@zusehq/serve 0.1.2 → 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-Bp5uahNl.mjs → cli-CHHBM6zs.mjs} +777 -184
- package/dist/cli-CHHBM6zs.mjs.map +1 -0
- package/dist/cli.mjs +1 -1
- package/package.json +2 -2
- package/dist/cli-Bp5uahNl.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
|
/**
|
|
@@ -1153,6 +1162,13 @@ const MODELS_BY_PROVIDER = {
|
|
|
1153
1162
|
supportsPlanMode: true,
|
|
1154
1163
|
supportsWebSearch: "queryOnly"
|
|
1155
1164
|
},
|
|
1165
|
+
{
|
|
1166
|
+
id: "grok-4.6",
|
|
1167
|
+
label: "Grok 4.6",
|
|
1168
|
+
badgeLabel: "New",
|
|
1169
|
+
supportsPlanMode: true,
|
|
1170
|
+
supportsWebSearch: "queryOnly"
|
|
1171
|
+
},
|
|
1156
1172
|
{
|
|
1157
1173
|
id: "grok-4.5",
|
|
1158
1174
|
label: "Grok 4.5",
|
|
@@ -1834,6 +1850,15 @@ var FsConflictError = class extends Schema.TaggedErrorClass()("FsConflictError",
|
|
|
1834
1850
|
expectedMtime: Schema.String,
|
|
1835
1851
|
actualMtime: Schema.String
|
|
1836
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
|
+
}) {};
|
|
1837
1862
|
var FsExternalReadError = class extends Schema.TaggedErrorClass()("FsExternalReadError", {
|
|
1838
1863
|
path: Schema.String,
|
|
1839
1864
|
reason: Schema.String
|
|
@@ -1873,6 +1898,7 @@ const FsWriteFileErrors = Schema.Union([
|
|
|
1873
1898
|
FsPathOutsideError,
|
|
1874
1899
|
FsReadError,
|
|
1875
1900
|
FsConflictError,
|
|
1901
|
+
FsCommandReuseError,
|
|
1876
1902
|
FsTooLargeError
|
|
1877
1903
|
]);
|
|
1878
1904
|
const FsCreateErrors = Schema.Union([
|
|
@@ -1902,17 +1928,35 @@ const FsTreeRpc = Rpc.make("fs.tree", {
|
|
|
1902
1928
|
success: Schema.Array(FsEntry),
|
|
1903
1929
|
error: FsErrors
|
|
1904
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
|
+
]);
|
|
1905
1947
|
/**
|
|
1906
1948
|
* Live stream of filesystem changes under the current project/worktree root.
|
|
1907
|
-
*
|
|
1908
|
-
*
|
|
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.
|
|
1909
1953
|
*/
|
|
1910
1954
|
const FsWatchTreeRpc = Rpc.make("fs.watchTree", {
|
|
1911
1955
|
payload: Schema.Struct({
|
|
1912
1956
|
folderId: FolderId,
|
|
1913
1957
|
worktreeId: Schema.optional(Schema.NullOr(WorktreeId))
|
|
1914
1958
|
}),
|
|
1915
|
-
success:
|
|
1959
|
+
success: FsTreeWatchEvent,
|
|
1916
1960
|
error: FsErrors,
|
|
1917
1961
|
stream: true
|
|
1918
1962
|
});
|
|
@@ -1957,6 +2001,8 @@ const FsReadFileRpc = Rpc.make("fs.readFile", {
|
|
|
1957
2001
|
*/
|
|
1958
2002
|
const FsWriteFileRpc = Rpc.make("fs.writeFile", {
|
|
1959
2003
|
payload: Schema.Struct({
|
|
2004
|
+
/** Stable identity makes a lost write response safe to retry. */
|
|
2005
|
+
commandId: CommandId,
|
|
1960
2006
|
folderId: FolderId,
|
|
1961
2007
|
path: Schema.String,
|
|
1962
2008
|
content: Schema.String,
|
|
@@ -2440,6 +2486,7 @@ const UserRichContent = Schema.TaggedStruct("user_rich", {
|
|
|
2440
2486
|
const AssistantContent = Schema.TaggedStruct("assistant", {
|
|
2441
2487
|
itemId: Schema.optional(AgentItemId),
|
|
2442
2488
|
text: Schema.String,
|
|
2489
|
+
checkpoint: Schema.optional(ProviderMessageCheckpoint),
|
|
2443
2490
|
/** Preserves a provider's dedicated final-plan item through persistence. */
|
|
2444
2491
|
isPlan: Schema.optional(Schema.Boolean),
|
|
2445
2492
|
parentItemId: Schema.optional(AgentItemId)
|
|
@@ -2454,6 +2501,7 @@ const ThinkingContent = Schema.TaggedStruct("thinking", {
|
|
|
2454
2501
|
itemId: AgentItemId,
|
|
2455
2502
|
text: Schema.String,
|
|
2456
2503
|
redacted: Schema.Boolean,
|
|
2504
|
+
checkpoint: Schema.optional(ProviderMessageCheckpoint),
|
|
2457
2505
|
parentItemId: Schema.optional(AgentItemId)
|
|
2458
2506
|
});
|
|
2459
2507
|
const ToolUseContent = Schema.TaggedStruct("tool_use", {
|
|
@@ -2620,6 +2668,16 @@ var QueuedMessageNotFoundError = class extends Schema.TaggedErrorClass()("Queued
|
|
|
2620
2668
|
sessionId: SessionId,
|
|
2621
2669
|
queueId: Schema.String
|
|
2622
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
|
+
}) {};
|
|
2623
2681
|
var QueueState = class extends Schema.Class("QueueState")({
|
|
2624
2682
|
items: Schema.Array(QueuedMessage),
|
|
2625
2683
|
paused: Schema.Boolean
|
|
@@ -2637,6 +2695,8 @@ const SessionTimelineTurn = Schema.Struct({
|
|
|
2637
2695
|
});
|
|
2638
2696
|
var SessionTimelineProjection = class extends Schema.Class("SessionTimelineProjection")({
|
|
2639
2697
|
messages: Schema.Array(Message),
|
|
2698
|
+
/** Sequence immediately before the oldest materialized message, if any. */
|
|
2699
|
+
olderMessageSequence: Schema.optional(Schema.NullOr(Schema.Number)),
|
|
2640
2700
|
status: SessionStatus,
|
|
2641
2701
|
currentTurn: Schema.NullOr(SessionTimelineTurn),
|
|
2642
2702
|
queue: QueueState,
|
|
@@ -2676,24 +2736,46 @@ const SessionTimelineEvent = Schema.Union([
|
|
|
2676
2736
|
Schema.TaggedStruct("QueueRemoved", { queueId: Schema.String }),
|
|
2677
2737
|
Schema.TaggedStruct("QueueReordered", { queueIds: Schema.Array(Schema.String) })
|
|
2678
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
|
+
});
|
|
2679
2744
|
const SessionTimelineFrame = Schema.Union([
|
|
2680
2745
|
Schema.Struct({
|
|
2681
2746
|
kind: Schema.Literal("snapshot"),
|
|
2682
2747
|
sessionId: SessionId,
|
|
2683
2748
|
throughVersion: Schema.Number,
|
|
2684
|
-
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))
|
|
2685
2754
|
}),
|
|
2686
2755
|
Schema.Struct({
|
|
2687
2756
|
kind: Schema.Literal("event"),
|
|
2688
2757
|
sessionId: SessionId,
|
|
2689
2758
|
streamVersion: Schema.Number,
|
|
2690
2759
|
eventId: Schema.String,
|
|
2691
|
-
event: SessionTimelineEvent
|
|
2760
|
+
event: SessionTimelineEvent,
|
|
2761
|
+
cursor: Schema.optional(SessionStreamCursor)
|
|
2692
2762
|
}),
|
|
2693
2763
|
Schema.Struct({
|
|
2694
2764
|
kind: Schema.Literal("synchronized"),
|
|
2695
2765
|
sessionId: SessionId,
|
|
2696
|
-
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
|
+
])
|
|
2697
2779
|
})
|
|
2698
2780
|
]);
|
|
2699
2781
|
var SessionNotFoundError = class extends Schema.TaggedErrorClass()("SessionNotFoundError", { sessionId: SessionId }) {};
|
|
@@ -2814,6 +2896,7 @@ const SessionSetWorktreeRpc = Rpc.make("session.setWorktree", {
|
|
|
2814
2896
|
});
|
|
2815
2897
|
const SessionRenameRpc = Rpc.make("session.rename", {
|
|
2816
2898
|
payload: Schema.Struct({
|
|
2899
|
+
commandId: CommandId,
|
|
2817
2900
|
sessionId: SessionId,
|
|
2818
2901
|
title: Schema.String
|
|
2819
2902
|
}),
|
|
@@ -3065,6 +3148,7 @@ const ChatCreationOperation = Schema.Struct({
|
|
|
3065
3148
|
prompt: Schema.NullOr(Schema.String),
|
|
3066
3149
|
startupInput: Schema.NullOr(ComposerInput),
|
|
3067
3150
|
startupQueueId: Schema.NullOr(Schema.String),
|
|
3151
|
+
startupReady: Schema.Boolean,
|
|
3068
3152
|
workspacePolicy: ChatWorkspacePolicy,
|
|
3069
3153
|
worktreeId: Schema.NullOr(WorktreeId),
|
|
3070
3154
|
status: ChatCreationOperationStatus,
|
|
@@ -3076,9 +3160,16 @@ const ChatCreationListRpc = Rpc.make("chat.creation.list", {
|
|
|
3076
3160
|
payload: Schema.Struct({ projectId: FolderId }),
|
|
3077
3161
|
success: Schema.Array(ChatCreationOperation)
|
|
3078
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
|
+
})]);
|
|
3079
3170
|
const ChatCreationStreamRpc = Rpc.make("chat.creation.stream", {
|
|
3080
3171
|
payload: Schema.Struct({ projectId: FolderId }),
|
|
3081
|
-
success:
|
|
3172
|
+
success: ChatCreationSummaryChange,
|
|
3082
3173
|
stream: true
|
|
3083
3174
|
});
|
|
3084
3175
|
const ChatCreationDiscardRpc = Rpc.make("chat.creation.discard", {
|
|
@@ -3102,6 +3193,8 @@ const ChatCreateRpc = Rpc.make("chat.create", {
|
|
|
3102
3193
|
workspacePolicy: Schema.optional(ChatWorkspacePolicy),
|
|
3103
3194
|
startupInput: Schema.optional(ComposerInput),
|
|
3104
3195
|
startupQueueId: Schema.optional(Schema.String),
|
|
3196
|
+
/** False while attachment or generated context preparation is pending. */
|
|
3197
|
+
startupReady: Schema.optional(Schema.Boolean),
|
|
3105
3198
|
agents: Schema.optional(Schema.Record(Schema.String, AgentDefinition)),
|
|
3106
3199
|
enableSubagents: Schema.optional(Schema.Boolean),
|
|
3107
3200
|
permissionMode: Schema.optional(PermissionMode),
|
|
@@ -3257,18 +3350,31 @@ const MessagesListRpc = Rpc.make("messages.list", {
|
|
|
3257
3350
|
*/
|
|
3258
3351
|
const MessagesSendRpc = Rpc.make("messages.send", {
|
|
3259
3352
|
payload: Schema.Struct({
|
|
3353
|
+
commandId: CommandId,
|
|
3260
3354
|
sessionId: SessionId,
|
|
3261
3355
|
text: Schema.optional(Schema.String),
|
|
3262
3356
|
input: Schema.optional(ComposerInput),
|
|
3263
3357
|
asGoal: Schema.optional(Schema.Boolean),
|
|
3358
|
+
modelOptions: Schema.optional(Schema.Record(Schema.String, Schema.String)),
|
|
3264
3359
|
clientMessageId: Schema.optional(MessageId)
|
|
3265
3360
|
}),
|
|
3266
3361
|
success: Schema.Void,
|
|
3267
3362
|
error: Schema.Union([SessionNotFoundError, DirectoryUnavailableError])
|
|
3268
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
|
+
})]);
|
|
3269
3370
|
const MessagesInterruptRpc = Rpc.make("messages.interrupt", {
|
|
3270
|
-
payload: Schema.Struct({
|
|
3271
|
-
|
|
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,
|
|
3272
3378
|
error: SessionNotFoundError
|
|
3273
3379
|
});
|
|
3274
3380
|
const MessagesQueueListRpc = Rpc.make("messages.queue.list", {
|
|
@@ -3278,6 +3384,7 @@ const MessagesQueueListRpc = Rpc.make("messages.queue.list", {
|
|
|
3278
3384
|
});
|
|
3279
3385
|
const MessagesQueueAddRpc = Rpc.make("messages.queue.add", {
|
|
3280
3386
|
payload: Schema.Struct({
|
|
3387
|
+
commandId: CommandId,
|
|
3281
3388
|
sessionId: SessionId,
|
|
3282
3389
|
/** Stable identity used to make persistence retries idempotent. */
|
|
3283
3390
|
queueId: Schema.optional(Schema.String),
|
|
@@ -3288,19 +3395,25 @@ const MessagesQueueAddRpc = Rpc.make("messages.queue.add", {
|
|
|
3288
3395
|
flush: Schema.optional(Schema.Boolean)
|
|
3289
3396
|
}),
|
|
3290
3397
|
success: QueuedMessage,
|
|
3291
|
-
error: SessionNotFoundError
|
|
3398
|
+
error: Schema.Union([SessionNotFoundError, QueuedMessageCapacityError])
|
|
3292
3399
|
});
|
|
3293
3400
|
const MessagesQueueUpdateRpc = Rpc.make("messages.queue.update", {
|
|
3294
3401
|
payload: Schema.Struct({
|
|
3402
|
+
commandId: CommandId,
|
|
3295
3403
|
sessionId: SessionId,
|
|
3296
3404
|
queueId: Schema.String,
|
|
3297
3405
|
input: ComposerInput
|
|
3298
3406
|
}),
|
|
3299
3407
|
success: QueuedMessage,
|
|
3300
|
-
error: Schema.Union([
|
|
3408
|
+
error: Schema.Union([
|
|
3409
|
+
SessionNotFoundError,
|
|
3410
|
+
QueuedMessageNotFoundError,
|
|
3411
|
+
QueuedMessageCapacityError
|
|
3412
|
+
])
|
|
3301
3413
|
});
|
|
3302
3414
|
const MessagesQueueDeleteRpc = Rpc.make("messages.queue.delete", {
|
|
3303
3415
|
payload: Schema.Struct({
|
|
3416
|
+
commandId: CommandId,
|
|
3304
3417
|
sessionId: SessionId,
|
|
3305
3418
|
queueId: Schema.String
|
|
3306
3419
|
}),
|
|
@@ -3313,6 +3426,7 @@ const MessagesQueueDeleteRpc = Rpc.make("messages.queue.delete", {
|
|
|
3313
3426
|
*/
|
|
3314
3427
|
const MessagesQueueRunNextRpc = Rpc.make("messages.queue.runNext", {
|
|
3315
3428
|
payload: Schema.Struct({
|
|
3429
|
+
commandId: CommandId,
|
|
3316
3430
|
sessionId: SessionId,
|
|
3317
3431
|
queueId: Schema.String
|
|
3318
3432
|
}),
|
|
@@ -3321,6 +3435,7 @@ const MessagesQueueRunNextRpc = Rpc.make("messages.queue.runNext", {
|
|
|
3321
3435
|
});
|
|
3322
3436
|
const MessagesQueueReorderRpc = Rpc.make("messages.queue.reorder", {
|
|
3323
3437
|
payload: Schema.Struct({
|
|
3438
|
+
commandId: CommandId,
|
|
3324
3439
|
sessionId: SessionId,
|
|
3325
3440
|
queueIds: Schema.Array(Schema.String)
|
|
3326
3441
|
}),
|
|
@@ -3328,12 +3443,18 @@ const MessagesQueueReorderRpc = Rpc.make("messages.queue.reorder", {
|
|
|
3328
3443
|
error: SessionNotFoundError
|
|
3329
3444
|
});
|
|
3330
3445
|
const MessagesQueueFlushRpc = Rpc.make("messages.queue.flush", {
|
|
3331
|
-
payload: Schema.Struct({
|
|
3446
|
+
payload: Schema.Struct({
|
|
3447
|
+
commandId: CommandId,
|
|
3448
|
+
sessionId: SessionId
|
|
3449
|
+
}),
|
|
3332
3450
|
success: Schema.Void,
|
|
3333
3451
|
error: SessionNotFoundError
|
|
3334
3452
|
});
|
|
3335
3453
|
const MessagesQueueResumeRpc = Rpc.make("messages.queue.resume", {
|
|
3336
|
-
payload: Schema.Struct({
|
|
3454
|
+
payload: Schema.Struct({
|
|
3455
|
+
commandId: CommandId,
|
|
3456
|
+
sessionId: SessionId
|
|
3457
|
+
}),
|
|
3337
3458
|
success: Schema.Void,
|
|
3338
3459
|
error: SessionNotFoundError
|
|
3339
3460
|
});
|
|
@@ -3354,6 +3475,7 @@ const SessionResumeRpc = Rpc.make("session.resume", {
|
|
|
3354
3475
|
*/
|
|
3355
3476
|
const SessionSetRuntimeModeRpc = Rpc.make("session.setRuntimeMode", {
|
|
3356
3477
|
payload: Schema.Struct({
|
|
3478
|
+
commandId: CommandId,
|
|
3357
3479
|
sessionId: SessionId,
|
|
3358
3480
|
runtimeMode: RuntimeMode
|
|
3359
3481
|
}),
|
|
@@ -3368,6 +3490,7 @@ const SessionSetRuntimeModeRpc = Rpc.make("session.setRuntimeMode", {
|
|
|
3368
3490
|
*/
|
|
3369
3491
|
const SessionSetPermissionModeRpc = Rpc.make("session.setPermissionMode", {
|
|
3370
3492
|
payload: Schema.Struct({
|
|
3493
|
+
commandId: CommandId,
|
|
3371
3494
|
sessionId: SessionId,
|
|
3372
3495
|
mode: PermissionMode
|
|
3373
3496
|
}),
|
|
@@ -3415,6 +3538,7 @@ const SessionEventsRpc = Rpc.make("session.events", {
|
|
|
3415
3538
|
payload: Schema.Struct({
|
|
3416
3539
|
sessionId: SessionId,
|
|
3417
3540
|
afterVersion: Schema.optional(Schema.Number),
|
|
3541
|
+
streamEpoch: Schema.optional(Schema.String),
|
|
3418
3542
|
hasProjection: Schema.optional(Schema.Boolean)
|
|
3419
3543
|
}),
|
|
3420
3544
|
success: SessionTimelineFrame,
|
|
@@ -3424,7 +3548,23 @@ const SessionEventsRpc = Rpc.make("session.events", {
|
|
|
3424
3548
|
/** Lightweight durable cursor used to detect an open-but-stalled event stream. */
|
|
3425
3549
|
const SessionEventsHeadRpc = Rpc.make("session.events.head", {
|
|
3426
3550
|
payload: Schema.Struct({ sessionId: SessionId }),
|
|
3427
|
-
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
|
+
}),
|
|
3428
3568
|
error: SessionNotFoundError
|
|
3429
3569
|
});
|
|
3430
3570
|
const SessionGoalGetRpc = Rpc.make("session.goal.get", {
|
|
@@ -3851,158 +3991,539 @@ const BrowserRemoveCredentialRpc = Rpc.make("browser.removeCredential", {
|
|
|
3851
3991
|
success: Schema.Void
|
|
3852
3992
|
});
|
|
3853
3993
|
//#endregion
|
|
3854
|
-
//#region ../contracts/src/
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
* shapes flat and primitive so they cross the effect/unstable/rpc + MCP JSON-schema
|
|
3859
|
-
* boundaries without ceremony.
|
|
3860
|
-
*/
|
|
3861
|
-
const IndexState = Schema.Literals([
|
|
3862
|
-
"idle",
|
|
3863
|
-
"indexing",
|
|
3994
|
+
//#region ../contracts/src/cloud-workspaces.ts
|
|
3995
|
+
const CloudProjectState = Schema.Literals([
|
|
3996
|
+
"connected",
|
|
3997
|
+
"preparing",
|
|
3864
3998
|
"ready",
|
|
3865
|
-
"
|
|
3999
|
+
"failed"
|
|
3866
4000
|
]);
|
|
3867
|
-
const
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
chunks: Schema.Number,
|
|
3874
|
-
symbols: Schema.Number,
|
|
3875
|
-
refs: Schema.Number
|
|
3876
|
-
});
|
|
3877
|
-
var IndexStatusInfo = class extends Schema.Class("IndexStatusInfo")({
|
|
3878
|
-
state: IndexState,
|
|
3879
|
-
branch: Schema.NullOr(Schema.String),
|
|
3880
|
-
progress: IndexProgress,
|
|
3881
|
-
stats: IndexStats
|
|
3882
|
-
}) {};
|
|
3883
|
-
const SymbolKind = Schema.Literals([
|
|
3884
|
-
"function",
|
|
3885
|
-
"method",
|
|
3886
|
-
"class",
|
|
3887
|
-
"interface",
|
|
3888
|
-
"type",
|
|
3889
|
-
"enum",
|
|
3890
|
-
"const",
|
|
3891
|
-
"variable",
|
|
3892
|
-
"property",
|
|
3893
|
-
"export"
|
|
4001
|
+
const CloudProjectBuildState = Schema.Literals([
|
|
4002
|
+
"queued",
|
|
4003
|
+
"building",
|
|
4004
|
+
"sanitizing",
|
|
4005
|
+
"ready",
|
|
4006
|
+
"failed"
|
|
3894
4007
|
]);
|
|
3895
|
-
const
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
"
|
|
3901
|
-
"
|
|
3902
|
-
"
|
|
3903
|
-
"
|
|
4008
|
+
const CloudWorkspaceState = Schema.Literals([
|
|
4009
|
+
"queued",
|
|
4010
|
+
"provisioning",
|
|
4011
|
+
"setup",
|
|
4012
|
+
"ready",
|
|
4013
|
+
"pausing",
|
|
4014
|
+
"paused",
|
|
4015
|
+
"resuming",
|
|
4016
|
+
"archiving",
|
|
4017
|
+
"archived",
|
|
4018
|
+
"deleting",
|
|
4019
|
+
"deleted",
|
|
4020
|
+
"failed"
|
|
3904
4021
|
]);
|
|
3905
|
-
const
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
4022
|
+
const CloudWorkspaceDesiredState = Schema.Literals([
|
|
4023
|
+
"ready",
|
|
4024
|
+
"paused",
|
|
4025
|
+
"archived",
|
|
4026
|
+
"deleted"
|
|
4027
|
+
]);
|
|
4028
|
+
const CloudWorkspaceStartupPhase = Schema.Literals([
|
|
4029
|
+
"allocating",
|
|
4030
|
+
"booting",
|
|
4031
|
+
"authenticating-runtime",
|
|
4032
|
+
"syncing-repository",
|
|
4033
|
+
"starting-agent",
|
|
4034
|
+
"running",
|
|
4035
|
+
"failed"
|
|
4036
|
+
]);
|
|
4037
|
+
var CloudWorkspaceStartupTimings = class extends Schema.Class("CloudWorkspaceStartupTimings")({
|
|
4038
|
+
requestedAt: Schema.optional(Schema.Number),
|
|
4039
|
+
resumeRequestedAt: Schema.optional(Schema.Number),
|
|
4040
|
+
allocatedAt: Schema.optional(Schema.Number),
|
|
4041
|
+
allocationDurationMs: Schema.optional(Schema.Number),
|
|
4042
|
+
enrolledAt: Schema.optional(Schema.Number),
|
|
4043
|
+
runtimeReadyAt: Schema.optional(Schema.Number),
|
|
4044
|
+
enrollmentDurationMs: Schema.optional(Schema.Number),
|
|
4045
|
+
networkOpenedAt: Schema.optional(Schema.Number),
|
|
4046
|
+
credentialInstallDurationMs: Schema.optional(Schema.Number),
|
|
4047
|
+
repositoryReadyAt: Schema.optional(Schema.Number),
|
|
4048
|
+
repositoryDurationMs: Schema.optional(Schema.Number),
|
|
4049
|
+
connectedAt: Schema.optional(Schema.Number),
|
|
4050
|
+
connectionDurationMs: Schema.optional(Schema.Number),
|
|
4051
|
+
durableChatCreatedAt: Schema.optional(Schema.Number),
|
|
4052
|
+
chatCreateDurationMs: Schema.optional(Schema.Number),
|
|
4053
|
+
agentStartedAt: Schema.optional(Schema.Number),
|
|
4054
|
+
agentStartDurationMs: Schema.optional(Schema.Number),
|
|
4055
|
+
launchDurationMs: Schema.optional(Schema.Number),
|
|
4056
|
+
providerResumedAt: Schema.optional(Schema.Number),
|
|
4057
|
+
providerResumeDurationMs: Schema.optional(Schema.Number)
|
|
4058
|
+
}) {};
|
|
4059
|
+
const CloudWorkspaceRuntimeState = Schema.Literals([
|
|
4060
|
+
"offline",
|
|
4061
|
+
"connecting",
|
|
4062
|
+
"online"
|
|
4063
|
+
]);
|
|
4064
|
+
const CloudCredentialKind = Schema.Literals([
|
|
4065
|
+
"github",
|
|
4066
|
+
"claude",
|
|
4067
|
+
"codex"
|
|
4068
|
+
]);
|
|
4069
|
+
var CloudProviderOption = class extends Schema.Class("CloudProviderOption")({
|
|
4070
|
+
providerId: Schema.String,
|
|
4071
|
+
displayName: Schema.String
|
|
4072
|
+
}) {};
|
|
4073
|
+
var CloudProviderList = class extends Schema.Class("CloudProviderList")({ providers: Schema.Array(CloudProviderOption) }) {};
|
|
4074
|
+
var CloudProjectBuildStatus = class extends Schema.Class("CloudProjectBuildStatus")({
|
|
4075
|
+
buildId: Schema.String,
|
|
4076
|
+
providerId: Schema.String,
|
|
4077
|
+
state: CloudProjectBuildState,
|
|
4078
|
+
errorCode: Schema.optional(Schema.String),
|
|
4079
|
+
createdAt: Schema.Number,
|
|
4080
|
+
updatedAt: Schema.Number
|
|
4081
|
+
}) {};
|
|
4082
|
+
var CloudProject = class extends Schema.Class("CloudProject")({
|
|
4083
|
+
projectId: Schema.String,
|
|
4084
|
+
repositoryIdentity: Schema.String,
|
|
4085
|
+
repositoryUrl: Schema.String,
|
|
4086
|
+
displayName: Schema.String,
|
|
4087
|
+
defaultBranch: Schema.String,
|
|
4088
|
+
visibility: Schema.Literals(["public", "private"]),
|
|
4089
|
+
state: CloudProjectState,
|
|
4090
|
+
activeBuilds: Schema.Record(Schema.String, Schema.String),
|
|
4091
|
+
latestBuilds: Schema.Record(Schema.String, CloudProjectBuildStatus),
|
|
4092
|
+
createdAt: Schema.Number,
|
|
4093
|
+
updatedAt: Schema.Number
|
|
4094
|
+
}) {};
|
|
4095
|
+
var CloudProjectList = class extends Schema.Class("CloudProjectList")({ projects: Schema.Array(CloudProject) }) {};
|
|
4096
|
+
var CloudProjectConnectRequest = class extends Schema.Class("CloudProjectConnectRequest")({
|
|
4097
|
+
repositoryUrl: Schema.String,
|
|
4098
|
+
defaultBranch: Schema.String,
|
|
4099
|
+
visibility: Schema.Literals(["public", "private"]),
|
|
4100
|
+
displayName: Schema.optional(Schema.String),
|
|
4101
|
+
cloudEnvironment: Schema.optional(Schema.Record(Schema.String, Schema.String)),
|
|
4102
|
+
secretBindings: Schema.optional(Schema.Array(Schema.String)),
|
|
4103
|
+
idempotencyKey: Schema.String
|
|
4104
|
+
}) {};
|
|
4105
|
+
var CloudProjectBuild = class extends Schema.Class("CloudProjectBuild")({
|
|
4106
|
+
buildId: Schema.String,
|
|
4107
|
+
projectId: Schema.String,
|
|
4108
|
+
providerId: Schema.String,
|
|
4109
|
+
state: CloudProjectBuildState,
|
|
4110
|
+
sourceCommit: Schema.optional(Schema.String),
|
|
4111
|
+
templateVersion: Schema.String,
|
|
4112
|
+
configurationDigest: Schema.String,
|
|
4113
|
+
createdAt: Schema.Number,
|
|
4114
|
+
updatedAt: Schema.Number
|
|
4115
|
+
}) {};
|
|
4116
|
+
var CloudProjectPrepareRequest = class extends Schema.Class("CloudProjectPrepareRequest")({
|
|
4117
|
+
projectId: Schema.String,
|
|
4118
|
+
providerId: Schema.String,
|
|
4119
|
+
idempotencyKey: Schema.String
|
|
4120
|
+
}) {};
|
|
4121
|
+
var CloudWorkspace = class extends Schema.Class("CloudWorkspace")({
|
|
4122
|
+
workspaceId: Schema.String,
|
|
4123
|
+
projectId: Schema.String,
|
|
4124
|
+
buildId: Schema.String,
|
|
4125
|
+
providerId: Schema.String,
|
|
4126
|
+
branch: Schema.String,
|
|
4127
|
+
baseRef: Schema.String,
|
|
4128
|
+
state: CloudWorkspaceState,
|
|
4129
|
+
desiredState: CloudWorkspaceDesiredState,
|
|
4130
|
+
statusCode: Schema.String,
|
|
4131
|
+
startupPhase: CloudWorkspaceStartupPhase,
|
|
4132
|
+
startupTimings: CloudWorkspaceStartupTimings,
|
|
4133
|
+
runtimeState: CloudWorkspaceRuntimeState,
|
|
4134
|
+
revision: Schema.Number,
|
|
4135
|
+
chatId: ChatId,
|
|
4136
|
+
initialSessionId: AgentSessionId,
|
|
4137
|
+
createdAt: Schema.Number,
|
|
4138
|
+
updatedAt: Schema.Number,
|
|
4139
|
+
lastActivityAt: Schema.Number
|
|
4140
|
+
}) {};
|
|
4141
|
+
var CloudWorkspaceLaunch = class extends Schema.Class("CloudWorkspaceLaunch")({
|
|
4142
|
+
workspace: CloudWorkspace,
|
|
4143
|
+
chatId: ChatId,
|
|
4144
|
+
initialSessionId: AgentSessionId
|
|
4145
|
+
}) {};
|
|
4146
|
+
var CloudWorkspaceConnection = class extends Schema.Class("CloudWorkspaceConnection")({
|
|
4147
|
+
workspaceId: Schema.String,
|
|
4148
|
+
wsUrl: Schema.String,
|
|
4149
|
+
protocol: Schema.String,
|
|
4150
|
+
role: Schema.Literal("client"),
|
|
4151
|
+
generation: Schema.Number,
|
|
4152
|
+
gatewayEpoch: Schema.Number,
|
|
4153
|
+
credential: Schema.String,
|
|
4154
|
+
expiresAt: Schema.Number
|
|
4155
|
+
}) {};
|
|
4156
|
+
Schema.Class("CloudWorkspaceRuntimeSummary")({
|
|
4157
|
+
summaryRevision: Schema.Number,
|
|
4158
|
+
title: Schema.String,
|
|
4159
|
+
lastActivityAt: Schema.Number,
|
|
4160
|
+
sessionHeadVersion: Schema.Number
|
|
3921
4161
|
});
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
4162
|
+
/** Last-known cloud workspace metadata available without a live runtime. */
|
|
4163
|
+
var CloudChatSummary = class extends Schema.Class("CloudChatSummary")({
|
|
4164
|
+
workspaceId: Schema.String,
|
|
4165
|
+
projectId: Schema.String,
|
|
4166
|
+
repositoryIdentity: Schema.String,
|
|
4167
|
+
repositoryDisplayName: Schema.String,
|
|
4168
|
+
chatId: ChatId,
|
|
4169
|
+
initialSessionId: AgentSessionId,
|
|
4170
|
+
title: Schema.String,
|
|
4171
|
+
branch: Schema.String,
|
|
4172
|
+
providerId: Schema.String,
|
|
4173
|
+
agent: ProviderId,
|
|
4174
|
+
model: Schema.String,
|
|
4175
|
+
state: CloudWorkspaceState,
|
|
4176
|
+
desiredState: CloudWorkspaceDesiredState,
|
|
4177
|
+
runtimeState: CloudWorkspaceRuntimeState,
|
|
4178
|
+
statusCode: Schema.String,
|
|
4179
|
+
startupPhase: CloudWorkspaceStartupPhase,
|
|
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))),
|
|
4185
|
+
unread: Schema.Boolean,
|
|
4186
|
+
lastMessageAt: Schema.NullOr(Schema.Number),
|
|
4187
|
+
archivedAt: Schema.optional(Schema.Number),
|
|
4188
|
+
createdAt: Schema.Number,
|
|
4189
|
+
updatedAt: Schema.Number
|
|
4190
|
+
}) {};
|
|
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
|
|
3950
4198
|
});
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
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
|
|
3954
4214
|
});
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
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)
|
|
3959
4229
|
});
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
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
|
+
})) }) {};
|
|
4244
|
+
var CloudWorkspaceList = class extends Schema.Class("CloudWorkspaceList")({ workspaces: Schema.Array(CloudWorkspace) }) {};
|
|
4245
|
+
var CloudWorkspaceCreateRequest = class extends Schema.Class("CloudWorkspaceCreateRequest")({
|
|
4246
|
+
projectId: Schema.String,
|
|
4247
|
+
providerId: Schema.String,
|
|
4248
|
+
baseRef: Schema.String,
|
|
4249
|
+
branch: Schema.optional(Schema.String),
|
|
4250
|
+
agent: Schema.String,
|
|
4251
|
+
model: Schema.String,
|
|
4252
|
+
credentialKinds: Schema.optional(Schema.Array(CloudCredentialKind)),
|
|
4253
|
+
secretBindings: Schema.optional(Schema.Array(Schema.String)),
|
|
4254
|
+
permissions: Schema.optional(Schema.Array(Schema.String)),
|
|
4255
|
+
firstMessage: Schema.optional(Schema.String),
|
|
4256
|
+
idempotencyKey: Schema.String
|
|
4257
|
+
}) {};
|
|
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
|
+
}) {};
|
|
4281
|
+
var CloudCredentialConnection = class extends Schema.Class("CloudCredentialConnection")({
|
|
4282
|
+
kind: CloudCredentialKind,
|
|
4283
|
+
state: Schema.Literals([
|
|
4284
|
+
"connected",
|
|
4285
|
+
"disconnected",
|
|
4286
|
+
"error"
|
|
4287
|
+
]),
|
|
4288
|
+
version: Schema.Number,
|
|
4289
|
+
accountLabel: Schema.optional(Schema.String),
|
|
4290
|
+
updatedAt: Schema.Number
|
|
4291
|
+
}) {};
|
|
4292
|
+
var CloudCredentialList = class extends Schema.Class("CloudCredentialList")({ credentials: Schema.Array(CloudCredentialConnection) }) {};
|
|
4293
|
+
Schema.Class("CloudCredentialConnectRequest")({
|
|
4294
|
+
kind: CloudCredentialKind,
|
|
4295
|
+
credentialType: Schema.Literals([
|
|
4296
|
+
"api-key",
|
|
4297
|
+
"oauth-token",
|
|
4298
|
+
"repository-token",
|
|
4299
|
+
"native-store"
|
|
4300
|
+
]),
|
|
4301
|
+
secret: Schema.String,
|
|
4302
|
+
accountLabel: Schema.optional(Schema.String)
|
|
3963
4303
|
});
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
4304
|
+
var CloudCredentialDisconnectRequest = class extends Schema.Class("CloudCredentialDisconnectRequest")({ kind: CloudCredentialKind }) {};
|
|
4305
|
+
var CloudWorkspaceOpError = class extends Schema.TaggedErrorClass()("CloudWorkspaceOpError", { code: Schema.Literals([
|
|
4306
|
+
"not-found",
|
|
4307
|
+
"not-allowed",
|
|
4308
|
+
"invalid-request",
|
|
4309
|
+
"entitlement-required",
|
|
4310
|
+
"provider-unavailable",
|
|
4311
|
+
"project-not-ready",
|
|
4312
|
+
"credential-required",
|
|
4313
|
+
"branch-in-use",
|
|
4314
|
+
"conflict",
|
|
4315
|
+
"billing-hold"
|
|
4316
|
+
]) }) {};
|
|
4317
|
+
const CloudProvidersRpc = Rpc.make("cloud.providers", {
|
|
4318
|
+
payload: Schema.Void,
|
|
4319
|
+
success: CloudProviderList,
|
|
4320
|
+
error: CloudWorkspaceOpError
|
|
3973
4321
|
});
|
|
3974
|
-
Rpc.make("
|
|
3975
|
-
payload: Schema.
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
4322
|
+
const CloudProjectsListRpc = Rpc.make("cloud.projects.list", {
|
|
4323
|
+
payload: Schema.Void,
|
|
4324
|
+
success: CloudProjectList,
|
|
4325
|
+
error: CloudWorkspaceOpError
|
|
4326
|
+
});
|
|
4327
|
+
const CloudProjectsConnectRpc = Rpc.make("cloud.projects.connect", {
|
|
4328
|
+
payload: CloudProjectConnectRequest,
|
|
4329
|
+
success: CloudProject,
|
|
4330
|
+
error: CloudWorkspaceOpError
|
|
4331
|
+
});
|
|
4332
|
+
const CloudProjectsPrepareRpc = Rpc.make("cloud.projects.prepare", {
|
|
4333
|
+
payload: CloudProjectPrepareRequest,
|
|
4334
|
+
success: CloudProjectBuild,
|
|
4335
|
+
error: CloudWorkspaceOpError
|
|
4336
|
+
});
|
|
4337
|
+
const CloudWorkspacesListRpc = Rpc.make("cloud.workspaces.list", {
|
|
4338
|
+
payload: Schema.Struct({ projectId: Schema.optional(Schema.String) }),
|
|
4339
|
+
success: CloudWorkspaceList,
|
|
4340
|
+
error: CloudWorkspaceOpError
|
|
3983
4341
|
});
|
|
3984
|
-
Rpc.make("
|
|
4342
|
+
const CloudWorkspacesGetRpc = Rpc.make("cloud.workspaces.get", {
|
|
4343
|
+
payload: CloudWorkspaceActionRequest,
|
|
4344
|
+
success: CloudWorkspace,
|
|
4345
|
+
error: CloudWorkspaceOpError
|
|
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", {
|
|
3985
4352
|
payload: Schema.Struct({
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
limit: Schema.optional(Schema.Number),
|
|
3989
|
-
pathGlob: Schema.optional(Schema.String)
|
|
4353
|
+
workspaceId: Schema.String,
|
|
4354
|
+
afterRevision: Schema.optional(Schema.Number)
|
|
3990
4355
|
}),
|
|
3991
|
-
success:
|
|
4356
|
+
success: CloudWorkspace,
|
|
4357
|
+
error: CloudWorkspaceOpError,
|
|
4358
|
+
stream: true
|
|
4359
|
+
});
|
|
4360
|
+
const CloudWorkspacesCreateRpc = Rpc.make("cloud.workspaces.create", {
|
|
4361
|
+
payload: CloudWorkspaceCreateRequest,
|
|
4362
|
+
success: CloudWorkspaceLaunch,
|
|
4363
|
+
error: CloudWorkspaceOpError
|
|
4364
|
+
});
|
|
4365
|
+
const CloudWorkspacesConnectRpc = Rpc.make("cloud.workspaces.connect", {
|
|
4366
|
+
payload: CloudWorkspaceActionRequest,
|
|
4367
|
+
success: CloudWorkspaceConnection,
|
|
4368
|
+
error: CloudWorkspaceOpError
|
|
3992
4369
|
});
|
|
3993
|
-
Rpc.make("
|
|
4370
|
+
const CloudChatsListRpc = Rpc.make("cloud.chats.list", {
|
|
3994
4371
|
payload: Schema.Struct({
|
|
3995
|
-
|
|
3996
|
-
|
|
4372
|
+
projectId: Schema.optional(Schema.String),
|
|
4373
|
+
scope: Schema.optional(Schema.Literals([
|
|
4374
|
+
"active",
|
|
4375
|
+
"archived",
|
|
4376
|
+
"all"
|
|
4377
|
+
]))
|
|
4378
|
+
}),
|
|
4379
|
+
success: CloudChatList,
|
|
4380
|
+
error: CloudWorkspaceOpError
|
|
4381
|
+
});
|
|
4382
|
+
const CloudWorkspacesPauseRpc = Rpc.make("cloud.workspaces.pause", {
|
|
4383
|
+
payload: CloudWorkspaceActionRequest,
|
|
4384
|
+
success: CloudWorkspace,
|
|
4385
|
+
error: CloudWorkspaceOpError
|
|
4386
|
+
});
|
|
4387
|
+
const CloudWorkspacesResumeRpc = Rpc.make("cloud.workspaces.resume", {
|
|
4388
|
+
payload: CloudWorkspaceResumeRequest,
|
|
4389
|
+
success: CloudWorkspace,
|
|
4390
|
+
error: CloudWorkspaceOpError
|
|
4391
|
+
});
|
|
4392
|
+
/** Restart the runtime of a running workspace in place (same sandbox). */
|
|
4393
|
+
const CloudWorkspacesRestartRpc = Rpc.make("cloud.workspaces.restart", {
|
|
4394
|
+
payload: CloudWorkspaceActionRequest,
|
|
4395
|
+
success: CloudWorkspace,
|
|
4396
|
+
error: CloudWorkspaceOpError
|
|
4397
|
+
});
|
|
4398
|
+
const CloudWorkspacesSshAccessRpc = Rpc.make("cloud.workspaces.sshAccess", {
|
|
4399
|
+
payload: CloudWorkspaceActionRequest,
|
|
4400
|
+
success: CloudWorkspaceSshAccess,
|
|
4401
|
+
error: CloudWorkspaceOpError
|
|
4402
|
+
});
|
|
4403
|
+
const CloudWorkspacesArchiveRpc = Rpc.make("cloud.workspaces.archive", {
|
|
4404
|
+
payload: CloudWorkspaceActionRequest,
|
|
4405
|
+
success: CloudWorkspace,
|
|
4406
|
+
error: CloudWorkspaceOpError
|
|
4407
|
+
});
|
|
4408
|
+
const CloudWorkspacesUnarchiveRpc = Rpc.make("cloud.workspaces.unarchive", {
|
|
4409
|
+
payload: CloudWorkspaceActionRequest,
|
|
4410
|
+
success: CloudWorkspace,
|
|
4411
|
+
error: CloudWorkspaceOpError
|
|
4412
|
+
});
|
|
4413
|
+
const CloudWorkspacesDeleteRpc = Rpc.make("cloud.workspaces.delete", {
|
|
4414
|
+
payload: CloudWorkspaceActionRequest,
|
|
4415
|
+
success: CloudWorkspace,
|
|
4416
|
+
error: CloudWorkspaceOpError
|
|
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)
|
|
3997
4423
|
}),
|
|
3998
|
-
success:
|
|
4424
|
+
success: CloudTranscriptCheckpointResult,
|
|
4425
|
+
error: CloudWorkspaceOpError
|
|
3999
4426
|
});
|
|
4000
|
-
Rpc.make("
|
|
4427
|
+
const CloudTranscriptMessagePageGetRpc = Rpc.make("cloud.transcript.messages.page", {
|
|
4001
4428
|
payload: Schema.Struct({
|
|
4002
|
-
|
|
4003
|
-
|
|
4429
|
+
workspaceId: Schema.String,
|
|
4430
|
+
sessionId: AgentSessionId,
|
|
4431
|
+
cursor: SessionStreamCursor,
|
|
4432
|
+
beforeSequence: Schema.Number
|
|
4004
4433
|
}),
|
|
4005
|
-
success:
|
|
4434
|
+
success: CloudTranscriptMessagePageResult,
|
|
4435
|
+
error: CloudWorkspaceOpError
|
|
4436
|
+
});
|
|
4437
|
+
const CloudCredentialsListRpc = Rpc.make("cloud.credentials.list", {
|
|
4438
|
+
payload: Schema.Void,
|
|
4439
|
+
success: CloudCredentialList,
|
|
4440
|
+
error: CloudWorkspaceOpError
|
|
4441
|
+
});
|
|
4442
|
+
const CloudCredentialsImportLocalRpc = Rpc.make("cloud.credentials.importLocal", {
|
|
4443
|
+
payload: Schema.Struct({ kind: CloudCredentialKind }),
|
|
4444
|
+
success: CloudCredentialConnection,
|
|
4445
|
+
error: CloudWorkspaceOpError
|
|
4446
|
+
});
|
|
4447
|
+
const CloudCredentialsDisconnectRpc = Rpc.make("cloud.credentials.disconnect", {
|
|
4448
|
+
payload: CloudCredentialDisconnectRequest,
|
|
4449
|
+
success: CloudCredentialConnection,
|
|
4450
|
+
error: CloudWorkspaceOpError
|
|
4451
|
+
});
|
|
4452
|
+
//#endregion
|
|
4453
|
+
//#region ../contracts/src/cloud-billing.ts
|
|
4454
|
+
const CloudBillingStatus = Schema.Literals([
|
|
4455
|
+
"active",
|
|
4456
|
+
"grace",
|
|
4457
|
+
"billing-hold",
|
|
4458
|
+
"ended",
|
|
4459
|
+
"manual"
|
|
4460
|
+
]);
|
|
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"
|
|
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
|
|
4517
|
+
});
|
|
4518
|
+
const CloudBillingUsageRpc = Rpc.make("cloud.billing.usage", {
|
|
4519
|
+
payload: CloudBillingUsageRequest,
|
|
4520
|
+
success: CloudBillingUsagePage,
|
|
4521
|
+
error: CloudWorkspaceOpError
|
|
4522
|
+
});
|
|
4523
|
+
const CloudBillingSetCapRpc = Rpc.make("cloud.billing.setCap", {
|
|
4524
|
+
payload: CloudBillingCapRequest,
|
|
4525
|
+
success: CloudBillingSummary,
|
|
4526
|
+
error: CloudWorkspaceOpError
|
|
4006
4527
|
});
|
|
4007
4528
|
//#endregion
|
|
4008
4529
|
//#region ../contracts/src/connect.ts
|
|
@@ -4497,6 +5018,7 @@ var GithubRepoSummary = class extends Schema.Class("GithubRepoSummary")({
|
|
|
4497
5018
|
sshUrl: Schema.String,
|
|
4498
5019
|
httpsUrl: Schema.String,
|
|
4499
5020
|
isPrivate: Schema.Boolean,
|
|
5021
|
+
defaultBranch: Schema.String,
|
|
4500
5022
|
updatedAt: Schema.DateFromString
|
|
4501
5023
|
}) {};
|
|
4502
5024
|
/**
|
|
@@ -4773,9 +5295,18 @@ const GitUserNameRpc = Rpc.make("git.userName", {
|
|
|
4773
5295
|
success: Schema.Struct({ userName: Schema.String }),
|
|
4774
5296
|
error: GitErrors
|
|
4775
5297
|
});
|
|
4776
|
-
|
|
4777
|
-
|
|
4778
|
-
|
|
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 }),
|
|
4779
5310
|
error: GitErrors,
|
|
4780
5311
|
stream: true
|
|
4781
5312
|
});
|
|
@@ -5327,26 +5858,6 @@ const GitRevertAllRpc = Rpc.make("git.revertAll", {
|
|
|
5327
5858
|
success: Schema.Struct({ reverted: Schema.Boolean }),
|
|
5328
5859
|
error: GitErrors
|
|
5329
5860
|
});
|
|
5330
|
-
/**
|
|
5331
|
-
* Total additions/deletions of a worktree's branch — including uncommitted
|
|
5332
|
-
* working-tree edits — relative to its base branch. Computed as
|
|
5333
|
-
* `git diff --numstat <merge-base(base, HEAD)>`, where `base` is the repo's
|
|
5334
|
-
* default branch (`origin/HEAD`, falling back to origin/main, main, …). Drives
|
|
5335
|
-
* the projects sidebar's per-chat `+N −N` stats so a branch shows its diff
|
|
5336
|
-
* even before a PR is opened. Returns zeros rather than failing when there's
|
|
5337
|
-
* no base, no commits, or no diff.
|
|
5338
|
-
*/
|
|
5339
|
-
const GitDiffStatRpc = Rpc.make("git.diffStat", {
|
|
5340
|
-
payload: Schema.Struct({
|
|
5341
|
-
folderId: FolderId,
|
|
5342
|
-
worktreeId: Schema.optional(Schema.NullOr(WorktreeId))
|
|
5343
|
-
}),
|
|
5344
|
-
success: Schema.Struct({
|
|
5345
|
-
additions: Schema.Number,
|
|
5346
|
-
deletions: Schema.Number
|
|
5347
|
-
}),
|
|
5348
|
-
error: GitErrors
|
|
5349
|
-
});
|
|
5350
5861
|
//#endregion
|
|
5351
5862
|
//#region ../contracts/src/handshake.ts
|
|
5352
5863
|
var WireHello = class extends Schema.Class("WireHello")({ protocolVersion: Schema.Number }) {};
|
|
@@ -5563,8 +6074,10 @@ const LinearPrepareContextRpc = Rpc.make("linear.prepareContext", {
|
|
|
5563
6074
|
//#endregion
|
|
5564
6075
|
//#region ../contracts/src/machines.ts
|
|
5565
6076
|
const MachineArchitecture = Schema.Literals(["x86_64"]);
|
|
6077
|
+
const MachineOfferKind = Schema.Literals(["persistent", "sandbox"]);
|
|
5566
6078
|
var MachineOffer = class extends Schema.Class("MachineOffer")({
|
|
5567
6079
|
offerId: Schema.String,
|
|
6080
|
+
kind: MachineOfferKind.pipe(Schema.withDecodingDefaultKey(Effect.succeed("persistent"))),
|
|
5568
6081
|
displayName: Schema.String,
|
|
5569
6082
|
architecture: MachineArchitecture,
|
|
5570
6083
|
vcpuCount: Schema.Number,
|
|
@@ -5661,6 +6174,21 @@ Schema.Class("MachineEnrollRequest")({
|
|
|
5661
6174
|
}),
|
|
5662
6175
|
label: Schema.optional(Schema.String)
|
|
5663
6176
|
});
|
|
6177
|
+
var CloudRuntimeCredential = class extends Schema.Class("CloudRuntimeCredential")({
|
|
6178
|
+
kind: Schema.Literals([
|
|
6179
|
+
"github",
|
|
6180
|
+
"claude",
|
|
6181
|
+
"codex"
|
|
6182
|
+
]),
|
|
6183
|
+
credentialType: Schema.Literals([
|
|
6184
|
+
"api-key",
|
|
6185
|
+
"oauth-token",
|
|
6186
|
+
"repository-token",
|
|
6187
|
+
"native-store"
|
|
6188
|
+
]),
|
|
6189
|
+
secret: Schema.String,
|
|
6190
|
+
version: Schema.Number
|
|
6191
|
+
}) {};
|
|
5664
6192
|
Schema.Class("MachineEnrollResponse")({
|
|
5665
6193
|
environmentId: EnvironmentId,
|
|
5666
6194
|
endpoint: EnvironmentEndpoint,
|
|
@@ -5668,13 +6196,18 @@ Schema.Class("MachineEnrollResponse")({
|
|
|
5668
6196
|
environmentCredential: Schema.String,
|
|
5669
6197
|
mintPublicKey: Schema.String,
|
|
5670
6198
|
tunnelHostname: Schema.optional(Schema.String),
|
|
5671
|
-
connectorToken: Schema.optional(Schema.String)
|
|
6199
|
+
connectorToken: Schema.optional(Schema.String),
|
|
6200
|
+
cloudCredentials: Schema.optional(Schema.Array(CloudRuntimeCredential))
|
|
5672
6201
|
});
|
|
5673
6202
|
Schema.Class("MachineBootStatusRequest")({
|
|
5674
6203
|
phase: MachineBootPhase,
|
|
5675
6204
|
statusCode: Schema.optional(MachineStatusCode)
|
|
5676
6205
|
});
|
|
5677
|
-
const EntitlementKind = Schema.Literals([
|
|
6206
|
+
const EntitlementKind = Schema.Literals([
|
|
6207
|
+
"persistent-machine",
|
|
6208
|
+
"cloud-workspace",
|
|
6209
|
+
"usage-credits"
|
|
6210
|
+
]);
|
|
5678
6211
|
const EntitlementStatus = Schema.Literals([
|
|
5679
6212
|
"pending",
|
|
5680
6213
|
"active",
|
|
@@ -5705,6 +6238,8 @@ const MachineErrorCode = Schema.Literals([
|
|
|
5705
6238
|
"provider-unavailable",
|
|
5706
6239
|
"enrollment-expired",
|
|
5707
6240
|
"enrollment-rejected",
|
|
6241
|
+
"credential-required",
|
|
6242
|
+
"branch-in-use",
|
|
5708
6243
|
"conflict",
|
|
5709
6244
|
"invalid-request"
|
|
5710
6245
|
]);
|
|
@@ -5861,6 +6396,23 @@ const MachineRuntimeUpdateRpc = Rpc.make("machine.runtime.update", {
|
|
|
5861
6396
|
success: MachineRuntimeStatus,
|
|
5862
6397
|
error: MachineOpError
|
|
5863
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
|
+
});
|
|
5864
6416
|
const AccountAccessProvider = Schema.Literals([
|
|
5865
6417
|
"github",
|
|
5866
6418
|
"claude",
|
|
@@ -5941,7 +6493,8 @@ const AccountAccessErrorCode = Schema.Literals([
|
|
|
5941
6493
|
"transfer-replayed",
|
|
5942
6494
|
"transfer-rejected",
|
|
5943
6495
|
"credential-store-failed",
|
|
5944
|
-
"cleanup-failed"
|
|
6496
|
+
"cleanup-failed",
|
|
6497
|
+
"credential-export-failed"
|
|
5945
6498
|
]);
|
|
5946
6499
|
var AccountAccessOpError = class extends Schema.TaggedErrorClass()("AccountAccessOpError", { code: AccountAccessErrorCode }) {};
|
|
5947
6500
|
const AccountAccessStatusRpc = Rpc.make("accountAccess.status", {
|
|
@@ -6316,6 +6869,20 @@ var SavedDecision = class extends Schema.Class("SavedDecision")({
|
|
|
6316
6869
|
decidedAt: Schema.DateFromString
|
|
6317
6870
|
}) {};
|
|
6318
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
|
+
]);
|
|
6319
6886
|
/**
|
|
6320
6887
|
* Live stream of pending requests across every session. The renderer
|
|
6321
6888
|
* filters by selected session; broadcasting once and filtering on the
|
|
@@ -6324,7 +6891,7 @@ var PermissionRequestNotFoundError = class extends Schema.TaggedErrorClass()("Pe
|
|
|
6324
6891
|
*/
|
|
6325
6892
|
const PermissionRequestsRpc = Rpc.make("permission.requests", {
|
|
6326
6893
|
payload: Schema.Struct({}),
|
|
6327
|
-
success:
|
|
6894
|
+
success: PermissionRequestChange,
|
|
6328
6895
|
stream: true
|
|
6329
6896
|
});
|
|
6330
6897
|
const PermissionDecideRpc = Rpc.make("permission.decide", {
|
|
@@ -6920,6 +7487,8 @@ var RepositorySettings = class extends Schema.Class("RepositorySettings")({
|
|
|
6920
7487
|
runScript: Schema.NullOr(Schema.String),
|
|
6921
7488
|
autoRunAfterSetup: Schema.Boolean,
|
|
6922
7489
|
environmentVariables: Schema.Record(Schema.String, Schema.String),
|
|
7490
|
+
/** Non-secret overrides applied only while preparing or running in cloud. */
|
|
7491
|
+
cloudEnvironmentVariables: Schema.Record(Schema.String, Schema.String).pipe(Schema.withDecodingDefaultKey(Effect.succeed({}))),
|
|
6923
7492
|
/**
|
|
6924
7493
|
* Newline-separated gitignore-style patterns for local files that should be
|
|
6925
7494
|
* linked into every Zuse worktree from the main checkout. Empty means "use
|
|
@@ -6949,6 +7518,7 @@ const RepositorySettingsPatch = Schema.Struct({
|
|
|
6949
7518
|
runScript: Schema.optional(Schema.NullOr(Schema.String)),
|
|
6950
7519
|
autoRunAfterSetup: Schema.optional(Schema.Boolean),
|
|
6951
7520
|
environmentVariables: Schema.optional(Schema.Record(Schema.String, Schema.String)),
|
|
7521
|
+
cloudEnvironmentVariables: Schema.optional(Schema.Record(Schema.String, Schema.String)),
|
|
6952
7522
|
fileIncludeGlobs: Schema.optional(Schema.String),
|
|
6953
7523
|
mcpDisabledServers: Schema.optional(Schema.Array(Schema.String))
|
|
6954
7524
|
});
|
|
@@ -6964,6 +7534,7 @@ Schema.Struct({
|
|
|
6964
7534
|
runScript: Schema.NullOr(Schema.String),
|
|
6965
7535
|
autoRunAfterSetup: Schema.Boolean,
|
|
6966
7536
|
environmentVariables: Schema.Record(Schema.String, Schema.String),
|
|
7537
|
+
cloudEnvironmentVariables: Schema.Record(Schema.String, Schema.String).pipe(Schema.withDecodingDefaultKey(Effect.succeed({}))),
|
|
6967
7538
|
fileIncludeGlobs: Schema.String,
|
|
6968
7539
|
mcpDisabledServers: Schema.Array(Schema.String)
|
|
6969
7540
|
});
|
|
@@ -7446,7 +8017,7 @@ const UsageLimitsHistoryRpc = Rpc.make("usage.limits.history", {
|
|
|
7446
8017
|
*
|
|
7447
8018
|
* Add new RPCs by importing them here and including them in the group.
|
|
7448
8019
|
*/
|
|
7449
|
-
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, MachinesOffersRpc, MachinesListRpc, MachinesGetRpc, MachinesCreateRpc, MachinesCancelRpc, MachinesRecoverRpc, MachinesDestroyRpc, MachinesCheckoutRpc, MachinesBillingPortalRpc, MachinesEntitlementsRpc, MachineSshKeysAddRpc, MachineSshKeysListRpc, MachineSshKeysRemoveRpc, MachinePrivateNetworkEnableRpc, MachinePrivateNetworkStatusRpc, MachineRuntimeTargetRpc, MachineRuntimeStatusRpc, MachineRuntimeUpdateRpc, 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,
|
|
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);
|
|
7450
8021
|
//#endregion
|
|
7451
8022
|
//#region ../contracts/src/serve.ts
|
|
7452
8023
|
const ServeServiceState = Schema.Literals([
|
|
@@ -7574,7 +8145,7 @@ const authenticatedWsUrl = (options) => {
|
|
|
7574
8145
|
const base = options.wsBaseUrl?.trim();
|
|
7575
8146
|
const url = new URL(base && base.length > 0 ? base : wsUrl(options));
|
|
7576
8147
|
if (options.token?.trim()) url.searchParams.set("token", options.token.trim());
|
|
7577
|
-
return withWireProtocolVersion(url.toString(),
|
|
8148
|
+
return withWireProtocolVersion(url.toString(), 5);
|
|
7578
8149
|
};
|
|
7579
8150
|
const wsClientProtocolLayer = (endpoint, options) => {
|
|
7580
8151
|
const makeWebSocket = options?.onClose === void 0 ? options?.makeWebSocket : observeWebSocketConstructor(options.makeWebSocket ?? ((url, protocols) => new globalThis.WebSocket(url, protocols)), options.onClose);
|
|
@@ -7582,6 +8153,7 @@ const wsClientProtocolLayer = (endpoint, options) => {
|
|
|
7582
8153
|
};
|
|
7583
8154
|
//#endregion
|
|
7584
8155
|
//#region src/agent-cli.ts
|
|
8156
|
+
const commandId = (kind) => CommandId.make(`${kind}:${randomUUID()}`);
|
|
7585
8157
|
const GROUPS = /* @__PURE__ */ new Set([
|
|
7586
8158
|
"commands",
|
|
7587
8159
|
"computer",
|
|
@@ -7711,14 +8283,14 @@ const endpoint = async (args, env) => {
|
|
|
7711
8283
|
const raw = one(args, "ws-url") ?? env.ZUSE_WS_URL ?? access?.wsUrl ?? `ws://127.0.0.1:${env.ZUSE_PORT ?? "47837"}/rpc`;
|
|
7712
8284
|
const url = new URL(raw);
|
|
7713
8285
|
if (url.pathname === "/") url.pathname = "/rpc";
|
|
7714
|
-
url.searchParams.set("wireVersion", String(
|
|
8286
|
+
url.searchParams.set("wireVersion", String(5));
|
|
7715
8287
|
const token = one(args, "token") ?? env.ZUSE_TOKEN ?? access?.token;
|
|
7716
8288
|
if (token !== void 0) url.searchParams.set("token", token);
|
|
7717
8289
|
return url.toString();
|
|
7718
8290
|
};
|
|
7719
8291
|
const connect = async (args, env) => {
|
|
7720
8292
|
return makeRpcClientSession(wsClientProtocolLayer(await endpoint(args, env)), MemoizeRpcs, {
|
|
7721
|
-
protocolVersion:
|
|
8293
|
+
protocolVersion: 5,
|
|
7722
8294
|
perform: (client, hello) => client["connect.handshake"](hello)
|
|
7723
8295
|
});
|
|
7724
8296
|
};
|
|
@@ -8091,6 +8663,7 @@ const execute = async (argv, env) => {
|
|
|
8091
8663
|
permissionMode: permission(args)
|
|
8092
8664
|
}));
|
|
8093
8665
|
if (prompt || context.attachments.length || context.fileRefs.length) await rpc(client["messages.send"]({
|
|
8666
|
+
commandId: commandId("message-send"),
|
|
8094
8667
|
sessionId: created.id,
|
|
8095
8668
|
input: composer(prompt, context)
|
|
8096
8669
|
}));
|
|
@@ -8137,6 +8710,7 @@ const execute = async (argv, env) => {
|
|
|
8137
8710
|
return { session: await rpc(client["session.get"]({ sessionId: selectedSessionId })) };
|
|
8138
8711
|
}
|
|
8139
8712
|
if (group === "session" && action === "rename") return { session: await rpc(client["session.rename"]({
|
|
8713
|
+
commandId: commandId("session-rename"),
|
|
8140
8714
|
sessionId: selectedSessionId,
|
|
8141
8715
|
title: required(one(args, "title"), "--title")
|
|
8142
8716
|
})) };
|
|
@@ -8166,14 +8740,17 @@ const execute = async (argv, env) => {
|
|
|
8166
8740
|
const context = await contextFor(client, args, selectedSessionId, project);
|
|
8167
8741
|
const text = await promptFor(args, true);
|
|
8168
8742
|
if (one(args, "permission")) await rpc(client["session.setPermissionMode"]({
|
|
8743
|
+
commandId: commandId("session-permission-mode"),
|
|
8169
8744
|
sessionId: selectedSessionId,
|
|
8170
8745
|
mode: permission(args)
|
|
8171
8746
|
}));
|
|
8172
8747
|
if (one(args, "runtime")) await rpc(client["session.setRuntimeMode"]({
|
|
8748
|
+
commandId: commandId("session-runtime-mode"),
|
|
8173
8749
|
sessionId: selectedSessionId,
|
|
8174
8750
|
runtimeMode: runtime(args)
|
|
8175
8751
|
}));
|
|
8176
8752
|
await rpc(client["messages.send"]({
|
|
8753
|
+
commandId: commandId("message-send"),
|
|
8177
8754
|
sessionId: selectedSessionId,
|
|
8178
8755
|
input: composer(text, context)
|
|
8179
8756
|
}));
|
|
@@ -8219,6 +8796,7 @@ const execute = async (argv, env) => {
|
|
|
8219
8796
|
const input = composer(await promptFor(args, true), context);
|
|
8220
8797
|
if (action === "queue-add") return {
|
|
8221
8798
|
item: await rpc(client["messages.queue.add"]({
|
|
8799
|
+
commandId: commandId("queue-add"),
|
|
8222
8800
|
sessionId: selectedSessionId,
|
|
8223
8801
|
input,
|
|
8224
8802
|
...one(args, "queue") ? { queueId: one(args, "queue") } : {},
|
|
@@ -8229,6 +8807,7 @@ const execute = async (argv, env) => {
|
|
|
8229
8807
|
};
|
|
8230
8808
|
return {
|
|
8231
8809
|
item: await rpc(client["messages.queue.update"]({
|
|
8810
|
+
commandId: commandId("queue-update"),
|
|
8232
8811
|
sessionId: selectedSessionId,
|
|
8233
8812
|
queueId: required(one(args, "queue"), "--queue"),
|
|
8234
8813
|
input
|
|
@@ -8239,6 +8818,7 @@ const execute = async (argv, env) => {
|
|
|
8239
8818
|
if (group === "session" && action === "queue-delete") {
|
|
8240
8819
|
const queueId = required(one(args, "queue"), "--queue");
|
|
8241
8820
|
await rpc(client["messages.queue.delete"]({
|
|
8821
|
+
commandId: commandId("queue-delete"),
|
|
8242
8822
|
sessionId: selectedSessionId,
|
|
8243
8823
|
queueId
|
|
8244
8824
|
}));
|
|
@@ -8249,12 +8829,14 @@ const execute = async (argv, env) => {
|
|
|
8249
8829
|
};
|
|
8250
8830
|
}
|
|
8251
8831
|
if (group === "session" && action === "queue-reorder") return { items: await rpc(client["messages.queue.reorder"]({
|
|
8832
|
+
commandId: commandId("queue-reorder"),
|
|
8252
8833
|
sessionId: selectedSessionId,
|
|
8253
8834
|
queueIds: many(args, "queue")
|
|
8254
8835
|
})) };
|
|
8255
8836
|
if (group === "session" && action === "queue-run-next") {
|
|
8256
8837
|
const queueId = required(one(args, "queue"), "--queue");
|
|
8257
8838
|
await rpc(client["messages.queue.runNext"]({
|
|
8839
|
+
commandId: commandId("queue-run-next"),
|
|
8258
8840
|
sessionId: selectedSessionId,
|
|
8259
8841
|
queueId
|
|
8260
8842
|
}));
|
|
@@ -8265,14 +8847,20 @@ const execute = async (argv, env) => {
|
|
|
8265
8847
|
};
|
|
8266
8848
|
}
|
|
8267
8849
|
if (group === "session" && action === "queue-flush") {
|
|
8268
|
-
await rpc(client["messages.queue.flush"]({
|
|
8850
|
+
await rpc(client["messages.queue.flush"]({
|
|
8851
|
+
commandId: commandId("queue-flush"),
|
|
8852
|
+
sessionId: selectedSessionId
|
|
8853
|
+
}));
|
|
8269
8854
|
return {
|
|
8270
8855
|
sessionId: selectedSessionId,
|
|
8271
8856
|
flushed: true
|
|
8272
8857
|
};
|
|
8273
8858
|
}
|
|
8274
8859
|
if (group === "session" && action === "queue-resume") {
|
|
8275
|
-
await rpc(client["messages.queue.resume"]({
|
|
8860
|
+
await rpc(client["messages.queue.resume"]({
|
|
8861
|
+
commandId: commandId("queue-resume"),
|
|
8862
|
+
sessionId: selectedSessionId
|
|
8863
|
+
}));
|
|
8276
8864
|
return {
|
|
8277
8865
|
sessionId: selectedSessionId,
|
|
8278
8866
|
resumed: true
|
|
@@ -8281,17 +8869,22 @@ const execute = async (argv, env) => {
|
|
|
8281
8869
|
if (group === "session" && action === "mode") {
|
|
8282
8870
|
if (!one(args, "permission") && !one(args, "runtime")) throw new CliError("invalid_input", "session mode requires --permission or --runtime.");
|
|
8283
8871
|
if (one(args, "permission")) await rpc(client["session.setPermissionMode"]({
|
|
8872
|
+
commandId: commandId("session-permission-mode"),
|
|
8284
8873
|
sessionId: selectedSessionId,
|
|
8285
8874
|
mode: permission(args)
|
|
8286
8875
|
}));
|
|
8287
8876
|
if (one(args, "runtime")) await rpc(client["session.setRuntimeMode"]({
|
|
8877
|
+
commandId: commandId("session-runtime-mode"),
|
|
8288
8878
|
sessionId: selectedSessionId,
|
|
8289
8879
|
runtimeMode: runtime(args)
|
|
8290
8880
|
}));
|
|
8291
8881
|
return { session: await rpc(client["session.get"]({ sessionId: selectedSessionId })) };
|
|
8292
8882
|
}
|
|
8293
8883
|
if (group === "session" && action === "interrupt") {
|
|
8294
|
-
await rpc(client["messages.interrupt"]({
|
|
8884
|
+
await rpc(client["messages.interrupt"]({
|
|
8885
|
+
commandId: commandId("message-interrupt"),
|
|
8886
|
+
sessionId: selectedSessionId
|
|
8887
|
+
}));
|
|
8295
8888
|
return {
|
|
8296
8889
|
sessionId: selectedSessionId,
|
|
8297
8890
|
interrupted: true
|
|
@@ -8320,4 +8913,4 @@ const runServeCli = async (argv, env = process.env) => {
|
|
|
8320
8913
|
//#endregion
|
|
8321
8914
|
export { runServeCli as t };
|
|
8322
8915
|
|
|
8323
|
-
//# sourceMappingURL=cli-
|
|
8916
|
+
//# sourceMappingURL=cli-CHHBM6zs.mjs.map
|