@uipath/packager-tool-flow 1.202.0-preview.141 → 1.202.0-preview.143

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.txt ADDED
@@ -0,0 +1,3 @@
1
+ © 2026 UiPath
2
+ Use of this product is subject (a) to the applicable licensing agreement available: https://www.uipath.com/legal/trust-and-security/legal-terms#content-1 and, (b) for paid products listed here https://licensing.uipath.com/: the licensing agreement agreed between you and UiPath.
3
+ (UiPath means UiPath SRL with headquarters at 4 Vasile Alecsandri Str. and 11 Constantin Daniel Str., Building A, floors 5 and 6, District 1, Bucharest 010639, Romania and UiPath Inc. with principal place of business: One Vanderbilt Avenue, 60th Floor, New York, NY 10017)
@@ -0,0 +1,8 @@
1
+ # Third-party notices for @uipath/packager-tool-flow
2
+
3
+ This package is distributed as a bundle: the dependencies below are
4
+ compiled into its `dist/` output rather than installed alongside it.
5
+ Their licences and copyright notices are reproduced here in full, as
6
+ those licences require.
7
+
8
+ No third-party code is bundled into this package.
package/dist/index.js CHANGED
@@ -32,14 +32,11 @@ import {
32
32
  // package.json
33
33
  var package_default = {
34
34
  name: "@uipath/packager-tool-flow",
35
- version: "1.202.0-preview.141",
35
+ version: "1.202.0-preview.143",
36
36
  description: "UiPath Flow tool implementation",
37
37
  type: "module",
38
38
  exports: {
39
- ".": {
40
- source: "./src/index.ts",
41
- default: "./dist/index.js"
42
- }
39
+ ".": "./dist/index.js"
43
40
  },
44
41
  repository: {
45
42
  type: "git",
@@ -68,11 +65,10 @@ var package_default = {
68
65
  lint: "biome check ."
69
66
  },
70
67
  files: [
71
- "dist",
72
- "src"
68
+ "dist"
73
69
  ],
74
70
  author: "",
75
- license: "ISC",
71
+ license: "SEE LICENSE IN LICENSE.txt",
76
72
  peerDependencies: {
77
73
  "@uipath/filesystem": "workspace:*",
78
74
  "@uipath/flow-converter": "0.55.0-develop",
@@ -984,4 +980,4 @@ export {
984
980
  voiceConvertOptions
985
981
  };
986
982
 
987
- //# debugId=ACCA89657F92EE1E64756E2164756E21
983
+ //# debugId=BB976B0E49EC023664756E2164756E21
package/package.json CHANGED
@@ -1,13 +1,10 @@
1
1
  {
2
2
  "name": "@uipath/packager-tool-flow",
3
- "version": "1.202.0-preview.141",
3
+ "version": "1.202.0-preview.143",
4
4
  "description": "UiPath Flow tool implementation",
5
5
  "type": "module",
6
6
  "exports": {
7
- ".": {
8
- "source": "./src/index.ts",
9
- "default": "./dist/index.js"
10
- }
7
+ ".": "./dist/index.js"
11
8
  },
12
9
  "repository": {
13
10
  "type": "git",
@@ -19,11 +16,10 @@
19
16
  },
20
17
  "types": "./dist/index.d.ts",
21
18
  "files": [
22
- "dist",
23
- "src"
19
+ "dist"
24
20
  ],
25
21
  "author": "",
26
- "license": "ISC",
22
+ "license": "SEE LICENSE IN LICENSE.txt",
27
23
  "peerDependencies": {
28
24
  "@uipath/filesystem": "1.202.0",
29
25
  "@uipath/flow-converter": "0.55.0-develop",
@@ -33,5 +29,5 @@
33
29
  "@uipath/solutionpackager-tool-core": "1.202.0",
34
30
  "@uipath/tool-agent": "^2.0.0"
35
31
  },
36
- "gitHead": "2c2b4b3b218f18c26db78eb8cd9ab8002d2b5290"
32
+ "gitHead": "23b5a7038ead7264439af18f8b807c7cc99a29d5"
37
33
  }
@@ -1,104 +0,0 @@
1
- /**
2
- * Encoding-agnostic readers for the inline-agent input encoding (MST-12020).
3
- *
4
- * flow-workbench writes inline-agent input names in one of two schemes, gated by its
5
- * `services.agent-storage.nested-agent-input-schema` feature flag:
6
- * - FLAT (shipped default): one top-level `inputSchema` property per input, `__`-joined
7
- * (`script1__output__query`), prompts read `{{input.script1__output__query}}`.
8
- * - NESTED (flag on): a nested object tree whose auto-created container nodes carry
9
- * `x-uipath-container: true`, prompts read `{{input.script1.output.query}}` (the runtime
10
- * template engine treats `.` as navigation).
11
- *
12
- * The CLI must read BOTH — an agent.json is whatever the authoring canvas last wrote — so these
13
- * helpers detect per file instead of consuming any flag. Detection is strictly the per-node
14
- * container marker: an object property WITHOUT the marker is a user-declared whole-object input
15
- * under either encoding and must be treated as one leaf, never unfolded.
16
- *
17
- * TODO: replace with flow-workbench's canonical helpers (`collectInlineAgentInputsFromAgent`,
18
- * `decodeFlatName`, `getContainerChildProps`) once they are re-exported from
19
- * `@uipath/flow-converter` — that package is the single source of truth for the encoding.
20
- */
21
-
22
- /** Marker flow-workbench stamps on auto-created container nodes of a NESTED inputSchema. */
23
- export const SCHEMA_CONTAINER_MARKER = "x-uipath-container";
24
-
25
- /** One bindable input leaf of an agent `inputSchema`, in both name forms. */
26
- export interface AgentInputLeaf {
27
- /** Flat `__`-joined name — what a flat prompt token / flat JobArgument uses. */
28
- flatKey: string;
29
- /** Canonical dotted path — what a nested prompt token navigates. */
30
- path: string;
31
- /** Declared `type` of the leaf node, when present. */
32
- type?: string;
33
- }
34
-
35
- const isRecord = (value: unknown): value is Record<string, unknown> =>
36
- typeof value === "object" && value !== null && !Array.isArray(value);
37
-
38
- /** Children of a MARKED container node; `undefined` for leaves and declared whole-object inputs. */
39
- function containerChildren(prop: unknown): Record<string, unknown> | undefined {
40
- if (!isRecord(prop)) return undefined;
41
- if (prop[SCHEMA_CONTAINER_MARKER] !== true) return undefined;
42
- const children = prop.properties;
43
- return isRecord(children) ? children : undefined;
44
- }
45
-
46
- /** Canonical dotted form of an input name from either encoding (`a__b` and `a.b` → `a.b`). */
47
- export function canonicalAgentInputPath(name: string): string {
48
- return name.split("__").join(".");
49
- }
50
-
51
- /**
52
- * Enumerate the bindable input leaves of an agent `inputSchema`, descending MARKED containers
53
- * (nested encoding) and passing flat / declared-object top-level keys through as single leaves.
54
- * Returns `[]` for an absent/empty/malformed schema.
55
- */
56
- export function collectAgentInputLeaves(
57
- inputSchema: unknown,
58
- ): AgentInputLeaf[] {
59
- const properties = isRecord(inputSchema)
60
- ? inputSchema.properties
61
- : undefined;
62
- if (!isRecord(properties)) return [];
63
-
64
- const leaves: AgentInputLeaf[] = [];
65
- const walk = (prop: unknown, segments: string[]): void => {
66
- const children = containerChildren(prop);
67
- if (!children) {
68
- // Flat keys already carry their whole path in one segment; keep the
69
- // stored spelling for flatKey and canonicalize for the dotted path.
70
- const flatKey = segments.join("__");
71
- leaves.push({
72
- flatKey,
73
- path: canonicalAgentInputPath(segments.join(".")),
74
- type:
75
- isRecord(prop) && typeof prop.type === "string"
76
- ? prop.type
77
- : undefined,
78
- });
79
- return;
80
- }
81
- for (const [key, child] of Object.entries(children)) {
82
- walk(child, [...segments, key]);
83
- }
84
- };
85
- for (const [key, prop] of Object.entries(properties)) {
86
- walk(prop, [key]);
87
- }
88
- return leaves;
89
- }
90
-
91
- /**
92
- * Source binding expression for one input leaf — the inverse of flow-workbench's encode:
93
- * a `metadata`-rooted path binds `$metadata.*`; everything else binds `$vars.*`.
94
- */
95
- export function leafToBinding(leaf: AgentInputLeaf): string {
96
- const segments = leaf.path.split(".");
97
- if (segments[0] === "metadata") {
98
- // A whole-object `metadata` leaf (unmarked object) has no trailing
99
- // segments — bind the root `$metadata`, not an invalid `$metadata.`.
100
- const rest = segments.slice(1).join(".");
101
- return rest ? `=$metadata.${rest}` : "=$metadata";
102
- }
103
- return `=$vars.${leaf.path}`;
104
- }
package/src/agents.ts DELETED
@@ -1,143 +0,0 @@
1
- import {
2
- healResourceInputEncoding,
3
- normalizeAgentInputEncoding,
4
- } from "@uipath/flow-converter";
5
- import type {
6
- IFileSystem,
7
- IToolLogger,
8
- } from "@uipath/solutionpackager-tool-core";
9
- import { Path } from "@uipath/solutionpackager-tool-core";
10
- import { type AgentBuildResult, buildAgent } from "@uipath/tool-agent/build";
11
- import { mergeAgentBindings, toBindingsResources } from "./bindings.js";
12
-
13
- export interface InlineAgentContract {
14
- agentJson: Record<string, unknown>;
15
- bindingsJson: {
16
- version: string;
17
- resources: Record<string, unknown>[];
18
- };
19
- }
20
-
21
- /**
22
- * Build the execution contract for one inline agent with the same migration,
23
- * validation, and binding pipeline used by normal solution packaging. The
24
- * returned `agentJson` is healed to the flat input encoding (MST-12020) — see
25
- * {@link healAgentInputEncoding}.
26
- */
27
- export async function buildInlineAgentContract(config: {
28
- fileSystem: IFileSystem;
29
- logger: IToolLogger;
30
- projectPath: string;
31
- outputPath: string;
32
- }): Promise<InlineAgentContract> {
33
- const built = await buildAgent({
34
- ...config,
35
- options: { writeBindings: false },
36
- });
37
-
38
- return {
39
- agentJson: healAgentInputEncoding(
40
- built.agent as Record<string, unknown>,
41
- ),
42
- bindingsJson: {
43
- version: built.bindings.version,
44
- resources: built.bindings.resources as unknown as Record<
45
- string,
46
- unknown
47
- >[],
48
- },
49
- };
50
- }
51
-
52
- /**
53
- * Normalize a built inline-agent contract to the FLAT input encoding (MST-12020) —
54
- * the one heal every packaging path shares.
55
- *
56
- * The sidecar `agent.json` is whatever the authoring canvas last wrote: flat `__`
57
- * names, or — behind flow-workbench's `nested-agent-input-schema` flag — a nested
58
- * `x-uipath-container` tree with dotted prompt tokens. Flattens both halves: prompts
59
- * + `inputSchema` via the agent heal, and each embedded resource's `argumentPath`
60
- * via the resource heal. Applied by `buildInlineAgentContract` (flow-tool's
61
- * `flow pack`/`publish`) and by `processAgents` (solution packaging). Defaults to
62
- * 'flat', idempotent.
63
- */
64
- function healAgentInputEncoding(
65
- agent: Record<string, unknown>,
66
- ): Record<string, unknown> {
67
- const normalized = normalizeAgentInputEncoding(agent);
68
- const rawResources = normalized.resources;
69
- const resources = Array.isArray(rawResources)
70
- ? rawResources.map((resource) =>
71
- resource &&
72
- typeof resource === "object" &&
73
- !Array.isArray(resource)
74
- ? healResourceInputEncoding(
75
- resource as Record<string, unknown>,
76
- )
77
- : resource,
78
- )
79
- : rawResources;
80
- return { ...normalized, resources };
81
- }
82
-
83
- /**
84
- * Build every root-level agent directory into the content folder and merge
85
- * their binding resources. Returns each built agent.json keyed by its
86
- * directory name (the source UUID).
87
- */
88
- export const processAgents = async (
89
- fileSystem: IFileSystem,
90
- logger: IToolLogger,
91
- projectPath: string,
92
- contentFolder: string,
93
- ): Promise<Map<string, Record<string, unknown>>> => {
94
- const agentResults: AgentBuildResult[] = [];
95
- const builtAgents = new Map<string, Record<string, unknown>>();
96
-
97
- const entries = await fileSystem.readdir(projectPath);
98
- for (const entry of entries) {
99
- const sourceDir = Path.join(projectPath, entry);
100
- const stat = await fileSystem.stat(sourceDir);
101
- if (!stat?.isDirectory()) {
102
- continue;
103
- }
104
-
105
- const agentJsonPath = Path.join(sourceDir, "agent.json");
106
- if (!(await fileSystem.exists(agentJsonPath))) {
107
- continue;
108
- }
109
-
110
- const outputDir = Path.join(contentFolder, entry);
111
- logger.progress(`Processing agent: ${entry}...`);
112
-
113
- const result = await buildAgent({
114
- fileSystem,
115
- projectPath: sourceDir,
116
- outputPath: outputDir,
117
- logger,
118
- });
119
- // buildAgent wrote the sidecar's encoding verbatim; normalize the deploy
120
- // artifact to flat (MST-12020), matching `flow pack` / `publish`.
121
- let agentJson = result.agent as Record<string, unknown>;
122
- if (agentJson) {
123
- agentJson = healAgentInputEncoding(agentJson);
124
- await fileSystem.writeFile(
125
- Path.join(outputDir, "agent.json"),
126
- JSON.stringify(agentJson, null, 2),
127
- );
128
- }
129
- agentResults.push(result);
130
- builtAgents.set(entry, agentJson);
131
- }
132
-
133
- const agentBindingResources = agentResults.flatMap(toBindingsResources);
134
- if (agentBindingResources.length > 0) {
135
- await mergeAgentBindings(
136
- fileSystem,
137
- contentFolder,
138
- agentBindingResources,
139
- );
140
- }
141
-
142
- return builtAgents;
143
- };
package/src/bindings.ts DELETED
@@ -1,64 +0,0 @@
1
- import type { IFileSystem } from "@uipath/solutionpackager-tool-core";
2
- import { Path } from "@uipath/solutionpackager-tool-core";
3
- import type { AgentBuildResult } from "@uipath/tool-agent/build";
4
-
5
- export interface BindingsResource {
6
- resource: string;
7
- key: string;
8
- [other: string]: unknown;
9
- }
10
-
11
- export interface Bindings {
12
- version: string;
13
- resources: BindingsResource[];
14
- }
15
-
16
- const BINDINGS_V2_FILE_NAME = "bindings_v2.json";
17
-
18
- export const toBindingsResources = (
19
- result: AgentBuildResult,
20
- ): BindingsResource[] => result.bindings.resources.map((r) => ({ ...r }));
21
-
22
- /**
23
- * Merge agent binding resources into the flow's bindings_v2.json.
24
- * Deduplicates by (resource, key) tuple, keeping the first occurrence.
25
- */
26
- export const mergeAgentBindings = async (
27
- fileSystem: IFileSystem,
28
- contentFolder: string,
29
- agentBindingResources: BindingsResource[],
30
- ): Promise<void> => {
31
- const bindingsPath = Path.join(contentFolder, BINDINGS_V2_FILE_NAME);
32
-
33
- let existing: Bindings = { version: "2.0", resources: [] };
34
-
35
- const bindingsExists = await fileSystem.exists(bindingsPath);
36
- if (bindingsExists) {
37
- const content = await fileSystem.readFile(bindingsPath);
38
- if (content) {
39
- try {
40
- const parsed = JSON.parse(new TextDecoder().decode(content));
41
- if (Array.isArray(parsed?.resources)) {
42
- existing = parsed;
43
- }
44
- } catch {
45
- // Invalid JSON, start fresh
46
- }
47
- }
48
- }
49
-
50
- const dedupKey = (b: BindingsResource) =>
51
- JSON.stringify([b.resource, b.key]);
52
-
53
- const seen = new Set(existing.resources.map(dedupKey));
54
-
55
- for (const binding of agentBindingResources) {
56
- const key = dedupKey(binding);
57
- if (!seen.has(key)) {
58
- seen.add(key);
59
- existing.resources.push(binding);
60
- }
61
- }
62
-
63
- await fileSystem.writeFile(bindingsPath, JSON.stringify(existing, null, 2));
64
- };