@cursor/july 0.1.40 → 0.1.42
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/AGENTS.md +13 -6
- package/dist/bin/agent-serve.js +28 -9
- package/dist/channels/slack/attachments.d.ts +82 -0
- package/dist/channels/slack/attachments.d.ts.map +1 -0
- package/dist/channels/slack/attachments.js +520 -0
- package/dist/channels/slack/cursor-account.d.ts +7 -1
- package/dist/channels/slack/cursor-account.d.ts.map +1 -1
- package/dist/channels/slack/cursor-account.js +2 -2
- package/dist/channels/slack/dispatch.d.ts +4 -3
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.js +84 -21
- package/dist/channels/slack/inbound.d.ts +6 -0
- package/dist/channels/slack/inbound.d.ts.map +1 -1
- package/dist/channels/slack/inbound.js +48 -2
- package/dist/channels/slack/index.d.ts +1 -0
- package/dist/channels/slack/index.d.ts.map +1 -1
- package/dist/channels/slack/index.js +1 -0
- package/dist/channels/slack/manifest.d.ts.map +1 -1
- package/dist/channels/slack/manifest.js +1 -0
- package/dist/channels/slack/slack-channel.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.js +7 -4
- package/dist/channels/slack/types.d.ts +49 -1
- package/dist/channels/slack/types.d.ts.map +1 -1
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +6 -6
- package/dist/docs/assets/{ab.md.6cLOW7--.js → ab.md.hdxsvX5M.js} +2 -2
- package/dist/docs/assets/{app.DpGLSiym.js → app.C4-Gwi7g.js} +1 -1
- package/dist/docs/assets/{building-with-agents.md.txrcGU2B.js → building-with-agents.md.PeZaZA1P.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.BlU3A8EB.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.B11XEMST.js → VPLocalSearchBox.DDoLm843.js} +1 -1
- package/dist/docs/assets/chunks/{theme.iTidHsAx.js → theme.SbjGIiM0.js} +2 -2
- package/dist/docs/assets/{deployment.md.CuK5SNjN.js → deployment.md.BHVjVqRa.js} +4 -4
- package/dist/docs/assets/{deployment.md.CuK5SNjN.lean.js → deployment.md.BHVjVqRa.lean.js} +1 -1
- package/dist/docs/assets/{evals.md.BQXI3rXy.js → evals.md.qeoGgPw0.js} +3 -3
- package/dist/docs/assets/example-agents_index.md.xmJ87d_3.js +2 -0
- package/dist/docs/assets/{guides_webhooks.md.BERuBSJW.js → guides_webhooks.md.DB-r_er9.js} +47 -4
- package/dist/docs/assets/{guides_webhooks.md.BERuBSJW.lean.js → guides_webhooks.md.DB-r_er9.lean.js} +1 -1
- package/dist/docs/assets/index.md.BKpbkCa6.js +24 -0
- package/dist/docs/assets/{index.md.CmhptOmN.lean.js → index.md.BKpbkCa6.lean.js} +1 -1
- package/dist/docs/assets/{quickstart.md.C_b6ESpD.js → quickstart.md.rIbfahJM.js} +4 -4
- package/dist/docs/assets/{reference_cli.md.Byvrg8eu.js → reference_cli.md.DqEqQpGn.js} +5 -5
- package/dist/docs/assets/{reference_cli.md.Byvrg8eu.lean.js → reference_cli.md.DqEqQpGn.lean.js} +1 -1
- package/dist/docs/assets/reference_hooks.md.B40QAG6m.js +14 -0
- package/dist/docs/assets/{reference_hooks.md.BGDw4VLm.lean.js → reference_hooks.md.B40QAG6m.lean.js} +1 -1
- package/dist/docs/assets/{storage.md.mQDtIULc.js → storage.md.DcGSnIxX.js} +10 -4
- package/dist/docs/assets/{storage.md.mQDtIULc.lean.js → storage.md.DcGSnIxX.lean.js} +1 -1
- package/dist/docs/assets/troubleshooting.md.CkgwmVI0.js +1 -0
- package/dist/docs/assets/{troubleshooting.md.B5RVX_tL.lean.js → troubleshooting.md.CkgwmVI0.lean.js} +1 -1
- package/dist/docs/building-with-agents.html +5 -5
- package/dist/docs/concepts.html +3 -3
- package/dist/docs/deployment.html +6 -6
- package/dist/docs/evals.html +7 -7
- package/dist/docs/example-agents/approval-buddy.html +3 -3
- package/dist/docs/example-agents/benny.html +3 -3
- package/dist/docs/example-agents/bugbot.html +3 -3
- package/dist/docs/example-agents/codebase-wiki.html +3 -3
- package/dist/docs/example-agents/codeowners-review.html +3 -3
- package/dist/docs/example-agents/concierge.html +3 -3
- package/dist/docs/example-agents/fsd.html +3 -3
- package/dist/docs/example-agents/index.html +5 -5
- package/dist/docs/example-agents/knowledge-base.html +3 -3
- package/dist/docs/example-agents/oncall.html +3 -3
- package/dist/docs/example-agents/security-reviewer.html +3 -3
- package/dist/docs/example-agents/slack-agent.html +3 -3
- package/dist/docs/example-agents/weather-agent.html +3 -3
- package/dist/docs/guides/agent-to-agent.html +3 -3
- package/dist/docs/guides/cloud-runtime.html +3 -3
- package/dist/docs/guides/github.html +3 -3
- package/dist/docs/guides/human-in-the-loop.html +3 -3
- package/dist/docs/guides/mcp-oauth.html +3 -3
- package/dist/docs/guides/slack.html +3 -3
- package/dist/docs/guides/webhooks.html +49 -6
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +3 -3
- package/dist/docs/index.html +7 -7
- package/dist/docs/quickstart.html +8 -8
- package/dist/docs/reference/agent-config.html +3 -3
- package/dist/docs/reference/artifacts.html +3 -3
- package/dist/docs/reference/channels.html +3 -3
- package/dist/docs/reference/cli.html +8 -8
- package/dist/docs/reference/connections.html +3 -3
- package/dist/docs/reference/hooks.html +9 -7
- package/dist/docs/reference/http-api.html +3 -3
- package/dist/docs/reference/instructions.html +3 -3
- package/dist/docs/reference/playground.html +3 -3
- package/dist/docs/reference/project-layout.html +3 -3
- package/dist/docs/reference/prompt.html +3 -3
- package/dist/docs/reference/schedules.html +3 -3
- package/dist/docs/reference/sessions.html +3 -3
- package/dist/docs/reference/skills.html +3 -3
- package/dist/docs/reference/subagents.html +3 -3
- package/dist/docs/reference/tools.html +3 -3
- package/dist/docs/scaffolding-agents.html +3 -3
- package/dist/docs/storage.html +14 -8
- package/dist/docs/troubleshooting.html +5 -5
- package/dist/hooks.d.ts +3 -1
- package/dist/hooks.d.ts.map +1 -1
- package/dist/hooks.js +3 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/internal/cli-ax.d.ts.map +1 -1
- package/dist/internal/cli-ax.js +22 -2
- package/dist/internal/cli-deploy.d.ts +6 -0
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +14 -4
- package/dist/internal/cli-mcp.js +4 -4
- package/dist/internal/deploy-client.js +1 -1
- package/dist/internal/discovery.d.ts.map +1 -1
- package/dist/internal/discovery.js +35 -7
- package/dist/internal/distribution.d.ts.map +1 -1
- package/dist/internal/distribution.js +3 -1
- package/dist/internal/durable-session-store.d.ts +48 -0
- package/dist/internal/durable-session-store.d.ts.map +1 -0
- package/dist/internal/durable-session-store.js +86 -0
- package/dist/internal/hosting.d.ts +1 -1
- package/dist/internal/hosting.js +2 -2
- package/dist/internal/init-project.d.ts +34 -0
- package/dist/internal/init-project.d.ts.map +1 -1
- package/dist/internal/init-project.js +121 -2
- package/dist/internal/ledger-serving.d.ts +101 -0
- package/dist/internal/ledger-serving.d.ts.map +1 -0
- package/dist/internal/ledger-serving.js +174 -0
- package/dist/internal/listen-port.d.ts +22 -0
- package/dist/internal/listen-port.d.ts.map +1 -0
- package/dist/internal/listen-port.js +77 -0
- package/dist/internal/playground/static.d.ts +21 -4
- package/dist/internal/playground/static.d.ts.map +1 -1
- package/dist/internal/playground/static.js +82 -18
- package/dist/internal/sdk-runner.d.ts.map +1 -1
- package/dist/internal/sdk-runner.js +10 -1
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +61 -47
- package/dist/internal/session-engine.d.ts +57 -1
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +118 -28
- package/dist/internal/slack-provision-client.js +1 -1
- package/dist/internal/workspace.d.ts +6 -2
- package/dist/internal/workspace.d.ts.map +1 -1
- package/dist/internal/workspace.js +10 -2
- package/dist/kv/memory-kv.d.ts +23 -0
- package/dist/kv/memory-kv.d.ts.map +1 -0
- package/dist/kv/memory-kv.js +103 -0
- package/dist/kv.d.ts +22 -0
- package/dist/kv.d.ts.map +1 -0
- package/dist/kv.js +20 -0
- package/dist/ledger/session-ledger.d.ts +204 -0
- package/dist/ledger/session-ledger.d.ts.map +1 -0
- package/dist/ledger/session-ledger.js +382 -0
- package/dist/ledger.d.ts +11 -0
- package/dist/ledger.d.ts.map +1 -0
- package/dist/ledger.js +9 -0
- package/dist/playground/assets/index-B3HBneZZ.js +85 -0
- package/dist/playground/assets/index-Bqk9nplh.css +1 -0
- package/dist/playground/index.html +2 -2
- package/dist/storage-backends/cursor-hosted.d.ts +25 -3
- package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/storage-backends/cursor-hosted.js +50 -2
- package/dist/storage-backends/file-kv.d.ts +5 -2
- package/dist/storage-backends/file-kv.d.ts.map +1 -1
- package/dist/storage-backends/file-kv.js +107 -7
- package/dist/storage.d.ts +60 -5
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +28 -4
- package/dist/types.d.ts +132 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +14 -0
- package/docs/README.md +10 -7
- package/docs/ab.md +2 -2
- package/docs/building-with-agents.md +1 -1
- package/docs/deployment.md +34 -11
- package/docs/evals.md +3 -3
- package/docs/example-agents/index.md +1 -1
- package/docs/guides/webhooks.md +87 -0
- package/docs/quickstart.md +7 -8
- package/docs/reference/cli.md +15 -6
- package/docs/reference/hooks.md +12 -3
- package/docs/storage.md +67 -7
- package/docs/troubleshooting.md +10 -2
- package/package.json +20 -7
- package/skills/create-agent/SKILL.md +1 -1
- package/skills/debug/SKILL.md +4 -0
- package/src/bin/agent-serve.ts +27 -11
- package/src/channels/slack/attachments.ts +635 -0
- package/src/channels/slack/cursor-account.ts +8 -0
- package/src/channels/slack/dispatch.ts +121 -6
- package/src/channels/slack/inbound.ts +60 -0
- package/src/channels/slack/index.ts +1 -0
- package/src/channels/slack/manifest.ts +1 -0
- package/src/channels/slack/slack-channel.ts +7 -0
- package/src/channels/slack/types.ts +47 -1
- package/src/hooks.ts +3 -1
- package/src/index.ts +9 -0
- package/src/internal/cli-ax.ts +25 -1
- package/src/internal/cli-deploy.ts +22 -4
- package/src/internal/cli-mcp.ts +4 -4
- package/src/internal/deploy-client.ts +1 -1
- package/src/internal/discovery.ts +42 -5
- package/src/internal/distribution.ts +3 -1
- package/src/internal/durable-session-store.ts +95 -0
- package/src/internal/hosting.ts +2 -2
- package/src/internal/init-project.ts +151 -2
- package/src/internal/ledger-serving.ts +240 -0
- package/src/internal/listen-port.ts +85 -0
- package/src/internal/playground/static.ts +111 -20
- package/src/internal/sdk-runner.ts +11 -1
- package/src/internal/server.ts +68 -61
- package/src/internal/session-engine.ts +193 -16
- package/src/internal/slack-provision-client.ts +1 -1
- package/src/internal/workspace.ts +14 -3
- package/src/kv/memory-kv.ts +99 -0
- package/src/kv.ts +27 -0
- package/src/ledger/session-ledger.ts +535 -0
- package/src/ledger.ts +29 -0
- package/src/storage-backends/cursor-hosted.ts +108 -3
- package/src/storage-backends/file-kv.ts +128 -12
- package/src/storage.ts +90 -6
- package/src/types.ts +139 -7
- package/dist/channels/slack/post-update-delivery.d.ts +0 -85
- package/dist/channels/slack/post-update-delivery.d.ts.map +0 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.D82_RVtF.js +0 -1
- package/dist/docs/assets/example-agents_index.md.DgGBwckv.js +0 -2
- package/dist/docs/assets/index.md.CmhptOmN.js +0 -24
- package/dist/docs/assets/reference_hooks.md.BGDw4VLm.js +0 -12
- package/dist/docs/assets/troubleshooting.md.B5RVX_tL.js +0 -1
- package/dist/internal/json-dir-store.d.ts +0 -32
- package/dist/internal/json-dir-store.d.ts.map +0 -1
- package/dist/internal/persistence-coordinator.d.ts +0 -127
- package/dist/internal/persistence-coordinator.d.ts.map +0 -1
- package/dist/multi-tenant.d.ts +0 -80
- package/dist/multi-tenant.d.ts.map +0 -1
- package/dist/multi-tenant.js +0 -69
- package/dist/persistence.d.ts +0 -184
- package/dist/persistence.d.ts.map +0 -1
- package/dist/playground/assets/index-BRhBbnd4.css +0 -1
- package/dist/playground/assets/index-Bc1oFgFG.js +0 -85
- package/dist/storage-backends/postgres-kv.d.ts +0 -82
- package/dist/storage-backends/postgres-kv.d.ts.map +0 -1
- package/dist/storage-backends/postgres-kv.js +0 -185
- package/src/storage-backends/postgres-kv.ts +0 -253
- /package/dist/docs/assets/{ab.md.6cLOW7--.lean.js → ab.md.hdxsvX5M.lean.js} +0 -0
- /package/dist/docs/assets/{building-with-agents.md.txrcGU2B.lean.js → building-with-agents.md.PeZaZA1P.lean.js} +0 -0
- /package/dist/docs/assets/{evals.md.BQXI3rXy.lean.js → evals.md.qeoGgPw0.lean.js} +0 -0
- /package/dist/docs/assets/{example-agents_index.md.DgGBwckv.lean.js → example-agents_index.md.xmJ87d_3.lean.js} +0 -0
- /package/dist/docs/assets/{quickstart.md.C_b6ESpD.lean.js → quickstart.md.rIbfahJM.lean.js} +0 -0
package/src/types.ts
CHANGED
|
@@ -204,8 +204,31 @@ export interface AgentConfig {
|
|
|
204
204
|
* {@link BuiltinToolsConfig}.
|
|
205
205
|
*/
|
|
206
206
|
builtinTools?: BuiltinToolsConfig;
|
|
207
|
+
/**
|
|
208
|
+
* How the serve host coordinates event delivery and turn execution. See
|
|
209
|
+
* {@link AgentServingMode}. Defaults to `"resident"`; opt in to
|
|
210
|
+
* `"ledger"` per agent — rollback is flipping the value back.
|
|
211
|
+
*/
|
|
212
|
+
serving?: AgentServingMode;
|
|
207
213
|
}
|
|
208
214
|
|
|
215
|
+
/**
|
|
216
|
+
* Serving coordination mode on {@link AgentConfig.serving}.
|
|
217
|
+
*
|
|
218
|
+
* - `"resident"` (default): the in-process session engine owns delivery —
|
|
219
|
+
* today's behavior, unchanged.
|
|
220
|
+
* - `"ledger"`: every delivery coordinates through the KV session ledger
|
|
221
|
+
* before its turn runs: session identity, a one-writer-per-session
|
|
222
|
+
* lease with generation fencing, and a fenced commit sequence.
|
|
223
|
+
* Requires a store with conditional writes (the `cas` group on
|
|
224
|
+
* `defineStorage`, or an explicit CAS-capable override); startup fails
|
|
225
|
+
* fast otherwise. This stage is coordination only — there is no
|
|
226
|
+
* durable inbox yet, so an event arriving while the lease is held
|
|
227
|
+
* waits in-process and a crash loses it exactly as resident serving
|
|
228
|
+
* does. The durable mailbox lands in a follow-up.
|
|
229
|
+
*/
|
|
230
|
+
export type AgentServingMode = "resident" | "ledger";
|
|
231
|
+
|
|
209
232
|
/**
|
|
210
233
|
* Built-in tools on {@link AgentConfig.builtinTools}. Each enabled
|
|
211
234
|
* capability materializes as ordinary server tools at discovery time, so
|
|
@@ -432,9 +455,9 @@ export interface SlackNudgeHostApi {
|
|
|
432
455
|
}
|
|
433
456
|
|
|
434
457
|
/**
|
|
435
|
-
* Shared host services available on every tool / channel / schedule
|
|
436
|
-
* Channel packs attach this as `ctx.host` so handlers can tap
|
|
437
|
-
* or MCP without the pack depending on another platform.
|
|
458
|
+
* Shared host services available on every tool / hook / channel / schedule
|
|
459
|
+
* surface. Channel packs attach this as `ctx.host` so handlers can tap
|
|
460
|
+
* GitHub, Slack, or MCP without the pack depending on another platform.
|
|
438
461
|
*/
|
|
439
462
|
export interface HostContext {
|
|
440
463
|
/**
|
|
@@ -493,6 +516,71 @@ export interface HostKvApi {
|
|
|
493
516
|
delete(key: string): Promise<void>;
|
|
494
517
|
}
|
|
495
518
|
|
|
519
|
+
/** A value plus its opaque version token, as returned by CAS-capable reads. */
|
|
520
|
+
export interface KvVersionedEntry {
|
|
521
|
+
value: JsonValue;
|
|
522
|
+
/**
|
|
523
|
+
* Opaque per-key token that changes on every successful write. Callers
|
|
524
|
+
* must not parse it — backends mint whatever is cheap for them (a
|
|
525
|
+
* counter, a UUID, an `updated_at`/`xmin` pair, …).
|
|
526
|
+
*/
|
|
527
|
+
version: string;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* Outcome of a conditional write. On conflict the backend returns the
|
|
532
|
+
* entry it observed (`undefined` when the key is absent), so a CAS retry
|
|
533
|
+
* loop gets its re-read for free instead of paying a second round trip.
|
|
534
|
+
*/
|
|
535
|
+
export type KvCasResult =
|
|
536
|
+
| { ok: true; version: string }
|
|
537
|
+
| { ok: false; current: KvVersionedEntry | undefined };
|
|
538
|
+
|
|
539
|
+
/**
|
|
540
|
+
* Conditional-write superset of {@link HostKvApi} for coordination
|
|
541
|
+
* protocols (the upcoming session ledger). Version-token CAS was chosen
|
|
542
|
+
* over compare-value: every candidate backend can mint a cheap opaque
|
|
543
|
+
* token (counter, UUID, row version), while compare-value would force
|
|
544
|
+
* deep JSON equality with key-order pitfalls on each of them. The
|
|
545
|
+
* agent-facing `host.kv` stays plain {@link HostKvApi}; storage backends
|
|
546
|
+
* supply CAS via the optional `cas` group on `defineStorage`, and
|
|
547
|
+
* coordination features fail fast when the backend lacks it.
|
|
548
|
+
*/
|
|
549
|
+
export interface HostKvCasApi extends HostKvApi {
|
|
550
|
+
/** Read one value with its version token. Miss → `undefined`. */
|
|
551
|
+
getWithVersion(key: string): Promise<KvVersionedEntry | undefined>;
|
|
552
|
+
/** Create the key only when absent. Conflict returns the existing entry. */
|
|
553
|
+
putIfAbsent(key: string, value: JsonValue): Promise<KvCasResult>;
|
|
554
|
+
/**
|
|
555
|
+
* Replace the value only when the key still carries `expectedVersion`.
|
|
556
|
+
* Conflict (version moved, or key deleted) returns the current entry.
|
|
557
|
+
*/
|
|
558
|
+
putIfVersion(
|
|
559
|
+
key: string,
|
|
560
|
+
value: JsonValue,
|
|
561
|
+
expectedVersion: string
|
|
562
|
+
): Promise<KvCasResult>;
|
|
563
|
+
/** All keys under a prefix, in ascending key order. */
|
|
564
|
+
listKeys(prefix: string): Promise<string[]>;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
/**
|
|
568
|
+
* Runtime probe: does this KV implement the CAS superset? Only for
|
|
569
|
+
* stores of unknown provenance — e.g. a caller-supplied {@link HostKvApi}
|
|
570
|
+
* object whose static type does not carry the CAS methods. A
|
|
571
|
+
* `defineStorage` backend declares CAS through its `cas` group instead
|
|
572
|
+
* and never needs probing.
|
|
573
|
+
*/
|
|
574
|
+
export function supportsKvCas(kv: HostKvApi): kv is HostKvCasApi {
|
|
575
|
+
const candidate = kv as Partial<HostKvCasApi>;
|
|
576
|
+
return (
|
|
577
|
+
typeof candidate.getWithVersion === "function" &&
|
|
578
|
+
typeof candidate.putIfAbsent === "function" &&
|
|
579
|
+
typeof candidate.putIfVersion === "function" &&
|
|
580
|
+
typeof candidate.listKeys === "function"
|
|
581
|
+
);
|
|
582
|
+
}
|
|
583
|
+
|
|
496
584
|
/**
|
|
497
585
|
* Which set of files a call addresses.
|
|
498
586
|
*
|
|
@@ -1218,7 +1306,15 @@ export interface SessionRecord {
|
|
|
1218
1306
|
* One-shot files to write into the harness cwd before the next turn
|
|
1219
1307
|
* (see {@link SendMessageOptions.workspaceFiles}). Cleared after apply.
|
|
1220
1308
|
*/
|
|
1221
|
-
pendingWorkspaceFiles?: Record<
|
|
1309
|
+
pendingWorkspaceFiles?: Record<
|
|
1310
|
+
string,
|
|
1311
|
+
string | { encoding: "base64"; data: string; mimeType?: string }
|
|
1312
|
+
>;
|
|
1313
|
+
/**
|
|
1314
|
+
* One-shot vision images for the next turn (see
|
|
1315
|
+
* {@link SendMessageOptions.images}). Cleared after apply.
|
|
1316
|
+
*/
|
|
1317
|
+
pendingImages?: Array<{ data: string; mimeType: string }>;
|
|
1222
1318
|
/**
|
|
1223
1319
|
* Per-session cloud options captured at session creation, merged over the
|
|
1224
1320
|
* agent's static `cloud` config on every turn of this session. Lets a
|
|
@@ -1346,9 +1442,18 @@ export interface SendMessageOptions {
|
|
|
1346
1442
|
* the first turn; on resume, replaces any pending files. Prefer this
|
|
1347
1443
|
* over {@link workspaceDir} when you only need to inject a few
|
|
1348
1444
|
* host-prepared files (skills/AGENTS.md still land in the normal
|
|
1349
|
-
* session workspace).
|
|
1445
|
+
* session workspace). Values may be utf8 strings or
|
|
1446
|
+
* `{ encoding: "base64", data }` blobs (Slack attachments, binary docs).
|
|
1447
|
+
*/
|
|
1448
|
+
workspaceFiles?: Record<
|
|
1449
|
+
string,
|
|
1450
|
+
string | { encoding: "base64"; data: string; mimeType?: string }
|
|
1451
|
+
>;
|
|
1452
|
+
/**
|
|
1453
|
+
* Base64 images for this turn's Cursor SDK `send({ images })` (vision).
|
|
1454
|
+
* Cleared after the turn starts. Slack inbound fills this from uploads.
|
|
1350
1455
|
*/
|
|
1351
|
-
|
|
1456
|
+
images?: Array<{ data: string; mimeType: string }>;
|
|
1352
1457
|
/**
|
|
1353
1458
|
* Per-session cloud options, merged over the agent's static `cloud`
|
|
1354
1459
|
* config (new sessions only). When set, this session runs as cloud even
|
|
@@ -1786,6 +1891,12 @@ export interface HookContext {
|
|
|
1786
1891
|
* memory journal) write here.
|
|
1787
1892
|
*/
|
|
1788
1893
|
stateRoot: string;
|
|
1894
|
+
/**
|
|
1895
|
+
* Shared host services (MCP / GitHub / Slack / kv / files). Same as
|
|
1896
|
+
* tool `ctx.host`. `files` is bound to this hook's session, so a
|
|
1897
|
+
* relative path cannot read another session's files.
|
|
1898
|
+
*/
|
|
1899
|
+
host: HostContext;
|
|
1789
1900
|
/**
|
|
1790
1901
|
* Durable artifacts, bound to this hook's session: `tag` auto-fills
|
|
1791
1902
|
* `sessionId` (and `turnId` when known).
|
|
@@ -2230,6 +2341,11 @@ export interface ResolvedAgent {
|
|
|
2230
2341
|
hosting?: AgentHostingOptions;
|
|
2231
2342
|
/** Validated turn admission limits from {@link AgentConfig.concurrency}. */
|
|
2232
2343
|
concurrency?: AgentConcurrencyOptions;
|
|
2344
|
+
/**
|
|
2345
|
+
* Validated serving mode from {@link AgentConfig.serving}. Undefined
|
|
2346
|
+
* means `"resident"` (the default path).
|
|
2347
|
+
*/
|
|
2348
|
+
serving?: AgentServingMode;
|
|
2233
2349
|
tools: DiscoveredTool[];
|
|
2234
2350
|
skills: DiscoveredSkill[];
|
|
2235
2351
|
connections: DiscoveredConnection[];
|
|
@@ -2301,7 +2417,18 @@ export interface AgentProjectInfo {
|
|
|
2301
2417
|
inputSchema: JsonSchemaObject;
|
|
2302
2418
|
}>;
|
|
2303
2419
|
skills: Array<{ name: string; description: string }>;
|
|
2304
|
-
connections: Array<{
|
|
2420
|
+
connections: Array<{
|
|
2421
|
+
name: string;
|
|
2422
|
+
transport: string;
|
|
2423
|
+
hostOnly?: boolean;
|
|
2424
|
+
/**
|
|
2425
|
+
* Present only for `cursorAccount` connections: the connector-name
|
|
2426
|
+
* allowlist, or `"*"` for every connected server. Structured twin of the
|
|
2427
|
+
* `cursor-account[:a,b]` transport label so consumers (e.g. the
|
|
2428
|
+
* dashboard's connector scoping) never parse the display string.
|
|
2429
|
+
*/
|
|
2430
|
+
cursorAccountServers?: string[] | "*";
|
|
2431
|
+
}>;
|
|
2305
2432
|
subagents: Array<{
|
|
2306
2433
|
name: string;
|
|
2307
2434
|
description?: string;
|
|
@@ -2367,6 +2494,11 @@ export interface RunnerTurnRequest {
|
|
|
2367
2494
|
runnerStateDir: string;
|
|
2368
2495
|
prompt: string;
|
|
2369
2496
|
isFirstTurn: boolean;
|
|
2497
|
+
/**
|
|
2498
|
+
* Base64 images for this turn (Cursor SDK `SDKUserMessage.images`).
|
|
2499
|
+
* Set from {@link SendMessageOptions.images} / Slack attachments.
|
|
2500
|
+
*/
|
|
2501
|
+
images?: Array<{ data: string; mimeType: string }>;
|
|
2370
2502
|
model?: ModelSetting;
|
|
2371
2503
|
runtime: AgentRuntime;
|
|
2372
2504
|
/** Cloud options when {@link runtime} is `"cloud"`. */
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Live-reply delivery strategies for the Slack default handlers.
|
|
3
|
-
*
|
|
4
|
-
* A single strategy owns how an in-progress reply is opened, updated,
|
|
5
|
-
* finalized, and cleaned up so the handlers in `defaults.ts` don't fork on the
|
|
6
|
-
* delivery mode at every event:
|
|
7
|
-
*
|
|
8
|
-
* - `stream`: Slack chat.startStream / appendStream / stopStream.
|
|
9
|
-
* - `post-update`: a chat.postMessage skeleton edited with chat.update. This is
|
|
10
|
-
* the only path that preserves Cursor-account identity pinning (which only
|
|
11
|
-
* covers postMessage).
|
|
12
|
-
*
|
|
13
|
-
* `buildDefaultEvents` selects one via {@link selectLiveDeliveryStrategy} up
|
|
14
|
-
* front and calls into it. All calls keep the same soft-fail / log behavior as
|
|
15
|
-
* the inlined logic they replaced.
|
|
16
|
-
*/
|
|
17
|
-
import type { ChannelEventContext } from "../../types.js";
|
|
18
|
-
import type { SlackLog } from "./log.js";
|
|
19
|
-
import type { SlackBotToken, SlackChannelState } from "./types.js";
|
|
20
|
-
type SlackChannel = ChannelEventContext<SlackChannelState>;
|
|
21
|
-
export interface LiveDeliveryDeps {
|
|
22
|
-
botToken: SlackBotToken | undefined;
|
|
23
|
-
getLog: () => SlackLog;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* How the default handlers deliver an in-progress reply. Methods write live
|
|
27
|
-
* delivery state (`streamTs`, `streamChannelId`, `lastPostedText`,
|
|
28
|
-
* `lastPostUpdateAtMs`, `streamingUnavailable`) on `channel.state` directly.
|
|
29
|
-
*/
|
|
30
|
-
export interface LiveDeliveryStrategy {
|
|
31
|
-
/** True when tool-call thinking steps can be appended to the live message. */
|
|
32
|
-
readonly inlineToolSteps: boolean;
|
|
33
|
-
/** Open the live message (skeleton post / stream start). */
|
|
34
|
-
start(args: {
|
|
35
|
-
channel: SlackChannel;
|
|
36
|
-
channelId: string;
|
|
37
|
-
threadTs: string;
|
|
38
|
-
sessionId: string;
|
|
39
|
-
}): Promise<void>;
|
|
40
|
-
/** Push the latest cumulative text to the live message (throttled). */
|
|
41
|
-
append(args: {
|
|
42
|
-
channel: SlackChannel;
|
|
43
|
-
channelId: string;
|
|
44
|
-
streamTs: string;
|
|
45
|
-
text: string;
|
|
46
|
-
sessionId: string;
|
|
47
|
-
}): Promise<void>;
|
|
48
|
-
/**
|
|
49
|
-
* Flush the final reply text. `delivered` is false only when the caller must
|
|
50
|
-
* post the full reply as a fresh message (finalize failed on partial text).
|
|
51
|
-
*/
|
|
52
|
-
finalize(args: {
|
|
53
|
-
channel: SlackChannel;
|
|
54
|
-
channelId: string;
|
|
55
|
-
streamTs: string;
|
|
56
|
-
text: string;
|
|
57
|
-
sessionId: string;
|
|
58
|
-
}): Promise<{
|
|
59
|
-
delivered: boolean;
|
|
60
|
-
}>;
|
|
61
|
-
/** Close the live message when the turn produced no final text. */
|
|
62
|
-
finalizeEmpty(args: {
|
|
63
|
-
channel: SlackChannel;
|
|
64
|
-
channelId: string;
|
|
65
|
-
streamTs: string;
|
|
66
|
-
}): Promise<void>;
|
|
67
|
-
/** Best-effort remove a live message left open after the turn ended. */
|
|
68
|
-
cleanupOrphan(args: {
|
|
69
|
-
channel: SlackChannel;
|
|
70
|
-
}): Promise<void>;
|
|
71
|
-
/** Deliver the error text into the live message; `delivered` gates a fallback post. */
|
|
72
|
-
fail(args: {
|
|
73
|
-
channel: SlackChannel;
|
|
74
|
-
channelId: string;
|
|
75
|
-
streamTs: string;
|
|
76
|
-
errorText: string;
|
|
77
|
-
sessionId: string;
|
|
78
|
-
}): Promise<{
|
|
79
|
-
delivered: boolean;
|
|
80
|
-
}>;
|
|
81
|
-
}
|
|
82
|
-
/** Pick the live-reply delivery strategy for a `buildDefaultEvents` instance. */
|
|
83
|
-
export declare function selectLiveDeliveryStrategy(deps: LiveDeliveryDeps, usePostUpdate: boolean): LiveDeliveryStrategy;
|
|
84
|
-
export {};
|
|
85
|
-
//# sourceMappingURL=post-update-delivery.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"post-update-delivery.d.ts","sourceRoot":"","sources":["../../../src/channels/slack/post-update-delivery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAW1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEnE,KAAK,YAAY,GAAG,mBAAmB,CAAC,iBAAiB,CAAC,CAAC;AAE3D,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,aAAa,GAAG,SAAS,CAAC;IACpC,MAAM,EAAE,MAAM,QAAQ,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,8EAA8E;IAC9E,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAClC,4DAA4D;IAC5D,KAAK,CAAC,IAAI,EAAE;QACV,OAAO,EAAE,YAAY,CAAC;QACtB,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClB,uEAAuE;IACvE,MAAM,CAAC,IAAI,EAAE;QACX,OAAO,EAAE,YAAY,CAAC;QACtB,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE;QACb,OAAO,EAAE,YAAY,CAAC;QACtB,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC;QAAE,SAAS,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IACpC,mEAAmE;IACnE,aAAa,CAAC,IAAI,EAAE;QAClB,OAAO,EAAE,YAAY,CAAC;QACtB,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;KAClB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClB,wEAAwE;IACxE,aAAa,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,YAAY,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D,uFAAuF;IACvF,IAAI,CAAC,IAAI,EAAE;QACT,OAAO,EAAE,YAAY,CAAC;QACtB,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC;QAAE,SAAS,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;CACrC;AA6RD,iFAAiF;AACjF,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,gBAAgB,EACtB,aAAa,EAAE,OAAO,GACrB,oBAAoB,CAItB"}
|