skillscript-runtime 0.13.8 → 0.14.1
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/README.md +12 -12
- package/dist/bootstrap.d.ts +13 -13
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +31 -31
- package/dist/bootstrap.js.map +1 -1
- package/dist/cli.js +6 -6
- package/dist/cli.js.map +1 -1
- package/dist/compile.js +2 -2
- package/dist/compile.js.map +1 -1
- package/dist/connectors/config.d.ts +4 -4
- package/dist/connectors/config.d.ts.map +1 -1
- package/dist/connectors/config.js +7 -7
- package/dist/connectors/config.js.map +1 -1
- package/dist/connectors/data-store-mcp.d.ts +29 -0
- package/dist/connectors/data-store-mcp.d.ts.map +1 -0
- package/dist/connectors/{memory-store-mcp.js → data-store-mcp.js} +56 -31
- package/dist/connectors/data-store-mcp.js.map +1 -0
- package/dist/connectors/{memory-store.d.ts → data-store.d.ts} +12 -12
- package/dist/connectors/data-store.d.ts.map +1 -0
- package/dist/connectors/{memory-store.js → data-store.js} +7 -7
- package/dist/connectors/data-store.js.map +1 -0
- package/dist/connectors/filter-enforcement.d.ts +18 -0
- package/dist/connectors/filter-enforcement.d.ts.map +1 -0
- package/dist/connectors/filter-enforcement.js +57 -0
- package/dist/connectors/filter-enforcement.js.map +1 -0
- package/dist/connectors/index.d.ts +5 -5
- package/dist/connectors/index.d.ts.map +1 -1
- package/dist/connectors/index.js +7 -7
- package/dist/connectors/index.js.map +1 -1
- package/dist/connectors/local-model-mcp.js +1 -1
- package/dist/connectors/local-model-mcp.js.map +1 -1
- package/dist/connectors/registry.d.ts +10 -10
- package/dist/connectors/registry.d.ts.map +1 -1
- package/dist/connectors/registry.js +11 -11
- package/dist/connectors/registry.js.map +1 -1
- package/dist/connectors/sqlite-skill-store.js +1 -1
- package/dist/connectors/sqlite-skill-store.js.map +1 -1
- package/dist/connectors/types.d.ts +36 -23
- package/dist/connectors/types.d.ts.map +1 -1
- package/dist/connectors/types.js +2 -2
- package/dist/connectors/types.js.map +1 -1
- package/dist/dashboard/spa/app.js +2 -2
- package/dist/errors.d.ts +43 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +70 -4
- package/dist/errors.js.map +1 -1
- package/dist/help-content.js +27 -27
- package/dist/help-content.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/lint.d.ts.map +1 -1
- package/dist/lint.js +48 -56
- package/dist/lint.js.map +1 -1
- package/dist/mcp-server.d.ts +1 -1
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/mcp-server.js +19 -16
- package/dist/mcp-server.js.map +1 -1
- package/dist/mutation-gate.d.ts +61 -0
- package/dist/mutation-gate.d.ts.map +1 -0
- package/dist/mutation-gate.js +89 -0
- package/dist/mutation-gate.js.map +1 -0
- package/dist/runtime-config.d.ts +2 -2
- package/dist/runtime-config.d.ts.map +1 -1
- package/dist/runtime-config.js +1 -1
- package/dist/runtime-config.js.map +1 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +59 -17
- package/dist/runtime.js.map +1 -1
- package/dist/skill-manager.js +1 -1
- package/dist/skill-manager.js.map +1 -1
- package/dist/testing/conformance.d.ts +8 -8
- package/dist/testing/conformance.d.ts.map +1 -1
- package/dist/testing/conformance.js +8 -8
- package/dist/testing/conformance.js.map +1 -1
- package/dist/testing/index.d.ts +2 -2
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +1 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/trace.d.ts +3 -3
- package/docs/adopter-playbook.md +85 -41
- package/docs/configuration.md +8 -8
- package/docs/connector-contract-reference.md +9 -9
- package/docs/language-reference.md +38 -63
- package/docs/sqlite-skill-store.md +2 -2
- package/examples/README.md +5 -5
- package/examples/connectors/{MemoryStoreTemplate/MemoryStoreTemplate.ts → DataStoreTemplate/DataStoreTemplate.ts} +56 -43
- package/examples/connectors/{MemoryStoreTemplate → DataStoreTemplate}/README.md +39 -39
- package/examples/connectors/LocalModelTemplate/README.md +1 -1
- package/examples/connectors/McpConnectorTemplate/McpConnectorTemplate.ts +2 -2
- package/examples/connectors/McpConnectorTemplate/README.md +5 -5
- package/examples/connectors/README.md +3 -3
- package/examples/connectors/SkillStoreTemplate/README.md +1 -1
- package/examples/connectors/SkillStoreTemplate/SkillStoreTemplate.ts +1 -1
- package/examples/custom-bootstrap.example.ts +15 -8
- package/examples/onboarding-scaffold/README.md +9 -10
- package/examples/onboarding-scaffold/bootstrap.ts +18 -13
- package/examples/onboarding-scaffold/connectors.json +1 -1
- package/examples/onboarding-scaffold/{file-memory-store.ts → file-data-store.ts} +34 -23
- package/examples/programmatic-trace-demo.mjs +1 -1
- package/examples/skillscripts/classify-support-ticket.skill.md +9 -8
- package/examples/skillscripts/cut-release-tag.skill.md +6 -6
- package/examples/skillscripts/doc-qa-with-citations.skill.md +3 -3
- package/examples/skillscripts/feedback-sentiment-scan.skill.md +9 -8
- package/examples/skillscripts/hello.skill.provenance.json +1 -1
- package/examples/skillscripts/morning-brief.skill.md +3 -3
- package/examples/skillscripts/service-health-watch.skill.md +5 -4
- package/package.json +1 -1
- package/scaffold/config.toml +6 -4
- package/scaffold/connectors.json +3 -3
- package/dist/connectors/memory-store-mcp.d.ts +0 -20
- package/dist/connectors/memory-store-mcp.d.ts.map +0 -1
- package/dist/connectors/memory-store-mcp.js.map +0 -1
- package/dist/connectors/memory-store.d.ts.map +0 -1
- package/dist/connectors/memory-store.js.map +0 -1
- /package/examples/onboarding-scaffold/{memory.example.json → data.example.json} +0 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { SkillOp } from "./parser.js";
|
|
2
|
+
/**
|
|
3
|
+
* Mutating-tool name shapes that trigger mutation classification when used
|
|
4
|
+
* with a bare `$ tool` dispatch. The pattern is a curated allowlist of
|
|
5
|
+
* conventional mutation-verb prefixes — `write_`, `update_`, `delete_`,
|
|
6
|
+
* etc. — extended over time as the wild-and-crazy harness surfaces new
|
|
7
|
+
* mutation clusters (`archive_`, `prune_`, `deploy_`, `expire_`, ...).
|
|
8
|
+
*
|
|
9
|
+
* Substrate-specific mutating tools whose names don't match the prefix
|
|
10
|
+
* list aren't auto-classified; authors can still declare intent via
|
|
11
|
+
* `approved="reason"` per-op kwarg or `# Autonomous: true` skill header.
|
|
12
|
+
*/
|
|
13
|
+
export declare const MUTATING_TOOL_PATTERN: RegExp;
|
|
14
|
+
export type MutationKind = "data_write" | "mutating_tool" | "file_write";
|
|
15
|
+
export interface MutationClassification {
|
|
16
|
+
kind: MutationKind;
|
|
17
|
+
/** Tool name for `$` ops; path for `file_write`. User-facing in error copy. */
|
|
18
|
+
detail: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Returns the mutation classification for an op, or `null` if the op isn't
|
|
22
|
+
* a mutation. Called by both the lint warning rule and the runtime
|
|
23
|
+
* enforcement gate.
|
|
24
|
+
*/
|
|
25
|
+
export declare function classifyMutation(op: SkillOp): MutationClassification | null;
|
|
26
|
+
/**
|
|
27
|
+
* Per-target authorization state. `skillAutonomous` is set once from the
|
|
28
|
+
* skill's `# Autonomous: true` header. `sawConfirm` flips when a `??` /
|
|
29
|
+
* `ask()` op fires earlier in the same target — `??` is the in-script
|
|
30
|
+
* confirmation gate that authorizes subsequent mutation ops.
|
|
31
|
+
*
|
|
32
|
+
* Pass-by-reference: the same authState object threads through `execOps`
|
|
33
|
+
* + nested recursive calls (foreach/if/else bodies) so `sawConfirm`
|
|
34
|
+
* propagates correctly across nesting. Runtime scope is "this target's
|
|
35
|
+
* execution"; reset per-target at the top-level call in `execute()`.
|
|
36
|
+
*/
|
|
37
|
+
export interface MutationAuthState {
|
|
38
|
+
skillAutonomous: boolean;
|
|
39
|
+
sawConfirm: boolean;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* The three authorization paths the spec defines. Predicate parity with
|
|
43
|
+
* the lint `unconfirmed-mutation` rule — runtime uses this to enforce
|
|
44
|
+
* what lint warns about.
|
|
45
|
+
*
|
|
46
|
+
* - `op.approved` truthy: per-op kwarg signaling author intent for this
|
|
47
|
+
* specific op. Any non-empty string accepts (presence is what matters;
|
|
48
|
+
* value not parsed semantically).
|
|
49
|
+
* - `skillAutonomous`: `# Autonomous: true` skill header — declares the
|
|
50
|
+
* whole skill as unattended-by-design; no per-op confirmation required.
|
|
51
|
+
* - `sawConfirm`: a `??` / `ask()` fired earlier in the same target's
|
|
52
|
+
* execution authorized subsequent mutation ops in iteration order.
|
|
53
|
+
*/
|
|
54
|
+
export declare function authorizationGranted(op: SkillOp, authState: MutationAuthState): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Build the concrete one-line remediation suggestion for an
|
|
57
|
+
* `UnconfirmedMutationError`. Names all three authorization paths so
|
|
58
|
+
* the adopter sees the full menu without bouncing to the docs.
|
|
59
|
+
*/
|
|
60
|
+
export declare function buildAuthorizationSuggestion(classification: MutationClassification): string;
|
|
61
|
+
//# sourceMappingURL=mutation-gate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutation-gate.d.ts","sourceRoot":"","sources":["../src/mutation-gate.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qBAAqB,QAA+N,CAAC;AAElQ,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG,eAAe,GAAG,YAAY,CAAC;AAEzE,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,YAAY,CAAC;IACnB,+EAA+E;IAC/E,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,OAAO,GAAG,sBAAsB,GAAG,IAAI,CAgB3E;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,iBAAiB;IAChC,eAAe,EAAE,OAAO,CAAC;IACzB,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,iBAAiB,GAAG,OAAO,CAKvF;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,cAAc,EAAE,sBAAsB,GAAG,MAAM,CAW3F"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// v0.14.1 — Shared mutation classification + authorization helpers used by
|
|
2
|
+
// both lint (`unconfirmed-mutation` rule) and runtime enforcement (`execOps`
|
|
3
|
+
// Layer A + `execOpInner` Layer B). Single source of truth — when lint and
|
|
4
|
+
// runtime classify the same op the same way and check the same predicate,
|
|
5
|
+
// the "discipline-only contracts are bugs" class can't recur on this surface.
|
|
6
|
+
//
|
|
7
|
+
// Layered enforcement (defense-in-depth, mirrors the §27 `skill_status`
|
|
8
|
+
// template):
|
|
9
|
+
// - Layer A (load-bearing): `execOps` checks each op BEFORE dispatch; throws
|
|
10
|
+
// `UnconfirmedMutationError` when `classifyMutation()` returns non-null
|
|
11
|
+
// AND `authorizationGranted()` returns false.
|
|
12
|
+
// - Layer B (regression guard): `execOpInner` re-checks at the `$` and
|
|
13
|
+
// `file_write` dispatch sites. Same predicate, same authState — defense
|
|
14
|
+
// against a future caller that bypasses execOps. The fail-closed default
|
|
15
|
+
// authState (`{ skillAutonomous: false, sawConfirm: false }`) ensures any
|
|
16
|
+
// bypass throws instead of silently passing.
|
|
17
|
+
/**
|
|
18
|
+
* Mutating-tool name shapes that trigger mutation classification when used
|
|
19
|
+
* with a bare `$ tool` dispatch. The pattern is a curated allowlist of
|
|
20
|
+
* conventional mutation-verb prefixes — `write_`, `update_`, `delete_`,
|
|
21
|
+
* etc. — extended over time as the wild-and-crazy harness surfaces new
|
|
22
|
+
* mutation clusters (`archive_`, `prune_`, `deploy_`, `expire_`, ...).
|
|
23
|
+
*
|
|
24
|
+
* Substrate-specific mutating tools whose names don't match the prefix
|
|
25
|
+
* list aren't auto-classified; authors can still declare intent via
|
|
26
|
+
* `approved="reason"` per-op kwarg or `# Autonomous: true` skill header.
|
|
27
|
+
*/
|
|
28
|
+
export const MUTATING_TOOL_PATTERN = /^(?:write_|update_|delete_|remove_|set_|create_|insert_|put_|patch_|destroy_|archive_|prune_|deploy_|expire_|consolidate_|purge_|reset_|rotate_|move_|rename_|drop_|truncate_|upsert_|overwrite_|clear_|wipe_|finalize_).*/;
|
|
29
|
+
/**
|
|
30
|
+
* Returns the mutation classification for an op, or `null` if the op isn't
|
|
31
|
+
* a mutation. Called by both the lint warning rule and the runtime
|
|
32
|
+
* enforcement gate.
|
|
33
|
+
*/
|
|
34
|
+
export function classifyMutation(op) {
|
|
35
|
+
if (op.kind === "$") {
|
|
36
|
+
const toolName = op.body.split(/\s+/)[0] ?? "";
|
|
37
|
+
// `data_write` is explicitly a mutation tool name — flag it even though
|
|
38
|
+
// it doesn't start with `write_` (the canonical prefix anchor). The
|
|
39
|
+
// dotted-name match (`<connector>.data_write`) is also caught so
|
|
40
|
+
// qualified dispatch through a named bridge instance is gated identically.
|
|
41
|
+
const isDataWrite = toolName === "data_write" || /(?:^|_)data_write(?:_|$)/.test(toolName);
|
|
42
|
+
if (isDataWrite)
|
|
43
|
+
return { kind: "data_write", detail: toolName };
|
|
44
|
+
if (MUTATING_TOOL_PATTERN.test(toolName))
|
|
45
|
+
return { kind: "mutating_tool", detail: toolName };
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
if (op.kind === "file_write") {
|
|
49
|
+
return { kind: "file_write", detail: op.fileParams?.path ?? "" };
|
|
50
|
+
}
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The three authorization paths the spec defines. Predicate parity with
|
|
55
|
+
* the lint `unconfirmed-mutation` rule — runtime uses this to enforce
|
|
56
|
+
* what lint warns about.
|
|
57
|
+
*
|
|
58
|
+
* - `op.approved` truthy: per-op kwarg signaling author intent for this
|
|
59
|
+
* specific op. Any non-empty string accepts (presence is what matters;
|
|
60
|
+
* value not parsed semantically).
|
|
61
|
+
* - `skillAutonomous`: `# Autonomous: true` skill header — declares the
|
|
62
|
+
* whole skill as unattended-by-design; no per-op confirmation required.
|
|
63
|
+
* - `sawConfirm`: a `??` / `ask()` fired earlier in the same target's
|
|
64
|
+
* execution authorized subsequent mutation ops in iteration order.
|
|
65
|
+
*/
|
|
66
|
+
export function authorizationGranted(op, authState) {
|
|
67
|
+
if (typeof op.approved === "string" && op.approved.length > 0)
|
|
68
|
+
return true;
|
|
69
|
+
if (authState.skillAutonomous)
|
|
70
|
+
return true;
|
|
71
|
+
if (authState.sawConfirm)
|
|
72
|
+
return true;
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Build the concrete one-line remediation suggestion for an
|
|
77
|
+
* `UnconfirmedMutationError`. Names all three authorization paths so
|
|
78
|
+
* the adopter sees the full menu without bouncing to the docs.
|
|
79
|
+
*/
|
|
80
|
+
export function buildAuthorizationSuggestion(classification) {
|
|
81
|
+
const opPhrase = classification.kind === "data_write" ? "$ data_write"
|
|
82
|
+
: classification.kind === "mutating_tool" ? `$ ${classification.detail}`
|
|
83
|
+
: `file_write(path="${classification.detail}")`;
|
|
84
|
+
return (`Authorize this \`${opPhrase}\` op via one of three paths: ` +
|
|
85
|
+
`(1) add \`approved="reason"\` kwarg on the op itself; ` +
|
|
86
|
+
`(2) precede with \`??\` / \`ask(prompt="...")\` confirmation in the same target; ` +
|
|
87
|
+
`(3) declare \`# Autonomous: true\` at the skill header for cron/agent-fired skills.`);
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=mutation-gate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutation-gate.js","sourceRoot":"","sources":["../src/mutation-gate.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,6EAA6E;AAC7E,2EAA2E;AAC3E,0EAA0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AAC,QAAQ,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IAC3E,IAAI,SAAS,CAAC,eAAe;QAAE,OAAO,IAAI,CAAC;IAC3C,IAAI,SAAS,CAAC,UAAU;QAAE,OAAO,IAAI,CAAC;IACtC,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,4BAA4B,CAAC,cAAsC;IACjF,MAAM,QAAQ,GACZ,cAAc,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC,CAAC,cAAc;QACrD,CAAC,CAAC,cAAc,CAAC,IAAI,KAAK,eAAe,CAAC,CAAC,CAAC,KAAK,cAAc,CAAC,MAAM,EAAE;YACxE,CAAC,CAAC,oBAAoB,cAAc,CAAC,MAAM,IAAI,CAAC;IAClD,OAAO,CACL,oBAAoB,QAAQ,gCAAgC;QAC5D,wDAAwD;QACxD,mFAAmF;QACnF,qFAAqF,CACtF,CAAC;AACJ,CAAC"}
|
package/dist/runtime-config.d.ts
CHANGED
|
@@ -8,8 +8,8 @@ export interface SkillscriptConfig {
|
|
|
8
8
|
skillsDir?: string;
|
|
9
9
|
/** Absolute or relative path; trace records written here. */
|
|
10
10
|
traceDir?: string;
|
|
11
|
-
/** SQLite memory store db path. Absent → no
|
|
12
|
-
|
|
11
|
+
/** SQLite memory store db path. Absent → no DataStore wired. */
|
|
12
|
+
dataDbPath?: string;
|
|
13
13
|
/** Scheduler poll interval. Default 30s. */
|
|
14
14
|
pollIntervalSeconds?: number;
|
|
15
15
|
/** When true, `shell(unsafe=true)` ops are permitted. Default false. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-config.d.ts","sourceRoot":"","sources":["../src/runtime-config.ts"],"names":[],"mappings":"AAsBA;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,
|
|
1
|
+
{"version":3,"file":"runtime-config.d.ts","sourceRoot":"","sources":["../src/runtime-config.ts"],"names":[],"mappings":"AAsBA;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gEAAgE;IAChE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4CAA4C;IAC5C,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,wEAAwE;IACxE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,8DAA8D;IAC9D,IAAI,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;IAC7B,gDAAgD;IAChD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iCAAiC;IACjC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,sCAAsC;IACtC,SAAS,CAAC,EAAE;QACV,8BAA8B;QAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,yCAAyC;QACzC,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;CACH;AAED,MAAM,WAAW,yBAAyB;IACxC,+EAA+E;IAC/E,IAAI,EAAE,MAAM,CAAC;IACb,sEAAsE;IACtE,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CACzB;AAED,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,iBAAiB,CAAC;IAC1B,8DAA8D;IAC9D,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,yBAAyB,GAAG,2BAA2B,CA0FlG"}
|
package/dist/runtime-config.js
CHANGED
|
@@ -57,7 +57,7 @@ export function loadSkillscriptConfig(opts) {
|
|
|
57
57
|
return { config: {}, errors };
|
|
58
58
|
const config = {};
|
|
59
59
|
const obj = resolved;
|
|
60
|
-
const stringFields = ["skillsDir", "traceDir", "
|
|
60
|
+
const stringFields = ["skillsDir", "traceDir", "dataDbPath", "triggersFilePath", "connectorsConfigPath"];
|
|
61
61
|
for (const field of stringFields) {
|
|
62
62
|
if (obj[field] === undefined)
|
|
63
63
|
continue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-config.js","sourceRoot":"","sources":["../src/runtime-config.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,6EAA6E;AAC7E,gEAAgE;AAChE,EAAE;AACF,8EAA8E;AAC9E,0EAA0E;AAC1E,0EAA0E;AAC1E,8CAA8C;AAC9C,EAAE;AACF,wEAAwE;AACxE,2EAA2E;AAC3E,0EAA0E;AAC1E,qEAAqE;AACrE,EAAE;AACF,0EAA0E;AAC1E,6EAA6E;AAC7E,4EAA4E;AAC5E,iEAAiE;AAEjE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AA8ChE;;;;;;;;;;GAUG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAA+B;IACnE,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IACpC,IAAI,GAAW,CAAC;IAChB,IAAI,CAAC;QACH,GAAG,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACxC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,IAAI,GAAI,GAA6B,CAAC,IAAI,CAAC;QACjD,IAAI,IAAI,KAAK,QAAQ;YAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;QACzD,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,4CAA4C,IAAI,CAAC,IAAI,MAAO,GAAa,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;IACvH,CAAC;IAED,IAAI,MAAe,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AC,EAAE,EAAE,CAAC,oBAAoB,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;IACxF,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAChD,MAAM,GAAG,GAA4B,EAAE,CAAC;QACxC,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;YAAE,GAAG,CAAC,CAAC,CAAC,GAAG,oBAAoB,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QAC1F,OAAO,GAAG,CAAC;IACb,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/runtime.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAuB,MAAM,aAAa,CAAC;AACpE,OAAO,KAAK,EAAgB,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAK3E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAuB,MAAM,aAAa,CAAC;AACpE,OAAO,KAAK,EAAgB,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAK3E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAwBzD,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE1D;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,QAAQ,CAAC;IACnB,uFAAuF;IACvF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+HAA+H;IAC/H,YAAY,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AAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAYxF;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAoClF;AAmCD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAY3E;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,CAMjD;AAsHD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAsB/E"}
|
package/dist/runtime.js
CHANGED
|
@@ -6,7 +6,8 @@ import { validateQualifiedDispatch } from "./dispatch-validate.js";
|
|
|
6
6
|
import { spawn } from "node:child_process";
|
|
7
7
|
import { readFile as fsReadFile, writeFile as fsWriteFile, mkdir as fsMkdir } from "node:fs/promises";
|
|
8
8
|
import { dirname as pathDirname } from "node:path";
|
|
9
|
-
import { OpError, ConnectorNotFoundError, OpTimeoutError, InteractiveOpInAutonomousModeError, UnsafeShellDisabledError, UnresolvedVariableError, TypeMismatchError, MissingSkillReferenceError, messageOf, } from "./errors.js";
|
|
9
|
+
import { OpError, ConnectorNotFoundError, OpTimeoutError, InteractiveOpInAutonomousModeError, UnsafeShellDisabledError, UnresolvedVariableError, TypeMismatchError, MissingSkillReferenceError, UnconfirmedMutationError, messageOf, } from "./errors.js";
|
|
10
|
+
import { classifyMutation, authorizationGranted, buildAuthorizationSuggestion, } from "./mutation-gate.js";
|
|
10
11
|
import { TraceBuilder, shouldTraceFire } from "./trace.js";
|
|
11
12
|
/**
|
|
12
13
|
* v0.9.6 audit Q8 — build the `DeliveryMeta` envelope for an `AgentConnector.deliver()`
|
|
@@ -111,8 +112,15 @@ export async function execute(parsed, initialVars, order, ctx) {
|
|
|
111
112
|
continue;
|
|
112
113
|
let targetLastBound = null;
|
|
113
114
|
let targetLastValue = undefined;
|
|
115
|
+
// v0.14.1 — fresh mutation-auth state per target. `skillAutonomous`
|
|
116
|
+
// is set from the parsed header; `sawConfirm` resets so a `??` in
|
|
117
|
+
// target T1 doesn't authorize mutations in T2 (correct scope).
|
|
118
|
+
const authState = {
|
|
119
|
+
skillAutonomous: parsed.autonomous === true,
|
|
120
|
+
sawConfirm: false,
|
|
121
|
+
};
|
|
114
122
|
try {
|
|
115
|
-
const r = await execOps(target.ops, vars, emissions, fallbacks, ctx, targetName, parsed.timeout, absoluteTimeoutMs, traceBuilder);
|
|
123
|
+
const r = await execOps(target.ops, vars, emissions, fallbacks, ctx, targetName, parsed.timeout, absoluteTimeoutMs, traceBuilder, authState);
|
|
116
124
|
targetLastBound = r.lastBoundVar;
|
|
117
125
|
targetLastValue = r.lastBoundVar !== null ? vars.get(r.lastBoundVar) : r.lastValue;
|
|
118
126
|
}
|
|
@@ -120,7 +128,7 @@ export async function execute(parsed, initialVars, order, ctx) {
|
|
|
120
128
|
errors.push(buildExecutionError(err, targetName));
|
|
121
129
|
if (target.elseBlock !== undefined) {
|
|
122
130
|
try {
|
|
123
|
-
const r = await execOps(target.elseBlock, vars, emissions, fallbacks, ctx, targetName, parsed.timeout, absoluteTimeoutMs, traceBuilder);
|
|
131
|
+
const r = await execOps(target.elseBlock, vars, emissions, fallbacks, ctx, targetName, parsed.timeout, absoluteTimeoutMs, traceBuilder, authState);
|
|
124
132
|
targetLastBound = r.lastBoundVar;
|
|
125
133
|
targetLastValue = r.lastBoundVar !== null ? vars.get(r.lastBoundVar) : r.lastValue;
|
|
126
134
|
}
|
|
@@ -264,11 +272,21 @@ export async function execute(parsed, initialVars, order, ctx) {
|
|
|
264
272
|
agentDeliveryReceipts,
|
|
265
273
|
};
|
|
266
274
|
}
|
|
267
|
-
async function execOps(ops, vars, emissions, fallbacks, ctx, targetName, skillTimeoutSec, absoluteTimeoutMs, traceBuilder) {
|
|
275
|
+
async function execOps(ops, vars, emissions, fallbacks, ctx, targetName, skillTimeoutSec, absoluteTimeoutMs, traceBuilder, authState) {
|
|
268
276
|
let lastBoundVar = null;
|
|
269
277
|
let lastValue = undefined;
|
|
270
278
|
for (const op of ops) {
|
|
271
|
-
|
|
279
|
+
// v0.14.1 Layer A — load-bearing mutation gate. Flip `sawConfirm` for the
|
|
280
|
+
// current op iteration in lint-parity order (`??` flips before its own
|
|
281
|
+
// gate check) so a `??` op's own classification path stays consistent
|
|
282
|
+
// with lint. Non-mutation `??` skips the throw branch naturally.
|
|
283
|
+
if (op.kind === "??")
|
|
284
|
+
authState.sawConfirm = true;
|
|
285
|
+
const mutKind = classifyMutation(op);
|
|
286
|
+
if (mutKind !== null && !authorizationGranted(op, authState)) {
|
|
287
|
+
throw new UnconfirmedMutationError(mutKind.kind, mutKind.detail, ["# Autonomous: true header", "preceding ?? / ask() in same target", "approved=\"reason\" per-op kwarg"], buildAuthorizationSuggestion(mutKind), op.kind, targetName);
|
|
288
|
+
}
|
|
289
|
+
const r = await execOp(op, vars, emissions, fallbacks, ctx, targetName, skillTimeoutSec, absoluteTimeoutMs, traceBuilder, authState);
|
|
272
290
|
if (r.lastBoundVar !== null) {
|
|
273
291
|
lastBoundVar = r.lastBoundVar;
|
|
274
292
|
lastValue = r.lastValue;
|
|
@@ -279,11 +297,11 @@ async function execOps(ops, vars, emissions, fallbacks, ctx, targetName, skillTi
|
|
|
279
297
|
}
|
|
280
298
|
return { lastBoundVar, lastValue };
|
|
281
299
|
}
|
|
282
|
-
async function execOp(op, vars, emissions, fallbacks, ctx, targetName, skillTimeoutSec, absoluteTimeoutMs, traceBuilder) {
|
|
300
|
+
async function execOp(op, vars, emissions, fallbacks, ctx, targetName, skillTimeoutSec, absoluteTimeoutMs, traceBuilder, authState) {
|
|
283
301
|
const startMs = traceBuilder !== null ? Date.now() : 0;
|
|
284
302
|
let errored = false;
|
|
285
303
|
try {
|
|
286
|
-
return await execOpInner(op, vars, emissions, fallbacks, ctx, targetName, skillTimeoutSec, absoluteTimeoutMs, traceBuilder);
|
|
304
|
+
return await execOpInner(op, vars, emissions, fallbacks, ctx, targetName, skillTimeoutSec, absoluteTimeoutMs, traceBuilder, authState);
|
|
287
305
|
}
|
|
288
306
|
catch (err) {
|
|
289
307
|
errored = true;
|
|
@@ -318,7 +336,7 @@ function extractOpConnector(op) {
|
|
|
318
336
|
default: return undefined;
|
|
319
337
|
}
|
|
320
338
|
}
|
|
321
|
-
async function execOpInner(op, vars, emissions, fallbacks, ctx, targetName, skillTimeoutSec, absoluteTimeoutMs, traceBuilder) {
|
|
339
|
+
async function execOpInner(op, vars, emissions, fallbacks, ctx, targetName, skillTimeoutSec, absoluteTimeoutMs, traceBuilder, authState = { skillAutonomous: false, sawConfirm: false }) {
|
|
322
340
|
switch (op.kind) {
|
|
323
341
|
case "$set": {
|
|
324
342
|
// v0.5.0 item 3 — `$set X = "...$(REF)..."` now resolves $(REF) at
|
|
@@ -503,6 +521,16 @@ async function execOpInner(op, vars, emissions, fallbacks, ctx, targetName, skil
|
|
|
503
521
|
case "file_write": {
|
|
504
522
|
// v0.7.0 — runtime-intrinsic file write. Substitutes `${VAR}` /
|
|
505
523
|
// `$(VAR)` in both path and content before writing.
|
|
524
|
+
// v0.14.1 Layer B — mutation gate regression guard. Same predicate
|
|
525
|
+
// as Layer A in `execOps`; defense-in-depth against any future
|
|
526
|
+
// caller that bypasses the dispatcher. Fail-closed default authState
|
|
527
|
+
// makes this throw if invoked outside the normal execOps path.
|
|
528
|
+
{
|
|
529
|
+
const mutKind = classifyMutation(op);
|
|
530
|
+
if (mutKind !== null && !authorizationGranted(op, authState)) {
|
|
531
|
+
throw new UnconfirmedMutationError(mutKind.kind, mutKind.detail, ["# Autonomous: true header", "preceding ?? / ask() in same target", "approved=\"reason\" per-op kwarg"], buildAuthorizationSuggestion(mutKind), op.kind, targetName);
|
|
532
|
+
}
|
|
533
|
+
}
|
|
506
534
|
const rawPath = op.fileParams?.path ?? "";
|
|
507
535
|
const rawContent = op.fileParams?.content ?? "";
|
|
508
536
|
const path = substituteRuntime(rawPath, vars);
|
|
@@ -597,6 +625,20 @@ async function execOpInner(op, vars, emissions, fallbacks, ctx, targetName, skil
|
|
|
597
625
|
return { lastBoundVar: op.outputVar ?? flatKey, lastValue: ack };
|
|
598
626
|
}
|
|
599
627
|
case "$": {
|
|
628
|
+
// v0.14.1 Layer B — mutation gate regression guard. Re-checks at the
|
|
629
|
+
// `$` dispatch site for `data_write` + mutating-name shapes; same
|
|
630
|
+
// predicate as Layer A in `execOps`. Fail-closed default authState
|
|
631
|
+
// means a caller that bypasses execOps and calls execOpInner directly
|
|
632
|
+
// (or a future dispatch surface that forgets to plumb authState)
|
|
633
|
+
// throws instead of silently dispatching the mutation. Non-mutation
|
|
634
|
+
// `$` ops (`$ search_*`, `$ llm`, etc.) pass through cleanly because
|
|
635
|
+
// `classifyMutation` returns null.
|
|
636
|
+
{
|
|
637
|
+
const mutKind = classifyMutation(op);
|
|
638
|
+
if (mutKind !== null && !authorizationGranted(op, authState)) {
|
|
639
|
+
throw new UnconfirmedMutationError(mutKind.kind, mutKind.detail, ["# Autonomous: true header", "preceding ?? / ask() in same target", "approved=\"reason\" per-op kwarg"], buildAuthorizationSuggestion(mutKind), op.kind, targetName);
|
|
640
|
+
}
|
|
641
|
+
}
|
|
600
642
|
const body = substituteRuntime(op.body, vars);
|
|
601
643
|
const m = /^([A-Za-z_][\w:-]*)\s*([\s\S]*)$/.exec(body);
|
|
602
644
|
if (m === null) {
|
|
@@ -664,7 +706,7 @@ async function execOpInner(op, vars, emissions, fallbacks, ctx, targetName, skil
|
|
|
664
706
|
// v0.7.2 — bare-form name-match dispatch resolution. When `$ <name> ...`
|
|
665
707
|
// is bare (no dotted prefix) AND `<name>` matches a registered
|
|
666
708
|
// connector name, route to that connector directly. This makes the
|
|
667
|
-
// canonical `$ llm prompt="..."` and `$
|
|
709
|
+
// canonical `$ llm prompt="..."` and `$ data_read mode=... query=...
|
|
668
710
|
// limit=N` paths work in default deployments where the bridges are
|
|
669
711
|
// auto-wired as `llm` + `memory` (rather than as `primary`). If
|
|
670
712
|
// `<name>` isn't a registered connector, fall back to the legacy
|
|
@@ -720,10 +762,10 @@ async function execOpInner(op, vars, emissions, fallbacks, ctx, targetName, skil
|
|
|
720
762
|
// errors silently, masking real failures. Now: throw, so the
|
|
721
763
|
// op-level (fallback:) catch below can recover if declared, or
|
|
722
764
|
// the error surfaces immediately.
|
|
723
|
-
// v0.10 — when bare-form (`$ llm`/`$
|
|
765
|
+
// v0.10 — when bare-form (`$ llm`/`$ data_read`/`$ data_write`),
|
|
724
766
|
// pass the tool name so the error message surfaces substrate-aware
|
|
725
767
|
// remediation copy (point cold authors at `substrate.local_model`/
|
|
726
|
-
// `substrate.
|
|
768
|
+
// `substrate.data_store` in connectors.json, not the generic API).
|
|
727
769
|
throw new ConnectorNotFoundError(connectorName, "mcp_connector", "$", targetName, op.mcpConnector === undefined ? toolName : undefined);
|
|
728
770
|
}
|
|
729
771
|
}
|
|
@@ -777,13 +819,13 @@ async function execOpInner(op, vars, emissions, fallbacks, ctx, targetName, skil
|
|
|
777
819
|
const mechanicalValue = p.fallback !== undefined
|
|
778
820
|
? p.fallback
|
|
779
821
|
: [makeMechanicalPlaceholder(`${op.outputVar}[0]`)];
|
|
780
|
-
emissions.push(`Would query
|
|
822
|
+
emissions.push(`Would query DataStore \`${p.connector}\` with mode=${p.mode}, ` +
|
|
781
823
|
`query="${querySub}", limit=${p.limit} (mechanical: true preview). ` +
|
|
782
824
|
`Binding $(${op.outputVar}) = placeholder result set.`);
|
|
783
825
|
vars.set(op.outputVar, mechanicalValue);
|
|
784
826
|
return { lastBoundVar: op.outputVar, lastValue: mechanicalValue };
|
|
785
827
|
}
|
|
786
|
-
const store = ctx.registry.
|
|
828
|
+
const store = ctx.registry.getDataStore(p.connector);
|
|
787
829
|
const limitResolved = resolveIntParam(p.limit, vars, "limit");
|
|
788
830
|
const filters = {
|
|
789
831
|
query: querySub,
|
|
@@ -876,7 +918,7 @@ async function execOpInner(op, vars, emissions, fallbacks, ctx, targetName, skil
|
|
|
876
918
|
let last = { lastBoundVar: null, lastValue: undefined };
|
|
877
919
|
for (const item of listVal) {
|
|
878
920
|
vars.set(iterName, item);
|
|
879
|
-
last = await execOps(op.foreachBody, vars, emissions, fallbacks, ctx, targetName, skillTimeoutSec, absoluteTimeoutMs, traceBuilder);
|
|
921
|
+
last = await execOps(op.foreachBody, vars, emissions, fallbacks, ctx, targetName, skillTimeoutSec, absoluteTimeoutMs, traceBuilder, authState);
|
|
880
922
|
}
|
|
881
923
|
for (const k of Array.from(vars.keys())) {
|
|
882
924
|
if (!before.has(k))
|
|
@@ -887,11 +929,11 @@ async function execOpInner(op, vars, emissions, fallbacks, ctx, targetName, skil
|
|
|
887
929
|
case "if": {
|
|
888
930
|
for (const branch of op.ifBranches) {
|
|
889
931
|
if (evalCondition(branch.cond, vars)) {
|
|
890
|
-
return execOps(branch.body, vars, emissions, fallbacks, ctx, targetName, skillTimeoutSec, absoluteTimeoutMs, traceBuilder);
|
|
932
|
+
return execOps(branch.body, vars, emissions, fallbacks, ctx, targetName, skillTimeoutSec, absoluteTimeoutMs, traceBuilder, authState);
|
|
891
933
|
}
|
|
892
934
|
}
|
|
893
935
|
if (op.ifElseBody !== undefined) {
|
|
894
|
-
return execOps(op.ifElseBody, vars, emissions, fallbacks, ctx, targetName, skillTimeoutSec, absoluteTimeoutMs, traceBuilder);
|
|
936
|
+
return execOps(op.ifElseBody, vars, emissions, fallbacks, ctx, targetName, skillTimeoutSec, absoluteTimeoutMs, traceBuilder, authState);
|
|
895
937
|
}
|
|
896
938
|
return { lastBoundVar: null, lastValue: undefined };
|
|
897
939
|
}
|
|
@@ -1219,7 +1261,7 @@ function resolveListExpr(expr, vars) {
|
|
|
1219
1261
|
}
|
|
1220
1262
|
/**
|
|
1221
1263
|
* Unwrap `CallToolResult`-shaped values into the meaningful payload.
|
|
1222
|
-
* Symmetry with `>` (binds `
|
|
1264
|
+
* Symmetry with `>` (binds `PortableData[]`) and `~` (binds the response
|
|
1223
1265
|
* string) — `$` should bind the *content*, not the wire envelope.
|
|
1224
1266
|
*
|
|
1225
1267
|
* Rules:
|