-
Notifications
You must be signed in to change notification settings - Fork 3
feat(repo): add @uipath/flow-node-schema package #362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
nikhil-maryala
wants to merge
1
commit into
main
Choose a base branch
from
feat/flow-schema-package
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| name: Flow Node Schema Release | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - 'packages/flow-node-schema/**' | ||
| - '.github/workflows/flow-node-schema-release.yml' | ||
|
|
||
| env: | ||
| GH_NPM_REGISTRY_TOKEN: ${{ secrets.GH_NPM_REGISTRY_TOKEN }} | ||
| NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | ||
| TURBO_TELEMETRY_DISABLED: 1 | ||
| DO_NOT_TRACK: 1 | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }} | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| release: | ||
| name: Release @uipath/flow-node-schema | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| packages: write | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| token: ${{ secrets.RELEASE_TOKEN }} | ||
|
|
||
| - name: Setup pnpm | ||
| uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | ||
| with: | ||
| node-version: 22 | ||
| cache: 'pnpm' | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
|
|
||
| - name: Build flow-node-schema | ||
| run: pnpm --filter @uipath/flow-node-schema build | ||
|
|
||
| - name: Test flow-node-schema | ||
| run: pnpm --filter @uipath/flow-node-schema test | ||
|
|
||
| - name: Setup git user | ||
| run: | | ||
| git config --global user.name "semantic-release-bot" | ||
| git config --global user.email "semantic-release-bot@users.noreply.github.com" | ||
|
|
||
| - name: Release | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} | ||
| NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | ||
| NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | ||
| GH_NPM_REGISTRY_TOKEN: ${{ secrets.GH_NPM_REGISTRY_TOKEN }} | ||
| HUSKY: 0 | ||
| working-directory: packages/flow-node-schema | ||
| run: semantic-release | ||
|
|
||
| - name: Commit version bump | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} | ||
| run: | | ||
| if [ -n "$(git status --porcelain packages/flow-node-schema)" ]; then | ||
| git add packages/flow-node-schema/ | ||
| git commit -m "chore(release): @uipath/flow-node-schema version bump [skip ci]" | ||
|
|
||
| if ! git push; then | ||
| echo "::error::Failed to push version bump commit" | ||
| exit 1 | ||
| fi | ||
| echo "✓ Pushed version bump commit" | ||
| else | ||
| echo "No changes to commit" | ||
| fi | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 2 additions & 67 deletions
69
packages/apollo-react/src/canvas/schema/node-definition/category-manifest.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,67 +1,2 @@ | ||
| /** | ||
| * Category Manifest Schemas | ||
| * | ||
| * Zod schemas for category definitions. | ||
| * Supports arbitrary nesting using parent references. | ||
| * Nodes define their own category membership. | ||
| */ | ||
|
|
||
| import { z } from 'zod'; | ||
|
|
||
| /** | ||
| * Category manifest from server | ||
| * | ||
| * Categories form a hierarchy using parentId references: | ||
| * - { id: 'control-flow', parentId: null } (root) | ||
| * - { id: 'decision', parentId: 'control-flow' } (child) | ||
| * - { id: 'advanced', parentId: 'decision' } (grandchild) | ||
| * | ||
| * Nodes define which categories they belong to via category property. | ||
| * This allows: | ||
| * - Stable category IDs (reorganization just changes parentId) | ||
| * - Nodes control their own categorization | ||
| */ | ||
| export const categoryManifestSchema = z.object({ | ||
| /** | ||
| * Unique category identifier | ||
| * | ||
| * Should be stable by version. | ||
| * Examples: 'control-flow', 'decision', 'loops', 'advanced' | ||
| */ | ||
| id: z.string().min(1), | ||
|
|
||
| /** Human-readable category name */ | ||
| name: z.string().min(1), | ||
|
|
||
| /** | ||
| * Parent category ID for nesting | ||
| * | ||
| * - null or undefined: root category | ||
| * - string: ID of parent category | ||
| * | ||
| * Categories can be reorganized by changing this field without | ||
| * affecting node references or constraint definitions. | ||
| */ | ||
| parentId: z.string().optional(), | ||
|
|
||
| /** | ||
| * Sort order for display within the same parent level | ||
| * Categories at the same level are sorted by this value | ||
| */ | ||
| sortOrder: z.number().int().nonnegative(), | ||
|
|
||
| /** Light mode color/gradient */ | ||
| color: z.string().min(1), | ||
|
|
||
| /** Dark mode color/gradient */ | ||
| colorDark: z.string().min(1), | ||
|
|
||
| /** Icon identifier */ | ||
| icon: z.string().min(1), | ||
|
|
||
| /** Tags for search and filtering */ | ||
| tags: z.array(z.string()), | ||
| }); | ||
|
|
||
| // Export inferred type | ||
| export type CategoryManifest = z.infer<typeof categoryManifestSchema>; | ||
| export type { CategoryManifest } from '@uipath/flow-node-schema'; | ||
| export { categoryManifestSchema } from '@uipath/flow-node-schema'; |
142 changes: 2 additions & 140 deletions
142
packages/apollo-react/src/canvas/schema/node-definition/constraints.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,140 +1,2 @@ | ||
| /** | ||
| * Connection Constraints | ||
| * | ||
| * Defines semantic rules for valid connections between nodes and handles. | ||
| * Focus on workflow composition semantics, not just data types. | ||
| */ | ||
|
|
||
| import { z } from 'zod'; | ||
|
|
||
| /** | ||
| * Specific node and handle targeting | ||
| * Used for precise semantic constraints like "Agent Model can only connect to Agent node's 'model' handle" | ||
| */ | ||
| export const handleTargetSchema = z.object({ | ||
| /** | ||
| * Specific node type this can connect to | ||
| * Example: "uipath.agent" (exact match, no wildcards) | ||
| */ | ||
| nodeType: z.string(), | ||
|
|
||
| /** | ||
| * Specific handle ID on the target node | ||
| * Example: "model", "input", "configuration" | ||
| */ | ||
| handleId: z.string().optional(), | ||
| }); | ||
|
|
||
| /** | ||
| * Connection constraint configuration for a handle | ||
| */ | ||
| export const connectionConstraintSchema = z.object({ | ||
| /** | ||
| * Maximum number of connections allowed | ||
| * - 1: Single connection only | ||
| * - undefined: Unlimited connections | ||
| */ | ||
| maxConnections: z.number().int().positive().optional(), | ||
|
|
||
| /** | ||
| * Minimum number of connections required (for validation) | ||
| * Example: Trigger output must connect to at least 1 node | ||
| */ | ||
| minConnections: z.number().int().nonnegative().optional(), | ||
|
|
||
| /** | ||
| * WHITELIST: Allowed target nodes/handles (for source handles) | ||
| * If specified, this handle can ONLY connect to these specific targets | ||
| * | ||
| * Example: Agent Model output can only connect to Agent node's "model" handle | ||
| * ``` | ||
| * allowedTargets: [ | ||
| * { nodeType: "uipath.agent", handleId: "model" } | ||
| * ] | ||
| * ``` | ||
| */ | ||
| allowedTargets: z.array(handleTargetSchema).optional(), | ||
|
|
||
| /** | ||
| * BLACKLIST: Forbidden target nodes/handles (for source handles) | ||
| * If specified, this handle CANNOT connect to these targets | ||
| * | ||
| * Example: Control flow cannot connect to triggers | ||
| * ``` | ||
| * forbiddenTargets: [ | ||
| * { nodeType: "uipath.trigger.*" } | ||
| * ] | ||
| * ``` | ||
| */ | ||
| forbiddenTargets: z.array(handleTargetSchema).optional(), | ||
|
|
||
| /** | ||
| * WHITELIST: Allowed source nodes/handles (for target handles) | ||
| * If specified, this handle can ONLY accept connections from these sources | ||
| * | ||
| * Example: Agent's "model" handle can only accept Agent Model nodes | ||
| * ``` | ||
| * allowedSources: [ | ||
| * { nodeType: "uipath.ai.agent-model" } | ||
| * ] | ||
| * ``` | ||
| */ | ||
| allowedSources: z.array(handleTargetSchema).optional(), | ||
|
|
||
| /** | ||
| * BLACKLIST: Forbidden source nodes/handles (for target handles) | ||
| * If specified, this handle CANNOT accept connections from these sources | ||
| */ | ||
| forbiddenSources: z.array(handleTargetSchema).optional(), | ||
|
|
||
| /** | ||
| * Required target categories | ||
| * If specified, can only connect to nodes in these categories | ||
| * Example: ["agent", "data-and-tools"] | ||
| */ | ||
| allowedTargetCategories: z.array(z.string()).optional(), | ||
|
|
||
| /** | ||
| * Forbidden target categories | ||
| * If specified, cannot connect to nodes in these categories | ||
| * Example: ["control-flow", "trigger"] | ||
| */ | ||
| forbiddenTargetCategories: z.array(z.string()).optional(), | ||
|
|
||
| /** | ||
| * Required source categories (for target handles) | ||
| */ | ||
| allowedSourceCategories: z.array(z.string()).optional(), | ||
|
|
||
| /** | ||
| * Forbidden source categories (for target handles) | ||
| */ | ||
| forbiddenSourceCategories: z.array(z.string()).optional(), | ||
|
|
||
| /** | ||
| * Custom validation expression | ||
| * Template expression that must evaluate to true for connection to be valid | ||
| * Context: sourceNode, targetNode, sourceHandle, targetHandle | ||
| * Example: "{sourceNode.model.agentType === targetNode.model.agentType}" | ||
| */ | ||
| customValidation: z.string().optional(), | ||
|
|
||
| /** | ||
| * Error message to show when connection is invalid | ||
| * Supports template expressions | ||
| * Example: "Agent Model can only connect to Agent node's model handle" | ||
| */ | ||
| validationMessage: z.string().optional(), | ||
|
|
||
| /** | ||
| * Severity level for constraint violations | ||
| * Controls whether violations appear as errors or warnings | ||
| * - 'error' (default): Blocks execution/publish | ||
| * - 'warning': Shows advisory badge but doesn't block | ||
| */ | ||
| severity: z.enum(['warning', 'error', 'critical', 'info']).optional(), | ||
| }); | ||
|
|
||
| // Export inferred types | ||
| export type HandleTarget = z.infer<typeof handleTargetSchema>; | ||
| export type ConnectionConstraint = z.infer<typeof connectionConstraintSchema>; | ||
| export type { HandleTarget, ConnectionConstraint } from '@uipath/flow-node-schema'; | ||
| export { handleTargetSchema, connectionConstraintSchema } from '@uipath/flow-node-schema'; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we doing a separate pipeline for this? Should all work with the normal release pipeline