@uipath/maestro-builder-sdk 6.16.4 → 6.16.6
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/dist/api-index.md +99 -99
- package/dist/api-members.md +255 -255
- package/dist/bpmn/check-cli.js +2 -2
- package/dist/bpmn/compile-cli.js +3 -7
- package/dist/bpmn/connector.js +1 -2
- package/dist/bpmn/decompile-cli.js +4 -8
- package/dist/bpmn/merge-cli.js +3 -7
- package/dist/bpmn/tidy-cli.js +2 -6
- package/dist/case/compile-cli.js +3 -7
- package/dist/case/decompile-cli.js +4 -8
- package/dist/case/merge-cli.js +2 -6
- package/dist/case/serialize.js +1 -1
- package/dist/check.js +13 -27
- package/dist/cli-library.d.ts +1 -1
- package/dist/cli-library.js +1 -1
- package/dist/cli-run.d.ts +2 -0
- package/dist/cli-run.js +5 -0
- package/dist/compile-cli.js +3 -7
- package/dist/config.d.ts +0 -8
- package/dist/config.js +1 -10
- package/dist/core/actions.d.ts +19 -4
- package/dist/core/cli-library.d.ts +0 -2
- package/dist/core/cli-library.js +1 -5
- package/dist/core/connector-inputs.d.ts +8 -0
- package/dist/core/connector-inputs.js +11 -16
- package/dist/core/edit-distance.d.ts +10 -0
- package/dist/core/edit-distance.js +20 -0
- package/dist/core/library.js +1 -12
- package/dist/decompile-cli.js +3 -7
- package/dist/decompile.js +63 -30
- package/dist/merge-cli.js +3 -7
- package/dist/registry/prepare/actions.js +1 -12
- package/dist/serialize.js +20 -24
- package/package.json +2 -2
package/dist/bpmn/check-cli.js
CHANGED
|
@@ -16,8 +16,8 @@ import { resolveBpmnFile, loadBuiltBpmn } from './load.js';
|
|
|
16
16
|
import { check } from './check.js';
|
|
17
17
|
import { graphModel, renderGraph } from './graph.js';
|
|
18
18
|
import { Bindings } from '../core/bindings.js';
|
|
19
|
-
import { connectorCheckOpts,
|
|
20
|
-
import { runWhenInvokedDirectly } from '../cli-run.js';
|
|
19
|
+
import { connectorCheckOpts, openCliLibrary } from '../core/cli-library.js';
|
|
20
|
+
import { flagValue, runWhenInvokedDirectly } from '../cli-run.js';
|
|
21
21
|
import { ensureTypeScriptRuntime } from '../node-runtime.js';
|
|
22
22
|
/** Flags that take a value — their argument is never the source positional. */
|
|
23
23
|
const VALUE_FLAGS = new Set(['--library', '--connectors-local', '--bindings']);
|
package/dist/bpmn/compile-cli.js
CHANGED
|
@@ -23,13 +23,9 @@ import { serialize } from './serialize.js';
|
|
|
23
23
|
import { check } from './check.js';
|
|
24
24
|
import { Bindings } from '../core/bindings.js';
|
|
25
25
|
import { connectorCheckOpts, openCliLibrary } from '../core/cli-library.js';
|
|
26
|
-
import { runWhenInvokedDirectly } from '../cli-run.js';
|
|
26
|
+
import { flagValue, runWhenInvokedDirectly } from '../cli-run.js';
|
|
27
27
|
import { ensureTypeScriptRuntime } from '../node-runtime.js';
|
|
28
28
|
import { defaultBindingsFile } from '../workdir.js';
|
|
29
|
-
function opt(argv, name) {
|
|
30
|
-
const i = argv.indexOf(name);
|
|
31
|
-
return i >= 0 ? argv[i + 1] : undefined;
|
|
32
|
-
}
|
|
33
29
|
export async function run(argv) {
|
|
34
30
|
if (argv.length === 0 || argv[0] === '-h' || argv[0] === '--help') {
|
|
35
31
|
console.error('usage: compile <bpmn.ts | BaseName> [-o out.bpmn] [--library <dir>] [--connectors-local <dir>] [--bindings <file>]');
|
|
@@ -50,7 +46,7 @@ export async function run(argv) {
|
|
|
50
46
|
// without it, so a prepare resolved an operation against the live connection,
|
|
51
47
|
// wrote the overlay, and compile ignored it.
|
|
52
48
|
const library = openCliLibrary(argv);
|
|
53
|
-
const bindFile =
|
|
49
|
+
const bindFile = flagValue(argv, '--bindings') ?? defaultBindingsFile();
|
|
54
50
|
const bindings = new Bindings(bindFile);
|
|
55
51
|
// The same facts `check-cli` runs on, from the instance about to serialize:
|
|
56
52
|
// the inner loop and the emit rung must not disagree about a field or a
|
|
@@ -64,7 +60,7 @@ export async function run(argv) {
|
|
|
64
60
|
}
|
|
65
61
|
const xml = await serialize(built, { library, bindings });
|
|
66
62
|
const base = basename(file).replace(/\.bpmn\.ts$|\.ts$/, '');
|
|
67
|
-
const out =
|
|
63
|
+
const out = flagValue(argv, '-o') ?? `${base}.bpmn`;
|
|
68
64
|
writeFileSync(out, xml);
|
|
69
65
|
console.log(`compile: wrote ${out} (${built.nodes.length} element(s))`);
|
|
70
66
|
reportResult({ path: resolve(out), elements: built.nodes.length });
|
package/dist/bpmn/connector.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { connectorOutputVars } from './bpmn-sdk.js';
|
|
2
|
-
import { transportHttpMethod } from '../config.js';
|
|
3
2
|
import { EQUALS_EXPR_DIALECT } from '../core/connector-checks.js';
|
|
4
|
-
import { buildConnectorInputs, nestConnectorBody } from '../core/connector-inputs.js';
|
|
3
|
+
import { buildConnectorInputs, nestConnectorBody, transportHttpMethod } from '../core/connector-inputs.js';
|
|
5
4
|
export function createConnectorTask(ctx, n) {
|
|
6
5
|
const { m } = ctx;
|
|
7
6
|
if (!ctx.library)
|
|
@@ -26,15 +26,11 @@ import { typeStripDecision } from '../node-runtime.js';
|
|
|
26
26
|
import { readFileSync } from 'node:fs';
|
|
27
27
|
import { basename, resolve } from 'node:path';
|
|
28
28
|
import { defaultSourceOut, writeSource } from '../workdir.js';
|
|
29
|
-
import { runWhenInvokedDirectly } from '../cli-run.js';
|
|
29
|
+
import { flagValue, runWhenInvokedDirectly } from '../cli-run.js';
|
|
30
30
|
import { decompile } from './decompile.js';
|
|
31
31
|
import { sameGraph } from './lift-verify.js';
|
|
32
32
|
import { BPMN_IMPORT } from '../package-name.js';
|
|
33
33
|
import { fileURLToPath } from 'node:url';
|
|
34
|
-
function opt(argv, name) {
|
|
35
|
-
const i = argv.indexOf(name);
|
|
36
|
-
return i >= 0 ? argv[i + 1] : undefined;
|
|
37
|
-
}
|
|
38
34
|
/**
|
|
39
35
|
* `run(argv)` is the tool contract the family-first `flow-sdk` CLI loads. It must
|
|
40
36
|
* NOT read `process.argv`: under the unified CLI that still holds
|
|
@@ -45,7 +41,7 @@ export async function run(argv) {
|
|
|
45
41
|
console.error('usage: decompile <Name.bpmn> [-o Name.bpmn.ts] [--import <specifier>] [--style explicit|nested] [--keep-flow-ids] [--keep-unused-bindings]');
|
|
46
42
|
return 2;
|
|
47
43
|
}
|
|
48
|
-
const style =
|
|
44
|
+
const style = flagValue(argv, '--style') ?? 'explicit';
|
|
49
45
|
if (style !== 'explicit' && style !== 'nested') {
|
|
50
46
|
console.error(`decompile: --style must be explicit or nested, not "${style}"`);
|
|
51
47
|
return 2;
|
|
@@ -76,7 +72,7 @@ export async function run(argv) {
|
|
|
76
72
|
return 2;
|
|
77
73
|
}
|
|
78
74
|
const xml = readFileSync(input, 'utf8');
|
|
79
|
-
const importSpecifier =
|
|
75
|
+
const importSpecifier = flagValue(argv, '--import') ?? BPMN_IMPORT;
|
|
80
76
|
let pruned = [];
|
|
81
77
|
const base0 = { importSpecifier, keepUnusedBindings, onPrune: (ids) => (pruned = ids) };
|
|
82
78
|
let source = await decompile(xml, base0);
|
|
@@ -103,7 +99,7 @@ export async function run(argv) {
|
|
|
103
99
|
}
|
|
104
100
|
}
|
|
105
101
|
const base = basename(input).replace(/\.bpmn$/, '');
|
|
106
|
-
const out =
|
|
102
|
+
const out = flagValue(argv, '-o') ?? defaultSourceOut(`${base}.bpmn.ts`);
|
|
107
103
|
writeSource(out, source);
|
|
108
104
|
console.log(`decompile: wrote ${out}`);
|
|
109
105
|
if (pruned.length) {
|
package/dist/bpmn/merge-cli.js
CHANGED
|
@@ -14,11 +14,7 @@ import { reportResult } from '../cli-result.js';
|
|
|
14
14
|
import { readFileSync, writeFileSync } from 'node:fs';
|
|
15
15
|
import { basename, resolve } from 'node:path';
|
|
16
16
|
import { mergeBpmn } from './merge.js';
|
|
17
|
-
import { runWhenInvokedDirectly } from '../cli-run.js';
|
|
18
|
-
function opt(argv, name) {
|
|
19
|
-
const i = argv.indexOf(name);
|
|
20
|
-
return i >= 0 ? argv[i + 1] : undefined;
|
|
21
|
-
}
|
|
17
|
+
import { flagValue, runWhenInvokedDirectly } from '../cli-run.js';
|
|
22
18
|
export function run(argv) {
|
|
23
19
|
if (argv.length === 0 || argv[0] === '-h' || argv[0] === '--help') {
|
|
24
20
|
console.error('usage: bpmn-merge <original.bpmn> <edited.bpmn> [-o merged.bpmn] [--baseline <baseline.bpmn>]');
|
|
@@ -31,11 +27,11 @@ export function run(argv) {
|
|
|
31
27
|
console.error('bpmn-merge: need <original.bpmn> and <edited.bpmn>');
|
|
32
28
|
return 2;
|
|
33
29
|
}
|
|
34
|
-
const baselinePath =
|
|
30
|
+
const baselinePath = flagValue(argv, '--baseline');
|
|
35
31
|
const result = mergeBpmn(readFileSync(originalPath, 'utf8'), readFileSync(editedPath, 'utf8'), {
|
|
36
32
|
...(baselinePath ? { baseline: readFileSync(baselinePath, 'utf8') } : {}),
|
|
37
33
|
});
|
|
38
|
-
const out =
|
|
34
|
+
const out = flagValue(argv, '-o') ?? 'merged.bpmn';
|
|
39
35
|
writeFileSync(out, result.xml);
|
|
40
36
|
reportResult({ path: resolve(out), preserved: result.preserved.length, authored: result.authored.length, removed: result.removed.length });
|
|
41
37
|
// Say what was kept and what was rewritten: on a surgical edit the preserved count
|
package/dist/bpmn/tidy-cli.js
CHANGED
|
@@ -15,11 +15,7 @@ import { reportResult } from '../cli-result.js';
|
|
|
15
15
|
import { readFileSync, writeFileSync } from 'node:fs';
|
|
16
16
|
import { layoutProcess } from 'bpmn-auto-layout';
|
|
17
17
|
import { finalizeBpmnXml } from './serialize.js';
|
|
18
|
-
import { runWhenInvokedDirectly } from '../cli-run.js';
|
|
19
|
-
function opt(argv, name) {
|
|
20
|
-
const i = argv.indexOf(name);
|
|
21
|
-
return i >= 0 ? argv[i + 1] : undefined;
|
|
22
|
-
}
|
|
18
|
+
import { flagValue, runWhenInvokedDirectly } from '../cli-run.js';
|
|
23
19
|
export async function run(argv) {
|
|
24
20
|
if (argv.length === 0 || argv[0] === '-h' || argv[0] === '--help') {
|
|
25
21
|
console.error('usage: tidy <file.bpmn> [-o out.bpmn]');
|
|
@@ -32,7 +28,7 @@ export async function run(argv) {
|
|
|
32
28
|
return 2;
|
|
33
29
|
}
|
|
34
30
|
const laidOut = finalizeBpmnXml(await layoutProcess(readFileSync(input, 'utf8')));
|
|
35
|
-
const out =
|
|
31
|
+
const out = flagValue(argv, '-o') ?? input;
|
|
36
32
|
writeFileSync(out, laidOut.endsWith('\n') ? laidOut : laidOut + '\n');
|
|
37
33
|
const shapes = (laidOut.match(/BPMNShape/g) ?? []).length;
|
|
38
34
|
console.log(`tidy: laid out ${out} (${shapes} shape(s))`);
|
package/dist/case/compile-cli.js
CHANGED
|
@@ -20,13 +20,9 @@ import { entryPointIO } from './entry-points.js';
|
|
|
20
20
|
import { Bindings } from '../core/bindings.js';
|
|
21
21
|
import { openCliLibrary } from '../core/cli-library.js';
|
|
22
22
|
import { defaultBindingsFile } from '../workdir.js';
|
|
23
|
-
import { runWhenInvokedDirectly } from '../cli-run.js';
|
|
23
|
+
import { flagValue, runWhenInvokedDirectly } from '../cli-run.js';
|
|
24
24
|
import { ensureTypeScriptRuntime } from '../node-runtime.js';
|
|
25
25
|
import { CASE_FORMAT_PROFILE } from './format-profile.js';
|
|
26
|
-
function opt(argv, name) {
|
|
27
|
-
const i = argv.indexOf(name);
|
|
28
|
-
return i >= 0 ? argv[i + 1] : undefined;
|
|
29
|
-
}
|
|
30
26
|
export async function run(argv) {
|
|
31
27
|
if (argv.length === 0 || argv[0] === '-h' || argv[0] === '--help') {
|
|
32
28
|
console.error('usage: compile <case.ts | BaseName> [-o caseplan.json]');
|
|
@@ -57,10 +53,10 @@ export async function run(argv) {
|
|
|
57
53
|
// also auto-detects the `connectors-local/` overlay `registry prepare` writes,
|
|
58
54
|
// which is what the three copies of these lines used to each decide for itself.
|
|
59
55
|
const library = openCliLibrary(argv);
|
|
60
|
-
const bindFile =
|
|
56
|
+
const bindFile = flagValue(argv, '--bindings') ?? defaultBindingsFile();
|
|
61
57
|
const bindings = new Bindings(bindFile);
|
|
62
58
|
const caseplan = serialize(built, { library, bindings });
|
|
63
|
-
const out =
|
|
59
|
+
const out = flagValue(argv, '-o') ?? 'caseplan.json';
|
|
64
60
|
writeFileSync(out, JSON.stringify(caseplan, null, 2) + '\n');
|
|
65
61
|
const stages = caseplan.nodes.filter((n) => String(n.type).endsWith('Stage')).length;
|
|
66
62
|
const triggers = syncEntryPoints(caseplan, out);
|
|
@@ -20,14 +20,10 @@ import { mkdirSync, existsSync, readFileSync, writeFileSync } from 'node:fs';
|
|
|
20
20
|
import { resolveLibraryDir } from '../registry/cache.js';
|
|
21
21
|
import { basename, join, resolve } from 'node:path';
|
|
22
22
|
import { defaultSourceOut, workDirBeside, writeSource } from '../workdir.js';
|
|
23
|
-
import { runWhenInvokedDirectly } from '../cli-run.js';
|
|
23
|
+
import { flagValue, runWhenInvokedDirectly } from '../cli-run.js';
|
|
24
24
|
import { Library } from '../core/library.js';
|
|
25
25
|
import { decompileWithDiagnostics } from './decompile.js';
|
|
26
26
|
import { CASE_IMPORT } from '../package-name.js';
|
|
27
|
-
function opt(argv, name) {
|
|
28
|
-
const i = argv.indexOf(name);
|
|
29
|
-
return i >= 0 ? argv[i + 1] : undefined;
|
|
30
|
-
}
|
|
31
27
|
/** Derive a PascalCase base name from the case name for the default output file. */
|
|
32
28
|
function baseName(plan) {
|
|
33
29
|
const src = plan.name ?? plan.id ?? 'Case';
|
|
@@ -56,16 +52,16 @@ export function run(argv) {
|
|
|
56
52
|
return 2;
|
|
57
53
|
}
|
|
58
54
|
const plan = JSON.parse(readFileSync(pos, 'utf8'));
|
|
59
|
-
const libraryDir = resolveLibraryDir(
|
|
55
|
+
const libraryDir = resolveLibraryDir(flagValue(argv, '--library'));
|
|
60
56
|
const library = libraryDir && existsSync(`${libraryDir}/index.json`) ? new Library(libraryDir) : undefined;
|
|
61
|
-
const importSpecifier =
|
|
57
|
+
const importSpecifier = flagValue(argv, '--import') ?? CASE_IMPORT;
|
|
62
58
|
const bestEffort = argv.includes('--best-effort');
|
|
63
59
|
const result = decompileWithDiagnostics(plan, {
|
|
64
60
|
importSpecifier,
|
|
65
61
|
library,
|
|
66
62
|
bestEffort,
|
|
67
63
|
});
|
|
68
|
-
const out =
|
|
64
|
+
const out = flagValue(argv, '-o') ?? defaultSourceOut(`${baseName(plan)}.case.ts`);
|
|
69
65
|
writeSource(out, result.source);
|
|
70
66
|
console.log(`decompile: wrote ${basename(out)}`);
|
|
71
67
|
reportResult({ path: resolve(out), diagnostics: result.diagnostics.map((d) => ({ code: d.code, location: d.location, message: d.message })) });
|
package/dist/case/merge-cli.js
CHANGED
|
@@ -13,11 +13,7 @@ import { reportResult } from '../cli-result.js';
|
|
|
13
13
|
import { readFileSync, writeFileSync } from 'node:fs';
|
|
14
14
|
import { basename, resolve } from 'node:path';
|
|
15
15
|
import { mergeCase } from './merge.js';
|
|
16
|
-
import { runWhenInvokedDirectly } from '../cli-run.js';
|
|
17
|
-
function opt(argv, name) {
|
|
18
|
-
const i = argv.indexOf(name);
|
|
19
|
-
return i >= 0 ? argv[i + 1] : undefined;
|
|
20
|
-
}
|
|
16
|
+
import { flagValue, runWhenInvokedDirectly } from '../cli-run.js';
|
|
21
17
|
export function run(argv) {
|
|
22
18
|
if (argv.length === 0 || argv[0] === '-h' || argv[0] === '--help') {
|
|
23
19
|
console.error('usage: case-merge <original.json> <edited.json> [-o merged.json]');
|
|
@@ -35,7 +31,7 @@ export function run(argv) {
|
|
|
35
31
|
const merged = mergeCase(original, edited, {
|
|
36
32
|
warn: (message) => console.error(`case-merge: warning: ${message}`),
|
|
37
33
|
});
|
|
38
|
-
const out =
|
|
34
|
+
const out = flagValue(argv, '-o') ?? 'merged.caseplan.json';
|
|
39
35
|
writeFileSync(out, JSON.stringify(merged, null, 2) + '\n');
|
|
40
36
|
const stages = (merged.nodes ?? [])
|
|
41
37
|
.filter((node) => String(node.type ?? '').endsWith('Stage')).length;
|
package/dist/case/serialize.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* name) are resolved here to the generated ids.
|
|
10
10
|
*/
|
|
11
11
|
import { IdGen } from './ids.js';
|
|
12
|
-
import { transportHttpMethod } from '../
|
|
12
|
+
import { transportHttpMethod } from '../core/connector-inputs.js';
|
|
13
13
|
import { refuseLookupToken } from '../core/lookups.js';
|
|
14
14
|
import { CASE_FORMAT_PROFILE, CASE_SCHEMA_VERSIONS } from './format-profile.js';
|
|
15
15
|
import { resolveSchemaVersion } from '../schema-version.js';
|
package/dist/check.js
CHANGED
|
@@ -11,6 +11,7 @@ import { QUEUE_ITEM_RECORD_SCHEMA } from './core/queue-record.js';
|
|
|
11
11
|
import { checkEventResolution, checkEventSubscription, eventParamsFor, } from './core/event-checks.js';
|
|
12
12
|
import { FLOW_EXPR_DIALECT, checkBindingLabels, checkBindingPresence, checkConnectorContract as coreCheckConnectorContract, checkConnectorLookups as coreCheckConnectorLookups, checkConnectorSchema as coreCheckConnectorSchema, collectConnectionUses, connectionConnectorConflicts, } from './core/connector-checks.js';
|
|
13
13
|
import { prepareCommand } from './core/cli-spelling.js';
|
|
14
|
+
import { editDistance } from './core/edit-distance.js';
|
|
14
15
|
import { isAnswerField } from './core/hitl-answers.js';
|
|
15
16
|
import { hitlDerivesOutcomeHandles, hitlExitModel, hitlRoutesPerOutcome } from './core/hitl-routing.js';
|
|
16
17
|
import { childStepLists, declaredExits, hasExits, stopsAtEnd } from './core/step-ports.js';
|
|
@@ -1394,20 +1395,6 @@ function nearestName(name, candidates) {
|
|
|
1394
1395
|
}
|
|
1395
1396
|
return best;
|
|
1396
1397
|
}
|
|
1397
|
-
/** Levenshtein distance, capped by the caller's threshold (names are short). */
|
|
1398
|
-
function editDistance(a, b) {
|
|
1399
|
-
const prev = new Array(b.length + 1).fill(0).map((_, j) => j);
|
|
1400
|
-
for (let i = 1; i <= a.length; i++) {
|
|
1401
|
-
let diag = prev[0];
|
|
1402
|
-
prev[0] = i;
|
|
1403
|
-
for (let j = 1; j <= b.length; j++) {
|
|
1404
|
-
const tmp = prev[j];
|
|
1405
|
-
prev[j] = Math.min(prev[j] + 1, prev[j - 1] + 1, diag + (a[i - 1] === b[j - 1] ? 0 : 1));
|
|
1406
|
-
diag = tmp;
|
|
1407
|
-
}
|
|
1408
|
-
}
|
|
1409
|
-
return prev[b.length];
|
|
1410
|
-
}
|
|
1411
1398
|
/**
|
|
1412
1399
|
* Diagnose a `subflow` step: the child flow itself, and the parent→child
|
|
1413
1400
|
* binding.
|
|
@@ -3206,14 +3193,14 @@ function checkInlineAgent(step, inputs, diags, opts = {}) {
|
|
|
3206
3193
|
: `inputs: { ${undeclared[0]}: input('${undeclared[0]}') }`);
|
|
3207
3194
|
}
|
|
3208
3195
|
// Direction 3: an input bound to a COMPUTED EXPRESSION rather than to one
|
|
3209
|
-
// reference. The platform names an agent's arguments
|
|
3210
|
-
//
|
|
3211
|
-
// several references has no single argument —
|
|
3212
|
-
// `{{input.<x>}}` token could address.
|
|
3213
|
-
//
|
|
3214
|
-
//
|
|
3215
|
-
//
|
|
3216
|
-
//
|
|
3196
|
+
// reference. The platform names each of an agent's arguments after the
|
|
3197
|
+
// reference path it is bound to (the shell node's `agentInputVariables`), so
|
|
3198
|
+
// an expression spanning zero or several references has no single argument —
|
|
3199
|
+
// and therefore no name a `{{input.<x>}}` token could address. The compiler
|
|
3200
|
+
// declares no argument for it, so its value does not reach the agent, and the
|
|
3201
|
+
// placeholder reaches the model as literal text. An error rather than a
|
|
3202
|
+
// warning, and for the same reason `INLINE_AGENT_UNDECLARED_PLACEHOLDER` is
|
|
3203
|
+
// one: the value never arrives.
|
|
3217
3204
|
for (const [name, val] of Object.entries(inputs?.inputs ?? {})) {
|
|
3218
3205
|
if (!(val instanceof Expr) || val.literal)
|
|
3219
3206
|
continue;
|
|
@@ -3223,11 +3210,10 @@ function checkInlineAgent(step, inputs, diags, opts = {}) {
|
|
|
3223
3210
|
continue;
|
|
3224
3211
|
at('INLINE_AGENT_COMPOSITE_INPUT', `Inline agent step "${step}"'s input \`${name}\` is bound to a computed expression `
|
|
3225
3212
|
+ `(\`${val.js.length > 60 ? `${val.js.slice(0, 60)}…` : val.js}\`), and a prompt references it as `
|
|
3226
|
-
+ `\`{{input.${name}}}\`. The platform does not send the agent the names you declared: it
|
|
3227
|
-
+ `
|
|
3228
|
-
+ `
|
|
3229
|
-
+ `
|
|
3230
|
-
+ `that literal text.`, `compute it in a script step first, then bind the step's output: `
|
|
3213
|
+
+ `\`{{input.${name}}}\`. The platform does not send the agent the names you declared: it names each `
|
|
3214
|
+
+ `argument after the REFERENCE PATH the input is bound to (\`$vars.a.output.b\` → \`a__output__b\`). `
|
|
3215
|
+
+ `A computed expression is not one reference, so it gets no argument: its value does not reach the `
|
|
3216
|
+
+ `agent, and the placeholder reaches the model as that literal text.`, `compute it in a script step first, then bind the step's output: `
|
|
3231
3217
|
+ `.step('${name}Value', script({ code: 'return …;' })) … inputs: { ${name}: out('${name}Value') }`);
|
|
3232
3218
|
}
|
|
3233
3219
|
// A step id containing `__` makes the flat name AMBIGUOUS on the platform: the
|
package/dist/cli-library.d.ts
CHANGED
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
* `core/cli-library.ts` when BPMN's `compile` and `check` needed the same things.
|
|
7
7
|
* This shim preserves the historical `./cli-library.js` import path.
|
|
8
8
|
*/
|
|
9
|
-
export { openCliLibrary,
|
|
9
|
+
export { openCliLibrary, connectorCheckOpts, eventResolveErrorFor, byoaCheckOpts } from './core/cli-library.js';
|
package/dist/cli-library.js
CHANGED
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
* `core/cli-library.ts` when BPMN's `compile` and `check` needed the same things.
|
|
7
7
|
* This shim preserves the historical `./cli-library.js` import path.
|
|
8
8
|
*/
|
|
9
|
-
export { openCliLibrary,
|
|
9
|
+
export { openCliLibrary, connectorCheckOpts, eventResolveErrorFor, byoaCheckOpts } from './core/cli-library.js';
|
package/dist/cli-run.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export type CliExitCode = 0 | 1 | 2;
|
|
2
2
|
export declare function runWhenInvokedDirectly(moduleUrl: string, label: string, run: (argv: string[]) => Promise<CliExitCode> | CliExitCode): void;
|
|
3
|
+
/** The value after `name` in `argv`, or `undefined`. */
|
|
4
|
+
export declare function flagValue(argv: readonly string[], name: string): string | undefined;
|
package/dist/cli-run.js
CHANGED
|
@@ -40,3 +40,8 @@ export function runWhenInvokedDirectly(moduleUrl, label, run) {
|
|
|
40
40
|
process.exitCode = 1;
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
+
/** The value after `name` in `argv`, or `undefined`. */
|
|
44
|
+
export function flagValue(argv, name) {
|
|
45
|
+
const i = argv.indexOf(name);
|
|
46
|
+
return i >= 0 ? argv[i + 1] : undefined;
|
|
47
|
+
}
|
package/dist/compile-cli.js
CHANGED
|
@@ -25,16 +25,12 @@ import { serializeWithSidecars, connectorInputErrors } from './serialize.js';
|
|
|
25
25
|
import { check } from './check.js';
|
|
26
26
|
import { byoaCheckOpts, eventResolveErrorFor, openCliLibrary } from './cli-library.js';
|
|
27
27
|
import { Bindings } from './bindings.js';
|
|
28
|
-
import { runWhenInvokedDirectly } from './cli-run.js';
|
|
28
|
+
import { flagValue, runWhenInvokedDirectly } from './cli-run.js';
|
|
29
29
|
import { connectionResources, mergeBindingsV2, readBindingsV2 } from './bindings-v2.js';
|
|
30
30
|
import { ensureTypeScriptRuntime } from './node-runtime.js';
|
|
31
31
|
import { defaultBindingsFile } from './workdir.js';
|
|
32
32
|
import { BindingRefusal } from './core/binding-messages.js';
|
|
33
33
|
import { ByoaRefusal } from './core/byoa.js';
|
|
34
|
-
function opt(argv, name) {
|
|
35
|
-
const i = argv.indexOf(name);
|
|
36
|
-
return i >= 0 ? argv[i + 1] : undefined;
|
|
37
|
-
}
|
|
38
34
|
/**
|
|
39
35
|
* The tool `type` values `compile` writes. NOT every `$resourceType: 'tool'`:
|
|
40
36
|
* the designer writes kinds the SDK cannot derive into the same directory, so
|
|
@@ -93,7 +89,7 @@ export async function run(argv) {
|
|
|
93
89
|
// library, and answering it from an assumption instead is what made
|
|
94
90
|
// EVENT_NO_SCOPE an error for HTTP Webhook, whose only correct `where` is empty.
|
|
95
91
|
const library = openCliLibrary(argv);
|
|
96
|
-
const bindFile =
|
|
92
|
+
const bindFile = flagValue(argv, '--bindings') ?? defaultBindingsFile();
|
|
97
93
|
const bindings = new Bindings(bindFile);
|
|
98
94
|
if (!noCheck) {
|
|
99
95
|
const diags = check(built, library
|
|
@@ -166,7 +162,7 @@ export async function run(argv) {
|
|
|
166
162
|
const { flow: flowJson, sidecars } = emitted;
|
|
167
163
|
for (const w of warnings)
|
|
168
164
|
console.error(` ⚠ [${w.code}] ${w.message}`);
|
|
169
|
-
const out =
|
|
165
|
+
const out = flagValue(argv, '-o') ?? `${built.name || basename(file).replace(/\.flow\.ts$|\.ts$/, '')}.flow`;
|
|
170
166
|
writeFileSync(out, JSON.stringify(flowJson, null, 2) + '\n');
|
|
171
167
|
console.log(`compile: wrote ${out} (${flowJson.nodes.length} nodes, ${flowJson.edges.length} edges)`);
|
|
172
168
|
const written = [];
|
package/dist/config.d.ts
CHANGED
|
@@ -6,14 +6,6 @@
|
|
|
6
6
|
* envelope. This mirrors the platform's own rehydrateConfiguration (Tier-A defaults
|
|
7
7
|
* + library-derived per-connector statics), minus the fieldsContainer sidecar.
|
|
8
8
|
*/
|
|
9
|
-
/**
|
|
10
|
-
* Convert an Integration Service operation discriminator into an HTTP transport
|
|
11
|
-
* verb. `GETBYID` identifies a curated Retrieve operation in the connector
|
|
12
|
-
* library, but the runtime's transport fields accept real HTTP methods only.
|
|
13
|
-
* Keep the discriminator in `instanceParameters`; normalize only fields that
|
|
14
|
-
* drive the request transport.
|
|
15
|
-
*/
|
|
16
|
-
export declare function transportHttpMethod(method: string): string;
|
|
17
9
|
/**
|
|
18
10
|
* Compose the `=jsonString:`-wrapped configuration for a connector library entry.
|
|
19
11
|
*
|
package/dist/config.js
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* + library-derived per-connector statics), minus the fieldsContainer sidecar.
|
|
8
8
|
*/
|
|
9
9
|
import { parseCeql } from './core/ceql.js';
|
|
10
|
+
import { transportHttpMethod } from './core/connector-inputs.js';
|
|
10
11
|
const TIER_A_DEFAULTS = {
|
|
11
12
|
additionalHeaders: null,
|
|
12
13
|
baseObject: null,
|
|
@@ -86,16 +87,6 @@ const ESSENTIAL_KEYS = new Set([
|
|
|
86
87
|
'path',
|
|
87
88
|
'unifiedTypesCompatible',
|
|
88
89
|
]);
|
|
89
|
-
/**
|
|
90
|
-
* Convert an Integration Service operation discriminator into an HTTP transport
|
|
91
|
-
* verb. `GETBYID` identifies a curated Retrieve operation in the connector
|
|
92
|
-
* library, but the runtime's transport fields accept real HTTP methods only.
|
|
93
|
-
* Keep the discriminator in `instanceParameters`; normalize only fields that
|
|
94
|
-
* drive the request transport.
|
|
95
|
-
*/
|
|
96
|
-
export function transportHttpMethod(method) {
|
|
97
|
-
return method === 'GETBYID' ? 'GET' : method;
|
|
98
|
-
}
|
|
99
90
|
function schemaReplayDetails(operation, inputValues) {
|
|
100
91
|
if (operation.customFieldsRequestDetails)
|
|
101
92
|
return operation.customFieldsRequestDetails;
|
package/dist/core/actions.d.ts
CHANGED
|
@@ -699,15 +699,24 @@ export interface ConversationalAgentInputs {
|
|
|
699
699
|
*/
|
|
700
700
|
settings: ConversationalAgentSettings;
|
|
701
701
|
/**
|
|
702
|
-
* Whether the agent's reply CLOSES the exchange.
|
|
703
|
-
*
|
|
702
|
+
* Whether the agent's reply CLOSES the exchange.
|
|
703
|
+
*
|
|
704
|
+
* @deprecated Has no effect and is not emitted. The platform retired the input:
|
|
705
|
+
* the conversational agent's v1.7 node migration removes it, and the converter
|
|
706
|
+
* always sends `conversationalService.endExchange = ''`. Wait-for-message and
|
|
707
|
+
* the end of the conversation close open exchanges.
|
|
704
708
|
*/
|
|
705
709
|
endExchange?: boolean;
|
|
706
710
|
/** Sampling temperature, 0–1. */
|
|
707
711
|
temperature?: number;
|
|
708
712
|
/** Max tokens in one response. */
|
|
709
713
|
maxTokenPerResponse?: number;
|
|
710
|
-
/**
|
|
714
|
+
/**
|
|
715
|
+
* The model's own context ceiling.
|
|
716
|
+
*
|
|
717
|
+
* @deprecated Has no effect and is not emitted. Studio Web derives it from the
|
|
718
|
+
* selected model.
|
|
719
|
+
*/
|
|
711
720
|
modelMaxTokens?: number;
|
|
712
721
|
/** How many tool-calling rounds one turn may take, 1–100. */
|
|
713
722
|
maxIterations?: number;
|
|
@@ -1505,7 +1514,13 @@ export interface InlineAgentInputs {
|
|
|
1505
1514
|
temperature?: number;
|
|
1506
1515
|
/** Max tokens in one response, 0–16384. */
|
|
1507
1516
|
maxTokenPerResponse?: number;
|
|
1508
|
-
/**
|
|
1517
|
+
/**
|
|
1518
|
+
* The model's own context ceiling, e.g. `128000`.
|
|
1519
|
+
*
|
|
1520
|
+
* @deprecated Has no effect and is not emitted. Studio Web derives it from the
|
|
1521
|
+
* selected model each time the agent is opened, and the sidecar has no field
|
|
1522
|
+
* for it.
|
|
1523
|
+
*/
|
|
1509
1524
|
modelMaxTokens?: number;
|
|
1510
1525
|
/** How many tool-calling rounds the agent may take, 1–100. */
|
|
1511
1526
|
maxIterations?: number;
|
|
@@ -2,8 +2,6 @@ import { Library } from './library.js';
|
|
|
2
2
|
import type { BindingsView } from './binding-messages.js';
|
|
3
3
|
import { type ConnectorCheckOpts } from './connector-checks.js';
|
|
4
4
|
import type { EventCheckOpts } from './event-checks.js';
|
|
5
|
-
/** The value after `name` in `argv`, or `undefined`. */
|
|
6
|
-
export declare function flagValue(argv: readonly string[], name: string): string | undefined;
|
|
7
5
|
/**
|
|
8
6
|
* The library for this invocation, or `undefined` when there is none.
|
|
9
7
|
*
|
package/dist/core/cli-library.js
CHANGED
|
@@ -18,14 +18,10 @@ import { existsSync } from 'node:fs';
|
|
|
18
18
|
import { join } from 'node:path';
|
|
19
19
|
import { Library } from './library.js';
|
|
20
20
|
import { resolveLibraryDir } from '../registry/cache.js';
|
|
21
|
+
import { flagValue } from '../cli-run.js';
|
|
21
22
|
import { defaultOverlayDir } from '../workdir.js';
|
|
22
23
|
import { EQUALS_EXPR_DIALECT } from './connector-checks.js';
|
|
23
24
|
import { connectorInputErrors } from './connector-inputs.js';
|
|
24
|
-
/** The value after `name` in `argv`, or `undefined`. */
|
|
25
|
-
export function flagValue(argv, name) {
|
|
26
|
-
const i = argv.indexOf(name);
|
|
27
|
-
return i >= 0 ? argv[i + 1] : undefined;
|
|
28
|
-
}
|
|
29
25
|
/**
|
|
30
26
|
* The library for this invocation, or `undefined` when there is none.
|
|
31
27
|
*
|
|
@@ -98,3 +98,11 @@ interface ConnectorSlots {
|
|
|
98
98
|
* author already wrote under a plain key is merged into, not replaced.
|
|
99
99
|
*/
|
|
100
100
|
export declare function nestConnectorBody(flat: Record<string, unknown>): Record<string, unknown>;
|
|
101
|
+
/**
|
|
102
|
+
* Convert an Integration Service operation discriminator into an HTTP transport
|
|
103
|
+
* verb. `GETBYID` identifies a curated Retrieve operation in the connector
|
|
104
|
+
* library, but the runtime's transport fields accept real HTTP methods only.
|
|
105
|
+
* Keep the discriminator in `instanceParameters`; normalize only fields that
|
|
106
|
+
* drive the request transport.
|
|
107
|
+
*/
|
|
108
|
+
export declare function transportHttpMethod(method: string): string;
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
*/
|
|
25
25
|
import { isLookupToken, resolvedValue, unresolvedLookupMessage, } from './lookups.js';
|
|
26
26
|
import { prepareCommand } from './cli-spelling.js';
|
|
27
|
+
import { editDistance } from './edit-distance.js';
|
|
27
28
|
/** Flow's dialect, re-exported so `serialize.ts` need not reach past this module. */
|
|
28
29
|
export { FLOW_EXPR_DIALECT } from './connector-checks.js';
|
|
29
30
|
import { FLOW_EXPR_DIALECT as FLOW_DIALECT } from './connector-checks.js';
|
|
@@ -286,6 +287,16 @@ export function nestConnectorBody(flat) {
|
|
|
286
287
|
}
|
|
287
288
|
return out;
|
|
288
289
|
}
|
|
290
|
+
/**
|
|
291
|
+
* Convert an Integration Service operation discriminator into an HTTP transport
|
|
292
|
+
* verb. `GETBYID` identifies a curated Retrieve operation in the connector
|
|
293
|
+
* library, but the runtime's transport fields accept real HTTP methods only.
|
|
294
|
+
* Keep the discriminator in `instanceParameters`; normalize only fields that
|
|
295
|
+
* drive the request transport.
|
|
296
|
+
*/
|
|
297
|
+
export function transportHttpMethod(method) {
|
|
298
|
+
return method === 'GETBYID' ? 'GET' : method;
|
|
299
|
+
}
|
|
289
300
|
function place(target, parts, index, value) {
|
|
290
301
|
const part = parts[index];
|
|
291
302
|
const last = index === parts.length - 1;
|
|
@@ -486,19 +497,3 @@ function nearestField(key, names) {
|
|
|
486
497
|
}
|
|
487
498
|
return bestD <= budget ? best : undefined;
|
|
488
499
|
}
|
|
489
|
-
/** Levenshtein distance, two rows — enough for field-name suggestions. */
|
|
490
|
-
function editDistance(a, b) {
|
|
491
|
-
if (a === b)
|
|
492
|
-
return 0;
|
|
493
|
-
if (Math.abs(a.length - b.length) > 3)
|
|
494
|
-
return 99; // cheap bail: beyond any budget
|
|
495
|
-
let prev = Array.from({ length: b.length + 1 }, (_, j) => j);
|
|
496
|
-
for (let i = 1; i <= a.length; i++) {
|
|
497
|
-
const row = [i];
|
|
498
|
-
for (let j = 1; j <= b.length; j++) {
|
|
499
|
-
row[j] = Math.min(prev[j] + 1, row[j - 1] + 1, prev[j - 1] + (a[i - 1] === b[j - 1] ? 0 : 1));
|
|
500
|
-
}
|
|
501
|
-
prev = row;
|
|
502
|
-
}
|
|
503
|
-
return prev[b.length];
|
|
504
|
-
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* core/edit-distance — Levenshtein distance for "did you mean …?" suggestions.
|
|
3
|
+
*
|
|
4
|
+
* Shared by the library's object lookup, Flow's `check`, connector-input routing
|
|
5
|
+
* and `registry prepare`. It returns the EXACT distance: callers compare it to a
|
|
6
|
+
* budget, and `registry/prepare/actions.ts` sorts by it, so a sentinel cutoff
|
|
7
|
+
* would reorder suggestions.
|
|
8
|
+
*/
|
|
9
|
+
/** Levenshtein distance, two rows. Short strings only (names and ids). */
|
|
10
|
+
export declare function editDistance(a: string, b: string): number;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* core/edit-distance — Levenshtein distance for "did you mean …?" suggestions.
|
|
3
|
+
*
|
|
4
|
+
* Shared by the library's object lookup, Flow's `check`, connector-input routing
|
|
5
|
+
* and `registry prepare`. It returns the EXACT distance: callers compare it to a
|
|
6
|
+
* budget, and `registry/prepare/actions.ts` sorts by it, so a sentinel cutoff
|
|
7
|
+
* would reorder suggestions.
|
|
8
|
+
*/
|
|
9
|
+
/** Levenshtein distance, two rows. Short strings only (names and ids). */
|
|
10
|
+
export function editDistance(a, b) {
|
|
11
|
+
let prev = Array.from({ length: b.length + 1 }, (_, i) => i);
|
|
12
|
+
for (let i = 1; i <= a.length; i++) {
|
|
13
|
+
const cur = [i];
|
|
14
|
+
for (let j = 1; j <= b.length; j++) {
|
|
15
|
+
cur[j] = Math.min(prev[j] + 1, cur[j - 1] + 1, prev[j - 1] + (a[i - 1] === b[j - 1] ? 0 : 1));
|
|
16
|
+
}
|
|
17
|
+
prev = cur;
|
|
18
|
+
}
|
|
19
|
+
return prev[b.length];
|
|
20
|
+
}
|
package/dist/core/library.js
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import { readFileSync, existsSync } from 'node:fs';
|
|
10
10
|
import { join } from 'node:path';
|
|
11
11
|
import { prepareCommand } from './cli-spelling.js';
|
|
12
|
+
import { editDistance } from './edit-distance.js';
|
|
12
13
|
import { loadListEnvelopes, lookupListEnvelope } from './list-envelope.js';
|
|
13
14
|
import { lookupSpecOf } from './lookups.js';
|
|
14
15
|
import { loadByoaLedger, loadInvariantCollections, loadLookupResolutions } from './lookup-store.js';
|
|
@@ -1126,18 +1127,6 @@ function nearest(want, objects) {
|
|
|
1126
1127
|
}
|
|
1127
1128
|
return best;
|
|
1128
1129
|
}
|
|
1129
|
-
/** Levenshtein distance, two rows. Short strings only (object names). */
|
|
1130
|
-
function editDistance(a, b) {
|
|
1131
|
-
let prev = Array.from({ length: b.length + 1 }, (_, i) => i);
|
|
1132
|
-
for (let i = 1; i <= a.length; i++) {
|
|
1133
|
-
const cur = [i];
|
|
1134
|
-
for (let j = 1; j <= b.length; j++) {
|
|
1135
|
-
cur[j] = Math.min(prev[j] + 1, cur[j - 1] + 1, prev[j - 1] + (a[i - 1] === b[j - 1] ? 0 : 1));
|
|
1136
|
-
}
|
|
1137
|
-
prev = cur;
|
|
1138
|
-
}
|
|
1139
|
-
return prev[b.length];
|
|
1140
|
-
}
|
|
1141
1130
|
/**
|
|
1142
1131
|
* The accepted input vocabulary for one connector operation, with each input's
|
|
1143
1132
|
* wire LOCATION.
|