@cursor/sdk 1.0.15 → 1.0.17
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/core-adapter.d.ts +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 +1 -1
- 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 +4 -5
- package/dist/cjs/platform.d.ts.map +1 -1
- package/dist/cjs/public-api.d.ts +8 -3
- package/dist/cjs/public-api.d.ts.map +1 -1
- package/dist/cjs/run-event-notifier-api.d.ts +120 -0
- package/dist/cjs/run-event-notifier-api.d.ts.map +1 -0
- package/dist/cjs/run-event-tailer.d.ts +1 -1
- package/dist/cjs/run-store-public-types.d.ts +173 -0
- package/dist/cjs/run-store-public-types.d.ts.map +1 -0
- 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/subagent-conversion.d.ts +1 -1
- package/dist/cjs/subagent-conversion.d.ts.map +1 -1
- package/dist/cjs/types/conversation-types.d.ts +33 -33
- package/dist/cjs/types/delta-types.d.ts +1 -1
- package/dist/cjs/types/tool-call-types.d.ts +1 -1
- package/dist/cjs/utils/message-schemas.d.ts +1 -1
- package/dist/cjs/vendor/cursor-sdk-shared/core-adapter.d.ts +3 -0
- package/dist/cjs/vendor/cursor-sdk-shared/delta-types.d.ts +19186 -0
- package/dist/cjs/vendor/cursor-sdk-shared/index.d.ts +4 -0
- package/dist/cjs/vendor/cursor-sdk-shared/message-schemas.d.ts +105 -0
- package/dist/cjs/vendor/cursor-sdk-shared/tool-call-types.d.ts +7894 -0
- package/dist/esm/agent.d.ts +8 -0
- package/dist/esm/agent.d.ts.map +1 -1
- package/dist/esm/core-adapter.d.ts +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 +3 -3
- package/dist/esm/local-executor.d.ts +1 -1
- 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 +4 -5
- package/dist/esm/platform.d.ts.map +1 -1
- package/dist/esm/public-api.d.ts +8 -3
- package/dist/esm/public-api.d.ts.map +1 -1
- package/dist/esm/run-event-notifier-api.d.ts +120 -0
- package/dist/esm/run-event-notifier-api.d.ts.map +1 -0
- package/dist/esm/run-event-tailer.d.ts +1 -1
- package/dist/esm/run-store-public-types.d.ts +173 -0
- package/dist/esm/run-store-public-types.d.ts.map +1 -0
- 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/subagent-conversion.d.ts +1 -1
- package/dist/esm/subagent-conversion.d.ts.map +1 -1
- package/dist/esm/types/conversation-types.d.ts +33 -33
- package/dist/esm/types/delta-types.d.ts +1 -1
- package/dist/esm/types/tool-call-types.d.ts +1 -1
- package/dist/esm/utils/message-schemas.d.ts +1 -1
- package/dist/esm/vendor/cursor-sdk-shared/core-adapter.d.ts +3 -0
- package/dist/esm/vendor/cursor-sdk-shared/delta-types.d.ts +19186 -0
- package/dist/esm/vendor/cursor-sdk-shared/index.d.ts +4 -0
- package/dist/esm/vendor/cursor-sdk-shared/message-schemas.d.ts +105 -0
- package/dist/esm/vendor/cursor-sdk-shared/tool-call-types.d.ts +7894 -0
- package/package.json +8 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type RuntimeCustomSubagentDefinition } from "
|
|
1
|
+
import { type RuntimeCustomSubagentDefinition } from "./run-store-public-types.js";
|
|
2
2
|
import type { RunExecutor } from "./executor-types.js";
|
|
3
3
|
import type { McpServerConfig, SandboxOptions, SettingSource } from "./options.js";
|
|
4
4
|
export interface LocalExecutorHandle {
|
|
@@ -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 "./run-store-public-types.js";
|
|
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,EAAE,
|
|
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,6BAA6B,CAAC;AACrC,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,E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C;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gDAAgD;IAChD,IAAI,CAAC,EAAE,eAAe,CAAC;CACxB"}
|
package/dist/cjs/platform.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
import type { AgentCheckpointStore, AgentRunStore, CursorAgentPlatformOptions, RunEventNotifier, RunEventStore } from "@anysphere/cursor-sdk-local-runtime/run-store";
|
|
1
|
+
type PlatformRunExecutor = (...args: never) => Promise<unknown>;
|
|
3
2
|
import type { AgentMessage, AgentOperationOptions, CursorRequestOptions, GetAgentMessagesOptions, GetAgentOptions, GetRunOptions, ListAgentsOptions, ListRunsOptions, ListResult as PublicListResult, SDKAgent, SDKAgentInfo, SDKModel, SDKRepository, SDKUser } from "./agent.js";
|
|
4
|
-
import type { RunExecutor } from "./executor-types.js";
|
|
5
3
|
import { type SDKMessage } from "./messages.js";
|
|
6
|
-
import type { AgentOptions, McpServerConfig, ModelSelection, SandboxOptions, SettingSource } from "./options.js";
|
|
4
|
+
import type { AgentOptions, CursorAgentPlatformOptions, McpServerConfig, ModelSelection, SandboxOptions, SettingSource } from "./options.js";
|
|
7
5
|
import { type Run } from "./run.js";
|
|
6
|
+
import type { AgentCheckpointStore, AgentRunStore, RunEventNotifier, RunEventStore, RuntimeCustomSubagentDefinition } from "./run-store-public-types.js";
|
|
8
7
|
interface AgentExecutorHandle {
|
|
9
|
-
run:
|
|
8
|
+
run: PlatformRunExecutor;
|
|
10
9
|
reload?(): Promise<void>;
|
|
11
10
|
dispose?(): Promise<void>;
|
|
12
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/agent/platform.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceR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Store, AgentLifecycleStatus, AgentRecord, AgentRunStore, AppendRunEventInput, AttachRunEventsInput, CheckpointRef, CreateAgentInput, CreateFollowUpRunInput, CursorAgentPlatformOptions, 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
|
-
export { createInMemoryRunEventNotifier, createLocalRunEventNotifier, InMemoryRunEventNotifier, LocalRunEventNotifier, LocalRunEventNotifierServer, startLocalRunEventNotifierServer, } from "@anysphere/cursor-sdk-local-runtime/run-store";
|
|
3
1
|
export type { AgentMessage, AgentOperationOptions, CursorRequestOptions, GetAgentMessagesOptions, GetAgentOptions, GetRunOptions, ListAgentsOptions, ListResult, ListRunsOptions, SDKAgent, SDKAgentInfo, SDKModel, SDKRepository, SDKUser, SendOptions, } from "./agent.js";
|
|
4
2
|
export type { SDKArtifact } from "./artifacts.js";
|
|
5
3
|
export type { LocalRunStreamDoneEvent, LocalRunStreamEvent, LocalRunStreamResultEvent, LocalRunStreamSdkMessageEvent, SDKAssistantMessage, SDKMessage, SDKStatusMessage, SDKSystemMessage, SDKTaskMessage, SDKThinkingMessage, SDKToolUseMessage, SDKUserMessageEvent, TextBlock, ToolUseBlock, } from "./messages.js";
|
|
6
4
|
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";
|
|
5
|
+
export type { AgentDefinition, AgentModeOption, AgentOptions, CloudAgentOptions, CursorAgentPlatformOptions, LocalAgentOptions, McpServerConfig, ModelListItem, ModelParameterDefinition, ModelParameterValue, ModelSelection, ModelVariant, SDKImage, SDKImageDimension, SDKUserMessage, SettingSource, } from "./options.js";
|
|
8
6
|
export { CursorAgentPlatform, createAgentPlatform } from "./platform.js";
|
|
9
7
|
export type { Run, RunOperation, RunResult, RunResultStatus, RunStatus, } from "./run.js";
|
|
10
8
|
export { UnsupportedRunOperationError } from "./run.js";
|
|
9
|
+
export type { LocalRunEventNotifierOptions, LocalRunEventNotifierServerOptions, RunEventHint, RunEventNotifier, RunEventOffset, RunEventSubscription, WatchRunEventsInput, } from "./run-event-notifier-api.js";
|
|
10
|
+
export { createInMemoryRunEventNotifier, createLocalRunEventNotifier, InMemoryRunEventNotifier, LocalRunEventNotifier, LocalRunEventNotifierServer, startLocalRunEventNotifierServer, } from "./run-event-notifier-api.js";
|
|
11
|
+
export type { AgentCheckpointStore, AgentLifecycleStatus, AgentRecord, AgentRunStore, AppendRunEventInput, AttachRunEventsInput, CheckpointRef, CreateAgentInput, CreateFollowUpRunInput, ListRunEventsInput, ListRunEventsResult, RunEventRecord, RunEventStore, RunEventStreamStore, RunLifecycleStatus, RunRecord, RunTerminalPatch, WatchableRunEventStore, } from "./run-store-public-types.js";
|
|
12
|
+
export type { CursorConfigureOptions } from "./sdk-config.js";
|
|
13
|
+
export { configureCursorSdk } from "./sdk-config.js";
|
|
14
|
+
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";
|
|
15
|
+
export { composeLocalAgentStore, getDefaultSdkStateRoot, JSONL_LOCAL_AGENT_STORE_FILES, JsonlLocalAgentStore, paginateAgentDocuments, paginateCheckpointBlobIds, paginateRunDocuments, SqliteLocalAgentStore, } from "./store/index.js";
|
|
11
16
|
export { Agent, Cursor } from "./stubs.js";
|
|
12
17
|
//# 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,
|
|
1
|
+
{"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../../src/agent/public-api.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,YAAY,EACZ,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,eAAe,EACf,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,OAAO,EACP,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,YAAY,EACV,uBAAuB,EACvB,mBAAmB,EACnB,yBAAyB,EACzB,6BAA6B,EAC7B,mBAAmB,EACnB,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,SAAS,EACT,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,8BAA8B,EAC9B,yBAAyB,EACzB,8BAA8B,EAC9B,6BAA6B,EAC7B,2BAA2B,EAC3B,+BAA+B,EAC/B,+BAA+B,GAChC,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,eAAe,EACf,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,0BAA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,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,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public types and implementations for run event notifiers.
|
|
3
|
+
*
|
|
4
|
+
* These types are inlined to avoid leaking internal runtime package types
|
|
5
|
+
* in the published SDK declaration files.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Opaque resume token for a run event stream.
|
|
9
|
+
*
|
|
10
|
+
* Stores own the format of this token. The default local SQLite and in-memory
|
|
11
|
+
* stores use numeric sequence strings, but SDK callers and custom backends
|
|
12
|
+
* must only persist and pass the token back as an exclusive `afterOffset`.
|
|
13
|
+
*/
|
|
14
|
+
export type RunEventOffset = string;
|
|
15
|
+
/**
|
|
16
|
+
* Hint that a run's event log may have new events.
|
|
17
|
+
*/
|
|
18
|
+
export interface RunEventHint {
|
|
19
|
+
/**
|
|
20
|
+
* Run whose durable event log may have advanced.
|
|
21
|
+
*/
|
|
22
|
+
runId: string;
|
|
23
|
+
/**
|
|
24
|
+
* Latest appended offset known to the publisher. Hints are wakeups only:
|
|
25
|
+
* subscribers must always re-read the durable RunEventStore and must not
|
|
26
|
+
* assume every offset hint arrives exactly once.
|
|
27
|
+
*/
|
|
28
|
+
offset: RunEventOffset;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Input for subscribing to run event hints.
|
|
32
|
+
*/
|
|
33
|
+
export interface WatchRunEventsInput {
|
|
34
|
+
runId: string;
|
|
35
|
+
signal?: AbortSignal;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Subscription to run event hints.
|
|
39
|
+
*/
|
|
40
|
+
export interface RunEventSubscription extends AsyncIterable<RunEventHint> {
|
|
41
|
+
readonly ready?: Promise<void>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Notifier for publishing and subscribing to run event hints.
|
|
45
|
+
*/
|
|
46
|
+
export interface RunEventNotifier {
|
|
47
|
+
/**
|
|
48
|
+
* Publishes a best-effort wakeup after a durable run event append. Notifiers
|
|
49
|
+
* may drop, duplicate, coalesce, or delay hints; correctness must come from
|
|
50
|
+
* replaying the RunEventStore.
|
|
51
|
+
*/
|
|
52
|
+
publishRunEventAppended(input: RunEventHint): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Subscribes to best-effort wakeups for one run. Consumers must tolerate
|
|
55
|
+
* missed hints and use each hint only as a prompt to list durable events.
|
|
56
|
+
* When `ready` is present on the returned subscription, it resolves after
|
|
57
|
+
* the subscription is armed server-side.
|
|
58
|
+
*/
|
|
59
|
+
subscribeRunEvents(input: WatchRunEventsInput): RunEventSubscription;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Options for creating a local run event notifier client.
|
|
63
|
+
*/
|
|
64
|
+
export interface LocalRunEventNotifierOptions {
|
|
65
|
+
socketPath: string;
|
|
66
|
+
connectTimeoutMs?: number;
|
|
67
|
+
requestTimeoutMs?: number;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Options for starting a local run event notifier server.
|
|
71
|
+
*/
|
|
72
|
+
export interface LocalRunEventNotifierServerOptions {
|
|
73
|
+
socketPath: string;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Local run event notifier client that connects to a notifier server via Unix socket.
|
|
77
|
+
*
|
|
78
|
+
* This wrapper class ensures the public API doesn't leak internal implementation types.
|
|
79
|
+
*/
|
|
80
|
+
export declare class LocalRunEventNotifier implements RunEventNotifier {
|
|
81
|
+
private readonly impl;
|
|
82
|
+
constructor(options: LocalRunEventNotifierOptions);
|
|
83
|
+
publishRunEventAppended(input: RunEventHint): Promise<void>;
|
|
84
|
+
subscribeRunEvents(input: WatchRunEventsInput): RunEventSubscription;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Local run event notifier server that listens on a Unix socket.
|
|
88
|
+
*
|
|
89
|
+
* This wrapper class ensures the public API doesn't leak internal implementation types.
|
|
90
|
+
*/
|
|
91
|
+
export declare class LocalRunEventNotifierServer {
|
|
92
|
+
private readonly impl;
|
|
93
|
+
private constructor();
|
|
94
|
+
static listen(options: LocalRunEventNotifierServerOptions): Promise<LocalRunEventNotifierServer>;
|
|
95
|
+
close(): Promise<void>;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* In-memory run event notifier for testing and development.
|
|
99
|
+
*
|
|
100
|
+
* This wrapper class ensures the public API doesn't leak internal implementation types.
|
|
101
|
+
*/
|
|
102
|
+
export declare class InMemoryRunEventNotifier implements RunEventNotifier {
|
|
103
|
+
private readonly impl;
|
|
104
|
+
constructor();
|
|
105
|
+
publishRunEventAppended(input: RunEventHint): Promise<void>;
|
|
106
|
+
subscribeRunEvents(input: WatchRunEventsInput): RunEventSubscription;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Creates a local run event notifier client.
|
|
110
|
+
*/
|
|
111
|
+
export declare function createLocalRunEventNotifier(options: LocalRunEventNotifierOptions): RunEventNotifier;
|
|
112
|
+
/**
|
|
113
|
+
* Starts a local run event notifier server.
|
|
114
|
+
*/
|
|
115
|
+
export declare function startLocalRunEventNotifierServer(options: LocalRunEventNotifierServerOptions): Promise<LocalRunEventNotifierServer>;
|
|
116
|
+
/**
|
|
117
|
+
* Creates an in-memory run event notifier for testing and development.
|
|
118
|
+
*/
|
|
119
|
+
export declare function createInMemoryRunEventNotifier(): RunEventNotifier;
|
|
120
|
+
//# sourceMappingURL=run-event-notifier-api.d.ts.map
|
|
@@ -0,0 +1 @@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AG,oBAAoB;CAGrE;AAED;;;;GAIG;AACH,qBAAa,2BAA2B;IACtC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAkC;IAEvD,OAAO;WAIM,MAAM,CACjB,OAAO,EAAE,kCAAkC,GAC1C,OAAO,CAAC,2BAA2B,CAAC;IAKjC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAG7B;AAED;;;;GAIG;AACH,qBAAa,wBAAyB,YAAW,gBAAgB;IAC/D,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA+B;;IAM9C,uBAAuB,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjE,kBAAkB,CAAC,KAAK,EAAE,mBAAmB,GAAG,oBAAoB;CAGrE;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,4BAA4B,GACpC,gBAAgB,CAElB;AAED;;GAEG;AACH,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,kCAAkC,GAC1C,OAAO,CAAC,2BAA2B,CAAC,CAEtC;AAED;;GAEG;AACH,wBAAgB,8BAA8B,IAAI,gBAAgB,CAEjE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RunEventNotifier, RunEventOffset, RunEventStore, RunEventStreamStore, RunLifecycleStatus } from "
|
|
1
|
+
import type { RunEventNotifier, RunEventOffset, RunEventStore, RunEventStreamStore, RunLifecycleStatus } from "./run-store-public-types.js";
|
|
2
2
|
import { type SDKMessage } from "./messages.js";
|
|
3
3
|
export interface RunEventTailerStreamOptions {
|
|
4
4
|
afterOffset?: RunEventOffset;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import type { RunEventNotifier } from "./run-event-notifier-api.js";
|
|
2
|
+
export type { RunEventNotifier } from "./run-event-notifier-api.js";
|
|
3
|
+
/** Custom subagent definition passed to the local agent runtime. */
|
|
4
|
+
export interface RuntimeCustomSubagentDefinition {
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly description: string;
|
|
7
|
+
readonly prompt: string;
|
|
8
|
+
readonly model: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Public run-store shapes for published SDK declarations.
|
|
12
|
+
*
|
|
13
|
+
* Mirrors ./run-store-public-types.js types without
|
|
14
|
+
* referencing unpublished workspace packages in .d.ts output.
|
|
15
|
+
*/
|
|
16
|
+
export type RunLifecycleStatus = "QUEUED" | "CREATING" | "RUNNING" | "FINISHED" | "ERROR" | "CANCELLED" | "EXPIRED";
|
|
17
|
+
export type AgentLifecycleStatus = "IDLE" | "RUNNING" | "ARCHIVED" | "ERROR";
|
|
18
|
+
export interface CheckpointRef {
|
|
19
|
+
blobId: string;
|
|
20
|
+
storeKind: string;
|
|
21
|
+
}
|
|
22
|
+
export interface StoredModelParameterValue {
|
|
23
|
+
id: string;
|
|
24
|
+
value: string;
|
|
25
|
+
}
|
|
26
|
+
export interface StoredModelSelection {
|
|
27
|
+
id: string;
|
|
28
|
+
params?: StoredModelParameterValue[];
|
|
29
|
+
}
|
|
30
|
+
export interface AgentRecord {
|
|
31
|
+
agentId: string;
|
|
32
|
+
workspaceRef: string;
|
|
33
|
+
status: AgentLifecycleStatus;
|
|
34
|
+
activeRunId: string | null;
|
|
35
|
+
latestCheckpointRef: CheckpointRef | null;
|
|
36
|
+
name: string | null;
|
|
37
|
+
createdAt: Date;
|
|
38
|
+
updatedAt: Date;
|
|
39
|
+
metadata: Record<string, unknown>;
|
|
40
|
+
}
|
|
41
|
+
export interface RunRecord {
|
|
42
|
+
runId: string;
|
|
43
|
+
agentId: string;
|
|
44
|
+
turnNumber: number;
|
|
45
|
+
status: RunLifecycleStatus;
|
|
46
|
+
model: StoredModelSelection | null;
|
|
47
|
+
startCheckpointRef: CheckpointRef | null;
|
|
48
|
+
latestCheckpointRef: CheckpointRef | null;
|
|
49
|
+
errorCode: string | null;
|
|
50
|
+
result: string | null;
|
|
51
|
+
usageRef: string | null;
|
|
52
|
+
createdAt: Date;
|
|
53
|
+
updatedAt: Date;
|
|
54
|
+
startedAt: Date | null;
|
|
55
|
+
finishedAt: Date | null;
|
|
56
|
+
cancelledAt: Date | null;
|
|
57
|
+
expiredAt: Date | null;
|
|
58
|
+
}
|
|
59
|
+
export interface CreateAgentInput {
|
|
60
|
+
agentId?: string;
|
|
61
|
+
workspaceRef: string;
|
|
62
|
+
name?: string | null;
|
|
63
|
+
model?: StoredModelSelection | null;
|
|
64
|
+
metadata?: Record<string, unknown>;
|
|
65
|
+
}
|
|
66
|
+
export interface CreateFollowUpRunInput {
|
|
67
|
+
model?: StoredModelSelection | null;
|
|
68
|
+
metadata?: Record<string, unknown>;
|
|
69
|
+
}
|
|
70
|
+
export interface ListOptions {
|
|
71
|
+
cursor?: string;
|
|
72
|
+
limit?: number;
|
|
73
|
+
}
|
|
74
|
+
export interface ListResult<T> {
|
|
75
|
+
items: T[];
|
|
76
|
+
nextCursor?: string;
|
|
77
|
+
}
|
|
78
|
+
export interface RunTerminalPatch {
|
|
79
|
+
status: Extract<RunLifecycleStatus, "FINISHED" | "ERROR" | "CANCELLED" | "EXPIRED">;
|
|
80
|
+
errorCode?: string | null;
|
|
81
|
+
result?: string | null;
|
|
82
|
+
usageRef?: string | null;
|
|
83
|
+
}
|
|
84
|
+
export interface AppendRunEventInput {
|
|
85
|
+
runId: string;
|
|
86
|
+
eventType: string;
|
|
87
|
+
payload?: unknown;
|
|
88
|
+
payloadRef?: string | null;
|
|
89
|
+
idempotencyKey?: string | null;
|
|
90
|
+
}
|
|
91
|
+
export interface RunEventRecord {
|
|
92
|
+
runId: string;
|
|
93
|
+
seq: number;
|
|
94
|
+
offset: string;
|
|
95
|
+
eventType: string;
|
|
96
|
+
payload: unknown;
|
|
97
|
+
payloadRef: string | null;
|
|
98
|
+
idempotencyKey: string | null;
|
|
99
|
+
createdAt: Date;
|
|
100
|
+
}
|
|
101
|
+
export interface ListRunEventsInput {
|
|
102
|
+
runId: string;
|
|
103
|
+
afterOffset?: string | null;
|
|
104
|
+
limit?: number;
|
|
105
|
+
}
|
|
106
|
+
export interface ListRunEventsResult {
|
|
107
|
+
events: RunEventRecord[];
|
|
108
|
+
nextOffset?: string;
|
|
109
|
+
}
|
|
110
|
+
export interface RunEventStore {
|
|
111
|
+
appendRunEvent(input: AppendRunEventInput): Promise<RunEventRecord>;
|
|
112
|
+
listRunEvents(input: ListRunEventsInput): Promise<ListRunEventsResult>;
|
|
113
|
+
deleteRunEvents?(input: {
|
|
114
|
+
runId: string;
|
|
115
|
+
}): Promise<void>;
|
|
116
|
+
}
|
|
117
|
+
export interface AttachRunEventsInput {
|
|
118
|
+
runId: string;
|
|
119
|
+
afterOffset?: string | null;
|
|
120
|
+
signal?: AbortSignal;
|
|
121
|
+
}
|
|
122
|
+
export interface RunEventStreamStore extends RunEventStore {
|
|
123
|
+
attachRunEvents(input: AttachRunEventsInput): AsyncIterable<RunEventRecord>;
|
|
124
|
+
}
|
|
125
|
+
export interface WatchableRunEventStore extends RunEventStore {
|
|
126
|
+
watchRunEvents(input: {
|
|
127
|
+
runId: string;
|
|
128
|
+
signal?: AbortSignal;
|
|
129
|
+
}): AsyncIterable<{
|
|
130
|
+
runId: string;
|
|
131
|
+
offset: string;
|
|
132
|
+
}>;
|
|
133
|
+
}
|
|
134
|
+
export interface AgentRunStore {
|
|
135
|
+
createAgent(input: CreateAgentInput): Promise<{
|
|
136
|
+
agent: AgentRecord;
|
|
137
|
+
run: RunRecord;
|
|
138
|
+
}>;
|
|
139
|
+
createFollowUpRun(agentId: string, input: CreateFollowUpRunInput): Promise<RunRecord>;
|
|
140
|
+
listAgents(opts?: ListOptions): Promise<ListResult<AgentRecord>>;
|
|
141
|
+
getAgent(agentId: string): Promise<AgentRecord | null>;
|
|
142
|
+
listRuns(agentId: string, opts?: ListOptions): Promise<ListResult<RunRecord>>;
|
|
143
|
+
getRun(agentId: string, runId: string): Promise<RunRecord | null>;
|
|
144
|
+
markRunStarting(agentId: string, runId: string): Promise<void>;
|
|
145
|
+
patchCheckpoint(agentId: string, runId: string, checkpointRef: CheckpointRef): Promise<void>;
|
|
146
|
+
markRunTerminal(agentId: string, runId: string, terminal: RunTerminalPatch): Promise<void>;
|
|
147
|
+
cancelRun(agentId: string, runId: string): Promise<void>;
|
|
148
|
+
archiveAgent(agentId: string): Promise<void>;
|
|
149
|
+
unarchiveAgent(agentId: string): Promise<void>;
|
|
150
|
+
deleteAgent(agentId: string): Promise<void>;
|
|
151
|
+
}
|
|
152
|
+
/** Opaque checkpoint payload in the published SDK surface. */
|
|
153
|
+
export type SdkConversationStateStructure = unknown;
|
|
154
|
+
/** Opaque conversation payload in the published SDK surface. */
|
|
155
|
+
export type SdkConversationState = unknown;
|
|
156
|
+
/** Opaque blob store handle in the published SDK surface. */
|
|
157
|
+
export type SdkBlobStore = unknown;
|
|
158
|
+
export interface AgentCheckpointStore {
|
|
159
|
+
loadLatest(agentId: string): Promise<SdkConversationStateStructure | null>;
|
|
160
|
+
saveCheckpoint(agentId: string, checkpoint: SdkConversationStateStructure): Promise<CheckpointRef>;
|
|
161
|
+
getBlobStore(agentId: string): Promise<SdkBlobStore>;
|
|
162
|
+
getFullConversation(agentId: string): Promise<SdkConversationState>;
|
|
163
|
+
deleteAgent?(agentId: string): Promise<void>;
|
|
164
|
+
}
|
|
165
|
+
export interface CursorAgentPlatformOptions {
|
|
166
|
+
store?: AgentRunStore;
|
|
167
|
+
checkpointStore?: AgentCheckpointStore;
|
|
168
|
+
eventStore?: RunEventStore;
|
|
169
|
+
eventNotifier?: RunEventNotifier;
|
|
170
|
+
stateRoot?: string;
|
|
171
|
+
workspaceRef?: string;
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=run-store-public-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-store-public-types.d.ts","sourceRoot":"","sources":["../../src/agent/run-store-public-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,YAAY,EAAE,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G,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9C;AAED,MAAM,WAAW,0BAA0B;IACzC,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,eAAe,CAAC,EAAE,oBAAoB,CAAC;IACvC,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB"}
|
|
@@ -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 "../run-store-public-types.js";
|
|
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"}
|