@zusehq/serve 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.mjs +1 -1
- package/dist/{cli-Cz9Ua4SV.mjs → cli-CHHBM6zs.mjs} +428 -268
- package/dist/cli-CHHBM6zs.mjs.map +1 -0
- package/dist/cli.mjs +1 -1
- package/package.json +1 -1
- package/dist/cli-Cz9Ua4SV.mjs.map +0 -1
|
@@ -5,7 +5,7 @@ import { Data, Effect, Layer, ManagedRuntime, Schema, Scope, Struct } from "effe
|
|
|
5
5
|
import { Rpc, RpcClient, RpcGroup, RpcSerialization } from "effect/unstable/rpc";
|
|
6
6
|
import { Socket } from "effect/unstable/socket";
|
|
7
7
|
//#region package.json
|
|
8
|
-
var version = "0.1.
|
|
8
|
+
var version = "0.1.4";
|
|
9
9
|
//#endregion
|
|
10
10
|
//#region ../client-runtime/src/connection.ts
|
|
11
11
|
var WireProtocolMismatchError = class extends Data.TaggedError("WireProtocolMismatchError") {};
|
|
@@ -57,7 +57,7 @@ const WorktreeId = makeEntityId("WorktreeId");
|
|
|
57
57
|
const ChatId = makeEntityId("ChatId");
|
|
58
58
|
const EnvironmentId = makeEntityId("EnvironmentId");
|
|
59
59
|
const AuthTokenId = makeEntityId("AuthTokenId");
|
|
60
|
-
makeEntityId("CommandId");
|
|
60
|
+
const CommandId = makeEntityId("CommandId");
|
|
61
61
|
makeEntityId("EventId");
|
|
62
62
|
//#endregion
|
|
63
63
|
//#region ../contracts/src/agent.ts
|
|
@@ -360,9 +360,17 @@ const VersionEvent = Schema.TaggedStruct("Version", {
|
|
|
360
360
|
sdkVersion: Schema.optional(Schema.String)
|
|
361
361
|
});
|
|
362
362
|
const CapabilitiesEvent = Schema.TaggedStruct("Capabilities", { capabilities: Schema.Array(Schema.String) });
|
|
363
|
+
/** Absolute, monotonically revised text emitted for one stable provider item. */
|
|
364
|
+
const ProviderMessageCheckpoint = Schema.Struct({
|
|
365
|
+
/** Revisions start at 1 and increase for every accepted cumulative value. */
|
|
366
|
+
revision: Schema.Number,
|
|
367
|
+
/** Final promotion is itself a strictly newer revision. */
|
|
368
|
+
final: Schema.Boolean
|
|
369
|
+
});
|
|
363
370
|
const AssistantMessageEvent = Schema.TaggedStruct("AssistantMessage", {
|
|
364
371
|
itemId: AgentItemId,
|
|
365
372
|
text: Schema.String,
|
|
373
|
+
checkpoint: Schema.optional(ProviderMessageCheckpoint),
|
|
366
374
|
/** True when the provider emitted a dedicated final plan item. */
|
|
367
375
|
isPlan: Schema.optional(Schema.Boolean),
|
|
368
376
|
parentItemId: Schema.optional(AgentItemId)
|
|
@@ -371,6 +379,7 @@ const ThinkingEvent = Schema.TaggedStruct("Thinking", {
|
|
|
371
379
|
itemId: AgentItemId,
|
|
372
380
|
text: Schema.String,
|
|
373
381
|
redacted: Schema.Boolean,
|
|
382
|
+
checkpoint: Schema.optional(ProviderMessageCheckpoint),
|
|
374
383
|
parentItemId: Schema.optional(AgentItemId)
|
|
375
384
|
});
|
|
376
385
|
/**
|
|
@@ -1841,6 +1850,15 @@ var FsConflictError = class extends Schema.TaggedErrorClass()("FsConflictError",
|
|
|
1841
1850
|
expectedMtime: Schema.String,
|
|
1842
1851
|
actualMtime: Schema.String
|
|
1843
1852
|
}) {};
|
|
1853
|
+
/**
|
|
1854
|
+
* A command id is an idempotency key, so it may only ever describe one exact
|
|
1855
|
+
* file write. Reusing it with a different target or payload is rejected
|
|
1856
|
+
* instead of returning an unrelated prior receipt.
|
|
1857
|
+
*/
|
|
1858
|
+
var FsCommandReuseError = class extends Schema.TaggedErrorClass()("FsCommandReuseError", {
|
|
1859
|
+
commandId: CommandId,
|
|
1860
|
+
reason: Schema.Literals(["target-mismatch", "payload-mismatch"])
|
|
1861
|
+
}) {};
|
|
1844
1862
|
var FsExternalReadError = class extends Schema.TaggedErrorClass()("FsExternalReadError", {
|
|
1845
1863
|
path: Schema.String,
|
|
1846
1864
|
reason: Schema.String
|
|
@@ -1880,6 +1898,7 @@ const FsWriteFileErrors = Schema.Union([
|
|
|
1880
1898
|
FsPathOutsideError,
|
|
1881
1899
|
FsReadError,
|
|
1882
1900
|
FsConflictError,
|
|
1901
|
+
FsCommandReuseError,
|
|
1883
1902
|
FsTooLargeError
|
|
1884
1903
|
]);
|
|
1885
1904
|
const FsCreateErrors = Schema.Union([
|
|
@@ -1909,17 +1928,35 @@ const FsTreeRpc = Rpc.make("fs.tree", {
|
|
|
1909
1928
|
success: Schema.Array(FsEntry),
|
|
1910
1929
|
error: FsErrors
|
|
1911
1930
|
});
|
|
1931
|
+
const FsTreeWatchEvent = Schema.Union([
|
|
1932
|
+
Schema.TaggedStruct("ready", {
|
|
1933
|
+
epoch: Schema.String,
|
|
1934
|
+
sequence: Schema.Number
|
|
1935
|
+
}),
|
|
1936
|
+
Schema.TaggedStruct("changed", {
|
|
1937
|
+
epoch: Schema.String,
|
|
1938
|
+
sequence: Schema.Number,
|
|
1939
|
+
paths: Schema.Array(Schema.String)
|
|
1940
|
+
}),
|
|
1941
|
+
Schema.TaggedStruct("gap", {
|
|
1942
|
+
epoch: Schema.String,
|
|
1943
|
+
sequence: Schema.Number,
|
|
1944
|
+
reason: Schema.String
|
|
1945
|
+
})
|
|
1946
|
+
]);
|
|
1912
1947
|
/**
|
|
1913
1948
|
* Live stream of filesystem changes under the current project/worktree root.
|
|
1914
|
-
*
|
|
1915
|
-
*
|
|
1949
|
+
* `ready` proves the server watcher was attached before a client reads its
|
|
1950
|
+
* snapshot. Subsequent `changed` frames carry a stream-local monotonic
|
|
1951
|
+
* sequence. `gap` means the watcher can no longer prove continuity and the
|
|
1952
|
+
* client must attach a replacement watcher and perform a full reconciliation.
|
|
1916
1953
|
*/
|
|
1917
1954
|
const FsWatchTreeRpc = Rpc.make("fs.watchTree", {
|
|
1918
1955
|
payload: Schema.Struct({
|
|
1919
1956
|
folderId: FolderId,
|
|
1920
1957
|
worktreeId: Schema.optional(Schema.NullOr(WorktreeId))
|
|
1921
1958
|
}),
|
|
1922
|
-
success:
|
|
1959
|
+
success: FsTreeWatchEvent,
|
|
1923
1960
|
error: FsErrors,
|
|
1924
1961
|
stream: true
|
|
1925
1962
|
});
|
|
@@ -1964,6 +2001,8 @@ const FsReadFileRpc = Rpc.make("fs.readFile", {
|
|
|
1964
2001
|
*/
|
|
1965
2002
|
const FsWriteFileRpc = Rpc.make("fs.writeFile", {
|
|
1966
2003
|
payload: Schema.Struct({
|
|
2004
|
+
/** Stable identity makes a lost write response safe to retry. */
|
|
2005
|
+
commandId: CommandId,
|
|
1967
2006
|
folderId: FolderId,
|
|
1968
2007
|
path: Schema.String,
|
|
1969
2008
|
content: Schema.String,
|
|
@@ -2447,6 +2486,7 @@ const UserRichContent = Schema.TaggedStruct("user_rich", {
|
|
|
2447
2486
|
const AssistantContent = Schema.TaggedStruct("assistant", {
|
|
2448
2487
|
itemId: Schema.optional(AgentItemId),
|
|
2449
2488
|
text: Schema.String,
|
|
2489
|
+
checkpoint: Schema.optional(ProviderMessageCheckpoint),
|
|
2450
2490
|
/** Preserves a provider's dedicated final-plan item through persistence. */
|
|
2451
2491
|
isPlan: Schema.optional(Schema.Boolean),
|
|
2452
2492
|
parentItemId: Schema.optional(AgentItemId)
|
|
@@ -2461,6 +2501,7 @@ const ThinkingContent = Schema.TaggedStruct("thinking", {
|
|
|
2461
2501
|
itemId: AgentItemId,
|
|
2462
2502
|
text: Schema.String,
|
|
2463
2503
|
redacted: Schema.Boolean,
|
|
2504
|
+
checkpoint: Schema.optional(ProviderMessageCheckpoint),
|
|
2464
2505
|
parentItemId: Schema.optional(AgentItemId)
|
|
2465
2506
|
});
|
|
2466
2507
|
const ToolUseContent = Schema.TaggedStruct("tool_use", {
|
|
@@ -2627,6 +2668,16 @@ var QueuedMessageNotFoundError = class extends Schema.TaggedErrorClass()("Queued
|
|
|
2627
2668
|
sessionId: SessionId,
|
|
2628
2669
|
queueId: Schema.String
|
|
2629
2670
|
}) {};
|
|
2671
|
+
var QueuedMessageCapacityError = class extends Schema.TaggedErrorClass()("QueuedMessageCapacityError", {
|
|
2672
|
+
sessionId: SessionId,
|
|
2673
|
+
reason: Schema.Literals([
|
|
2674
|
+
"too-many-items",
|
|
2675
|
+
"item-too-large",
|
|
2676
|
+
"queue-too-large"
|
|
2677
|
+
]),
|
|
2678
|
+
limit: Schema.Number,
|
|
2679
|
+
actual: Schema.Number
|
|
2680
|
+
}) {};
|
|
2630
2681
|
var QueueState = class extends Schema.Class("QueueState")({
|
|
2631
2682
|
items: Schema.Array(QueuedMessage),
|
|
2632
2683
|
paused: Schema.Boolean
|
|
@@ -2644,6 +2695,8 @@ const SessionTimelineTurn = Schema.Struct({
|
|
|
2644
2695
|
});
|
|
2645
2696
|
var SessionTimelineProjection = class extends Schema.Class("SessionTimelineProjection")({
|
|
2646
2697
|
messages: Schema.Array(Message),
|
|
2698
|
+
/** Sequence immediately before the oldest materialized message, if any. */
|
|
2699
|
+
olderMessageSequence: Schema.optional(Schema.NullOr(Schema.Number)),
|
|
2647
2700
|
status: SessionStatus,
|
|
2648
2701
|
currentTurn: Schema.NullOr(SessionTimelineTurn),
|
|
2649
2702
|
queue: QueueState,
|
|
@@ -2683,24 +2736,46 @@ const SessionTimelineEvent = Schema.Union([
|
|
|
2683
2736
|
Schema.TaggedStruct("QueueRemoved", { queueId: Schema.String }),
|
|
2684
2737
|
Schema.TaggedStruct("QueueReordered", { queueIds: Schema.Array(Schema.String) })
|
|
2685
2738
|
]);
|
|
2739
|
+
/** Durable cursor for one database epoch and one session stream. */
|
|
2740
|
+
const SessionStreamCursor = Schema.Struct({
|
|
2741
|
+
epoch: Schema.String,
|
|
2742
|
+
version: Schema.Number
|
|
2743
|
+
});
|
|
2686
2744
|
const SessionTimelineFrame = Schema.Union([
|
|
2687
2745
|
Schema.Struct({
|
|
2688
2746
|
kind: Schema.Literal("snapshot"),
|
|
2689
2747
|
sessionId: SessionId,
|
|
2690
2748
|
throughVersion: Schema.Number,
|
|
2691
|
-
projection: SessionTimelineProjection
|
|
2749
|
+
projection: SessionTimelineProjection,
|
|
2750
|
+
/** Present on new runtimes; omitted by older peers during protocol rollout. */
|
|
2751
|
+
cursor: Schema.optional(SessionStreamCursor),
|
|
2752
|
+
/** Sequence immediately before the oldest included message, if any. */
|
|
2753
|
+
olderMessageSequence: Schema.optional(Schema.NullOr(Schema.Number))
|
|
2692
2754
|
}),
|
|
2693
2755
|
Schema.Struct({
|
|
2694
2756
|
kind: Schema.Literal("event"),
|
|
2695
2757
|
sessionId: SessionId,
|
|
2696
2758
|
streamVersion: Schema.Number,
|
|
2697
2759
|
eventId: Schema.String,
|
|
2698
|
-
event: SessionTimelineEvent
|
|
2760
|
+
event: SessionTimelineEvent,
|
|
2761
|
+
cursor: Schema.optional(SessionStreamCursor)
|
|
2699
2762
|
}),
|
|
2700
2763
|
Schema.Struct({
|
|
2701
2764
|
kind: Schema.Literal("synchronized"),
|
|
2702
2765
|
sessionId: SessionId,
|
|
2703
|
-
throughVersion: Schema.Number
|
|
2766
|
+
throughVersion: Schema.Number,
|
|
2767
|
+
cursor: Schema.optional(SessionStreamCursor)
|
|
2768
|
+
}),
|
|
2769
|
+
Schema.Struct({
|
|
2770
|
+
kind: Schema.Literal("reset-required"),
|
|
2771
|
+
sessionId: SessionId,
|
|
2772
|
+
throughVersion: Schema.Number,
|
|
2773
|
+
cursor: SessionStreamCursor,
|
|
2774
|
+
reason: Schema.Literals([
|
|
2775
|
+
"restored",
|
|
2776
|
+
"compacted",
|
|
2777
|
+
"cursor-invalid"
|
|
2778
|
+
])
|
|
2704
2779
|
})
|
|
2705
2780
|
]);
|
|
2706
2781
|
var SessionNotFoundError = class extends Schema.TaggedErrorClass()("SessionNotFoundError", { sessionId: SessionId }) {};
|
|
@@ -2821,6 +2896,7 @@ const SessionSetWorktreeRpc = Rpc.make("session.setWorktree", {
|
|
|
2821
2896
|
});
|
|
2822
2897
|
const SessionRenameRpc = Rpc.make("session.rename", {
|
|
2823
2898
|
payload: Schema.Struct({
|
|
2899
|
+
commandId: CommandId,
|
|
2824
2900
|
sessionId: SessionId,
|
|
2825
2901
|
title: Schema.String
|
|
2826
2902
|
}),
|
|
@@ -3072,6 +3148,7 @@ const ChatCreationOperation = Schema.Struct({
|
|
|
3072
3148
|
prompt: Schema.NullOr(Schema.String),
|
|
3073
3149
|
startupInput: Schema.NullOr(ComposerInput),
|
|
3074
3150
|
startupQueueId: Schema.NullOr(Schema.String),
|
|
3151
|
+
startupReady: Schema.Boolean,
|
|
3075
3152
|
workspacePolicy: ChatWorkspacePolicy,
|
|
3076
3153
|
worktreeId: Schema.NullOr(WorktreeId),
|
|
3077
3154
|
status: ChatCreationOperationStatus,
|
|
@@ -3083,9 +3160,16 @@ const ChatCreationListRpc = Rpc.make("chat.creation.list", {
|
|
|
3083
3160
|
payload: Schema.Struct({ projectId: FolderId }),
|
|
3084
3161
|
success: Schema.Array(ChatCreationOperation)
|
|
3085
3162
|
});
|
|
3163
|
+
const ChatCreationSummaryChange = Schema.Union([Schema.Struct({
|
|
3164
|
+
_tag: Schema.Literal("snapshot"),
|
|
3165
|
+
operations: Schema.Array(ChatCreationOperation)
|
|
3166
|
+
}), Schema.Struct({
|
|
3167
|
+
_tag: Schema.Literal("change"),
|
|
3168
|
+
operation: ChatCreationOperation
|
|
3169
|
+
})]);
|
|
3086
3170
|
const ChatCreationStreamRpc = Rpc.make("chat.creation.stream", {
|
|
3087
3171
|
payload: Schema.Struct({ projectId: FolderId }),
|
|
3088
|
-
success:
|
|
3172
|
+
success: ChatCreationSummaryChange,
|
|
3089
3173
|
stream: true
|
|
3090
3174
|
});
|
|
3091
3175
|
const ChatCreationDiscardRpc = Rpc.make("chat.creation.discard", {
|
|
@@ -3109,6 +3193,8 @@ const ChatCreateRpc = Rpc.make("chat.create", {
|
|
|
3109
3193
|
workspacePolicy: Schema.optional(ChatWorkspacePolicy),
|
|
3110
3194
|
startupInput: Schema.optional(ComposerInput),
|
|
3111
3195
|
startupQueueId: Schema.optional(Schema.String),
|
|
3196
|
+
/** False while attachment or generated context preparation is pending. */
|
|
3197
|
+
startupReady: Schema.optional(Schema.Boolean),
|
|
3112
3198
|
agents: Schema.optional(Schema.Record(Schema.String, AgentDefinition)),
|
|
3113
3199
|
enableSubagents: Schema.optional(Schema.Boolean),
|
|
3114
3200
|
permissionMode: Schema.optional(PermissionMode),
|
|
@@ -3264,18 +3350,31 @@ const MessagesListRpc = Rpc.make("messages.list", {
|
|
|
3264
3350
|
*/
|
|
3265
3351
|
const MessagesSendRpc = Rpc.make("messages.send", {
|
|
3266
3352
|
payload: Schema.Struct({
|
|
3353
|
+
commandId: CommandId,
|
|
3267
3354
|
sessionId: SessionId,
|
|
3268
3355
|
text: Schema.optional(Schema.String),
|
|
3269
3356
|
input: Schema.optional(ComposerInput),
|
|
3270
3357
|
asGoal: Schema.optional(Schema.Boolean),
|
|
3358
|
+
modelOptions: Schema.optional(Schema.Record(Schema.String, Schema.String)),
|
|
3271
3359
|
clientMessageId: Schema.optional(MessageId)
|
|
3272
3360
|
}),
|
|
3273
3361
|
success: Schema.Void,
|
|
3274
3362
|
error: Schema.Union([SessionNotFoundError, DirectoryUnavailableError])
|
|
3275
3363
|
});
|
|
3364
|
+
/** Durable outcome of an exact-turn interrupt request. */
|
|
3365
|
+
const TurnInterruptReceipt = Schema.Union([Schema.TaggedStruct("requested", { turnId: AgentTurnId }), Schema.TaggedStruct("not-active", {
|
|
3366
|
+
reason: Schema.Literals(["no-active-turn", "turn-mismatch"]),
|
|
3367
|
+
expectedTurnId: Schema.NullOr(AgentTurnId),
|
|
3368
|
+
actualTurnId: Schema.NullOr(AgentTurnId)
|
|
3369
|
+
})]);
|
|
3276
3370
|
const MessagesInterruptRpc = Rpc.make("messages.interrupt", {
|
|
3277
|
-
payload: Schema.Struct({
|
|
3278
|
-
|
|
3371
|
+
payload: Schema.Struct({
|
|
3372
|
+
commandId: CommandId,
|
|
3373
|
+
sessionId: SessionId,
|
|
3374
|
+
/** Fences retries to the turn visible when the user pressed Stop. */
|
|
3375
|
+
expectedTurnId: Schema.optional(AgentTurnId)
|
|
3376
|
+
}),
|
|
3377
|
+
success: TurnInterruptReceipt,
|
|
3279
3378
|
error: SessionNotFoundError
|
|
3280
3379
|
});
|
|
3281
3380
|
const MessagesQueueListRpc = Rpc.make("messages.queue.list", {
|
|
@@ -3285,6 +3384,7 @@ const MessagesQueueListRpc = Rpc.make("messages.queue.list", {
|
|
|
3285
3384
|
});
|
|
3286
3385
|
const MessagesQueueAddRpc = Rpc.make("messages.queue.add", {
|
|
3287
3386
|
payload: Schema.Struct({
|
|
3387
|
+
commandId: CommandId,
|
|
3288
3388
|
sessionId: SessionId,
|
|
3289
3389
|
/** Stable identity used to make persistence retries idempotent. */
|
|
3290
3390
|
queueId: Schema.optional(Schema.String),
|
|
@@ -3295,19 +3395,25 @@ const MessagesQueueAddRpc = Rpc.make("messages.queue.add", {
|
|
|
3295
3395
|
flush: Schema.optional(Schema.Boolean)
|
|
3296
3396
|
}),
|
|
3297
3397
|
success: QueuedMessage,
|
|
3298
|
-
error: SessionNotFoundError
|
|
3398
|
+
error: Schema.Union([SessionNotFoundError, QueuedMessageCapacityError])
|
|
3299
3399
|
});
|
|
3300
3400
|
const MessagesQueueUpdateRpc = Rpc.make("messages.queue.update", {
|
|
3301
3401
|
payload: Schema.Struct({
|
|
3402
|
+
commandId: CommandId,
|
|
3302
3403
|
sessionId: SessionId,
|
|
3303
3404
|
queueId: Schema.String,
|
|
3304
3405
|
input: ComposerInput
|
|
3305
3406
|
}),
|
|
3306
3407
|
success: QueuedMessage,
|
|
3307
|
-
error: Schema.Union([
|
|
3408
|
+
error: Schema.Union([
|
|
3409
|
+
SessionNotFoundError,
|
|
3410
|
+
QueuedMessageNotFoundError,
|
|
3411
|
+
QueuedMessageCapacityError
|
|
3412
|
+
])
|
|
3308
3413
|
});
|
|
3309
3414
|
const MessagesQueueDeleteRpc = Rpc.make("messages.queue.delete", {
|
|
3310
3415
|
payload: Schema.Struct({
|
|
3416
|
+
commandId: CommandId,
|
|
3311
3417
|
sessionId: SessionId,
|
|
3312
3418
|
queueId: Schema.String
|
|
3313
3419
|
}),
|
|
@@ -3320,6 +3426,7 @@ const MessagesQueueDeleteRpc = Rpc.make("messages.queue.delete", {
|
|
|
3320
3426
|
*/
|
|
3321
3427
|
const MessagesQueueRunNextRpc = Rpc.make("messages.queue.runNext", {
|
|
3322
3428
|
payload: Schema.Struct({
|
|
3429
|
+
commandId: CommandId,
|
|
3323
3430
|
sessionId: SessionId,
|
|
3324
3431
|
queueId: Schema.String
|
|
3325
3432
|
}),
|
|
@@ -3328,6 +3435,7 @@ const MessagesQueueRunNextRpc = Rpc.make("messages.queue.runNext", {
|
|
|
3328
3435
|
});
|
|
3329
3436
|
const MessagesQueueReorderRpc = Rpc.make("messages.queue.reorder", {
|
|
3330
3437
|
payload: Schema.Struct({
|
|
3438
|
+
commandId: CommandId,
|
|
3331
3439
|
sessionId: SessionId,
|
|
3332
3440
|
queueIds: Schema.Array(Schema.String)
|
|
3333
3441
|
}),
|
|
@@ -3335,12 +3443,18 @@ const MessagesQueueReorderRpc = Rpc.make("messages.queue.reorder", {
|
|
|
3335
3443
|
error: SessionNotFoundError
|
|
3336
3444
|
});
|
|
3337
3445
|
const MessagesQueueFlushRpc = Rpc.make("messages.queue.flush", {
|
|
3338
|
-
payload: Schema.Struct({
|
|
3446
|
+
payload: Schema.Struct({
|
|
3447
|
+
commandId: CommandId,
|
|
3448
|
+
sessionId: SessionId
|
|
3449
|
+
}),
|
|
3339
3450
|
success: Schema.Void,
|
|
3340
3451
|
error: SessionNotFoundError
|
|
3341
3452
|
});
|
|
3342
3453
|
const MessagesQueueResumeRpc = Rpc.make("messages.queue.resume", {
|
|
3343
|
-
payload: Schema.Struct({
|
|
3454
|
+
payload: Schema.Struct({
|
|
3455
|
+
commandId: CommandId,
|
|
3456
|
+
sessionId: SessionId
|
|
3457
|
+
}),
|
|
3344
3458
|
success: Schema.Void,
|
|
3345
3459
|
error: SessionNotFoundError
|
|
3346
3460
|
});
|
|
@@ -3361,6 +3475,7 @@ const SessionResumeRpc = Rpc.make("session.resume", {
|
|
|
3361
3475
|
*/
|
|
3362
3476
|
const SessionSetRuntimeModeRpc = Rpc.make("session.setRuntimeMode", {
|
|
3363
3477
|
payload: Schema.Struct({
|
|
3478
|
+
commandId: CommandId,
|
|
3364
3479
|
sessionId: SessionId,
|
|
3365
3480
|
runtimeMode: RuntimeMode
|
|
3366
3481
|
}),
|
|
@@ -3375,6 +3490,7 @@ const SessionSetRuntimeModeRpc = Rpc.make("session.setRuntimeMode", {
|
|
|
3375
3490
|
*/
|
|
3376
3491
|
const SessionSetPermissionModeRpc = Rpc.make("session.setPermissionMode", {
|
|
3377
3492
|
payload: Schema.Struct({
|
|
3493
|
+
commandId: CommandId,
|
|
3378
3494
|
sessionId: SessionId,
|
|
3379
3495
|
mode: PermissionMode
|
|
3380
3496
|
}),
|
|
@@ -3422,6 +3538,7 @@ const SessionEventsRpc = Rpc.make("session.events", {
|
|
|
3422
3538
|
payload: Schema.Struct({
|
|
3423
3539
|
sessionId: SessionId,
|
|
3424
3540
|
afterVersion: Schema.optional(Schema.Number),
|
|
3541
|
+
streamEpoch: Schema.optional(Schema.String),
|
|
3425
3542
|
hasProjection: Schema.optional(Schema.Boolean)
|
|
3426
3543
|
}),
|
|
3427
3544
|
success: SessionTimelineFrame,
|
|
@@ -3431,7 +3548,23 @@ const SessionEventsRpc = Rpc.make("session.events", {
|
|
|
3431
3548
|
/** Lightweight durable cursor used to detect an open-but-stalled event stream. */
|
|
3432
3549
|
const SessionEventsHeadRpc = Rpc.make("session.events.head", {
|
|
3433
3550
|
payload: Schema.Struct({ sessionId: SessionId }),
|
|
3434
|
-
success: Schema.Struct({
|
|
3551
|
+
success: Schema.Struct({
|
|
3552
|
+
throughVersion: Schema.Number,
|
|
3553
|
+
streamEpoch: Schema.optional(Schema.String)
|
|
3554
|
+
}),
|
|
3555
|
+
error: SessionNotFoundError
|
|
3556
|
+
});
|
|
3557
|
+
/** Older timeline messages, newest page first on the wire then rendered ascending. */
|
|
3558
|
+
const SessionMessagesPageRpc = Rpc.make("session.messages.page", {
|
|
3559
|
+
payload: Schema.Struct({
|
|
3560
|
+
sessionId: SessionId,
|
|
3561
|
+
beforeSequence: Schema.optional(Schema.Number),
|
|
3562
|
+
limit: Schema.optional(Schema.Number)
|
|
3563
|
+
}),
|
|
3564
|
+
success: Schema.Struct({
|
|
3565
|
+
messages: Schema.Array(Message),
|
|
3566
|
+
olderMessageSequence: Schema.NullOr(Schema.Number)
|
|
3567
|
+
}),
|
|
3435
3568
|
error: SessionNotFoundError
|
|
3436
3569
|
});
|
|
3437
3570
|
const SessionGoalGetRpc = Rpc.make("session.goal.get", {
|
|
@@ -3882,7 +4015,6 @@ const CloudWorkspaceState = Schema.Literals([
|
|
|
3882
4015
|
"resuming",
|
|
3883
4016
|
"archiving",
|
|
3884
4017
|
"archived",
|
|
3885
|
-
"recovering",
|
|
3886
4018
|
"deleting",
|
|
3887
4019
|
"deleted",
|
|
3888
4020
|
"failed"
|
|
@@ -4004,9 +4136,7 @@ var CloudWorkspace = class extends Schema.Class("CloudWorkspace")({
|
|
|
4004
4136
|
initialSessionId: AgentSessionId,
|
|
4005
4137
|
createdAt: Schema.Number,
|
|
4006
4138
|
updatedAt: Schema.Number,
|
|
4007
|
-
lastActivityAt: Schema.Number
|
|
4008
|
-
warmRetentionDeadline: Schema.optional(Schema.Number),
|
|
4009
|
-
recoveryAvailable: Schema.Boolean
|
|
4139
|
+
lastActivityAt: Schema.Number
|
|
4010
4140
|
}) {};
|
|
4011
4141
|
var CloudWorkspaceLaunch = class extends Schema.Class("CloudWorkspaceLaunch")({
|
|
4012
4142
|
workspace: CloudWorkspace,
|
|
@@ -4017,47 +4147,19 @@ var CloudWorkspaceConnection = class extends Schema.Class("CloudWorkspaceConnect
|
|
|
4017
4147
|
workspaceId: Schema.String,
|
|
4018
4148
|
wsUrl: Schema.String,
|
|
4019
4149
|
protocol: Schema.String,
|
|
4150
|
+
role: Schema.Literal("client"),
|
|
4151
|
+
generation: Schema.Number,
|
|
4152
|
+
gatewayEpoch: Schema.Number,
|
|
4020
4153
|
credential: Schema.String,
|
|
4021
4154
|
expiresAt: Schema.Number
|
|
4022
4155
|
}) {};
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
createdAt: Schema.Number
|
|
4031
|
-
}) {};
|
|
4032
|
-
var CloudChatQueuedMessage = class extends Schema.Class("CloudChatQueuedMessage")({
|
|
4033
|
-
sequence: Schema.optional(Schema.Number),
|
|
4034
|
-
clientMessageId: MessageId,
|
|
4035
|
-
input: ComposerInput,
|
|
4036
|
-
state: Schema.Literals([
|
|
4037
|
-
"queued",
|
|
4038
|
-
"claimed",
|
|
4039
|
-
"acknowledged",
|
|
4040
|
-
"failed"
|
|
4041
|
-
]),
|
|
4042
|
-
asGoal: Schema.Boolean,
|
|
4043
|
-
createdAt: Schema.Number
|
|
4044
|
-
}) {};
|
|
4045
|
-
var CloudChatHistory = class extends Schema.Class("CloudChatHistory")({
|
|
4046
|
-
workspaceId: Schema.String,
|
|
4047
|
-
chatId: ChatId,
|
|
4048
|
-
initialSessionId: AgentSessionId,
|
|
4049
|
-
firstMessage: Schema.optional(Schema.String),
|
|
4050
|
-
commandState: Schema.Literals([
|
|
4051
|
-
"queued",
|
|
4052
|
-
"claimed",
|
|
4053
|
-
"acknowledged",
|
|
4054
|
-
"failed"
|
|
4055
|
-
]),
|
|
4056
|
-
events: Schema.Array(CloudChatEvent),
|
|
4057
|
-
queuedMessages: Schema.Array(CloudChatQueuedMessage),
|
|
4058
|
-
cursor: Schema.Number
|
|
4059
|
-
}) {};
|
|
4060
|
-
/** Durable cloud-chat metadata that is available without a live sandbox. */
|
|
4156
|
+
Schema.Class("CloudWorkspaceRuntimeSummary")({
|
|
4157
|
+
summaryRevision: Schema.Number,
|
|
4158
|
+
title: Schema.String,
|
|
4159
|
+
lastActivityAt: Schema.Number,
|
|
4160
|
+
sessionHeadVersion: Schema.Number
|
|
4161
|
+
});
|
|
4162
|
+
/** Last-known cloud workspace metadata available without a live runtime. */
|
|
4061
4163
|
var CloudChatSummary = class extends Schema.Class("CloudChatSummary")({
|
|
4062
4164
|
workspaceId: Schema.String,
|
|
4063
4165
|
projectId: Schema.String,
|
|
@@ -4076,16 +4178,69 @@ var CloudChatSummary = class extends Schema.Class("CloudChatSummary")({
|
|
|
4076
4178
|
statusCode: Schema.String,
|
|
4077
4179
|
startupPhase: CloudWorkspaceStartupPhase,
|
|
4078
4180
|
revision: Schema.Number,
|
|
4181
|
+
/** Monotonic within the current runtime generation. */
|
|
4182
|
+
summaryRevision: Schema.Number.pipe(Schema.withConstructorDefault(Effect.succeed(0)), Schema.withDecodingDefaultType(Effect.succeed(0))),
|
|
4183
|
+
/** Authoritative runtime session head represented by this summary. */
|
|
4184
|
+
sessionHeadVersion: Schema.Number.pipe(Schema.withConstructorDefault(Effect.succeed(0)), Schema.withDecodingDefaultType(Effect.succeed(0))),
|
|
4079
4185
|
unread: Schema.Boolean,
|
|
4080
4186
|
lastMessageAt: Schema.NullOr(Schema.Number),
|
|
4081
4187
|
archivedAt: Schema.optional(Schema.Number),
|
|
4082
|
-
archivePhase: Schema.optional(Schema.String),
|
|
4083
|
-
archiveErrorCode: Schema.optional(Schema.String),
|
|
4084
|
-
archiveDiagnostic: Schema.optional(Schema.String),
|
|
4085
4188
|
createdAt: Schema.Number,
|
|
4086
4189
|
updatedAt: Schema.Number
|
|
4087
4190
|
}) {};
|
|
4088
4191
|
var CloudChatList = class extends Schema.Class("CloudChatList")({ chats: Schema.Array(CloudChatSummary) }) {};
|
|
4192
|
+
Schema.Class("CloudTranscriptCheckpointPayload")({
|
|
4193
|
+
schemaVersion: Schema.Literal(1),
|
|
4194
|
+
workspaceId: Schema.String,
|
|
4195
|
+
sessionId: AgentSessionId,
|
|
4196
|
+
cursor: SessionStreamCursor,
|
|
4197
|
+
projection: SessionTimelineProjection
|
|
4198
|
+
});
|
|
4199
|
+
var CloudTranscriptCheckpointMetadata = class extends Schema.Class("CloudTranscriptCheckpointMetadata")({
|
|
4200
|
+
workspaceId: Schema.String,
|
|
4201
|
+
sessionId: AgentSessionId,
|
|
4202
|
+
runtimeGeneration: Schema.Number,
|
|
4203
|
+
cursor: SessionStreamCursor,
|
|
4204
|
+
objectKey: Schema.String,
|
|
4205
|
+
ciphertextSha256: Schema.String,
|
|
4206
|
+
ciphertextBytes: Schema.Number,
|
|
4207
|
+
createdAt: Schema.Number
|
|
4208
|
+
}) {};
|
|
4209
|
+
Schema.Class("CloudTranscriptCheckpointUpload")({
|
|
4210
|
+
sessionId: AgentSessionId,
|
|
4211
|
+
cursor: SessionStreamCursor,
|
|
4212
|
+
ciphertext: Schema.String,
|
|
4213
|
+
ciphertextSha256: Schema.String
|
|
4214
|
+
});
|
|
4215
|
+
var CloudTranscriptCheckpointAccess = class extends Schema.Class("CloudTranscriptCheckpointAccess")({
|
|
4216
|
+
metadata: CloudTranscriptCheckpointMetadata,
|
|
4217
|
+
ciphertext: Schema.String,
|
|
4218
|
+
transcriptKey: Schema.String
|
|
4219
|
+
}) {};
|
|
4220
|
+
var CloudTranscriptCheckpointResult = class extends Schema.Class("CloudTranscriptCheckpointResult")({ checkpoint: Schema.NullOr(CloudTranscriptCheckpointAccess) }) {};
|
|
4221
|
+
Schema.Class("CloudTranscriptMessagePagePayload")({
|
|
4222
|
+
schemaVersion: Schema.Literal(1),
|
|
4223
|
+
workspaceId: Schema.String,
|
|
4224
|
+
sessionId: AgentSessionId,
|
|
4225
|
+
cursor: SessionStreamCursor,
|
|
4226
|
+
beforeSequence: Schema.Number,
|
|
4227
|
+
messages: Schema.Array(Message),
|
|
4228
|
+
olderMessageSequence: Schema.NullOr(Schema.Number)
|
|
4229
|
+
});
|
|
4230
|
+
Schema.Class("CloudTranscriptMessagePageUpload")({
|
|
4231
|
+
sessionId: AgentSessionId,
|
|
4232
|
+
cursor: SessionStreamCursor,
|
|
4233
|
+
beforeSequence: Schema.Number,
|
|
4234
|
+
ciphertext: Schema.String,
|
|
4235
|
+
ciphertextSha256: Schema.String
|
|
4236
|
+
});
|
|
4237
|
+
var CloudTranscriptMessagePageResult = class extends Schema.Class("CloudTranscriptMessagePageResult")({ page: Schema.NullOr(Schema.Struct({
|
|
4238
|
+
cursor: SessionStreamCursor,
|
|
4239
|
+
beforeSequence: Schema.Number,
|
|
4240
|
+
ciphertext: Schema.String,
|
|
4241
|
+
ciphertextSha256: Schema.String,
|
|
4242
|
+
transcriptKey: Schema.String
|
|
4243
|
+
})) }) {};
|
|
4089
4244
|
var CloudWorkspaceList = class extends Schema.Class("CloudWorkspaceList")({ workspaces: Schema.Array(CloudWorkspace) }) {};
|
|
4090
4245
|
var CloudWorkspaceCreateRequest = class extends Schema.Class("CloudWorkspaceCreateRequest")({
|
|
4091
4246
|
projectId: Schema.String,
|
|
@@ -4100,7 +4255,29 @@ var CloudWorkspaceCreateRequest = class extends Schema.Class("CloudWorkspaceCrea
|
|
|
4100
4255
|
firstMessage: Schema.optional(Schema.String),
|
|
4101
4256
|
idempotencyKey: Schema.String
|
|
4102
4257
|
}) {};
|
|
4103
|
-
var CloudWorkspaceActionRequest = class extends Schema.Class("CloudWorkspaceActionRequest")({
|
|
4258
|
+
var CloudWorkspaceActionRequest = class extends Schema.Class("CloudWorkspaceActionRequest")({
|
|
4259
|
+
workspaceId: Schema.String,
|
|
4260
|
+
commandId: Schema.optional(Schema.String)
|
|
4261
|
+
}) {};
|
|
4262
|
+
var CloudWorkspaceResumeRequest = class extends Schema.Class("CloudWorkspaceResumeRequest")({
|
|
4263
|
+
workspaceId: Schema.String,
|
|
4264
|
+
commandId: Schema.optional(Schema.String),
|
|
4265
|
+
/** The gateway proved that Relay's online projection has no runtime socket. */
|
|
4266
|
+
recoverRuntime: Schema.optional(Schema.Boolean)
|
|
4267
|
+
}) {};
|
|
4268
|
+
/**
|
|
4269
|
+
* A short-lived grant for the workspace runtime's WebSocket SSH bridge. The
|
|
4270
|
+
* relay stages the hashed ticket inside the sandbox; the desktop's
|
|
4271
|
+
* ProxyCommand bridge presents the plain ticket when it connects to `wsUrl`.
|
|
4272
|
+
*/
|
|
4273
|
+
var CloudWorkspaceSshAccess = class extends Schema.Class("CloudWorkspaceSshAccess")({
|
|
4274
|
+
workspaceId: Schema.String,
|
|
4275
|
+
wsUrl: Schema.String,
|
|
4276
|
+
ticket: Schema.String,
|
|
4277
|
+
expiresAt: Schema.Number,
|
|
4278
|
+
user: Schema.String,
|
|
4279
|
+
workspacePath: Schema.String
|
|
4280
|
+
}) {};
|
|
4104
4281
|
var CloudCredentialConnection = class extends Schema.Class("CloudCredentialConnection")({
|
|
4105
4282
|
kind: CloudCredentialKind,
|
|
4106
4283
|
state: Schema.Literals([
|
|
@@ -4134,7 +4311,8 @@ var CloudWorkspaceOpError = class extends Schema.TaggedErrorClass()("CloudWorksp
|
|
|
4134
4311
|
"project-not-ready",
|
|
4135
4312
|
"credential-required",
|
|
4136
4313
|
"branch-in-use",
|
|
4137
|
-
"conflict"
|
|
4314
|
+
"conflict",
|
|
4315
|
+
"billing-hold"
|
|
4138
4316
|
]) }) {};
|
|
4139
4317
|
const CloudProvidersRpc = Rpc.make("cloud.providers", {
|
|
4140
4318
|
payload: Schema.Void,
|
|
@@ -4166,6 +4344,19 @@ const CloudWorkspacesGetRpc = Rpc.make("cloud.workspaces.get", {
|
|
|
4166
4344
|
success: CloudWorkspace,
|
|
4167
4345
|
error: CloudWorkspaceOpError
|
|
4168
4346
|
});
|
|
4347
|
+
/**
|
|
4348
|
+
* One monotonic lifecycle control stream for a workspace. The server adapts
|
|
4349
|
+
* Relay's current REST surface; clients never own lifecycle polling loops.
|
|
4350
|
+
*/
|
|
4351
|
+
const CloudWorkspacesWatchRpc = Rpc.make("cloud.workspaces.watch", {
|
|
4352
|
+
payload: Schema.Struct({
|
|
4353
|
+
workspaceId: Schema.String,
|
|
4354
|
+
afterRevision: Schema.optional(Schema.Number)
|
|
4355
|
+
}),
|
|
4356
|
+
success: CloudWorkspace,
|
|
4357
|
+
error: CloudWorkspaceOpError,
|
|
4358
|
+
stream: true
|
|
4359
|
+
});
|
|
4169
4360
|
const CloudWorkspacesCreateRpc = Rpc.make("cloud.workspaces.create", {
|
|
4170
4361
|
payload: CloudWorkspaceCreateRequest,
|
|
4171
4362
|
success: CloudWorkspaceLaunch,
|
|
@@ -4176,14 +4367,6 @@ const CloudWorkspacesConnectRpc = Rpc.make("cloud.workspaces.connect", {
|
|
|
4176
4367
|
success: CloudWorkspaceConnection,
|
|
4177
4368
|
error: CloudWorkspaceOpError
|
|
4178
4369
|
});
|
|
4179
|
-
const CloudChatsHistoryRpc = Rpc.make("cloud.chats.history", {
|
|
4180
|
-
payload: Schema.Struct({
|
|
4181
|
-
workspaceId: Schema.String,
|
|
4182
|
-
after: Schema.optional(Schema.Number)
|
|
4183
|
-
}),
|
|
4184
|
-
success: CloudChatHistory,
|
|
4185
|
-
error: CloudWorkspaceOpError
|
|
4186
|
-
});
|
|
4187
4370
|
const CloudChatsListRpc = Rpc.make("cloud.chats.list", {
|
|
4188
4371
|
payload: Schema.Struct({
|
|
4189
4372
|
projectId: Schema.optional(Schema.String),
|
|
@@ -4196,32 +4379,25 @@ const CloudChatsListRpc = Rpc.make("cloud.chats.list", {
|
|
|
4196
4379
|
success: CloudChatList,
|
|
4197
4380
|
error: CloudWorkspaceOpError
|
|
4198
4381
|
});
|
|
4199
|
-
const
|
|
4200
|
-
payload:
|
|
4201
|
-
|
|
4202
|
-
title: Schema.String
|
|
4203
|
-
}),
|
|
4204
|
-
success: CloudChatSummary,
|
|
4382
|
+
const CloudWorkspacesPauseRpc = Rpc.make("cloud.workspaces.pause", {
|
|
4383
|
+
payload: CloudWorkspaceActionRequest,
|
|
4384
|
+
success: CloudWorkspace,
|
|
4205
4385
|
error: CloudWorkspaceOpError
|
|
4206
4386
|
});
|
|
4207
|
-
const
|
|
4208
|
-
payload:
|
|
4209
|
-
|
|
4210
|
-
input: ComposerInput,
|
|
4211
|
-
clientMessageId: MessageId,
|
|
4212
|
-
asGoal: Schema.optional(Schema.Boolean)
|
|
4213
|
-
}),
|
|
4214
|
-
success: Schema.Struct({ sequence: Schema.Number }),
|
|
4387
|
+
const CloudWorkspacesResumeRpc = Rpc.make("cloud.workspaces.resume", {
|
|
4388
|
+
payload: CloudWorkspaceResumeRequest,
|
|
4389
|
+
success: CloudWorkspace,
|
|
4215
4390
|
error: CloudWorkspaceOpError
|
|
4216
4391
|
});
|
|
4217
|
-
|
|
4392
|
+
/** Restart the runtime of a running workspace in place (same sandbox). */
|
|
4393
|
+
const CloudWorkspacesRestartRpc = Rpc.make("cloud.workspaces.restart", {
|
|
4218
4394
|
payload: CloudWorkspaceActionRequest,
|
|
4219
4395
|
success: CloudWorkspace,
|
|
4220
4396
|
error: CloudWorkspaceOpError
|
|
4221
4397
|
});
|
|
4222
|
-
const
|
|
4398
|
+
const CloudWorkspacesSshAccessRpc = Rpc.make("cloud.workspaces.sshAccess", {
|
|
4223
4399
|
payload: CloudWorkspaceActionRequest,
|
|
4224
|
-
success:
|
|
4400
|
+
success: CloudWorkspaceSshAccess,
|
|
4225
4401
|
error: CloudWorkspaceOpError
|
|
4226
4402
|
});
|
|
4227
4403
|
const CloudWorkspacesArchiveRpc = Rpc.make("cloud.workspaces.archive", {
|
|
@@ -4239,6 +4415,25 @@ const CloudWorkspacesDeleteRpc = Rpc.make("cloud.workspaces.delete", {
|
|
|
4239
4415
|
success: CloudWorkspace,
|
|
4240
4416
|
error: CloudWorkspaceOpError
|
|
4241
4417
|
});
|
|
4418
|
+
const CloudTranscriptCheckpointGetRpc = Rpc.make("cloud.transcript.get", {
|
|
4419
|
+
payload: Schema.Struct({
|
|
4420
|
+
workspaceId: Schema.String,
|
|
4421
|
+
sessionId: AgentSessionId,
|
|
4422
|
+
cursor: Schema.optional(SessionStreamCursor)
|
|
4423
|
+
}),
|
|
4424
|
+
success: CloudTranscriptCheckpointResult,
|
|
4425
|
+
error: CloudWorkspaceOpError
|
|
4426
|
+
});
|
|
4427
|
+
const CloudTranscriptMessagePageGetRpc = Rpc.make("cloud.transcript.messages.page", {
|
|
4428
|
+
payload: Schema.Struct({
|
|
4429
|
+
workspaceId: Schema.String,
|
|
4430
|
+
sessionId: AgentSessionId,
|
|
4431
|
+
cursor: SessionStreamCursor,
|
|
4432
|
+
beforeSequence: Schema.Number
|
|
4433
|
+
}),
|
|
4434
|
+
success: CloudTranscriptMessagePageResult,
|
|
4435
|
+
error: CloudWorkspaceOpError
|
|
4436
|
+
});
|
|
4242
4437
|
const CloudCredentialsListRpc = Rpc.make("cloud.credentials.list", {
|
|
4243
4438
|
payload: Schema.Void,
|
|
4244
4439
|
success: CloudCredentialList,
|
|
@@ -4255,158 +4450,80 @@ const CloudCredentialsDisconnectRpc = Rpc.make("cloud.credentials.disconnect", {
|
|
|
4255
4450
|
error: CloudWorkspaceOpError
|
|
4256
4451
|
});
|
|
4257
4452
|
//#endregion
|
|
4258
|
-
//#region ../contracts/src/
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
const IndexState = Schema.Literals([
|
|
4266
|
-
"idle",
|
|
4267
|
-
"indexing",
|
|
4268
|
-
"ready",
|
|
4269
|
-
"error"
|
|
4270
|
-
]);
|
|
4271
|
-
const IndexProgress = Schema.NullOr(Schema.Struct({
|
|
4272
|
-
processed: Schema.Number,
|
|
4273
|
-
total: Schema.Number
|
|
4274
|
-
}));
|
|
4275
|
-
const IndexStats = Schema.Struct({
|
|
4276
|
-
blobs: Schema.Number,
|
|
4277
|
-
chunks: Schema.Number,
|
|
4278
|
-
symbols: Schema.Number,
|
|
4279
|
-
refs: Schema.Number
|
|
4280
|
-
});
|
|
4281
|
-
var IndexStatusInfo = class extends Schema.Class("IndexStatusInfo")({
|
|
4282
|
-
state: IndexState,
|
|
4283
|
-
branch: Schema.NullOr(Schema.String),
|
|
4284
|
-
progress: IndexProgress,
|
|
4285
|
-
stats: IndexStats
|
|
4286
|
-
}) {};
|
|
4287
|
-
const SymbolKind = Schema.Literals([
|
|
4288
|
-
"function",
|
|
4289
|
-
"method",
|
|
4290
|
-
"class",
|
|
4291
|
-
"interface",
|
|
4292
|
-
"type",
|
|
4293
|
-
"enum",
|
|
4294
|
-
"const",
|
|
4295
|
-
"variable",
|
|
4296
|
-
"property",
|
|
4297
|
-
"export"
|
|
4298
|
-
]);
|
|
4299
|
-
const Range = Schema.Struct({
|
|
4300
|
-
start: Schema.Number,
|
|
4301
|
-
end: Schema.Number
|
|
4302
|
-
});
|
|
4303
|
-
const SearchKind = Schema.Literals([
|
|
4304
|
-
"auto",
|
|
4305
|
-
"symbol",
|
|
4306
|
-
"text",
|
|
4307
|
-
"semantic"
|
|
4453
|
+
//#region ../contracts/src/cloud-billing.ts
|
|
4454
|
+
const CloudBillingStatus = Schema.Literals([
|
|
4455
|
+
"active",
|
|
4456
|
+
"grace",
|
|
4457
|
+
"billing-hold",
|
|
4458
|
+
"ended",
|
|
4459
|
+
"manual"
|
|
4308
4460
|
]);
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4461
|
+
var CloudBillingSummary = class extends Schema.Class("CloudBillingSummary")({
|
|
4462
|
+
currency: Schema.Literal("USD"),
|
|
4463
|
+
status: CloudBillingStatus,
|
|
4464
|
+
periodStart: Schema.Number,
|
|
4465
|
+
periodEnd: Schema.Number,
|
|
4466
|
+
basePriceMicros: Schema.Number,
|
|
4467
|
+
includedProviderCostMicros: Schema.Number,
|
|
4468
|
+
providerCostMicros: Schema.Number,
|
|
4469
|
+
includedUsedMicros: Schema.Number,
|
|
4470
|
+
includedRemainingMicros: Schema.Number,
|
|
4471
|
+
overageProviderCostMicros: Schema.Number,
|
|
4472
|
+
overageChargeMicros: Schema.Number,
|
|
4473
|
+
overageCapMicros: Schema.Number,
|
|
4474
|
+
markupBasisPoints: Schema.Number,
|
|
4475
|
+
currentInvoiceEstimateMicros: Schema.Number,
|
|
4476
|
+
lastProviderReconciledAt: Schema.optional(Schema.Number),
|
|
4477
|
+
lastPolarReconciledAt: Schema.optional(Schema.Number),
|
|
4478
|
+
usageProvisional: Schema.Boolean
|
|
4479
|
+
}) {};
|
|
4480
|
+
var CloudBillingUsageItem = class extends Schema.Class("CloudBillingUsageItem")({
|
|
4481
|
+
entryId: Schema.String,
|
|
4482
|
+
resourceKind: Schema.Literals([
|
|
4483
|
+
"workspace",
|
|
4484
|
+
"build",
|
|
4485
|
+
"other"
|
|
4486
|
+
]),
|
|
4487
|
+
resourceId: Schema.String,
|
|
4488
|
+
provider: Schema.String,
|
|
4489
|
+
providerExecutionId: Schema.optional(Schema.String),
|
|
4490
|
+
startedAt: Schema.Number,
|
|
4491
|
+
endedAt: Schema.Number,
|
|
4492
|
+
vcpuCount: Schema.Number,
|
|
4493
|
+
memoryMib: Schema.Number,
|
|
4494
|
+
providerCostMicros: Schema.Number,
|
|
4495
|
+
status: Schema.Literals([
|
|
4496
|
+
"provisional",
|
|
4497
|
+
"confirmed",
|
|
4498
|
+
"corrected"
|
|
4324
4499
|
])
|
|
4500
|
+
}) {};
|
|
4501
|
+
var CloudBillingUsagePage = class extends Schema.Class("CloudBillingUsagePage")({
|
|
4502
|
+
items: Schema.Array(CloudBillingUsageItem),
|
|
4503
|
+
nextCursor: Schema.optional(Schema.String)
|
|
4504
|
+
}) {};
|
|
4505
|
+
var CloudBillingUsageRequest = class extends Schema.Class("CloudBillingUsageRequest")({
|
|
4506
|
+
cursor: Schema.optional(Schema.String),
|
|
4507
|
+
limit: Schema.optional(Schema.Number)
|
|
4508
|
+
}) {};
|
|
4509
|
+
var CloudBillingCapRequest = class extends Schema.Class("CloudBillingCapRequest")({
|
|
4510
|
+
overageCapMicros: Schema.Number,
|
|
4511
|
+
idempotencyKey: Schema.String
|
|
4512
|
+
}) {};
|
|
4513
|
+
const CloudBillingSummaryRpc = Rpc.make("cloud.billing.summary", {
|
|
4514
|
+
payload: Schema.Void,
|
|
4515
|
+
success: CloudBillingSummary,
|
|
4516
|
+
error: CloudWorkspaceOpError
|
|
4325
4517
|
});
|
|
4326
|
-
const
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
kind: SymbolKind,
|
|
4331
|
-
signature: Schema.NullOr(Schema.String),
|
|
4332
|
-
file: Schema.String,
|
|
4333
|
-
range: Range,
|
|
4334
|
-
exported: Schema.Boolean
|
|
4335
|
-
});
|
|
4336
|
-
const RefHit = Schema.Struct({
|
|
4337
|
-
refId: Schema.Number,
|
|
4338
|
-
file: Schema.String,
|
|
4339
|
-
range: Range,
|
|
4340
|
-
context: Schema.String
|
|
4341
|
-
});
|
|
4342
|
-
const ChunkContent = Schema.NullOr(Schema.Struct({
|
|
4343
|
-
chunkId: Schema.Number,
|
|
4344
|
-
file: Schema.String,
|
|
4345
|
-
content: Schema.String,
|
|
4346
|
-
range: Range
|
|
4347
|
-
}));
|
|
4348
|
-
const SymbolSummary = Schema.Struct({
|
|
4349
|
-
name: Schema.String,
|
|
4350
|
-
kind: SymbolKind,
|
|
4351
|
-
signature: Schema.NullOr(Schema.String),
|
|
4352
|
-
startLine: Schema.Number,
|
|
4353
|
-
exported: Schema.Boolean
|
|
4354
|
-
});
|
|
4355
|
-
Rpc.make("index.status", {
|
|
4356
|
-
payload: Schema.Struct({ folderId: FolderId }),
|
|
4357
|
-
success: IndexStatusInfo
|
|
4358
|
-
});
|
|
4359
|
-
Rpc.make("index.statusStream", {
|
|
4360
|
-
payload: Schema.Struct({ folderId: FolderId }),
|
|
4361
|
-
success: IndexStatusInfo,
|
|
4362
|
-
stream: true
|
|
4363
|
-
});
|
|
4364
|
-
Rpc.make("index.reindex", {
|
|
4365
|
-
payload: Schema.Struct({ folderId: FolderId }),
|
|
4366
|
-
success: IndexStatusInfo
|
|
4367
|
-
});
|
|
4368
|
-
Rpc.make("index.search", {
|
|
4369
|
-
payload: Schema.Struct({
|
|
4370
|
-
folderId: FolderId,
|
|
4371
|
-
query: Schema.String,
|
|
4372
|
-
kind: Schema.optional(SearchKind),
|
|
4373
|
-
limit: Schema.optional(Schema.Number),
|
|
4374
|
-
pathGlob: Schema.optional(Schema.String)
|
|
4375
|
-
}),
|
|
4376
|
-
success: Schema.Array(SearchHit)
|
|
4377
|
-
});
|
|
4378
|
-
Rpc.make("index.symbolLookup", {
|
|
4379
|
-
payload: Schema.Struct({
|
|
4380
|
-
folderId: FolderId,
|
|
4381
|
-
name: Schema.String,
|
|
4382
|
-
kind: Schema.optional(Schema.String),
|
|
4383
|
-
limit: Schema.optional(Schema.Number),
|
|
4384
|
-
pathGlob: Schema.optional(Schema.String)
|
|
4385
|
-
}),
|
|
4386
|
-
success: Schema.Array(SymbolHit)
|
|
4387
|
-
});
|
|
4388
|
-
Rpc.make("index.findReferences", {
|
|
4389
|
-
payload: Schema.Struct({
|
|
4390
|
-
folderId: FolderId,
|
|
4391
|
-
symbol: Schema.String,
|
|
4392
|
-
limit: Schema.optional(Schema.Number),
|
|
4393
|
-
pathGlob: Schema.optional(Schema.String)
|
|
4394
|
-
}),
|
|
4395
|
-
success: Schema.Array(RefHit)
|
|
4396
|
-
});
|
|
4397
|
-
Rpc.make("index.readChunk", {
|
|
4398
|
-
payload: Schema.Struct({
|
|
4399
|
-
folderId: FolderId,
|
|
4400
|
-
chunkId: Schema.Number
|
|
4401
|
-
}),
|
|
4402
|
-
success: ChunkContent
|
|
4518
|
+
const CloudBillingUsageRpc = Rpc.make("cloud.billing.usage", {
|
|
4519
|
+
payload: CloudBillingUsageRequest,
|
|
4520
|
+
success: CloudBillingUsagePage,
|
|
4521
|
+
error: CloudWorkspaceOpError
|
|
4403
4522
|
});
|
|
4404
|
-
Rpc.make("
|
|
4405
|
-
payload:
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
}),
|
|
4409
|
-
success: Schema.Array(SymbolSummary)
|
|
4523
|
+
const CloudBillingSetCapRpc = Rpc.make("cloud.billing.setCap", {
|
|
4524
|
+
payload: CloudBillingCapRequest,
|
|
4525
|
+
success: CloudBillingSummary,
|
|
4526
|
+
error: CloudWorkspaceOpError
|
|
4410
4527
|
});
|
|
4411
4528
|
//#endregion
|
|
4412
4529
|
//#region ../contracts/src/connect.ts
|
|
@@ -4901,6 +5018,7 @@ var GithubRepoSummary = class extends Schema.Class("GithubRepoSummary")({
|
|
|
4901
5018
|
sshUrl: Schema.String,
|
|
4902
5019
|
httpsUrl: Schema.String,
|
|
4903
5020
|
isPrivate: Schema.Boolean,
|
|
5021
|
+
defaultBranch: Schema.String,
|
|
4904
5022
|
updatedAt: Schema.DateFromString
|
|
4905
5023
|
}) {};
|
|
4906
5024
|
/**
|
|
@@ -5177,9 +5295,18 @@ const GitUserNameRpc = Rpc.make("git.userName", {
|
|
|
5177
5295
|
success: Schema.Struct({ userName: Schema.String }),
|
|
5178
5296
|
error: GitErrors
|
|
5179
5297
|
});
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
|
|
5298
|
+
/**
|
|
5299
|
+
* Coalesced invalidation for one explicit repository checkout. The first
|
|
5300
|
+
* frame is emitted immediately, then filesystem/index/HEAD changes advance a
|
|
5301
|
+
* monotonic revision. Clients re-read their materialized Git resource after
|
|
5302
|
+
* each revision; no transcript or patch payload is duplicated in this stream.
|
|
5303
|
+
*/
|
|
5304
|
+
const GitWorkspaceChangesRpc = Rpc.make("git.workspaceChanges", {
|
|
5305
|
+
payload: Schema.Struct({
|
|
5306
|
+
folderId: FolderId,
|
|
5307
|
+
worktreeId: Schema.optional(Schema.NullOr(WorktreeId))
|
|
5308
|
+
}),
|
|
5309
|
+
success: Schema.Struct({ revision: Schema.Number }),
|
|
5183
5310
|
error: GitErrors,
|
|
5184
5311
|
stream: true
|
|
5185
5312
|
});
|
|
@@ -5731,26 +5858,6 @@ const GitRevertAllRpc = Rpc.make("git.revertAll", {
|
|
|
5731
5858
|
success: Schema.Struct({ reverted: Schema.Boolean }),
|
|
5732
5859
|
error: GitErrors
|
|
5733
5860
|
});
|
|
5734
|
-
/**
|
|
5735
|
-
* Total additions/deletions of a worktree's branch — including uncommitted
|
|
5736
|
-
* working-tree edits — relative to its base branch. Computed as
|
|
5737
|
-
* `git diff --numstat <merge-base(base, HEAD)>`, where `base` is the repo's
|
|
5738
|
-
* default branch (`origin/HEAD`, falling back to origin/main, main, …). Drives
|
|
5739
|
-
* the projects sidebar's per-chat `+N −N` stats so a branch shows its diff
|
|
5740
|
-
* even before a PR is opened. Returns zeros rather than failing when there's
|
|
5741
|
-
* no base, no commits, or no diff.
|
|
5742
|
-
*/
|
|
5743
|
-
const GitDiffStatRpc = Rpc.make("git.diffStat", {
|
|
5744
|
-
payload: Schema.Struct({
|
|
5745
|
-
folderId: FolderId,
|
|
5746
|
-
worktreeId: Schema.optional(Schema.NullOr(WorktreeId))
|
|
5747
|
-
}),
|
|
5748
|
-
success: Schema.Struct({
|
|
5749
|
-
additions: Schema.Number,
|
|
5750
|
-
deletions: Schema.Number
|
|
5751
|
-
}),
|
|
5752
|
-
error: GitErrors
|
|
5753
|
-
});
|
|
5754
5861
|
//#endregion
|
|
5755
5862
|
//#region ../contracts/src/handshake.ts
|
|
5756
5863
|
var WireHello = class extends Schema.Class("WireHello")({ protocolVersion: Schema.Number }) {};
|
|
@@ -6289,6 +6396,23 @@ const MachineRuntimeUpdateRpc = Rpc.make("machine.runtime.update", {
|
|
|
6289
6396
|
success: MachineRuntimeStatus,
|
|
6290
6397
|
error: MachineOpError
|
|
6291
6398
|
});
|
|
6399
|
+
var MachineResourceSample = class extends Schema.Class("MachineResourceSample")({
|
|
6400
|
+
sampledAt: Schema.Number,
|
|
6401
|
+
cpuCores: Schema.Number,
|
|
6402
|
+
cpuPercent: Schema.Number,
|
|
6403
|
+
memTotalBytes: Schema.Number,
|
|
6404
|
+
memUsedBytes: Schema.Number,
|
|
6405
|
+
diskTotalBytes: Schema.Number,
|
|
6406
|
+
diskUsedBytes: Schema.Number,
|
|
6407
|
+
/** Filesystem the disk numbers describe (the workspace root when present). */
|
|
6408
|
+
diskPath: Schema.String
|
|
6409
|
+
}) {};
|
|
6410
|
+
const MachineResourcesWatchRpc = Rpc.make("machine.resources.watch", {
|
|
6411
|
+
payload: Schema.Struct({ intervalMs: Schema.optional(Schema.Number) }),
|
|
6412
|
+
success: MachineResourceSample,
|
|
6413
|
+
error: MachineOpError,
|
|
6414
|
+
stream: true
|
|
6415
|
+
});
|
|
6292
6416
|
const AccountAccessProvider = Schema.Literals([
|
|
6293
6417
|
"github",
|
|
6294
6418
|
"claude",
|
|
@@ -6745,6 +6869,20 @@ var SavedDecision = class extends Schema.Class("SavedDecision")({
|
|
|
6745
6869
|
decidedAt: Schema.DateFromString
|
|
6746
6870
|
}) {};
|
|
6747
6871
|
var PermissionRequestNotFoundError = class extends Schema.TaggedErrorClass()("PermissionRequestNotFoundError", { requestId: Schema.String }) {};
|
|
6872
|
+
const PermissionRequestChange = Schema.Union([
|
|
6873
|
+
Schema.Struct({
|
|
6874
|
+
_tag: Schema.Literal("snapshot"),
|
|
6875
|
+
requests: Schema.Array(PermissionRequest)
|
|
6876
|
+
}),
|
|
6877
|
+
Schema.Struct({
|
|
6878
|
+
_tag: Schema.Literal("change"),
|
|
6879
|
+
request: PermissionRequest
|
|
6880
|
+
}),
|
|
6881
|
+
Schema.Struct({
|
|
6882
|
+
_tag: Schema.Literal("remove"),
|
|
6883
|
+
requestId: Schema.String
|
|
6884
|
+
})
|
|
6885
|
+
]);
|
|
6748
6886
|
/**
|
|
6749
6887
|
* Live stream of pending requests across every session. The renderer
|
|
6750
6888
|
* filters by selected session; broadcasting once and filtering on the
|
|
@@ -6753,7 +6891,7 @@ var PermissionRequestNotFoundError = class extends Schema.TaggedErrorClass()("Pe
|
|
|
6753
6891
|
*/
|
|
6754
6892
|
const PermissionRequestsRpc = Rpc.make("permission.requests", {
|
|
6755
6893
|
payload: Schema.Struct({}),
|
|
6756
|
-
success:
|
|
6894
|
+
success: PermissionRequestChange,
|
|
6757
6895
|
stream: true
|
|
6758
6896
|
});
|
|
6759
6897
|
const PermissionDecideRpc = Rpc.make("permission.decide", {
|
|
@@ -7879,7 +8017,7 @@ const UsageLimitsHistoryRpc = Rpc.make("usage.limits.history", {
|
|
|
7879
8017
|
*
|
|
7880
8018
|
* Add new RPCs by importing them here and including them in the group.
|
|
7881
8019
|
*/
|
|
7882
|
-
const MemoizeRpcs = RpcGroup.make(PingRpc, AnalyticsGetContextRpc, AnalyticsContextChangesRpc, AuthGetSessionRpc, AuthSignInRpc, AuthSignOutRpc, AuthSessionChangesRpc, LinearListConnectionsRpc, LinearConnectRpc, LinearDisconnectRpc, LinearListIssuesRpc, LinearPrepareContextRpc, PairingStartRpc, PairingListTokensRpc, PairingRevokeTokenRpc, PairingListNearbyRequestsRpc, PairingResolveNearbyRequestRpc, ConnectHandshakeRpc, ConnectDescribeRpc, ConnectLinkProofRpc, ConnectRelayConfigRpc, RelayLinkRpc, RelayStatusRpc, RelayUnlinkRpc, EnvironmentsListRpc, EnvironmentConnectRpc, CloudProvidersRpc, CloudProjectsListRpc, CloudProjectsConnectRpc, CloudProjectsPrepareRpc, CloudWorkspacesListRpc, CloudWorkspacesGetRpc, CloudWorkspacesCreateRpc, CloudWorkspacesConnectRpc,
|
|
8020
|
+
const MemoizeRpcs = RpcGroup.make(PingRpc, AnalyticsGetContextRpc, AnalyticsContextChangesRpc, AuthGetSessionRpc, AuthSignInRpc, AuthSignOutRpc, AuthSessionChangesRpc, LinearListConnectionsRpc, LinearConnectRpc, LinearDisconnectRpc, LinearListIssuesRpc, LinearPrepareContextRpc, PairingStartRpc, PairingListTokensRpc, PairingRevokeTokenRpc, PairingListNearbyRequestsRpc, PairingResolveNearbyRequestRpc, ConnectHandshakeRpc, ConnectDescribeRpc, ConnectLinkProofRpc, ConnectRelayConfigRpc, RelayLinkRpc, RelayStatusRpc, RelayUnlinkRpc, EnvironmentsListRpc, EnvironmentConnectRpc, CloudBillingSummaryRpc, CloudBillingUsageRpc, CloudBillingSetCapRpc, CloudProvidersRpc, CloudProjectsListRpc, CloudProjectsConnectRpc, CloudProjectsPrepareRpc, CloudWorkspacesListRpc, CloudWorkspacesGetRpc, CloudWorkspacesWatchRpc, CloudWorkspacesCreateRpc, CloudWorkspacesConnectRpc, CloudChatsListRpc, CloudWorkspacesPauseRpc, CloudWorkspacesResumeRpc, CloudWorkspacesRestartRpc, CloudWorkspacesSshAccessRpc, CloudWorkspacesArchiveRpc, CloudWorkspacesUnarchiveRpc, CloudWorkspacesDeleteRpc, CloudTranscriptCheckpointGetRpc, CloudTranscriptMessagePageGetRpc, CloudCredentialsListRpc, CloudCredentialsImportLocalRpc, CloudCredentialsDisconnectRpc, MachinesOffersRpc, MachinesListRpc, MachinesGetRpc, MachinesCreateRpc, MachinesCancelRpc, MachinesRecoverRpc, MachinesDestroyRpc, MachinesCheckoutRpc, MachinesBillingPortalRpc, MachinesEntitlementsRpc, MachineSshKeysAddRpc, MachineSshKeysListRpc, MachineSshKeysRemoveRpc, MachinePrivateNetworkEnableRpc, MachinePrivateNetworkStatusRpc, MachineRuntimeTargetRpc, MachineRuntimeStatusRpc, MachineRuntimeUpdateRpc, MachineResourcesWatchRpc, MachineSshModeSetRpc, AccountAccessStatusRpc, AccountAccessDetectLocalRpc, AccountAccessStartLoginRpc, AccountAccessPrepareImportRpc, AccountAccessCreateClaudeTransferRpc, AccountAccessContinueClaudeTransferRpc, AccountAccessImportRpc, AccountAccessDisconnectRpc, RelayEnvironmentsRpc, RelayConnectEnvironmentRpc, RelayClientsRpc, RelayRevokeClientRpc, WorkspaceAddRpc, WorkspaceBrowseDirectoryRpc, WorkspaceListRpc, WorkspaceRemoveRpc, WorkspacePickFolderRpc, WorkspaceGetSelectedRpc, WorkspaceSetSelectedRpc, WorkspaceStreamChangesRpc, WorkspaceSearchFilesRpc, WorkspaceCloneRepoRpc, WorkspaceCreateProjectRpc, WorkspaceListGithubReposRpc, WorkspaceGhAuthStatusRpc, ExternalThreadsListRpc, ExternalThreadsContinueRpc, PtyOpenRpc, PtyWriteRpc, PtyResizeRpc, PtyCloseRpc, PtyOutputRpc, GitLogRpc, GitStatusRpc, GitBranchesRpc, GitSwitchBranchRpc, GitUserNameRpc, GitWorkspaceChangesRpc, GitOriginRpc, GitPrStateRpc, GitPrDetailsRpc, GitListPrsRpc, GitListIssuesRpc, GitIssueMarkdownRpc, GitChangesRpc, GitReviewSummaryRpc, GitReviewPatchesRpc, GitReviewFileContentsRpc, GitReviewIdentityRpc, GitDiffRpc, GitCommitRpc, GitCreateReviewCommentRpc, GitPushRpc, GitResolveConflictRpc, GitMergePrRpc, GitMarkReadyRpc, GitInitRpc, GitFixFailingChecksRpc, GitRevertFileRpc, GitRestoreFileToBaseRpc, GitRevertAllRpc, FsTreeRpc, FsWatchTreeRpc, FsListPathsRpc, FsMoveRpc, FsReadFileRpc, FsWriteFileRpc, FsCreateFileRpc, FsCreateDirectoryRpc, FsRemoveRpc, FsReadExternalFileRpc, FsWriteExternalFileRpc, ProviderAvailabilityRpc, ProviderRemoveCredentialRpc, ProviderSetCredentialRpc, ProviderOpencodeInventoryRpc, ProviderKiroInventoryRpc, ProviderOpencodeSetAuthRpc, ProviderOpencodeRemoveAuthRpc, ProviderOpencodeAddCustomRpc, ProviderOpencodeRemoveCustomRpc, ProviderStartLoginRpc, ProviderUpdateRpc, ChatArchivePreviewRpc, McpListRpc, McpRefreshRpc, McpSetEnabledRpc, McpAuthenticateRpc, ChatListRpc, ChatGetRpc, ChatCreateRpc, ChatCreationListRpc, ChatCreationStreamRpc, ChatCreationDiscardRpc, ChatRenameRpc, ChatMarkReadRpc, ChatStreamChangesRpc, ChatSetWorktreeRpc, ChatSetActiveSessionRpc, ChatArchiveRpc, ChatArchiveStatusRpc, ChatArchiveJobsRpc, ChatDirectoryStatusRpc, ChatUnarchiveRpc, ChatDeleteRpc, SessionListRpc, SessionStreamChangesRpc, SessionMcpUpdateRpc, SessionGetRpc, SessionCreateRpc, SessionRenameRpc, SessionGoalGetRpc, SessionGoalSetRpc, SessionGoalClearRpc, SessionGoalStreamRpc, SessionSetModelRpc, SessionSetProviderRpc, SessionArchiveRpc, SessionUnarchiveRpc, SessionDeleteRpc, SessionEventsHeadRpc, SessionEventsRpc, SessionMessagesPageRpc, SessionForkRpc, SessionExportTranscriptRpc, SessionLatestPlanRpc, SessionResumeRpc, SessionSetRuntimeModeRpc, SessionSetPermissionModeRpc, SessionAnswerQuestionRpc, SessionPlanRespondRpc, SessionSetWorktreeRpc, MessagesListRpc, MessagesSendRpc, MessagesInterruptRpc, MessagesQueueListRpc, MessagesQueueAddRpc, MessagesQueueUpdateRpc, MessagesQueueDeleteRpc, MessagesQueueRunNextRpc, MessagesQueueReorderRpc, MessagesQueueFlushRpc, MessagesQueueResumeRpc, AttachmentUploadRpc, ContextSaveTextRpc, SkillListRpc, SkillListForProjectRpc, SkillStreamRpc, PermissionRequestsRpc, PermissionDecideRpc, PermissionListPendingRpc, PermissionListDecisionsRpc, PermissionRevokeDecisionRpc, PokemonPokedexRpc, PokemonEnsureSpriteCachedRpc, BrowserCommandsRpc, BrowserRespondRpc, BrowserSetCredentialRpc, BrowserListCredentialsRpc, BrowserRemoveCredentialRpc, WorktreeCreateRpc, WorktreeListRpc, WorktreeGetRpc, WorktreeRenameBranchRpc, WorktreeRerunSetupRpc, WorktreeSetupStreamRpc, WorktreeStartRunRpc, WorktreeRemoveRpc, RepositorySettingsGetRpc, RepositorySettingsUpdateRpc, SettingsGetRpc, SettingsUpdateRpc, SettingsStreamRpc, SettingsMigrateLocalStorageRpc, UsageReportRpc, UsageOverviewRpc, UsageSessionsRpc, UsageLimitsRpc, UsageLimitsHistoryRpc, DiagnosticsExportRpc, DiagnosticsOverviewRpc, DiagnosticsEventsRpc, DiagnosticsProcessesRpc, DiagnosticsSignalRpc, DiagnosticsIngestRpc, DiagnosticsCaptureRpc, KeybindingsGetRpc, KeybindingsReplaceRpc, KeybindingsStreamRpc, SessionSetWorktreeRpc);
|
|
7883
8021
|
//#endregion
|
|
7884
8022
|
//#region ../contracts/src/serve.ts
|
|
7885
8023
|
const ServeServiceState = Schema.Literals([
|
|
@@ -8007,7 +8145,7 @@ const authenticatedWsUrl = (options) => {
|
|
|
8007
8145
|
const base = options.wsBaseUrl?.trim();
|
|
8008
8146
|
const url = new URL(base && base.length > 0 ? base : wsUrl(options));
|
|
8009
8147
|
if (options.token?.trim()) url.searchParams.set("token", options.token.trim());
|
|
8010
|
-
return withWireProtocolVersion(url.toString(),
|
|
8148
|
+
return withWireProtocolVersion(url.toString(), 5);
|
|
8011
8149
|
};
|
|
8012
8150
|
const wsClientProtocolLayer = (endpoint, options) => {
|
|
8013
8151
|
const makeWebSocket = options?.onClose === void 0 ? options?.makeWebSocket : observeWebSocketConstructor(options.makeWebSocket ?? ((url, protocols) => new globalThis.WebSocket(url, protocols)), options.onClose);
|
|
@@ -8015,6 +8153,7 @@ const wsClientProtocolLayer = (endpoint, options) => {
|
|
|
8015
8153
|
};
|
|
8016
8154
|
//#endregion
|
|
8017
8155
|
//#region src/agent-cli.ts
|
|
8156
|
+
const commandId = (kind) => CommandId.make(`${kind}:${randomUUID()}`);
|
|
8018
8157
|
const GROUPS = /* @__PURE__ */ new Set([
|
|
8019
8158
|
"commands",
|
|
8020
8159
|
"computer",
|
|
@@ -8144,14 +8283,14 @@ const endpoint = async (args, env) => {
|
|
|
8144
8283
|
const raw = one(args, "ws-url") ?? env.ZUSE_WS_URL ?? access?.wsUrl ?? `ws://127.0.0.1:${env.ZUSE_PORT ?? "47837"}/rpc`;
|
|
8145
8284
|
const url = new URL(raw);
|
|
8146
8285
|
if (url.pathname === "/") url.pathname = "/rpc";
|
|
8147
|
-
url.searchParams.set("wireVersion", String(
|
|
8286
|
+
url.searchParams.set("wireVersion", String(5));
|
|
8148
8287
|
const token = one(args, "token") ?? env.ZUSE_TOKEN ?? access?.token;
|
|
8149
8288
|
if (token !== void 0) url.searchParams.set("token", token);
|
|
8150
8289
|
return url.toString();
|
|
8151
8290
|
};
|
|
8152
8291
|
const connect = async (args, env) => {
|
|
8153
8292
|
return makeRpcClientSession(wsClientProtocolLayer(await endpoint(args, env)), MemoizeRpcs, {
|
|
8154
|
-
protocolVersion:
|
|
8293
|
+
protocolVersion: 5,
|
|
8155
8294
|
perform: (client, hello) => client["connect.handshake"](hello)
|
|
8156
8295
|
});
|
|
8157
8296
|
};
|
|
@@ -8524,6 +8663,7 @@ const execute = async (argv, env) => {
|
|
|
8524
8663
|
permissionMode: permission(args)
|
|
8525
8664
|
}));
|
|
8526
8665
|
if (prompt || context.attachments.length || context.fileRefs.length) await rpc(client["messages.send"]({
|
|
8666
|
+
commandId: commandId("message-send"),
|
|
8527
8667
|
sessionId: created.id,
|
|
8528
8668
|
input: composer(prompt, context)
|
|
8529
8669
|
}));
|
|
@@ -8570,6 +8710,7 @@ const execute = async (argv, env) => {
|
|
|
8570
8710
|
return { session: await rpc(client["session.get"]({ sessionId: selectedSessionId })) };
|
|
8571
8711
|
}
|
|
8572
8712
|
if (group === "session" && action === "rename") return { session: await rpc(client["session.rename"]({
|
|
8713
|
+
commandId: commandId("session-rename"),
|
|
8573
8714
|
sessionId: selectedSessionId,
|
|
8574
8715
|
title: required(one(args, "title"), "--title")
|
|
8575
8716
|
})) };
|
|
@@ -8599,14 +8740,17 @@ const execute = async (argv, env) => {
|
|
|
8599
8740
|
const context = await contextFor(client, args, selectedSessionId, project);
|
|
8600
8741
|
const text = await promptFor(args, true);
|
|
8601
8742
|
if (one(args, "permission")) await rpc(client["session.setPermissionMode"]({
|
|
8743
|
+
commandId: commandId("session-permission-mode"),
|
|
8602
8744
|
sessionId: selectedSessionId,
|
|
8603
8745
|
mode: permission(args)
|
|
8604
8746
|
}));
|
|
8605
8747
|
if (one(args, "runtime")) await rpc(client["session.setRuntimeMode"]({
|
|
8748
|
+
commandId: commandId("session-runtime-mode"),
|
|
8606
8749
|
sessionId: selectedSessionId,
|
|
8607
8750
|
runtimeMode: runtime(args)
|
|
8608
8751
|
}));
|
|
8609
8752
|
await rpc(client["messages.send"]({
|
|
8753
|
+
commandId: commandId("message-send"),
|
|
8610
8754
|
sessionId: selectedSessionId,
|
|
8611
8755
|
input: composer(text, context)
|
|
8612
8756
|
}));
|
|
@@ -8652,6 +8796,7 @@ const execute = async (argv, env) => {
|
|
|
8652
8796
|
const input = composer(await promptFor(args, true), context);
|
|
8653
8797
|
if (action === "queue-add") return {
|
|
8654
8798
|
item: await rpc(client["messages.queue.add"]({
|
|
8799
|
+
commandId: commandId("queue-add"),
|
|
8655
8800
|
sessionId: selectedSessionId,
|
|
8656
8801
|
input,
|
|
8657
8802
|
...one(args, "queue") ? { queueId: one(args, "queue") } : {},
|
|
@@ -8662,6 +8807,7 @@ const execute = async (argv, env) => {
|
|
|
8662
8807
|
};
|
|
8663
8808
|
return {
|
|
8664
8809
|
item: await rpc(client["messages.queue.update"]({
|
|
8810
|
+
commandId: commandId("queue-update"),
|
|
8665
8811
|
sessionId: selectedSessionId,
|
|
8666
8812
|
queueId: required(one(args, "queue"), "--queue"),
|
|
8667
8813
|
input
|
|
@@ -8672,6 +8818,7 @@ const execute = async (argv, env) => {
|
|
|
8672
8818
|
if (group === "session" && action === "queue-delete") {
|
|
8673
8819
|
const queueId = required(one(args, "queue"), "--queue");
|
|
8674
8820
|
await rpc(client["messages.queue.delete"]({
|
|
8821
|
+
commandId: commandId("queue-delete"),
|
|
8675
8822
|
sessionId: selectedSessionId,
|
|
8676
8823
|
queueId
|
|
8677
8824
|
}));
|
|
@@ -8682,12 +8829,14 @@ const execute = async (argv, env) => {
|
|
|
8682
8829
|
};
|
|
8683
8830
|
}
|
|
8684
8831
|
if (group === "session" && action === "queue-reorder") return { items: await rpc(client["messages.queue.reorder"]({
|
|
8832
|
+
commandId: commandId("queue-reorder"),
|
|
8685
8833
|
sessionId: selectedSessionId,
|
|
8686
8834
|
queueIds: many(args, "queue")
|
|
8687
8835
|
})) };
|
|
8688
8836
|
if (group === "session" && action === "queue-run-next") {
|
|
8689
8837
|
const queueId = required(one(args, "queue"), "--queue");
|
|
8690
8838
|
await rpc(client["messages.queue.runNext"]({
|
|
8839
|
+
commandId: commandId("queue-run-next"),
|
|
8691
8840
|
sessionId: selectedSessionId,
|
|
8692
8841
|
queueId
|
|
8693
8842
|
}));
|
|
@@ -8698,14 +8847,20 @@ const execute = async (argv, env) => {
|
|
|
8698
8847
|
};
|
|
8699
8848
|
}
|
|
8700
8849
|
if (group === "session" && action === "queue-flush") {
|
|
8701
|
-
await rpc(client["messages.queue.flush"]({
|
|
8850
|
+
await rpc(client["messages.queue.flush"]({
|
|
8851
|
+
commandId: commandId("queue-flush"),
|
|
8852
|
+
sessionId: selectedSessionId
|
|
8853
|
+
}));
|
|
8702
8854
|
return {
|
|
8703
8855
|
sessionId: selectedSessionId,
|
|
8704
8856
|
flushed: true
|
|
8705
8857
|
};
|
|
8706
8858
|
}
|
|
8707
8859
|
if (group === "session" && action === "queue-resume") {
|
|
8708
|
-
await rpc(client["messages.queue.resume"]({
|
|
8860
|
+
await rpc(client["messages.queue.resume"]({
|
|
8861
|
+
commandId: commandId("queue-resume"),
|
|
8862
|
+
sessionId: selectedSessionId
|
|
8863
|
+
}));
|
|
8709
8864
|
return {
|
|
8710
8865
|
sessionId: selectedSessionId,
|
|
8711
8866
|
resumed: true
|
|
@@ -8714,17 +8869,22 @@ const execute = async (argv, env) => {
|
|
|
8714
8869
|
if (group === "session" && action === "mode") {
|
|
8715
8870
|
if (!one(args, "permission") && !one(args, "runtime")) throw new CliError("invalid_input", "session mode requires --permission or --runtime.");
|
|
8716
8871
|
if (one(args, "permission")) await rpc(client["session.setPermissionMode"]({
|
|
8872
|
+
commandId: commandId("session-permission-mode"),
|
|
8717
8873
|
sessionId: selectedSessionId,
|
|
8718
8874
|
mode: permission(args)
|
|
8719
8875
|
}));
|
|
8720
8876
|
if (one(args, "runtime")) await rpc(client["session.setRuntimeMode"]({
|
|
8877
|
+
commandId: commandId("session-runtime-mode"),
|
|
8721
8878
|
sessionId: selectedSessionId,
|
|
8722
8879
|
runtimeMode: runtime(args)
|
|
8723
8880
|
}));
|
|
8724
8881
|
return { session: await rpc(client["session.get"]({ sessionId: selectedSessionId })) };
|
|
8725
8882
|
}
|
|
8726
8883
|
if (group === "session" && action === "interrupt") {
|
|
8727
|
-
await rpc(client["messages.interrupt"]({
|
|
8884
|
+
await rpc(client["messages.interrupt"]({
|
|
8885
|
+
commandId: commandId("message-interrupt"),
|
|
8886
|
+
sessionId: selectedSessionId
|
|
8887
|
+
}));
|
|
8728
8888
|
return {
|
|
8729
8889
|
sessionId: selectedSessionId,
|
|
8730
8890
|
interrupted: true
|
|
@@ -8753,4 +8913,4 @@ const runServeCli = async (argv, env = process.env) => {
|
|
|
8753
8913
|
//#endregion
|
|
8754
8914
|
export { runServeCli as t };
|
|
8755
8915
|
|
|
8756
|
-
//# sourceMappingURL=cli-
|
|
8916
|
+
//# sourceMappingURL=cli-CHHBM6zs.mjs.map
|