@sensigo/realm-cli 0.39.0 → 0.40.0
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/agent/drive-failure.d.ts +62 -0
- package/dist/agent/drive-failure.d.ts.map +1 -0
- package/dist/agent/drive-failure.js +241 -0
- package/dist/agent/drive-failure.js.map +1 -0
- package/dist/agent/providers/agent-utils.d.ts +132 -0
- package/dist/agent/providers/agent-utils.d.ts.map +1 -1
- package/dist/agent/providers/agent-utils.js +348 -1
- package/dist/agent/providers/agent-utils.js.map +1 -1
- package/dist/agent/providers/anthropic-provider.d.ts +51 -1
- package/dist/agent/providers/anthropic-provider.d.ts.map +1 -1
- package/dist/agent/providers/anthropic-provider.js +109 -30
- package/dist/agent/providers/anthropic-provider.js.map +1 -1
- package/dist/agent/providers/llm-provider.d.ts +13 -1
- package/dist/agent/providers/llm-provider.d.ts.map +1 -1
- package/dist/agent/providers/llm-provider.js +8 -4
- package/dist/agent/providers/llm-provider.js.map +1 -1
- package/dist/agent/providers/openai-provider.d.ts +6 -1
- package/dist/agent/providers/openai-provider.d.ts.map +1 -1
- package/dist/agent/providers/openai-provider.js +75 -20
- package/dist/agent/providers/openai-provider.js.map +1 -1
- package/dist/agent/providers/openai-reasoning-provider.d.ts +4 -1
- package/dist/agent/providers/openai-reasoning-provider.d.ts.map +1 -1
- package/dist/agent/providers/openai-reasoning-provider.js +21 -6
- package/dist/agent/providers/openai-reasoning-provider.js.map +1 -1
- package/dist/agent/run-agent.d.ts +9 -0
- package/dist/agent/run-agent.d.ts.map +1 -1
- package/dist/agent/run-agent.js +775 -680
- package/dist/agent/run-agent.js.map +1 -1
- package/dist/agent/run-attach.d.ts.map +1 -1
- package/dist/agent/run-attach.js +26 -2
- package/dist/agent/run-attach.js.map +1 -1
- package/dist/agent/test-support/anthropic-stub.d.ts +45 -0
- package/dist/agent/test-support/anthropic-stub.d.ts.map +1 -0
- package/dist/agent/test-support/anthropic-stub.js +146 -0
- package/dist/agent/test-support/anthropic-stub.js.map +1 -0
- package/dist/agent/test-support/composed-journey.d.ts +40 -0
- package/dist/agent/test-support/composed-journey.d.ts.map +1 -0
- package/dist/agent/test-support/composed-journey.js +104 -0
- package/dist/agent/test-support/composed-journey.js.map +1 -0
- package/dist/agent/test-support/mcp-server-entry.d.ts +20 -0
- package/dist/agent/test-support/mcp-server-entry.d.ts.map +1 -0
- package/dist/agent/test-support/mcp-server-entry.js +39 -0
- package/dist/agent/test-support/mcp-server-entry.js.map +1 -0
- package/dist/agent/test-support/openai-stub.d.ts +47 -0
- package/dist/agent/test-support/openai-stub.d.ts.map +1 -0
- package/dist/agent/test-support/openai-stub.js +115 -0
- package/dist/agent/test-support/openai-stub.js.map +1 -0
- package/dist/commands/agent.d.ts.map +1 -1
- package/dist/commands/agent.js +17 -0
- package/dist/commands/agent.js.map +1 -1
- package/dist/commands/gc.d.ts.map +1 -1
- package/dist/commands/gc.js.map +1 -1
- package/dist/commands/inspect.d.ts.map +1 -1
- package/dist/commands/inspect.js +42 -0
- package/dist/commands/inspect.js.map +1 -1
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/list.js +35 -0
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/purge.d.ts +22 -1
- package/dist/commands/purge.d.ts.map +1 -1
- package/dist/commands/purge.js +70 -42
- package/dist/commands/purge.js.map +1 -1
- package/dist/commands/register.d.ts.map +1 -1
- package/dist/commands/register.js +3 -1
- package/dist/commands/register.js.map +1 -1
- package/dist/commands/validate.d.ts.map +1 -1
- package/dist/commands/validate.js +7 -5
- package/dist/commands/validate.js.map +1 -1
- package/dist/commands/watch.d.ts.map +1 -1
- package/dist/commands/watch.js +6 -4
- package/dist/commands/watch.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/loader-warnings.d.ts +22 -1
- package/dist/lib/loader-warnings.d.ts.map +1 -1
- package/dist/lib/loader-warnings.js +42 -2
- package/dist/lib/loader-warnings.js.map +1 -1
- package/package.json +5 -4
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import 'dotenv/config';
|
|
|
4
4
|
import { Command } from 'commander';
|
|
5
5
|
import { workflowCommands, runCommands, topLevelCommands } from './commands-registry.js';
|
|
6
6
|
const program = new Command();
|
|
7
|
-
program.name('realm').description('Realm workflow engine CLI').version('0.
|
|
7
|
+
program.name('realm').description('Realm workflow engine CLI').version('0.40.0');
|
|
8
8
|
// realm workflow — operations on workflow definitions
|
|
9
9
|
const workflowCmd = new Command('workflow').description('Manage workflow definitions');
|
|
10
10
|
for (const cmd of workflowCommands)
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { type LoaderWarning, type WarningCode } from '@sensigo/realm';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Prints every warning via the single renderLoaderWarning format source, correcting the
|
|
4
|
+
* "— ignored" claim for any warning this boundary will actually refuse.
|
|
5
|
+
*
|
|
6
|
+
* Resolved against DEFAULT_POLICY, which is the policy the boundary-reject itself uses. A warning
|
|
7
|
+
* that only fails under `--strict` still renders "— ignored" — see the report's design note; the
|
|
8
|
+
* `--strict` path prints its own "failing due to --strict" line, so the author is not left
|
|
9
|
+
* without an explanation.
|
|
10
|
+
*/
|
|
3
11
|
export declare function printLoaderWarnings(warnings: LoaderWarning[]): void;
|
|
4
12
|
/**
|
|
5
13
|
* The dormant issue #170 boundary-reject hook, factored ONCE so validate/register/watch can't
|
|
@@ -12,4 +20,17 @@ export declare function printLoaderWarnings(warnings: LoaderWarning[]): void;
|
|
|
12
20
|
export declare function rejectOnErrorSeverity(warnings: LoaderWarning[], policy?: Record<WarningCode, 'warn' | 'error'>): boolean;
|
|
13
21
|
/** True if `--strict` should fail the command given these accumulated warnings. */
|
|
14
22
|
export declare function failsStrict(warnings: LoaderWarning[]): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Renders a load failure without saying "invalid" twice (issue #417).
|
|
25
|
+
*
|
|
26
|
+
* The loader's own message already begins `Invalid workflow: …`, so wrapping it in `Invalid: `
|
|
27
|
+
* produced `Invalid: Invalid workflow: Step 'x': …` — an author's first three words are the same
|
|
28
|
+
* word twice, before anything they can act on. Where the message announces itself, it is printed
|
|
29
|
+
* verbatim; where it does not (a non-loader error surfacing on the same path), the prefix still
|
|
30
|
+
* earns its place.
|
|
31
|
+
*
|
|
32
|
+
* Applies only to the message-echoing renders. The standalone strict-escalation lines have their
|
|
33
|
+
* own text and are untouched.
|
|
34
|
+
*/
|
|
35
|
+
export declare function renderLoadFailure(message: string): string;
|
|
15
36
|
//# sourceMappingURL=loader-warnings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader-warnings.d.ts","sourceRoot":"","sources":["../../src/lib/loader-warnings.ts"],"names":[],"mappings":"AAIA,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,WAAW,EACjB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"loader-warnings.d.ts","sourceRoot":"","sources":["../../src/lib/loader-warnings.ts"],"names":[],"mappings":"AAIA,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,WAAW,EACjB,MAAM,gBAAgB,CAAC;AAiBxB;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,aAAa,EAAE,GAAG,IAAI,CASnE;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,aAAa,EAAE,EACzB,MAAM,GAAE,MAAM,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAkB,GAC7D,OAAO,CAET;AAWD,mFAAmF;AACnF,wBAAgB,WAAW,CAAC,QAAQ,EAAE,aAAa,EAAE,GAAG,OAAO,CAE9D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEzD"}
|
|
@@ -3,10 +3,35 @@
|
|
|
3
3
|
// only caller of renderLoaderWarning — no command hand-rolls a `⚠ ` string), and the dormant
|
|
4
4
|
// #170 boundary-reject is factored into ONE shared helper so validate/register/watch can't drift.
|
|
5
5
|
import { renderLoaderWarning, resolveSeverity, DEFAULT_POLICY, } from '@sensigo/realm';
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* The unknown-key warning is minted with "— ignored", which is true of the LENIENT loader
|
|
8
|
+
* (run/agent/listen really do ignore the key and carry on) and false here: the only callers of
|
|
9
|
+
* this function are validate/register/watch, and post-#170 those three REFUSE a workflow whose
|
|
10
|
+
* warning resolves to 'error'. Printing "— ignored" one line above "escalated to an error" tells
|
|
11
|
+
* the author the opposite of what is about to happen to them.
|
|
12
|
+
*
|
|
13
|
+
* Substituted at the RENDER, not the mint, precisely because the mint is shared with the lenient
|
|
14
|
+
* path — where the original wording is true and worth keeping. The did-you-mean fragment is
|
|
15
|
+
* untouched: it is the most useful half of the line and the reason the author can fix this in one
|
|
16
|
+
* edit.
|
|
17
|
+
*/
|
|
18
|
+
const IGNORED_CLAUSE = '— ignored';
|
|
19
|
+
const REFUSED_CLAUSE = '— REFUSED below';
|
|
20
|
+
/**
|
|
21
|
+
* Prints every warning via the single renderLoaderWarning format source, correcting the
|
|
22
|
+
* "— ignored" claim for any warning this boundary will actually refuse.
|
|
23
|
+
*
|
|
24
|
+
* Resolved against DEFAULT_POLICY, which is the policy the boundary-reject itself uses. A warning
|
|
25
|
+
* that only fails under `--strict` still renders "— ignored" — see the report's design note; the
|
|
26
|
+
* `--strict` path prints its own "failing due to --strict" line, so the author is not left
|
|
27
|
+
* without an explanation.
|
|
28
|
+
*/
|
|
7
29
|
export function printLoaderWarnings(warnings) {
|
|
8
30
|
for (const w of warnings) {
|
|
9
|
-
|
|
31
|
+
const line = renderLoaderWarning(w);
|
|
32
|
+
console.warn(resolveSeverity(w.code, DEFAULT_POLICY) === 'error'
|
|
33
|
+
? line.replace(IGNORED_CLAUSE, REFUSED_CLAUSE)
|
|
34
|
+
: line);
|
|
10
35
|
}
|
|
11
36
|
}
|
|
12
37
|
/**
|
|
@@ -30,4 +55,19 @@ const ALL_ERROR_POLICY = Object.fromEntries(Object.keys(DEFAULT_POLICY).map((cod
|
|
|
30
55
|
export function failsStrict(warnings) {
|
|
31
56
|
return rejectOnErrorSeverity(warnings, ALL_ERROR_POLICY);
|
|
32
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Renders a load failure without saying "invalid" twice (issue #417).
|
|
60
|
+
*
|
|
61
|
+
* The loader's own message already begins `Invalid workflow: …`, so wrapping it in `Invalid: `
|
|
62
|
+
* produced `Invalid: Invalid workflow: Step 'x': …` — an author's first three words are the same
|
|
63
|
+
* word twice, before anything they can act on. Where the message announces itself, it is printed
|
|
64
|
+
* verbatim; where it does not (a non-loader error surfacing on the same path), the prefix still
|
|
65
|
+
* earns its place.
|
|
66
|
+
*
|
|
67
|
+
* Applies only to the message-echoing renders. The standalone strict-escalation lines have their
|
|
68
|
+
* own text and are untouched.
|
|
69
|
+
*/
|
|
70
|
+
export function renderLoadFailure(message) {
|
|
71
|
+
return message.startsWith('Invalid workflow:') ? message : `Invalid: ${message}`;
|
|
72
|
+
}
|
|
33
73
|
//# sourceMappingURL=loader-warnings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader-warnings.js","sourceRoot":"","sources":["../../src/lib/loader-warnings.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,gGAAgG;AAChG,6FAA6F;AAC7F,kGAAkG;AAClG,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,cAAc,GAGf,MAAM,gBAAgB,CAAC;AAExB,
|
|
1
|
+
{"version":3,"file":"loader-warnings.js","sourceRoot":"","sources":["../../src/lib/loader-warnings.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,gGAAgG;AAChG,6FAA6F;AAC7F,kGAAkG;AAClG,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,cAAc,GAGf,MAAM,gBAAgB,CAAC;AAExB;;;;;;;;;;;GAWG;AACH,MAAM,cAAc,GAAG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|
{
|
|
2
2
|
"name": "@sensigo/realm-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.40.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
+
"@anthropic-ai/sdk": "^0.120.0",
|
|
58
59
|
"@types/js-yaml": "^4.0.9",
|
|
59
60
|
"@types/node": "^26.1.1",
|
|
60
61
|
"openai": "^6.34.0",
|
|
@@ -63,9 +64,9 @@
|
|
|
63
64
|
"vitest": "^4.1.0"
|
|
64
65
|
},
|
|
65
66
|
"dependencies": {
|
|
66
|
-
"@sensigo/realm": "^0.
|
|
67
|
-
"@sensigo/realm-mcp": "^0.
|
|
68
|
-
"@sensigo/realm-testing": "^0.
|
|
67
|
+
"@sensigo/realm": "^0.40.0",
|
|
68
|
+
"@sensigo/realm-mcp": "^0.40.0",
|
|
69
|
+
"@sensigo/realm-testing": "^0.40.0",
|
|
69
70
|
"@modelcontextprotocol/sdk": "1.30.0",
|
|
70
71
|
"chalk": "^5.0.0",
|
|
71
72
|
"commander": "^15.0.0",
|