skillscript-runtime 0.15.7 → 0.16.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 +23 -24
- package/dist/compile.js +25 -71
- package/dist/compile.js.map +1 -1
- package/dist/connectors/mcp-remote.d.ts.map +1 -1
- package/dist/connectors/mcp-remote.js +7 -1
- package/dist/connectors/mcp-remote.js.map +1 -1
- package/dist/errors.d.ts +13 -7
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +20 -13
- package/dist/errors.js.map +1 -1
- package/dist/help-content.d.ts.map +1 -1
- package/dist/help-content.js +78 -103
- package/dist/help-content.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lint.d.ts.map +1 -1
- package/dist/lint.js +167 -228
- package/dist/lint.js.map +1 -1
- package/dist/mutation-gate.d.ts +7 -13
- package/dist/mutation-gate.d.ts.map +1 -1
- package/dist/mutation-gate.js +6 -11
- package/dist/mutation-gate.js.map +1 -1
- package/dist/parser.d.ts +25 -74
- package/dist/parser.d.ts.map +1 -1
- package/dist/parser.js +80 -272
- package/dist/parser.js.map +1 -1
- package/dist/runtime.d.ts +1 -10
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +76 -188
- package/dist/runtime.js.map +1 -1
- package/dist/safe-path.d.ts +20 -0
- package/dist/safe-path.d.ts.map +1 -0
- package/dist/safe-path.js +49 -0
- package/dist/safe-path.js.map +1 -0
- package/dist/skill-manager.js +1 -1
- package/dist/skill-manager.js.map +1 -1
- package/dist/trace.d.ts.map +1 -1
- package/dist/trace.js +26 -9
- package/dist/trace.js.map +1 -1
- package/docs/language-reference.md +3 -24
- package/examples/README.md +1 -2
- package/examples/connectors/McpConnectorTemplate/McpConnectorTemplate.ts +4 -5
- package/examples/connectors/SkillStoreTemplate/SkillStoreTemplate.ts +9 -9
- package/examples/custom-bootstrap.example.ts +4 -4
- package/examples/onboarding-scaffold/bootstrap.ts +7 -7
- package/examples/onboarding-scaffold/file-data-store.ts +3 -5
- package/examples/onboarding-scaffold/openai-local-model.ts +7 -8
- package/examples/onboarding-scaffold/tmux-shell-agent-connector.ts +4 -4
- package/examples/skillscripts/hello-world.skill.provenance.json +1 -1
- package/package.json +1 -1
- package/examples/skillscripts/cut-release-tag.skill.md +0 -40
package/dist/parser.d.ts
CHANGED
|
@@ -1,52 +1,20 @@
|
|
|
1
|
-
export type OpKind = "$" | "$set" | "$append" | "?" | "
|
|
1
|
+
export type OpKind = "$" | "$set" | "$append" | "?" | "shell" | "emit" | "foreach" | "if" | "inline" | "file_read" | "file_write" | "notify";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* Runtime-intrinsic function-call names. Closed set of ops the language
|
|
4
|
+
* implements directly (no MCP dispatch). Function-call grammar:
|
|
5
5
|
* `verb(kwarg=value, ...) [-> BINDING]`.
|
|
6
6
|
*
|
|
7
7
|
* Anything else with function-call shape is rejected by parser with a
|
|
8
8
|
* remediation pointing at `$ tool args -> R` for MCP dispatch.
|
|
9
9
|
*/
|
|
10
|
-
export declare const RUNTIME_INTRINSIC_FN_NAMES: readonly ["emit", "
|
|
10
|
+
export declare const RUNTIME_INTRINSIC_FN_NAMES: readonly ["emit", "inline", "execute_skill", "shell", "file_read", "file_write", "notify"];
|
|
11
11
|
export interface SkillOp {
|
|
12
12
|
kind: OpKind;
|
|
13
13
|
body: string;
|
|
14
14
|
outputVar?: string;
|
|
15
15
|
mcpConnector?: string;
|
|
16
|
-
retrievalParams?: {
|
|
17
|
-
mode: string;
|
|
18
|
-
query: string;
|
|
19
|
-
/** Integer literal OR a `$(VAR)`-style ref string. Runtime substitutes refs then parses to int. */
|
|
20
|
-
limit: number | string;
|
|
21
|
-
connector: string;
|
|
22
|
-
extra: Record<string, string>;
|
|
23
|
-
/**
|
|
24
|
-
* Op-level fallback (per language reference §9). When the retrieval
|
|
25
|
-
* throws or returns an empty array, runtime binds this value (string)
|
|
26
|
-
* to the output var instead of propagating the error.
|
|
27
|
-
*/
|
|
28
|
-
fallback?: string;
|
|
29
|
-
};
|
|
30
|
-
localModelParams?: {
|
|
31
|
-
prompt: string;
|
|
32
|
-
model?: string;
|
|
33
|
-
/** Integer literal OR a `$(VAR)`-style ref string. Runtime substitutes refs then parses to int. */
|
|
34
|
-
maxTokens?: number | string;
|
|
35
|
-
/**
|
|
36
|
-
* Per-op timeout override in SECONDS (per decision 7 resolution chain).
|
|
37
|
-
* Integer literal OR `$(VAR)` ref. Per-op wins over skill `# Timeout:`
|
|
38
|
-
* header, connector default, and built-in fallback.
|
|
39
|
-
*/
|
|
40
|
-
timeoutSeconds?: number | string;
|
|
41
|
-
/**
|
|
42
|
-
* Op-level fallback (per language reference §9). When the model call
|
|
43
|
-
* throws or returns an empty (trimmed) response, runtime binds this
|
|
44
|
-
* value to the output var instead of propagating the error.
|
|
45
|
-
*/
|
|
46
|
-
fallback?: string;
|
|
47
|
-
};
|
|
48
16
|
/**
|
|
49
|
-
*
|
|
17
|
+
* `inline` ops only: skill name + optional key=value args passed as inputs
|
|
50
18
|
* when the target is procedural (runtime invocation), ignored when the
|
|
51
19
|
* target is data-typed (compile-time inline). `outputVar` captures the
|
|
52
20
|
* result of procedural invocations; absent for data inlines.
|
|
@@ -56,23 +24,18 @@ export interface SkillOp {
|
|
|
56
24
|
args: Record<string, string>;
|
|
57
25
|
};
|
|
58
26
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* `
|
|
63
|
-
*
|
|
64
|
-
* decision 2 — one binary, no shell interpretation.
|
|
27
|
+
* `shell` ops only: when `unsafe=true` kwarg is set, the runtime routes
|
|
28
|
+
* through full-shell exec (vs default structured-spawn sandbox). Refused
|
|
29
|
+
* unless `runtime.enable_unsafe_shell = true` (default false). Default
|
|
30
|
+
* `shell(...)` ops route through structured spawn — one binary, no shell
|
|
31
|
+
* interpretation.
|
|
65
32
|
*/
|
|
66
33
|
policy?: "unsafe";
|
|
67
34
|
setName?: string;
|
|
68
35
|
setValue?: string;
|
|
69
36
|
/**
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
* runtime binds this value to the output var instead of propagating
|
|
73
|
-
* the error. `~` and `>` ops carry fallback on their params bag for
|
|
74
|
-
* type-specific coercion; `$` returns are heterogeneous (objects,
|
|
75
|
-
* arrays, strings) so it lives at the op level.
|
|
37
|
+
* Op-level fallback. On op throw or empty result, runtime binds this value
|
|
38
|
+
* to the output var instead of propagating the error.
|
|
76
39
|
*/
|
|
77
40
|
fallback?: string;
|
|
78
41
|
foreachIter?: string;
|
|
@@ -84,7 +47,7 @@ export interface SkillOp {
|
|
|
84
47
|
}>;
|
|
85
48
|
ifElseBody?: SkillOp[];
|
|
86
49
|
/**
|
|
87
|
-
*
|
|
50
|
+
* `file_read` / `file_write` op params. `path` is the filesystem path
|
|
88
51
|
* (may contain `${VAR}` substitutions resolved at runtime). `content` is
|
|
89
52
|
* the body to write (file_write only).
|
|
90
53
|
*/
|
|
@@ -93,41 +56,29 @@ export interface SkillOp {
|
|
|
93
56
|
content?: string;
|
|
94
57
|
};
|
|
95
58
|
/**
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
59
|
+
* `notify` op params. `agent` is the target agent identifier (required,
|
|
60
|
+
* may contain `${VAR}` substitutions resolved at runtime). `message` is
|
|
61
|
+
* the explicit message body (optional — runtime defaults to the joined
|
|
62
|
+
* accumulated emissions when absent). `connectors` is an optional
|
|
63
|
+
* restriction list — when present, only AgentConnectors whose registered
|
|
64
|
+
* name is in this list are dispatched to.
|
|
102
65
|
*/
|
|
103
66
|
notifyParams?: {
|
|
104
67
|
agent: string;
|
|
105
68
|
message?: string;
|
|
106
69
|
connectors?: string[];
|
|
107
|
-
/**
|
|
70
|
+
/** Adopter-defined routing vocab; flows to `meta.event_type`. */
|
|
108
71
|
event_type?: string;
|
|
109
|
-
/**
|
|
72
|
+
/** Reply-correlation primitive; flows to `meta.correlation_id`. */
|
|
110
73
|
correlation_id?: string;
|
|
111
74
|
};
|
|
112
75
|
/**
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
76
|
+
* Inline `approved="reason"` kwarg captured on mutation-class function-call
|
|
77
|
+
* ops. Author intent marker; lint's `unconfirmed-mutation` rule accepts
|
|
78
|
+
* presence (any non-empty string) as per-op authorization when
|
|
79
|
+
* `# Autonomous: true` is not declared.
|
|
117
80
|
*/
|
|
118
81
|
approved?: string;
|
|
119
|
-
/**
|
|
120
|
-
* v0.7.1 — source-form marker. The parser collapses canonical
|
|
121
|
-
* function-call ops (`emit(text="...")`, `shell(command="...")`, etc.)
|
|
122
|
-
* to the same AST `kind` as the legacy symbol form (`! ...`, `@ ...`,
|
|
123
|
-
* etc.) so runtime/render/lint share one dispatch path. This field
|
|
124
|
-
* preserves which surface the author wrote so the `deprecated-symbol-op`
|
|
125
|
-
* lint can fire only on legacy-form occurrences.
|
|
126
|
-
*
|
|
127
|
-
* `"function-call"` = author wrote `verb(kwargs)` shape.
|
|
128
|
-
* `undefined` = author wrote symbol form (legacy).
|
|
129
|
-
*/
|
|
130
|
-
sourceForm?: "function-call";
|
|
131
82
|
}
|
|
132
83
|
export interface SkillTarget {
|
|
133
84
|
name: string;
|
package/dist/parser.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../src/parser.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,MAAM,GAAG,GAAG,GAAG,MAAM,GAAG,SAAS,GAAG,GAAG,GAAG,
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../src/parser.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,MAAM,GAAG,GAAG,GAAG,MAAM,GAAG,SAAS,GAAG,GAAG,G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