@cursor/july 0.1.39 → 0.1.41
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 +4 -3
- package/dist/bin/agent-serve.js +28 -9
- package/dist/channels/slack/api.d.ts.map +1 -1
- package/dist/channels/slack/api.js +18 -8
- 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/defaults.d.ts.map +1 -1
- package/dist/channels/slack/defaults.js +26 -17
- 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/live-delivery.d.ts.map +1 -1
- package/dist/channels/slack/live-delivery.js +16 -4
- 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.BQ8Hihdf.js → app.mIw24pb1.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.BA7V8dEJ.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.BBCr8Yuy.js → VPLocalSearchBox.hOzpPwrG.js} +1 -1
- package/dist/docs/assets/chunks/{theme.CK_NiGC-.js → theme.BtFhUYmh.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.BGDw4VLm.js → reference_hooks.md.BHeG-vjK.js} +2 -2
- package/dist/docs/assets/{reference_hooks.md.BGDw4VLm.lean.js → reference_hooks.md.BHeG-vjK.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 +5 -5
- 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/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-oauth.d.ts.map +1 -1
- package/dist/internal/cli-mcp-oauth.js +3 -1
- package/dist/internal/cli-mcp.js +4 -4
- package/dist/internal/cursor-event-relay.d.ts +45 -0
- package/dist/internal/cursor-event-relay.d.ts.map +1 -1
- package/dist/internal/cursor-event-relay.js +96 -2
- 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/mcp-oauth.d.ts +12 -1
- package/dist/internal/mcp-oauth.d.ts.map +1 -1
- package/dist/internal/mcp-oauth.js +25 -3
- 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 +67 -49
- 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 +117 -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 +123 -3
- 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 +8 -2
- 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/src/bin/agent-serve.ts +27 -11
- package/src/channels/slack/api.ts +19 -14
- package/src/channels/slack/attachments.ts +635 -0
- package/src/channels/slack/cursor-account.ts +8 -0
- package/src/channels/slack/defaults.ts +34 -18
- 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/live-delivery.ts +17 -3
- 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/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-oauth.ts +3 -1
- package/src/internal/cli-mcp.ts +4 -4
- package/src/internal/cursor-event-relay.ts +168 -0
- 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/mcp-oauth.ts +29 -4
- package/src/internal/playground/static.ts +111 -20
- package/src/internal/sdk-runner.ts +11 -1
- package/src/internal/server.ts +76 -62
- package/src/internal/session-engine.ts +192 -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 +130 -4
- 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.B-VTH4As.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/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-_2WKw9a-.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
|
|
@@ -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).
|
|
1350
1447
|
*/
|
|
1351
|
-
workspaceFiles?: Record<
|
|
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.
|
|
1455
|
+
*/
|
|
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
|
|
@@ -2230,6 +2335,11 @@ export interface ResolvedAgent {
|
|
|
2230
2335
|
hosting?: AgentHostingOptions;
|
|
2231
2336
|
/** Validated turn admission limits from {@link AgentConfig.concurrency}. */
|
|
2232
2337
|
concurrency?: AgentConcurrencyOptions;
|
|
2338
|
+
/**
|
|
2339
|
+
* Validated serving mode from {@link AgentConfig.serving}. Undefined
|
|
2340
|
+
* means `"resident"` (the default path).
|
|
2341
|
+
*/
|
|
2342
|
+
serving?: AgentServingMode;
|
|
2233
2343
|
tools: DiscoveredTool[];
|
|
2234
2344
|
skills: DiscoveredSkill[];
|
|
2235
2345
|
connections: DiscoveredConnection[];
|
|
@@ -2301,7 +2411,18 @@ export interface AgentProjectInfo {
|
|
|
2301
2411
|
inputSchema: JsonSchemaObject;
|
|
2302
2412
|
}>;
|
|
2303
2413
|
skills: Array<{ name: string; description: string }>;
|
|
2304
|
-
connections: Array<{
|
|
2414
|
+
connections: Array<{
|
|
2415
|
+
name: string;
|
|
2416
|
+
transport: string;
|
|
2417
|
+
hostOnly?: boolean;
|
|
2418
|
+
/**
|
|
2419
|
+
* Present only for `cursorAccount` connections: the connector-name
|
|
2420
|
+
* allowlist, or `"*"` for every connected server. Structured twin of the
|
|
2421
|
+
* `cursor-account[:a,b]` transport label so consumers (e.g. the
|
|
2422
|
+
* dashboard's connector scoping) never parse the display string.
|
|
2423
|
+
*/
|
|
2424
|
+
cursorAccountServers?: string[] | "*";
|
|
2425
|
+
}>;
|
|
2305
2426
|
subagents: Array<{
|
|
2306
2427
|
name: string;
|
|
2307
2428
|
description?: string;
|
|
@@ -2367,6 +2488,11 @@ export interface RunnerTurnRequest {
|
|
|
2367
2488
|
runnerStateDir: string;
|
|
2368
2489
|
prompt: string;
|
|
2369
2490
|
isFirstTurn: boolean;
|
|
2491
|
+
/**
|
|
2492
|
+
* Base64 images for this turn (Cursor SDK `SDKUserMessage.images`).
|
|
2493
|
+
* Set from {@link SendMessageOptions.images} / Slack attachments.
|
|
2494
|
+
*/
|
|
2495
|
+
images?: Array<{ data: string; mimeType: string }>;
|
|
2370
2496
|
model?: ModelSetting;
|
|
2371
2497
|
runtime: AgentRuntime;
|
|
2372
2498
|
/** 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"}
|