lark-agent-bridge 0.1.39
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/LICENSE +21 -0
- package/README.md +265 -0
- package/README.zh.md +265 -0
- package/bin/lark-agent-bridge.mjs +2 -0
- package/dist/agent/cursor/cursor-sdk-worker.js +702 -0
- package/dist/cli.js +7588 -0
- package/dist/index.d.ts +113 -0
- package/dist/index.js +721 -0
- package/package.json +72 -0
- package/vendor/cursor-sdk/LICENSE.md +3 -0
- package/vendor/cursor-sdk/README.md +23 -0
- package/vendor/cursor-sdk/dist/cjs/642.index.js +1 -0
- package/vendor/cursor-sdk/dist/cjs/agent.d.ts +170 -0
- package/vendor/cursor-sdk/dist/cjs/agent.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/cjs/analytics.d.ts +98 -0
- package/vendor/cursor-sdk/dist/cjs/analytics.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/cjs/artifacts.d.ts +6 -0
- package/vendor/cursor-sdk/dist/cjs/artifacts.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/cjs/cloud-agent.d.ts +47 -0
- package/vendor/cursor-sdk/dist/cjs/cloud-agent.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/cjs/cloud-api-client.d.ts +197 -0
- package/vendor/cursor-sdk/dist/cjs/cloud-api-client.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/cjs/cloud-executor.d.ts +14 -0
- package/vendor/cursor-sdk/dist/cjs/cloud-executor.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/cjs/cloud-mcp-utils.d.ts +4 -0
- package/vendor/cursor-sdk/dist/cjs/cloud-mcp-utils.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/cjs/core-adapter.d.ts +2 -0
- package/vendor/cursor-sdk/dist/cjs/core-adapter.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/cjs/errors.d.ts +135 -0
- package/vendor/cursor-sdk/dist/cjs/errors.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/cjs/executor-common.d.ts +16 -0
- package/vendor/cursor-sdk/dist/cjs/executor-common.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/cjs/executor-types.d.ts +65 -0
- package/vendor/cursor-sdk/dist/cjs/executor-types.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/cjs/index.d.ts +18 -0
- package/vendor/cursor-sdk/dist/cjs/index.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/cjs/index.js +8 -0
- package/vendor/cursor-sdk/dist/cjs/index.js.LICENSE.txt +285 -0
- package/vendor/cursor-sdk/dist/cjs/local-executor.d.ts +18 -0
- package/vendor/cursor-sdk/dist/cjs/local-executor.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/cjs/local-model-validation.d.ts +6 -0
- package/vendor/cursor-sdk/dist/cjs/local-model-validation.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/cjs/messages.d.ts +110 -0
- package/vendor/cursor-sdk/dist/cjs/messages.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/cjs/options.d.ts +145 -0
- package/vendor/cursor-sdk/dist/cjs/options.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/cjs/package.json +3 -0
- package/vendor/cursor-sdk/dist/cjs/platform.d.ts +71 -0
- package/vendor/cursor-sdk/dist/cjs/platform.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/cjs/prefetched-blobs.d.ts +13 -0
- package/vendor/cursor-sdk/dist/cjs/prefetched-blobs.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/cjs/public-api.d.ts +12 -0
- package/vendor/cursor-sdk/dist/cjs/public-api.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/cjs/run-event-tailer.d.ts +33 -0
- package/vendor/cursor-sdk/dist/cjs/run-event-tailer.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/cjs/run-interaction-accumulator.d.ts +33 -0
- package/vendor/cursor-sdk/dist/cjs/run-interaction-accumulator.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/cjs/run.d.ts +44 -0
- package/vendor/cursor-sdk/dist/cjs/run.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/cjs/sdk-statsig.d.ts +10 -0
- package/vendor/cursor-sdk/dist/cjs/sdk-statsig.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/cjs/stubs.d.ts +98 -0
- package/vendor/cursor-sdk/dist/cjs/stubs.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/cjs/subagent-conversion.d.ts +22 -0
- package/vendor/cursor-sdk/dist/cjs/subagent-conversion.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/cjs/tool-call-utils.d.ts +7 -0
- package/vendor/cursor-sdk/dist/cjs/tool-call-utils.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/cjs/types/conversation-types.d.ts +12062 -0
- package/vendor/cursor-sdk/dist/cjs/types/conversation-types.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/cjs/types/delta-types.d.ts +2 -0
- package/vendor/cursor-sdk/dist/cjs/types/delta-types.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/cjs/types/tool-call-types.d.ts +2 -0
- package/vendor/cursor-sdk/dist/cjs/types/tool-call-types.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/cjs/utils/conversation-utils.d.ts +3 -0
- package/vendor/cursor-sdk/dist/cjs/utils/conversation-utils.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/cjs/utils/logger.d.ts +12 -0
- package/vendor/cursor-sdk/dist/cjs/utils/logger.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/cjs/utils/message-schemas.d.ts +2 -0
- package/vendor/cursor-sdk/dist/cjs/utils/message-schemas.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/esm/642.index.js +1 -0
- package/vendor/cursor-sdk/dist/esm/agent.d.ts +170 -0
- package/vendor/cursor-sdk/dist/esm/agent.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/esm/analytics.d.ts +98 -0
- package/vendor/cursor-sdk/dist/esm/analytics.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/esm/artifacts.d.ts +6 -0
- package/vendor/cursor-sdk/dist/esm/artifacts.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/esm/cloud-agent.d.ts +47 -0
- package/vendor/cursor-sdk/dist/esm/cloud-agent.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/esm/cloud-api-client.d.ts +197 -0
- package/vendor/cursor-sdk/dist/esm/cloud-api-client.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/esm/cloud-executor.d.ts +14 -0
- package/vendor/cursor-sdk/dist/esm/cloud-executor.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/esm/cloud-mcp-utils.d.ts +4 -0
- package/vendor/cursor-sdk/dist/esm/cloud-mcp-utils.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/esm/core-adapter.d.ts +2 -0
- package/vendor/cursor-sdk/dist/esm/core-adapter.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/esm/errors.d.ts +135 -0
- package/vendor/cursor-sdk/dist/esm/errors.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/esm/executor-common.d.ts +16 -0
- package/vendor/cursor-sdk/dist/esm/executor-common.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/esm/executor-types.d.ts +65 -0
- package/vendor/cursor-sdk/dist/esm/executor-types.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/esm/index.d.ts +18 -0
- package/vendor/cursor-sdk/dist/esm/index.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/esm/index.js +8 -0
- package/vendor/cursor-sdk/dist/esm/index.js.LICENSE.txt +285 -0
- package/vendor/cursor-sdk/dist/esm/local-executor.d.ts +18 -0
- package/vendor/cursor-sdk/dist/esm/local-executor.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/esm/local-model-validation.d.ts +6 -0
- package/vendor/cursor-sdk/dist/esm/local-model-validation.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/esm/messages.d.ts +110 -0
- package/vendor/cursor-sdk/dist/esm/messages.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/esm/options.d.ts +145 -0
- package/vendor/cursor-sdk/dist/esm/options.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/esm/platform.d.ts +71 -0
- package/vendor/cursor-sdk/dist/esm/platform.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/esm/prefetched-blobs.d.ts +13 -0
- package/vendor/cursor-sdk/dist/esm/prefetched-blobs.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/esm/public-api.d.ts +12 -0
- package/vendor/cursor-sdk/dist/esm/public-api.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/esm/run-event-tailer.d.ts +33 -0
- package/vendor/cursor-sdk/dist/esm/run-event-tailer.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/esm/run-interaction-accumulator.d.ts +33 -0
- package/vendor/cursor-sdk/dist/esm/run-interaction-accumulator.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/esm/run.d.ts +44 -0
- package/vendor/cursor-sdk/dist/esm/run.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/esm/sdk-statsig.d.ts +10 -0
- package/vendor/cursor-sdk/dist/esm/sdk-statsig.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/esm/stubs.d.ts +98 -0
- package/vendor/cursor-sdk/dist/esm/stubs.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/esm/subagent-conversion.d.ts +22 -0
- package/vendor/cursor-sdk/dist/esm/subagent-conversion.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/esm/tool-call-utils.d.ts +7 -0
- package/vendor/cursor-sdk/dist/esm/tool-call-utils.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/esm/types/conversation-types.d.ts +12062 -0
- package/vendor/cursor-sdk/dist/esm/types/conversation-types.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/esm/types/delta-types.d.ts +2 -0
- package/vendor/cursor-sdk/dist/esm/types/delta-types.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/esm/types/tool-call-types.d.ts +2 -0
- package/vendor/cursor-sdk/dist/esm/types/tool-call-types.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/esm/utils/conversation-utils.d.ts +3 -0
- package/vendor/cursor-sdk/dist/esm/utils/conversation-utils.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/esm/utils/logger.d.ts +12 -0
- package/vendor/cursor-sdk/dist/esm/utils/logger.d.ts.map +1 -0
- package/vendor/cursor-sdk/dist/esm/utils/message-schemas.d.ts +2 -0
- package/vendor/cursor-sdk/dist/esm/utils/message-schemas.d.ts.map +1 -0
- package/vendor/cursor-sdk/package.json +77 -0
- package/vendor/cursor-sdk-linux-x64/README.md +5 -0
- package/vendor/cursor-sdk-linux-x64/bin/cursorsandbox +0 -0
- package/vendor/cursor-sdk-linux-x64/bin/rg +0 -0
- package/vendor/cursor-sdk-linux-x64/package.json +8 -0
- package/vendor/package/README.md +5 -0
- package/vendor/package/bin/cursorsandbox +0 -0
- package/vendor/package/bin/rg +0 -0
- package/vendor/package/package.json +25 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type BlobStore } from "@anysphere/agent-kv";
|
|
2
|
+
import type { Context } from "@anysphere/context";
|
|
3
|
+
import { ConversationStateStructure, PreFetchedBlob } from "@anysphere/proto/agent/v1/agent_pb.js";
|
|
4
|
+
export interface CollectPreFetchedBlobsOptions {
|
|
5
|
+
readonly maxBlobs?: number;
|
|
6
|
+
readonly maxTotalBytes?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface CollectPreFetchedBlobsResult {
|
|
9
|
+
readonly blobs: PreFetchedBlob[];
|
|
10
|
+
readonly truncated: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function collectPreFetchedBlobs(ctx: Context, state: ConversationStateStructure, blobStore: BlobStore, options?: CollectPreFetchedBlobsOptions): Promise<CollectPreFetchedBlobsResult>;
|
|
13
|
+
//# sourceMappingURL=prefetched-blobs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prefetched-blobs.d.ts","sourceRoot":"","sources":["../../src/agent/prefetched-blobs.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,KAAK,SAAS,EAAS,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAEL,0BAA0B,EAG1B,cAAc,EAGf,MAAM,uCAAuC,CAAC;AAE/C,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,KAAK,EAAE,cAAc,EAAE,CAAC;IACjC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B;AA6BD,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,0BAA0B,EACjC,SAAS,EAAE,SAAS,EACpB,OAAO,GAAE,6BAAkC,GAC1C,OAAO,CAAC,4BAA4B,CAAC,CA6DvC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type { AgentCheckpointStore, 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
|
+
export type { AgentMessage, AgentOperationOptions, CursorRequestOptions, GetAgentMessagesOptions, GetAgentOptions, GetRunOptions, ListAgentsOptions, ListResult, ListRunsOptions, SDKAgent, SDKAgentInfo, SDKModel, SDKRepository, SDKUser, SendOptions, } from "./agent.js";
|
|
4
|
+
export type { SDKArtifact } from "./artifacts.js";
|
|
5
|
+
export type { LocalRunStreamDoneEvent, LocalRunStreamEvent, LocalRunStreamResultEvent, LocalRunStreamSdkMessageEvent, SDKAssistantMessage, SDKMessage, SDKStatusMessage, SDKSystemMessage, SDKTaskMessage, SDKThinkingMessage, SDKToolUseMessage, SDKUserMessageEvent, TextBlock, ToolUseBlock, } from "./messages.js";
|
|
6
|
+
export { createSdkMessageRunStreamEvent, decodeLocalRunStreamEvent, decodeSdkMessageRunStreamEvent, isTerminalLocalRunStreamEvent, LOCAL_RUN_STREAM_EVENT_TYPE, LOCAL_RUN_STREAM_SCHEMA_VERSION, localRunStreamEventToSdkMessage, } from "./messages.js";
|
|
7
|
+
export type { AgentDefinition, AgentOptions, CloudAgentOptions, LocalAgentOptions, McpServerConfig, ModelListItem, ModelParameterDefinition, ModelParameterValue, ModelSelection, ModelVariant, SDKImage, SDKImageDimension, SDKUserMessage, SettingSource, } from "./options.js";
|
|
8
|
+
export { CursorAgentPlatform, createAgentPlatform } from "./platform.js";
|
|
9
|
+
export type { Run, RunOperation, RunResult, RunResultStatus, RunStatus, } from "./run.js";
|
|
10
|
+
export { UnsupportedRunOperationError } from "./run.js";
|
|
11
|
+
export { Agent, Cursor } from "./stubs.js";
|
|
12
|
+
//# sourceMappingURL=public-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../../src/agent/public-api.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,oBAAoB,EACpB,oBAAoB,EAC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EACd,YAAY,EACZ,QAAQ,EACR,iBAAiB,EACjB,cAAc,EACd,aAAa,GACd,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,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,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { RunEventNotifier, RunEventOffset, RunEventStore, RunEventStreamStore, RunLifecycleStatus } from "@anysphere/cursor-sdk-local-runtime/run-store";
|
|
2
|
+
import { type SDKMessage } from "./messages.js";
|
|
3
|
+
export interface RunEventTailerStreamOptions {
|
|
4
|
+
afterOffset?: RunEventOffset;
|
|
5
|
+
limit?: number;
|
|
6
|
+
mode?: "replay" | "tail" | "replay-and-tail";
|
|
7
|
+
signal?: AbortSignal;
|
|
8
|
+
pollIntervalMs?: number;
|
|
9
|
+
}
|
|
10
|
+
interface RunEventTailerOptions {
|
|
11
|
+
eventStore: RunEventStore;
|
|
12
|
+
eventStreamStore?: RunEventStreamStore;
|
|
13
|
+
eventNotifier?: RunEventNotifier;
|
|
14
|
+
loadRunStatus(runId: string): Promise<RunLifecycleStatus | undefined>;
|
|
15
|
+
defaultPollIntervalMs?: number;
|
|
16
|
+
}
|
|
17
|
+
export declare class RunEventTailer {
|
|
18
|
+
private readonly eventStore;
|
|
19
|
+
private readonly eventStreamStore;
|
|
20
|
+
private readonly eventNotifier;
|
|
21
|
+
private readonly loadRunStatus;
|
|
22
|
+
private readonly defaultPollIntervalMs;
|
|
23
|
+
constructor(options: RunEventTailerOptions);
|
|
24
|
+
streamRunEvents(runId: string, options?: RunEventTailerStreamOptions): AsyncGenerator<SDKMessage, void>;
|
|
25
|
+
private streamAttachedRunEvents;
|
|
26
|
+
private streamPolledRunEvents;
|
|
27
|
+
private drainExistingEvents;
|
|
28
|
+
private listAvailableEvents;
|
|
29
|
+
private decodeRunEventRecord;
|
|
30
|
+
private isTerminalAndDrained;
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=run-event-tailer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-event-tailer.d.ts","sourceRoot":"","sources":["../../src/agent/run-event-tailer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,gBAAgB,EAChB,cAAc,EAEd,aAAa,EACb,mBAAmB,EAEnB,kBAAkB,EACnB,MAAM,+CAA+C,CAAC;AAEvD,OAAO,EAKL,KAAK,UAAU,EAChB,MAAM,eAAe,CAAC;AAGvB,MAAM,WAAW,2BAA2B;IAC1C,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,iBAAiB,CAAC;IAC7C,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,UAAU,qBAAqB;IAC7B,UAAU,EAAE,aAAa,CAAC;IAC1B,gBAAgB,CAAC,EAAE,mBAAmB,CAAC;IACvC,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC,CAAC;IACtE,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAgB;IAC3C,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAkC;IACnE,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA+B;IAC7D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAEe;IAC7C,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAS;gBAEnC,OAAO,EAAE,qBAAqB;IAenC,eAAe,CACpB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,2BAAgC,GACxC,cAAc,CAAC,UAAU,EAAE,IAAI,CAAC;YAcpB,uBAAuB;YAoDvB,qBAAqB;YAoEtB,mBAAmB;YAsBnB,mBAAmB;IAsCjC,OAAO,CAAC,oBAAoB;YAed,oBAAoB;CAmBnC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { SDKMessage } from "./messages.js";
|
|
2
|
+
import type { ConversationStep, ConversationTurn } from "./types/conversation-types.js";
|
|
3
|
+
import type { InteractionUpdate } from "./types/delta-types.js";
|
|
4
|
+
export interface RunInteractionAccumulatorOptions {
|
|
5
|
+
onStep?: (args: {
|
|
6
|
+
step: ConversationStep;
|
|
7
|
+
}) => void | Promise<void>;
|
|
8
|
+
onDelta?: (args: {
|
|
9
|
+
update: InteractionUpdate;
|
|
10
|
+
}) => void | Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
export declare class RunInteractionAccumulator {
|
|
13
|
+
private readonly options;
|
|
14
|
+
private readonly turns;
|
|
15
|
+
private currentTurn;
|
|
16
|
+
private lastFiredStepIndex;
|
|
17
|
+
constructor(options?: RunInteractionAccumulatorOptions);
|
|
18
|
+
conversation(): ConversationTurn[];
|
|
19
|
+
finalAssistantText(): string | undefined;
|
|
20
|
+
apply(update: InteractionUpdate): Promise<void>;
|
|
21
|
+
flushPendingStep(): Promise<void>;
|
|
22
|
+
private ensureCurrentTurn;
|
|
23
|
+
private mergeIntoConversation;
|
|
24
|
+
private onUserMessage;
|
|
25
|
+
private onTextDelta;
|
|
26
|
+
private onThinkingDelta;
|
|
27
|
+
private onThinkingCompleted;
|
|
28
|
+
private onTool;
|
|
29
|
+
private didPreviousStepComplete;
|
|
30
|
+
}
|
|
31
|
+
export declare function accumulateSdkMessageStream(stream: AsyncIterable<SDKMessage>): Promise<ConversationTurn[]>;
|
|
32
|
+
export declare function sdkMessageToInteractionUpdate(message: SDKMessage): InteractionUpdate | undefined;
|
|
33
|
+
//# sourceMappingURL=run-interaction-accumulator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-interaction-accumulator.d.ts","sourceRoot":"","sources":["../../src/agent/run-interaction-accumulator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAGV,gBAAgB,EAChB,gBAAgB,EAEjB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EACV,iBAAiB,EAMlB,MAAM,wBAAwB,CAAC;AAGhC,MAAM,WAAW,gCAAgC;IAC/C,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,gBAAgB,CAAA;KAAE,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,iBAAiB,CAAA;KAAE,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACzE;AAED,qBAAa,yBAAyB;IAMlC,OAAO,CAAC,QAAQ,CAAC,OAAO;IAL1B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA0B;IAChD,OAAO,CAAC,WAAW,CAAsC;IACzD,OAAO,CAAC,kBAAkB,CAAM;gBAGb,OAAO,GAAE,gCAAqC;IAGjE,YAAY,IAAI,gBAAgB,EAAE;IAIlC,kBAAkB,IAAI,MAAM,GAAG,SAAS;IAiBlC,KAAK,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAe/C,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAcvC,OAAO,CAAC,iBAAiB;IAUzB,OAAO,CAAC,qBAAqB;IA6B7B,OAAO,CAAC,aAAa;IASrB,OAAO,CAAC,WAAW;IAsBnB,OAAO,CAAC,eAAe;IAsBvB,OAAO,CAAC,mBAAmB;IAc3B,OAAO,CAAC,MAAM;IAQd,OAAO,CAAC,uBAAuB;CA4BhC;AAED,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,aAAa,CAAC,UAAU,CAAC,GAChC,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAU7B;AAED,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,UAAU,GAClB,iBAAiB,GAAG,SAAS,CA8C/B"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ConfigurationError } from "./errors.js";
|
|
2
|
+
import type { SDKMessage } from "./messages.js";
|
|
3
|
+
import type { ModelSelection } from "./options.js";
|
|
4
|
+
import type { ConversationTurn } from "./types/conversation-types.js";
|
|
5
|
+
export type RunStatus = "running" | "finished" | "error" | "cancelled";
|
|
6
|
+
export type RunResultStatus = Exclude<RunStatus, "running">;
|
|
7
|
+
export type RunOperation = "stream" | "wait" | "cancel" | "conversation";
|
|
8
|
+
export declare class UnsupportedRunOperationError extends ConfigurationError {
|
|
9
|
+
constructor(operation: RunOperation, reason?: string);
|
|
10
|
+
}
|
|
11
|
+
export interface RunGitBranchInfo {
|
|
12
|
+
repoUrl: string;
|
|
13
|
+
branch?: string;
|
|
14
|
+
prUrl?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface RunGitInfo {
|
|
17
|
+
branches: RunGitBranchInfo[];
|
|
18
|
+
}
|
|
19
|
+
export interface RunResult {
|
|
20
|
+
id: string;
|
|
21
|
+
status: RunResultStatus;
|
|
22
|
+
result?: string;
|
|
23
|
+
model?: ModelSelection;
|
|
24
|
+
durationMs?: number;
|
|
25
|
+
git?: RunGitInfo;
|
|
26
|
+
}
|
|
27
|
+
export interface Run {
|
|
28
|
+
readonly id: string;
|
|
29
|
+
readonly agentId: string;
|
|
30
|
+
supports(operation: RunOperation): boolean;
|
|
31
|
+
unsupportedReason(operation: RunOperation): string | undefined;
|
|
32
|
+
stream(): AsyncGenerator<SDKMessage, void>;
|
|
33
|
+
conversation(): Promise<ConversationTurn[]>;
|
|
34
|
+
wait(): Promise<RunResult>;
|
|
35
|
+
cancel(): Promise<void>;
|
|
36
|
+
readonly status: RunStatus;
|
|
37
|
+
onDidChangeStatus(listener: (status: RunStatus) => void): () => void;
|
|
38
|
+
readonly result?: string;
|
|
39
|
+
readonly model?: ModelSelection;
|
|
40
|
+
readonly durationMs?: number;
|
|
41
|
+
readonly git?: RunGitInfo;
|
|
42
|
+
readonly createdAt?: number;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/agent/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,GAAG,WAAW,CAAC;AACvE,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;AAC5D,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,cAAc,CAAC;AAEzE,qBAAa,4BAA6B,SAAQ,kBAAkB;gBACtD,SAAS,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,MAAM;CAOrD;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,gBAAgB,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,eAAe,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,UAAU,CAAC;CAClB;AAED,MAAM,WAAW,GAAG;IAClB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,YAAY,GAAG,OAAO,CAAC;IAC3C,iBAAiB,CAAC,SAAS,EAAE,YAAY,GAAG,MAAM,GAAG,SAAS,CAAC;IAC/D,MAAM,IAAI,cAAc,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAC3C,YAAY,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAC5C,IAAI,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC;IAC3B,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,iBAAiB,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IACrE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,GAAG,CAAC,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface SdkStatsigClient {
|
|
2
|
+
checkFeatureGate(gateName: string): boolean;
|
|
3
|
+
getDynamicConfigValue<T>(params: {
|
|
4
|
+
configName: string;
|
|
5
|
+
paramName: string;
|
|
6
|
+
defaultValue: T;
|
|
7
|
+
}): T;
|
|
8
|
+
}
|
|
9
|
+
export declare function bootstrapSdkStatsig(apiKey: string): Promise<SdkStatsigClient>;
|
|
10
|
+
//# sourceMappingURL=sdk-statsig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk-statsig.d.ts","sourceRoot":"","sources":["../../src/agent/sdk-statsig.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,gBAAgB;IAC/B,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5C,qBAAqB,CAAC,CAAC,EAAE,MAAM,EAAE;QAC/B,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,YAAY,EAAE,CAAC,CAAC;KACjB,GAAG,CAAC,CAAC;CACP;AA0ID,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAsB7E"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { AgentMessage, AgentOperationOptions, CursorRequestOptions, GetAgentMessagesOptions, GetAgentOptions, GetRunOptions, ListAgentsOptions, ListResult, ListRunsOptions, SDKAgent, SDKAgentInfo, SDKModel, SDKRepository, SDKUser, SendOptions } from "./agent.js";
|
|
2
|
+
import type { SDKArtifact } from "./artifacts.js";
|
|
3
|
+
import { ConfigurationError } from "./errors.js";
|
|
4
|
+
import type { SDKMessage } from "./messages.js";
|
|
5
|
+
import type { AgentOptions, SDKUserMessage } from "./options.js";
|
|
6
|
+
import type { Run, RunOperation, RunResult, RunStatus } from "./run.js";
|
|
7
|
+
import type { ConversationTurn } from "./types/conversation-types.js";
|
|
8
|
+
export declare function createUnimplementedError(apiName: string): ConfigurationError;
|
|
9
|
+
export declare class UnimplementedRun implements Run {
|
|
10
|
+
readonly id = "unimplemented-run";
|
|
11
|
+
readonly agentId = "unimplemented-agent";
|
|
12
|
+
readonly result: undefined;
|
|
13
|
+
readonly model: undefined;
|
|
14
|
+
readonly durationMs: undefined;
|
|
15
|
+
readonly git: undefined;
|
|
16
|
+
supports(_operation: RunOperation): boolean;
|
|
17
|
+
unsupportedReason(operation: RunOperation): string | undefined;
|
|
18
|
+
stream(): AsyncGenerator<SDKMessage, void>;
|
|
19
|
+
conversation(): Promise<ConversationTurn[]>;
|
|
20
|
+
wait(): Promise<RunResult>;
|
|
21
|
+
cancel(): Promise<void>;
|
|
22
|
+
get status(): RunStatus;
|
|
23
|
+
onDidChangeStatus(_listener: (status: RunStatus) => void): () => void;
|
|
24
|
+
}
|
|
25
|
+
export declare class UnimplementedAgent implements SDKAgent {
|
|
26
|
+
readonly agentId = "unimplemented-agent";
|
|
27
|
+
readonly model: undefined;
|
|
28
|
+
send(_message: string | SDKUserMessage, _options?: SendOptions): Promise<Run>;
|
|
29
|
+
close(): void;
|
|
30
|
+
reload(): Promise<void>;
|
|
31
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
32
|
+
listArtifacts(): Promise<SDKArtifact[]>;
|
|
33
|
+
downloadArtifact(_path: string): Promise<Buffer>;
|
|
34
|
+
}
|
|
35
|
+
export declare class Agent {
|
|
36
|
+
private constructor();
|
|
37
|
+
/**
|
|
38
|
+
* Create an agent instance.
|
|
39
|
+
*/
|
|
40
|
+
static create(options: AgentOptions): Promise<SDKAgent>;
|
|
41
|
+
/**
|
|
42
|
+
* Resume an existing agent by ID.
|
|
43
|
+
*/
|
|
44
|
+
static resume(agentId: string, options?: Partial<AgentOptions>): Promise<SDKAgent>;
|
|
45
|
+
/**
|
|
46
|
+
* Convenience API to create an agent, run one prompt, and close.
|
|
47
|
+
*/
|
|
48
|
+
static prompt(message: string, options?: AgentOptions): Promise<RunResult>;
|
|
49
|
+
static list(options?: ListAgentsOptions): Promise<ListResult<SDKAgentInfo>>;
|
|
50
|
+
static listRuns(agentId: string, options?: ListRunsOptions): Promise<ListResult<Run>>;
|
|
51
|
+
static getRun(runId: string, options?: GetRunOptions): Promise<Run>;
|
|
52
|
+
static cancelRun(runId: string, options?: GetRunOptions): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Fetch a single agent's metadata by ID. Cloud-only — local agent lookup
|
|
55
|
+
* is a post-launch followup.
|
|
56
|
+
*/
|
|
57
|
+
static get(agentId: string, options?: GetAgentOptions): Promise<SDKAgentInfo>;
|
|
58
|
+
/**
|
|
59
|
+
* Archive an agent. Cloud-only.
|
|
60
|
+
*/
|
|
61
|
+
static archive(agentId: string, options?: AgentOperationOptions): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Unarchive a previously archived agent. Cloud-only.
|
|
64
|
+
*/
|
|
65
|
+
static unarchive(agentId: string, options?: AgentOperationOptions): Promise<void>;
|
|
66
|
+
/**
|
|
67
|
+
* Delete an agent. Cloud-only and irreversible.
|
|
68
|
+
*/
|
|
69
|
+
static delete(agentId: string, options?: AgentOperationOptions): Promise<void>;
|
|
70
|
+
static readonly messages: {
|
|
71
|
+
list(agentId: string, options?: GetAgentMessagesOptions): Promise<AgentMessage[]>;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Account and platform-level operations. Namespaced separately from `Agent`
|
|
76
|
+
* because these concerns (the calling user, available models, connected
|
|
77
|
+
* repositories) aren't scoped to a specific agent.
|
|
78
|
+
*/
|
|
79
|
+
export declare class Cursor {
|
|
80
|
+
private constructor();
|
|
81
|
+
/**
|
|
82
|
+
* Get metadata about the authenticated user / API key.
|
|
83
|
+
*/
|
|
84
|
+
static me(options?: CursorRequestOptions): Promise<SDKUser>;
|
|
85
|
+
/**
|
|
86
|
+
* List models available to the authenticated user.
|
|
87
|
+
*/
|
|
88
|
+
static readonly models: {
|
|
89
|
+
list(options?: CursorRequestOptions): Promise<SDKModel[]>;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* List GitHub repositories the authenticated user has connected to Cursor.
|
|
93
|
+
*/
|
|
94
|
+
static readonly repositories: {
|
|
95
|
+
list(options?: CursorRequestOptions): Promise<SDKRep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untimeCustomSubagentDefinition } from "@anysphere/cursor-sdk-local-runtime";
|
|
2
|
+
import type { V1CustomSubagent } from "./cloud-api-client.js";
|
|
3
|
+
import type { AgentDefinition, ModelSelection } from "./options.js";
|
|
4
|
+
export interface SDKCustomSubagentDefinition {
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
prompt: string;
|
|
8
|
+
model: ModelSelection | "inherit";
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Convert SDK `AgentOptions.agents` to a plain, serializable custom subagent
|
|
12
|
+
* shape. Inline `McpServerConfig` entries on a subagent are rejected; SDK
|
|
13
|
+
* custom subagents inherit the parent agent's MCP config.
|
|
14
|
+
*/
|
|
15
|
+
export declare function convertAgentDefinitionsToCustomSubagents(agents: Record<string, AgentDefinition> | undefined): SDKCustomSubagentDefinition[] | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Convert SDK `AgentOptions.agents` to the `V1CustomSubagent[]` shape the
|
|
18
|
+
* cloud API expects.
|
|
19
|
+
*/
|
|
20
|
+
export declare function convertAgentDefinitionsToV1CustomSubagents(agents: Record<string, AgentDefinition> | undefined): V1CustomSubagent[] | undefined;
|
|
21
|
+
export declare function convertAgentDefinitionsToRuntimeCustomSubagents(agents: Record<string, AgentDefinition> | undefined): RuntimeCustomSubagentDefinition[] | undefined;
|
|
22
|
+
//# sourceMappingURL=subagent-conversion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subagent-conversion.d.ts","sourceRoot":"","sources":["../../src/agent/subagent-conversion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,qCAAqC,CAAC;AAC3F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEpE,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,cAAc,GAAG,SAAS,CAAC;CACnC;AAED;;;;GAIG;AACH,wBAAgB,wCAAwC,CACtD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,SAAS,GAClD,2BAA2B,EAAE,GAAG,SAAS,CAqC3C;AAED;;;GAGG;AACH,wBAAgB,0CAA0C,CACxD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,SAAS,GAClD,gBAAgB,EAAE,GAAG,SAAS,CAEhC;AAED,wBAAgB,+CAA+C,CAC7D,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,SAAS,GAClD,+BAA+B,EAAE,GAAG,SAAS,CAY/C"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type ToolPayloadTruncated = {
|
|
2
|
+
args?: boolean;
|
|
3
|
+
result?: boolean;
|
|
4
|
+
};
|
|
5
|
+
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
6
|
+
export declare function isToolPayloadTruncated(value: unknown): value is ToolPayloadTruncated;
|
|
7
|
+
//# sourceMappingURL=tool-call-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-call-utils.d.ts","sourceRoot":"","sources":["../../src/agent/tool-call-utils.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzE;AAED,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,oBAAoB,CAQ/B"}
|