@cursor/july 0.1.76 → 0.1.78
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/channels/origin/origin-webhook.d.ts +23 -2
- package/dist/channels/origin/origin-webhook.d.ts.map +1 -1
- package/dist/channels/origin/origin-webhook.js +82 -20
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +3 -3
- package/dist/docs/assets/{app.b8bhB2SV.js → app.BsA7t7rS.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.Dcs6boxD.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.lLSeIyWw.js → VPLocalSearchBox.B1hHhktM.js} +1 -1
- package/dist/docs/assets/chunks/{theme.C_owesa-.js → theme.DLpLSsQh.js} +2 -2
- package/dist/docs/assets/{storage.md.D8NQ389l.js → storage.md.ks1u64_R.js} +3 -3
- package/dist/docs/assets/storage.md.ks1u64_R.lean.js +1 -0
- package/dist/docs/building-with-agents.html +3 -3
- package/dist/docs/concepts.html +3 -3
- package/dist/docs/deployment.html +3 -3
- package/dist/docs/evals.html +3 -3
- 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 +3 -3
- 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/convert-automation.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/opentelemetry.html +3 -3
- package/dist/docs/guides/slack.html +3 -3
- package/dist/docs/guides/webhooks.html +3 -3
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +3 -3
- package/dist/docs/index.html +3 -3
- package/dist/docs/quickstart.html +3 -3
- 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 +3 -3
- package/dist/docs/reference/connections.html +3 -3
- package/dist/docs/reference/hooks.html +3 -3
- 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 +7 -7
- package/dist/docs/templates/agentic-owners.html +3 -3
- package/dist/docs/templates/demo.html +3 -3
- package/dist/docs/templates/pr-autofixer.html +3 -3
- package/dist/docs/templates/security-reviewer.html +3 -3
- package/dist/docs/templates/triage.html +3 -3
- package/dist/docs/troubleshooting.html +3 -3
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/internal/discovery.d.ts.map +1 -1
- package/dist/internal/discovery.js +3 -21
- package/dist/internal/distribution.d.ts.map +1 -1
- package/dist/internal/distribution.js +0 -1
- package/dist/internal/session-engine.d.ts +1 -60
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +10 -109
- package/dist/kv/memory-kv.d.ts +1 -10
- package/dist/kv/memory-kv.d.ts.map +1 -1
- package/dist/kv/memory-kv.js +1 -10
- package/dist/kv.d.ts +2 -3
- package/dist/kv.d.ts.map +1 -1
- package/dist/kv.js +2 -3
- package/dist/playground/assets/{index-Bfwz2yLN.css → index-DJzcIeGt.css} +1 -1
- package/dist/playground/assets/{index-BWqjJcRo.js → index-K3Sxyx0I.js} +48 -45
- package/dist/playground/index.html +2 -2
- package/dist/storage-backends/cursor-hosted.js +3 -3
- package/dist/storage-protocol.d.ts +3 -8
- package/dist/storage-protocol.d.ts.map +1 -1
- package/dist/storage-protocol.js +4 -10
- package/dist/storage.d.ts +5 -11
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +3 -4
- package/dist/types.d.ts +5 -34
- package/dist/types.d.ts.map +1 -1
- package/docs/storage.md +11 -44
- package/package.json +1 -8
- package/src/channels/origin/origin-webhook.ts +111 -25
- package/src/index.ts +0 -6
- package/src/internal/discovery.ts +3 -27
- package/src/internal/distribution.ts +0 -1
- package/src/internal/session-engine.ts +1 -168
- package/src/kv/memory-kv.ts +1 -10
- package/src/kv.ts +2 -3
- package/src/storage-backends/cursor-hosted.ts +3 -3
- package/src/storage-protocol.ts +4 -10
- package/src/storage.ts +6 -12
- package/src/types.ts +5 -35
- package/dist/docs/assets/chunks/@localSearchIndexroot.DGZeXVqn.js +0 -1
- package/dist/docs/assets/storage.md.D8NQ389l.lean.js +0 -1
- package/dist/internal/durable-session-store.d.ts +0 -60
- package/dist/internal/durable-session-store.d.ts.map +0 -1
- package/dist/internal/durable-session-store.js +0 -131
- package/dist/internal/ledger-serving.d.ts +0 -169
- package/dist/internal/ledger-serving.d.ts.map +0 -1
- package/dist/internal/ledger-serving.js +0 -393
- package/dist/ledger/janitor.d.ts +0 -60
- package/dist/ledger/janitor.d.ts.map +0 -1
- package/dist/ledger/janitor.js +0 -137
- package/dist/ledger/session-ledger.d.ts +0 -293
- package/dist/ledger/session-ledger.d.ts.map +0 -1
- package/dist/ledger/session-ledger.js +0 -614
- package/dist/ledger.d.ts +0 -12
- package/dist/ledger.d.ts.map +0 -1
- package/dist/ledger.js +0 -9
- package/src/internal/durable-session-store.ts +0 -134
- package/src/internal/ledger-serving.ts +0 -531
- package/src/ledger/janitor.ts +0 -193
- package/src/ledger/session-ledger.ts +0 -839
- package/src/ledger.ts +0 -44
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,OAAO,EACL,KAAK,uBAAuB,EAE7B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EACV,WAAW,EACX,qBAAqB,EACrB,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,sBAAsB,EACtB,YAAY,EACb,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,EACL,QAAQ,EACR,UAAU,EACV,MAAM,EACN,aAAa,EACb,GAAG,EACH,WAAW,EACX,QAAQ,EACR,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,KAAK,EACL,IAAI,EACJ,GAAG,EACH,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,YAAY,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,4BAA4B,EAC5B,6BAA6B,EAC7B,4BAA4B,EAC5B,6BAA6B,EAC7B,sBAAsB,EACtB,uBAAuB,EACvB,6BAA6B,GAC9B,MAA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ENDPO
|
|
|
49
49
|
export { ReminderValidationError, UnknownReminderError, } from "./internal/reminder-runner.js";
|
|
50
50
|
export { SessionBusyError, ToolInputError, ToolNotDirectlyCallableError, UnknownChannelError, UnknownSessionError, UnknownToolError, } from "./internal/session-engine.js";
|
|
51
51
|
export { createMemoryKv, memoryCasTable } from "./kv/memory-kv.js";
|
|
52
|
-
export { LedgerCasExhaustedError, LedgerFencedError, SessionLedger, supportsSessionLedgerKv, } from "./ledger.js";
|
|
53
52
|
export { agentStoreMemoryBackend, fileMemoryBackend, memoryHook, } from "./memory.js";
|
|
54
53
|
export { defineOtel } from "./otel.js";
|
|
55
54
|
export { prompt } from "./prompt.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../src/internal/discovery.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAkBH,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,gBAAgB,
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../src/internal/discovery.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAkBH,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,gBAAgB,EASrB,KAAK,UAAU,EAuBhB,MAAM,aAAa,CAAC;AA+BrB,MAAM,WAAW,uBAAuB;IACtC,sDAAsD;IACtD,YAAY,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CAC3E;AAmBD;;;;GAIG;AACH,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CASrE;AAED,sEAAsE;AACtE,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,aAAa,EAAE,CAAC,CA2B1B;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,YAAY,CAAA;CAAE,CAAC,CAAC,CA6BzD;AAED;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,uBAAuB,GAAG;IACjC,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;CACtB,GACL,OAAO,CAAC,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,YAAY,CAAA;CAAE,CAAC,CAAC,CAgBzD;AAWD,iFAAiF;AACjF,eAAO,MAAM,cAAc,EAAE,GAAG,CAAC,MAAM,CAIrC,CAAC;AAEH,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,YAAY,CAAC,CAmEvB;AAED,qEAAqE;AACrE,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAElE;AAED,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,MAAM,CAOnE;AAowBD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAiB3E;AAo2BD,wBAAgB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,gBAAgB,CA4JnE"}
|
|
@@ -120,9 +120,9 @@ export function loadAgentProjects(rootDir_1) {
|
|
|
120
120
|
throw new Error(`No agent projects found directly under ${resolved}. Each agent should be a subdirectory with its own agent/ directory (or flat-layout markers).`);
|
|
121
121
|
}
|
|
122
122
|
const results = [];
|
|
123
|
-
// Storage namespaces (session mirror, host kv
|
|
124
|
-
//
|
|
125
|
-
//
|
|
123
|
+
// Storage namespaces (session mirror, host kv) key on the project
|
|
124
|
+
// NAME, not the mount slug — two co-hosted agents sharing a name would
|
|
125
|
+
// silently share sessions and KV state.
|
|
126
126
|
const slugByName = new Map();
|
|
127
127
|
for (const child of children) {
|
|
128
128
|
const project = yield loadAgentProject(child.dir, options);
|
|
@@ -371,7 +371,6 @@ function loadAgent(ctx, agentDir, options) {
|
|
|
371
371
|
};
|
|
372
372
|
const hosting = resolveHosting(ctx, agentDir, config === null || config === void 0 ? void 0 : config.hosting);
|
|
373
373
|
const concurrency = resolveConcurrency(ctx, agentDir, config === null || config === void 0 ? void 0 : config.concurrency);
|
|
374
|
-
const serving = resolveServing(ctx, agentDir, config === null || config === void 0 ? void 0 : config.serving);
|
|
375
374
|
if (runtime === "cloud") {
|
|
376
375
|
warnCloudRuntimeLimitations(ctx, agentDir, {
|
|
377
376
|
agentTools: tools.filter((tool) => tool.execution === "agent").length,
|
|
@@ -388,7 +387,6 @@ function loadAgent(ctx, agentDir, options) {
|
|
|
388
387
|
cloud,
|
|
389
388
|
local }, (allowedTools === undefined ? {} : { allowedTools })), { hosting,
|
|
390
389
|
concurrency,
|
|
391
|
-
serving,
|
|
392
390
|
tools,
|
|
393
391
|
skills,
|
|
394
392
|
connections,
|
|
@@ -396,22 +394,6 @@ function loadAgent(ctx, agentDir, options) {
|
|
|
396
394
|
seedFiles });
|
|
397
395
|
});
|
|
398
396
|
}
|
|
399
|
-
/**
|
|
400
|
-
* Validate the authored serving mode. An unrecognized value is an error
|
|
401
|
-
* diagnostic and falls back to undefined (resident) — a typo must not
|
|
402
|
-
* silently opt an agent into (or out of) ledger coordination.
|
|
403
|
-
*/
|
|
404
|
-
function resolveServing(ctx, agentDir, serving) {
|
|
405
|
-
if (serving === undefined || serving === "resident" || serving === "ledger") {
|
|
406
|
-
return serving;
|
|
407
|
-
}
|
|
408
|
-
ctx.diagnostics.push({
|
|
409
|
-
severity: "error",
|
|
410
|
-
path: displayPath(ctx, join(agentDir, "agent.ts")),
|
|
411
|
-
message: `serving must be "resident" or "ledger"; got ${JSON.stringify(serving)}.`,
|
|
412
|
-
});
|
|
413
|
-
return undefined;
|
|
414
|
-
}
|
|
415
397
|
/** Absolute harness cwd parent, or undefined when unset / blank. */
|
|
416
398
|
function resolveAgentCwd(ctx, authored) {
|
|
417
399
|
if (authored === undefined) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"distribution.d.ts","sourceRoot":"","sources":["../../src/internal/distribution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,sEAAsE;AACtE,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAE3C,6EAA6E;AAC7E,eAAO,MAAM,mBAAmB,2BAA2B,CAAC;AAE5D;;;GAGG;AACH,eAAO,MAAM,qBAAqB,qBAAqB,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,WAAW,cAAc,CAAC;AACvC,eAAO,MAAM,UAAU,EAAE,MAA2B,CAAC;AACrD,eAAO,MAAM,gBAAgB,EAAE,MAAiC,CAAC;AAEjE;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAA+B,CAAC;AAc/D;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAGhD;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,kEAAkE;AAClE,wBAAgB,cAAc,IAAI,MAAM,CAOvC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,EAAE,aAAa,CAC/C,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"distribution.d.ts","sourceRoot":"","sources":["../../src/internal/distribution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,sEAAsE;AACtE,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAE3C,6EAA6E;AAC7E,eAAO,MAAM,mBAAmB,2BAA2B,CAAC;AAE5D;;;GAGG;AACH,eAAO,MAAM,qBAAqB,qBAAqB,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,WAAW,cAAc,CAAC;AACvC,eAAO,MAAM,UAAU,EAAE,MAA2B,CAAC;AACrD,eAAO,MAAM,gBAAgB,EAAE,MAAiC,CAAC;AAEjE;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAA+B,CAAC;AAc/D;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAGhD;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,kEAAkE;AAClE,wBAAgB,cAAc,IAAI,MAAM,CAOvC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,EAAE,aAAa,CAC/C,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CA2BzC,CAAC"}
|
|
@@ -96,7 +96,6 @@ export const AUTHORING_ENTRY_FILES = [
|
|
|
96
96
|
["artifacts", "artifacts.js"],
|
|
97
97
|
["kv", "kv.js"],
|
|
98
98
|
["kv/memory", "kv/memory-kv.js"],
|
|
99
|
-
["ledger", "ledger.js"],
|
|
100
99
|
["storage", "storage.js"],
|
|
101
100
|
["storage/file-kv", "storage-backends/file-kv.js"],
|
|
102
101
|
["storage/cursor-hosted", "storage-backends/cursor-hosted.js"],
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import type { SDKCustomToolResult } from "@cursor/sdk";
|
|
10
10
|
import type { Meter } from "@opentelemetry/api";
|
|
11
11
|
import { SlackAskDedupeStore, SlackNudgeStore } from "../channels/slack/nudge-store.js";
|
|
12
|
-
import { type AgentProject, type ApprovalDecision, type ArtifactListFilter, type ArtifactRecord, type ArtifactsApi, type AuthContext, type CallToolOptions, type ChannelDefinition, type ChannelSession, type ConnectionTransport, type HostContext, type
|
|
12
|
+
import { type AgentProject, type ApprovalDecision, type ArtifactListFilter, type ArtifactRecord, type ArtifactsApi, type AuthContext, type CallToolOptions, type ChannelDefinition, type ChannelSession, type ConnectionTransport, type HostContext, type HttpChannelDefinition, type JsonValue, type PendingApproval, type ReceiveInput, type SendMessageOptions, type SessionEvent, type SessionInfo, type SessionListSource, type SessionRecord, type SessionSummary, type ToolCallOutcome, type TurnOutcome } from "../types.js";
|
|
13
13
|
import { type ABSnapshot } from "./ab-snapshot.js";
|
|
14
14
|
import { type CloudAgentUsage } from "./cloud-turn-cost.js";
|
|
15
15
|
import { type EventLogMemoryStats } from "./event-log.js";
|
|
@@ -68,22 +68,6 @@ export interface SessionEngineOptions {
|
|
|
68
68
|
* stub; production uses billed usage events when an agent id is known.
|
|
69
69
|
*/
|
|
70
70
|
estimateTurnCost?: EstimateTurnCostFn;
|
|
71
|
-
/**
|
|
72
|
-
* Explicit durable-session store for `serving: "ledger"` agents — a KV
|
|
73
|
-
* dedicated to the ledger (session identity, leases, commit heads),
|
|
74
|
-
* separate from agent state. Must implement the full CAS-capable KV
|
|
75
|
-
* surface (`HostKvCasApi`: the CAS trio plus `get`/`put`/`delete` for
|
|
76
|
-
* mailbox payload blobs and `listKeys` for the janitor scan);
|
|
77
|
-
* construction fails fast otherwise. Supply the **raw** store: the
|
|
78
|
-
* engine owns key scoping and namespaces every ledger key under
|
|
79
|
-
* `agentkit/v1/<agent>/durable-session/` itself — a self-hoster never
|
|
80
|
-
* writes prefixes. Default when omitted: the authored storage backend
|
|
81
|
-
* (`agent/storage.ts`) when it implements the `cas` group, else — with
|
|
82
|
-
* no authored storage — a file store under `<stateRoot>/ledger-kv`
|
|
83
|
-
* (single-process correctness only). An authored storage backend
|
|
84
|
-
* *without* `cas` fails fast. Ignored for resident-mode agents.
|
|
85
|
-
*/
|
|
86
|
-
durableSessionStore?: HostKvApi;
|
|
87
71
|
/** Process-level OTel collector; observe-only, never fatal. */
|
|
88
72
|
otel?: OtelCollector;
|
|
89
73
|
/** Process-level meter for {@link HostContext.otel}. Absent → no-op counters. */
|
|
@@ -115,14 +99,6 @@ export interface EngineResolvedConnection {
|
|
|
115
99
|
}
|
|
116
100
|
export interface EngineSendOptions extends SendMessageOptions {
|
|
117
101
|
mode?: "chat" | "task";
|
|
118
|
-
/**
|
|
119
|
-
* Internal (ledger serving): set only by the ledger pump when it
|
|
120
|
-
* executes an already-parked event under its lease, so the call must
|
|
121
|
-
* run the resident path. Without the flag, every send on a
|
|
122
|
-
* `serving: "ledger"` agent routes through the ledger (append → claim
|
|
123
|
-
* → drain → turn → commit) and the pump would recurse into itself.
|
|
124
|
-
*/
|
|
125
|
-
fromLedgerPump?: boolean;
|
|
126
102
|
}
|
|
127
103
|
export declare class SessionEngine {
|
|
128
104
|
readonly project: AgentProject;
|
|
@@ -203,42 +179,7 @@ export declare class SessionEngine {
|
|
|
203
179
|
private readonly cloudCostBackfillDone;
|
|
204
180
|
/** Deduped in-flight cloud cost backfills, keyed by session id. */
|
|
205
181
|
private readonly cloudCostBackfill;
|
|
206
|
-
/**
|
|
207
|
-
* Ledger-mode delivery seam; set only when the agent declares
|
|
208
|
-
* `serving: "ledger"`. When present, {@link send} routes every
|
|
209
|
-
* non-delivery call through the ledger's claim → turn → commit.
|
|
210
|
-
*/
|
|
211
|
-
private readonly ledgerServing;
|
|
212
182
|
constructor(options: SessionEngineOptions);
|
|
213
|
-
/**
|
|
214
|
-
* Ledger-mode wiring (`serving: "ledger"`): resolve a CAS-capable
|
|
215
|
-
* durable-session store and build the event pump. Resident agents
|
|
216
|
-
* (the default) return undefined and never touch ledger keys.
|
|
217
|
-
*/
|
|
218
|
-
private buildLedgerServing;
|
|
219
|
-
/**
|
|
220
|
-
* Pick the KV the ledger coordinates on, in precedence order:
|
|
221
|
-
*
|
|
222
|
-
* 1. `options.durableSessionStore` — an explicit store separate from
|
|
223
|
-
* agent state (advanced deployments, tests).
|
|
224
|
-
* 2. The authored storage backend (`agent/storage.ts`) when it
|
|
225
|
-
* implements the `cas` group — one backend serves both the storage
|
|
226
|
-
* API and the durable session API.
|
|
227
|
-
* 3. No authored storage: a file store under `<stateRoot>/ledger-kv`
|
|
228
|
-
* (same place resident state lives; single-process only).
|
|
229
|
-
*
|
|
230
|
-
* An authored backend without `cas` fails fast: silently falling back
|
|
231
|
-
* to local files would fork coordination away from the deployment's
|
|
232
|
-
* durable store. The check demands the full surface the inbox uses —
|
|
233
|
-
* the CAS trio plus `get`/`put`/`delete` for mailbox payload blobs and
|
|
234
|
-
* `listKeys` for the janitor scan and the orphan sweep.
|
|
235
|
-
*
|
|
236
|
-
* Whatever store wins, the returned handle is scoped here — once —
|
|
237
|
-
* under `agentkit/v1/<agent>/durable-session/`. The ledger speaks bare
|
|
238
|
-
* `session/…` / `ledger/…` / `mailbox/…` keys; namespacing is this
|
|
239
|
-
* boundary's job, exactly like `host.kv`'s agent scoping.
|
|
240
|
-
*/
|
|
241
|
-
private resolveDurableSessionStore;
|
|
242
183
|
/**
|
|
243
184
|
* Attach serve-time resolved connections (peers, Cursor account bridge).
|
|
244
185
|
* They join the per-turn SDK `mcpServers` map (loopback URL for local
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-engine.d.ts","sourceRoot":"","sources":["../../src/internal/session-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAiB,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAShD,OAAO,EACL,mBAAmB,EACnB,eAAe,EAChB,MAAM,kCAAkC,CAAC;AAS1C,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,YAAY,EAEjB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EAEtB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EAIxB,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,qBAAqB,EAG1B,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,YAAY,EAKjB,KAAK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AAM,GAAG,IAAI,GACnB,OAAO,CAAC,IAAI,CAAC,CAmBf;IAED,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CASxC;IAED,WAAW,CAAC,MAAM,EAAE,aAAa,GAAG,WAAW,CAc9C;IAED,OAAO,CAAC,cAAc;IAqBtB,OAAO,CAAC,gBAAgB;IAwBxB,OAAO,CAAC,mBAAmB;IAc3B,sEAAsE;IACtE,OAAO,CAAC,YAAY;IA6BpB;;;;;;;;;;;OAWG;IACG,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC,CAgB3C;YAEa,cAAc;IA4F5B;;;;;;;;OAQG;IACG,mBAAmB,CACvB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAMpC;IAED;;;;;;;;;;OAUG;IACH,OAAO,CAAC,4BAA4B;IAqBpC,OAAO,CAAC,kBAAkB;YAkBZ,gCAAgC;YAgBhC,sBAAsB;YAWtB,yBAAyB;IAmBvC;;;;;OAKG;YACW,kBAAkB;IAYhC,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAO/C;IAED,2EAA2E;IAC3E,mBAAmB,IAAI,mBAAmB,CAEzC;IAED,yEAAyE;IACnE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAc3B;CACF;AAgCD;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,SAAS,GAAG,SAAS,EAC9B,KAAK,EAAE,SAAS,GAAG,SAAS,GAC3B,SAAS,GAAG,SAAS,CAuBvB"}
|
|
@@ -23,8 +23,6 @@ import { materializeSlackNudgeCarrier } from "../channels/slack/nudge-carrier.js
|
|
|
23
23
|
import { SlackAskDedupeStore, SlackNudgeStore, } from "../channels/slack/nudge-store.js";
|
|
24
24
|
import { resolveDedicatedSlackHostBinding } from "../channels/slack/slack-channel.js";
|
|
25
25
|
import { isCursorHostedFilesAvailable } from "../files-backends/cursor-hosted.js";
|
|
26
|
-
import { SessionLedger, supportsSessionLedgerKv, } from "../ledger/session-ledger.js";
|
|
27
|
-
import { fileKv } from "../storage-backends/file-kv.js";
|
|
28
26
|
import { DEFAULT_MODEL, DIRECT_TOOL_CALL_CHANNEL_ID, isHostOauthConnectionTransport, isSymbolicConnectionTransport, } from "../types.js";
|
|
29
27
|
import { ABCollector } from "./ab-collector.js";
|
|
30
28
|
import { foldABStream } from "./ab-fold.js";
|
|
@@ -36,7 +34,6 @@ import { SessionAuthError, samePrincipal } from "./auth.js";
|
|
|
36
34
|
import { mergeCloudOptions, resolveSessionRuntime } from "./cloud-merge.js";
|
|
37
35
|
import { applyCloudUsageToEvents, cloudSdkAgentIdFromEvents, isUnpricedCompletedTurn, mapSdkTokenUsage, } from "./cloud-turn-cost.js";
|
|
38
36
|
import { isDevMode } from "./dev-mode.js";
|
|
39
|
-
import { ledgerKeyPrefix, namespacedKv, storageCasKv, } from "./durable-session-store.js";
|
|
40
37
|
import { EventLogStore } from "./event-log.js";
|
|
41
38
|
import { TurnEventMapper } from "./event-mapper.js";
|
|
42
39
|
import { selectFrameworkStorageDefinition } from "./framework-storage-selection.js";
|
|
@@ -46,7 +43,6 @@ import { createHostOtelApi } from "./host-otel.js";
|
|
|
46
43
|
import { createHostPlatforms, createHostSlackClient, } from "./host-platforms.js";
|
|
47
44
|
import { formatContinuationToken, newContinuationKey, newSessionId, newToolCallId, } from "./ids.js";
|
|
48
45
|
import { validateToolInput } from "./json-schema.js";
|
|
49
|
-
import { LedgerServing, newLedgerPodId } from "./ledger-serving.js";
|
|
50
46
|
import { McpHost } from "./mcp-host.js";
|
|
51
47
|
import { shouldStartProcessMemoryTelemetry, startProcessMemoryTelemetry, } from "./process-memory-telemetry.js";
|
|
52
48
|
import { buildSessionContextBlock, SCHEDULE_CHANNEL_PREFIX, } from "./prompt-context.js";
|
|
@@ -67,7 +63,7 @@ export class SessionBusyError extends Error {
|
|
|
67
63
|
this.name = "SessionBusyError";
|
|
68
64
|
}
|
|
69
65
|
}
|
|
70
|
-
// Defined in auth.js (
|
|
66
|
+
// Defined in auth.js (HTTP/session-store callers import it without this
|
|
71
67
|
// module); re-exported here because this is its historical public home.
|
|
72
68
|
export { SessionAuthError } from "./auth.js";
|
|
73
69
|
export class UnknownChannelError extends Error {
|
|
@@ -115,8 +111,7 @@ export class ApprovalInterruptedError extends Error {
|
|
|
115
111
|
}
|
|
116
112
|
export class SessionEngine {
|
|
117
113
|
constructor(options) {
|
|
118
|
-
var _a;
|
|
119
|
-
var _b, _c, _d, _e;
|
|
114
|
+
var _a, _b, _c, _d;
|
|
120
115
|
/** In-flight lazy restores, deduped per channel + continuation key. */
|
|
121
116
|
this.restoreInFlight = new Map();
|
|
122
117
|
this.channelsById = new Map();
|
|
@@ -159,9 +154,9 @@ export class SessionEngine {
|
|
|
159
154
|
this.project = options.project;
|
|
160
155
|
this.stateRoot = options.stateRoot;
|
|
161
156
|
this.runner = options.runner;
|
|
162
|
-
this.logger = (
|
|
163
|
-
this.getCloudUsage = (
|
|
164
|
-
this.estimateTurnCost = (
|
|
157
|
+
this.logger = (_a = options.logger) !== null && _a !== void 0 ? _a : (() => { });
|
|
158
|
+
this.getCloudUsage = (_b = options.getCloudUsage) !== null && _b !== void 0 ? _b : defaultGetCloudUsage;
|
|
159
|
+
this.estimateTurnCost = (_c = options.estimateTurnCost) !== null && _c !== void 0 ? _c : estimateTurnCostFromApi;
|
|
165
160
|
this.otel = options.otel;
|
|
166
161
|
this.otelHost = createHostOtelApi({
|
|
167
162
|
agentName: options.project.name,
|
|
@@ -206,7 +201,7 @@ export class SessionEngine {
|
|
|
206
201
|
// resolves them; the host-side MCP registry starts with the concrete
|
|
207
202
|
// connections and gains the rest via setResolvedConnections.
|
|
208
203
|
this.mcpHost = new McpHost(options.project.agent.connections.filter((connection) => !isSymbolicConnectionTransport(connection.transport)));
|
|
209
|
-
const basePlatforms = (
|
|
204
|
+
const basePlatforms = (_d = options.platforms) !== null && _d !== void 0 ? _d : createHostPlatforms();
|
|
210
205
|
const slackBinding = resolveDedicatedSlackHostBinding(options.project.channels);
|
|
211
206
|
this.platforms =
|
|
212
207
|
slackBinding === undefined
|
|
@@ -221,8 +216,6 @@ export class SessionEngine {
|
|
|
221
216
|
for (const channel of options.project.channels) {
|
|
222
217
|
this.channelsById.set(channel.id, channel.definition);
|
|
223
218
|
}
|
|
224
|
-
this.ledgerServing = this.buildLedgerServing(options);
|
|
225
|
-
(_a = this.ledgerServing) === null || _a === void 0 ? void 0 : _a.start();
|
|
226
219
|
this.stopMemoryTelemetry = shouldStartProcessMemoryTelemetry()
|
|
227
220
|
? startProcessMemoryTelemetry({
|
|
228
221
|
agentName: options.project.name,
|
|
@@ -232,83 +225,6 @@ export class SessionEngine {
|
|
|
232
225
|
})
|
|
233
226
|
: undefined;
|
|
234
227
|
}
|
|
235
|
-
/**
|
|
236
|
-
* Ledger-mode wiring (`serving: "ledger"`): resolve a CAS-capable
|
|
237
|
-
* durable-session store and build the event pump. Resident agents
|
|
238
|
-
* (the default) return undefined and never touch ledger keys.
|
|
239
|
-
*/
|
|
240
|
-
buildLedgerServing(options) {
|
|
241
|
-
if (options.project.agent.serving !== "ledger") {
|
|
242
|
-
return undefined;
|
|
243
|
-
}
|
|
244
|
-
// The handle is already agent-scoped (resolveDurableSessionStore):
|
|
245
|
-
// two ledger-mode agents sharing one backend never resolve to each
|
|
246
|
-
// other's sessions or janitor-claim each other's parked envelopes.
|
|
247
|
-
const ledgerKv = this.resolveDurableSessionStore(options);
|
|
248
|
-
return new LedgerServing({
|
|
249
|
-
ledger: new SessionLedger({ kv: ledgerKv, podId: newLedgerPodId() }),
|
|
250
|
-
deliverTurn: (envelope) => this.send(envelope.channelId, envelope.message, Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ continuationToken: envelope.continuationToken, auth: envelope.auth }, (envelope.title === undefined ? {} : { title: envelope.title })), (envelope.state === undefined ? {} : { state: envelope.state })), (envelope.mode === undefined ? {} : { mode: envelope.mode })), (envelope.purpose === undefined
|
|
251
|
-
? {}
|
|
252
|
-
: { purpose: envelope.purpose })), (envelope.workspaceDir === undefined
|
|
253
|
-
? {}
|
|
254
|
-
: { workspaceDir: envelope.workspaceDir })), (envelope.cloud === undefined ? {} : { cloud: envelope.cloud })), { fromLedgerPump: true })),
|
|
255
|
-
findSession: (channelId, continuationToken) => __awaiter(this, void 0, void 0, function* () {
|
|
256
|
-
let record = yield this.sessions.findByContinuation(channelId, continuationToken);
|
|
257
|
-
if (record === undefined) {
|
|
258
|
-
record = yield this.restoreSessionByContinuation(channelId, continuationToken);
|
|
259
|
-
}
|
|
260
|
-
return record === undefined
|
|
261
|
-
? undefined
|
|
262
|
-
: this.channelSession(record.sessionId, record, false);
|
|
263
|
-
}),
|
|
264
|
-
logger: this.logger,
|
|
265
|
-
});
|
|
266
|
-
}
|
|
267
|
-
/**
|
|
268
|
-
* Pick the KV the ledger coordinates on, in precedence order:
|
|
269
|
-
*
|
|
270
|
-
* 1. `options.durableSessionStore` — an explicit store separate from
|
|
271
|
-
* agent state (advanced deployments, tests).
|
|
272
|
-
* 2. The authored storage backend (`agent/storage.ts`) when it
|
|
273
|
-
* implements the `cas` group — one backend serves both the storage
|
|
274
|
-
* API and the durable session API.
|
|
275
|
-
* 3. No authored storage: a file store under `<stateRoot>/ledger-kv`
|
|
276
|
-
* (same place resident state lives; single-process only).
|
|
277
|
-
*
|
|
278
|
-
* An authored backend without `cas` fails fast: silently falling back
|
|
279
|
-
* to local files would fork coordination away from the deployment's
|
|
280
|
-
* durable store. The check demands the full surface the inbox uses —
|
|
281
|
-
* the CAS trio plus `get`/`put`/`delete` for mailbox payload blobs and
|
|
282
|
-
* `listKeys` for the janitor scan and the orphan sweep.
|
|
283
|
-
*
|
|
284
|
-
* Whatever store wins, the returned handle is scoped here — once —
|
|
285
|
-
* under `agentkit/v1/<agent>/durable-session/`. The ledger speaks bare
|
|
286
|
-
* `session/…` / `ledger/…` / `mailbox/…` keys; namespacing is this
|
|
287
|
-
* boundary's job, exactly like `host.kv`'s agent scoping.
|
|
288
|
-
*/
|
|
289
|
-
resolveDurableSessionStore(options) {
|
|
290
|
-
const namespace = ledgerKeyPrefix(options.project.name);
|
|
291
|
-
const explicit = options.durableSessionStore;
|
|
292
|
-
if (explicit !== undefined) {
|
|
293
|
-
if (!supportsSessionLedgerKv(explicit)) {
|
|
294
|
-
throw new Error(`Agent "${options.project.name}" declares serving: "ledger", but the configured durableSessionStore is not CAS-capable (getWithVersion / putIfAbsent / putIfVersion / listKeys). Provide a store implementing HostKvCasApi (see @cursor/july/kv).`);
|
|
295
|
-
}
|
|
296
|
-
return namespacedKv(explicit, namespace);
|
|
297
|
-
}
|
|
298
|
-
const casArgs = {
|
|
299
|
-
agentName: options.project.name,
|
|
300
|
-
projectRoot: options.project.rootDir,
|
|
301
|
-
};
|
|
302
|
-
const authored = options.project.storage;
|
|
303
|
-
if (authored !== undefined) {
|
|
304
|
-
if (authored.cas === undefined) {
|
|
305
|
-
throw new Error(`Agent "${options.project.name}" declares serving: "ledger", which needs conditional writes, but the storage backend in agent/storage.ts does not implement the cas group. Add cas: {...} to defineStorage (fileKv and cursorHostedStorage already include it), or pass an explicit durableSessionStore.`);
|
|
306
|
-
}
|
|
307
|
-
return namespacedKv(storageCasKv(authored, casArgs), namespace);
|
|
308
|
-
}
|
|
309
|
-
const fallback = fileKv({ dir: join(options.stateRoot, "ledger-kv") });
|
|
310
|
-
return namespacedKv(storageCasKv(fallback, casArgs), namespace);
|
|
311
|
-
}
|
|
312
228
|
/**
|
|
313
229
|
* Attach serve-time resolved connections (peers, Cursor account bridge).
|
|
314
230
|
* They join the per-turn SDK `mcpServers` map (loopback URL for local
|
|
@@ -543,12 +459,6 @@ export class SessionEngine {
|
|
|
543
459
|
return __awaiter(this, arguments, void 0, function* (channelId, message, options = {}) {
|
|
544
460
|
var _a;
|
|
545
461
|
var _b, _c, _d, _e, _f;
|
|
546
|
-
// Ledger-mode agents park the event durably and coordinate through
|
|
547
|
-
// the session lease before any turn runs; only the pump's own
|
|
548
|
-
// lease-holding deliveries fall through to the resident path.
|
|
549
|
-
if (this.ledgerServing !== undefined && options.fromLedgerPump !== true) {
|
|
550
|
-
return this.ledgerServing.deliver(channelId, message, options);
|
|
551
|
-
}
|
|
552
462
|
const auth = (_b = options.auth) !== null && _b !== void 0 ? _b : null;
|
|
553
463
|
let existing = options.continuationToken === undefined
|
|
554
464
|
? undefined
|
|
@@ -616,13 +526,6 @@ export class SessionEngine {
|
|
|
616
526
|
};
|
|
617
527
|
yield this.sessions.save(record);
|
|
618
528
|
(_a = this.storage) === null || _a === void 0 ? void 0 : _a.sessionRecord(record);
|
|
619
|
-
// Ledger serving: another pod can follow up mid-turn, so the session
|
|
620
|
-
// identity (record + continuation index) must hit the shared store
|
|
621
|
-
// before we return a session id. Default turnEnd flush is too late.
|
|
622
|
-
if (this.ledgerServing !== undefined && this.storage !== undefined) {
|
|
623
|
-
this.storage.flushSession(record.sessionId);
|
|
624
|
-
yield this.storage.whenIdle();
|
|
625
|
-
}
|
|
626
529
|
yield this.appendEvent(record.sessionId, {
|
|
627
530
|
type: "session.started",
|
|
628
531
|
data: { channelId },
|
|
@@ -2884,11 +2787,9 @@ export class SessionEngine {
|
|
|
2884
2787
|
/** Drain running turns, dispatches, and pending writes, then dispose. */
|
|
2885
2788
|
close() {
|
|
2886
2789
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2887
|
-
var _a, _b, _c, _d, _e
|
|
2790
|
+
var _a, _b, _c, _d, _e;
|
|
2888
2791
|
(_a = this.stopMemoryTelemetry) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
2889
2792
|
this.approvals.cancelAll("deny");
|
|
2890
|
-
// Ledger deliveries spawn turns, so settle them before activeTurns.
|
|
2891
|
-
yield (_b = this.ledgerServing) === null || _b === void 0 ? void 0 : _b.close();
|
|
2892
2793
|
yield Promise.allSettled([...this.activeTurns.values()]);
|
|
2893
2794
|
yield Promise.allSettled([...this.backgroundWork]);
|
|
2894
2795
|
yield Promise.allSettled([...this.dispatchChains.values()]);
|
|
@@ -2896,10 +2797,10 @@ export class SessionEngine {
|
|
|
2896
2797
|
// After the drain, so a successor need not wait out the heartbeat TTL.
|
|
2897
2798
|
yield this.turnLeases.releaseAll().catch(() => { });
|
|
2898
2799
|
yield this.logs.flushAll();
|
|
2899
|
-
yield (
|
|
2800
|
+
yield (_b = this.storage) === null || _b === void 0 ? void 0 : _b.close();
|
|
2900
2801
|
yield this.mcpHost.close();
|
|
2901
|
-
yield (
|
|
2902
|
-
(
|
|
2802
|
+
yield (_d = (_c = this.runner).dispose) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
2803
|
+
(_e = this.otel) === null || _e === void 0 ? void 0 : _e.close();
|
|
2903
2804
|
});
|
|
2904
2805
|
}
|
|
2905
2806
|
}
|
package/dist/kv/memory-kv.d.ts
CHANGED
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
* `@cursor/july/kv/memory`.
|
|
5
5
|
*
|
|
6
6
|
* The memory KV *is* the dev shim: tests and local runs exercise the
|
|
7
|
-
*
|
|
8
|
-
* RPC. Values are deep-copied on both write and
|
|
7
|
+
* CAS contract, not a mock of an RPC. Values are deep-copied on both write and
|
|
9
8
|
* read so callers can never observe (or cause) shared-reference mutation.
|
|
10
9
|
*/
|
|
11
10
|
import type { StorageCasTable } from "../storage.js";
|
|
@@ -18,14 +17,6 @@ export declare function createMemoryKv(): HostKvCasApi;
|
|
|
18
17
|
* fixtures, an off-hosting no-op sink). Non-durable and process-local by
|
|
19
18
|
* construction; a real deployment backend should implement CAS against
|
|
20
19
|
* its own store instead.
|
|
21
|
-
*
|
|
22
|
-
* **Never pair this with `serving: "ledger"` on a real backend.** The
|
|
23
|
-
* ledger derives its coordination store from the whole storage config,
|
|
24
|
-
* so a durable plain backend with a memory `cas` group silently voids
|
|
25
|
-
* ack-after-durable: leases, heads, and pending indexes live only in
|
|
26
|
-
* this process and vanish on restart while payload blobs go through the
|
|
27
|
-
* plain methods. Ledger state must live in the same durable store as
|
|
28
|
-
* the blobs.
|
|
29
20
|
*/
|
|
30
21
|
export declare function memoryCasTable(): StorageCasTable;
|
|
31
22
|
//# sourceMappingURL=memory-kv.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory-kv.d.ts","sourceRoot":"","sources":["../../src/kv/memory-kv.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"memory-kv.d.ts","sourceRoot":"","sources":["../../src/kv/memory-kv.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,KAAK,EACV,YAAY,EAIb,MAAM,aAAa,CAAC;AAErB,gDAAgD;AAChD,wBAAgB,cAAc,IAAI,YAAY,CA4D7C;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,IAAI,eAAe,CAShD"}
|
package/dist/kv/memory-kv.js
CHANGED
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
* `@cursor/july/kv/memory`.
|
|
5
5
|
*
|
|
6
6
|
* The memory KV *is* the dev shim: tests and local runs exercise the
|
|
7
|
-
*
|
|
8
|
-
* RPC. Values are deep-copied on both write and
|
|
7
|
+
* CAS contract, not a mock of an RPC. Values are deep-copied on both write and
|
|
9
8
|
* read so callers can never observe (or cause) shared-reference mutation.
|
|
10
9
|
*/
|
|
11
10
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
@@ -91,14 +90,6 @@ export function createMemoryKv() {
|
|
|
91
90
|
* fixtures, an off-hosting no-op sink). Non-durable and process-local by
|
|
92
91
|
* construction; a real deployment backend should implement CAS against
|
|
93
92
|
* its own store instead.
|
|
94
|
-
*
|
|
95
|
-
* **Never pair this with `serving: "ledger"` on a real backend.** The
|
|
96
|
-
* ledger derives its coordination store from the whole storage config,
|
|
97
|
-
* so a durable plain backend with a memory `cas` group silently voids
|
|
98
|
-
* ack-after-durable: leases, heads, and pending indexes live only in
|
|
99
|
-
* this process and vanish on restart while payload blobs go through the
|
|
100
|
-
* plain methods. Ledger state must live in the same durable store as
|
|
101
|
-
* the blobs.
|
|
102
93
|
*/
|
|
103
94
|
export function memoryCasTable() {
|
|
104
95
|
const kv = createMemoryKv();
|
package/dist/kv.d.ts
CHANGED
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
* The CAS-capable KV **interface** — `@cursor/july/kv`.
|
|
3
3
|
*
|
|
4
4
|
* This module is implementation-free on purpose: it is the contract a
|
|
5
|
-
* bring-your-own KV implements so
|
|
6
|
-
*
|
|
7
|
-
* it. {@link HostKvCasApi} is the conditional-write superset of the plain
|
|
5
|
+
* bring-your-own KV implements so conditional writes can run on it.
|
|
6
|
+
* {@link HostKvCasApi} is the conditional-write superset of the plain
|
|
8
7
|
* {@link HostKvApi}; {@link supportsKvCas} is the runtime probe for
|
|
9
8
|
* stores of unknown provenance — a `defineStorage` backend declares CAS
|
|
10
9
|
* through its `cas` group instead, so it never needs probing.
|
package/dist/kv.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kv.d.ts","sourceRoot":"","sources":["../src/kv.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"kv.d.ts","sourceRoot":"","sources":["../src/kv.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,YAAY,EACV,SAAS,EACT,YAAY,EACZ,WAAW,EACX,gBAAgB,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/kv.js
CHANGED
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
* The CAS-capable KV **interface** — `@cursor/july/kv`.
|
|
3
3
|
*
|
|
4
4
|
* This module is implementation-free on purpose: it is the contract a
|
|
5
|
-
* bring-your-own KV implements so
|
|
6
|
-
*
|
|
7
|
-
* it. {@link HostKvCasApi} is the conditional-write superset of the plain
|
|
5
|
+
* bring-your-own KV implements so conditional writes can run on it.
|
|
6
|
+
* {@link HostKvCasApi} is the conditional-write superset of the plain
|
|
8
7
|
* {@link HostKvApi}; {@link supportsKvCas} is the runtime probe for
|
|
9
8
|
* stores of unknown provenance — a `defineStorage` backend declares CAS
|
|
10
9
|
* through its `cas` group instead, so it never needs probing.
|