skillscript-runtime 0.18.1 → 0.18.2
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/connectors/agent-noop.d.ts.map +1 -1
- package/dist/connectors/agent-noop.js +6 -1
- package/dist/connectors/agent-noop.js.map +1 -1
- package/dist/connectors/agent.d.ts +66 -0
- package/dist/connectors/agent.d.ts.map +1 -1
- package/examples/connectors/HttpWebhookAgentConnector/HttpWebhookAgentConnector.ts +11 -5
- package/examples/connectors/HttpWebhookAgentConnector/tests/HttpWebhookAgentConnector.test.ts +6 -3
- package/examples/skillscripts/hello-world.skill.provenance.json +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-noop.d.ts","sourceRoot":"","sources":["../../src/connectors/agent-noop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,WAAW,EACX,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,QAAQ,EACR,QAAQ,EACR,WAAW,EACZ,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAE7D;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,kBAAmB,YAAW,cAAc;IACvD,MAAM,CAAC,kBAAkB,IAAI,0BAA0B;IASjD,WAAW,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;IAIzC,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IAO7E,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"agent-noop.d.ts","sourceRoot":"","sources":["../../src/connectors/agent-noop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,WAAW,EACX,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,QAAQ,EACR,QAAQ,EACR,WAAW,EACZ,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAE7D;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,kBAAmB,YAAW,cAAc;IACvD,MAAM,CAAC,kBAAkB,IAAI,0BAA0B;IASjD,WAAW,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;IAIzC,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IAO7E,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC;IAY9D,YAAY,IAAI,OAAO,CAAC,OAAO,CAAC;IAQhC,gBAAgB,CACpB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,eAAe,EACzB,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAAC,QAAQ,CAAC;IAad,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;CAO5D"}
|
|
@@ -32,7 +32,12 @@ export class NoOpAgentConnector {
|
|
|
32
32
|
}
|
|
33
33
|
async wake(agent_id, _opts) {
|
|
34
34
|
process.stderr.write(`[NoOpAgentConnector] wake(${agent_id}) — no substrate wired; wake skipped.\n`);
|
|
35
|
-
|
|
35
|
+
// v0.18.2 — graceful degradation: NoOp can't interrupt anything, so
|
|
36
|
+
// it reports `woken: false`. Callers reading the receipt distinguish
|
|
37
|
+
// delivered-only from actually-woke without needing per-substrate
|
|
38
|
+
// knowledge. Per Perry's degradation requirement: conform by
|
|
39
|
+
// degrading, never by erroring.
|
|
40
|
+
return { woken_at: Date.now(), woken: false };
|
|
36
41
|
}
|
|
37
42
|
async health_check() {
|
|
38
43
|
// NoOp is always "healthy" — there's no real substrate to fail. Adopters
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-noop.js","sourceRoot":"","sources":["../../src/connectors/agent-noop.ts"],"names":[],"mappings":"AAaA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,kBAAkB;IAC7B,MAAM,CAAC,kBAAkB;QACvB,OAAO;YACL,cAAc,EAAE,iBAAiB;YACjC,cAAc,EAAE,oBAAoB;YACpC,gBAAgB,EAAE,OAAO;YACzB,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE;SACnG,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,WAAW;QACf,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,QAAgB,EAAE,OAAwB;QACtD,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,gCAAgC,QAAQ,UAAU,OAAO,CAAC,IAAI,iBAAiB,OAAO,CAAC,IAAI,CAAC,WAAW,8CAA8C,CACtJ,CAAC;QACF,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,QAAgB,EAAE,KAAgB;QAC3C,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,6BAA6B,QAAQ,yCAAyC,CAC/E,CAAC;QACF,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"agent-noop.js","sourceRoot":"","sources":["../../src/connectors/agent-noop.ts"],"names":[],"mappings":"AAaA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,kBAAkB;IAC7B,MAAM,CAAC,kBAAkB;QACvB,OAAO;YACL,cAAc,EAAE,iBAAiB;YACjC,cAAc,EAAE,oBAAoB;YACpC,gBAAgB,EAAE,OAAO;YACzB,QAAQ,EAAE,EAAE,O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;QAC3B,OAAO,SAAS,CAAC;IACnB,CAAC;CACF"}
|
|
@@ -104,6 +104,14 @@ export interface DeliveryReceipt {
|
|
|
104
104
|
delivered_at: number;
|
|
105
105
|
/** Substrate-specific id for callers to correlate later. */
|
|
106
106
|
delivery_id?: string;
|
|
107
|
+
/**
|
|
108
|
+
* v0.18.2 — the session that received the delivery. Set when the
|
|
109
|
+
* substrate routes to a specific session (mailbox-pull per terminal,
|
|
110
|
+
* webhook per running-tab, etc.). Omit if the substrate is
|
|
111
|
+
* agent-level only (Slack DM, email — no session concept) or if the
|
|
112
|
+
* substrate elected to fan out / accept without specific session.
|
|
113
|
+
*/
|
|
114
|
+
session_id?: string;
|
|
107
115
|
/**
|
|
108
116
|
* Adopter signals "accepted but not pushed to the agent" — agent offline,
|
|
109
117
|
* rate-limit drop, tmux session exists but agent hasn't read, etc.
|
|
@@ -141,9 +149,39 @@ export interface WakeOpts {
|
|
|
141
149
|
context?: string;
|
|
142
150
|
/** `"immediate"` (default) or a unix-ms timestamp for scheduled wake. */
|
|
143
151
|
when?: "immediate" | number;
|
|
152
|
+
/**
|
|
153
|
+
* v0.18.2 — optional structured session targeting. Alternative to
|
|
154
|
+
* embedding `agent@session` in the `agent_id` opaque string. Callers
|
|
155
|
+
* with the session already separated (e.g., dashboard's per-session
|
|
156
|
+
* "wake this terminal" action) pass it here. Substrates that don't
|
|
157
|
+
* track sessions ignore the field; substrates that do route the wake
|
|
158
|
+
* to the named session. Per Perry's `e1ef003`-thread session-granular
|
|
159
|
+
* targeting requirement.
|
|
160
|
+
*/
|
|
161
|
+
session_id?: string;
|
|
144
162
|
}
|
|
163
|
+
/**
|
|
164
|
+
* v0.18.2 — `woken` is the required honesty signal. Wake-capable
|
|
165
|
+
* substrates (live tmux session, browser-tab open, push-channel
|
|
166
|
+
* connected) set `woken: true` after delivering an attention signal.
|
|
167
|
+
* Passive substrates (webhook, file-drop, store-only) can't interrupt
|
|
168
|
+
* and degrade gracefully: deliver the content, set `woken: false`. Per
|
|
169
|
+
* Perry's graceful-degradation requirement — "conform by degrading,
|
|
170
|
+
* never by erroring." Callers reading the receipt distinguish
|
|
171
|
+
* interrupted-them from delivered-only without needing per-substrate
|
|
172
|
+
* knowledge.
|
|
173
|
+
*/
|
|
145
174
|
export interface WakeReceipt {
|
|
146
175
|
woken_at: number;
|
|
176
|
+
/** `true` if substrate actually woke the session; `false` if degraded to deliver-only. */
|
|
177
|
+
woken: boolean;
|
|
178
|
+
/**
|
|
179
|
+
* The session that received the wake (or delivery, if degraded). Set
|
|
180
|
+
* when the substrate knows; omit if the substrate doesn't track
|
|
181
|
+
* sessions. With session-targeted wake input, this typically echoes
|
|
182
|
+
* the requested session; with bare `agent_id`, the substrate's
|
|
183
|
+
* choice if it picks one.
|
|
184
|
+
*/
|
|
147
185
|
session_id?: string;
|
|
148
186
|
}
|
|
149
187
|
export interface AgentDescriptor {
|
|
@@ -176,7 +214,35 @@ export type AgentStatus = "active" | "idle" | "asleep" | "unknown";
|
|
|
176
214
|
*/
|
|
177
215
|
export interface AgentConnector {
|
|
178
216
|
list_agents(): Promise<AgentDescriptor[]>;
|
|
217
|
+
/**
|
|
218
|
+
* Durable put — "it's in their inbox, no interrupt."
|
|
219
|
+
*
|
|
220
|
+
* `agent_id` is an opaque string. The substrate may treat it as:
|
|
221
|
+
* - a bare agent identifier (Slack `@user`, email address, Discord user ID)
|
|
222
|
+
* - a composite `agent@session` (e.g., `"perry@kitchen-terminal"`) when the
|
|
223
|
+
* substrate tracks multiple live sessions per identity — the substrate
|
|
224
|
+
* decomposes the composite if it cares; non-session substrates ignore
|
|
225
|
+
* the suffix or treat the whole string as the address.
|
|
226
|
+
*
|
|
227
|
+
* Per Perry's v0.18.2 session-granular-targeting requirement: every
|
|
228
|
+
* messaging substrate needs to address either a bare identity or a
|
|
229
|
+
* specific live session. The opaque-composite form keeps the contract
|
|
230
|
+
* substrate-neutral while preserving the routing capability.
|
|
231
|
+
*/
|
|
179
232
|
deliver(agent_id: string, payload: DeliveryPayload): Promise<DeliveryReceipt>;
|
|
233
|
+
/**
|
|
234
|
+
* Attention signal — "go look at this now."
|
|
235
|
+
*
|
|
236
|
+
* `agent_id` accepts the same opaque/composite form as `deliver` (bare
|
|
237
|
+
* identity or `agent@session`). `opts.session_id` is the structured
|
|
238
|
+
* alternative for callers with the session already separated.
|
|
239
|
+
*
|
|
240
|
+
* Passive substrates that can't interrupt (webhook, file-drop, store-only)
|
|
241
|
+
* degrade gracefully — deliver the payload as if it were a `deliver()`
|
|
242
|
+
* call and set `woken: false` on the receipt. The contract's graceful-
|
|
243
|
+
* degradation rule (never throw for missing wake-capability) keeps
|
|
244
|
+
* non-wake-capable substrates conformant.
|
|
245
|
+
*/
|
|
180
246
|
wake(agent_id: string, opts?: WakeOpts): Promise<WakeReceipt>;
|
|
181
247
|
/**
|
|
182
248
|
* Bootstrap-time health probe. Adopter returns `true` if the substrate
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/connectors/agent.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD;;;;;;;;GAQG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;;;;;;OASG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;OAKG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,MAAM,EAAE;QACN,8DAA8D;QAC9D,UAAU,EAAE,MAAM,CAAC;QACnB;;;;;;WAMG;QACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B;;;;WAIG;QACH,YAAY,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,KAAK,GAAG,WAAW,GAAG,QAAQ,CAAC;QACxF;;;;;;WAMG;QACH,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,CAAC;IAEF;;;;;;;;;OASG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;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,YAAY,CAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;CACvD;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,GAAG,IAAI,EAAE,KAAK,EAAE,GAAG,cAAc,CAAC;IACvC,kBAAkB,IAAI,kBAAkB,CAAC;CAC1C"}
|
|
@@ -233,13 +233,17 @@ export class HttpWebhookAgentConnector implements AgentConnector {
|
|
|
233
233
|
async wake(agent_id: string, _opts?: WakeOpts): Promise<WakeReceipt> {
|
|
234
234
|
const cfg = this.agents[agent_id];
|
|
235
235
|
if (cfg === undefined) {
|
|
236
|
+
// Caller misconfiguration (agent not in HTTP_WEBHOOK_AGENTS) — still
|
|
237
|
+
// throws. Distinct from the substrate-can't-wake case below.
|
|
236
238
|
throw new Error(`wake('${agent_id}'): agent not configured`);
|
|
237
239
|
}
|
|
238
240
|
if (cfg.wake_url === undefined) {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
241
|
+
// v0.18.2 — graceful degradation. No wake URL configured for this
|
|
242
|
+
// agent means this connector is "passive" for them — webhook can
|
|
243
|
+
// deliver content but can't interrupt. Per Perry's degradation
|
|
244
|
+
// requirement: conform by degrading, never by erroring. Caller
|
|
245
|
+
// reads `woken: false` and knows the wake was downgraded.
|
|
246
|
+
return { woken_at: Date.now(), woken: false };
|
|
243
247
|
}
|
|
244
248
|
// Adopter-specific wake protocol; bundled example just POSTs to the URL.
|
|
245
249
|
const response = await fetch(cfg.wake_url, {
|
|
@@ -249,9 +253,11 @@ export class HttpWebhookAgentConnector implements AgentConnector {
|
|
|
249
253
|
signal: AbortSignal.timeout(this.timeout_ms),
|
|
250
254
|
});
|
|
251
255
|
if (response.status >= 400) {
|
|
256
|
+
// Real substrate-side failure — still throws. Distinct from the
|
|
257
|
+
// graceful-degradation case above (no wake URL configured at all).
|
|
252
258
|
throw new Error(`wake('${agent_id}'): HTTP ${response.status}`);
|
|
253
259
|
}
|
|
254
|
-
return { woken_at: Date.now() };
|
|
260
|
+
return { woken_at: Date.now(), woken: true };
|
|
255
261
|
}
|
|
256
262
|
|
|
257
263
|
async health_check(): Promise<boolean> {
|
package/examples/connectors/HttpWebhookAgentConnector/tests/HttpWebhookAgentConnector.test.ts
CHANGED
|
@@ -278,17 +278,20 @@ describe("HttpWebhookAgentConnector — list_agents / health_check / wake / requ
|
|
|
278
278
|
expect(await conn.health_check()).toBe(true);
|
|
279
279
|
});
|
|
280
280
|
|
|
281
|
-
it("wake
|
|
281
|
+
it("wake degrades gracefully when wake_url not configured (v0.18.2 — returns woken: false instead of throwing)", async () => {
|
|
282
282
|
const conn = new HttpWebhookAgentConnector({ agents: { "agent-x": { url: mock.url } } });
|
|
283
|
-
await
|
|
283
|
+
const receipt = await conn.wake("agent-x");
|
|
284
|
+
expect(receipt.woken).toBe(false);
|
|
285
|
+
expect(typeof receipt.woken_at).toBe("number");
|
|
284
286
|
});
|
|
285
287
|
|
|
286
|
-
it("wake POSTs to wake_url when configured", async () => {
|
|
288
|
+
it("wake POSTs to wake_url when configured + reports woken: true", async () => {
|
|
287
289
|
const conn = new HttpWebhookAgentConnector({
|
|
288
290
|
agents: { "agent-x": { url: mock.url, wake_url: `${mock.url}/wake` } },
|
|
289
291
|
});
|
|
290
292
|
const receipt = await conn.wake("agent-x");
|
|
291
293
|
expect(typeof receipt.woken_at).toBe("number");
|
|
294
|
+
expect(receipt.woken).toBe(true);
|
|
292
295
|
expect(mock.received).toHaveLength(1);
|
|
293
296
|
expect(mock.received[0]!.url).toBe("/wake");
|
|
294
297
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skillscript-runtime",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.2",
|
|
4
4
|
"description": "Runtime, compiler, lint, CLI, and dashboard for Skillscript — a small declarative language for authoring agent workflows.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Scott Shwarts <scotts@pobox.com>",
|