@codexhost/cli-win32-arm64 0.26.1 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/app/codexhost-distribution.json +1 -1
- package/app/console-server.mjs +1010 -592
- package/app/console-web.js +1861 -1498
- package/app/desktop-controller.mjs +488 -245
- package/app/host-runtime.mjs +9177 -4006
- package/app/plugins/antigravity/plugin.mjs +9055 -548
- package/app/plugins/claude-code/plugin.mjs +1117 -423
- package/app/plugins/codebuddy/plugin.mjs +599 -261
- package/app/plugins/codex-usage/plugin.mjs +1808 -1357
- package/app/plugins/copilot/plugin.mjs +491 -235
- package/app/plugins/cursor-cli/plugin.mjs +487 -232
- package/app/plugins/deepseek-harness/plugin.mjs +493 -235
- package/app/plugins/devin/plugin.mjs +467 -232
- package/app/plugins/grok/plugin.mjs +547 -253
- package/app/plugins/hermes/plugin.mjs +468 -232
- package/app/plugins/kimi-code/plugin.mjs +762 -439
- package/app/plugins/kiro-cli/plugin.mjs +466 -232
- package/app/plugins/omp/plugin.mjs +1705 -1356
- package/app/plugins/opencode/manifest.json +1 -1
- package/app/plugins/opencode/plugin.mjs +544 -250
- package/app/plugins/pi/plugin.mjs +761 -364
- package/app/plugins/qoder/plugin.mjs +540 -246
- package/app/plugins/qoder-cn/plugin.mjs +540 -246
- package/app/plugins/qwen-code/plugin.mjs +466 -232
- package/app/plugins/workbuddy/plugin.mjs +594 -273
- package/app/plugins/zcode/plugin.mjs +468 -232
- package/app/renderer-extension.js +2653 -657
- package/app/web/assets/index-DBPgg32z.css +1 -0
- package/app/web/assets/index-DWxiVzuS.js +204 -0
- package/app/web/codexhost-settings.js +101 -66
- package/app/web/index.html +2 -2
- package/app/web/plugins/deepseek-ai__dsh-api-remotes/client.js +65 -65
- package/app/web/plugins/deepseek-ai__dsh-api-session-controller/client.js +69 -69
- package/app/web/plugins/deepseek-ai__dsh-client-shortcuts/client.js +2 -2
- package/app/web/plugins/deepseek-ai__dsh-client-ui-approval/client.js +4 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-chat/client.js +75 -75
- package/app/web/plugins/deepseek-ai__dsh-client-ui-codexhost/client.js +73 -73
- package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +19 -19
- package/app/web/plugins/deepseek-ai__dsh-client-ui-input-trigger/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-layout/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-model-selection/client.js +5 -5
- package/app/web/plugins/deepseek-ai__dsh-client-ui-settings-general/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-shortcuts/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-documentpreview/client.pdf.js +2 -2
- package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-right/client.js +2 -2
- package/app/web/plugins/deepseek-ai__dsh-client-ui-tool/client.js +18 -18
- package/app/web/plugins/deepseek-ai__dsh-client-ui-user-questions/client.js +4 -4
- package/app/web/plugins/deepseek-ai__dsh-client-ui-workspace/client.js +71 -71
- package/app/web/plugins.json +2 -1
- package/app/web-modules/server.mjs +5065 -1964
- package/bin/codexhost.exe +0 -0
- package/libexec/codexhost-node-repl.exe +0 -0
- package/libexec/codexhost-shell.exe +0 -0
- package/libexec/codexhost-shim.exe +0 -0
- package/libexec/codexhost-updater.exe +0 -0
- package/package.json +1 -1
- package/app/web/assets/index-CR4Y8Ndj.css +0 -1
- package/app/web/assets/index-Dw-yHAxN.js +0 -196
|
@@ -19858,6 +19858,38 @@ var threadPermissionModeSelectParamsSchema = external_exports.object({
|
|
|
19858
19858
|
// ../../shared-contracts/dist/harness-route-limit.js
|
|
19859
19859
|
var HARNESS_TRANSPORT_MODEL_ID_MAX_LENGTH = 8192;
|
|
19860
19860
|
|
|
19861
|
+
// ../../shared-contracts/dist/thread-handoff.js
|
|
19862
|
+
var nonBlankTextSchema2 = external_exports.string().refine((value) => value.trim().length > 0, {
|
|
19863
|
+
message: "Value must not be empty or whitespace"
|
|
19864
|
+
});
|
|
19865
|
+
var THREAD_HANDOFF_METHOD = "codexhost/thread/handoff";
|
|
19866
|
+
var threadHandoffParamsSchema = external_exports.object({
|
|
19867
|
+
sourceThreadId: hostThreadIdSchema,
|
|
19868
|
+
lastTurnId: hostTurnIdSchema.optional(),
|
|
19869
|
+
targetHarnessId: harnessIdSchema,
|
|
19870
|
+
targetModel: nonBlankTextSchema2.max(1024).optional(),
|
|
19871
|
+
targetThinkingOptionId: nonBlankTextSchema2.max(128).regex(/^[A-Za-z0-9._~-]+$/u, "Thinking option ID must use transport-safe characters").optional()
|
|
19872
|
+
}).strict();
|
|
19873
|
+
var threadHandoffMetadataSchema = external_exports.object({
|
|
19874
|
+
sourceThreadId: hostThreadIdSchema,
|
|
19875
|
+
sourceHarnessId: harnessIdSchema,
|
|
19876
|
+
sourceHarnessLabel: nonBlankTextSchema2.max(256).optional(),
|
|
19877
|
+
sourceModel: nonBlankTextSchema2.max(1024).optional(),
|
|
19878
|
+
targetHarnessId: harnessIdSchema,
|
|
19879
|
+
targetHarnessLabel: nonBlankTextSchema2.max(256).optional(),
|
|
19880
|
+
targetModel: nonBlankTextSchema2.max(1024).optional(),
|
|
19881
|
+
totalTurns: external_exports.number().int().min(1),
|
|
19882
|
+
boundaryTurnNumber: external_exports.number().int().min(1),
|
|
19883
|
+
includedTurnNumbers: external_exports.array(external_exports.number().int().min(1)),
|
|
19884
|
+
omittedTurns: external_exports.number().int().min(0),
|
|
19885
|
+
preview: external_exports.string().max(32e3),
|
|
19886
|
+
createdAtMs: external_exports.number().int().nonnegative()
|
|
19887
|
+
}).strict();
|
|
19888
|
+
var threadHandoffResultSchema = external_exports.object({
|
|
19889
|
+
threadId: hostThreadIdSchema,
|
|
19890
|
+
handoff: threadHandoffMetadataSchema
|
|
19891
|
+
}).strict();
|
|
19892
|
+
|
|
19861
19893
|
// ../../shared-contracts/dist/thread-usage.js
|
|
19862
19894
|
var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonnegative();
|
|
19863
19895
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
@@ -20041,7 +20073,7 @@ var HARNESS_MODEL_REF_MAX_LENGTH = 512;
|
|
|
20041
20073
|
var HARNESS_MODEL_LABEL_MAX_LENGTH = 256;
|
|
20042
20074
|
var HARNESS_THINKING_OPTION_ID_MAX_LENGTH = 128;
|
|
20043
20075
|
var THREAD_OWNERSHIP_LIST_MAX_LENGTH = 100;
|
|
20044
|
-
var
|
|
20076
|
+
var nonBlankTextSchema3 = external_exports.string().refine((value) => value.trim().length > 0, {
|
|
20045
20077
|
message: "Value must not be empty or whitespace"
|
|
20046
20078
|
});
|
|
20047
20079
|
var harnessModelRefIdSchema = external_exports.string().min(1).max(HARNESS_MODEL_REF_MAX_LENGTH).refine((id2) => !new RegExp("\\p{Cc}", "u").test(id2), "Model Ref must not contain control characters").brand();
|
|
@@ -20053,15 +20085,15 @@ var harnessModelRefSchema = external_exports.object({
|
|
|
20053
20085
|
function sameHarnessModelRef(left, right) {
|
|
20054
20086
|
return left?.id === right?.id && left?.serviceTier === right?.serviceTier;
|
|
20055
20087
|
}
|
|
20056
|
-
var harnessThinkingOptionIdSchema =
|
|
20057
|
-
var harnessResolvedModelLabelSchema =
|
|
20088
|
+
var harnessThinkingOptionIdSchema = nonBlankTextSchema3.max(HARNESS_THINKING_OPTION_ID_MAX_LENGTH).regex(/^[A-Za-z0-9._~-]+$/u, "Thinking option ID must use transport-safe characters").brand();
|
|
20089
|
+
var harnessResolvedModelLabelSchema = nonBlankTextSchema3.max(HARNESS_MODEL_LABEL_MAX_LENGTH);
|
|
20058
20090
|
var harnessThinkingOptionSchema = external_exports.object({
|
|
20059
20091
|
id: harnessThinkingOptionIdSchema,
|
|
20060
|
-
label:
|
|
20092
|
+
label: nonBlankTextSchema3.max(HARNESS_MODEL_LABEL_MAX_LENGTH)
|
|
20061
20093
|
}).strict();
|
|
20062
20094
|
var harnessModelSchema = external_exports.object({
|
|
20063
20095
|
ref: harnessModelRefSchema,
|
|
20064
|
-
label:
|
|
20096
|
+
label: nonBlankTextSchema3.max(HARNESS_MODEL_LABEL_MAX_LENGTH),
|
|
20065
20097
|
resolvedModelLabel: harnessResolvedModelLabelSchema.optional(),
|
|
20066
20098
|
/** Optional opaque selection for this same Model with priority processing enabled. */
|
|
20067
20099
|
fastModel: harnessModelRefSchema.optional(),
|
|
@@ -20088,11 +20120,21 @@ var harnessThinkingOptionsSchema = external_exports.array(harnessThinkingOptionS
|
|
|
20088
20120
|
ids.add(option.id);
|
|
20089
20121
|
}
|
|
20090
20122
|
});
|
|
20123
|
+
var harnessThinkingOptionsScopeSchema = external_exports.enum(["catalog", "activeModel"]);
|
|
20091
20124
|
var harnessModelCatalogSchema = external_exports.object({
|
|
20092
20125
|
models: external_exports.array(harnessModelSchema),
|
|
20093
20126
|
defaultModel: harnessModelRefSchema.optional(),
|
|
20094
20127
|
thinkingOptions: harnessThinkingOptionsSchema,
|
|
20095
|
-
defaultThinkingOptionId: harnessThinkingOptionIdSchema.optional()
|
|
20128
|
+
defaultThinkingOptionId: harnessThinkingOptionIdSchema.optional(),
|
|
20129
|
+
/**
|
|
20130
|
+
* Scope of per-Model `supportedThinkingOptionIds` in this catalog.
|
|
20131
|
+
* Omitted or `"catalog"` means each Model's `supportedThinkingOptionIds`
|
|
20132
|
+
* reflects its own options (omitted or `[]` means none).
|
|
20133
|
+
* `"activeModel"` means only the active Model's Thinking options were
|
|
20134
|
+
* observed; other Models omit `supportedThinkingOptionIds` and must be
|
|
20135
|
+
* validated by the Adapter after selecting the Model.
|
|
20136
|
+
*/
|
|
20137
|
+
thinkingOptionsScope: harnessThinkingOptionsScopeSchema.optional()
|
|
20096
20138
|
}).strict().superRefine((catalog, context) => {
|
|
20097
20139
|
const refs = [];
|
|
20098
20140
|
const thinkingIds = new Set(catalog.thinkingOptions.map(({ id: id2 }) => id2));
|
|
@@ -20225,7 +20267,7 @@ var harnessInspectionSchema = external_exports.union([
|
|
|
20225
20267
|
]);
|
|
20226
20268
|
var harnessInspectParamsSchema = external_exports.object({
|
|
20227
20269
|
harnessId: harnessIdSchema,
|
|
20228
|
-
cwd:
|
|
20270
|
+
cwd: nonBlankTextSchema3.max(16384).optional(),
|
|
20229
20271
|
refresh: external_exports.boolean().optional(),
|
|
20230
20272
|
/** `availability` asks only whether the Harness can run; see `InspectHarnessInput.purpose`. */
|
|
20231
20273
|
purpose: external_exports.literal("availability").optional(),
|
|
@@ -20255,12 +20297,13 @@ var codexThreadInspectionSchema = external_exports.object({
|
|
|
20255
20297
|
effectiveThinkingOptionId: harnessThinkingOptionIdSchema.optional(),
|
|
20256
20298
|
effectivePermissionModeId: harnessPermissionModeIdSchema.optional(),
|
|
20257
20299
|
history: harnessHistoryCapabilitiesSchema.optional(),
|
|
20258
|
-
supportsThreadReferences: external_exports.literal(true).optional()
|
|
20300
|
+
supportsThreadReferences: external_exports.literal(true).optional(),
|
|
20301
|
+
handoff: threadHandoffMetadataSchema.optional()
|
|
20259
20302
|
}).strict();
|
|
20260
20303
|
var externalThreadInspectionSchema = external_exports.object({
|
|
20261
20304
|
owner: external_exports.literal("external"),
|
|
20262
|
-
harnessId:
|
|
20263
|
-
transportModelId:
|
|
20305
|
+
harnessId: nonBlankTextSchema3.max(256),
|
|
20306
|
+
transportModelId: nonBlankTextSchema3.max(HARNESS_TRANSPORT_MODEL_ID_MAX_LENGTH),
|
|
20264
20307
|
effectiveModel: harnessModelRefSchema.optional(),
|
|
20265
20308
|
resolvedModelLabel: harnessResolvedModelLabelSchema.optional(),
|
|
20266
20309
|
effectiveThinkingOptionId: harnessThinkingOptionIdSchema.optional(),
|
|
@@ -20270,6 +20313,7 @@ var externalThreadInspectionSchema = external_exports.object({
|
|
|
20270
20313
|
catalog: harnessModelCatalogSchema.optional(),
|
|
20271
20314
|
history: harnessHistoryCapabilitiesSchema,
|
|
20272
20315
|
usage: threadUsageSnapshotSchema.optional(),
|
|
20316
|
+
handoff: threadHandoffMetadataSchema.optional(),
|
|
20273
20317
|
locked: external_exports.literal(true)
|
|
20274
20318
|
}).strict();
|
|
20275
20319
|
var threadInspectionSchema = external_exports.discriminatedUnion("owner", [
|
|
@@ -20907,6 +20951,7 @@ var CLIENT_CHANNEL_METHODS = [
|
|
|
20907
20951
|
"codexhost/harness/preferences/get",
|
|
20908
20952
|
"codexhost/harness/preferences/patch",
|
|
20909
20953
|
"thread/list",
|
|
20954
|
+
"thread/metadata/update",
|
|
20910
20955
|
"codexhost/thread/catalog/read",
|
|
20911
20956
|
"thread/read",
|
|
20912
20957
|
"thread/resume",
|
|
@@ -20931,6 +20976,10 @@ var CLIENT_CHANNEL_METHODS = [
|
|
|
20931
20976
|
"thread/queue/start",
|
|
20932
20977
|
"codexhost/thread/queue/send-now",
|
|
20933
20978
|
"codexhost/workspace/read",
|
|
20979
|
+
"project/create",
|
|
20980
|
+
"project/update",
|
|
20981
|
+
"project/delete",
|
|
20982
|
+
"project/move",
|
|
20934
20983
|
"codexhost/thread/tree/read",
|
|
20935
20984
|
"codexhost/thread/pins/list",
|
|
20936
20985
|
"codexhost/thread/sections/list",
|
|
@@ -20948,6 +20997,7 @@ var CLIENT_CHANNEL_METHODS = [
|
|
|
20948
20997
|
"codexhost/harness/commands/inspect",
|
|
20949
20998
|
"codexhost/thread/command/execute",
|
|
20950
20999
|
"codexhost/thread/fork",
|
|
21000
|
+
THREAD_HANDOFF_METHOD,
|
|
20951
21001
|
"codexhost/harness/session-import/sources",
|
|
20952
21002
|
"codexhost/harness/session-import/list",
|
|
20953
21003
|
"codexhost/harness/session-import/import",
|
|
@@ -20998,7 +21048,13 @@ var clientProjectlessWorkspaceSchema = external_exports.object({
|
|
|
20998
21048
|
prompt: external_exports.string().max(16384).optional()
|
|
20999
21049
|
}).strict();
|
|
21000
21050
|
var clientWorkspaceSnapshotSchema = external_exports.object({
|
|
21001
|
-
projects: external_exports.array(external_exports.object({
|
|
21051
|
+
projects: external_exports.array(external_exports.object({
|
|
21052
|
+
id: external_exports.string(),
|
|
21053
|
+
name: external_exports.string(),
|
|
21054
|
+
rootPaths: external_exports.array(external_exports.string()),
|
|
21055
|
+
createdAt: external_exports.number().int().optional()
|
|
21056
|
+
})),
|
|
21057
|
+
nativeProjects: external_exports.literal(true).optional(),
|
|
21002
21058
|
assignments: external_exports.record(external_exports.string(), external_exports.string()),
|
|
21003
21059
|
projectless: external_exports.array(external_exports.string()),
|
|
21004
21060
|
/** Canonical external pin membership; pins/list provides the native merged order. */
|
|
@@ -21013,6 +21069,7 @@ var clientChannelCursorSchema = external_exports.object({
|
|
|
21013
21069
|
sequence: external_exports.number().int().nonnegative()
|
|
21014
21070
|
});
|
|
21015
21071
|
var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
|
|
21072
|
+
external_exports.object({ type: external_exports.literal("projects-changed"), cursor: clientChannelCursorSchema }),
|
|
21016
21073
|
external_exports.object({
|
|
21017
21074
|
type: external_exports.literal("skills-changed"),
|
|
21018
21075
|
cursor: clientChannelCursorSchema,
|
|
@@ -21176,7 +21233,8 @@ var clientThreadSnapshotSchema = external_exports.object({
|
|
|
21176
21233
|
items: external_exports.array(clientQueuedSubmissionSchema),
|
|
21177
21234
|
pausedReason: external_exports.enum(["interrupted", "outcome-unknown", "failed"]).nullable()
|
|
21178
21235
|
}).optional(),
|
|
21179
|
-
interactions: external_exports.array(clientInteractionSchema)
|
|
21236
|
+
interactions: external_exports.array(clientInteractionSchema),
|
|
21237
|
+
handoff: threadHandoffMetadataSchema.optional()
|
|
21180
21238
|
});
|
|
21181
21239
|
var clientChannelDescriptorSchema = external_exports.object({
|
|
21182
21240
|
version: external_exports.literal(CLIENT_CHANNEL_VERSION),
|
|
@@ -21185,7 +21243,10 @@ var clientChannelDescriptorSchema = external_exports.object({
|
|
|
21185
21243
|
port: external_exports.number().int().min(1).max(65535),
|
|
21186
21244
|
token: external_exports.string().regex(/^[0-9a-f]{64}$/u),
|
|
21187
21245
|
startedAt: external_exports.number(),
|
|
21188
|
-
epoch: external_exports.string().uuid()
|
|
21246
|
+
epoch: external_exports.string().uuid(),
|
|
21247
|
+
capabilities: external_exports.object({
|
|
21248
|
+
peerDelegation: external_exports.literal(1).optional()
|
|
21249
|
+
}).optional()
|
|
21189
21250
|
});
|
|
21190
21251
|
var clientChannelResponseSchema = external_exports.object({
|
|
21191
21252
|
epoch: external_exports.string().uuid(),
|
|
@@ -21204,10 +21265,18 @@ var threadCatalogReadParamsSchema = external_exports.object({
|
|
|
21204
21265
|
* `excludeCwds` folder, the branch ends, or a page bound is reached. Every row read is
|
|
21205
21266
|
* returned, so the native cursors stay contiguous.
|
|
21206
21267
|
*/
|
|
21207
|
-
scope: external_exports.
|
|
21208
|
-
|
|
21209
|
-
|
|
21210
|
-
|
|
21268
|
+
scope: external_exports.union([
|
|
21269
|
+
external_exports.object({
|
|
21270
|
+
cwd: external_exports.string().min(1).max(4096),
|
|
21271
|
+
excludeCwds: external_exports.array(external_exports.string().min(1).max(4096)).max(1024)
|
|
21272
|
+
}).strict(),
|
|
21273
|
+
external_exports.object({
|
|
21274
|
+
projectId: external_exports.string().min(1).max(1024),
|
|
21275
|
+
legacyThreadIds: external_exports.array(external_exports.string().min(1).max(1024)).max(1024),
|
|
21276
|
+
/** Roots whose Threads without a project ID belong to this project, as on Desktop. */
|
|
21277
|
+
rootPaths: external_exports.array(external_exports.string().min(1).max(4096)).max(1024).optional()
|
|
21278
|
+
}).strict()
|
|
21279
|
+
]).optional()
|
|
21211
21280
|
}).strict();
|
|
21212
21281
|
var threadCatalogReadResultSchema = external_exports.object({
|
|
21213
21282
|
threads: external_exports.array(jsonObjectSchema),
|
|
@@ -21394,1398 +21463,1563 @@ var delegationReadParamsSchema = external_exports.strictObject({
|
|
|
21394
21463
|
to: external_exports.number().int().min(1).max(Number.MAX_SAFE_INTEGER).optional()
|
|
21395
21464
|
});
|
|
21396
21465
|
|
|
21397
|
-
// ../../shared-contracts/dist/
|
|
21398
|
-
var
|
|
21399
|
-
|
|
21400
|
-
|
|
21401
|
-
|
|
21402
|
-
|
|
21403
|
-
|
|
21404
|
-
|
|
21405
|
-
|
|
21406
|
-
|
|
21407
|
-
|
|
21408
|
-
|
|
21409
|
-
|
|
21410
|
-
|
|
21411
|
-
|
|
21412
|
-
|
|
21413
|
-
|
|
21414
|
-
|
|
21415
|
-
|
|
21416
|
-
|
|
21417
|
-
|
|
21418
|
-
|
|
21419
|
-
|
|
21420
|
-
sourceId: external_exports.string().min(1).max(256),
|
|
21421
|
-
name: credentialImportNameSchema,
|
|
21422
|
-
confirmed: external_exports.literal(true)
|
|
21423
|
-
}).strict(),
|
|
21424
|
-
external_exports.object({
|
|
21425
|
-
action: external_exports.literal("remove"),
|
|
21426
|
-
name: credentialImportNameSchema,
|
|
21427
|
-
confirmed: external_exports.literal(true)
|
|
21428
|
-
}).strict()
|
|
21466
|
+
// ../../shared-contracts/dist/remote-peers.js
|
|
21467
|
+
var REMOTE_PEER_ID_PATTERN = /^[a-zA-Z0-9_-]{1,64}$/u;
|
|
21468
|
+
var remotePeerIdSchema = external_exports.string().regex(REMOTE_PEER_ID_PATTERN);
|
|
21469
|
+
var remotePeerNodeIdSchema = external_exports.string().regex(REMOTE_PEER_ID_PATTERN);
|
|
21470
|
+
var remotePeerHostIdSchema = external_exports.string().regex(/^remote-peer:[a-zA-Z0-9_-]{1,64}$/u);
|
|
21471
|
+
var remotePeerTransportKindSchema = external_exports.enum(["relay", "tailscale", "lan", "custom"]);
|
|
21472
|
+
var REMOTE_PEER_COLORS = [
|
|
21473
|
+
"blue",
|
|
21474
|
+
"purple",
|
|
21475
|
+
"cyan",
|
|
21476
|
+
"green",
|
|
21477
|
+
"amber",
|
|
21478
|
+
"rose",
|
|
21479
|
+
"slate"
|
|
21480
|
+
];
|
|
21481
|
+
var remotePeerColorSchema = external_exports.enum(REMOTE_PEER_COLORS);
|
|
21482
|
+
var REMOTE_PEER_COLOR_SET = new Set(REMOTE_PEER_COLORS);
|
|
21483
|
+
var remotePeerStateSchema = external_exports.enum([
|
|
21484
|
+
"connected",
|
|
21485
|
+
"connecting",
|
|
21486
|
+
"auth-error",
|
|
21487
|
+
"offline",
|
|
21488
|
+
"disabled"
|
|
21429
21489
|
]);
|
|
21430
|
-
var
|
|
21431
|
-
|
|
21432
|
-
|
|
21433
|
-
|
|
21434
|
-
|
|
21435
|
-
|
|
21436
|
-
|
|
21437
|
-
|
|
21438
|
-
|
|
21439
|
-
sources: external_exports.array(credentialSourceSchema),
|
|
21440
|
-
targets: external_exports.array(external_exports.object({
|
|
21441
|
-
harnessId: external_exports.string(),
|
|
21442
|
-
providers: external_exports.array(external_exports.enum(["openai-codex", "xai"])),
|
|
21443
|
-
imports: external_exports.array(credentialImportRecordSchema),
|
|
21444
|
-
others: external_exports.array(credentialOtherLoginSchema).default([])
|
|
21445
|
-
}).strict())
|
|
21446
|
-
}).strict();
|
|
21447
|
-
var credentialImportsParamsSchema = external_exports.object({
|
|
21448
|
-
targetHarnessId: external_exports.string().min(1).max(128).optional(),
|
|
21449
|
-
request: credentialImportsRequestSchema
|
|
21450
|
-
}).strict();
|
|
21451
|
-
|
|
21452
|
-
// ../../shared-contracts/dist/harness-display-settings.js
|
|
21453
|
-
var harnessDisplayCapabilitiesSchema = external_exports.object({ events: external_exports.boolean() });
|
|
21454
|
-
var harnessDisplayEntriesSchema = external_exports.array(external_exports.strictObject({
|
|
21455
|
-
agent: external_exports.string().min(1).max(128),
|
|
21456
|
-
section: external_exports.enum(["main", "more", "auto"])
|
|
21457
|
-
})).max(256).refine((entries) => new Set(entries.map((entry) => entry.agent)).size === entries.length, "Duplicate Harness IDs");
|
|
21458
|
-
var harnessDisplaySettingsSchema = external_exports.strictObject({
|
|
21459
|
-
entries: harnessDisplayEntriesSchema.nullable()
|
|
21460
|
-
});
|
|
21461
|
-
var harnessDisplayGetSchema = external_exports.strictObject({});
|
|
21462
|
-
var harnessDisplaySetSchema = external_exports.strictObject({
|
|
21463
|
-
entries: harnessDisplayEntriesSchema,
|
|
21464
|
-
/** Import legacy Desktop preferences only if no shared settings exist yet. */
|
|
21465
|
-
initializeOnly: external_exports.boolean().optional()
|
|
21466
|
-
});
|
|
21467
|
-
|
|
21468
|
-
// ../../shared-contracts/dist/idle-release.js
|
|
21469
|
-
var IDLE_RELEASE_TIMEOUT_MINUTES_MIN = 5;
|
|
21470
|
-
var IDLE_RELEASE_TIMEOUT_MINUTES_MAX = 1440;
|
|
21471
|
-
var idleReleaseSettingsSchema = external_exports.strictObject({
|
|
21490
|
+
var remotePeerSummarySchema = external_exports.object({
|
|
21491
|
+
peerId: remotePeerIdSchema,
|
|
21492
|
+
hostId: remotePeerHostIdSchema,
|
|
21493
|
+
nodeId: remotePeerNodeIdSchema.optional(),
|
|
21494
|
+
name: external_exports.string().min(1).max(120),
|
|
21495
|
+
color: remotePeerColorSchema.optional(),
|
|
21496
|
+
origin: external_exports.string().min(1).max(2048),
|
|
21497
|
+
transportKind: remotePeerTransportKindSchema,
|
|
21498
|
+
encrypted: external_exports.boolean(),
|
|
21472
21499
|
enabled: external_exports.boolean(),
|
|
21473
|
-
|
|
21474
|
-
|
|
21475
|
-
|
|
21476
|
-
|
|
21477
|
-
|
|
21478
|
-
|
|
21479
|
-
|
|
21480
|
-
|
|
21481
|
-
|
|
21482
|
-
|
|
21483
|
-
|
|
21484
|
-
|
|
21485
|
-
|
|
21486
|
-
|
|
21487
|
-
|
|
21488
|
-
var newThreadDefaultsSchema = external_exports.strictObject({
|
|
21489
|
-
lastHarness: harnessIdSchema.optional(),
|
|
21490
|
-
byHarness: external_exports.record(preferenceHarnessKey, harnessDefaultConfigurationSchema)
|
|
21491
|
-
});
|
|
21492
|
-
var harnessDelegationDefaultSchema = external_exports.strictObject({
|
|
21493
|
-
model: harnessModelRefSchema.optional(),
|
|
21494
|
-
thinkingOptionId: harnessThinkingOptionIdSchema.optional()
|
|
21495
|
-
}).refine((value) => Boolean(value.model || value.thinkingOptionId), "A delegation default must contain a Model or Thinking option");
|
|
21496
|
-
var delegationDefaultsSchema = external_exports.strictObject({
|
|
21497
|
-
byHarness: external_exports.record(preferenceHarnessKey, harnessDelegationDefaultSchema)
|
|
21500
|
+
state: remotePeerStateSchema,
|
|
21501
|
+
supportsPeerPairing: external_exports.boolean().optional(),
|
|
21502
|
+
/** Omitted when either side's node mapping is unknown. */
|
|
21503
|
+
pairedBack: external_exports.boolean().optional(),
|
|
21504
|
+
/** Other configured remote peerIds on this Hub present in this peer's `manifest.peerNodes`. */
|
|
21505
|
+
linkedPeerIds: external_exports.array(remotePeerIdSchema).max(128).optional(),
|
|
21506
|
+
latencyMs: external_exports.number().int().nonnegative().optional(),
|
|
21507
|
+
version: external_exports.string().max(128).optional(),
|
|
21508
|
+
platform: external_exports.string().max(64).optional(),
|
|
21509
|
+
hostname: external_exports.string().max(255).optional(),
|
|
21510
|
+
homeDir: external_exports.string().max(4096).optional(),
|
|
21511
|
+
lastError: external_exports.string().max(1e3).optional(),
|
|
21512
|
+
projectCount: external_exports.number().int().nonnegative(),
|
|
21513
|
+
createdAt: external_exports.string(),
|
|
21514
|
+
updatedAt: external_exports.string()
|
|
21498
21515
|
});
|
|
21499
|
-
var
|
|
21500
|
-
|
|
21501
|
-
idleRelease: idleReleaseSettingsSchema.optional(),
|
|
21502
|
-
favorites: external_exports.record(preferenceHarnessKey, external_exports.array(modelId).max(2048)).default({}),
|
|
21503
|
-
newThread: newThreadDefaultsSchema.optional(),
|
|
21504
|
-
delegation: delegationDefaultsSchema.optional()
|
|
21516
|
+
var remotePeerListResultSchema = external_exports.object({
|
|
21517
|
+
peers: external_exports.array(remotePeerSummarySchema)
|
|
21505
21518
|
});
|
|
21506
|
-
var
|
|
21507
|
-
|
|
21508
|
-
|
|
21509
|
-
|
|
21519
|
+
var remotePeerAddParamsSchema = external_exports.object({
|
|
21520
|
+
connectionUrl: external_exports.string().min(1).max(4096).optional(),
|
|
21521
|
+
origin: external_exports.string().min(1).max(2048).optional(),
|
|
21522
|
+
token: external_exports.string().min(1).max(2048).optional(),
|
|
21523
|
+
name: external_exports.string().trim().min(1).max(120).optional(),
|
|
21524
|
+
color: remotePeerColorSchema.optional(),
|
|
21525
|
+
pairBack: external_exports.boolean().optional(),
|
|
21526
|
+
meshPeerIds: external_exports.array(remotePeerIdSchema).max(64).optional(),
|
|
21527
|
+
selfOrigin: external_exports.string().min(1).max(2048).optional()
|
|
21528
|
+
}).refine((input3) => Boolean(input3.connectionUrl) || Boolean(input3.origin) && Boolean(input3.token), "Provide either connectionUrl or both origin and token");
|
|
21529
|
+
var remotePeerIntroduceParamsSchema = external_exports.strictObject({
|
|
21530
|
+
origin: external_exports.string().min(1).max(2048),
|
|
21531
|
+
token: external_exports.string().min(1).max(2048),
|
|
21532
|
+
name: external_exports.string().trim().min(1).max(120).optional(),
|
|
21533
|
+
color: remotePeerColorSchema.optional(),
|
|
21534
|
+
expectedNodeId: remotePeerNodeIdSchema.optional()
|
|
21510
21535
|
});
|
|
21511
|
-
var
|
|
21512
|
-
|
|
21536
|
+
var remotePeerIntroduceResultSchema = external_exports.object({
|
|
21537
|
+
status: external_exports.enum(["added", "updated", "existing"]),
|
|
21538
|
+
peerId: remotePeerIdSchema,
|
|
21539
|
+
hostId: remotePeerHostIdSchema,
|
|
21540
|
+
nodeId: remotePeerNodeIdSchema.optional()
|
|
21513
21541
|
});
|
|
21514
|
-
var
|
|
21515
|
-
|
|
21516
|
-
|
|
21517
|
-
|
|
21518
|
-
|
|
21519
|
-
|
|
21520
|
-
enabled: external_exports.boolean()
|
|
21521
|
-
}),
|
|
21522
|
-
external_exports.strictObject({
|
|
21523
|
-
kind: external_exports.literal("favorites"),
|
|
21524
|
-
harnessId: harnessIdSchema,
|
|
21525
|
-
modelIds: external_exports.array(modelId).max(2048)
|
|
21526
|
-
}),
|
|
21527
|
-
external_exports.strictObject({
|
|
21528
|
-
kind: external_exports.literal("newThread"),
|
|
21529
|
-
lastHarness: harnessIdSchema.optional(),
|
|
21530
|
-
harnessId: harnessIdSchema.optional(),
|
|
21531
|
-
configuration: harnessDefaultConfigurationSchema.optional()
|
|
21532
|
-
}),
|
|
21533
|
-
external_exports.strictObject({
|
|
21534
|
-
kind: external_exports.literal("delegation"),
|
|
21535
|
-
harnessId: harnessIdSchema,
|
|
21536
|
-
configuration: harnessDelegationDefaultSchema.nullable()
|
|
21537
|
-
})
|
|
21542
|
+
var remotePeerPairingStatusSchema = external_exports.enum([
|
|
21543
|
+
"added",
|
|
21544
|
+
"updated",
|
|
21545
|
+
"existing",
|
|
21546
|
+
"failed",
|
|
21547
|
+
"skipped"
|
|
21538
21548
|
]);
|
|
21539
|
-
var
|
|
21540
|
-
|
|
21541
|
-
|
|
21542
|
-
|
|
21543
|
-
|
|
21544
|
-
|
|
21545
|
-
|
|
21546
|
-
if (operation.kind === "newThread" && (!operation.lastHarness && !operation.configuration || Boolean(operation.harnessId) !== Boolean(operation.configuration)))
|
|
21547
|
-
ctx.addIssue({
|
|
21548
|
-
code: "custom",
|
|
21549
|
-
message: "A default Harness or complete configuration is required"
|
|
21550
|
-
});
|
|
21551
|
-
}
|
|
21549
|
+
var remotePeerPairingStepSchema = external_exports.object({
|
|
21550
|
+
targetPeerId: remotePeerIdSchema,
|
|
21551
|
+
targetName: external_exports.string().min(1).max(120),
|
|
21552
|
+
introducedHost: external_exports.union([external_exports.literal("local"), remotePeerIdSchema]),
|
|
21553
|
+
introducedName: external_exports.string().min(1).max(120),
|
|
21554
|
+
status: remotePeerPairingStatusSchema,
|
|
21555
|
+
error: external_exports.string().max(1e3).optional()
|
|
21552
21556
|
});
|
|
21553
|
-
var
|
|
21554
|
-
|
|
21555
|
-
revision: external_exports.number().int().nonnegative(),
|
|
21556
|
-
scopes: external_exports.record(harnessPreferenceScopeSchema, harnessPreferenceValuesSchema)
|
|
21557
|
+
var remotePeerPairingReportSchema = external_exports.object({
|
|
21558
|
+
results: external_exports.array(remotePeerPairingStepSchema)
|
|
21557
21559
|
});
|
|
21558
|
-
|
|
21559
|
-
|
|
21560
|
-
|
|
21561
|
-
|
|
21562
|
-
|
|
21563
|
-
output: usdPerMillionTokens,
|
|
21564
|
-
cacheRead: usdPerMillionTokens.optional(),
|
|
21565
|
-
cacheWrite: usdPerMillionTokens.optional(),
|
|
21566
|
-
cacheWrite1h: usdPerMillionTokens.optional()
|
|
21560
|
+
var remotePeerSyncMeshParamsSchema = external_exports.object({
|
|
21561
|
+
peerIds: external_exports.array(remotePeerIdSchema).max(64).optional(),
|
|
21562
|
+
includeSelf: external_exports.boolean().optional(),
|
|
21563
|
+
includeMesh: external_exports.boolean().optional(),
|
|
21564
|
+
selfOrigin: external_exports.string().min(1).max(2048).optional()
|
|
21567
21565
|
});
|
|
21568
|
-
var
|
|
21569
|
-
|
|
21570
|
-
|
|
21571
|
-
|
|
21572
|
-
|
|
21573
|
-
|
|
21574
|
-
|
|
21566
|
+
var remotePeerUpdateParamsSchema = external_exports.object({
|
|
21567
|
+
peerId: remotePeerIdSchema,
|
|
21568
|
+
name: external_exports.string().trim().min(1).max(120).optional(),
|
|
21569
|
+
color: remotePeerColorSchema.nullable().optional(),
|
|
21570
|
+
connectionUrl: external_exports.string().min(1).max(4096).optional(),
|
|
21571
|
+
origin: external_exports.string().min(1).max(2048).optional(),
|
|
21572
|
+
token: external_exports.string().min(1).max(2048).optional(),
|
|
21573
|
+
enabled: external_exports.boolean().optional()
|
|
21575
21574
|
});
|
|
21576
|
-
var
|
|
21577
|
-
|
|
21578
|
-
key: modelPriceKeySchema,
|
|
21579
|
-
price: modelPriceOverrideSchema.nullable(),
|
|
21580
|
-
previousKey: modelPriceKeySchema.optional()
|
|
21575
|
+
var remotePeerIdParamsSchema = external_exports.object({
|
|
21576
|
+
peerId: remotePeerIdSchema
|
|
21581
21577
|
});
|
|
21582
|
-
var
|
|
21583
|
-
|
|
21578
|
+
var remotePeerRemoveResultSchema = external_exports.object({
|
|
21579
|
+
removed: external_exports.boolean()
|
|
21584
21580
|
});
|
|
21585
|
-
var
|
|
21586
|
-
|
|
21587
|
-
|
|
21588
|
-
|
|
21589
|
-
|
|
21590
|
-
|
|
21591
|
-
|
|
21581
|
+
var remotePeerTestParamsSchema = external_exports.object({
|
|
21582
|
+
peerId: remotePeerIdSchema.optional(),
|
|
21583
|
+
connectionUrl: external_exports.string().min(1).max(4096).optional(),
|
|
21584
|
+
origin: external_exports.string().min(1).max(2048).optional(),
|
|
21585
|
+
token: external_exports.string().min(1).max(2048).optional()
|
|
21586
|
+
}).refine((input3) => Boolean(input3.peerId) || Boolean(input3.connectionUrl) || Boolean(input3.origin) && Boolean(input3.token), "Provide peerId, connectionUrl, or both origin and token");
|
|
21587
|
+
var remotePeerTestProjectSchema = external_exports.object({
|
|
21588
|
+
id: external_exports.string().min(1).max(1024),
|
|
21589
|
+
name: external_exports.string().min(1).max(512),
|
|
21590
|
+
path: external_exports.string().min(1).max(8192)
|
|
21592
21591
|
});
|
|
21593
|
-
var
|
|
21594
|
-
|
|
21595
|
-
|
|
21596
|
-
|
|
21592
|
+
var remotePeerTestResultSchema = external_exports.object({
|
|
21593
|
+
ok: external_exports.boolean(),
|
|
21594
|
+
nodeId: remotePeerNodeIdSchema.optional(),
|
|
21595
|
+
supportsPeerPairing: external_exports.boolean().optional(),
|
|
21596
|
+
pairedBack: external_exports.boolean().optional(),
|
|
21597
|
+
latencyMs: external_exports.number().int().nonnegative().optional(),
|
|
21598
|
+
origin: external_exports.string().max(2048).optional(),
|
|
21599
|
+
transportKind: remotePeerTransportKindSchema.optional(),
|
|
21600
|
+
encrypted: external_exports.boolean().optional(),
|
|
21601
|
+
version: external_exports.string().max(128).optional(),
|
|
21602
|
+
platform: external_exports.string().max(64).optional(),
|
|
21603
|
+
hostname: external_exports.string().max(255).optional(),
|
|
21604
|
+
homeDir: external_exports.string().max(4096).optional(),
|
|
21605
|
+
projectCount: external_exports.number().int().nonnegative().optional(),
|
|
21606
|
+
projects: external_exports.array(remotePeerTestProjectSchema).optional(),
|
|
21607
|
+
error: external_exports.string().max(1e3).optional()
|
|
21597
21608
|
});
|
|
21598
|
-
|
|
21599
|
-
|
|
21600
|
-
|
|
21601
|
-
|
|
21602
|
-
|
|
21603
|
-
var harness = external_exports.string().min(1).max(128);
|
|
21604
|
-
var model = external_exports.string().min(1).max(512);
|
|
21605
|
-
var project = external_exports.string().min(1).max(4096);
|
|
21606
|
-
var usageStatisticsParamsSchema = external_exports.strictObject({
|
|
21607
|
-
range: external_exports.enum(USAGE_STATISTICS_RANGES),
|
|
21608
|
-
/** Display timezone for ranges, dates and hourly buckets; omitted means the Host's local zone. */
|
|
21609
|
-
timeZone: external_exports.string().min(1).max(128).refine((value) => {
|
|
21610
|
-
try {
|
|
21611
|
-
new Intl.DateTimeFormat("en", { timeZone: value });
|
|
21612
|
-
return true;
|
|
21613
|
-
} catch {
|
|
21614
|
-
return false;
|
|
21615
|
-
}
|
|
21616
|
-
}, "Unsupported usage statistics timezone").optional(),
|
|
21617
|
-
harness: harness.optional(),
|
|
21618
|
-
model: model.nullable().optional(),
|
|
21619
|
-
project: project.nullable().optional(),
|
|
21620
|
-
/** One date in the query timezone inside the range. */
|
|
21621
|
-
date: localDate.optional()
|
|
21609
|
+
var remotePeerManifestProjectSchema = external_exports.object({
|
|
21610
|
+
id: external_exports.string().min(1).max(1024),
|
|
21611
|
+
name: external_exports.string().min(1).max(512),
|
|
21612
|
+
path: external_exports.string().min(1).max(8192),
|
|
21613
|
+
threadIds: external_exports.array(external_exports.string().min(1).max(1024))
|
|
21622
21614
|
});
|
|
21623
|
-
var
|
|
21624
|
-
|
|
21625
|
-
|
|
21626
|
-
|
|
21627
|
-
|
|
21628
|
-
|
|
21629
|
-
|
|
21630
|
-
|
|
21631
|
-
|
|
21632
|
-
|
|
21633
|
-
|
|
21634
|
-
costUsd: external_exports.number().finite().min(0),
|
|
21635
|
-
/** Requests without a price (or the cache data the price needs); not in `costUsd`. */
|
|
21636
|
-
unpricedRequests: count,
|
|
21637
|
-
/**
|
|
21638
|
-
* Requests whose storage gave no token counts: counted as requests, with neither tokens nor
|
|
21639
|
-
* cost, and not as unpriced.
|
|
21640
|
-
*/
|
|
21641
|
-
unmeteredRequests: count
|
|
21615
|
+
var remotePeerCapabilitiesSchema = external_exports.object({
|
|
21616
|
+
/** /api/peer/v1/uploads, /api/peer/v1/prompt, and /api/peer/v1/file are all available. */
|
|
21617
|
+
attachments: external_exports.literal(1).optional(),
|
|
21618
|
+
/** /api/peer/v1/workspace-files/rpc and /api/peer/v1/workspace-files/download are available. */
|
|
21619
|
+
workspaceFiles: external_exports.literal(1).optional(),
|
|
21620
|
+
/** Peer supports officeToPdf/render over /api/peer/v1/workspace-files/rpc. */
|
|
21621
|
+
officePreview: external_exports.literal(1).optional(),
|
|
21622
|
+
/** /api/peer/v1/delegation is available for fixed-whitelist cross-host delegation. */
|
|
21623
|
+
delegation: external_exports.literal(1).optional(),
|
|
21624
|
+
/** POST /api/peer/v1/peers is available. */
|
|
21625
|
+
peerPairing: external_exports.literal(1).optional()
|
|
21642
21626
|
});
|
|
21643
|
-
var
|
|
21644
|
-
|
|
21645
|
-
|
|
21646
|
-
|
|
21647
|
-
|
|
21648
|
-
|
|
21649
|
-
|
|
21650
|
-
|
|
21651
|
-
|
|
21652
|
-
|
|
21653
|
-
lastAtMs: count,
|
|
21654
|
-
...totals
|
|
21627
|
+
var remotePeerManifestSchema = external_exports.object({
|
|
21628
|
+
version: external_exports.string().max(128),
|
|
21629
|
+
platform: external_exports.string().max(64),
|
|
21630
|
+
hostname: external_exports.string().max(255),
|
|
21631
|
+
homeDir: external_exports.string().max(4096).optional(),
|
|
21632
|
+
epoch: external_exports.string().min(1).max(256),
|
|
21633
|
+
nodeId: remotePeerNodeIdSchema.optional(),
|
|
21634
|
+
peerNodes: external_exports.record(remotePeerHostIdSchema, remotePeerNodeIdSchema).refine((v) => Object.keys(v).length <= 128).optional(),
|
|
21635
|
+
projects: external_exports.array(remotePeerManifestProjectSchema),
|
|
21636
|
+
capabilities: remotePeerCapabilitiesSchema.optional()
|
|
21655
21637
|
});
|
|
21656
|
-
var
|
|
21657
|
-
|
|
21658
|
-
|
|
21659
|
-
|
|
21660
|
-
|
|
21661
|
-
|
|
21662
|
-
|
|
21663
|
-
|
|
21664
|
-
|
|
21665
|
-
|
|
21666
|
-
|
|
21667
|
-
unknownProject: external_exports.boolean(),
|
|
21668
|
-
date: localDate.nullable()
|
|
21669
|
-
}),
|
|
21670
|
-
/** Reading of native storage: incomplete while the first read, or a refresh, is under way. */
|
|
21671
|
-
reading: external_exports.strictObject({ complete: external_exports.boolean(), sources: count, read: count }),
|
|
21672
|
-
/** Harnesses whose storage could not be read; their part is missing, the rest is complete. */
|
|
21673
|
-
failures: external_exports.array(external_exports.strictObject({ harness, message: external_exports.string().max(2048) })).max(256),
|
|
21674
|
-
/** Every value seen in the range, ignoring the filters, to choose filters from. */
|
|
21675
|
-
options: external_exports.strictObject({
|
|
21676
|
-
harnesses: external_exports.array(harness).max(256),
|
|
21677
|
-
models: external_exports.array(model.nullable()).max(4096),
|
|
21678
|
-
projects: external_exports.array(project.nullable()).max(4096)
|
|
21679
|
-
}),
|
|
21680
|
-
/** Current display metadata, scoped by Harness. Never a pricing or filter identity.
|
|
21681
|
-
* Optional for older Hosts; missing/conflicting labels fall back to the native model ID.
|
|
21682
|
-
*/
|
|
21683
|
-
modelLabels: external_exports.array(external_exports.strictObject({ harness, model, label: model })).max(4096).optional(),
|
|
21684
|
-
/** Native credits, all filters applied, never combined across Harnesses or treated as USD.
|
|
21685
|
-
* Only groups with at least one reported value appear; reportedRequests exposes partial data.
|
|
21686
|
-
*/
|
|
21687
|
-
credits: external_exports.array(external_exports.strictObject({
|
|
21688
|
-
harness,
|
|
21689
|
-
model: model.nullable(),
|
|
21690
|
-
credits: external_exports.number().finite().min(0),
|
|
21691
|
-
reportedRequests: count,
|
|
21692
|
-
requests: count
|
|
21693
|
-
})).max(4096).optional(),
|
|
21694
|
-
/** All filters applied. */
|
|
21695
|
-
totals: usageStatisticsTotalsSchema,
|
|
21696
|
-
/** Each date and Harness of the range: every filter except the day. */
|
|
21697
|
-
daily: external_exports.array(external_exports.strictObject({ date: localDate, harness, ...totals })).max(2e5),
|
|
21698
|
-
/** Weekday (0 = Sunday) and hour in the query timezone, all filters applied. */
|
|
21699
|
-
hourly: external_exports.array(external_exports.strictObject({
|
|
21700
|
-
weekday: external_exports.number().int().min(0).max(6),
|
|
21701
|
-
hour: external_exports.number().int().min(0).max(23),
|
|
21702
|
-
...totals
|
|
21703
|
-
})).max(168),
|
|
21704
|
-
byHarness: external_exports.array(external_exports.strictObject({ harness, ...totals })).max(256),
|
|
21705
|
-
byModel: external_exports.array(external_exports.strictObject({
|
|
21706
|
-
model: model.nullable(),
|
|
21707
|
-
...totals,
|
|
21708
|
-
/** Requests priced by what the Harness recorded they cost, not by a price list. */
|
|
21709
|
-
harnessPricedRequests: count
|
|
21710
|
-
})).max(4096),
|
|
21711
|
-
byProject: external_exports.array(external_exports.strictObject({ project: project.nullable(), ...totals })).max(4096),
|
|
21712
|
-
/**
|
|
21713
|
-
* The sessions that spent the most, by cost and by tokens without cache, all filters applied;
|
|
21714
|
-
* requests without a native session are not listed here but count everywhere else.
|
|
21715
|
-
*/
|
|
21716
|
-
sessions: external_exports.array(usageStatisticsSessionSchema).max(100),
|
|
21717
|
-
/**
|
|
21718
|
-
* The sessions last active in the range, newest first, all filters applied. Optional for older
|
|
21719
|
-
* Hosts; missing is treated as no list rather than no sessions.
|
|
21720
|
-
*/
|
|
21721
|
-
recentSessions: external_exports.array(usageStatisticsSessionSchema).max(100).optional()
|
|
21638
|
+
var REMOTE_PEER_UPLOAD_SCOPE_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/u;
|
|
21639
|
+
var remotePeerPromptParamsSchema = external_exports.strictObject({
|
|
21640
|
+
threadId: external_exports.string().min(1).max(1024),
|
|
21641
|
+
scope: external_exports.string().regex(REMOTE_PEER_UPLOAD_SCOPE_PATTERN).optional(),
|
|
21642
|
+
requestId: external_exports.string().min(1).max(256).optional(),
|
|
21643
|
+
mode: external_exports.enum(["queue", "steer"]).optional(),
|
|
21644
|
+
expectedTurnId: external_exports.string().min(1).max(1024).nullable().optional(),
|
|
21645
|
+
content: external_exports.array(external_exports.discriminatedUnion("type", [
|
|
21646
|
+
external_exports.strictObject({ type: external_exports.literal("text"), text: external_exports.string() }),
|
|
21647
|
+
external_exports.strictObject({ type: external_exports.literal("file"), receiptId: external_exports.string().min(1).max(128) })
|
|
21648
|
+
])).min(1).max(64)
|
|
21722
21649
|
});
|
|
21723
|
-
|
|
21724
|
-
|
|
21725
|
-
|
|
21726
|
-
|
|
21727
|
-
|
|
21728
|
-
|
|
21729
|
-
|
|
21650
|
+
var remotePeerErrorEnvelopeSchema = external_exports.object({
|
|
21651
|
+
ok: external_exports.literal(false),
|
|
21652
|
+
error: external_exports.object({
|
|
21653
|
+
code: external_exports.string(),
|
|
21654
|
+
message: external_exports.string(),
|
|
21655
|
+
details: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
|
|
21656
|
+
})
|
|
21657
|
+
});
|
|
21658
|
+
var remotePeerUploadResultSchema = external_exports.union([
|
|
21730
21659
|
external_exports.object({
|
|
21731
|
-
|
|
21732
|
-
|
|
21733
|
-
|
|
21734
|
-
|
|
21735
|
-
|
|
21736
|
-
|
|
21737
|
-
|
|
21738
|
-
|
|
21739
|
-
|
|
21740
|
-
allowOther: external_exports.boolean(),
|
|
21741
|
-
optional: external_exports.boolean()
|
|
21660
|
+
ok: external_exports.literal(true),
|
|
21661
|
+
value: external_exports.object({
|
|
21662
|
+
receiptId: external_exports.string().min(1),
|
|
21663
|
+
file: external_exports.object({
|
|
21664
|
+
attachmentId: external_exports.string(),
|
|
21665
|
+
name: external_exports.string(),
|
|
21666
|
+
bytes: external_exports.number().int().nonnegative()
|
|
21667
|
+
})
|
|
21668
|
+
})
|
|
21742
21669
|
}),
|
|
21670
|
+
remotePeerErrorEnvelopeSchema
|
|
21671
|
+
]);
|
|
21672
|
+
var remotePeerPromptResultSchema = external_exports.union([
|
|
21743
21673
|
external_exports.object({
|
|
21744
|
-
|
|
21745
|
-
|
|
21746
|
-
|
|
21747
|
-
|
|
21748
|
-
secret: external_exports.literal(false),
|
|
21749
|
-
optional: external_exports.boolean(),
|
|
21750
|
-
placeholder: external_exports.string().optional(),
|
|
21751
|
-
prefill: external_exports.string().optional()
|
|
21752
|
-
})
|
|
21674
|
+
ok: external_exports.literal(true),
|
|
21675
|
+
value: external_exports.object({ accepted: external_exports.literal(true) })
|
|
21676
|
+
}),
|
|
21677
|
+
remotePeerErrorEnvelopeSchema
|
|
21753
21678
|
]);
|
|
21754
|
-
var
|
|
21755
|
-
|
|
21756
|
-
|
|
21757
|
-
|
|
21758
|
-
questions: external_exports.array(field).min(1)
|
|
21759
|
-
}).refine(({ questions }) => questions.some((q) => q.type === "choice" && q.multiple), {
|
|
21760
|
-
message: "Shared cards require at least one multi-select question"
|
|
21679
|
+
var remotePeerDirectoryEntrySchema = external_exports.object({
|
|
21680
|
+
name: external_exports.string().min(1).max(512),
|
|
21681
|
+
path: external_exports.string().min(1).max(8192),
|
|
21682
|
+
kind: external_exports.literal("directory")
|
|
21761
21683
|
});
|
|
21762
|
-
var
|
|
21763
|
-
|
|
21764
|
-
|
|
21765
|
-
threadId: external_exports.string().min(1),
|
|
21766
|
-
turnId: external_exports.string().min(1),
|
|
21767
|
-
interactionId: external_exports.string().min(1),
|
|
21768
|
-
answers: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())),
|
|
21769
|
-
cancelled: external_exports.boolean().default(false)
|
|
21684
|
+
var remotePeerListDirsParamsSchema = external_exports.object({
|
|
21685
|
+
peerId: remotePeerIdSchema,
|
|
21686
|
+
path: external_exports.string().min(1).max(8192).optional()
|
|
21770
21687
|
});
|
|
21771
|
-
var
|
|
21772
|
-
|
|
21773
|
-
|
|
21774
|
-
|
|
21775
|
-
|
|
21776
|
-
oldText: external_exports.string().nullable(),
|
|
21777
|
-
newText: external_exports.string()
|
|
21688
|
+
var remotePeerListDirsResultSchema = external_exports.object({
|
|
21689
|
+
path: external_exports.string().min(1).max(8192),
|
|
21690
|
+
parentPath: external_exports.string().min(1).max(8192).nullable(),
|
|
21691
|
+
homeDir: external_exports.string().min(1).max(8192).optional(),
|
|
21692
|
+
entries: external_exports.array(remotePeerDirectoryEntrySchema)
|
|
21778
21693
|
});
|
|
21779
|
-
var
|
|
21780
|
-
|
|
21781
|
-
|
|
21782
|
-
|
|
21694
|
+
var remotePeerCreateDirParamsSchema = external_exports.object({
|
|
21695
|
+
peerId: remotePeerIdSchema,
|
|
21696
|
+
parentPath: external_exports.string().min(1).max(8192),
|
|
21697
|
+
name: external_exports.string().min(1).max(255).refine((value) => value.trim().length > 0, "Directory name cannot be blank")
|
|
21783
21698
|
});
|
|
21784
|
-
var
|
|
21785
|
-
|
|
21786
|
-
|
|
21787
|
-
|
|
21788
|
-
// ../../shared-contracts/dist/web-tool-output.js
|
|
21789
|
-
var webToolOutputReferenceSchema = external_exports.object({
|
|
21790
|
-
sessionId: external_exports.string().min(1),
|
|
21791
|
-
epoch: external_exports.string().min(1),
|
|
21792
|
-
turn: external_exports.number().int().nonnegative(),
|
|
21793
|
-
seq: external_exports.number().int().nonnegative(),
|
|
21794
|
-
callId: external_exports.string().min(1),
|
|
21795
|
-
part: external_exports.number().int().nonnegative(),
|
|
21796
|
-
version: external_exports.string().min(1)
|
|
21699
|
+
var remotePeerCreateDirResultSchema = external_exports.object({
|
|
21700
|
+
path: external_exports.string().min(1).max(8192),
|
|
21701
|
+
name: external_exports.string().min(1).max(255)
|
|
21797
21702
|
});
|
|
21798
|
-
var
|
|
21799
|
-
|
|
21800
|
-
|
|
21801
|
-
|
|
21703
|
+
var remotePeerCreateWorkspaceParamsSchema = external_exports.object({
|
|
21704
|
+
peerId: remotePeerIdSchema,
|
|
21705
|
+
path: external_exports.string().min(1).max(8192),
|
|
21706
|
+
title: external_exports.string().trim().min(1).max(255).optional()
|
|
21802
21707
|
});
|
|
21803
|
-
|
|
21804
|
-
|
|
21805
|
-
|
|
21806
|
-
title: external_exports.string().trim().min(1).max(
|
|
21807
|
-
type: external_exports.enum(["info", "warning", "danger"]),
|
|
21808
|
-
body: external_exports.string().trim().min(1).max(16 * 1024)
|
|
21708
|
+
var remotePeerRenameWorkspaceParamsSchema = external_exports.object({
|
|
21709
|
+
peerId: remotePeerIdSchema,
|
|
21710
|
+
workspaceId: external_exports.string().min(1).max(1024),
|
|
21711
|
+
title: external_exports.string().trim().min(1).max(255)
|
|
21809
21712
|
});
|
|
21810
|
-
var
|
|
21811
|
-
|
|
21812
|
-
|
|
21813
|
-
|
|
21713
|
+
var remotePeerDeleteWorkspaceParamsSchema = external_exports.object({
|
|
21714
|
+
peerId: remotePeerIdSchema,
|
|
21715
|
+
workspaceId: external_exports.string().min(1).max(1024)
|
|
21716
|
+
});
|
|
21717
|
+
var remotePeerWorkspaceMutationResultSchema = external_exports.object({
|
|
21718
|
+
workspaceId: external_exports.string().min(1).max(1024).optional(),
|
|
21719
|
+
manifest: remotePeerManifestSchema
|
|
21720
|
+
});
|
|
21721
|
+
var delegationRemoteHostsParamsSchema = external_exports.object({
|
|
21722
|
+
sessionHostId: external_exports.string().min(1).max(128).optional()
|
|
21723
|
+
});
|
|
21724
|
+
var delegationRemoteHostOptionSchema = external_exports.object({
|
|
21725
|
+
hostId: external_exports.union([external_exports.literal("local"), remotePeerHostIdSchema]),
|
|
21726
|
+
name: external_exports.string().min(1).max(120),
|
|
21727
|
+
isLocal: external_exports.boolean().optional(),
|
|
21728
|
+
color: remotePeerColorSchema.optional(),
|
|
21729
|
+
hostname: external_exports.string().max(255).optional()
|
|
21730
|
+
});
|
|
21731
|
+
var delegationRemoteHostsResultSchema = external_exports.object({
|
|
21732
|
+
hosts: external_exports.array(delegationRemoteHostOptionSchema)
|
|
21733
|
+
});
|
|
21734
|
+
var delegationHostHarnessesParamsSchema = external_exports.object({
|
|
21735
|
+
hostId: external_exports.union([external_exports.literal("local"), remotePeerHostIdSchema])
|
|
21736
|
+
});
|
|
21737
|
+
var delegationHostHarnessOptionSchema = external_exports.object({
|
|
21738
|
+
id: external_exports.string().regex(/^[a-z0-9][a-z0-9-]*$/u),
|
|
21739
|
+
name: external_exports.string().min(1).max(120)
|
|
21740
|
+
});
|
|
21741
|
+
var delegationHostHarnessesResultSchema = external_exports.object({
|
|
21742
|
+
harnesses: external_exports.array(delegationHostHarnessOptionSchema)
|
|
21814
21743
|
});
|
|
21815
|
-
var CONSOLE_HOST_METHODS = Object.freeze([
|
|
21816
|
-
"codexhost/console/remote-connections",
|
|
21817
|
-
"codexhost/runtime/status",
|
|
21818
|
-
"codexhost/remote/ssh-setup",
|
|
21819
|
-
"codexhost/harness/plugins/list",
|
|
21820
|
-
"codexhost/harness/display-settings/capabilities",
|
|
21821
|
-
"codexhost/harness/display-settings/get",
|
|
21822
|
-
"codexhost/harness/display-settings/set",
|
|
21823
|
-
"codexhost/harness/inspect",
|
|
21824
|
-
"codexhost/harness/installation",
|
|
21825
|
-
"codexhost/harness/installation/start",
|
|
21826
|
-
"codexhost/harness/installation/status",
|
|
21827
|
-
"codexhost/harness/launch-settings/get",
|
|
21828
|
-
"codexhost/harness/launch-settings/set",
|
|
21829
|
-
"codexhost/harness/web-ui/open",
|
|
21830
|
-
"codexhost/harness/accounts/sources",
|
|
21831
|
-
"codexhost/harness/accounts/list",
|
|
21832
|
-
"codexhost/harness/accounts/inspect",
|
|
21833
|
-
"codexhost/harness/credential-imports",
|
|
21834
|
-
"codexhost/harness/session-import/sources",
|
|
21835
|
-
"codexhost/harness/session-import/list",
|
|
21836
|
-
"codexhost/harness/session-import/import",
|
|
21837
|
-
"codexhost/account/list",
|
|
21838
|
-
"codexhost/account/refresh",
|
|
21839
|
-
"codexhost/account/usage/inspect",
|
|
21840
|
-
"codexhost/usage/model-prices/get",
|
|
21841
|
-
"codexhost/usage/model-prices/set",
|
|
21842
|
-
"codexhost/usage/model-prices/default",
|
|
21843
|
-
"codexhost/usage/statistics/get",
|
|
21844
|
-
"codexhost/update/check",
|
|
21845
|
-
"codexhost/update/start",
|
|
21846
|
-
"codexhost/update/status"
|
|
21847
|
-
]);
|
|
21848
|
-
|
|
21849
|
-
// ../../shared-contracts/dist/version.js
|
|
21850
|
-
var WORKSPACE_CONTRACT_VERSION = 1;
|
|
21851
21744
|
|
|
21852
|
-
// ../../shared-contracts/dist/
|
|
21853
|
-
var
|
|
21854
|
-
|
|
21855
|
-
"
|
|
21856
|
-
"
|
|
21857
|
-
"
|
|
21858
|
-
"
|
|
21859
|
-
"
|
|
21860
|
-
|
|
21861
|
-
|
|
21862
|
-
"
|
|
21863
|
-
|
|
21864
|
-
|
|
21865
|
-
|
|
21866
|
-
|
|
21867
|
-
|
|
21868
|
-
|
|
21869
|
-
|
|
21745
|
+
// ../../shared-contracts/dist/peer-delegation.js
|
|
21746
|
+
var PEER_DELEGATION_BRIDGE_VERSION = 1;
|
|
21747
|
+
var PEER_DELEGATION_OPERATIONS = [
|
|
21748
|
+
"listHarnesses",
|
|
21749
|
+
"inspect",
|
|
21750
|
+
"start",
|
|
21751
|
+
"send",
|
|
21752
|
+
"cancel",
|
|
21753
|
+
"read",
|
|
21754
|
+
"answer",
|
|
21755
|
+
"list"
|
|
21756
|
+
];
|
|
21757
|
+
var peerDelegationOperationSchema = external_exports.enum(PEER_DELEGATION_OPERATIONS);
|
|
21758
|
+
var peerDelegationRequestSchema = external_exports.strictObject({
|
|
21759
|
+
operation: peerDelegationOperationSchema,
|
|
21760
|
+
hopCount: external_exports.number().int().min(0).max(16),
|
|
21761
|
+
/** Opaque A-side peer pairing identifier used by B to scope implicit deduplication per Peer. */
|
|
21762
|
+
sourceId: remotePeerIdSchema.optional(),
|
|
21763
|
+
input: jsonObjectSchema
|
|
21764
|
+
});
|
|
21765
|
+
var peerDelegationErrorSchema = external_exports.strictObject({
|
|
21766
|
+
code: external_exports.string().min(1).max(128),
|
|
21767
|
+
message: external_exports.string().max(4096),
|
|
21768
|
+
details: jsonObjectSchema.optional()
|
|
21769
|
+
});
|
|
21770
|
+
var peerDelegationResponseSchema = external_exports.union([
|
|
21771
|
+
external_exports.strictObject({
|
|
21772
|
+
ok: external_exports.literal(true),
|
|
21773
|
+
value: jsonValueSchema
|
|
21774
|
+
}),
|
|
21775
|
+
external_exports.strictObject({
|
|
21776
|
+
ok: external_exports.literal(false),
|
|
21777
|
+
error: peerDelegationErrorSchema
|
|
21778
|
+
})
|
|
21870
21779
|
]);
|
|
21871
|
-
var
|
|
21872
|
-
|
|
21873
|
-
|
|
21874
|
-
|
|
21875
|
-
|
|
21876
|
-
|
|
21877
|
-
|
|
21878
|
-
|
|
21879
|
-
|
|
21880
|
-
|
|
21881
|
-
|
|
21882
|
-
|
|
21883
|
-
|
|
21780
|
+
var peerDelegationHostProjectSchema = external_exports.strictObject({
|
|
21781
|
+
id: external_exports.string().min(1).max(1024),
|
|
21782
|
+
name: external_exports.string().min(1).max(512),
|
|
21783
|
+
path: external_exports.string().min(1).max(8192)
|
|
21784
|
+
});
|
|
21785
|
+
var peerDelegationHostSummarySchema = external_exports.strictObject({
|
|
21786
|
+
hostId: remotePeerHostIdSchema,
|
|
21787
|
+
nodeId: remotePeerNodeIdSchema.optional(),
|
|
21788
|
+
displayName: external_exports.string().min(1).max(120),
|
|
21789
|
+
online: external_exports.boolean(),
|
|
21790
|
+
state: remotePeerStateSchema,
|
|
21791
|
+
delegation: external_exports.boolean(),
|
|
21792
|
+
projects: external_exports.array(peerDelegationHostProjectSchema),
|
|
21793
|
+
platform: external_exports.string().max(64).optional(),
|
|
21794
|
+
hostname: external_exports.string().max(255).optional(),
|
|
21795
|
+
homeDir: external_exports.string().max(4096).optional()
|
|
21796
|
+
});
|
|
21797
|
+
var peerDelegationHostsResultSchema = external_exports.strictObject({
|
|
21798
|
+
hosts: external_exports.array(peerDelegationHostSummarySchema)
|
|
21884
21799
|
});
|
|
21800
|
+
var peerDelegationBridgeDescriptorSchema = external_exports.strictObject({
|
|
21801
|
+
version: external_exports.literal(PEER_DELEGATION_BRIDGE_VERSION),
|
|
21802
|
+
instanceId: external_exports.string().min(1).max(128),
|
|
21803
|
+
pid: external_exports.number().int().positive(),
|
|
21804
|
+
endpoint: external_exports.string().min(1).max(256),
|
|
21805
|
+
token: external_exports.string().regex(/^[0-9a-f]{64}$/u),
|
|
21806
|
+
startedAt: external_exports.number().int().nonnegative()
|
|
21807
|
+
});
|
|
21808
|
+
var peerDelegationBridgeRequestSchema = external_exports.union([
|
|
21809
|
+
external_exports.strictObject({
|
|
21810
|
+
operation: external_exports.literal("hosts")
|
|
21811
|
+
}),
|
|
21812
|
+
external_exports.strictObject({
|
|
21813
|
+
operation: peerDelegationOperationSchema,
|
|
21814
|
+
hostId: remotePeerHostIdSchema,
|
|
21815
|
+
hopCount: external_exports.number().int().min(0).max(16),
|
|
21816
|
+
timeoutMs: external_exports.number().int().min(1).max(12e4).optional(),
|
|
21817
|
+
input: jsonObjectSchema
|
|
21818
|
+
})
|
|
21819
|
+
]);
|
|
21885
21820
|
|
|
21886
|
-
// ../../shared-contracts/dist/
|
|
21887
|
-
var
|
|
21888
|
-
|
|
21889
|
-
|
|
21890
|
-
|
|
21891
|
-
|
|
21892
|
-
balance: accountBalanceSnapshotSchema.optional()
|
|
21821
|
+
// ../../shared-contracts/dist/credential-imports.js
|
|
21822
|
+
var credentialSourceSchema = external_exports.object({
|
|
21823
|
+
id: external_exports.string().min(1).max(256),
|
|
21824
|
+
harnessId: external_exports.string().min(1),
|
|
21825
|
+
label: external_exports.string().min(1).max(512),
|
|
21826
|
+
provider: external_exports.enum(["openai-codex", "xai"])
|
|
21893
21827
|
}).strict();
|
|
21894
|
-
|
|
21895
|
-
|
|
21896
|
-
|
|
21897
|
-
|
|
21898
|
-
|
|
21899
|
-
}
|
|
21900
|
-
var harnessAccountSnapshotSchema = requireReportedQuota(harnessAccountSnapshotObject);
|
|
21901
|
-
var harnessAccountIdentityShape = {
|
|
21902
|
-
harnessId: harnessIdSchema,
|
|
21903
|
-
harnessName: external_exports.string().trim().min(1).max(128)
|
|
21904
|
-
};
|
|
21905
|
-
var harnessAccountSourceSchema = external_exports.object(harnessAccountIdentityShape).strict();
|
|
21906
|
-
var harnessAccountSourceListParamsSchema = external_exports.object({}).strict();
|
|
21907
|
-
var harnessAccountSourceListResultSchema = external_exports.object({ sources: external_exports.array(harnessAccountSourceSchema).max(128) }).strict();
|
|
21908
|
-
var harnessAccountInspectParamsSchema = external_exports.object({ harnessId: harnessIdSchema, refresh: external_exports.boolean().optional() }).strict();
|
|
21909
|
-
var harnessAccountInspectResultSchema = external_exports.object({
|
|
21910
|
-
...harnessAccountIdentityShape,
|
|
21911
|
-
account: harnessAccountSnapshotSchema.nullable(),
|
|
21912
|
-
/** Every Billing Source from one Harness; `account` remains the first for older clients. */
|
|
21913
|
-
accounts: external_exports.array(harnessAccountSnapshotSchema).max(8).optional()
|
|
21828
|
+
var credentialImportNameSchema = external_exports.string().regex(/^[a-z][a-z0-9-]{0,47}$/);
|
|
21829
|
+
var credentialImportRecordSchema = external_exports.object({
|
|
21830
|
+
name: credentialImportNameSchema,
|
|
21831
|
+
source: credentialSourceSchema,
|
|
21832
|
+
importedAt: external_exports.string()
|
|
21914
21833
|
}).strict();
|
|
21915
|
-
var
|
|
21916
|
-
|
|
21917
|
-
|
|
21834
|
+
var credentialImportsRequestSchema = external_exports.discriminatedUnion("action", [
|
|
21835
|
+
external_exports.object({ action: external_exports.literal("list") }).strict(),
|
|
21836
|
+
external_exports.object({
|
|
21837
|
+
action: external_exports.literal("import"),
|
|
21838
|
+
sourceId: external_exports.string().min(1).max(256),
|
|
21839
|
+
name: credentialImportNameSchema,
|
|
21840
|
+
confirmed: external_exports.literal(true)
|
|
21841
|
+
}).strict(),
|
|
21842
|
+
external_exports.object({
|
|
21843
|
+
action: external_exports.literal("reimport"),
|
|
21844
|
+
sourceId: external_exports.string().min(1).max(256),
|
|
21845
|
+
name: credentialImportNameSchema,
|
|
21846
|
+
confirmed: external_exports.literal(true)
|
|
21847
|
+
}).strict(),
|
|
21848
|
+
external_exports.object({
|
|
21849
|
+
action: external_exports.literal("remove"),
|
|
21850
|
+
name: credentialImportNameSchema,
|
|
21851
|
+
confirmed: external_exports.literal(true)
|
|
21852
|
+
}).strict()
|
|
21853
|
+
]);
|
|
21854
|
+
var credentialOtherLoginSchema = external_exports.object({
|
|
21855
|
+
provider: external_exports.string().min(1).max(128),
|
|
21856
|
+
type: external_exports.enum(["oauth", "api_key", "unknown"]),
|
|
21857
|
+
/** Best-effort account label (e.g. the email in a Codex token), derived locally when present. */
|
|
21858
|
+
label: external_exports.string().min(1).max(512).optional(),
|
|
21859
|
+
/** Recognized credential vendor, derived from the OAuth token issuer. Absent when unknown. */
|
|
21860
|
+
vendor: external_exports.enum(["openai-codex", "xai"]).optional()
|
|
21918
21861
|
}).strict();
|
|
21919
|
-
|
|
21920
|
-
|
|
21921
|
-
|
|
21922
|
-
|
|
21923
|
-
|
|
21924
|
-
|
|
21925
|
-
|
|
21926
|
-
|
|
21927
|
-
* Desktop forwards only the Model of a main-process prewarm to thread/start. */
|
|
21928
|
-
prewarm: external_exports.literal(true).optional()
|
|
21862
|
+
var credentialImportsResultSchema = external_exports.object({
|
|
21863
|
+
sources: external_exports.array(credentialSourceSchema),
|
|
21864
|
+
targets: external_exports.array(external_exports.object({
|
|
21865
|
+
harnessId: external_exports.string(),
|
|
21866
|
+
providers: external_exports.array(external_exports.enum(["openai-codex", "xai"])),
|
|
21867
|
+
imports: external_exports.array(credentialImportRecordSchema),
|
|
21868
|
+
others: external_exports.array(credentialOtherLoginSchema).default([])
|
|
21869
|
+
}).strict())
|
|
21929
21870
|
}).strict();
|
|
21930
|
-
|
|
21931
|
-
|
|
21932
|
-
|
|
21933
|
-
var harnessLaunchSettingsGetSchema = external_exports.object({
|
|
21934
|
-
harnessId: harnessPluginIdSchema
|
|
21871
|
+
var credentialImportsParamsSchema = external_exports.object({
|
|
21872
|
+
targetHarnessId: external_exports.string().min(1).max(128).optional(),
|
|
21873
|
+
request: credentialImportsRequestSchema
|
|
21935
21874
|
}).strict();
|
|
21936
|
-
|
|
21937
|
-
|
|
21875
|
+
|
|
21876
|
+
// ../../shared-contracts/dist/harness-display-settings.js
|
|
21877
|
+
var harnessDisplayCapabilitiesSchema = external_exports.object({ events: external_exports.boolean() });
|
|
21878
|
+
var harnessDisplayEntriesSchema = external_exports.array(external_exports.strictObject({
|
|
21879
|
+
agent: external_exports.string().min(1).max(128),
|
|
21880
|
+
section: external_exports.enum(["main", "more", "auto"])
|
|
21881
|
+
})).max(256).refine((entries) => new Set(entries.map((entry) => entry.agent)).size === entries.length, "Duplicate Harness IDs");
|
|
21882
|
+
var harnessDisplaySettingsSchema = external_exports.strictObject({
|
|
21883
|
+
entries: harnessDisplayEntriesSchema.nullable()
|
|
21884
|
+
});
|
|
21885
|
+
var harnessDisplayGetSchema = external_exports.strictObject({});
|
|
21886
|
+
var harnessDisplaySetSchema = external_exports.strictObject({
|
|
21887
|
+
entries: harnessDisplayEntriesSchema,
|
|
21888
|
+
/** Import legacy Desktop preferences only if no shared settings exist yet. */
|
|
21889
|
+
initializeOnly: external_exports.boolean().optional()
|
|
21938
21890
|
});
|
|
21939
|
-
var harnessLaunchSettingsSchema = external_exports.object({
|
|
21940
|
-
path: harnessLaunchPathSchema.nullable(),
|
|
21941
|
-
restartRequired: external_exports.boolean()
|
|
21942
|
-
}).strict();
|
|
21943
21891
|
|
|
21944
|
-
// ../../shared-contracts/dist/
|
|
21945
|
-
var
|
|
21946
|
-
|
|
21947
|
-
|
|
21948
|
-
|
|
21949
|
-
|
|
21950
|
-
|
|
21951
|
-
|
|
21952
|
-
|
|
21953
|
-
|
|
21954
|
-
|
|
21955
|
-
/** Present when the Adapter has a verified list and the available target is outside it. */
|
|
21956
|
-
latestVerifiedVersion: external_exports.string().min(1).max(128).optional(),
|
|
21957
|
-
/** Update preflight stopped before running the installer; latestVersion needs confirmation. */
|
|
21958
|
-
confirmationRequired: external_exports.literal(true).optional(),
|
|
21959
|
-
/** Defaults to CLI; some Harnesses ship only inside a desktop application. */
|
|
21960
|
-
versionKind: external_exports.enum(["cli", "application"]).optional(),
|
|
21961
|
-
/** Official download opened by the user; does not imply an automatic installation. */
|
|
21962
|
-
manualUpdateUrl: external_exports.url().max(2048).refine((value) => /^https:\/\/[^/?#@]+(?:[/?#]|$)/iu.test(value), "Manual updates require a credential-free HTTPS URL").optional(),
|
|
21963
|
-
// Adapter-owned diagnostic text; UI uses messageCode rather than displaying it verbatim.
|
|
21964
|
-
message: external_exports.string().max(2048).optional(),
|
|
21965
|
-
messageCode: external_exports.string().min(1).max(128).optional(),
|
|
21966
|
-
/** Safe plugin-owned explanation, distinct from raw diagnostic message. */
|
|
21967
|
-
notice: harnessLocalizedTextSchema.optional(),
|
|
21968
|
-
latestVersionKind: external_exports.enum(["unknown", "tracking-branch"]).optional()
|
|
21969
|
-
}).strict();
|
|
21970
|
-
var harnessInstallationTaskParamsSchema = external_exports.object({ taskId: external_exports.string().uuid() }).strict();
|
|
21971
|
-
var harnessInstallationTaskSchema = external_exports.discriminatedUnion("status", [
|
|
21972
|
-
external_exports.object({ taskId: external_exports.string().uuid(), status: external_exports.literal("running") }).strict(),
|
|
21973
|
-
external_exports.object({
|
|
21974
|
-
taskId: external_exports.string().uuid(),
|
|
21975
|
-
status: external_exports.literal("succeeded"),
|
|
21976
|
-
result: harnessInstallationStateSchema
|
|
21977
|
-
}).strict(),
|
|
21978
|
-
external_exports.object({
|
|
21979
|
-
taskId: external_exports.string().uuid(),
|
|
21980
|
-
status: external_exports.literal("failed"),
|
|
21981
|
-
error: external_exports.object({ code: external_exports.number().int(), message: external_exports.string().min(1).max(2048) }).strict()
|
|
21982
|
-
}).strict()
|
|
21983
|
-
]);
|
|
21892
|
+
// ../../shared-contracts/dist/idle-release.js
|
|
21893
|
+
var IDLE_RELEASE_TIMEOUT_MINUTES_MIN = 5;
|
|
21894
|
+
var IDLE_RELEASE_TIMEOUT_MINUTES_MAX = 1440;
|
|
21895
|
+
var idleReleaseSettingsSchema = external_exports.strictObject({
|
|
21896
|
+
enabled: external_exports.boolean(),
|
|
21897
|
+
timeoutMinutes: external_exports.number().int().min(IDLE_RELEASE_TIMEOUT_MINUTES_MIN).max(IDLE_RELEASE_TIMEOUT_MINUTES_MAX)
|
|
21898
|
+
});
|
|
21899
|
+
var DEFAULT_IDLE_RELEASE_SETTINGS = Object.freeze({
|
|
21900
|
+
enabled: true,
|
|
21901
|
+
timeoutMinutes: 10
|
|
21902
|
+
});
|
|
21984
21903
|
|
|
21985
|
-
// ../../shared-contracts/dist/
|
|
21986
|
-
var
|
|
21987
|
-
var
|
|
21988
|
-
var
|
|
21989
|
-
|
|
21990
|
-
|
|
21991
|
-
|
|
21992
|
-
|
|
21993
|
-
|
|
21994
|
-
|
|
21995
|
-
|
|
21996
|
-
|
|
21997
|
-
|
|
21998
|
-
|
|
21999
|
-
|
|
22000
|
-
|
|
22001
|
-
|
|
22002
|
-
|
|
22003
|
-
|
|
22004
|
-
|
|
22005
|
-
|
|
21904
|
+
// ../../shared-contracts/dist/harness-preferences.js
|
|
21905
|
+
var harnessPreferenceScopeSchema = external_exports.string().regex(/^external$/u);
|
|
21906
|
+
var preferenceHarnessKey = harnessIdSchema.transform((id2) => String(id2));
|
|
21907
|
+
var harnessDefaultConfigurationSchema = external_exports.strictObject({
|
|
21908
|
+
model: harnessModelRefSchema.optional(),
|
|
21909
|
+
thinkingOptionId: harnessThinkingOptionIdSchema.optional(),
|
|
21910
|
+
permissionModeId: harnessPermissionModeIdSchema.optional()
|
|
21911
|
+
}).refine((value) => Boolean(value.model || value.thinkingOptionId || value.permissionModeId), "A default configuration must contain a preference");
|
|
21912
|
+
var newThreadDefaultsSchema = external_exports.strictObject({
|
|
21913
|
+
lastHarness: harnessIdSchema.optional(),
|
|
21914
|
+
byHarness: external_exports.record(preferenceHarnessKey, harnessDefaultConfigurationSchema)
|
|
21915
|
+
});
|
|
21916
|
+
var harnessDelegationDefaultSchema = external_exports.strictObject({
|
|
21917
|
+
model: harnessModelRefSchema.optional(),
|
|
21918
|
+
thinkingOptionId: harnessThinkingOptionIdSchema.optional()
|
|
21919
|
+
}).refine((value) => Boolean(value.model || value.thinkingOptionId), "A delegation default must contain a Model or Thinking option");
|
|
21920
|
+
var delegationDefaultsSchema = external_exports.strictObject({
|
|
21921
|
+
byHarness: external_exports.record(preferenceHarnessKey, harnessDelegationDefaultSchema)
|
|
21922
|
+
});
|
|
21923
|
+
var modelId = external_exports.string().min(1).max(1024);
|
|
21924
|
+
var harnessPreferenceValuesSchema = external_exports.strictObject({
|
|
21925
|
+
idleRelease: idleReleaseSettingsSchema.optional(),
|
|
21926
|
+
favorites: external_exports.record(preferenceHarnessKey, external_exports.array(modelId).max(2048)).default({}),
|
|
21927
|
+
newThread: newThreadDefaultsSchema.optional(),
|
|
21928
|
+
delegation: delegationDefaultsSchema.optional()
|
|
21929
|
+
});
|
|
21930
|
+
var harnessPreferenceSnapshotSchema = external_exports.strictObject({
|
|
21931
|
+
scope: harnessPreferenceScopeSchema,
|
|
21932
|
+
revision: external_exports.number().int().nonnegative(),
|
|
21933
|
+
values: harnessPreferenceValuesSchema
|
|
21934
|
+
});
|
|
21935
|
+
var harnessPreferenceGetSchema = external_exports.strictObject({
|
|
21936
|
+
scope: harnessPreferenceScopeSchema.default("external")
|
|
21937
|
+
});
|
|
21938
|
+
var harnessPreferenceOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
21939
|
+
external_exports.strictObject({ kind: external_exports.literal("idleRelease"), value: idleReleaseSettingsSchema }),
|
|
21940
|
+
external_exports.strictObject({
|
|
21941
|
+
kind: external_exports.literal("favorite"),
|
|
21942
|
+
harnessId: harnessIdSchema,
|
|
21943
|
+
modelId,
|
|
21944
|
+
enabled: external_exports.boolean()
|
|
21945
|
+
}),
|
|
21946
|
+
external_exports.strictObject({
|
|
21947
|
+
kind: external_exports.literal("favorites"),
|
|
21948
|
+
harnessId: harnessIdSchema,
|
|
21949
|
+
modelIds: external_exports.array(modelId).max(2048)
|
|
21950
|
+
}),
|
|
21951
|
+
external_exports.strictObject({
|
|
21952
|
+
kind: external_exports.literal("newThread"),
|
|
21953
|
+
lastHarness: harnessIdSchema.optional(),
|
|
21954
|
+
harnessId: harnessIdSchema.optional(),
|
|
21955
|
+
configuration: harnessDefaultConfigurationSchema.optional()
|
|
21956
|
+
}),
|
|
21957
|
+
external_exports.strictObject({
|
|
21958
|
+
kind: external_exports.literal("delegation"),
|
|
21959
|
+
harnessId: harnessIdSchema,
|
|
21960
|
+
configuration: harnessDelegationDefaultSchema.nullable()
|
|
21961
|
+
})
|
|
22006
21962
|
]);
|
|
22007
|
-
var
|
|
22008
|
-
|
|
22009
|
-
|
|
22010
|
-
|
|
22011
|
-
|
|
22012
|
-
}).
|
|
22013
|
-
|
|
22014
|
-
|
|
22015
|
-
|
|
22016
|
-
|
|
22017
|
-
|
|
21963
|
+
var harnessPreferencePatchSchema = external_exports.strictObject({
|
|
21964
|
+
scope: harnessPreferenceScopeSchema.default("external"),
|
|
21965
|
+
operations: external_exports.array(harnessPreferenceOperationSchema).min(1).max(256),
|
|
21966
|
+
initializeOnly: external_exports.boolean().optional(),
|
|
21967
|
+
expectedRevision: external_exports.number().int().nonnegative().optional()
|
|
21968
|
+
}).superRefine((input3, ctx) => {
|
|
21969
|
+
for (const operation of input3.operations) {
|
|
21970
|
+
if (operation.kind === "newThread" && (!operation.lastHarness && !operation.configuration || Boolean(operation.harnessId) !== Boolean(operation.configuration)))
|
|
21971
|
+
ctx.addIssue({
|
|
21972
|
+
code: "custom",
|
|
21973
|
+
message: "A default Harness or complete configuration is required"
|
|
21974
|
+
});
|
|
21975
|
+
}
|
|
21976
|
+
});
|
|
21977
|
+
var harnessPreferencesDocumentSchema = external_exports.strictObject({
|
|
21978
|
+
version: external_exports.literal(1),
|
|
22018
21979
|
revision: external_exports.number().int().nonnegative(),
|
|
22019
|
-
|
|
22020
|
-
|
|
22021
|
-
}).strict();
|
|
22022
|
-
var codexAccountUsageParamsSchema = external_exports.object({ accountId: accountIdSchema, refresh: external_exports.boolean().optional() }).strict();
|
|
22023
|
-
var codexAccountUsageResultSchema = external_exports.object({
|
|
22024
|
-
accountId: accountIdSchema,
|
|
22025
|
-
usage: threadUsageSnapshotSchema.nullable(),
|
|
22026
|
-
accountCredits: accountCreditsSnapshotSchema.optional(),
|
|
22027
|
-
freshness: external_exports.enum(["live", "cached"]),
|
|
22028
|
-
observedAt: external_exports.string().datetime().nullable()
|
|
22029
|
-
}).strict();
|
|
22030
|
-
|
|
22031
|
-
// ../../shared-contracts/dist/harness-session-import.js
|
|
22032
|
-
var HARNESS_SESSION_IMPORT_ID_MAX_LENGTH = 1024;
|
|
22033
|
-
var HARNESS_SESSION_IMPORT_CWD_MAX_LENGTH = 16384;
|
|
22034
|
-
var HARNESS_SESSION_IMPORT_TITLE_MAX_LENGTH = 4096;
|
|
22035
|
-
var HARNESS_SESSION_IMPORT_LIST_MAX_LENGTH = 1e3;
|
|
22036
|
-
var HARNESS_SESSION_IMPORT_UPDATED_AT_MAX = 864e13;
|
|
22037
|
-
var nonBlankTextSchema4 = external_exports.string().refine((value) => value.trim().length > 0, "Value must not be empty or whitespace").refine((value) => !value.includes("\0"), "Value must not contain NUL");
|
|
22038
|
-
var harnessSessionImportIdSchema = nonBlankTextSchema4.max(HARNESS_SESSION_IMPORT_ID_MAX_LENGTH);
|
|
22039
|
-
var harnessSessionImportCandidateSchema = external_exports.object({
|
|
22040
|
-
nativeSessionId: harnessSessionImportIdSchema,
|
|
22041
|
-
title: nonBlankTextSchema4.max(HARNESS_SESSION_IMPORT_TITLE_MAX_LENGTH).nullable(),
|
|
22042
|
-
updatedAt: external_exports.number().int().nonnegative().max(HARNESS_SESSION_IMPORT_UPDATED_AT_MAX),
|
|
22043
|
-
cwd: nonBlankTextSchema4.max(HARNESS_SESSION_IMPORT_CWD_MAX_LENGTH),
|
|
22044
|
-
// Native file discovery cannot reliably observe another process's activity.
|
|
22045
|
-
running: external_exports.boolean().nullable()
|
|
22046
|
-
}).strict();
|
|
22047
|
-
var harnessSessionImportSourcesParamsSchema = external_exports.object({}).strict();
|
|
22048
|
-
var harnessSessionImportSourcesResultSchema = external_exports.object({
|
|
22049
|
-
harnesses: external_exports.array(external_exports.object({
|
|
22050
|
-
harnessId: harnessPluginIdSchema,
|
|
22051
|
-
name: nonBlankTextSchema4.max(128)
|
|
22052
|
-
}).strict()).max(128)
|
|
22053
|
-
}).strict();
|
|
22054
|
-
var harnessSessionListParamsSchema = external_exports.object({
|
|
22055
|
-
harnessId: harnessPluginIdSchema,
|
|
22056
|
-
query: external_exports.string().trim().max(4096).refine((value) => !value.includes("\0")).optional(),
|
|
22057
|
-
offset: external_exports.number().int().nonnegative().safe().optional(),
|
|
22058
|
-
limit: external_exports.number().int().min(1).max(HARNESS_SESSION_IMPORT_LIST_MAX_LENGTH).optional()
|
|
22059
|
-
}).strict();
|
|
22060
|
-
var harnessSessionListResultSchema = external_exports.object({
|
|
22061
|
-
candidates: external_exports.array(harnessSessionImportCandidateSchema).max(HARNESS_SESSION_IMPORT_LIST_MAX_LENGTH),
|
|
22062
|
-
total: external_exports.number().int().nonnegative().safe()
|
|
22063
|
-
}).strict();
|
|
22064
|
-
var harnessSessionImportParamsSchema = external_exports.object({
|
|
22065
|
-
harnessId: harnessPluginIdSchema,
|
|
22066
|
-
nativeSessionId: harnessSessionImportIdSchema
|
|
22067
|
-
}).strict();
|
|
22068
|
-
var harnessSessionImportResultSchema = external_exports.object({
|
|
22069
|
-
threadId: nonBlankTextSchema4.max(1024).pipe(hostThreadIdSchema)
|
|
22070
|
-
}).strict();
|
|
22071
|
-
|
|
22072
|
-
// ../../shared-contracts/dist/deepseek-modern-sessions.js
|
|
22073
|
-
var DEEPSEEK_MODERN_SESSION_LIST_MAX_LENGTH = HARNESS_SESSION_IMPORT_LIST_MAX_LENGTH;
|
|
22074
|
-
var DEEPSEEK_MODERN_HOST_THREAD_ID_MAX_LENGTH = 1024;
|
|
22075
|
-
var nonBlankTextSchema5 = external_exports.string().refine((value) => value.trim().length > 0, "Value must not be empty or whitespace").refine((value) => !value.includes("\0"), "Value must not contain NUL");
|
|
22076
|
-
var deepSeekModernSessionIdSchema = harnessSessionImportIdSchema;
|
|
22077
|
-
var deepSeekModernSessionCandidateSchema = harnessSessionImportCandidateSchema;
|
|
22078
|
-
var deepSeekModernSessionListParamsSchema = external_exports.object({}).strict();
|
|
22079
|
-
var deepSeekModernSessionListResultSchema = external_exports.object({
|
|
22080
|
-
candidates: external_exports.array(deepSeekModernSessionCandidateSchema).max(DEEPSEEK_MODERN_SESSION_LIST_MAX_LENGTH)
|
|
22081
|
-
}).strict();
|
|
22082
|
-
var deepSeekModernSessionImportParamsSchema = external_exports.object({
|
|
22083
|
-
nativeSessionId: deepSeekModernSessionIdSchema
|
|
22084
|
-
}).strict();
|
|
22085
|
-
var deepSeekModernSessionImportResultSchema = external_exports.object({
|
|
22086
|
-
threadId: nonBlankTextSchema5.max(DEEPSEEK_MODERN_HOST_THREAD_ID_MAX_LENGTH).pipe(hostThreadIdSchema)
|
|
22087
|
-
}).strict();
|
|
22088
|
-
|
|
22089
|
-
// ../../shared-contracts/dist/external-thread-fork.js
|
|
22090
|
-
var externalThreadForkParamsSchema = external_exports.object({
|
|
22091
|
-
threadId: hostThreadIdSchema,
|
|
22092
|
-
lastTurnId: hostTurnIdSchema
|
|
22093
|
-
}).strict();
|
|
22094
|
-
var externalThreadForkResultSchema = external_exports.object({
|
|
22095
|
-
threadId: hostThreadIdSchema
|
|
22096
|
-
}).strict();
|
|
21980
|
+
scopes: external_exports.record(harnessPreferenceScopeSchema, harnessPreferenceValuesSchema)
|
|
21981
|
+
});
|
|
22097
21982
|
|
|
22098
|
-
// ../../shared-contracts/dist/
|
|
22099
|
-
var
|
|
22100
|
-
var
|
|
22101
|
-
|
|
22102
|
-
|
|
22103
|
-
|
|
22104
|
-
|
|
22105
|
-
|
|
22106
|
-
label: commandLabelSchema,
|
|
22107
|
-
description: commandDescriptionSchema.optional(),
|
|
22108
|
-
localizations: harnessLocalizationsSchema.optional(),
|
|
22109
|
-
argumentMode: external_exports.enum(["none", "text"]),
|
|
22110
|
-
/**
|
|
22111
|
-
* Native distinction reported by the Harness. Omitted when the Harness does
|
|
22112
|
-
* not tell skills and commands apart; consumers treat that as "command".
|
|
22113
|
-
*/
|
|
22114
|
-
kind: external_exports.enum(["command", "skill"]).optional()
|
|
22115
|
-
}).strict();
|
|
22116
|
-
var harnessCommandCatalogSchema = external_exports.object({
|
|
22117
|
-
commands: external_exports.array(harnessCommandDescriptorSchema),
|
|
22118
|
-
/** Partial discovery failures; valid commands remain available. */
|
|
22119
|
-
warnings: external_exports.array(external_exports.string().min(1)).optional(),
|
|
22120
|
-
/**
|
|
22121
|
-
* `live` when the catalog includes what a native Session reports for its
|
|
22122
|
-
* workspace (custom commands, skills); `static` for Adapter built-ins only.
|
|
22123
|
-
* Omitted by Adapters; set by the Host on inspection results.
|
|
22124
|
-
*/
|
|
22125
|
-
source: external_exports.enum(["live", "static"]).optional()
|
|
22126
|
-
}).strict().superRefine((catalog, context) => {
|
|
22127
|
-
const ids = /* @__PURE__ */ new Set();
|
|
22128
|
-
for (const [index, command] of catalog.commands.entries()) {
|
|
22129
|
-
if (ids.has(command.id)) {
|
|
22130
|
-
context.addIssue({
|
|
22131
|
-
code: "custom",
|
|
22132
|
-
message: "Harness command IDs must be unique",
|
|
22133
|
-
path: ["commands", index, "id"]
|
|
22134
|
-
});
|
|
22135
|
-
}
|
|
22136
|
-
ids.add(command.id);
|
|
22137
|
-
}
|
|
22138
|
-
});
|
|
22139
|
-
var harnessCommandsInspectParamsSchema = external_exports.object({
|
|
22140
|
-
harnessId: harnessIdSchema,
|
|
22141
|
-
/** Workspace of a draft without a Thread, for its live catalog when known. */
|
|
22142
|
-
cwd: external_exports.string().min(1).optional()
|
|
22143
|
-
}).strict();
|
|
22144
|
-
var threadCommandsInspectParamsSchema = external_exports.object({
|
|
22145
|
-
threadId: hostThreadIdSchema
|
|
22146
|
-
}).strict();
|
|
22147
|
-
var threadCommandExecuteParamsSchema = external_exports.object({
|
|
22148
|
-
threadId: hostThreadIdSchema,
|
|
22149
|
-
commandId: commandIdSchema,
|
|
22150
|
-
turnId: hostTurnIdSchema.optional(),
|
|
22151
|
-
arguments: jsonObjectSchema.optional()
|
|
22152
|
-
}).strict();
|
|
22153
|
-
var threadCommandExecuteResultSchema = external_exports.object({
|
|
22154
|
-
accepted: external_exports.literal(true),
|
|
22155
|
-
turnId: hostTurnIdSchema.optional()
|
|
22156
|
-
}).strict();
|
|
22157
|
-
|
|
22158
|
-
// ../../shared-contracts/dist/json-rpc.js
|
|
22159
|
-
var jsonRpcVersionSchema = external_exports.literal("2.0").optional();
|
|
22160
|
-
var absentSchema = external_exports.never().optional();
|
|
22161
|
-
var methodSchema = external_exports.string().min(1);
|
|
22162
|
-
var jsonRpcIdSchema = external_exports.union([external_exports.string(), external_exports.number().int()]);
|
|
22163
|
-
var jsonRpcErrorSchema = external_exports.object({
|
|
22164
|
-
code: external_exports.number().int(),
|
|
22165
|
-
message: external_exports.string(),
|
|
22166
|
-
data: jsonValueSchema.optional()
|
|
22167
|
-
}).catchall(jsonValueSchema).superRefine(rejectExplicitUndefined(["data"]));
|
|
22168
|
-
var jsonRpcRequestSchema = external_exports.object({
|
|
22169
|
-
jsonrpc: jsonRpcVersionSchema,
|
|
22170
|
-
id: jsonRpcIdSchema,
|
|
22171
|
-
method: methodSchema,
|
|
22172
|
-
params: jsonValueSchema.optional(),
|
|
22173
|
-
result: absentSchema,
|
|
22174
|
-
error: absentSchema
|
|
22175
|
-
}).catchall(jsonValueSchema).superRefine(rejectExplicitUndefined(["jsonrpc", "params", "result", "error"]));
|
|
22176
|
-
var jsonRpcNotificationSchema = external_exports.object({
|
|
22177
|
-
jsonrpc: jsonRpcVersionSchema,
|
|
22178
|
-
id: absentSchema,
|
|
22179
|
-
method: methodSchema,
|
|
22180
|
-
params: jsonValueSchema.optional(),
|
|
22181
|
-
result: absentSchema,
|
|
22182
|
-
error: absentSchema
|
|
22183
|
-
}).catchall(jsonValueSchema).superRefine(rejectExplicitUndefined(["jsonrpc", "id", "params", "result", "error"]));
|
|
22184
|
-
var jsonRpcSuccessResponseSchema = external_exports.object({
|
|
22185
|
-
jsonrpc: jsonRpcVersionSchema,
|
|
22186
|
-
id: jsonRpcIdSchema,
|
|
22187
|
-
method: absentSchema,
|
|
22188
|
-
params: absentSchema,
|
|
22189
|
-
result: jsonValueSchema,
|
|
22190
|
-
error: absentSchema
|
|
22191
|
-
}).catchall(jsonValueSchema).superRefine(rejectExplicitUndefined(["jsonrpc", "method", "params", "error"]));
|
|
22192
|
-
var jsonRpcErrorResponseSchema = external_exports.object({
|
|
22193
|
-
jsonrpc: jsonRpcVersionSchema,
|
|
22194
|
-
id: jsonRpcIdSchema,
|
|
22195
|
-
method: absentSchema,
|
|
22196
|
-
params: absentSchema,
|
|
22197
|
-
result: absentSchema,
|
|
22198
|
-
error: jsonRpcErrorSchema
|
|
22199
|
-
}).catchall(jsonValueSchema).superRefine(rejectExplicitUndefined(["jsonrpc", "method", "params", "result"]));
|
|
22200
|
-
var jsonRpcEnvelopeSchema = external_exports.union([
|
|
22201
|
-
jsonRpcRequestSchema,
|
|
22202
|
-
jsonRpcNotificationSchema,
|
|
22203
|
-
jsonRpcSuccessResponseSchema,
|
|
22204
|
-
jsonRpcErrorResponseSchema
|
|
22205
|
-
]);
|
|
22206
|
-
|
|
22207
|
-
// ../../shared-contracts/dist/native-refs.js
|
|
22208
|
-
var nativeIdSchema = external_exports.string().refine((value) => value.trim().length > 0, {
|
|
22209
|
-
message: "Native identifier must not be empty or whitespace"
|
|
21983
|
+
// ../../shared-contracts/dist/model-price-overrides.js
|
|
21984
|
+
var usdPerMillionTokens = external_exports.number().finite().nonnegative();
|
|
21985
|
+
var modelPriceOverrideSchema = external_exports.strictObject({
|
|
21986
|
+
input: usdPerMillionTokens,
|
|
21987
|
+
output: usdPerMillionTokens,
|
|
21988
|
+
cacheRead: usdPerMillionTokens.optional(),
|
|
21989
|
+
cacheWrite: usdPerMillionTokens.optional(),
|
|
21990
|
+
cacheWrite1h: usdPerMillionTokens.optional()
|
|
22210
21991
|
});
|
|
22211
|
-
var
|
|
22212
|
-
|
|
22213
|
-
|
|
22214
|
-
|
|
22215
|
-
|
|
22216
|
-
|
|
22217
|
-
|
|
22218
|
-
harnessId: harnessIdSchema,
|
|
22219
|
-
nativeSessionId: nativeIdSchema,
|
|
22220
|
-
nativeTurnKey: nativeIdSchema,
|
|
22221
|
-
formatVersion: external_exports.literal(1)
|
|
21992
|
+
var modelPriceKeySchema = external_exports.string().max(512).refine((key2) => key2.trim() === key2 && key2.length > 0, "Model ID is required");
|
|
21993
|
+
var modelPriceOverridesSchema = external_exports.strictObject({
|
|
21994
|
+
/** Absolute path of the Host's `pricing.json`. */
|
|
21995
|
+
path: external_exports.string(),
|
|
21996
|
+
entries: external_exports.array(external_exports.strictObject({ key: external_exports.string(), price: modelPriceOverrideSchema })),
|
|
21997
|
+
/** Why the existing file is unusable; the Host then ignores it and refuses to overwrite it. */
|
|
21998
|
+
error: external_exports.string().nullable()
|
|
22222
21999
|
});
|
|
22223
|
-
var
|
|
22224
|
-
|
|
22225
|
-
|
|
22226
|
-
|
|
22227
|
-
|
|
22228
|
-
formatVersion: external_exports.literal(1)
|
|
22229
|
-
}).superRefine(rejectExplicitUndefined(["locator"]));
|
|
22230
|
-
|
|
22231
|
-
// ../../shared-contracts/dist/updates.js
|
|
22232
|
-
var UPDATE_ERROR_MAX_LENGTH = 500;
|
|
22233
|
-
var UPDATE_SEMVER_PATTERN = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/u;
|
|
22234
|
-
var updateSemanticVersionSchema = external_exports.string().regex(UPDATE_SEMVER_PATTERN);
|
|
22235
|
-
var updateInstallationSchema = external_exports.enum([
|
|
22236
|
-
"npm",
|
|
22237
|
-
"windows-installer",
|
|
22238
|
-
"macos-dmg",
|
|
22239
|
-
"linux-archive"
|
|
22240
|
-
]);
|
|
22241
|
-
var updatePhaseSchema = external_exports.enum([
|
|
22242
|
-
"prepared",
|
|
22243
|
-
"downloading",
|
|
22244
|
-
"waiting-for-exit",
|
|
22245
|
-
"installing",
|
|
22246
|
-
"restarting",
|
|
22247
|
-
"succeeded",
|
|
22248
|
-
"failed"
|
|
22249
|
-
]);
|
|
22250
|
-
var updateStatusSchema = external_exports.strictObject({
|
|
22251
|
-
version: updateSemanticVersionSchema,
|
|
22252
|
-
installation: updateInstallationSchema,
|
|
22253
|
-
phase: updatePhaseSchema,
|
|
22254
|
-
updatedAt: external_exports.number().int().nonnegative(),
|
|
22255
|
-
downloadedBytes: external_exports.number().int().nonnegative().optional(),
|
|
22256
|
-
totalBytes: external_exports.number().int().positive().optional(),
|
|
22257
|
-
error: external_exports.string().min(1).max(UPDATE_ERROR_MAX_LENGTH).nullable(),
|
|
22258
|
-
serviceStopOutput: external_exports.string().optional()
|
|
22259
|
-
}).superRefine((status, context) => {
|
|
22260
|
-
if (status.downloadedBytes !== void 0 && status.totalBytes !== void 0 && status.downloadedBytes > status.totalBytes) {
|
|
22261
|
-
context.addIssue({
|
|
22262
|
-
code: "custom",
|
|
22263
|
-
path: ["downloadedBytes"],
|
|
22264
|
-
message: "downloadedBytes must not exceed totalBytes"
|
|
22265
|
-
});
|
|
22266
|
-
}
|
|
22000
|
+
var modelPriceOverridesGetSchema = external_exports.strictObject({});
|
|
22001
|
+
var modelPriceOverridesSetSchema = external_exports.strictObject({
|
|
22002
|
+
key: modelPriceKeySchema,
|
|
22003
|
+
price: modelPriceOverrideSchema.nullable(),
|
|
22004
|
+
previousKey: modelPriceKeySchema.optional()
|
|
22267
22005
|
});
|
|
22268
|
-
var
|
|
22269
|
-
|
|
22270
|
-
var updateCheckResultSchema = external_exports.strictObject({
|
|
22271
|
-
currentVersion: updateSemanticVersionSchema,
|
|
22272
|
-
installation: updateInstallationSchema.nullable(),
|
|
22273
|
-
latestVersion: updateSemanticVersionSchema.nullable(),
|
|
22274
|
-
updateAvailable: external_exports.boolean(),
|
|
22275
|
-
installationAvailable: external_exports.boolean(),
|
|
22276
|
-
releaseNotes: external_exports.string().min(1).max(2e4).nullable(),
|
|
22277
|
-
releaseNotesUrl: githubReleaseNotesUrlSchema.nullable(),
|
|
22278
|
-
status: updateStatusSchema.nullable(),
|
|
22279
|
-
error: external_exports.string().min(1).max(UPDATE_ERROR_MAX_LENGTH).nullable()
|
|
22006
|
+
var modelPriceDefaultParamsSchema = external_exports.strictObject({
|
|
22007
|
+
model: modelPriceKeySchema
|
|
22280
22008
|
});
|
|
22281
|
-
var
|
|
22282
|
-
|
|
22009
|
+
var modelPriceSuggestionSchema = external_exports.strictObject({
|
|
22010
|
+
/** Verified from catalog canonical links, not inferred from names or equal prices. */
|
|
22011
|
+
official: external_exports.boolean().optional(),
|
|
22012
|
+
canonicalModelId: external_exports.string().min(1).optional(),
|
|
22013
|
+
provider: external_exports.string().min(1).max(512),
|
|
22014
|
+
model: external_exports.string().min(1).max(512),
|
|
22015
|
+
price: modelPriceOverrideSchema
|
|
22283
22016
|
});
|
|
22284
|
-
var
|
|
22285
|
-
|
|
22017
|
+
var modelPriceDefaultResultSchema = external_exports.strictObject({
|
|
22018
|
+
price: modelPriceOverrideSchema.nullable(),
|
|
22019
|
+
/** Local catalog suggestions only; never used automatically for pricing. */
|
|
22020
|
+
suggestions: external_exports.array(modelPriceSuggestionSchema).max(6).optional()
|
|
22286
22021
|
});
|
|
22287
22022
|
|
|
22288
|
-
// ../../shared-contracts/dist/
|
|
22289
|
-
var
|
|
22290
|
-
var
|
|
22291
|
-
|
|
22292
|
-
|
|
22293
|
-
|
|
22294
|
-
|
|
22295
|
-
|
|
22296
|
-
|
|
22297
|
-
|
|
22298
|
-
|
|
22299
|
-
|
|
22300
|
-
|
|
22301
|
-
|
|
22302
|
-
|
|
22303
|
-
|
|
22304
|
-
|
|
22305
|
-
|
|
22306
|
-
|
|
22307
|
-
|
|
22023
|
+
// ../../shared-contracts/dist/usage-statistics.js
|
|
22024
|
+
var USAGE_STATISTICS_RANGES = ["today", "7d", "30d", "90d", "all"];
|
|
22025
|
+
var count = external_exports.number().int().min(0).max(Number.MAX_SAFE_INTEGER);
|
|
22026
|
+
var localDate = external_exports.string().regex(/^\d{4}-\d{2}-\d{2}$/u);
|
|
22027
|
+
var harness = external_exports.string().min(1).max(128);
|
|
22028
|
+
var model = external_exports.string().min(1).max(512);
|
|
22029
|
+
var project = external_exports.string().min(1).max(4096);
|
|
22030
|
+
var usageStatisticsParamsSchema = external_exports.strictObject({
|
|
22031
|
+
range: external_exports.enum(USAGE_STATISTICS_RANGES),
|
|
22032
|
+
/** Display timezone for ranges, dates and hourly buckets; omitted means the Host's local zone. */
|
|
22033
|
+
timeZone: external_exports.string().min(1).max(128).refine((value) => {
|
|
22034
|
+
try {
|
|
22035
|
+
new Intl.DateTimeFormat("en", { timeZone: value });
|
|
22036
|
+
return true;
|
|
22037
|
+
} catch {
|
|
22038
|
+
return false;
|
|
22039
|
+
}
|
|
22040
|
+
}, "Unsupported usage statistics timezone").optional(),
|
|
22041
|
+
harness: harness.optional(),
|
|
22042
|
+
model: model.nullable().optional(),
|
|
22043
|
+
project: project.nullable().optional(),
|
|
22044
|
+
/** One date in the query timezone inside the range. */
|
|
22045
|
+
date: localDate.optional()
|
|
22308
22046
|
});
|
|
22309
|
-
var
|
|
22310
|
-
|
|
22047
|
+
var usageStatisticsTotalsSchema = external_exports.strictObject({
|
|
22048
|
+
requests: count,
|
|
22049
|
+
inputTokens: count,
|
|
22050
|
+
cachedInputTokens: count,
|
|
22051
|
+
cacheWriteInputTokens: count,
|
|
22052
|
+
cacheKnownInputTokens: count,
|
|
22053
|
+
cacheHitCachedInputTokens: count,
|
|
22054
|
+
cacheHitInputTokens: count,
|
|
22055
|
+
outputTokens: count,
|
|
22056
|
+
reasoningOutputTokens: count,
|
|
22057
|
+
/** USD at the public price, summed over the priced requests only. */
|
|
22058
|
+
costUsd: external_exports.number().finite().min(0),
|
|
22059
|
+
/** Requests without a price (or the cache data the price needs); not in `costUsd`. */
|
|
22060
|
+
unpricedRequests: count,
|
|
22061
|
+
/**
|
|
22062
|
+
* Requests whose storage gave no token counts: counted as requests, with neither tokens nor
|
|
22063
|
+
* cost, and not as unpriced.
|
|
22064
|
+
*/
|
|
22065
|
+
unmeteredRequests: count
|
|
22311
22066
|
});
|
|
22312
|
-
var
|
|
22313
|
-
|
|
22314
|
-
|
|
22067
|
+
var totals = usageStatisticsTotalsSchema.shape;
|
|
22068
|
+
var usageStatisticsSessionSchema = external_exports.strictObject({
|
|
22069
|
+
harness,
|
|
22070
|
+
sessionId: external_exports.string().min(1).max(512),
|
|
22071
|
+
project: project.nullable(),
|
|
22072
|
+
/** Persisted Desktop title for a mapped Session, otherwise its native name; may be absent. */
|
|
22073
|
+
title: external_exports.string().min(1).max(200).optional(),
|
|
22074
|
+
/** Models the session used, most requests first. */
|
|
22075
|
+
models: external_exports.array(model).max(16),
|
|
22076
|
+
firstAtMs: count,
|
|
22077
|
+
lastAtMs: count,
|
|
22078
|
+
...totals
|
|
22315
22079
|
});
|
|
22316
|
-
var
|
|
22317
|
-
|
|
22080
|
+
var usageStatisticsResultSchema = external_exports.strictObject({
|
|
22081
|
+
range: external_exports.enum(USAGE_STATISTICS_RANGES),
|
|
22082
|
+
/** First date in the query timezone (Host local when omitted); null for all time. */
|
|
22083
|
+
from: localDate.nullable(),
|
|
22084
|
+
to: localDate,
|
|
22085
|
+
/** The filters these figures apply, echoed so a late answer to older filters is recognised. */
|
|
22086
|
+
filters: external_exports.strictObject({
|
|
22087
|
+
harness: harness.nullable(),
|
|
22088
|
+
model: model.nullable(),
|
|
22089
|
+
unknownModel: external_exports.boolean(),
|
|
22090
|
+
project: project.nullable(),
|
|
22091
|
+
unknownProject: external_exports.boolean(),
|
|
22092
|
+
date: localDate.nullable()
|
|
22093
|
+
}),
|
|
22094
|
+
/** Reading of native storage: incomplete while the first read, or a refresh, is under way. */
|
|
22095
|
+
reading: external_exports.strictObject({ complete: external_exports.boolean(), sources: count, read: count }),
|
|
22096
|
+
/** Harnesses whose storage could not be read; their part is missing, the rest is complete. */
|
|
22097
|
+
failures: external_exports.array(external_exports.strictObject({ harness, message: external_exports.string().max(2048) })).max(256),
|
|
22098
|
+
/** Every value seen in the range, ignoring the filters, to choose filters from. */
|
|
22099
|
+
options: external_exports.strictObject({
|
|
22100
|
+
harnesses: external_exports.array(harness).max(256),
|
|
22101
|
+
models: external_exports.array(model.nullable()).max(4096),
|
|
22102
|
+
projects: external_exports.array(project.nullable()).max(4096)
|
|
22103
|
+
}),
|
|
22104
|
+
/** Current display metadata, scoped by Harness. Never a pricing or filter identity.
|
|
22105
|
+
* Optional for older Hosts; missing/conflicting labels fall back to the native model ID.
|
|
22106
|
+
*/
|
|
22107
|
+
modelLabels: external_exports.array(external_exports.strictObject({ harness, model, label: model })).max(4096).optional(),
|
|
22108
|
+
/** Native credits, all filters applied, never combined across Harnesses or treated as USD.
|
|
22109
|
+
* Only groups with at least one reported value appear; reportedRequests exposes partial data.
|
|
22110
|
+
*/
|
|
22111
|
+
credits: external_exports.array(external_exports.strictObject({
|
|
22112
|
+
harness,
|
|
22113
|
+
model: model.nullable(),
|
|
22114
|
+
credits: external_exports.number().finite().min(0),
|
|
22115
|
+
reportedRequests: count,
|
|
22116
|
+
requests: count
|
|
22117
|
+
})).max(4096).optional(),
|
|
22118
|
+
/** All filters applied. */
|
|
22119
|
+
totals: usageStatisticsTotalsSchema,
|
|
22120
|
+
/** Each date and Harness of the range: every filter except the day. */
|
|
22121
|
+
daily: external_exports.array(external_exports.strictObject({ date: localDate, harness, ...totals })).max(2e5),
|
|
22122
|
+
/** Weekday (0 = Sunday) and hour in the query timezone, all filters applied. */
|
|
22123
|
+
hourly: external_exports.array(external_exports.strictObject({
|
|
22124
|
+
weekday: external_exports.number().int().min(0).max(6),
|
|
22125
|
+
hour: external_exports.number().int().min(0).max(23),
|
|
22126
|
+
...totals
|
|
22127
|
+
})).max(168),
|
|
22128
|
+
byHarness: external_exports.array(external_exports.strictObject({ harness, ...totals })).max(256),
|
|
22129
|
+
byModel: external_exports.array(external_exports.strictObject({
|
|
22130
|
+
model: model.nullable(),
|
|
22131
|
+
...totals,
|
|
22132
|
+
/** Requests priced by what the Harness recorded they cost, not by a price list. */
|
|
22133
|
+
harnessPricedRequests: count
|
|
22134
|
+
})).max(4096),
|
|
22135
|
+
byProject: external_exports.array(external_exports.strictObject({ project: project.nullable(), ...totals })).max(4096),
|
|
22136
|
+
/**
|
|
22137
|
+
* The sessions that spent the most, by cost and by tokens without cache, all filters applied;
|
|
22138
|
+
* requests without a native session are not listed here but count everywhere else.
|
|
22139
|
+
*/
|
|
22140
|
+
sessions: external_exports.array(usageStatisticsSessionSchema).max(100),
|
|
22141
|
+
/**
|
|
22142
|
+
* The sessions last active in the range, newest first, all filters applied. Optional for older
|
|
22143
|
+
* Hosts; missing is treated as no list rather than no sessions.
|
|
22144
|
+
*/
|
|
22145
|
+
recentSessions: external_exports.array(usageStatisticsSessionSchema).max(100).optional()
|
|
22318
22146
|
});
|
|
22319
22147
|
|
|
22320
|
-
// ../../shared-contracts/dist/thread-
|
|
22321
|
-
var
|
|
22322
|
-
|
|
22323
|
-
"failed",
|
|
22324
|
-
"interrupted",
|
|
22325
|
-
"needsInput",
|
|
22326
|
-
"timedOut",
|
|
22327
|
-
"unreadable",
|
|
22328
|
-
"notFound"
|
|
22329
|
-
];
|
|
22330
|
-
var ENTRY_PATTERN = new RegExp(String.raw`^- \[([^\]\n]+)\]\(thread://([^\s()<>"?#/]+)\): ` + `(${THREAD_WATCH_NOTICE_OUTCOMES.join("|")})(?:. (.+))?$`, "u");
|
|
22331
|
-
|
|
22332
|
-
// ../../shared-contracts/dist/remote-runtime.js
|
|
22333
|
-
var remoteUpdatePhaseSchema = external_exports.enum([
|
|
22334
|
-
"idle",
|
|
22335
|
-
"installing",
|
|
22336
|
-
"restarting",
|
|
22337
|
-
"succeeded",
|
|
22338
|
-
"failed"
|
|
22339
|
-
]);
|
|
22340
|
-
var runtimeStatusSchema = external_exports.object({
|
|
22341
|
-
runningVersion: external_exports.string().nullable(),
|
|
22342
|
-
installedVersion: external_exports.string().nullable(),
|
|
22343
|
-
restartRequired: external_exports.boolean(),
|
|
22344
|
-
remote: external_exports.boolean(),
|
|
22345
|
-
updateSupported: external_exports.boolean(),
|
|
22346
|
-
update: external_exports.object({
|
|
22347
|
-
phase: remoteUpdatePhaseSchema,
|
|
22348
|
-
targetVersion: external_exports.string().nullable(),
|
|
22349
|
-
error: external_exports.string().nullable()
|
|
22350
|
-
})
|
|
22351
|
-
});
|
|
22352
|
-
var remoteUpdateParamsSchema = external_exports.object({
|
|
22353
|
-
version: external_exports.string().regex(/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/u)
|
|
22354
|
-
}).strict();
|
|
22355
|
-
var remoteSshSetupParamsSchema = external_exports.object({
|
|
22356
|
-
hostname: external_exports.string().min(1).max(1024).refine((value) => !value.startsWith("-") && !/\s/u.test(value)),
|
|
22357
|
-
port: external_exports.number().int().min(1).max(65535).nullable(),
|
|
22358
|
-
identity: external_exports.string().max(4096).nullable(),
|
|
22359
|
-
action: external_exports.enum(["inspect", "install", "update", "repair", "uninstall"]),
|
|
22360
|
-
uninstallPackage: external_exports.boolean().optional(),
|
|
22361
|
-
version: external_exports.string().regex(/^\d+\.\d+\.\d+$/u).nullable()
|
|
22362
|
-
}).strict();
|
|
22363
|
-
var remoteSshSetupResultSchema = external_exports.object({ state: external_exports.enum(["installed", "not-installed"]) }).strict();
|
|
22148
|
+
// ../../shared-contracts/dist/thread-prewarm.js
|
|
22149
|
+
var threadPrewarmDiscardParamsSchema = external_exports.object({ threadId: hostThreadIdSchema });
|
|
22150
|
+
var threadPrewarmDiscardResultSchema = external_exports.object({ discarded: external_exports.boolean() });
|
|
22364
22151
|
|
|
22365
|
-
// ../../shared-contracts/dist/
|
|
22366
|
-
var
|
|
22367
|
-
var REMOTE_IDENTITY_MAX_LENGTH = 1024;
|
|
22368
|
-
var identity = external_exports.string().min(1).max(REMOTE_IDENTITY_MAX_LENGTH);
|
|
22369
|
-
var target = {
|
|
22370
|
-
hostId: identity.regex(/^(?:remote-(?:ssh(?:-|:)|control:)|remote-peer:[a-zA-Z0-9_-]{1,64}$)/u)
|
|
22371
|
-
};
|
|
22372
|
-
var thread = { ...target, threadId: identity };
|
|
22373
|
-
var text = external_exports.string().min(1).max(8e3);
|
|
22374
|
-
var input2 = { text, requestId: identity };
|
|
22375
|
-
var remoteDeliveryReplySchema = external_exports.discriminatedUnion("accepted", [
|
|
22376
|
-
external_exports.object({ accepted: external_exports.literal(true), startQueuedItemId: identity.optional() }),
|
|
22152
|
+
// ../../shared-contracts/dist/thread-questions.js
|
|
22153
|
+
var field = external_exports.discriminatedUnion("type", [
|
|
22377
22154
|
external_exports.object({
|
|
22378
|
-
|
|
22379
|
-
|
|
22380
|
-
|
|
22381
|
-
|
|
22382
|
-
|
|
22383
|
-
|
|
22384
|
-
|
|
22385
|
-
|
|
22386
|
-
|
|
22387
|
-
|
|
22388
|
-
|
|
22389
|
-
|
|
22390
|
-
var remoteQueueSnapshotSchema = external_exports.discriminatedUnion("available", [
|
|
22391
|
-
external_exports.object({ available: external_exports.literal(false) }),
|
|
22155
|
+
id: external_exports.string().min(1),
|
|
22156
|
+
type: external_exports.literal("choice"),
|
|
22157
|
+
prompt: external_exports.string(),
|
|
22158
|
+
options: external_exports.array(external_exports.object({
|
|
22159
|
+
value: external_exports.string().min(1),
|
|
22160
|
+
label: external_exports.string(),
|
|
22161
|
+
description: external_exports.string().optional()
|
|
22162
|
+
})).min(1),
|
|
22163
|
+
multiple: external_exports.boolean(),
|
|
22164
|
+
allowOther: external_exports.boolean(),
|
|
22165
|
+
optional: external_exports.boolean()
|
|
22166
|
+
}),
|
|
22392
22167
|
external_exports.object({
|
|
22393
|
-
|
|
22394
|
-
|
|
22168
|
+
id: external_exports.string().min(1),
|
|
22169
|
+
type: external_exports.literal("text"),
|
|
22170
|
+
prompt: external_exports.string(),
|
|
22171
|
+
multiline: external_exports.boolean(),
|
|
22172
|
+
secret: external_exports.literal(false),
|
|
22173
|
+
optional: external_exports.boolean(),
|
|
22174
|
+
placeholder: external_exports.string().optional(),
|
|
22175
|
+
prefill: external_exports.string().optional()
|
|
22395
22176
|
})
|
|
22396
22177
|
]);
|
|
22397
|
-
var
|
|
22398
|
-
|
|
22399
|
-
external_exports.
|
|
22400
|
-
|
|
22401
|
-
|
|
22402
|
-
|
|
22403
|
-
|
|
22404
|
-
|
|
22405
|
-
|
|
22406
|
-
|
|
22407
|
-
|
|
22408
|
-
|
|
22409
|
-
|
|
22410
|
-
|
|
22411
|
-
|
|
22412
|
-
|
|
22413
|
-
|
|
22414
|
-
|
|
22415
|
-
|
|
22416
|
-
|
|
22417
|
-
|
|
22418
|
-
|
|
22419
|
-
|
|
22420
|
-
|
|
22421
|
-
|
|
22422
|
-
|
|
22423
|
-
|
|
22424
|
-
external_exports.
|
|
22425
|
-
|
|
22426
|
-
|
|
22427
|
-
|
|
22428
|
-
|
|
22429
|
-
|
|
22430
|
-
|
|
22431
|
-
|
|
22432
|
-
|
|
22433
|
-
|
|
22434
|
-
|
|
22435
|
-
|
|
22436
|
-
|
|
22437
|
-
|
|
22438
|
-
|
|
22439
|
-
|
|
22440
|
-
|
|
22441
|
-
|
|
22442
|
-
|
|
22443
|
-
|
|
22444
|
-
external_exports.
|
|
22445
|
-
|
|
22446
|
-
|
|
22447
|
-
|
|
22448
|
-
|
|
22449
|
-
|
|
22450
|
-
|
|
22451
|
-
|
|
22452
|
-
|
|
22453
|
-
|
|
22454
|
-
|
|
22455
|
-
|
|
22456
|
-
|
|
22457
|
-
|
|
22458
|
-
|
|
22459
|
-
|
|
22460
|
-
|
|
22461
|
-
|
|
22462
|
-
|
|
22463
|
-
|
|
22464
|
-
|
|
22465
|
-
|
|
22466
|
-
|
|
22467
|
-
|
|
22468
|
-
|
|
22469
|
-
|
|
22470
|
-
|
|
22471
|
-
|
|
22472
|
-
|
|
22473
|
-
|
|
22474
|
-
|
|
22475
|
-
|
|
22476
|
-
|
|
22477
|
-
|
|
22478
|
-
|
|
22479
|
-
|
|
22480
|
-
|
|
22481
|
-
|
|
22482
|
-
|
|
22483
|
-
|
|
22484
|
-
|
|
22485
|
-
|
|
22486
|
-
|
|
22487
|
-
|
|
22488
|
-
|
|
22489
|
-
|
|
22490
|
-
requestId: external_exports.union([identity, external_exports.number().int()]),
|
|
22491
|
-
result: external_exports.record(external_exports.string(), external_exports.unknown())
|
|
22492
|
-
})
|
|
22178
|
+
var threadQuestionSchema = external_exports.object({
|
|
22179
|
+
interactionId: external_exports.string().min(1),
|
|
22180
|
+
turnId: external_exports.string().min(1),
|
|
22181
|
+
title: external_exports.string().optional(),
|
|
22182
|
+
questions: external_exports.array(field).min(1)
|
|
22183
|
+
}).refine(({ questions }) => questions.some((q) => q.type === "choice" && q.multiple), {
|
|
22184
|
+
message: "Shared cards require at least one multi-select question"
|
|
22185
|
+
});
|
|
22186
|
+
var threadQuestionsListParamsSchema = external_exports.strictObject({ threadId: external_exports.string().min(1) });
|
|
22187
|
+
var threadQuestionsResultSchema = external_exports.object({ questions: external_exports.array(threadQuestionSchema) });
|
|
22188
|
+
var threadQuestionRespondParamsSchema = external_exports.strictObject({
|
|
22189
|
+
threadId: external_exports.string().min(1),
|
|
22190
|
+
turnId: external_exports.string().min(1),
|
|
22191
|
+
interactionId: external_exports.string().min(1),
|
|
22192
|
+
answers: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())),
|
|
22193
|
+
cancelled: external_exports.boolean().default(false)
|
|
22194
|
+
});
|
|
22195
|
+
var threadQuestionRespondResultSchema = external_exports.object({ accepted: external_exports.literal(true) });
|
|
22196
|
+
|
|
22197
|
+
// ../../shared-contracts/dist/web.js
|
|
22198
|
+
var webFileDiffSchema = external_exports.object({
|
|
22199
|
+
path: external_exports.string(),
|
|
22200
|
+
oldText: external_exports.string().nullable(),
|
|
22201
|
+
newText: external_exports.string()
|
|
22202
|
+
});
|
|
22203
|
+
var webTurnDiffsRequestSchema = external_exports.object({
|
|
22204
|
+
sessionId: external_exports.string().min(1),
|
|
22205
|
+
turn: external_exports.number().int().nonnegative(),
|
|
22206
|
+
path: external_exports.string().min(1).optional()
|
|
22207
|
+
});
|
|
22208
|
+
var webTurnDiffsResultSchema = external_exports.object({ diffs: external_exports.array(webFileDiffSchema) });
|
|
22209
|
+
var webOpenParamsSchema = external_exports.strictObject({});
|
|
22210
|
+
var webOpenResultSchema = external_exports.strictObject({});
|
|
22211
|
+
|
|
22212
|
+
// ../../shared-contracts/dist/web-tool-output.js
|
|
22213
|
+
var webToolOutputReferenceSchema = external_exports.object({
|
|
22214
|
+
sessionId: external_exports.string().min(1),
|
|
22215
|
+
epoch: external_exports.string().min(1),
|
|
22216
|
+
turn: external_exports.number().int().nonnegative(),
|
|
22217
|
+
seq: external_exports.number().int().nonnegative(),
|
|
22218
|
+
callId: external_exports.string().min(1),
|
|
22219
|
+
part: external_exports.number().int().nonnegative(),
|
|
22220
|
+
version: external_exports.string().min(1)
|
|
22221
|
+
});
|
|
22222
|
+
var webToolOutputPreviewSchema = external_exports.object({
|
|
22223
|
+
reference: webToolOutputReferenceSchema,
|
|
22224
|
+
length: external_exports.number().int().nonnegative(),
|
|
22225
|
+
bytes: external_exports.number().int().nonnegative()
|
|
22226
|
+
});
|
|
22227
|
+
|
|
22228
|
+
// ../../shared-contracts/dist/console.js
|
|
22229
|
+
var consoleAnnouncementSchema = external_exports.strictObject({
|
|
22230
|
+
title: external_exports.string().trim().min(1).max(200),
|
|
22231
|
+
type: external_exports.enum(["info", "warning", "danger"]),
|
|
22232
|
+
body: external_exports.string().trim().min(1).max(16 * 1024)
|
|
22233
|
+
});
|
|
22234
|
+
var consoleOpenParamsSchema = external_exports.strictObject({});
|
|
22235
|
+
var consoleOpenResultSchema = external_exports.strictObject({
|
|
22236
|
+
/** The console address. */
|
|
22237
|
+
url: external_exports.string().max(2048).regex(/^http:\/\/(?:127\.0\.0\.1|localhost):\d{1,5}\/(?:\?.*)?$/u)
|
|
22238
|
+
});
|
|
22239
|
+
var CONSOLE_HOST_METHODS = Object.freeze([
|
|
22240
|
+
"codexhost/console/remote-connections",
|
|
22241
|
+
"codexhost/runtime/status",
|
|
22242
|
+
"codexhost/remote/ssh-setup",
|
|
22243
|
+
"codexhost/harness/plugins/list",
|
|
22244
|
+
"codexhost/harness/display-settings/capabilities",
|
|
22245
|
+
"codexhost/harness/display-settings/get",
|
|
22246
|
+
"codexhost/harness/display-settings/set",
|
|
22247
|
+
"codexhost/harness/inspect",
|
|
22248
|
+
"codexhost/harness/installation",
|
|
22249
|
+
"codexhost/harness/installation/start",
|
|
22250
|
+
"codexhost/harness/installation/status",
|
|
22251
|
+
"codexhost/harness/launch-settings/get",
|
|
22252
|
+
"codexhost/harness/launch-settings/set",
|
|
22253
|
+
"codexhost/harness/web-ui/open",
|
|
22254
|
+
"codexhost/harness/accounts/sources",
|
|
22255
|
+
"codexhost/harness/accounts/list",
|
|
22256
|
+
"codexhost/harness/accounts/inspect",
|
|
22257
|
+
"codexhost/harness/credential-imports",
|
|
22258
|
+
"codexhost/harness/session-import/sources",
|
|
22259
|
+
"codexhost/harness/session-import/list",
|
|
22260
|
+
"codexhost/harness/session-import/import",
|
|
22261
|
+
"codexhost/account/list",
|
|
22262
|
+
"codexhost/account/refresh",
|
|
22263
|
+
"codexhost/account/usage/inspect",
|
|
22264
|
+
"codexhost/usage/model-prices/get",
|
|
22265
|
+
"codexhost/usage/model-prices/set",
|
|
22266
|
+
"codexhost/usage/model-prices/default",
|
|
22267
|
+
"codexhost/usage/statistics/get",
|
|
22268
|
+
"codexhost/update/check",
|
|
22269
|
+
"codexhost/update/start",
|
|
22270
|
+
"codexhost/update/status"
|
|
22493
22271
|
]);
|
|
22494
22272
|
|
|
22495
|
-
// ../../shared-contracts/dist/
|
|
22496
|
-
var
|
|
22497
|
-
|
|
22498
|
-
|
|
22499
|
-
|
|
22500
|
-
|
|
22501
|
-
|
|
22502
|
-
|
|
22503
|
-
|
|
22504
|
-
|
|
22505
|
-
|
|
22506
|
-
|
|
22273
|
+
// ../../shared-contracts/dist/version.js
|
|
22274
|
+
var WORKSPACE_CONTRACT_VERSION = 1;
|
|
22275
|
+
|
|
22276
|
+
// ../../shared-contracts/dist/loaded-sessions.js
|
|
22277
|
+
var loadedSessionStateSchema = external_exports.enum([
|
|
22278
|
+
"idle",
|
|
22279
|
+
"running",
|
|
22280
|
+
"busy",
|
|
22281
|
+
"closing",
|
|
22282
|
+
"failed",
|
|
22283
|
+
"blocked"
|
|
22284
|
+
]);
|
|
22285
|
+
var loadedSessionReasonSchema = external_exports.enum([
|
|
22286
|
+
"none",
|
|
22287
|
+
"disabled",
|
|
22288
|
+
"timeout",
|
|
22289
|
+
"operation",
|
|
22290
|
+
"background",
|
|
22291
|
+
"identity",
|
|
22292
|
+
"persistence",
|
|
22293
|
+
"closeFailed"
|
|
22294
|
+
]);
|
|
22295
|
+
var loadedSessionsSchema = external_exports.array(external_exports.strictObject({
|
|
22296
|
+
threadId: external_exports.string(),
|
|
22297
|
+
title: external_exports.string(),
|
|
22298
|
+
harnessId: external_exports.string(),
|
|
22299
|
+
state: loadedSessionStateSchema,
|
|
22300
|
+
reason: loadedSessionReasonSchema,
|
|
22301
|
+
inactiveMs: external_exports.number().nonnegative()
|
|
22302
|
+
}));
|
|
22303
|
+
|
|
22304
|
+
// ../../shared-contracts/dist/manual-compaction.js
|
|
22305
|
+
var threadManualCompactionStartedSchema = external_exports.strictObject({
|
|
22306
|
+
threadId: hostThreadIdSchema,
|
|
22307
|
+
turnId: hostTurnIdSchema
|
|
22507
22308
|
});
|
|
22508
|
-
|
|
22509
|
-
|
|
22510
|
-
|
|
22511
|
-
|
|
22512
|
-
|
|
22309
|
+
|
|
22310
|
+
// ../../shared-contracts/dist/harness-accounts.js
|
|
22311
|
+
var harnessAccountSnapshotObject = external_exports.object({
|
|
22312
|
+
email: external_exports.string().trim().min(1).max(320).optional(),
|
|
22313
|
+
label: external_exports.string().trim().min(1).max(256).optional(),
|
|
22314
|
+
plan: external_exports.string().trim().min(1).max(128).optional(),
|
|
22315
|
+
credits: accountCreditsSnapshotSchema.optional(),
|
|
22316
|
+
balance: accountBalanceSnapshotSchema.optional()
|
|
22317
|
+
}).strict();
|
|
22318
|
+
function requireReportedQuota(schema) {
|
|
22319
|
+
return schema.refine((value) => {
|
|
22320
|
+
const reported = value;
|
|
22321
|
+
return reported.credits !== void 0 || reported.balance !== void 0;
|
|
22322
|
+
}, { message: "Account must report either credits or a balance" });
|
|
22323
|
+
}
|
|
22324
|
+
var harnessAccountSnapshotSchema = requireReportedQuota(harnessAccountSnapshotObject);
|
|
22325
|
+
var harnessAccountIdentityShape = {
|
|
22326
|
+
harnessId: harnessIdSchema,
|
|
22327
|
+
harnessName: external_exports.string().trim().min(1).max(128)
|
|
22328
|
+
};
|
|
22329
|
+
var harnessAccountSourceSchema = external_exports.object(harnessAccountIdentityShape).strict();
|
|
22330
|
+
var harnessAccountSourceListParamsSchema = external_exports.object({}).strict();
|
|
22331
|
+
var harnessAccountSourceListResultSchema = external_exports.object({ sources: external_exports.array(harnessAccountSourceSchema).max(128) }).strict();
|
|
22332
|
+
var harnessAccountInspectParamsSchema = external_exports.object({ harnessId: harnessIdSchema, refresh: external_exports.boolean().optional() }).strict();
|
|
22333
|
+
var harnessAccountInspectResultSchema = external_exports.object({
|
|
22334
|
+
...harnessAccountIdentityShape,
|
|
22335
|
+
account: harnessAccountSnapshotSchema.nullable(),
|
|
22336
|
+
/** Every Billing Source from one Harness; `account` remains the first for older clients. */
|
|
22337
|
+
accounts: external_exports.array(harnessAccountSnapshotSchema).max(8).optional()
|
|
22338
|
+
}).strict();
|
|
22339
|
+
var harnessAccountListParamsSchema = external_exports.object({ refresh: external_exports.boolean().optional() }).strict();
|
|
22340
|
+
var harnessAccountListResultSchema = external_exports.object({
|
|
22341
|
+
accounts: external_exports.array(requireReportedQuota(harnessAccountSnapshotObject.extend(harnessAccountIdentityShape))).max(128)
|
|
22342
|
+
}).strict();
|
|
22343
|
+
|
|
22344
|
+
// ../../shared-contracts/dist/harness-route.js
|
|
22345
|
+
var harnessPluginRouteSchema = external_exports.object({
|
|
22346
|
+
harnessId: harnessPluginIdSchema,
|
|
22347
|
+
model: harnessModelRefSchema.optional(),
|
|
22348
|
+
thinkingOptionId: harnessThinkingOptionIdSchema.optional(),
|
|
22349
|
+
permissionModeId: harnessPermissionModeIdSchema.optional(),
|
|
22350
|
+
/** A draft prewarm create: stays unsubmitted until the user's first Turn.
|
|
22351
|
+
* Desktop forwards only the Model of a main-process prewarm to thread/start. */
|
|
22352
|
+
prewarm: external_exports.literal(true).optional()
|
|
22353
|
+
}).strict();
|
|
22354
|
+
|
|
22355
|
+
// ../../shared-contracts/dist/harness-launch-settings.js
|
|
22356
|
+
var harnessLaunchPathSchema = external_exports.string().trim().min(1).max(4096).refine((value) => !/[\u0000\r\n]/u.test(value), "Invalid entrypoint path");
|
|
22357
|
+
var harnessLaunchSettingsGetSchema = external_exports.object({
|
|
22358
|
+
harnessId: harnessPluginIdSchema
|
|
22359
|
+
}).strict();
|
|
22360
|
+
var harnessLaunchSettingsSetSchema = harnessLaunchSettingsGetSchema.extend({
|
|
22361
|
+
path: harnessLaunchPathSchema.nullable()
|
|
22513
22362
|
});
|
|
22514
|
-
var
|
|
22515
|
-
|
|
22516
|
-
|
|
22517
|
-
|
|
22518
|
-
|
|
22519
|
-
|
|
22520
|
-
|
|
22521
|
-
|
|
22522
|
-
|
|
22523
|
-
external_exports.
|
|
22524
|
-
|
|
22525
|
-
|
|
22526
|
-
|
|
22527
|
-
|
|
22528
|
-
|
|
22529
|
-
|
|
22530
|
-
|
|
22531
|
-
|
|
22532
|
-
|
|
22533
|
-
|
|
22534
|
-
|
|
22535
|
-
|
|
22536
|
-
|
|
22363
|
+
var harnessLaunchSettingsSchema = external_exports.object({
|
|
22364
|
+
path: harnessLaunchPathSchema.nullable(),
|
|
22365
|
+
restartRequired: external_exports.boolean()
|
|
22366
|
+
}).strict();
|
|
22367
|
+
|
|
22368
|
+
// ../../shared-contracts/dist/harness-installation.js
|
|
22369
|
+
var harnessInstallationParamsSchema = external_exports.object({
|
|
22370
|
+
harnessId: harnessIdSchema,
|
|
22371
|
+
action: external_exports.enum(["check", "update", "install"]),
|
|
22372
|
+
confirmedVersion: external_exports.string().min(1).max(128).optional()
|
|
22373
|
+
}).strict().refine(({ action, confirmedVersion }) => action === "update" || confirmedVersion === void 0);
|
|
22374
|
+
var harnessInstallationStateSchema = external_exports.object({
|
|
22375
|
+
currentVersion: external_exports.string().min(1).max(128),
|
|
22376
|
+
latestVersion: external_exports.string().min(1).max(128),
|
|
22377
|
+
updateAvailable: external_exports.boolean(),
|
|
22378
|
+
canUpdate: external_exports.boolean(),
|
|
22379
|
+
/** Present when the Adapter has a verified list and the available target is outside it. */
|
|
22380
|
+
latestVerifiedVersion: external_exports.string().min(1).max(128).optional(),
|
|
22381
|
+
/** Update preflight stopped before running the installer; latestVersion needs confirmation. */
|
|
22382
|
+
confirmationRequired: external_exports.literal(true).optional(),
|
|
22383
|
+
/** Defaults to CLI; some Harnesses ship only inside a desktop application. */
|
|
22384
|
+
versionKind: external_exports.enum(["cli", "application"]).optional(),
|
|
22385
|
+
/** Official download opened by the user; does not imply an automatic installation. */
|
|
22386
|
+
manualUpdateUrl: external_exports.url().max(2048).refine((value) => /^https:\/\/[^/?#@]+(?:[/?#]|$)/iu.test(value), "Manual updates require a credential-free HTTPS URL").optional(),
|
|
22387
|
+
// Adapter-owned diagnostic text; UI uses messageCode rather than displaying it verbatim.
|
|
22388
|
+
message: external_exports.string().max(2048).optional(),
|
|
22389
|
+
messageCode: external_exports.string().min(1).max(128).optional(),
|
|
22390
|
+
/** Safe plugin-owned explanation, distinct from raw diagnostic message. */
|
|
22391
|
+
notice: harnessLocalizedTextSchema.optional(),
|
|
22392
|
+
latestVersionKind: external_exports.enum(["unknown", "tracking-branch"]).optional()
|
|
22393
|
+
}).strict();
|
|
22394
|
+
var harnessInstallationTaskParamsSchema = external_exports.object({ taskId: external_exports.string().uuid() }).strict();
|
|
22395
|
+
var harnessInstallationTaskSchema = external_exports.discriminatedUnion("status", [
|
|
22396
|
+
external_exports.object({ taskId: external_exports.string().uuid(), status: external_exports.literal("running") }).strict(),
|
|
22397
|
+
external_exports.object({
|
|
22398
|
+
taskId: external_exports.string().uuid(),
|
|
22399
|
+
status: external_exports.literal("succeeded"),
|
|
22400
|
+
result: harnessInstallationStateSchema
|
|
22401
|
+
}).strict(),
|
|
22402
|
+
external_exports.object({
|
|
22403
|
+
taskId: external_exports.string().uuid(),
|
|
22404
|
+
status: external_exports.literal("failed"),
|
|
22405
|
+
error: external_exports.object({ code: external_exports.number().int(), message: external_exports.string().min(1).max(2048) }).strict()
|
|
22406
|
+
}).strict()
|
|
22537
22407
|
]);
|
|
22538
|
-
|
|
22539
|
-
|
|
22540
|
-
|
|
22408
|
+
|
|
22409
|
+
// ../../shared-contracts/dist/codex-accounts.js
|
|
22410
|
+
var accountIdSchema = external_exports.string().min(1).max(256).regex(/^[A-Za-z0-9._~-]+$/u);
|
|
22411
|
+
var nonBlankTextSchema4 = external_exports.string().trim().min(1);
|
|
22412
|
+
var codexAccountPlanTypeSchema = external_exports.enum([
|
|
22413
|
+
"free",
|
|
22414
|
+
"go",
|
|
22415
|
+
"plus",
|
|
22416
|
+
"pro",
|
|
22417
|
+
"prolite",
|
|
22418
|
+
"team",
|
|
22419
|
+
"self_serve_business_prolite",
|
|
22420
|
+
"self_serve_business_usage_based",
|
|
22421
|
+
"business",
|
|
22422
|
+
"ent26",
|
|
22423
|
+
"enterprise_cbp_automation",
|
|
22424
|
+
"enterprise_cbp_usage_based",
|
|
22425
|
+
"enterprise",
|
|
22426
|
+
"edu",
|
|
22427
|
+
"edu_plus",
|
|
22428
|
+
"edu_pro",
|
|
22429
|
+
"unknown"
|
|
22541
22430
|
]);
|
|
22431
|
+
var codexAccountSchema = external_exports.object({
|
|
22432
|
+
accountId: accountIdSchema,
|
|
22433
|
+
label: nonBlankTextSchema4.max(256),
|
|
22434
|
+
email: external_exports.string().email().max(320).optional(),
|
|
22435
|
+
planType: codexAccountPlanTypeSchema.optional()
|
|
22436
|
+
}).strict();
|
|
22437
|
+
var codexAccountPhaseSchema = external_exports.enum(["ready", "unavailable"]);
|
|
22438
|
+
var codexAccountListResultSchema = external_exports.object({
|
|
22439
|
+
version: external_exports.literal(2),
|
|
22440
|
+
currentAccountId: accountIdSchema.nullable(),
|
|
22441
|
+
phase: codexAccountPhaseSchema,
|
|
22442
|
+
revision: external_exports.number().int().nonnegative(),
|
|
22443
|
+
instanceId: nonBlankTextSchema4.max(1024).optional(),
|
|
22444
|
+
accounts: external_exports.array(codexAccountSchema).max(1)
|
|
22445
|
+
}).strict();
|
|
22446
|
+
var codexAccountUsageParamsSchema = external_exports.object({ accountId: accountIdSchema, refresh: external_exports.boolean().optional() }).strict();
|
|
22447
|
+
var codexAccountUsageResultSchema = external_exports.object({
|
|
22448
|
+
accountId: accountIdSchema,
|
|
22449
|
+
usage: threadUsageSnapshotSchema.nullable(),
|
|
22450
|
+
accountCredits: accountCreditsSnapshotSchema.optional(),
|
|
22451
|
+
freshness: external_exports.enum(["live", "cached"]),
|
|
22452
|
+
observedAt: external_exports.string().datetime().nullable()
|
|
22453
|
+
}).strict();
|
|
22454
|
+
|
|
22455
|
+
// ../../shared-contracts/dist/harness-session-import.js
|
|
22456
|
+
var HARNESS_SESSION_IMPORT_ID_MAX_LENGTH = 1024;
|
|
22457
|
+
var HARNESS_SESSION_IMPORT_CWD_MAX_LENGTH = 16384;
|
|
22458
|
+
var HARNESS_SESSION_IMPORT_TITLE_MAX_LENGTH = 4096;
|
|
22459
|
+
var HARNESS_SESSION_IMPORT_LIST_MAX_LENGTH = 1e3;
|
|
22460
|
+
var HARNESS_SESSION_IMPORT_UPDATED_AT_MAX = 864e13;
|
|
22461
|
+
var nonBlankTextSchema5 = external_exports.string().refine((value) => value.trim().length > 0, "Value must not be empty or whitespace").refine((value) => !value.includes("\0"), "Value must not contain NUL");
|
|
22462
|
+
var harnessSessionImportIdSchema = nonBlankTextSchema5.max(HARNESS_SESSION_IMPORT_ID_MAX_LENGTH);
|
|
22463
|
+
var harnessSessionImportCandidateSchema = external_exports.object({
|
|
22464
|
+
nativeSessionId: harnessSessionImportIdSchema,
|
|
22465
|
+
title: nonBlankTextSchema5.max(HARNESS_SESSION_IMPORT_TITLE_MAX_LENGTH).nullable(),
|
|
22466
|
+
updatedAt: external_exports.number().int().nonnegative().max(HARNESS_SESSION_IMPORT_UPDATED_AT_MAX),
|
|
22467
|
+
cwd: nonBlankTextSchema5.max(HARNESS_SESSION_IMPORT_CWD_MAX_LENGTH),
|
|
22468
|
+
// Native file discovery cannot reliably observe another process's activity.
|
|
22469
|
+
running: external_exports.boolean().nullable()
|
|
22470
|
+
}).strict();
|
|
22471
|
+
var harnessSessionImportSourcesParamsSchema = external_exports.object({}).strict();
|
|
22472
|
+
var harnessSessionImportSourcesResultSchema = external_exports.object({
|
|
22473
|
+
harnesses: external_exports.array(external_exports.object({
|
|
22474
|
+
harnessId: harnessPluginIdSchema,
|
|
22475
|
+
name: nonBlankTextSchema5.max(128)
|
|
22476
|
+
}).strict()).max(128)
|
|
22477
|
+
}).strict();
|
|
22478
|
+
var harnessSessionListParamsSchema = external_exports.object({
|
|
22479
|
+
harnessId: harnessPluginIdSchema,
|
|
22480
|
+
query: external_exports.string().trim().max(4096).refine((value) => !value.includes("\0")).optional(),
|
|
22481
|
+
offset: external_exports.number().int().nonnegative().safe().optional(),
|
|
22482
|
+
limit: external_exports.number().int().min(1).max(HARNESS_SESSION_IMPORT_LIST_MAX_LENGTH).optional()
|
|
22483
|
+
}).strict();
|
|
22484
|
+
var harnessSessionListResultSchema = external_exports.object({
|
|
22485
|
+
candidates: external_exports.array(harnessSessionImportCandidateSchema).max(HARNESS_SESSION_IMPORT_LIST_MAX_LENGTH),
|
|
22486
|
+
total: external_exports.number().int().nonnegative().safe()
|
|
22487
|
+
}).strict();
|
|
22488
|
+
var harnessSessionImportParamsSchema = external_exports.object({
|
|
22489
|
+
harnessId: harnessPluginIdSchema,
|
|
22490
|
+
nativeSessionId: harnessSessionImportIdSchema
|
|
22491
|
+
}).strict();
|
|
22492
|
+
var harnessSessionImportResultSchema = external_exports.object({
|
|
22493
|
+
threadId: nonBlankTextSchema5.max(1024).pipe(hostThreadIdSchema)
|
|
22494
|
+
}).strict();
|
|
22542
22495
|
|
|
22543
|
-
// ../../shared-contracts/dist/
|
|
22544
|
-
var
|
|
22545
|
-
|
|
22546
|
-
|
|
22496
|
+
// ../../shared-contracts/dist/deepseek-modern-sessions.js
|
|
22497
|
+
var DEEPSEEK_MODERN_SESSION_LIST_MAX_LENGTH = HARNESS_SESSION_IMPORT_LIST_MAX_LENGTH;
|
|
22498
|
+
var DEEPSEEK_MODERN_HOST_THREAD_ID_MAX_LENGTH = 1024;
|
|
22499
|
+
var nonBlankTextSchema6 = external_exports.string().refine((value) => value.trim().length > 0, "Value must not be empty or whitespace").refine((value) => !value.includes("\0"), "Value must not contain NUL");
|
|
22500
|
+
var deepSeekModernSessionIdSchema = harnessSessionImportIdSchema;
|
|
22501
|
+
var deepSeekModernSessionCandidateSchema = harnessSessionImportCandidateSchema;
|
|
22502
|
+
var deepSeekModernSessionListParamsSchema = external_exports.object({}).strict();
|
|
22503
|
+
var deepSeekModernSessionListResultSchema = external_exports.object({
|
|
22504
|
+
candidates: external_exports.array(deepSeekModernSessionCandidateSchema).max(DEEPSEEK_MODERN_SESSION_LIST_MAX_LENGTH)
|
|
22505
|
+
}).strict();
|
|
22506
|
+
var deepSeekModernSessionImportParamsSchema = external_exports.object({
|
|
22507
|
+
nativeSessionId: deepSeekModernSessionIdSchema
|
|
22508
|
+
}).strict();
|
|
22509
|
+
var deepSeekModernSessionImportResultSchema = external_exports.object({
|
|
22510
|
+
threadId: nonBlankTextSchema6.max(DEEPSEEK_MODERN_HOST_THREAD_ID_MAX_LENGTH).pipe(hostThreadIdSchema)
|
|
22511
|
+
}).strict();
|
|
22512
|
+
|
|
22513
|
+
// ../../shared-contracts/dist/external-thread-fork.js
|
|
22514
|
+
var externalThreadForkParamsSchema = external_exports.object({
|
|
22515
|
+
threadId: hostThreadIdSchema,
|
|
22516
|
+
lastTurnId: hostTurnIdSchema
|
|
22517
|
+
}).strict();
|
|
22518
|
+
var externalThreadForkResultSchema = external_exports.object({
|
|
22519
|
+
threadId: hostThreadIdSchema
|
|
22520
|
+
}).strict();
|
|
22521
|
+
|
|
22522
|
+
// ../../shared-contracts/dist/harness-commands.js
|
|
22523
|
+
var commandIdSchema = external_exports.string().trim().min(1).max(128).regex(/^[A-Za-z0-9._:-]+$/u).brand();
|
|
22524
|
+
var commandInvocationSchema = external_exports.string().min(1).max(128);
|
|
22525
|
+
var commandLabelSchema = external_exports.string().trim().min(1).max(128);
|
|
22526
|
+
var commandDescriptionSchema = external_exports.string().trim().min(1).max(512);
|
|
22527
|
+
var harnessCommandDescriptorSchema = external_exports.object({
|
|
22528
|
+
id: commandIdSchema,
|
|
22529
|
+
invocation: commandInvocationSchema,
|
|
22530
|
+
label: commandLabelSchema,
|
|
22531
|
+
description: commandDescriptionSchema.optional(),
|
|
22532
|
+
localizations: harnessLocalizationsSchema.optional(),
|
|
22533
|
+
argumentMode: external_exports.enum(["none", "text"]),
|
|
22534
|
+
/**
|
|
22535
|
+
* Native distinction reported by the Harness. Omitted when the Harness does
|
|
22536
|
+
* not tell skills and commands apart; consumers treat that as "command".
|
|
22537
|
+
*/
|
|
22538
|
+
kind: external_exports.enum(["command", "skill"]).optional()
|
|
22539
|
+
}).strict();
|
|
22540
|
+
var harnessCommandCatalogSchema = external_exports.object({
|
|
22541
|
+
commands: external_exports.array(harnessCommandDescriptorSchema),
|
|
22542
|
+
/** Partial discovery failures; valid commands remain available. */
|
|
22543
|
+
warnings: external_exports.array(external_exports.string().min(1)).optional(),
|
|
22544
|
+
/**
|
|
22545
|
+
* `live` when a native Session has reported its live catalog for the
|
|
22546
|
+
* workspace (even when filtering leaves only built-ins); `static` for
|
|
22547
|
+
* Adapter built-ins only before live commands arrive. Adapters may set
|
|
22548
|
+
* `live` once their Session's live catalog has loaded.
|
|
22549
|
+
*/
|
|
22550
|
+
source: external_exports.enum(["live", "static"]).optional()
|
|
22551
|
+
}).strict().superRefine((catalog, context) => {
|
|
22552
|
+
const ids = /* @__PURE__ */ new Set();
|
|
22553
|
+
for (const [index, command] of catalog.commands.entries()) {
|
|
22554
|
+
if (ids.has(command.id)) {
|
|
22555
|
+
context.addIssue({
|
|
22556
|
+
code: "custom",
|
|
22557
|
+
message: "Harness command IDs must be unique",
|
|
22558
|
+
path: ["commands", index, "id"]
|
|
22559
|
+
});
|
|
22560
|
+
}
|
|
22561
|
+
ids.add(command.id);
|
|
22562
|
+
}
|
|
22547
22563
|
});
|
|
22548
|
-
var
|
|
22564
|
+
var harnessCommandsInspectParamsSchema = external_exports.object({
|
|
22565
|
+
harnessId: harnessIdSchema,
|
|
22566
|
+
/** Workspace of a draft without a Thread, for its live catalog when known. */
|
|
22567
|
+
cwd: external_exports.string().min(1).optional()
|
|
22568
|
+
}).strict();
|
|
22569
|
+
var threadCommandsInspectParamsSchema = external_exports.object({
|
|
22570
|
+
threadId: hostThreadIdSchema
|
|
22571
|
+
}).strict();
|
|
22572
|
+
var threadCommandExecuteParamsSchema = external_exports.object({
|
|
22573
|
+
threadId: hostThreadIdSchema,
|
|
22574
|
+
commandId: commandIdSchema,
|
|
22575
|
+
turnId: hostTurnIdSchema.optional(),
|
|
22576
|
+
arguments: jsonObjectSchema.optional()
|
|
22577
|
+
}).strict();
|
|
22578
|
+
var threadCommandExecuteResultSchema = external_exports.object({
|
|
22579
|
+
accepted: external_exports.literal(true),
|
|
22580
|
+
turnId: hostTurnIdSchema.optional()
|
|
22581
|
+
}).strict();
|
|
22549
22582
|
|
|
22550
|
-
// ../../shared-contracts/dist/
|
|
22551
|
-
var
|
|
22552
|
-
var
|
|
22553
|
-
|
|
22554
|
-
|
|
22583
|
+
// ../../shared-contracts/dist/json-rpc.js
|
|
22584
|
+
var jsonRpcVersionSchema = external_exports.literal("2.0").optional();
|
|
22585
|
+
var absentSchema = external_exports.never().optional();
|
|
22586
|
+
var methodSchema = external_exports.string().min(1);
|
|
22587
|
+
var jsonRpcIdSchema = external_exports.union([external_exports.string(), external_exports.number().int()]);
|
|
22588
|
+
var jsonRpcErrorSchema = external_exports.object({
|
|
22589
|
+
code: external_exports.number().int(),
|
|
22590
|
+
message: external_exports.string(),
|
|
22591
|
+
data: jsonValueSchema.optional()
|
|
22592
|
+
}).catchall(jsonValueSchema).superRefine(rejectExplicitUndefined(["data"]));
|
|
22593
|
+
var jsonRpcRequestSchema = external_exports.object({
|
|
22594
|
+
jsonrpc: jsonRpcVersionSchema,
|
|
22595
|
+
id: jsonRpcIdSchema,
|
|
22596
|
+
method: methodSchema,
|
|
22597
|
+
params: jsonValueSchema.optional(),
|
|
22598
|
+
result: absentSchema,
|
|
22599
|
+
error: absentSchema
|
|
22600
|
+
}).catchall(jsonValueSchema).superRefine(rejectExplicitUndefined(["jsonrpc", "params", "result", "error"]));
|
|
22601
|
+
var jsonRpcNotificationSchema = external_exports.object({
|
|
22602
|
+
jsonrpc: jsonRpcVersionSchema,
|
|
22603
|
+
id: absentSchema,
|
|
22604
|
+
method: methodSchema,
|
|
22605
|
+
params: jsonValueSchema.optional(),
|
|
22606
|
+
result: absentSchema,
|
|
22607
|
+
error: absentSchema
|
|
22608
|
+
}).catchall(jsonValueSchema).superRefine(rejectExplicitUndefined(["jsonrpc", "id", "params", "result", "error"]));
|
|
22609
|
+
var jsonRpcSuccessResponseSchema = external_exports.object({
|
|
22610
|
+
jsonrpc: jsonRpcVersionSchema,
|
|
22611
|
+
id: jsonRpcIdSchema,
|
|
22612
|
+
method: absentSchema,
|
|
22613
|
+
params: absentSchema,
|
|
22614
|
+
result: jsonValueSchema,
|
|
22615
|
+
error: absentSchema
|
|
22616
|
+
}).catchall(jsonValueSchema).superRefine(rejectExplicitUndefined(["jsonrpc", "method", "params", "error"]));
|
|
22617
|
+
var jsonRpcErrorResponseSchema = external_exports.object({
|
|
22618
|
+
jsonrpc: jsonRpcVersionSchema,
|
|
22619
|
+
id: jsonRpcIdSchema,
|
|
22620
|
+
method: absentSchema,
|
|
22621
|
+
params: absentSchema,
|
|
22622
|
+
result: absentSchema,
|
|
22623
|
+
error: jsonRpcErrorSchema
|
|
22624
|
+
}).catchall(jsonValueSchema).superRefine(rejectExplicitUndefined(["jsonrpc", "method", "params", "result"]));
|
|
22625
|
+
var jsonRpcEnvelopeSchema = external_exports.union([
|
|
22626
|
+
jsonRpcRequestSchema,
|
|
22627
|
+
jsonRpcNotificationSchema,
|
|
22628
|
+
jsonRpcSuccessResponseSchema,
|
|
22629
|
+
jsonRpcErrorResponseSchema
|
|
22555
22630
|
]);
|
|
22556
|
-
|
|
22557
|
-
|
|
22558
|
-
|
|
22559
|
-
|
|
22560
|
-
error: external_exports.string().optional()
|
|
22561
|
-
});
|
|
22562
|
-
var webUiExtensionSchema = external_exports.object({
|
|
22563
|
-
id: webUiExtensionIdSchema,
|
|
22564
|
-
name: external_exports.string().min(1).max(214),
|
|
22565
|
-
version: external_exports.string().min(1).max(128),
|
|
22566
|
-
format: external_exports.literal("dsh"),
|
|
22567
|
-
supportedTargets: external_exports.tuple([external_exports.literal("web")]),
|
|
22568
|
-
enabledTargets: external_exports.array(external_exports.literal("web")).max(1),
|
|
22569
|
-
source: external_exports.string().min(1).max(4096),
|
|
22570
|
-
/** Public project page, derived from installed package metadata and its source. */
|
|
22571
|
-
projectUrl: external_exports.string().max(4096).url({ protocol: /^https?$/u }).optional(),
|
|
22572
|
-
installedAt: external_exports.string(),
|
|
22573
|
-
meta: webUiExtensionMetaSchema.optional(),
|
|
22574
|
-
loadError: external_exports.string().optional()
|
|
22631
|
+
|
|
22632
|
+
// ../../shared-contracts/dist/native-refs.js
|
|
22633
|
+
var nativeIdSchema = external_exports.string().refine((value) => value.trim().length > 0, {
|
|
22634
|
+
message: "Native identifier must not be empty or whitespace"
|
|
22575
22635
|
});
|
|
22576
|
-
var
|
|
22577
|
-
|
|
22578
|
-
|
|
22579
|
-
|
|
22580
|
-
|
|
22636
|
+
var nativeSessionRefV1RuntimeSchema = external_exports.strictObject({
|
|
22637
|
+
harnessId: harnessIdSchema,
|
|
22638
|
+
nativeSessionId: nativeIdSchema,
|
|
22639
|
+
locator: jsonValueSchema.optional(),
|
|
22640
|
+
formatVersion: external_exports.literal(1)
|
|
22641
|
+
}).superRefine(rejectExplicitUndefined(["locator"]));
|
|
22642
|
+
var nativeTurnRefV1Schema = external_exports.strictObject({
|
|
22643
|
+
harnessId: harnessIdSchema,
|
|
22644
|
+
nativeSessionId: nativeIdSchema,
|
|
22645
|
+
nativeTurnKey: nativeIdSchema,
|
|
22646
|
+
formatVersion: external_exports.literal(1)
|
|
22581
22647
|
});
|
|
22582
|
-
var
|
|
22583
|
-
|
|
22584
|
-
|
|
22585
|
-
|
|
22586
|
-
|
|
22587
|
-
|
|
22588
|
-
|
|
22648
|
+
var nativeCheckpointRefV1RuntimeSchema = external_exports.strictObject({
|
|
22649
|
+
harnessId: harnessIdSchema,
|
|
22650
|
+
nativeSessionId: nativeIdSchema,
|
|
22651
|
+
checkpointId: nativeIdSchema,
|
|
22652
|
+
locator: jsonValueSchema.optional(),
|
|
22653
|
+
formatVersion: external_exports.literal(1)
|
|
22654
|
+
}).superRefine(rejectExplicitUndefined(["locator"]));
|
|
22589
22655
|
|
|
22590
|
-
// ../../shared-contracts/dist/
|
|
22591
|
-
var
|
|
22592
|
-
var
|
|
22593
|
-
var
|
|
22594
|
-
var
|
|
22595
|
-
|
|
22596
|
-
"
|
|
22597
|
-
"
|
|
22598
|
-
"
|
|
22599
|
-
"green",
|
|
22600
|
-
"amber",
|
|
22601
|
-
"rose",
|
|
22602
|
-
"slate"
|
|
22603
|
-
];
|
|
22604
|
-
var remotePeerColorSchema = external_exports.enum(REMOTE_PEER_COLORS);
|
|
22605
|
-
var REMOTE_PEER_COLOR_SET = new Set(REMOTE_PEER_COLORS);
|
|
22606
|
-
var remotePeerStateSchema = external_exports.enum([
|
|
22607
|
-
"connected",
|
|
22608
|
-
"connecting",
|
|
22609
|
-
"auth-error",
|
|
22610
|
-
"offline",
|
|
22611
|
-
"disabled"
|
|
22656
|
+
// ../../shared-contracts/dist/updates.js
|
|
22657
|
+
var UPDATE_ERROR_MAX_LENGTH = 500;
|
|
22658
|
+
var UPDATE_SEMVER_PATTERN = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/u;
|
|
22659
|
+
var updateSemanticVersionSchema = external_exports.string().regex(UPDATE_SEMVER_PATTERN);
|
|
22660
|
+
var updateInstallationSchema = external_exports.enum([
|
|
22661
|
+
"npm",
|
|
22662
|
+
"windows-installer",
|
|
22663
|
+
"macos-dmg",
|
|
22664
|
+
"linux-archive"
|
|
22612
22665
|
]);
|
|
22613
|
-
var
|
|
22614
|
-
|
|
22615
|
-
|
|
22616
|
-
|
|
22617
|
-
|
|
22618
|
-
|
|
22619
|
-
|
|
22620
|
-
|
|
22621
|
-
|
|
22622
|
-
|
|
22623
|
-
|
|
22624
|
-
|
|
22625
|
-
|
|
22626
|
-
|
|
22627
|
-
|
|
22628
|
-
lastError: external_exports.string().max(1e3).optional(),
|
|
22629
|
-
projectCount: external_exports.number().int().nonnegative(),
|
|
22630
|
-
createdAt: external_exports.string(),
|
|
22631
|
-
updatedAt: external_exports.string()
|
|
22666
|
+
var updatePhaseSchema = external_exports.enum([
|
|
22667
|
+
"prepared",
|
|
22668
|
+
"downloading",
|
|
22669
|
+
"waiting-for-exit",
|
|
22670
|
+
"installing",
|
|
22671
|
+
"restarting",
|
|
22672
|
+
"succeeded",
|
|
22673
|
+
"failed"
|
|
22674
|
+
]);
|
|
22675
|
+
var npmDownloadProgressSchema = external_exports.strictObject({
|
|
22676
|
+
completed: external_exports.number().int().nonnegative(),
|
|
22677
|
+
total: external_exports.number().int().positive()
|
|
22678
|
+
}).refine((progress) => progress.completed <= progress.total, {
|
|
22679
|
+
path: ["completed"],
|
|
22680
|
+
message: "completed must not exceed total"
|
|
22632
22681
|
});
|
|
22633
|
-
var
|
|
22634
|
-
|
|
22682
|
+
var updateStatusSchema = external_exports.strictObject({
|
|
22683
|
+
version: updateSemanticVersionSchema,
|
|
22684
|
+
installation: updateInstallationSchema,
|
|
22685
|
+
phase: updatePhaseSchema,
|
|
22686
|
+
updatedAt: external_exports.number().int().nonnegative(),
|
|
22687
|
+
downloadedBytes: external_exports.number().int().nonnegative().optional(),
|
|
22688
|
+
totalBytes: external_exports.number().int().positive().optional(),
|
|
22689
|
+
npmDownload: npmDownloadProgressSchema.optional(),
|
|
22690
|
+
error: external_exports.string().min(1).max(UPDATE_ERROR_MAX_LENGTH).nullable(),
|
|
22691
|
+
serviceStopOutput: external_exports.string().optional()
|
|
22692
|
+
}).superRefine((status, context) => {
|
|
22693
|
+
if (status.downloadedBytes !== void 0 && status.totalBytes !== void 0 && status.downloadedBytes > status.totalBytes) {
|
|
22694
|
+
context.addIssue({
|
|
22695
|
+
code: "custom",
|
|
22696
|
+
path: ["downloadedBytes"],
|
|
22697
|
+
message: "downloadedBytes must not exceed totalBytes"
|
|
22698
|
+
});
|
|
22699
|
+
}
|
|
22635
22700
|
});
|
|
22636
|
-
var
|
|
22637
|
-
|
|
22638
|
-
|
|
22639
|
-
|
|
22640
|
-
|
|
22641
|
-
|
|
22642
|
-
|
|
22643
|
-
|
|
22644
|
-
|
|
22645
|
-
|
|
22646
|
-
|
|
22647
|
-
|
|
22648
|
-
origin: external_exports.string().min(1).max(2048).optional(),
|
|
22649
|
-
token: external_exports.string().min(1).max(2048).optional(),
|
|
22650
|
-
enabled: external_exports.boolean().optional()
|
|
22701
|
+
var updateEmptyParamsSchema = external_exports.strictObject({});
|
|
22702
|
+
var githubReleaseNotesUrlSchema = external_exports.string().max(300).regex(/^https:\/\/github\.com\/BytePioneer-AI\/codex-host\/releases\/tag\/v[0-9A-Za-z.+-]+$/u, "release notes URL must identify a codexhost GitHub Release");
|
|
22703
|
+
var updateCheckResultSchema = external_exports.strictObject({
|
|
22704
|
+
currentVersion: updateSemanticVersionSchema,
|
|
22705
|
+
installation: updateInstallationSchema.nullable(),
|
|
22706
|
+
latestVersion: updateSemanticVersionSchema.nullable(),
|
|
22707
|
+
updateAvailable: external_exports.boolean(),
|
|
22708
|
+
installationAvailable: external_exports.boolean(),
|
|
22709
|
+
releaseNotes: external_exports.string().min(1).max(2e4).nullable(),
|
|
22710
|
+
releaseNotesUrl: githubReleaseNotesUrlSchema.nullable(),
|
|
22711
|
+
status: updateStatusSchema.nullable(),
|
|
22712
|
+
error: external_exports.string().min(1).max(UPDATE_ERROR_MAX_LENGTH).nullable()
|
|
22651
22713
|
});
|
|
22652
|
-
var
|
|
22653
|
-
|
|
22714
|
+
var updateStartResultSchema = external_exports.strictObject({
|
|
22715
|
+
status: updateStatusSchema
|
|
22654
22716
|
});
|
|
22655
|
-
var
|
|
22656
|
-
|
|
22717
|
+
var updateStatusResultSchema = external_exports.strictObject({
|
|
22718
|
+
status: updateStatusSchema.nullable()
|
|
22657
22719
|
});
|
|
22658
|
-
|
|
22659
|
-
|
|
22660
|
-
|
|
22661
|
-
|
|
22662
|
-
|
|
22663
|
-
|
|
22664
|
-
|
|
22665
|
-
|
|
22666
|
-
name: external_exports.string().min(1).max(512),
|
|
22667
|
-
path: external_exports.string().min(1).max(8192)
|
|
22720
|
+
|
|
22721
|
+
// ../../shared-contracts/dist/release-announcement.js
|
|
22722
|
+
var RELEASE_ANNOUNCEMENT_MAX_THEMES = 12;
|
|
22723
|
+
var releaseAnnouncementThemeSchema = external_exports.strictObject({
|
|
22724
|
+
icon: external_exports.string().min(1).max(16).optional(),
|
|
22725
|
+
title: external_exports.string().min(1).max(120),
|
|
22726
|
+
body: external_exports.string().min(1).max(1200),
|
|
22727
|
+
contributors: external_exports.array(external_exports.string().min(1).max(39)).max(30)
|
|
22668
22728
|
});
|
|
22669
|
-
var
|
|
22670
|
-
|
|
22671
|
-
|
|
22672
|
-
origin: external_exports.string().max(2048).optional(),
|
|
22673
|
-
transportKind: remotePeerTransportKindSchema.optional(),
|
|
22674
|
-
encrypted: external_exports.boolean().optional(),
|
|
22675
|
-
version: external_exports.string().max(128).optional(),
|
|
22676
|
-
platform: external_exports.string().max(64).optional(),
|
|
22677
|
-
hostname: external_exports.string().max(255).optional(),
|
|
22678
|
-
homeDir: external_exports.string().max(4096).optional(),
|
|
22679
|
-
projectCount: external_exports.number().int().nonnegative().optional(),
|
|
22680
|
-
projects: external_exports.array(remotePeerTestProjectSchema).optional(),
|
|
22681
|
-
error: external_exports.string().max(1e3).optional()
|
|
22729
|
+
var releaseAnnouncementContentSchema = external_exports.strictObject({
|
|
22730
|
+
summary: external_exports.string().min(1).max(600).optional(),
|
|
22731
|
+
themes: external_exports.array(releaseAnnouncementThemeSchema).min(1).max(RELEASE_ANNOUNCEMENT_MAX_THEMES)
|
|
22682
22732
|
});
|
|
22683
|
-
var
|
|
22684
|
-
|
|
22685
|
-
|
|
22686
|
-
|
|
22687
|
-
|
|
22733
|
+
var releaseAnnouncementSchema = external_exports.strictObject({
|
|
22734
|
+
version: updateSemanticVersionSchema,
|
|
22735
|
+
publishedAt: external_exports.iso.datetime(),
|
|
22736
|
+
url: external_exports.string().max(300).regex(/^https:\/\/github\.com\/BytePioneer-AI\/codex-host\/releases\/tag\/v[0-9A-Za-z.+-]+$/u),
|
|
22737
|
+
zh: releaseAnnouncementContentSchema.nullable(),
|
|
22738
|
+
en: releaseAnnouncementContentSchema.nullable()
|
|
22739
|
+
}).refine((value) => value.zh !== null || value.en !== null, {
|
|
22740
|
+
message: "an announcement needs at least one language"
|
|
22688
22741
|
});
|
|
22689
|
-
var
|
|
22690
|
-
|
|
22691
|
-
attachments: external_exports.literal(1).optional(),
|
|
22692
|
-
/** /api/peer/v1/workspace-files/rpc and /api/peer/v1/workspace-files/download are available. */
|
|
22693
|
-
workspaceFiles: external_exports.literal(1).optional(),
|
|
22694
|
-
/** Peer supports officeToPdf/render over /api/peer/v1/workspace-files/rpc. */
|
|
22695
|
-
officePreview: external_exports.literal(1).optional()
|
|
22742
|
+
var releaseAnnouncementGetParamsSchema = external_exports.strictObject({
|
|
22743
|
+
manual: external_exports.boolean().optional()
|
|
22696
22744
|
});
|
|
22697
|
-
var
|
|
22698
|
-
|
|
22699
|
-
|
|
22700
|
-
hostname: external_exports.string().max(255),
|
|
22701
|
-
homeDir: external_exports.string().max(4096).optional(),
|
|
22702
|
-
epoch: external_exports.string().min(1).max(256),
|
|
22703
|
-
projects: external_exports.array(remotePeerManifestProjectSchema),
|
|
22704
|
-
capabilities: remotePeerCapabilitiesSchema.optional()
|
|
22745
|
+
var releaseAnnouncementGetResultSchema = external_exports.strictObject({
|
|
22746
|
+
announcement: releaseAnnouncementSchema.nullable(),
|
|
22747
|
+
unread: external_exports.boolean()
|
|
22705
22748
|
});
|
|
22706
|
-
var
|
|
22707
|
-
|
|
22708
|
-
threadId: external_exports.string().min(1).max(1024),
|
|
22709
|
-
scope: external_exports.string().regex(REMOTE_PEER_UPLOAD_SCOPE_PATTERN).optional(),
|
|
22710
|
-
requestId: external_exports.string().min(1).max(256).optional(),
|
|
22711
|
-
mode: external_exports.enum(["queue", "steer"]).optional(),
|
|
22712
|
-
expectedTurnId: external_exports.string().min(1).max(1024).nullable().optional(),
|
|
22713
|
-
content: external_exports.array(external_exports.discriminatedUnion("type", [
|
|
22714
|
-
external_exports.strictObject({ type: external_exports.literal("text"), text: external_exports.string() }),
|
|
22715
|
-
external_exports.strictObject({ type: external_exports.literal("file"), receiptId: external_exports.string().min(1).max(128) })
|
|
22716
|
-
])).min(1).max(64)
|
|
22749
|
+
var releaseAnnouncementAcknowledgeParamsSchema = external_exports.strictObject({
|
|
22750
|
+
version: updateSemanticVersionSchema
|
|
22717
22751
|
});
|
|
22718
|
-
|
|
22719
|
-
|
|
22720
|
-
|
|
22721
|
-
|
|
22722
|
-
|
|
22723
|
-
|
|
22752
|
+
|
|
22753
|
+
// ../../shared-contracts/dist/thread-watch-notice.js
|
|
22754
|
+
var THREAD_WATCH_NOTICE_OUTCOMES = [
|
|
22755
|
+
"completed",
|
|
22756
|
+
"failed",
|
|
22757
|
+
"interrupted",
|
|
22758
|
+
"needsInput",
|
|
22759
|
+
"timedOut",
|
|
22760
|
+
"unreadable",
|
|
22761
|
+
"notFound"
|
|
22762
|
+
];
|
|
22763
|
+
var ENTRY_PATTERN = new RegExp(String.raw`^- \[([^\]\n]+)\]\(thread://([^\s()<>"?#/]+)\): ` + `(${THREAD_WATCH_NOTICE_OUTCOMES.join("|")})(?:. (.+))?$`, "u");
|
|
22764
|
+
|
|
22765
|
+
// ../../shared-contracts/dist/remote-runtime.js
|
|
22766
|
+
var remoteUpdatePhaseSchema = external_exports.enum([
|
|
22767
|
+
"idle",
|
|
22768
|
+
"installing",
|
|
22769
|
+
"restarting",
|
|
22770
|
+
"succeeded",
|
|
22771
|
+
"failed"
|
|
22772
|
+
]);
|
|
22773
|
+
var runtimeStatusSchema = external_exports.object({
|
|
22774
|
+
runningVersion: external_exports.string().nullable(),
|
|
22775
|
+
installedVersion: external_exports.string().nullable(),
|
|
22776
|
+
restartRequired: external_exports.boolean(),
|
|
22777
|
+
remote: external_exports.boolean(),
|
|
22778
|
+
updateSupported: external_exports.boolean(),
|
|
22779
|
+
update: external_exports.object({
|
|
22780
|
+
phase: remoteUpdatePhaseSchema,
|
|
22781
|
+
targetVersion: external_exports.string().nullable(),
|
|
22782
|
+
error: external_exports.string().nullable()
|
|
22724
22783
|
})
|
|
22725
22784
|
});
|
|
22726
|
-
var
|
|
22785
|
+
var remoteUpdateParamsSchema = external_exports.object({
|
|
22786
|
+
version: external_exports.string().regex(/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/u)
|
|
22787
|
+
}).strict();
|
|
22788
|
+
var remoteSshSetupParamsSchema = external_exports.object({
|
|
22789
|
+
hostname: external_exports.string().min(1).max(1024).refine((value) => !value.startsWith("-") && !/\s/u.test(value)),
|
|
22790
|
+
port: external_exports.number().int().min(1).max(65535).nullable(),
|
|
22791
|
+
identity: external_exports.string().max(4096).nullable(),
|
|
22792
|
+
action: external_exports.enum(["inspect", "install", "update", "repair", "uninstall"]),
|
|
22793
|
+
uninstallPackage: external_exports.boolean().optional(),
|
|
22794
|
+
version: external_exports.string().regex(/^\d+\.\d+\.\d+$/u).nullable()
|
|
22795
|
+
}).strict();
|
|
22796
|
+
var remoteSshSetupResultSchema = external_exports.object({ state: external_exports.enum(["installed", "not-installed"]) }).strict();
|
|
22797
|
+
|
|
22798
|
+
// ../../shared-contracts/dist/remote-sessions.js
|
|
22799
|
+
var REMOTE_CONTROLLER_REQUEST_MAX_BYTES = 16 * 1024;
|
|
22800
|
+
var REMOTE_IDENTITY_MAX_LENGTH = 1024;
|
|
22801
|
+
var identity = external_exports.string().min(1).max(REMOTE_IDENTITY_MAX_LENGTH);
|
|
22802
|
+
var target = {
|
|
22803
|
+
hostId: identity.regex(/^(?:remote-(?:ssh(?:-|:)|control:)|remote-peer:[a-zA-Z0-9_-]{1,64}$)/u)
|
|
22804
|
+
};
|
|
22805
|
+
var thread = { ...target, threadId: identity };
|
|
22806
|
+
var text = external_exports.string().min(1).max(8e3);
|
|
22807
|
+
var input2 = { text, requestId: identity };
|
|
22808
|
+
var remoteDeliveryReplySchema = external_exports.discriminatedUnion("accepted", [
|
|
22809
|
+
external_exports.object({ accepted: external_exports.literal(true), startQueuedItemId: identity.optional() }),
|
|
22727
22810
|
external_exports.object({
|
|
22728
|
-
|
|
22729
|
-
|
|
22730
|
-
|
|
22731
|
-
|
|
22732
|
-
|
|
22733
|
-
|
|
22734
|
-
|
|
22735
|
-
|
|
22736
|
-
|
|
22811
|
+
accepted: external_exports.literal(false),
|
|
22812
|
+
code: external_exports.enum([
|
|
22813
|
+
"remote/queue-unavailable",
|
|
22814
|
+
"remote/steer-unavailable",
|
|
22815
|
+
"remote/turn-changed",
|
|
22816
|
+
"remote/send-rejected",
|
|
22817
|
+
"session/queue-item-not-found",
|
|
22818
|
+
"session/queue-item-starting"
|
|
22819
|
+
]),
|
|
22820
|
+
message: external_exports.string()
|
|
22821
|
+
})
|
|
22822
|
+
]);
|
|
22823
|
+
var remoteQueueSnapshotSchema = external_exports.discriminatedUnion("available", [
|
|
22824
|
+
external_exports.object({ available: external_exports.literal(false) }),
|
|
22825
|
+
external_exports.object({
|
|
22826
|
+
available: external_exports.literal(true),
|
|
22827
|
+
items: external_exports.array(external_exports.object({ id: identity, clientUserMessageId: identity, preview: external_exports.string().max(801) })).max(100)
|
|
22828
|
+
})
|
|
22829
|
+
]);
|
|
22830
|
+
var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
22831
|
+
external_exports.strictObject({ kind: external_exports.literal("hosts") }),
|
|
22832
|
+
external_exports.strictObject({
|
|
22833
|
+
kind: external_exports.literal("create"),
|
|
22834
|
+
...target,
|
|
22835
|
+
cwd: external_exports.string().min(1).max(8192),
|
|
22836
|
+
epoch: identity
|
|
22837
|
+
}),
|
|
22838
|
+
external_exports.strictObject({ kind: external_exports.literal("projectHarnesses"), ...target, epoch: identity }),
|
|
22839
|
+
external_exports.strictObject({
|
|
22840
|
+
kind: external_exports.literal("inspectHarness"),
|
|
22841
|
+
...target,
|
|
22842
|
+
epoch: identity,
|
|
22843
|
+
cwd: external_exports.string().min(1).max(8192),
|
|
22844
|
+
harnessId: identity
|
|
22845
|
+
}),
|
|
22846
|
+
external_exports.strictObject({
|
|
22847
|
+
kind: external_exports.literal("startSelected"),
|
|
22848
|
+
...target,
|
|
22849
|
+
epoch: identity,
|
|
22850
|
+
cwd: external_exports.string().min(1).max(8192),
|
|
22851
|
+
harnessId: identity,
|
|
22852
|
+
model: external_exports.string().min(1).max(4096),
|
|
22853
|
+
serviceTier: external_exports.enum(["priority", "ultrafast"]).optional(),
|
|
22854
|
+
reasoningEffort: identity.optional()
|
|
22855
|
+
}),
|
|
22856
|
+
external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
|
|
22857
|
+
external_exports.strictObject({
|
|
22858
|
+
kind: external_exports.literal("list"),
|
|
22859
|
+
...target,
|
|
22860
|
+
cursor: external_exports.string().nullable(),
|
|
22861
|
+
archived: external_exports.boolean(),
|
|
22862
|
+
includeLoaded: external_exports.literal(true).optional()
|
|
22737
22863
|
}),
|
|
22738
|
-
|
|
22739
|
-
|
|
22740
|
-
|
|
22741
|
-
|
|
22742
|
-
|
|
22743
|
-
|
|
22864
|
+
external_exports.strictObject({
|
|
22865
|
+
kind: external_exports.literal("read"),
|
|
22866
|
+
...thread,
|
|
22867
|
+
page: external_exports.strictObject({
|
|
22868
|
+
cursor: external_exports.string().min(1).max(8192).nullable(),
|
|
22869
|
+
epoch: identity.optional(),
|
|
22870
|
+
sortDirection: external_exports.enum(["asc", "desc"]).optional(),
|
|
22871
|
+
limit: external_exports.number().int().min(1).max(20).optional()
|
|
22872
|
+
}).refine((page) => page.cursor === null || page.epoch !== void 0, {
|
|
22873
|
+
message: "A history continuation requires its connection epoch"
|
|
22874
|
+
}).optional()
|
|
22744
22875
|
}),
|
|
22745
|
-
|
|
22876
|
+
external_exports.strictObject({ kind: external_exports.literal("usage"), ...thread, epoch: identity }),
|
|
22877
|
+
external_exports.strictObject({
|
|
22878
|
+
kind: external_exports.literal("configure"),
|
|
22879
|
+
...thread,
|
|
22880
|
+
epoch: identity,
|
|
22881
|
+
modelId: identity.optional(),
|
|
22882
|
+
serviceTier: harnessModelServiceTierSchema.optional(),
|
|
22883
|
+
thinkingOptionId: identity.optional(),
|
|
22884
|
+
permissionModeId: identity.optional()
|
|
22885
|
+
}).refine((value) => [value.modelId, value.thinkingOptionId, value.permissionModeId].filter((v) => v !== void 0).length === 1, "Select exactly one remote setting").refine((value) => value.serviceTier === void 0 || value.modelId !== void 0, {
|
|
22886
|
+
message: "A service tier requires a Model ID"
|
|
22887
|
+
}),
|
|
22888
|
+
external_exports.strictObject({
|
|
22889
|
+
kind: external_exports.literal("prompt"),
|
|
22890
|
+
...thread,
|
|
22891
|
+
epoch: identity,
|
|
22892
|
+
text,
|
|
22893
|
+
requestId: identity.optional()
|
|
22894
|
+
}),
|
|
22895
|
+
external_exports.strictObject({ kind: external_exports.literal("queue"), ...thread, epoch: identity }),
|
|
22896
|
+
external_exports.strictObject({
|
|
22897
|
+
kind: external_exports.literal("delivery"),
|
|
22898
|
+
...thread,
|
|
22899
|
+
epoch: identity,
|
|
22900
|
+
action: external_exports.discriminatedUnion("kind", [
|
|
22901
|
+
external_exports.strictObject({ kind: external_exports.literal("enqueue"), ...input2 }),
|
|
22902
|
+
external_exports.strictObject({ kind: external_exports.literal("steer"), ...input2, turnId: identity }),
|
|
22903
|
+
external_exports.strictObject({ kind: external_exports.literal("remove"), itemId: identity }),
|
|
22904
|
+
external_exports.strictObject({
|
|
22905
|
+
kind: external_exports.literal("start"),
|
|
22906
|
+
itemId: identity,
|
|
22907
|
+
onlyIfHead: external_exports.literal(true).optional()
|
|
22908
|
+
}),
|
|
22909
|
+
external_exports.strictObject({ kind: external_exports.literal("sendNow"), itemId: identity })
|
|
22910
|
+
])
|
|
22911
|
+
}),
|
|
22912
|
+
external_exports.strictObject({ kind: external_exports.literal("interrupt"), ...thread, epoch: identity, turnId: identity }),
|
|
22913
|
+
external_exports.strictObject({
|
|
22914
|
+
kind: external_exports.literal("rename"),
|
|
22915
|
+
...thread,
|
|
22916
|
+
epoch: identity,
|
|
22917
|
+
name: external_exports.string().min(1).max(512)
|
|
22918
|
+
}),
|
|
22919
|
+
external_exports.strictObject({ kind: external_exports.literal("archive"), ...thread, epoch: identity, archived: external_exports.boolean() }),
|
|
22920
|
+
external_exports.strictObject({
|
|
22921
|
+
kind: external_exports.literal("respond"),
|
|
22922
|
+
...thread,
|
|
22923
|
+
epoch: identity,
|
|
22924
|
+
requestId: external_exports.union([identity, external_exports.number().int()]),
|
|
22925
|
+
result: external_exports.record(external_exports.string(), external_exports.unknown())
|
|
22926
|
+
})
|
|
22746
22927
|
]);
|
|
22747
|
-
|
|
22748
|
-
|
|
22749
|
-
|
|
22750
|
-
|
|
22751
|
-
|
|
22752
|
-
|
|
22753
|
-
|
|
22754
|
-
|
|
22755
|
-
|
|
22756
|
-
|
|
22757
|
-
|
|
22758
|
-
|
|
22759
|
-
|
|
22760
|
-
entries: external_exports.array(remotePeerDirectoryEntrySchema)
|
|
22761
|
-
});
|
|
22762
|
-
var remotePeerCreateDirParamsSchema = external_exports.object({
|
|
22763
|
-
peerId: remotePeerIdSchema,
|
|
22764
|
-
parentPath: external_exports.string().min(1).max(8192),
|
|
22765
|
-
name: external_exports.string().min(1).max(255).refine((value) => value.trim().length > 0, "Directory name cannot be blank")
|
|
22928
|
+
|
|
22929
|
+
// ../../shared-contracts/dist/remote-connections.js
|
|
22930
|
+
var hostId = external_exports.string().min(1).max(1024);
|
|
22931
|
+
var codexSshConnectionSchema = external_exports.object({
|
|
22932
|
+
hostId,
|
|
22933
|
+
displayName: external_exports.string().min(1).max(1024),
|
|
22934
|
+
source: external_exports.enum(["codex-managed", "discovered"]),
|
|
22935
|
+
sshAlias: external_exports.string().max(1024).nullable(),
|
|
22936
|
+
sshHost: external_exports.string().min(1).max(1024),
|
|
22937
|
+
sshPort: external_exports.number().int().min(1).max(65535).nullable(),
|
|
22938
|
+
identity: external_exports.string().max(4096).nullable(),
|
|
22939
|
+
autoConnect: external_exports.boolean(),
|
|
22940
|
+
connectionAnalyticsId: external_exports.string().max(1024).optional()
|
|
22766
22941
|
});
|
|
22767
|
-
var
|
|
22768
|
-
|
|
22769
|
-
|
|
22942
|
+
var codexSshDraftSchema = external_exports.strictObject({
|
|
22943
|
+
displayName: external_exports.string().min(1).max(1024),
|
|
22944
|
+
hostname: external_exports.string().min(1).max(1024),
|
|
22945
|
+
sshPort: external_exports.number().int().min(1).max(65535).nullable(),
|
|
22946
|
+
identity: external_exports.string().max(4096).nullable()
|
|
22770
22947
|
});
|
|
22771
|
-
var
|
|
22772
|
-
|
|
22773
|
-
|
|
22774
|
-
|
|
22948
|
+
var remoteConnectionsRequestSchema = external_exports.discriminatedUnion("action", [
|
|
22949
|
+
external_exports.strictObject({ action: external_exports.literal("session"), operation: remoteSessionOperationSchema }),
|
|
22950
|
+
external_exports.strictObject({ action: external_exports.literal("list") }),
|
|
22951
|
+
external_exports.strictObject({ action: external_exports.literal("catalog") }),
|
|
22952
|
+
external_exports.strictObject({
|
|
22953
|
+
action: external_exports.literal("read-thread"),
|
|
22954
|
+
hostId: hostId.refine((id2) => id2 !== "local"),
|
|
22955
|
+
input: delegationReadParamsSchema
|
|
22956
|
+
}),
|
|
22957
|
+
external_exports.strictObject({
|
|
22958
|
+
action: external_exports.literal("save"),
|
|
22959
|
+
draft: codexSshDraftSchema,
|
|
22960
|
+
previous: codexSshConnectionSchema.nullable()
|
|
22961
|
+
}),
|
|
22962
|
+
external_exports.strictObject({ action: external_exports.literal("remove"), previous: codexSshConnectionSchema }),
|
|
22963
|
+
external_exports.strictObject({ action: external_exports.literal("connect"), hostId, enabled: external_exports.boolean() }),
|
|
22964
|
+
external_exports.strictObject({ action: external_exports.literal("state"), hostId }),
|
|
22965
|
+
external_exports.strictObject({ action: external_exports.literal("runtime"), hostId }),
|
|
22966
|
+
external_exports.strictObject({
|
|
22967
|
+
action: external_exports.literal("update"),
|
|
22968
|
+
hostId: hostId.refine((id2) => id2 !== "local"),
|
|
22969
|
+
version: remoteUpdateParamsSchema.shape.version
|
|
22970
|
+
})
|
|
22971
|
+
]);
|
|
22972
|
+
var remoteConnectionsReplySchema = external_exports.union([
|
|
22973
|
+
external_exports.strictObject({ result: jsonValueSchema }),
|
|
22974
|
+
external_exports.strictObject({ error: external_exports.strictObject({ code: external_exports.number().int(), message: external_exports.string() }) })
|
|
22975
|
+
]);
|
|
22976
|
+
|
|
22977
|
+
// ../../shared-contracts/dist/thread-title.js
|
|
22978
|
+
var threadTitleInputSchema = external_exports.strictObject({
|
|
22979
|
+
prompt: external_exports.string().trim().min(1).max(2e3),
|
|
22980
|
+
cwd: external_exports.string().max(4096).nullable()
|
|
22775
22981
|
});
|
|
22776
|
-
var
|
|
22777
|
-
|
|
22778
|
-
|
|
22779
|
-
|
|
22982
|
+
var threadTitleResultSchema = external_exports.string().trim().min(1).max(60).nullable();
|
|
22983
|
+
|
|
22984
|
+
// ../../shared-contracts/dist/web-ui-extensions.js
|
|
22985
|
+
var webUiExtensionIdSchema = external_exports.string().max(214).regex(/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/u);
|
|
22986
|
+
var localizedTextSchema2 = external_exports.union([
|
|
22987
|
+
external_exports.string(),
|
|
22988
|
+
external_exports.object({ en: external_exports.string() }).catchall(external_exports.string())
|
|
22989
|
+
]);
|
|
22990
|
+
var webUiExtensionMetaSchema = external_exports.object({
|
|
22991
|
+
title: localizedTextSchema2.optional(),
|
|
22992
|
+
description: localizedTextSchema2.optional(),
|
|
22993
|
+
icon: external_exports.string().max(Math.ceil(256 * 1024 / 3) * 4 + 64).regex(/^data:image\/(?:svg\+xml|png|jpeg|webp);base64,[A-Za-z0-9+/]*={0,2}$/u).optional(),
|
|
22994
|
+
error: external_exports.string().optional()
|
|
22780
22995
|
});
|
|
22781
|
-
var
|
|
22782
|
-
|
|
22783
|
-
|
|
22996
|
+
var webUiExtensionSchema = external_exports.object({
|
|
22997
|
+
id: webUiExtensionIdSchema,
|
|
22998
|
+
name: external_exports.string().min(1).max(214),
|
|
22999
|
+
version: external_exports.string().min(1).max(128),
|
|
23000
|
+
format: external_exports.literal("dsh"),
|
|
23001
|
+
supportedTargets: external_exports.tuple([external_exports.literal("web")]),
|
|
23002
|
+
enabledTargets: external_exports.array(external_exports.literal("web")).max(1),
|
|
23003
|
+
source: external_exports.string().min(1).max(4096),
|
|
23004
|
+
/** Public project page, derived from installed package metadata and its source. */
|
|
23005
|
+
projectUrl: external_exports.string().max(4096).url({ protocol: /^https?$/u }).optional(),
|
|
23006
|
+
installedAt: external_exports.string(),
|
|
23007
|
+
meta: webUiExtensionMetaSchema.optional(),
|
|
23008
|
+
loadError: external_exports.string().optional()
|
|
22784
23009
|
});
|
|
22785
|
-
var
|
|
22786
|
-
|
|
22787
|
-
|
|
23010
|
+
var webUiExtensionsStateSchema = external_exports.object({
|
|
23011
|
+
extensions: external_exports.array(webUiExtensionSchema),
|
|
23012
|
+
loadedIds: external_exports.array(webUiExtensionIdSchema),
|
|
23013
|
+
safeMode: external_exports.boolean(),
|
|
23014
|
+
storeError: external_exports.string().optional()
|
|
22788
23015
|
});
|
|
23016
|
+
var webUiExtensionRegistrySchema = external_exports.string().trim().max(2048).url({ protocol: /^https?$/u, normalize: true }).refine((value) => !/[\s\\?#]/u.test(value) && !value.split("/")[2]?.includes("@"), "Use an HTTP(S) registry URL without credentials, a query, or a fragment.").transform((value) => value.endsWith("/") ? value : `${value}/`);
|
|
23017
|
+
var webUiExtensionInstallSchema = external_exports.object({
|
|
23018
|
+
spec: external_exports.string().trim().min(1).max(4096),
|
|
23019
|
+
registry: webUiExtensionRegistrySchema.optional()
|
|
23020
|
+
}).strict();
|
|
23021
|
+
var webUiExtensionEnabledSchema = external_exports.object({ id: webUiExtensionIdSchema, enabled: external_exports.boolean() }).strict();
|
|
23022
|
+
var webUiExtensionRemoveSchema = external_exports.object({ id: webUiExtensionIdSchema }).strict();
|
|
22789
23023
|
|
|
22790
23024
|
// ../../shared-contracts/dist/index.js
|
|
22791
23025
|
var workspaceContractVersionSchema = external_exports.literal(WORKSPACE_CONTRACT_VERSION);
|
|
@@ -22795,11 +23029,11 @@ import { createHash } from "node:crypto";
|
|
|
22795
23029
|
import { lstat, readdir } from "node:fs/promises";
|
|
22796
23030
|
import os from "node:os";
|
|
22797
23031
|
import path from "node:path";
|
|
23032
|
+
import { performance } from "node:perf_hooks";
|
|
22798
23033
|
import { setImmediate as yieldToEventLoop } from "node:timers/promises";
|
|
22799
23034
|
|
|
22800
23035
|
// ../../harness-adapter/dist/usage-statistics.js
|
|
22801
23036
|
import { createReadStream } from "node:fs";
|
|
22802
|
-
import { createInterface } from "node:readline";
|
|
22803
23037
|
var HarnessUsageSourceChangedError = class extends Error {
|
|
22804
23038
|
code = "HARNESS_USAGE_SOURCE_CHANGED";
|
|
22805
23039
|
/** Plugins may bundle their own copy of this contract, so instanceof is insufficient. */
|
|
@@ -22898,12 +23132,59 @@ function parseHarnessUsageEntry(value) {
|
|
|
22898
23132
|
}
|
|
22899
23133
|
return entry;
|
|
22900
23134
|
}
|
|
23135
|
+
var JSONL_CHUNK_BYTES = 128 * 1024;
|
|
23136
|
+
var JSONL_HEADER_CHUNK_BYTES = 16 * 1024;
|
|
23137
|
+
function concatParts(parts, total) {
|
|
23138
|
+
const [single] = parts;
|
|
23139
|
+
return single && parts.length === 1 ? single : Buffer.concat(parts, total);
|
|
23140
|
+
}
|
|
23141
|
+
async function* jsonlLineSlices(file2, signal, highWaterMark) {
|
|
23142
|
+
const stream = createReadStream(file2, { highWaterMark, signal });
|
|
23143
|
+
let parts = [];
|
|
23144
|
+
let buffered = 0;
|
|
23145
|
+
try {
|
|
23146
|
+
for await (const raw of stream) {
|
|
23147
|
+
signal.throwIfAborted();
|
|
23148
|
+
const chunk = raw;
|
|
23149
|
+
let start = 0;
|
|
23150
|
+
let end;
|
|
23151
|
+
while ((end = chunk.indexOf(10, start)) >= 0) {
|
|
23152
|
+
const lineEnd = end > start && chunk[end - 1] === 13 ? end - 1 : end;
|
|
23153
|
+
const slice = chunk.subarray(start, lineEnd);
|
|
23154
|
+
if (buffered === 0) {
|
|
23155
|
+
yield slice;
|
|
23156
|
+
} else {
|
|
23157
|
+
if (slice.length > 0) {
|
|
23158
|
+
parts.push(slice);
|
|
23159
|
+
buffered += slice.length;
|
|
23160
|
+
}
|
|
23161
|
+
const combined = concatParts(parts, buffered);
|
|
23162
|
+
parts = [];
|
|
23163
|
+
buffered = 0;
|
|
23164
|
+
yield combined.length > 0 && combined[combined.length - 1] === 13 ? combined.subarray(0, combined.length - 1) : combined;
|
|
23165
|
+
}
|
|
23166
|
+
start = end + 1;
|
|
23167
|
+
}
|
|
23168
|
+
if (start < chunk.length) {
|
|
23169
|
+
const rest = chunk.subarray(start);
|
|
23170
|
+
parts.push(rest);
|
|
23171
|
+
buffered += rest.length;
|
|
23172
|
+
}
|
|
23173
|
+
}
|
|
23174
|
+
if (buffered > 0) {
|
|
23175
|
+
const combined = concatParts(parts, buffered);
|
|
23176
|
+
yield combined.length > 0 && combined[combined.length - 1] === 13 ? combined.subarray(0, combined.length - 1) : combined;
|
|
23177
|
+
}
|
|
23178
|
+
} finally {
|
|
23179
|
+
stream.destroy();
|
|
23180
|
+
}
|
|
23181
|
+
}
|
|
22901
23182
|
async function* jsonlRecords(file2, marker, signal) {
|
|
22902
|
-
const
|
|
22903
|
-
|
|
22904
|
-
|
|
22905
|
-
|
|
22906
|
-
|
|
23183
|
+
const markerBytes = marker.length > 0 ? Buffer.from(marker, "utf8") : null;
|
|
23184
|
+
for await (const rawLine of jsonlLineSlices(file2, signal, JSONL_CHUNK_BYTES)) {
|
|
23185
|
+
if (markerBytes && !rawLine.includes(markerBytes))
|
|
23186
|
+
continue;
|
|
23187
|
+
const line = rawLine.toString("utf8");
|
|
22907
23188
|
if (!line.includes(marker))
|
|
22908
23189
|
continue;
|
|
22909
23190
|
let value;
|
|
@@ -23326,7 +23607,6 @@ var CodexCounters = class {
|
|
|
23326
23607
|
|
|
23327
23608
|
// dist/rollout-io.js
|
|
23328
23609
|
import { createReadStream as createReadStream2 } from "node:fs";
|
|
23329
|
-
import { StringDecoder } from "node:string_decoder";
|
|
23330
23610
|
import { pipeline } from "node:stream/promises";
|
|
23331
23611
|
import { Readable } from "node:stream";
|
|
23332
23612
|
import { constants as zstdConstants, createZstdDecompress } from "node:zlib";
|
|
@@ -23352,10 +23632,16 @@ import { constants as zstdConstants, createZstdDecompress } from "node:zlib";
|
|
|
23352
23632
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23353
23633
|
* SOFTWARE.
|
|
23354
23634
|
*/
|
|
23635
|
+
var BLOCK_SIZE = 128 * 1024;
|
|
23636
|
+
var ZSTD_READ_SIZE = 512 * 1024;
|
|
23355
23637
|
var MAX_LINE = 128 * 1024 * 1024;
|
|
23638
|
+
var PEEK_BYTES = 4096;
|
|
23356
23639
|
async function* rolloutBytes(file2, signal) {
|
|
23357
23640
|
signal.throwIfAborted();
|
|
23358
|
-
const stream = createReadStream2(file2, {
|
|
23641
|
+
const stream = createReadStream2(file2, {
|
|
23642
|
+
highWaterMark: file2.endsWith(".zst") ? ZSTD_READ_SIZE : BLOCK_SIZE,
|
|
23643
|
+
signal
|
|
23644
|
+
});
|
|
23359
23645
|
try {
|
|
23360
23646
|
if (!file2.endsWith(".zst")) {
|
|
23361
23647
|
for await (const chunk of stream) {
|
|
@@ -23367,6 +23653,12 @@ async function* rolloutBytes(file2, signal) {
|
|
|
23367
23653
|
const input3 = stream[Symbol.asyncIterator]();
|
|
23368
23654
|
let pending = Buffer.alloc(0);
|
|
23369
23655
|
async function readExact(size, allowEof = false) {
|
|
23656
|
+
signal.throwIfAborted();
|
|
23657
|
+
if (pending.length >= size) {
|
|
23658
|
+
const slice = pending.subarray(0, size);
|
|
23659
|
+
pending = pending.subarray(size);
|
|
23660
|
+
return slice;
|
|
23661
|
+
}
|
|
23370
23662
|
const parts = [];
|
|
23371
23663
|
let length = 0;
|
|
23372
23664
|
while (length < size) {
|
|
@@ -23385,7 +23677,8 @@ async function* rolloutBytes(file2, signal) {
|
|
|
23385
23677
|
pending = pending.subarray(count2);
|
|
23386
23678
|
length += count2;
|
|
23387
23679
|
}
|
|
23388
|
-
|
|
23680
|
+
const [firstPart] = parts;
|
|
23681
|
+
return firstPart && parts.length === 1 ? firstPart : Buffer.concat(parts, length);
|
|
23389
23682
|
}
|
|
23390
23683
|
for (; ; ) {
|
|
23391
23684
|
const magicBytes = await readExact(4, true);
|
|
@@ -23395,7 +23688,7 @@ async function* rolloutBytes(file2, signal) {
|
|
|
23395
23688
|
if ((magic & 4294967280) === 407710288) {
|
|
23396
23689
|
let size = (await readExact(4)).readUInt32LE(0);
|
|
23397
23690
|
while (size) {
|
|
23398
|
-
const count2 = Math.min(size,
|
|
23691
|
+
const count2 = Math.min(size, ZSTD_READ_SIZE);
|
|
23399
23692
|
await readExact(count2);
|
|
23400
23693
|
size -= count2;
|
|
23401
23694
|
}
|
|
@@ -23412,17 +23705,44 @@ async function* rolloutBytes(file2, signal) {
|
|
|
23412
23705
|
const header = Buffer.concat([magicBytes, descriptorBytes, await readExact(headerSize)]);
|
|
23413
23706
|
async function* frameChunks() {
|
|
23414
23707
|
yield header;
|
|
23415
|
-
|
|
23708
|
+
let done = false;
|
|
23709
|
+
while (!done) {
|
|
23710
|
+
signal.throwIfAborted();
|
|
23711
|
+
let batchEnd = 0;
|
|
23712
|
+
while (pending.length - batchEnd >= 3) {
|
|
23713
|
+
const block2 = pending.readUIntLE(batchEnd, 3);
|
|
23714
|
+
const type2 = block2 >> 1 & 3;
|
|
23715
|
+
if (type2 === 3)
|
|
23716
|
+
throw new Error("Reserved Codex zstd block");
|
|
23717
|
+
const blockSize2 = block2 >>> 3;
|
|
23718
|
+
if (blockSize2 > BLOCK_SIZE)
|
|
23719
|
+
throw new Error("Invalid Codex zstd block size");
|
|
23720
|
+
const step = 3 + (type2 === 1 ? 1 : blockSize2);
|
|
23721
|
+
if (pending.length - batchEnd < step)
|
|
23722
|
+
break;
|
|
23723
|
+
batchEnd += step;
|
|
23724
|
+
if (block2 & 1) {
|
|
23725
|
+
done = true;
|
|
23726
|
+
break;
|
|
23727
|
+
}
|
|
23728
|
+
}
|
|
23729
|
+
if (batchEnd > 0) {
|
|
23730
|
+
const batch = pending.subarray(0, batchEnd);
|
|
23731
|
+
pending = pending.subarray(batchEnd);
|
|
23732
|
+
yield batch;
|
|
23733
|
+
if (done)
|
|
23734
|
+
break;
|
|
23735
|
+
}
|
|
23416
23736
|
const blockBytes = await readExact(3);
|
|
23417
23737
|
const block = blockBytes.readUIntLE(0, 3);
|
|
23418
23738
|
const type = block >> 1 & 3;
|
|
23419
23739
|
if (type === 3)
|
|
23420
23740
|
throw new Error("Reserved Codex zstd block");
|
|
23421
23741
|
const blockSize = block >>> 3;
|
|
23422
|
-
if (blockSize >
|
|
23742
|
+
if (blockSize > BLOCK_SIZE)
|
|
23423
23743
|
throw new Error("Invalid Codex zstd block size");
|
|
23424
|
-
|
|
23425
|
-
yield
|
|
23744
|
+
const body = await readExact(type === 1 ? 1 : blockSize);
|
|
23745
|
+
yield Buffer.concat([blockBytes, body], 3 + body.length);
|
|
23426
23746
|
if (block & 1)
|
|
23427
23747
|
break;
|
|
23428
23748
|
}
|
|
@@ -23431,7 +23751,7 @@ async function* rolloutBytes(file2, signal) {
|
|
|
23431
23751
|
}
|
|
23432
23752
|
const frame = Readable.from(frameChunks(), { objectMode: false });
|
|
23433
23753
|
const decoder = createZstdDecompress({
|
|
23434
|
-
chunkSize:
|
|
23754
|
+
chunkSize: BLOCK_SIZE,
|
|
23435
23755
|
params: { [zstdConstants.ZSTD_d_windowLogMax]: 27 }
|
|
23436
23756
|
});
|
|
23437
23757
|
const completed = pipeline(frame, decoder, { signal }).then(() => null, (error62) => error62);
|
|
@@ -23453,25 +23773,98 @@ async function* rolloutBytes(file2, signal) {
|
|
|
23453
23773
|
stream.destroy();
|
|
23454
23774
|
}
|
|
23455
23775
|
}
|
|
23456
|
-
|
|
23457
|
-
const
|
|
23458
|
-
|
|
23776
|
+
function copyEdgeBytes(parts, total, take, head) {
|
|
23777
|
+
const length = Math.min(total, take);
|
|
23778
|
+
const out = Buffer.allocUnsafe(length);
|
|
23779
|
+
if (head) {
|
|
23780
|
+
let offset2 = 0;
|
|
23781
|
+
for (const part of parts) {
|
|
23782
|
+
const count2 = Math.min(part.length, length - offset2);
|
|
23783
|
+
part.copy(out, offset2, 0, count2);
|
|
23784
|
+
offset2 += count2;
|
|
23785
|
+
if (offset2 >= length)
|
|
23786
|
+
break;
|
|
23787
|
+
}
|
|
23788
|
+
return out;
|
|
23789
|
+
}
|
|
23790
|
+
let offset = length;
|
|
23791
|
+
for (let i = parts.length - 1; i >= 0 && offset > 0; i--) {
|
|
23792
|
+
const part = parts[i];
|
|
23793
|
+
if (!part)
|
|
23794
|
+
continue;
|
|
23795
|
+
const count2 = Math.min(part.length, offset);
|
|
23796
|
+
part.copy(out, offset - count2, part.length - count2, part.length);
|
|
23797
|
+
offset -= count2;
|
|
23798
|
+
}
|
|
23799
|
+
let start = 0;
|
|
23800
|
+
while (start < 3 && start < out.length && ((out[start] ?? 0) & 192) === 128)
|
|
23801
|
+
start += 1;
|
|
23802
|
+
return out.subarray(start);
|
|
23803
|
+
}
|
|
23804
|
+
async function* rolloutLines(file2, signal, shouldDecode) {
|
|
23805
|
+
let parts = [];
|
|
23806
|
+
let buffered = 0;
|
|
23807
|
+
const decodeMultiChunk = () => {
|
|
23808
|
+
if (shouldDecode && buffered > PEEK_BYTES * 2) {
|
|
23809
|
+
const head = copyEdgeBytes(parts, buffered, PEEK_BYTES, true).toString("utf8").slice(0, 1024);
|
|
23810
|
+
const tail = copyEdgeBytes(parts, buffered, PEEK_BYTES, false).toString("utf8").slice(-1024);
|
|
23811
|
+
if (!shouldDecode(head, tail)) {
|
|
23812
|
+
parts = [];
|
|
23813
|
+
buffered = 0;
|
|
23814
|
+
return null;
|
|
23815
|
+
}
|
|
23816
|
+
}
|
|
23817
|
+
const [single] = parts;
|
|
23818
|
+
const line = (single && parts.length === 1 ? single : Buffer.concat(parts, buffered)).toString("utf8");
|
|
23819
|
+
parts = [];
|
|
23820
|
+
buffered = 0;
|
|
23821
|
+
return line;
|
|
23822
|
+
};
|
|
23459
23823
|
for await (const chunk of rolloutBytes(file2, signal)) {
|
|
23460
|
-
|
|
23461
|
-
let
|
|
23462
|
-
while ((end =
|
|
23463
|
-
|
|
23464
|
-
|
|
23465
|
-
|
|
23824
|
+
let start = 0;
|
|
23825
|
+
let end;
|
|
23826
|
+
while ((end = chunk.indexOf(10, start)) >= 0) {
|
|
23827
|
+
const slice = chunk.subarray(start, end);
|
|
23828
|
+
if (buffered === 0) {
|
|
23829
|
+
if (slice.length > MAX_LINE)
|
|
23830
|
+
throw new Error("Codex rollout line exceeds the safety limit");
|
|
23831
|
+
if (shouldDecode && slice.length > PEEK_BYTES * 2) {
|
|
23832
|
+
const head = slice.subarray(0, PEEK_BYTES).toString("utf8").slice(0, 1024);
|
|
23833
|
+
let tailStart = slice.length - PEEK_BYTES;
|
|
23834
|
+
while (tailStart < slice.length && ((slice[tailStart] ?? 0) & 192) === 128)
|
|
23835
|
+
tailStart += 1;
|
|
23836
|
+
const tail = slice.subarray(tailStart).toString("utf8").slice(-1024);
|
|
23837
|
+
if (!shouldDecode(head, tail)) {
|
|
23838
|
+
start = end + 1;
|
|
23839
|
+
continue;
|
|
23840
|
+
}
|
|
23841
|
+
}
|
|
23842
|
+
yield slice.toString("utf8");
|
|
23843
|
+
} else {
|
|
23844
|
+
buffered += slice.length;
|
|
23845
|
+
if (buffered > MAX_LINE)
|
|
23846
|
+
throw new Error("Codex rollout line exceeds the safety limit");
|
|
23847
|
+
if (slice.length > 0)
|
|
23848
|
+
parts.push(slice);
|
|
23849
|
+
const decoded = decodeMultiChunk();
|
|
23850
|
+
if (decoded !== null)
|
|
23851
|
+
yield decoded;
|
|
23852
|
+
}
|
|
23466
23853
|
start = end + 1;
|
|
23467
23854
|
}
|
|
23468
|
-
|
|
23469
|
-
|
|
23470
|
-
|
|
23855
|
+
if (start < chunk.length) {
|
|
23856
|
+
const rest = chunk.subarray(start);
|
|
23857
|
+
buffered += rest.length;
|
|
23858
|
+
if (buffered > MAX_LINE)
|
|
23859
|
+
throw new Error("Codex rollout line exceeds the safety limit");
|
|
23860
|
+
parts.push(rest);
|
|
23861
|
+
}
|
|
23862
|
+
}
|
|
23863
|
+
if (buffered > 0) {
|
|
23864
|
+
const decoded = decodeMultiChunk();
|
|
23865
|
+
if (decoded !== null && decoded.trim())
|
|
23866
|
+
yield decoded;
|
|
23471
23867
|
}
|
|
23472
|
-
pending += decoder.end();
|
|
23473
|
-
if (pending.trim())
|
|
23474
|
-
yield pending;
|
|
23475
23868
|
}
|
|
23476
23869
|
async function copyRelation(a, b, signal) {
|
|
23477
23870
|
const left = rolloutBytes(a, signal), right = rolloutBytes(b, signal);
|
|
@@ -23524,14 +23917,32 @@ var HEAD_TYPE = /"type"\s*:\s*"([^"]+)"/u;
|
|
|
23524
23917
|
var TAIL_TYPE = /"type"\s*:\s*"([^"]+)"\s*\}\s*$/u;
|
|
23525
23918
|
var USER_ROLE = /"role"\s*:\s*"user"/u;
|
|
23526
23919
|
var EVENT_OF_INTEREST = /"type"\s*:\s*"(?:token_count|task_started|task_complete|thread_settings_applied|user_message)"/u;
|
|
23527
|
-
function
|
|
23528
|
-
const head = HEAD_TYPE.exec(
|
|
23920
|
+
function rowKindFromEdges(headSlice, tailSlice) {
|
|
23921
|
+
const head = HEAD_TYPE.exec(headSlice)?.[1];
|
|
23529
23922
|
if (head && ROW_KINDS.has(head))
|
|
23530
23923
|
return head;
|
|
23531
|
-
return TAIL_TYPE.exec(
|
|
23924
|
+
return TAIL_TYPE.exec(tailSlice)?.[1] ?? head;
|
|
23925
|
+
}
|
|
23926
|
+
function rowKind(line) {
|
|
23927
|
+
return rowKindFromEdges(line.slice(0, 1024), line.slice(-1024));
|
|
23928
|
+
}
|
|
23929
|
+
function markerInEdges(pattern, headSlice, tailSlice) {
|
|
23930
|
+
return pattern.test(headSlice) || pattern.test(tailSlice);
|
|
23532
23931
|
}
|
|
23533
23932
|
function markerIn(pattern, line) {
|
|
23534
|
-
return pattern
|
|
23933
|
+
return markerInEdges(pattern, line.slice(0, 1024), line.slice(-1024));
|
|
23934
|
+
}
|
|
23935
|
+
function shouldDecodeUnboundedLine(headSlice, tailSlice) {
|
|
23936
|
+
const kind = rowKindFromEdges(headSlice, tailSlice);
|
|
23937
|
+
if (!kind)
|
|
23938
|
+
return true;
|
|
23939
|
+
if (!ROW_KINDS.has(kind))
|
|
23940
|
+
return false;
|
|
23941
|
+
if (kind === "response_item")
|
|
23942
|
+
return markerInEdges(USER_ROLE, headSlice, tailSlice);
|
|
23943
|
+
if (kind === "event_msg")
|
|
23944
|
+
return markerInEdges(EVENT_OF_INTEREST, headSlice, tailSlice);
|
|
23945
|
+
return true;
|
|
23535
23946
|
}
|
|
23536
23947
|
async function stamp(file2) {
|
|
23537
23948
|
const s = await lstat(file2, { bigint: true });
|
|
@@ -23587,11 +23998,15 @@ async function readCodexRollouts(files, thread2, signal, options = {}) {
|
|
|
23587
23998
|
const counters = new CodexCounters();
|
|
23588
23999
|
let model2 = "", cwd = "", ownFrom = null, firstMeta = false, forkAt = 0, seen = 0, firstPrompt;
|
|
23589
24000
|
let lastOrdinal = -1;
|
|
24001
|
+
let yieldedAt = performance.now();
|
|
24002
|
+
const filterEdges = options.endOrdinalExclusive === void 0 ? shouldDecodeUnboundedLine : void 0;
|
|
23590
24003
|
reading: for (const file2 of files) {
|
|
23591
|
-
for await (const line of rolloutLines(file2, signal)) {
|
|
24004
|
+
for await (const line of rolloutLines(file2, signal, filterEdges)) {
|
|
23592
24005
|
signal.throwIfAborted();
|
|
23593
|
-
if (++seen
|
|
24006
|
+
if ((++seen & 511) === 0 && performance.now() - yieldedAt >= 12) {
|
|
23594
24007
|
await yieldToEventLoop(void 0, { signal });
|
|
24008
|
+
yieldedAt = performance.now();
|
|
24009
|
+
}
|
|
23595
24010
|
if (options.endOrdinalExclusive !== void 0) {
|
|
23596
24011
|
if (lastOrdinal >= options.endOrdinalExclusive - 1)
|
|
23597
24012
|
break reading;
|
|
@@ -23732,13 +24147,29 @@ function createCodexUsageStatistics(environment, options = {}) {
|
|
|
23732
24147
|
const groups = /* @__PURE__ */ new Map();
|
|
23733
24148
|
let names = /* @__PURE__ */ new Map();
|
|
23734
24149
|
let namesStamp = "";
|
|
24150
|
+
let namesLoading = null;
|
|
23735
24151
|
async function threadNames(signal) {
|
|
23736
24152
|
const current = await stamp(path.join(home, "session_index.jsonl")).catch(() => "-");
|
|
23737
24153
|
if (namesStamp === current)
|
|
23738
24154
|
return names;
|
|
23739
|
-
|
|
23740
|
-
|
|
23741
|
-
|
|
24155
|
+
if (namesLoading?.stamp === current && namesLoading.signal === signal) {
|
|
24156
|
+
return namesLoading.promise;
|
|
24157
|
+
}
|
|
24158
|
+
const promise2 = readThreadNames(home, signal).then((loaded) => {
|
|
24159
|
+
if (namesLoading?.promise === promise2) {
|
|
24160
|
+
names = loaded;
|
|
24161
|
+
namesStamp = current;
|
|
24162
|
+
}
|
|
24163
|
+
return loaded;
|
|
24164
|
+
});
|
|
24165
|
+
const entry = { stamp: current, signal, promise: promise2 };
|
|
24166
|
+
namesLoading = entry;
|
|
24167
|
+
try {
|
|
24168
|
+
return await promise2;
|
|
24169
|
+
} finally {
|
|
24170
|
+
if (namesLoading === entry)
|
|
24171
|
+
namesLoading = null;
|
|
24172
|
+
}
|
|
23742
24173
|
}
|
|
23743
24174
|
return {
|
|
23744
24175
|
async listSources(signal) {
|
|
@@ -23750,31 +24181,45 @@ function createCodexUsageStatistics(environment, options = {}) {
|
|
|
23750
24181
|
return [];
|
|
23751
24182
|
throw error62;
|
|
23752
24183
|
});
|
|
23753
|
-
|
|
23754
|
-
|
|
24184
|
+
entries.sort((a, b) => a.name.localeCompare(b.name));
|
|
24185
|
+
const subdirectories = [];
|
|
24186
|
+
const candidates = [];
|
|
24187
|
+
for (const entry of entries) {
|
|
23755
24188
|
const file2 = path.join(directory, entry.name);
|
|
23756
24189
|
if (entry.isDirectory() && depth < 4)
|
|
23757
|
-
|
|
24190
|
+
subdirectories.push(file2);
|
|
23758
24191
|
if (!entry.isFile())
|
|
23759
24192
|
continue;
|
|
23760
24193
|
const thread2 = ROLLOUT.exec(entry.name)?.[1];
|
|
23761
24194
|
if (!thread2 || options.sessionId && thread2 !== options.sessionId)
|
|
23762
24195
|
continue;
|
|
24196
|
+
candidates.push({ thread: thread2, file: file2 });
|
|
24197
|
+
}
|
|
24198
|
+
const stamped = await Promise.all(candidates.map(async ({ thread: thread2, file: file2 }) => ({
|
|
24199
|
+
thread: thread2,
|
|
24200
|
+
file: file2,
|
|
24201
|
+
fingerprint: await stamp(file2)
|
|
24202
|
+
})));
|
|
24203
|
+
signal.throwIfAborted();
|
|
24204
|
+
for (const { thread: thread2, file: file2, fingerprint: fileStamp } of stamped) {
|
|
23763
24205
|
const list = found.get(thread2) ?? [];
|
|
23764
|
-
list.push({ file: file2, fingerprint:
|
|
24206
|
+
list.push({ file: file2, fingerprint: fileStamp });
|
|
23765
24207
|
found.set(thread2, list);
|
|
23766
24208
|
}
|
|
24209
|
+
for (const subdirectory of subdirectories)
|
|
24210
|
+
await visit2(subdirectory, depth + 1);
|
|
23767
24211
|
}
|
|
23768
24212
|
await visit2(path.join(home, "sessions"), 0);
|
|
23769
24213
|
await visit2(path.join(home, "archived_sessions"), 0);
|
|
23770
|
-
const
|
|
24214
|
+
const indexNames = options.sessionId ? void 0 : await threadNames(signal);
|
|
23771
24215
|
const result = [];
|
|
23772
24216
|
groups.clear();
|
|
23773
24217
|
for (const [thread2, files] of found) {
|
|
23774
24218
|
files.sort((a, b) => path.basename(a.file).localeCompare(path.basename(b.file)) || a.file.localeCompare(b.file));
|
|
24219
|
+
const named = indexNames?.get(thread2);
|
|
23775
24220
|
const id2 = path.join(home, `usage-thread-${thread2}`);
|
|
23776
|
-
groups.set(id2, { thread: thread2, files });
|
|
23777
|
-
result.push({ id: id2, fingerprint: fingerprint(files,
|
|
24221
|
+
groups.set(id2, { thread: thread2, files, named });
|
|
24222
|
+
result.push({ id: id2, fingerprint: fingerprint(files, named ?? "") });
|
|
23778
24223
|
}
|
|
23779
24224
|
return result;
|
|
23780
24225
|
},
|
|
@@ -23806,10 +24251,16 @@ function createCodexUsageStatistics(environment, options = {}) {
|
|
|
23806
24251
|
kept.push(candidate);
|
|
23807
24252
|
}
|
|
23808
24253
|
const entries = await readCodexRollouts(kept.map(({ file: file2 }) => file2), group.thread, signal, options);
|
|
23809
|
-
|
|
23810
|
-
|
|
24254
|
+
const currentStamps = await Promise.all(group.files.map(({ file: file2 }) => stamp(file2)));
|
|
24255
|
+
for (let i = 0; i < group.files.length; i++) {
|
|
24256
|
+
if (currentStamps[i] !== group.files[i]?.fingerprint) {
|
|
23811
24257
|
throw new HarnessUsageSourceChangedError("Codex rollout changed while reading; refresh to retry");
|
|
24258
|
+
}
|
|
24259
|
+
}
|
|
23812
24260
|
const named = options.sessionId ? void 0 : (await threadNames(signal)).get(group.thread);
|
|
24261
|
+
if (!options.sessionId && named !== group.named) {
|
|
24262
|
+
throw new HarnessUsageSourceChangedError("Codex session index changed while reading; refresh to retry");
|
|
24263
|
+
}
|
|
23813
24264
|
return named ? entries.map((entry) => withUsageSession(entry, {
|
|
23814
24265
|
sessionId: entry.sessionId,
|
|
23815
24266
|
cwd: entry.cwd,
|