@cursor/sdk 1.0.14 → 1.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -19
- package/dist/cjs/agent.d.ts +8 -0
- package/dist/cjs/agent.d.ts.map +1 -1
- package/dist/cjs/executor-common.d.ts +4 -0
- package/dist/cjs/executor-common.d.ts.map +1 -1
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/local-executor.d.ts.map +1 -1
- package/dist/cjs/options.d.ts +34 -2
- package/dist/cjs/options.d.ts.map +1 -1
- package/dist/cjs/platform.d.ts +2 -2
- package/dist/cjs/platform.d.ts.map +1 -1
- package/dist/cjs/public-api.d.ts +6 -2
- package/dist/cjs/public-api.d.ts.map +1 -1
- package/dist/cjs/sdk-config.d.ts +24 -0
- package/dist/cjs/sdk-config.d.ts.map +1 -0
- package/dist/cjs/store/index.d.ts +8 -0
- package/dist/cjs/store/index.d.ts.map +1 -0
- package/dist/cjs/store/jsonl-local-agent-store.d.ts +34 -0
- package/dist/cjs/store/jsonl-local-agent-store.d.ts.map +1 -0
- package/dist/cjs/store/local-agent-record-conversion.d.ts +7 -0
- package/dist/cjs/store/local-agent-record-conversion.d.ts.map +1 -0
- package/dist/cjs/store/local-agent-store.d.ts +288 -0
- package/dist/cjs/store/local-agent-store.d.ts.map +1 -0
- package/dist/cjs/store/sdk-local-defaults.d.ts +15 -0
- package/dist/cjs/store/sdk-local-defaults.d.ts.map +1 -0
- package/dist/cjs/store/sdk-state-root.d.ts +6 -0
- package/dist/cjs/store/sdk-state-root.d.ts.map +1 -0
- package/dist/cjs/store/sqlite-local-agent-store.d.ts +30 -0
- package/dist/cjs/store/sqlite-local-agent-store.d.ts.map +1 -0
- package/dist/cjs/stubs.d.ts +6 -0
- package/dist/cjs/stubs.d.ts.map +1 -1
- package/dist/cjs/types/conversation-types.d.ts +96 -96
- package/dist/esm/agent.d.ts +8 -0
- package/dist/esm/agent.d.ts.map +1 -1
- package/dist/esm/executor-common.d.ts +4 -0
- package/dist/esm/executor-common.d.ts.map +1 -1
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +5 -5
- package/dist/esm/local-executor.d.ts.map +1 -1
- package/dist/esm/options.d.ts +34 -2
- package/dist/esm/options.d.ts.map +1 -1
- package/dist/esm/platform.d.ts +2 -2
- package/dist/esm/platform.d.ts.map +1 -1
- package/dist/esm/public-api.d.ts +6 -2
- package/dist/esm/public-api.d.ts.map +1 -1
- package/dist/esm/sdk-config.d.ts +24 -0
- package/dist/esm/sdk-config.d.ts.map +1 -0
- package/dist/esm/store/index.d.ts +8 -0
- package/dist/esm/store/index.d.ts.map +1 -0
- package/dist/esm/store/jsonl-local-agent-store.d.ts +34 -0
- package/dist/esm/store/jsonl-local-agent-store.d.ts.map +1 -0
- package/dist/esm/store/local-agent-record-conversion.d.ts +7 -0
- package/dist/esm/store/local-agent-record-conversion.d.ts.map +1 -0
- package/dist/esm/store/local-agent-store.d.ts +288 -0
- package/dist/esm/store/local-agent-store.d.ts.map +1 -0
- package/dist/esm/store/sdk-local-defaults.d.ts +15 -0
- package/dist/esm/store/sdk-local-defaults.d.ts.map +1 -0
- package/dist/esm/store/sdk-state-root.d.ts +6 -0
- package/dist/esm/store/sdk-state-root.d.ts.map +1 -0
- package/dist/esm/store/sqlite-local-agent-store.d.ts +30 -0
- package/dist/esm/store/sqlite-local-agent-store.d.ts.map +1 -0
- package/dist/esm/stubs.d.ts +6 -0
- package/dist/esm/stubs.d.ts.map +1 -1
- package/dist/esm/types/conversation-types.d.ts +96 -96
- package/package.json +7 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-executor.d.ts","sourceRoot":"","sources":["../../src/agent/local-executor.ts"],"names":[],"mappings":"AAwBA,OAAO,EAQL,KAAK,+BAA+B,EAKrC,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"local-executor.d.ts","sourceRoot":"","sources":["../../src/agent/local-executor.ts"],"names":[],"mappings":"AAwBA,OAAO,EAQL,KAAK,+BAA+B,EAKrC,MAAM,qCAAqC,CAAC;AAsE7C,OAAO,KAAK,EACV,WAAW,EAIZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAEV,eAAe,EACf,cAAc,EACd,aAAa,EACd,MAAM,cAAc,CAAC;AAItB,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,WAAW,CAAC;IACjB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACxB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;IACnD,QAAQ,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC;IACzC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACtD,QAAQ,CAAC,eAAe,CAAC,EAAE,SAAS,+BAA+B,EAAE,CAAC;CACvE;AA2JD,wBAAsB,mBAAmB,CACvC,yBAAyB,CAAC,EAAE,0BAA0B,GAAG,MAAM,EAC/D,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,mBAAmB,CAAC,CA2Z9B"}
|
package/dist/cjs/options.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AgentCheckpointStore, AgentRunStore, RunEventNotifier, RunEventStore } from "@anysphere/cursor-sdk-local-runtime/run-store";
|
|
2
|
+
import type { LocalAgentStore } from "./store/local-agent-store.js";
|
|
2
3
|
/** Conversation mode for agent runs. */
|
|
3
4
|
export type AgentModeOption = "agent" | "plan";
|
|
4
5
|
export interface SDKImageDimension {
|
|
@@ -81,6 +82,15 @@ export interface AgentDefinition {
|
|
|
81
82
|
*/
|
|
82
83
|
export interface LocalAgentOptions {
|
|
83
84
|
cwd?: string | string[];
|
|
85
|
+
/**
|
|
86
|
+
* Custom {@link LocalAgentStore} for this call. When omitted, uses
|
|
87
|
+
* `Cursor.configure({ local: { store } })` if set; otherwise
|
|
88
|
+
* {@link SqliteLocalAgentStore} (see `SqliteLocalAgentStore.open`).
|
|
89
|
+
* For a portable JSONL file backend, use `new JsonlLocalAgentStore(rootDir)`.
|
|
90
|
+
* Agent rows hold a slim checkpoint ref (`latestCheckpoint.rootBlobId`);
|
|
91
|
+
* blob bytes live on `store.checkpoints`.
|
|
92
|
+
*/
|
|
93
|
+
store?: LocalAgentStore;
|
|
84
94
|
/**
|
|
85
95
|
* Ambient Cursor settings layers to load from the local filesystem.
|
|
86
96
|
* Local agents only. On cloud, `project` / `team` / `plugins` are
|
|
@@ -121,6 +131,29 @@ export interface CloudAgentOptions {
|
|
|
121
131
|
*/
|
|
122
132
|
envVars?: Record<string, string>;
|
|
123
133
|
}
|
|
134
|
+
export interface CursorAgentPlatformOptions {
|
|
135
|
+
/**
|
|
136
|
+
* Custom {@link LocalAgentStore}. Prefer `local.store` on `Agent.create` /
|
|
137
|
+
* `Agent.resume` unless constructing a platform directly. When omitted, the
|
|
138
|
+
* platform uses built-in SQLite under `stateRoot` — implement
|
|
139
|
+
* {@link LocalAgentStore} only to replace that default path.
|
|
140
|
+
*/
|
|
141
|
+
localStore?: LocalAgentStore;
|
|
142
|
+
stateRoot?: string;
|
|
143
|
+
workspaceRef?: string;
|
|
144
|
+
/**
|
|
145
|
+
* When set, custom-store reads filter to agents whose `cwd` matches. Populated
|
|
146
|
+
* from an explicit caller `cwd`; omitted when the caller did not pass one.
|
|
147
|
+
*/
|
|
148
|
+
scopedWorkspaceRef?: string;
|
|
149
|
+
/**
|
|
150
|
+
* Internal storage hooks retained for existing advanced callers.
|
|
151
|
+
*/
|
|
152
|
+
store?: AgentRunStore;
|
|
153
|
+
checkpointStore?: AgentCheckpointStore;
|
|
154
|
+
eventStore?: RunEventStore;
|
|
155
|
+
eventNotifier?: RunEventNotifier;
|
|
156
|
+
}
|
|
124
157
|
export interface AgentOptions {
|
|
125
158
|
/**
|
|
126
159
|
* Model selection (`{ id, params? }`). Required for local agents; optional
|
|
@@ -144,6 +177,5 @@ export interface AgentOptions {
|
|
|
144
177
|
idempotencyKey?: string;
|
|
145
178
|
/** Initial conversation mode for this agent. */
|
|
146
179
|
mode?: AgentModeOption;
|
|
147
|
-
platform?: CursorAgentPlatformOptions;
|
|
148
180
|
}
|
|
149
181
|
//# sourceMappingURL=options.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/agent/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/agent/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,aAAa,EACd,MAAM,+CAA+C,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEpE,wCAAwC;AACxC,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,MAAM,CAAC;AAE/C,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,QAAQ,GAChB;IACE,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,iBAAiB,CAAC;CAC/B,GACD;IACE,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,iBAAiB,CAAC;CAC/B,CAAC;AAEN,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,M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inition } from "@anysphere/cursor-sdk-local-runtime";
|
|
2
|
-
import type { AgentCheckpointStore, AgentRunStore,
|
|
2
|
+
import type { AgentCheckpointStore, AgentRunStore, RunEventNotifier, RunEventStore } from "@anysphere/cursor-sdk-local-runtime/run-store";
|
|
3
3
|
import type { AgentMessage, AgentOperationOptions, CursorRequestOptions, GetAgentMessagesOptions, GetAgentOptions, GetRunOptions, ListAgentsOptions, ListRunsOptions, ListResult as PublicListResult, SDKAgent, SDKAgentInfo, SDKModel, SDKRepository, SDKUser } from "./agent.js";
|
|
4
4
|
import type { RunExecutor } from "./executor-types.js";
|
|
5
5
|
import { type SDKMessage } from "./messages.js";
|
|
6
|
-
import type { AgentOptions, McpServerConfig, ModelSelection, SandboxOptions, SettingSource } from "./options.js";
|
|
6
|
+
import type { AgentOptions, CursorAgentPlatformOptions, McpServerConfig, ModelSelection, SandboxOptions, SettingSource } from "./options.js";
|
|
7
7
|
import { type Run } from "./run.js";
|
|
8
8
|
interface AgentExecutorHandle {
|
|
9
9
|
run: RunExecutor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/agent/platform.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/agent/platform.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,qCAAqC,CAAC;AAC3F,OAAO,KAAK,EACV,oBAAoB,EAEpB,aAAa,EACb,gBAAgB,EAChB,aAAa,EAId,MAAM,+CAA+C,CAAC;AAMvD,OAAO,KAAK,EACV,YAAY,EACZ,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,UAAU,IAAI,gBAAgB,EAC9B,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,OAAO,EAER,MAAM,YAAY,CAAC;AAUpB,OAAO,KAAK,E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B;AAaD,wBAAsB,eAAe,CACnC,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,YAAY,CAAC,CAOvB;AAED,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,IAAI,CAAC,CAOf;AAED,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,IAAI,CAAC,CAOf;AAED,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,IAAI,CAAC,CAOf;AAED,wBAAsB,YAAY,CAChC,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,OAAO,CAAC,CAGlB;AAED,wBAAsB,iBAAiB,CACrC,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,QAAQ,EAAE,CAAC,CAGrB;AAED,wBAAsB,uBAAuB,CAC3C,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,aAAa,EAAE,CAAC,CAG1B"}
|
package/dist/cjs/public-api.d.ts
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
export type { AgentCheckpointStore, AgentLifecycleStatus, AgentRecord, AgentRunStore, AppendRunEventInput, AttachRunEventsInput, CheckpointRef, CreateAgentInput, CreateFollowUpRunInput,
|
|
1
|
+
export type { AgentCheckpointStore, AgentLifecycleStatus, AgentRecord, AgentRunStore, AppendRunEventInput, AttachRunEventsInput, CheckpointRef, CreateAgentInput, CreateFollowUpRunInput, ListRunEventsInput, ListRunEventsResult, LocalRunEventNotifierOptions, LocalRunEventNotifierServerOptions, RunEventHint, RunEventNotifier, RunEventOffset, RunEventRecord, RunEventStore, RunEventStreamStore, RunEventSubscription, RunLifecycleStatus, RunRecord, RunTerminalPatch, WatchableRunEventStore, WatchRunEventsInput, } from "@anysphere/cursor-sdk-local-runtime/run-store";
|
|
2
2
|
export { createInMemoryRunEventNotifier, createLocalRunEventNotifier, InMemoryRunEventNotifier, LocalRunEventNotifier, LocalRunEventNotifierServer, startLocalRunEventNotifierServer, } from "@anysphere/cursor-sdk-local-runtime/run-store";
|
|
3
3
|
export type { AgentMessage, AgentOperationOptions, CursorRequestOptions, GetAgentMessagesOptions, GetAgentOptions, GetRunOptions, ListAgentsOptions, ListResult, ListRunsOptions, SDKAgent, SDKAgentInfo, SDKModel, SDKRepository, SDKUser, SendOptions, } from "./agent.js";
|
|
4
4
|
export type { SDKArtifact } from "./artifacts.js";
|
|
5
5
|
export type { LocalRunStreamDoneEvent, LocalRunStreamEvent, LocalRunStreamResultEvent, LocalRunStreamSdkMessageEvent, SDKAssistantMessage, SDKMessage, SDKStatusMessage, SDKSystemMessage, SDKTaskMessage, SDKThinkingMessage, SDKToolUseMessage, SDKUserMessageEvent, TextBlock, ToolUseBlock, } from "./messages.js";
|
|
6
6
|
export { createSdkMessageRunStreamEvent, decodeLocalRunStreamEvent, decodeSdkMessageRunStreamEvent, isTerminalLocalRunStreamEvent, LOCAL_RUN_STREAM_EVENT_TYPE, LOCAL_RUN_STREAM_SCHEMA_VERSION, localRunStreamEventToSdkMessage, } from "./messages.js";
|
|
7
|
-
export type { AgentDefinition, AgentModeOption, AgentOptions, CloudAgentOptions, LocalAgentOptions, McpServerConfig, ModelListItem, ModelParameterDefinition, ModelParameterValue, ModelSelection, ModelVariant, SDKImage, SDKImageDimension, SDKUserMessage, SettingSource, } from "./options.js";
|
|
7
|
+
export type { AgentDefinition, AgentModeOption, AgentOptions, CloudAgentOptions, CursorAgentPlatformOptions, LocalAgentOptions, McpServerConfig, ModelListItem, ModelParameterDefinition, ModelParameterValue, ModelSelection, ModelVariant, SDKImage, SDKImageDimension, SDKUserMessage, SettingSource, } from "./options.js";
|
|
8
8
|
export { CursorAgentPlatform, createAgentPlatform } from "./platform.js";
|
|
9
9
|
export type { Run, RunOperation, RunResult, RunResultStatus, RunStatus, } from "./run.js";
|
|
10
10
|
export { UnsupportedRunOperationError } from "./run.js";
|
|
11
|
+
export type { CursorConfigureOptions } from "./sdk-config.js";
|
|
12
|
+
export { configureCursorSdk } from "./sdk-config.js";
|
|
13
|
+
export type { LocalAgentAgentFilter, LocalAgentCheckpointFilter, LocalAgentCheckpointRef, LocalAgentDocument, LocalAgentListFilter, LocalAgentRunDocument, LocalAgentRunEventDocument, LocalAgentRunEventFilter, LocalAgentRunEventListResult, LocalAgentRunEventOffset, LocalAgentRunFilter, LocalAgentRunStatus, LocalAgentStatus, LocalAgentStore, LocalAgentStoreAgents, LocalAgentStoreCheckpoints, LocalAgentStoreListResult, LocalAgentStoreRunEvents, LocalAgentStoreRuns, RunFilter, SqliteLocalAgentStoreOptions, } from "./store/index.js";
|
|
14
|
+
export { composeLocalAgentStore, getDefaultSdkStateRoot, JSONL_LOCAL_AGENT_STORE_FILES, JsonlLocalAgentStore, paginateAgentDocuments, paginateCheckpointBlobIds, paginateRunDocuments, SqliteLocalAgentStore, } from "./store/index.js";
|
|
11
15
|
export { Agent, Cursor } from "./stubs.js";
|
|
12
16
|
//# sourceMappingURL=public-api.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../../src/agent/public-api.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,oBAAoB,EACpB,oBAAoB,EACpB,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,sBAAsB,EACtB,
|
|
1
|
+
{"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../../src/agent/public-api.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,oBAAoB,EACpB,oBAAoB,EACpB,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,sBAAsB,EACtB,kBAAkB,EAClB,m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E,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACzE,YAAY,EACV,GAAG,EACH,YAAY,EACZ,SAAS,EACT,eAAe,EACf,SAAS,GACV,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AACxD,YAAY,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,YAAY,EACV,qBAAqB,EACrB,0BAA0B,EAC1B,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,0BAA0B,EAC1B,wBAAwB,EACxB,4BAA4B,EAC5B,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,0BAA0B,EAC1B,yBAAyB,EACzB,wBAAwB,EACxB,mBAAmB,EACnB,SAAS,EACT,4BAA4B,GAC7B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,6BAA6B,EAC7B,oBAAoB,EACpB,sBAAsB,EACtB,yBAAyB,EACzB,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { LocalAgentStore } from "./store/local-agent-store.js";
|
|
2
|
+
export interface CursorConfigureOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Defaults for local-agent persistence. Fields on individual `Agent.*`
|
|
5
|
+
* calls override these values.
|
|
6
|
+
*/
|
|
7
|
+
local?: {
|
|
8
|
+
/**
|
|
9
|
+
* Default {@link LocalAgentStore} when a call omits `store` / `local.store`.
|
|
10
|
+
* Pass `null` to clear a previous default. When unset, local routes use
|
|
11
|
+
* {@link SqliteLocalAgentStore} via `SqliteLocalAgentStore.open`.
|
|
12
|
+
*/
|
|
13
|
+
store?: LocalAgentStore | null;
|
|
14
|
+
/**
|
|
15
|
+
* Force local agent backend streams to use HTTP/1.1 with SSE instead of
|
|
16
|
+
* HTTP/2. Pass `null` to clear a previous default.
|
|
17
|
+
*/
|
|
18
|
+
useHttp1ForAgent?: boolean | null;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export declare function configureCursorSdk(options: CursorConfigureOptions): void;
|
|
22
|
+
export declare function getDefaultUseHttp1ForAgent(): boolean | undefined;
|
|
23
|
+
export declare function __clearDefaultNetworkConfigForTests(): void;
|
|
24
|
+
//# sourceMappingURL=sdk-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk-config.d.ts","sourceRoot":"","sources":["../../src/agent/sdk-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAGpE,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,KAAK,CAAC,EAAE;QACN;;;;WAIG;QACH,KAAK,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;QAC/B;;;WAGG;QACH,gBAAgB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;KACnC,CAAC;CACH;AAID,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,sBAAsB,GAAG,IAAI,CAOxE;AAED,wBAAgB,0BAA0B,IAAI,OAAO,GAAG,SAAS,CAEhE;AAED,wBAAgB,mCAAmC,IAAI,IAAI,CAE1D"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { JSONL_LOCAL_AGENT_STORE_FILES, JsonlLocalAgentStore, } from "./jsonl-local-agent-store.js";
|
|
2
|
+
export type { LocalAgentAgentFilter, LocalAgentCheckpointFilter, LocalAgentCheckpointRef, LocalAgentDocument, LocalAgentListFilter, LocalAgentRunDocument, LocalAgentRunEventDocument, LocalAgentRunEventFilter, LocalAgentRunEventListResult, LocalAgentRunEventOffset, LocalAgentRunFilter, LocalAgentRunStatus, LocalAgentStatus, LocalAgentStore, LocalAgentStoreAgents, LocalAgentStoreCheckpoints, LocalAgentStoreListResult, LocalAgentStoreRunEvents, LocalAgentStoreRuns, RunFilter, } from "./local-agent-store.js";
|
|
3
|
+
export { composeLocalAgentStore, createLocalAgentStoreAdapters, paginateAgentDocuments, paginateCheckpointBlobIds, paginateRunDocuments, } from "./local-agent-store.js";
|
|
4
|
+
export { resolveLocalAgentStore, setDefaultLocalAgentStore, } from "./sdk-local-defaults.js";
|
|
5
|
+
export { getDefaultSdkStateRoot } from "./sdk-state-root.js";
|
|
6
|
+
export type { SqliteLocalAgentStoreOptions } from "./sqlite-local-agent-store.js";
|
|
7
|
+
export { SqliteLocalAgentStore } from "./sqlite-local-agent-store.js";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agent/store/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,oBAAoB,GACrB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,qBAAqB,EACrB,0BAA0B,EAC1B,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,0BAA0B,EAC1B,wBAAwB,EACxB,4BAA4B,EAC5B,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,0BAA0B,EAC1B,yBAAyB,EACzB,wBAAwB,EACxB,mBAAmB,EACnB,SAAS,GACV,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,sBAAsB,EACtB,6BAA6B,EAC7B,sBAAsB,EACtB,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,YAAY,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAClF,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { LocalAgentStore, LocalAgentStoreAgents, LocalAgentStoreCheckpoints, LocalAgentStoreRunEvents, LocalAgentStoreRuns } from "./local-agent-store.js";
|
|
2
|
+
/** JSONL filenames under the directory passed to {@link JsonlLocalAgentStore}. */
|
|
3
|
+
export declare const JSONL_LOCAL_AGENT_STORE_FILES: {
|
|
4
|
+
readonly agents: "agents.ndjson";
|
|
5
|
+
readonly runs: "runs.ndjson";
|
|
6
|
+
readonly runEvents: "run_events.ndjson";
|
|
7
|
+
readonly checkpoints: "checkpoints.ndjson";
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* File-backed {@link LocalAgentStore} using newline-delimited JSON (JSONL / NDJSON).
|
|
11
|
+
*
|
|
12
|
+
* Under `rootDir` the store reads and writes four files:
|
|
13
|
+
* {@link JSONL_LOCAL_AGENT_STORE_FILES}. Writes are serialized process-wide so
|
|
14
|
+
* concurrent SDK callbacks do not interleave partial lines. Listing rewrites whole
|
|
15
|
+
* files on delete/update (simple, portable; not optimized for huge catalogs).
|
|
16
|
+
*
|
|
17
|
+
* Pass the same instance (or the same `Cursor.configure` default) on
|
|
18
|
+
* `Agent.create`, `Agent.resume`, and local list/get APIs.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* const store = new JsonlLocalAgentStore("/path/to/store");
|
|
23
|
+
* Cursor.configure({ local: { store } });
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare class JsonlLocalAgentStore implements LocalAgentStore {
|
|
27
|
+
private readonly rootDir;
|
|
28
|
+
readonly agents: LocalAgentStoreAgents;
|
|
29
|
+
readonly checkpoints: LocalAgentStoreCheckpoints;
|
|
30
|
+
readonly runs: LocalAgentStoreRuns;
|
|
31
|
+
readonly runEvents: LocalAgentStoreRunEvents;
|
|
32
|
+
constructor(rootDir: string);
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=jsonl-local-agent-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonl-local-agent-store.d.ts","sourceRoot":"","sources":["../../../src/agent/store/jsonl-local-agent-store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAWV,eAAe,EACf,qBAAqB,EACrB,0BAA0B,EAC1B,wBAAwB,EACxB,mBAAmB,EACpB,MAAM,wBAAwB,CAAC;AAYhC,kFAAkF;AAClF,eAAO,MAAM,6BAA6B;;;;;CAKhC,CAAC;AA0BX;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,oBAAqB,YAAW,eAAe;IAM9C,OAAO,CAAC,QAAQ,CAAC,OAAO;IALpC,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAC;IACvC,QAAQ,CAAC,WAAW,EAAE,0BAA0B,CAAC;IACjD,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAE,wBAAwB,CAAC;gBAEhB,OAAO,EAAE,MAAM;CAM7C"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AgentRecord, RunRecord } from "@anysphere/cursor-sdk-local-runtime/run-store";
|
|
2
|
+
import type { LocalAgentDocument, LocalAgentRunDocument } from "./local-agent-store.js";
|
|
3
|
+
export declare function localAgentDocumentFromAgentRecord(record: AgentRecord): LocalAgentDocument;
|
|
4
|
+
export declare function localAgentRunDocumentFromRunRecord(record: RunRecord): LocalAgentRunDocument;
|
|
5
|
+
export declare function agentRecordFromLocalAgentDocument(document: LocalAgentDocument): AgentRecord;
|
|
6
|
+
export declare function runRecordFromLocalAgentRunDocument(run: LocalAgentRunDocument): RunRecord;
|
|
7
|
+
//# sourceMappingURL=local-agent-record-conversion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-agent-record-conversion.d.ts","sourceRoot":"","sources":["../../../src/agent/store/local-agent-record-conversion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,WAAW,EAGX,SAAS,EACV,MAAM,+CAA+C,CAAC;AACvD,OAAO,KAAK,EAEV,kBAAkB,EAClB,qBAAqB,EAGtB,MAAM,wBAAwB,CAAC;AAEhC,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,WAAW,GAClB,kBAAkB,CAcpB;AAED,wBAAgB,kCAAkC,CAChD,MAAM,EAAE,SAAS,GAChB,qBAAqB,CA0BvB;AAED,wBAAgB,iCAAiC,CAC/C,QAAQ,EAAE,kBAAkB,GAC3B,WAAW,CAcb;AAED,wBAAgB,kCAAkC,CAChD,GAAG,EAAE,qBAAqB,GACzB,SAAS,CAyBX"}
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
import type { AgentCheckpointStore, AgentRunStore, RunEventStore } from "@anysphere/cursor-sdk-local-runtime/run-store";
|
|
2
|
+
import type { ModelSelection } from "../options.js";
|
|
3
|
+
export type LocalAgentStatus = "idle" | "running" | "error" | "archived";
|
|
4
|
+
export type LocalAgentRunStatus = "queued" | "running" | "finished" | "error" | "cancelled" | "expired";
|
|
5
|
+
/** Pointer to the latest conversation checkpoint for an agent. */
|
|
6
|
+
export interface LocalAgentCheckpointRef {
|
|
7
|
+
readonly schemaVersion: 1;
|
|
8
|
+
readonly rootBlobId: string;
|
|
9
|
+
}
|
|
10
|
+
export interface LocalAgentRunDocument {
|
|
11
|
+
readonly runId: string;
|
|
12
|
+
readonly agentId: string;
|
|
13
|
+
readonly turnNumber: number;
|
|
14
|
+
readonly status: LocalAgentRunStatus;
|
|
15
|
+
readonly model?: ModelSelection | null;
|
|
16
|
+
readonly result?: string | null;
|
|
17
|
+
readonly error?: string | null;
|
|
18
|
+
readonly usageRef?: string | null;
|
|
19
|
+
readonly createdAt: number;
|
|
20
|
+
readonly updatedAt: number;
|
|
21
|
+
readonly startedAt?: number | null;
|
|
22
|
+
readonly endedAt?: number | null;
|
|
23
|
+
/** Snapshot at run creation (mirrors `runs.start_checkpoint_ref` in SQLite). */
|
|
24
|
+
readonly startCheckpointRef?: LocalAgentCheckpointRef | null;
|
|
25
|
+
/** Latest checkpoint for this run (mirrors `runs.latest_checkpoint_ref`). */
|
|
26
|
+
readonly latestCheckpointRef?: LocalAgentCheckpointRef | null;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Agent metadata persisted by a custom local store. Run rows live on
|
|
30
|
+
* {@link LocalAgentStore.runs} separately, or a bundled in-memory layout that
|
|
31
|
+
* co-locates runs per agent while still exposing both substores.
|
|
32
|
+
*/
|
|
33
|
+
export interface LocalAgentDocument {
|
|
34
|
+
readonly agentId: string;
|
|
35
|
+
readonly cwd: string;
|
|
36
|
+
readonly status: LocalAgentStatus;
|
|
37
|
+
readonly activeRunId?: string | null;
|
|
38
|
+
readonly name?: string | null;
|
|
39
|
+
readonly createdAt: number;
|
|
40
|
+
readonly updatedAt: number;
|
|
41
|
+
readonly latestCheckpoint?: LocalAgentCheckpointRef | null;
|
|
42
|
+
/**
|
|
43
|
+
* SDK-owned metadata. Stores should persist and return it unchanged.
|
|
44
|
+
*/
|
|
45
|
+
readonly sdkMetadata?: Record<string, unknown>;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Agent delete filter. When `agentIds` is omitted or empty, every agent row
|
|
49
|
+
* matches (use with care on `delete`).
|
|
50
|
+
*/
|
|
51
|
+
export interface LocalAgentAgentFilter {
|
|
52
|
+
readonly agentIds?: readonly string[];
|
|
53
|
+
readonly cwd?: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Agent list filter. When `cwd` is omitted, agents from every workspace in the
|
|
57
|
+
* store are listed.
|
|
58
|
+
*/
|
|
59
|
+
export interface LocalAgentListFilter {
|
|
60
|
+
/** Opaque cursor from a previous page's `nextCursor` (id-based, not an offset). */
|
|
61
|
+
readonly cursor?: string;
|
|
62
|
+
readonly limit?: number;
|
|
63
|
+
/** When set, only agents whose persisted `cwd` matches are listed. */
|
|
64
|
+
readonly cwd?: string;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Paged list result for {@link LocalAgentStore.agents},
|
|
68
|
+
* {@link LocalAgentStore.runs}, and {@link LocalAgentStore.checkpoints}.
|
|
69
|
+
* Resume with `filter.cursor` from the previous page's `nextCursor` (opaque,
|
|
70
|
+
* id-based — not a row offset).
|
|
71
|
+
*/
|
|
72
|
+
export interface LocalAgentStoreListResult<T> {
|
|
73
|
+
readonly items: readonly T[];
|
|
74
|
+
readonly nextCursor?: string;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Run list/delete filter. When both `agentIds` and `runIds` are omitted or empty,
|
|
78
|
+
* every run matches (list returns all runs; delete removes all runs — use with care).
|
|
79
|
+
*/
|
|
80
|
+
export interface LocalAgentRunFilter {
|
|
81
|
+
readonly agentIds?: readonly string[];
|
|
82
|
+
readonly runIds?: readonly string[];
|
|
83
|
+
/** Opaque cursor from a previous page's `nextCursor` (id-based, not an offset). */
|
|
84
|
+
readonly cursor?: string;
|
|
85
|
+
readonly limit?: number;
|
|
86
|
+
}
|
|
87
|
+
/** @deprecated Use {@link LocalAgentRunFilter}. */
|
|
88
|
+
export type RunFilter = LocalAgentRunFilter;
|
|
89
|
+
/**
|
|
90
|
+
* Checkpoint blob list/delete filter. When `agentIds` and `blobIds` are both
|
|
91
|
+
* omitted or empty, every blob matches (use with care on `delete`).
|
|
92
|
+
*/
|
|
93
|
+
export interface LocalAgentCheckpointFilter {
|
|
94
|
+
readonly agentIds?: readonly string[];
|
|
95
|
+
readonly blobIds?: readonly string[];
|
|
96
|
+
readonly cursor?: string;
|
|
97
|
+
readonly limit?: number;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Run event delete filter. When `runIds` is omitted or empty, every run event
|
|
101
|
+
* row matches (use with care on `delete`).
|
|
102
|
+
*/
|
|
103
|
+
export interface LocalAgentRunEventFilter {
|
|
104
|
+
readonly runIds?: readonly string[];
|
|
105
|
+
}
|
|
106
|
+
/** Opaque resume token for a run event stream (exclusive `afterOffset` on list). */
|
|
107
|
+
export type LocalAgentRunEventOffset = string;
|
|
108
|
+
export interface LocalAgentRunEventDocument {
|
|
109
|
+
readonly runId: string;
|
|
110
|
+
readonly seq: number;
|
|
111
|
+
readonly offset: LocalAgentRunEventOffset;
|
|
112
|
+
readonly eventType: string;
|
|
113
|
+
readonly payload: unknown;
|
|
114
|
+
readonly payloadRef: string | null;
|
|
115
|
+
readonly idempotencyKey: string | null;
|
|
116
|
+
readonly createdAt: number;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Paged tail of a single run's event stream. Unlike catalog lists, pagination uses
|
|
120
|
+
* {@link LocalAgentRunEventOffset} (`afterOffset` / `nextOffset`) because events are
|
|
121
|
+
* append-only and ordered by sequence, not by sortable row ids.
|
|
122
|
+
*/
|
|
123
|
+
export interface LocalAgentRunEventListResult {
|
|
124
|
+
readonly items: readonly LocalAgentRunEventDocument[];
|
|
125
|
+
readonly nextOffset?: LocalAgentRunEventOffset;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Per-agent checkpoint bytes (content-addressed). Same role as
|
|
129
|
+
* `stateRoot/agents/<hash>/store.db` in the default layout.
|
|
130
|
+
*/
|
|
131
|
+
export interface LocalAgentStoreCheckpoints {
|
|
132
|
+
get(input: {
|
|
133
|
+
readonly agentId: string;
|
|
134
|
+
readonly blobId: string;
|
|
135
|
+
}): Promise<Uint8Array | null>;
|
|
136
|
+
/**
|
|
137
|
+
* Persists bytes for a content-addressed blob. Returns `void` (no row document);
|
|
138
|
+
* callers already know `agentId` and `blobId`.
|
|
139
|
+
*/
|
|
140
|
+
create(input: {
|
|
141
|
+
readonly agentId: string;
|
|
142
|
+
readonly blobId: string;
|
|
143
|
+
readonly data: Uint8Array;
|
|
144
|
+
}): Promise<void>;
|
|
145
|
+
/** Overwrites blob bytes. Returns `void`; use {@link get} to read back. */
|
|
146
|
+
update(input: {
|
|
147
|
+
readonly agentId: string;
|
|
148
|
+
readonly blobId: string;
|
|
149
|
+
readonly data: Uint8Array;
|
|
150
|
+
}): Promise<void>;
|
|
151
|
+
delete(input: {
|
|
152
|
+
readonly filter: LocalAgentCheckpointFilter;
|
|
153
|
+
}): Promise<void>;
|
|
154
|
+
list(input?: {
|
|
155
|
+
readonly filter?: LocalAgentCheckpointFilter;
|
|
156
|
+
}): Promise<LocalAgentStoreListResult<string>>;
|
|
157
|
+
}
|
|
158
|
+
/** Agent rows for a custom {@link LocalAgentStore}. */
|
|
159
|
+
export interface LocalAgentStoreAgents {
|
|
160
|
+
get(input: {
|
|
161
|
+
readonly agentId: string;
|
|
162
|
+
}): Promise<LocalAgentDocument | null>;
|
|
163
|
+
create(input: {
|
|
164
|
+
readonly agent: LocalAgentDocument;
|
|
165
|
+
}): Promise<LocalAgentDocument>;
|
|
166
|
+
update(input: {
|
|
167
|
+
readonly agent: LocalAgentDocument;
|
|
168
|
+
}): Promise<LocalAgentDocument>;
|
|
169
|
+
delete(input: {
|
|
170
|
+
readonly filter: LocalAgentAgentFilter;
|
|
171
|
+
}): Promise<void>;
|
|
172
|
+
list(input?: {
|
|
173
|
+
readonly filter?: LocalAgentListFilter;
|
|
174
|
+
}): Promise<LocalAgentStoreListResult<LocalAgentDocument>>;
|
|
175
|
+
}
|
|
176
|
+
/** Run rows for a custom {@link LocalAgentStore}. */
|
|
177
|
+
export interface LocalAgentStoreRuns {
|
|
178
|
+
get(input: {
|
|
179
|
+
readonly agentId: string;
|
|
180
|
+
readonly runId: string;
|
|
181
|
+
}): Promise<LocalAgentRunDocument | null>;
|
|
182
|
+
create(input: {
|
|
183
|
+
readonly run: LocalAgentRunDocument;
|
|
184
|
+
}): Promise<LocalAgentRunDocument>;
|
|
185
|
+
update(input: {
|
|
186
|
+
readonly run: LocalAgentRunDocument;
|
|
187
|
+
}): Promise<LocalAgentRunDocument>;
|
|
188
|
+
/** Deletes runs matching {@link LocalAgentRunFilter}; an empty filter deletes all runs. */
|
|
189
|
+
delete(input: {
|
|
190
|
+
readonly filter: LocalAgentRunFilter;
|
|
191
|
+
}): Promise<void>;
|
|
192
|
+
list(input?: {
|
|
193
|
+
readonly filter?: LocalAgentRunFilter;
|
|
194
|
+
}): Promise<LocalAgentStoreListResult<LocalAgentRunDocument>>;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Durable run stream log (`run_events` in default SQLite). Append-only: use
|
|
198
|
+
* {@link append}, {@link list} with exclusive `afterOffset`, and {@link delete}
|
|
199
|
+
* for agent/run cleanup.
|
|
200
|
+
*/
|
|
201
|
+
export interface LocalAgentStoreRunEvents {
|
|
202
|
+
append(input: {
|
|
203
|
+
readonly runId: string;
|
|
204
|
+
readonly eventType: string;
|
|
205
|
+
readonly payload?: unknown;
|
|
206
|
+
readonly payloadRef?: string | null;
|
|
207
|
+
readonly idempotencyKey?: string | null;
|
|
208
|
+
}): Promise<LocalAgentRunEventDocument>;
|
|
209
|
+
/**
|
|
210
|
+
* Lists events for one `runId`. Pass `afterOffset` from a prior page's
|
|
211
|
+
* `nextOffset` (exclusive resume), not `filter.cursor`.
|
|
212
|
+
*/
|
|
213
|
+
list(input: {
|
|
214
|
+
readonly runId: string;
|
|
215
|
+
readonly afterOffset?: LocalAgentRunEventOffset | null;
|
|
216
|
+
readonly limit?: number;
|
|
217
|
+
}): Promise<LocalAgentRunEventListResult>;
|
|
218
|
+
delete(input: {
|
|
219
|
+
readonly filter: LocalAgentRunEventFilter;
|
|
220
|
+
}): Promise<void>;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Custom persistence for local SDK agents. Implement this interface (or
|
|
224
|
+
* {@link composeLocalAgentStore}) when you need to own where agent metadata,
|
|
225
|
+
* checkpoint blobs, runs, and run events are stored.
|
|
226
|
+
*
|
|
227
|
+
* When `local.store` / `localStore` is omitted, the SDK opens
|
|
228
|
+
* {@link SqliteLocalAgentStore} (on-disk SQLite under the workspace state root).
|
|
229
|
+
* Implement {@link LocalAgentStore} yourself only when replacing that layout.
|
|
230
|
+
*
|
|
231
|
+
* Table alignment (default SQLite names in parentheses):
|
|
232
|
+
* {@link agents} (`agents`), {@link checkpoints} (`checkpoints` / per-agent blob
|
|
233
|
+
* dirs), {@link runs} (`runs`), {@link runEvents} (`run_events`).
|
|
234
|
+
*
|
|
235
|
+
* Pagination: catalog substores use `filter.cursor` / `nextCursor`; run events
|
|
236
|
+
* use `afterOffset` / `nextOffset` on a single run stream (see
|
|
237
|
+
* {@link LocalAgentStoreRunEvents.list}).
|
|
238
|
+
*
|
|
239
|
+
* Built-in backends (exported from `@cursor/sdk`): default
|
|
240
|
+
* {@link SqliteLocalAgentStore}; portable {@link JsonlLocalAgentStore}.
|
|
241
|
+
*/
|
|
242
|
+
export interface LocalAgentStore {
|
|
243
|
+
readonly agents: LocalAgentStoreAgents;
|
|
244
|
+
readonly checkpoints: LocalAgentStoreCheckpoints;
|
|
245
|
+
readonly runs: LocalAgentStoreRuns;
|
|
246
|
+
readonly runEvents: LocalAgentStoreRunEvents;
|
|
247
|
+
}
|
|
248
|
+
interface LocalAgentStoreAdapters {
|
|
249
|
+
readonly store: AgentRunStore;
|
|
250
|
+
readonly checkpointStore: AgentCheckpointStore;
|
|
251
|
+
readonly eventStore: RunEventStore;
|
|
252
|
+
}
|
|
253
|
+
export declare function createLocalAgentStoreAdapters(options: {
|
|
254
|
+
localStore: LocalAgentStore;
|
|
255
|
+
workspaceRef: string;
|
|
256
|
+
/**
|
|
257
|
+
* When set (caller passed `cwd`), agent reads are limited to rows with that
|
|
258
|
+
* `cwd`. When omitted, reads see every agent in the store.
|
|
259
|
+
*/
|
|
260
|
+
scopedWorkspaceRef?: string;
|
|
261
|
+
}): LocalAgentStoreAdapters;
|
|
262
|
+
/**
|
|
263
|
+
* In-memory store with separate agent and run maps (relational layout).
|
|
264
|
+
*/
|
|
265
|
+
export declare function createInMemoryLocalAgentStore(): LocalAgentStore;
|
|
266
|
+
/** In-memory bundled layout (tests / SDK-internal; not exported from `@cursor/sdk`). */
|
|
267
|
+
export declare function createBundledLocalAgentStore(): LocalAgentStore;
|
|
268
|
+
/** Combine separately implemented substores into one {@link LocalAgentStore}. */
|
|
269
|
+
export declare function composeLocalAgentStore(parts: {
|
|
270
|
+
readonly agents: LocalAgentStoreAgents;
|
|
271
|
+
readonly checkpoints: LocalAgentStoreCheckpoints;
|
|
272
|
+
readonly runs: LocalAgentStoreRuns;
|
|
273
|
+
readonly runEvents: LocalAgentStoreRunEvents;
|
|
274
|
+
}): LocalAgentStore;
|
|
275
|
+
export declare function matchesAgentFilter(agent: LocalAgentDocument, filter?: LocalAgentAgentFilter): boolean;
|
|
276
|
+
export declare function matchesCheckpointFilter(key: {
|
|
277
|
+
agentId: string;
|
|
278
|
+
blobId: string;
|
|
279
|
+
}, filter?: LocalAgentCheckpointFilter): boolean;
|
|
280
|
+
/** Paginate checkpoint blob ids sorted lexicographically. */
|
|
281
|
+
export declare function paginateCheckpointBlobIds(blobIds: readonly string[], options?: Pick<LocalAgentCheckpointFilter, "cursor" | "limit">): LocalAgentStoreListResult<string>;
|
|
282
|
+
export declare function matchesRunFilter(run: LocalAgentRunDocument, filter?: LocalAgentRunFilter): boolean;
|
|
283
|
+
/** Paginate agents sorted by `updatedAt` desc, then `agentId` desc. */
|
|
284
|
+
export declare function paginateAgentDocuments(items: readonly LocalAgentDocument[], filter?: Pick<LocalAgentListFilter, "cursor" | "limit" | "cwd">): LocalAgentStoreListResult<LocalAgentDocument>;
|
|
285
|
+
/** Paginate runs sorted by `turnNumber` asc, then `runId` asc. */
|
|
286
|
+
export declare function paginateRunDocuments(items: readonly LocalAgentRunDocument[], options?: Pick<LocalAgentRunFilter, "cursor" | "limit">): LocalAgentStoreListResult<LocalAgentRunDocument>;
|
|
287
|
+
export {};
|
|
288
|
+
//# sourceMappingURL=local-agent-store.d.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K,CAAC,GAC9D,yBAAyB,CAAC,kBAAkB,CAAC,CAyB/C;AAED,kEAAkE;AAClE,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,SAAS,qBAAqB,EAAE,EACvC,OAAO,CAAC,EAAE,IAAI,CAAC,mBAAmB,EAAE,QAAQ,GAAG,OAAO,CAAC,GACtD,yBAAyB,CAAC,qBAAqB,CAAC,CAqBlD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { LocalAgentStore } from "./local-agent-store.js";
|
|
2
|
+
export interface SdkLocalDefaultsSource {
|
|
3
|
+
readonly local?: {
|
|
4
|
+
readonly store?: LocalAgentStore;
|
|
5
|
+
};
|
|
6
|
+
readonly store?: LocalAgentStore;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Module-level default `LocalAgentStore` for static `Agent.*` local routes.
|
|
10
|
+
* Per-call `store` / `local.store` overrides this value.
|
|
11
|
+
*/
|
|
12
|
+
export declare function resolveLocalAgentStore(options?: SdkLocalDefaultsSource): LocalAgentStore | undefined;
|
|
13
|
+
export declare function setDefaultLocalAgentStore(store: LocalAgentStore | undefined): void;
|
|
14
|
+
export declare function __clearDefaultLocalAgentStoreForTests(): void;
|
|
15
|
+
//# sourceMappingURL=sdk-local-defaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk-local-defaults.d.ts","sourceRoot":"","sources":["../../../src/agent/store/sdk-local-defaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAI9D,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,KAAK,CAAC,EAAE;QACf,QAAQ,CAAC,KAAK,CAAC,EAAE,eAAe,CAAC;KAClC,CAAC;IACF,QAAQ,CAAC,KAAK,CAAC,EAAE,eAAe,CAAC;CAClC;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,CAAC,EAAE,sBAAsB,GAC/B,eAAe,GAAG,SAAS,CAE7B;AAED,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,eAAe,GAAG,SAAS,GACjC,IAAI,CAEN;AAED,wBAAgB,qCAAqC,IAAI,IAAI,CAE5D"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default on-disk state root for local SDK agents for a workspace.
|
|
3
|
+
* Layout: `{root}/index.db`, `{root}/agents/agent-{sha256}/store.db`, etc.
|
|
4
|
+
*/
|
|
5
|
+
export declare function getDefaultSdkStateRoot(workspaceRef: string): string;
|
|
6
|
+
//# sourceMappingURL=sdk-state-root.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk-state-root.d.ts","sourceRoot":"","sources":["../../../src/agent/store/sdk-state-root.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAOnE"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { LocalAgentStore, LocalAgentStoreAgents, LocalAgentStoreCheckpoints, LocalAgentStoreRunEvents, LocalAgentStoreRuns } from "./local-agent-store.js";
|
|
2
|
+
export interface SqliteLocalAgentStoreOptions {
|
|
3
|
+
/** Workspace path used for default state root and agent `cwd` scoping. */
|
|
4
|
+
readonly workspaceRef: string;
|
|
5
|
+
/**
|
|
6
|
+
* Root directory for `index.db`, per-agent checkpoint dirs, etc.
|
|
7
|
+
* Defaults to {@link getDefaultSdkStateRoot} for `workspaceRef`.
|
|
8
|
+
*/
|
|
9
|
+
readonly stateRoot?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* On-disk {@link LocalAgentStore} backed by the SDK's default SQLite layout
|
|
13
|
+
* (`index.db`, per-agent checkpoint blob stores, `run_events` table).
|
|
14
|
+
*
|
|
15
|
+
* This is the persistence surface used when no custom `local.store` is passed.
|
|
16
|
+
* Open once per workspace/state root and reuse across `Agent.create` / `resume`.
|
|
17
|
+
*/
|
|
18
|
+
export declare class SqliteLocalAgentStore implements LocalAgentStore {
|
|
19
|
+
readonly stateRoot: string;
|
|
20
|
+
readonly workspaceRef: string;
|
|
21
|
+
readonly agents: LocalAgentStoreAgents;
|
|
22
|
+
readonly checkpoints: LocalAgentStoreCheckpoints;
|
|
23
|
+
readonly runs: LocalAgentStoreRuns;
|
|
24
|
+
readonly runEvents: LocalAgentStoreRunEvents;
|
|
25
|
+
private readonly deps;
|
|
26
|
+
static open(options: SqliteLocalAgentStoreOptions): Promise<SqliteLocalAgentStore>;
|
|
27
|
+
private constructor();
|
|
28
|
+
dispose(): Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=sqlite-local-agent-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqlite-local-agent-store.d.ts","sourceRoot":"","sources":["../../../src/agent/store/sqlite-local-agent-store.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAGV,eAAe,EACf,qBAAqB,EACrB,0BAA0B,EAC1B,wBAAwB,EACxB,mBAAmB,EACpB,MAAM,wBAAwB,CAAC;AAWhC,MAAM,WAAW,4BAA4B;IAC3C,0EAA0E;IAC1E,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAgTD;;;;;;GAMG;AACH,qBAAa,qBAAsB,YAAW,eAAe;IAC3D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAC;IACvC,QAAQ,CAAC,WAAW,EAAE,0BAA0B,CAAC;IACjD,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAE,wBAAwB,CAAC;IAE7C,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA4B;WAEpC,IAAI,CACf,OAAO,EAAE,4BAA4B,GACpC,OAAO,CAAC,qBAAqB,CAAC;IAoBjC,OAAO;IAoBD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAO/B"}
|