@codexhost/cli-win32-arm64 0.25.1 → 0.26.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 +307 -19
- package/app/console-web.js +613 -230
- package/app/desktop-controller.mjs +225 -5
- package/app/host-runtime.mjs +1189 -647
- package/app/plugins/antigravity/plugin.mjs +272 -19
- package/app/plugins/claude-code/plugin.mjs +265 -10
- package/app/plugins/codebuddy/plugin.mjs +224 -5
- package/app/plugins/codex-usage/plugin.mjs +224 -5
- package/app/plugins/copilot/plugin.mjs +224 -5
- package/app/plugins/cursor-cli/plugin.mjs +224 -5
- package/app/plugins/deepseek-harness/plugin.mjs +252 -36
- package/app/plugins/devin/plugin.mjs +224 -5
- package/app/plugins/grok/plugin.mjs +224 -5
- package/app/plugins/hermes/plugin.mjs +268 -20
- package/app/plugins/kimi-code/plugin.mjs +224 -5
- package/app/plugins/kiro-cli/plugin.mjs +224 -5
- package/app/plugins/omp/plugin.mjs +224 -5
- package/app/plugins/opencode/plugin.mjs +225 -9
- package/app/plugins/pi/plugin.mjs +366 -33
- package/app/plugins/qoder/plugin.mjs +224 -5
- package/app/plugins/qoder-cn/plugin.mjs +224 -5
- package/app/plugins/qwen-code/plugin.mjs +224 -5
- package/app/plugins/workbuddy/plugin.mjs +224 -5
- package/app/plugins/zcode/plugin.mjs +224 -5
- package/app/renderer-extension.js +1202 -330
- package/app/web/assets/index-BDWdtbFT.js +203 -0
- package/app/web/assets/index-jLAmV7OU.css +1 -0
- package/app/web/codexhost-settings.js +230 -140
- package/app/web/index.html +2 -2
- package/app/web/plugins/deepseek-ai__dsh-api-remotes/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-api-session-controller/client.js +8 -10
- package/app/web/plugins/deepseek-ai__dsh-api-workspace-controller/client.js +3 -3
- package/app/web/plugins/deepseek-ai__dsh-client-ui-brand-official/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-chat/client.js +74 -74
- package/app/web/plugins/deepseek-ai__dsh-client-ui-codexhost/client.js +74 -74
- package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +96 -96
- 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 +2 -2
- 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.js +9 -9
- package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-files/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-theme/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-tool/client.js +18 -18
- package/app/web/plugins/deepseek-ai__dsh-client-ui-workspace/client.js +132 -11
- package/app/web-modules/server.mjs +71157 -65816
- 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-CTCFIQbU.css +0 -1
- package/app/web/assets/index-DUOvhHbV.js +0 -203
|
@@ -16204,7 +16204,10 @@ var clientWorkspaceSnapshotSchema = external_exports.object({
|
|
|
16204
16204
|
assignments: external_exports.record(external_exports.string(), external_exports.string()),
|
|
16205
16205
|
projectless: external_exports.array(external_exports.string()),
|
|
16206
16206
|
/** Canonical external pin membership; pins/list provides the native merged order. */
|
|
16207
|
-
pinned: external_exports.array(external_exports.string())
|
|
16207
|
+
pinned: external_exports.array(external_exports.string()),
|
|
16208
|
+
/** Projects Desktop placed in each custom section, keyed by the official section ID, in
|
|
16209
|
+
* Desktop's section order. Omitted when no section holds a project. */
|
|
16210
|
+
sectionProjects: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())).optional()
|
|
16208
16211
|
});
|
|
16209
16212
|
var record2 = external_exports.record(external_exports.string(), external_exports.unknown());
|
|
16210
16213
|
var clientChannelCursorSchema = external_exports.object({
|
|
@@ -16397,7 +16400,16 @@ var clientChannelResponseSchema = external_exports.object({
|
|
|
16397
16400
|
var threadCatalogReadParamsSchema = external_exports.object({
|
|
16398
16401
|
includeArchived: external_exports.boolean().optional(),
|
|
16399
16402
|
/** Absent means first page; null means this branch is exhausted. Native cursors only. */
|
|
16400
|
-
officialCursor: external_exports.object({ live: external_exports.string().nullable(), archived: external_exports.string().nullable().optional() }).strict().optional()
|
|
16403
|
+
officialCursor: external_exports.object({ live: external_exports.string().nullable(), archived: external_exports.string().nullable().optional() }).strict().optional(),
|
|
16404
|
+
/**
|
|
16405
|
+
* Keep reading native pages until one holds a Thread in `cwd` but outside every
|
|
16406
|
+
* `excludeCwds` folder, the branch ends, or a page bound is reached. Every row read is
|
|
16407
|
+
* returned, so the native cursors stay contiguous.
|
|
16408
|
+
*/
|
|
16409
|
+
scope: external_exports.object({
|
|
16410
|
+
cwd: external_exports.string().min(1).max(4096),
|
|
16411
|
+
excludeCwds: external_exports.array(external_exports.string().min(1).max(4096)).max(1024)
|
|
16412
|
+
}).strict().optional()
|
|
16401
16413
|
}).strict();
|
|
16402
16414
|
var threadCatalogReadResultSchema = external_exports.object({
|
|
16403
16415
|
threads: external_exports.array(jsonObjectSchema),
|
|
@@ -16663,7 +16675,7 @@ var idleReleaseSettingsSchema = external_exports.strictObject({
|
|
|
16663
16675
|
timeoutMinutes: external_exports.number().int().min(IDLE_RELEASE_TIMEOUT_MINUTES_MIN).max(IDLE_RELEASE_TIMEOUT_MINUTES_MAX)
|
|
16664
16676
|
});
|
|
16665
16677
|
var DEFAULT_IDLE_RELEASE_SETTINGS = Object.freeze({
|
|
16666
|
-
enabled:
|
|
16678
|
+
enabled: true,
|
|
16667
16679
|
timeoutMinutes: 10
|
|
16668
16680
|
});
|
|
16669
16681
|
|
|
@@ -17427,7 +17439,12 @@ var nativeCheckpointRefSchema = nativeCheckpointRefV1Schema;
|
|
|
17427
17439
|
var UPDATE_ERROR_MAX_LENGTH = 500;
|
|
17428
17440
|
var UPDATE_SEMVER_PATTERN = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/u;
|
|
17429
17441
|
var updateSemanticVersionSchema = external_exports.string().regex(UPDATE_SEMVER_PATTERN);
|
|
17430
|
-
var updateInstallationSchema = external_exports.enum([
|
|
17442
|
+
var updateInstallationSchema = external_exports.enum([
|
|
17443
|
+
"npm",
|
|
17444
|
+
"windows-installer",
|
|
17445
|
+
"macos-dmg",
|
|
17446
|
+
"linux-archive"
|
|
17447
|
+
]);
|
|
17431
17448
|
var updatePhaseSchema = external_exports.enum([
|
|
17432
17449
|
"prepared",
|
|
17433
17450
|
"downloading",
|
|
@@ -17556,7 +17573,9 @@ var remoteSshSetupResultSchema = external_exports.object({ state: external_expor
|
|
|
17556
17573
|
var REMOTE_CONTROLLER_REQUEST_MAX_BYTES = 16 * 1024;
|
|
17557
17574
|
var REMOTE_IDENTITY_MAX_LENGTH = 1024;
|
|
17558
17575
|
var identity = external_exports.string().min(1).max(REMOTE_IDENTITY_MAX_LENGTH);
|
|
17559
|
-
var target = {
|
|
17576
|
+
var target = {
|
|
17577
|
+
hostId: identity.regex(/^(?:remote-(?:ssh(?:-|:)|control:)|remote-peer:[a-zA-Z0-9_-]{1,64}$)/u)
|
|
17578
|
+
};
|
|
17560
17579
|
var thread = { ...target, threadId: identity };
|
|
17561
17580
|
var text = external_exports.string().min(1).max(8e3);
|
|
17562
17581
|
var input = { text, requestId: identity };
|
|
@@ -17775,6 +17794,206 @@ var webUiExtensionInstallSchema = external_exports.object({
|
|
|
17775
17794
|
var webUiExtensionEnabledSchema = external_exports.object({ id: webUiExtensionIdSchema, enabled: external_exports.boolean() }).strict();
|
|
17776
17795
|
var webUiExtensionRemoveSchema = external_exports.object({ id: webUiExtensionIdSchema }).strict();
|
|
17777
17796
|
|
|
17797
|
+
// ../../shared-contracts/dist/remote-peers.js
|
|
17798
|
+
var REMOTE_PEER_ID_PATTERN = /^[a-zA-Z0-9_-]{1,64}$/u;
|
|
17799
|
+
var remotePeerIdSchema = external_exports.string().regex(REMOTE_PEER_ID_PATTERN);
|
|
17800
|
+
var remotePeerHostIdSchema = external_exports.string().regex(/^remote-peer:[a-zA-Z0-9_-]{1,64}$/u);
|
|
17801
|
+
var remotePeerTransportKindSchema = external_exports.enum(["relay", "tailscale", "lan", "custom"]);
|
|
17802
|
+
var REMOTE_PEER_COLORS = [
|
|
17803
|
+
"blue",
|
|
17804
|
+
"purple",
|
|
17805
|
+
"cyan",
|
|
17806
|
+
"green",
|
|
17807
|
+
"amber",
|
|
17808
|
+
"rose",
|
|
17809
|
+
"slate"
|
|
17810
|
+
];
|
|
17811
|
+
var remotePeerColorSchema = external_exports.enum(REMOTE_PEER_COLORS);
|
|
17812
|
+
var REMOTE_PEER_COLOR_SET = new Set(REMOTE_PEER_COLORS);
|
|
17813
|
+
var remotePeerStateSchema = external_exports.enum([
|
|
17814
|
+
"connected",
|
|
17815
|
+
"connecting",
|
|
17816
|
+
"auth-error",
|
|
17817
|
+
"offline",
|
|
17818
|
+
"disabled"
|
|
17819
|
+
]);
|
|
17820
|
+
var remotePeerSummarySchema = external_exports.object({
|
|
17821
|
+
peerId: remotePeerIdSchema,
|
|
17822
|
+
hostId: remotePeerHostIdSchema,
|
|
17823
|
+
name: external_exports.string().min(1).max(120),
|
|
17824
|
+
color: remotePeerColorSchema.optional(),
|
|
17825
|
+
origin: external_exports.string().min(1).max(2048),
|
|
17826
|
+
transportKind: remotePeerTransportKindSchema,
|
|
17827
|
+
encrypted: external_exports.boolean(),
|
|
17828
|
+
enabled: external_exports.boolean(),
|
|
17829
|
+
state: remotePeerStateSchema,
|
|
17830
|
+
latencyMs: external_exports.number().int().nonnegative().optional(),
|
|
17831
|
+
version: external_exports.string().max(128).optional(),
|
|
17832
|
+
platform: external_exports.string().max(64).optional(),
|
|
17833
|
+
hostname: external_exports.string().max(255).optional(),
|
|
17834
|
+
homeDir: external_exports.string().max(4096).optional(),
|
|
17835
|
+
lastError: external_exports.string().max(1e3).optional(),
|
|
17836
|
+
projectCount: external_exports.number().int().nonnegative(),
|
|
17837
|
+
createdAt: external_exports.string(),
|
|
17838
|
+
updatedAt: external_exports.string()
|
|
17839
|
+
});
|
|
17840
|
+
var remotePeerListResultSchema = external_exports.object({
|
|
17841
|
+
peers: external_exports.array(remotePeerSummarySchema)
|
|
17842
|
+
});
|
|
17843
|
+
var remotePeerAddParamsSchema = external_exports.object({
|
|
17844
|
+
connectionUrl: external_exports.string().min(1).max(4096).optional(),
|
|
17845
|
+
origin: external_exports.string().min(1).max(2048).optional(),
|
|
17846
|
+
token: external_exports.string().min(1).max(2048).optional(),
|
|
17847
|
+
name: external_exports.string().trim().min(1).max(120).optional(),
|
|
17848
|
+
color: remotePeerColorSchema.optional()
|
|
17849
|
+
}).refine((input2) => Boolean(input2.connectionUrl) || Boolean(input2.origin) && Boolean(input2.token), "Provide either connectionUrl or both origin and token");
|
|
17850
|
+
var remotePeerUpdateParamsSchema = external_exports.object({
|
|
17851
|
+
peerId: remotePeerIdSchema,
|
|
17852
|
+
name: external_exports.string().trim().min(1).max(120).optional(),
|
|
17853
|
+
color: remotePeerColorSchema.nullable().optional(),
|
|
17854
|
+
connectionUrl: external_exports.string().min(1).max(4096).optional(),
|
|
17855
|
+
origin: external_exports.string().min(1).max(2048).optional(),
|
|
17856
|
+
token: external_exports.string().min(1).max(2048).optional(),
|
|
17857
|
+
enabled: external_exports.boolean().optional()
|
|
17858
|
+
});
|
|
17859
|
+
var remotePeerIdParamsSchema = external_exports.object({
|
|
17860
|
+
peerId: remotePeerIdSchema
|
|
17861
|
+
});
|
|
17862
|
+
var remotePeerRemoveResultSchema = external_exports.object({
|
|
17863
|
+
removed: external_exports.boolean()
|
|
17864
|
+
});
|
|
17865
|
+
var remotePeerTestParamsSchema = external_exports.object({
|
|
17866
|
+
peerId: remotePeerIdSchema.optional(),
|
|
17867
|
+
connectionUrl: external_exports.string().min(1).max(4096).optional(),
|
|
17868
|
+
origin: external_exports.string().min(1).max(2048).optional(),
|
|
17869
|
+
token: external_exports.string().min(1).max(2048).optional()
|
|
17870
|
+
}).refine((input2) => Boolean(input2.peerId) || Boolean(input2.connectionUrl) || Boolean(input2.origin) && Boolean(input2.token), "Provide peerId, connectionUrl, or both origin and token");
|
|
17871
|
+
var remotePeerTestProjectSchema = external_exports.object({
|
|
17872
|
+
id: external_exports.string().min(1).max(1024),
|
|
17873
|
+
name: external_exports.string().min(1).max(512),
|
|
17874
|
+
path: external_exports.string().min(1).max(8192)
|
|
17875
|
+
});
|
|
17876
|
+
var remotePeerTestResultSchema = external_exports.object({
|
|
17877
|
+
ok: external_exports.boolean(),
|
|
17878
|
+
latencyMs: external_exports.number().int().nonnegative().optional(),
|
|
17879
|
+
origin: external_exports.string().max(2048).optional(),
|
|
17880
|
+
transportKind: remotePeerTransportKindSchema.optional(),
|
|
17881
|
+
encrypted: external_exports.boolean().optional(),
|
|
17882
|
+
version: external_exports.string().max(128).optional(),
|
|
17883
|
+
platform: external_exports.string().max(64).optional(),
|
|
17884
|
+
hostname: external_exports.string().max(255).optional(),
|
|
17885
|
+
homeDir: external_exports.string().max(4096).optional(),
|
|
17886
|
+
projectCount: external_exports.number().int().nonnegative().optional(),
|
|
17887
|
+
projects: external_exports.array(remotePeerTestProjectSchema).optional(),
|
|
17888
|
+
error: external_exports.string().max(1e3).optional()
|
|
17889
|
+
});
|
|
17890
|
+
var remotePeerManifestProjectSchema = external_exports.object({
|
|
17891
|
+
id: external_exports.string().min(1).max(1024),
|
|
17892
|
+
name: external_exports.string().min(1).max(512),
|
|
17893
|
+
path: external_exports.string().min(1).max(8192),
|
|
17894
|
+
threadIds: external_exports.array(external_exports.string().min(1).max(1024))
|
|
17895
|
+
});
|
|
17896
|
+
var remotePeerCapabilitiesSchema = external_exports.object({
|
|
17897
|
+
/** /api/peer/v1/uploads, /api/peer/v1/prompt, and /api/peer/v1/file are all available. */
|
|
17898
|
+
attachments: external_exports.literal(1).optional(),
|
|
17899
|
+
/** /api/peer/v1/workspace-files/rpc and /api/peer/v1/workspace-files/download are available. */
|
|
17900
|
+
workspaceFiles: external_exports.literal(1).optional(),
|
|
17901
|
+
/** Peer supports officeToPdf/render over /api/peer/v1/workspace-files/rpc. */
|
|
17902
|
+
officePreview: external_exports.literal(1).optional()
|
|
17903
|
+
});
|
|
17904
|
+
var remotePeerManifestSchema = external_exports.object({
|
|
17905
|
+
version: external_exports.string().max(128),
|
|
17906
|
+
platform: external_exports.string().max(64),
|
|
17907
|
+
hostname: external_exports.string().max(255),
|
|
17908
|
+
homeDir: external_exports.string().max(4096).optional(),
|
|
17909
|
+
epoch: external_exports.string().min(1).max(256),
|
|
17910
|
+
projects: external_exports.array(remotePeerManifestProjectSchema),
|
|
17911
|
+
capabilities: remotePeerCapabilitiesSchema.optional()
|
|
17912
|
+
});
|
|
17913
|
+
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;
|
|
17914
|
+
var remotePeerPromptParamsSchema = external_exports.strictObject({
|
|
17915
|
+
threadId: external_exports.string().min(1).max(1024),
|
|
17916
|
+
scope: external_exports.string().regex(REMOTE_PEER_UPLOAD_SCOPE_PATTERN).optional(),
|
|
17917
|
+
requestId: external_exports.string().min(1).max(256).optional(),
|
|
17918
|
+
mode: external_exports.enum(["queue", "steer"]).optional(),
|
|
17919
|
+
expectedTurnId: external_exports.string().min(1).max(1024).nullable().optional(),
|
|
17920
|
+
content: external_exports.array(external_exports.discriminatedUnion("type", [
|
|
17921
|
+
external_exports.strictObject({ type: external_exports.literal("text"), text: external_exports.string() }),
|
|
17922
|
+
external_exports.strictObject({ type: external_exports.literal("file"), receiptId: external_exports.string().min(1).max(128) })
|
|
17923
|
+
])).min(1).max(64)
|
|
17924
|
+
});
|
|
17925
|
+
var remotePeerErrorEnvelopeSchema = external_exports.object({
|
|
17926
|
+
ok: external_exports.literal(false),
|
|
17927
|
+
error: external_exports.object({
|
|
17928
|
+
code: external_exports.string(),
|
|
17929
|
+
message: external_exports.string(),
|
|
17930
|
+
details: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
|
|
17931
|
+
})
|
|
17932
|
+
});
|
|
17933
|
+
var remotePeerUploadResultSchema = external_exports.union([
|
|
17934
|
+
external_exports.object({
|
|
17935
|
+
ok: external_exports.literal(true),
|
|
17936
|
+
value: external_exports.object({
|
|
17937
|
+
receiptId: external_exports.string().min(1),
|
|
17938
|
+
file: external_exports.object({
|
|
17939
|
+
attachmentId: external_exports.string(),
|
|
17940
|
+
name: external_exports.string(),
|
|
17941
|
+
bytes: external_exports.number().int().nonnegative()
|
|
17942
|
+
})
|
|
17943
|
+
})
|
|
17944
|
+
}),
|
|
17945
|
+
remotePeerErrorEnvelopeSchema
|
|
17946
|
+
]);
|
|
17947
|
+
var remotePeerPromptResultSchema = external_exports.union([
|
|
17948
|
+
external_exports.object({
|
|
17949
|
+
ok: external_exports.literal(true),
|
|
17950
|
+
value: external_exports.object({ accepted: external_exports.literal(true) })
|
|
17951
|
+
}),
|
|
17952
|
+
remotePeerErrorEnvelopeSchema
|
|
17953
|
+
]);
|
|
17954
|
+
var remotePeerDirectoryEntrySchema = external_exports.object({
|
|
17955
|
+
name: external_exports.string().min(1).max(512),
|
|
17956
|
+
path: external_exports.string().min(1).max(8192),
|
|
17957
|
+
kind: external_exports.literal("directory")
|
|
17958
|
+
});
|
|
17959
|
+
var remotePeerListDirsParamsSchema = external_exports.object({
|
|
17960
|
+
peerId: remotePeerIdSchema,
|
|
17961
|
+
path: external_exports.string().min(1).max(8192).optional()
|
|
17962
|
+
});
|
|
17963
|
+
var remotePeerListDirsResultSchema = external_exports.object({
|
|
17964
|
+
path: external_exports.string().min(1).max(8192),
|
|
17965
|
+
parentPath: external_exports.string().min(1).max(8192).nullable(),
|
|
17966
|
+
homeDir: external_exports.string().min(1).max(8192).optional(),
|
|
17967
|
+
entries: external_exports.array(remotePeerDirectoryEntrySchema)
|
|
17968
|
+
});
|
|
17969
|
+
var remotePeerCreateDirParamsSchema = external_exports.object({
|
|
17970
|
+
peerId: remotePeerIdSchema,
|
|
17971
|
+
parentPath: external_exports.string().min(1).max(8192),
|
|
17972
|
+
name: external_exports.string().min(1).max(255).refine((value) => value.trim().length > 0, "Directory name cannot be blank")
|
|
17973
|
+
});
|
|
17974
|
+
var remotePeerCreateDirResultSchema = external_exports.object({
|
|
17975
|
+
path: external_exports.string().min(1).max(8192),
|
|
17976
|
+
name: external_exports.string().min(1).max(255)
|
|
17977
|
+
});
|
|
17978
|
+
var remotePeerCreateWorkspaceParamsSchema = external_exports.object({
|
|
17979
|
+
peerId: remotePeerIdSchema,
|
|
17980
|
+
path: external_exports.string().min(1).max(8192),
|
|
17981
|
+
title: external_exports.string().trim().min(1).max(255).optional()
|
|
17982
|
+
});
|
|
17983
|
+
var remotePeerRenameWorkspaceParamsSchema = external_exports.object({
|
|
17984
|
+
peerId: remotePeerIdSchema,
|
|
17985
|
+
workspaceId: external_exports.string().min(1).max(1024),
|
|
17986
|
+
title: external_exports.string().trim().min(1).max(255)
|
|
17987
|
+
});
|
|
17988
|
+
var remotePeerDeleteWorkspaceParamsSchema = external_exports.object({
|
|
17989
|
+
peerId: remotePeerIdSchema,
|
|
17990
|
+
workspaceId: external_exports.string().min(1).max(1024)
|
|
17991
|
+
});
|
|
17992
|
+
var remotePeerWorkspaceMutationResultSchema = external_exports.object({
|
|
17993
|
+
workspaceId: external_exports.string().min(1).max(1024).optional(),
|
|
17994
|
+
manifest: remotePeerManifestSchema
|
|
17995
|
+
});
|
|
17996
|
+
|
|
17778
17997
|
// ../../shared-contracts/dist/index.js
|
|
17779
17998
|
var workspaceContractVersionSchema = external_exports.literal(WORKSPACE_CONTRACT_VERSION);
|
|
17780
17999
|
|
|
@@ -22478,6 +22697,7 @@ var READ_ONLY_COMMANDS = /* @__PURE__ */ new Set([
|
|
|
22478
22697
|
"get_available_thinking_levels"
|
|
22479
22698
|
]);
|
|
22480
22699
|
var MAX_EXPIRED_IDS = 64;
|
|
22700
|
+
var CANCELLATION_RECOVERY_TIMEOUT_MS = 6e4;
|
|
22481
22701
|
function nativeMessageIdentity(active2) {
|
|
22482
22702
|
return active2.assistantNativeMessageIdentity ? { nativeMessageIdentity: active2.assistantNativeMessageIdentity } : {};
|
|
22483
22703
|
}
|
|
@@ -22723,11 +22943,12 @@ var PiRpcSession = class {
|
|
|
22723
22943
|
// Pieces of the unterminated frame; joined once at its newline so a large frame (a long
|
|
22724
22944
|
// Session's get_entries) costs linear rather than quadratic copying on the Host event loop.
|
|
22725
22945
|
#buffer = [];
|
|
22726
|
-
// Ids whose read-only command timed out
|
|
22946
|
+
// Ids whose read-only command timed out or whose Turn was abandoned.
|
|
22727
22947
|
#expired = /* @__PURE__ */ new Set();
|
|
22728
22948
|
#child = null;
|
|
22729
22949
|
#closed = false;
|
|
22730
22950
|
#closePromise = null;
|
|
22951
|
+
#cancellationRecovery = null;
|
|
22731
22952
|
#compactionActive = false;
|
|
22732
22953
|
#compactionTurn = null;
|
|
22733
22954
|
#failed = false;
|
|
@@ -22776,7 +22997,14 @@ var PiRpcSession = class {
|
|
|
22776
22997
|
return this.#stderrTail;
|
|
22777
22998
|
}
|
|
22778
22999
|
get isBusy() {
|
|
22779
|
-
return this.#activeTurn !== null || this.#manualCompaction !== null || this.#compactionActive || this.#deferredRunFrames.length > 0;
|
|
23000
|
+
return this.#activeTurn !== null || this.#cancellationRecovery !== null || this.#manualCompaction !== null || this.#compactionActive || this.#deferredRunFrames.length > 0 || this.#hasPendingCommand(["steer"]);
|
|
23001
|
+
}
|
|
23002
|
+
#hasPendingCommand(commands) {
|
|
23003
|
+
for (const pending of this.#pending.values()) {
|
|
23004
|
+
if (commands.includes(pending.command))
|
|
23005
|
+
return true;
|
|
23006
|
+
}
|
|
23007
|
+
return false;
|
|
22780
23008
|
}
|
|
22781
23009
|
setSubagentStatusHandler(handler) {
|
|
22782
23010
|
this.#subagents.setHandler(handler);
|
|
@@ -22923,7 +23151,7 @@ var PiRpcSession = class {
|
|
|
22923
23151
|
if (!this.#child || !this.#state || this.#closed || this.#failed) {
|
|
22924
23152
|
throw new Error("Pi RPC Session is unavailable");
|
|
22925
23153
|
}
|
|
22926
|
-
if (this.#activeTurn || this.#manualCompaction || this.#compactionActive) {
|
|
23154
|
+
if (this.#activeTurn || this.#cancellationRecovery || this.#manualCompaction || this.#compactionActive || this.#hasPendingCommand(["steer"])) {
|
|
22927
23155
|
throw new Error("Pi RPC Session already has an active operation");
|
|
22928
23156
|
}
|
|
22929
23157
|
const result = new Promise((resolve, reject) => {
|
|
@@ -23128,11 +23356,14 @@ var PiRpcSession = class {
|
|
|
23128
23356
|
abortPromise: null
|
|
23129
23357
|
};
|
|
23130
23358
|
});
|
|
23359
|
+
const active2 = this.#activeTurn;
|
|
23131
23360
|
try {
|
|
23132
23361
|
this.#drainProgress(onEvent);
|
|
23133
23362
|
await this.#send("prompt", { message: text5 });
|
|
23134
23363
|
} catch (error51) {
|
|
23135
|
-
this.#
|
|
23364
|
+
if (this.#activeTurn === active2) {
|
|
23365
|
+
this.#rejectActiveTurn(error51 instanceof Error ? error51 : new Error(message2(error51)));
|
|
23366
|
+
}
|
|
23136
23367
|
}
|
|
23137
23368
|
return settled;
|
|
23138
23369
|
}
|
|
@@ -23183,11 +23414,13 @@ var PiRpcSession = class {
|
|
|
23183
23414
|
active2.cancellation = "accepted";
|
|
23184
23415
|
this.#finishSettledTurn(active2);
|
|
23185
23416
|
}).catch((error51) => {
|
|
23186
|
-
if (this.#activeTurn !== active2)
|
|
23417
|
+
if (this.#activeTurn !== active2) {
|
|
23418
|
+
if (active2.cancellation === "abandoned")
|
|
23419
|
+
return;
|
|
23187
23420
|
throw error51;
|
|
23421
|
+
}
|
|
23188
23422
|
const fault = error51 instanceof PiRpcFaultError ? error51 : new PiRpcFaultError("protocolError", `Pi RPC Abort failed: ${message2(error51)}`);
|
|
23189
23423
|
this.#terminateFailedCancellation(active2, fault);
|
|
23190
|
-
throw fault;
|
|
23191
23424
|
});
|
|
23192
23425
|
active2.abortPromise = aborting;
|
|
23193
23426
|
return aborting;
|
|
@@ -23198,10 +23431,82 @@ var PiRpcSession = class {
|
|
|
23198
23431
|
if (active2.cancellationTimeout)
|
|
23199
23432
|
clearTimeout(active2.cancellationTimeout);
|
|
23200
23433
|
active2.cancellationTimeout = null;
|
|
23201
|
-
this.#
|
|
23202
|
-
|
|
23434
|
+
if (this.#hasPendingCommand(["prompt", "steer"])) {
|
|
23435
|
+
void this.#faultAfterProcessCleanup(fault, "Pi RPC unacknowledged input cleanup failed");
|
|
23436
|
+
return;
|
|
23437
|
+
}
|
|
23438
|
+
active2.cancellation = "abandoned";
|
|
23439
|
+
const recovery = {
|
|
23440
|
+
probe: null,
|
|
23441
|
+
nativeStartGeneration: 0,
|
|
23442
|
+
timer: setTimeout(() => {
|
|
23443
|
+
void this.#expireCancellationRecovery(recovery, fault);
|
|
23444
|
+
}, CANCELLATION_RECOVERY_TIMEOUT_MS).unref()
|
|
23445
|
+
};
|
|
23446
|
+
this.#cancellationRecovery = recovery;
|
|
23447
|
+
this.#activeTurn = null;
|
|
23448
|
+
this.#deferredRunFrames = [];
|
|
23449
|
+
this.#deferredRunBytes = 0;
|
|
23450
|
+
for (const waiter of this.#runWaiters)
|
|
23451
|
+
waiter.reject(fault);
|
|
23452
|
+
for (const [id2, pending] of this.#pending) {
|
|
23453
|
+
if (pending.command !== "abort" && pending.command !== "prompt" && pending.command !== "steer") {
|
|
23454
|
+
continue;
|
|
23455
|
+
}
|
|
23456
|
+
if (pending.timeout)
|
|
23457
|
+
clearTimeout(pending.timeout);
|
|
23458
|
+
this.#pending.delete(id2);
|
|
23459
|
+
this.#rememberExpiredCommand(id2);
|
|
23460
|
+
pending.reject(fault);
|
|
23461
|
+
}
|
|
23462
|
+
if (this.#compactionActive) {
|
|
23463
|
+
this.#compactionActive = false;
|
|
23464
|
+
this.#compactionTurn = null;
|
|
23465
|
+
active2.onEvent({ type: "compaction.completed", outcome: "cancelled" });
|
|
23466
|
+
}
|
|
23467
|
+
this.#closeInteractions(active2, "cancelled");
|
|
23468
|
+
if (active2.origin === "autonomous") {
|
|
23469
|
+
this.#emitAutonomousTurn(active2, {
|
|
23470
|
+
status: "cancelled",
|
|
23471
|
+
text: active2.text,
|
|
23472
|
+
reason: fault.message
|
|
23473
|
+
});
|
|
23474
|
+
} else {
|
|
23475
|
+
active2.resolve({ text: active2.text, cancelled: true });
|
|
23476
|
+
}
|
|
23477
|
+
void this.#probeCancellationRecovery(recovery);
|
|
23478
|
+
}
|
|
23479
|
+
#probeCancellationRecovery(recovery) {
|
|
23480
|
+
const generation = recovery.nativeStartGeneration;
|
|
23481
|
+
recovery.probe ??= this.#send("get_state", {}, void 0, this.#options.closeTimeoutMs).then((response) => {
|
|
23482
|
+
const state2 = sessionStateData(response);
|
|
23483
|
+
if (this.#cancellationRecovery === recovery && recovery.nativeStartGeneration === generation && state2.isStreaming === false && state2.isCompacting === false) {
|
|
23484
|
+
this.#clearCancellationRecovery();
|
|
23485
|
+
}
|
|
23486
|
+
}).catch(() => {
|
|
23487
|
+
}).finally(() => {
|
|
23488
|
+
recovery.probe = null;
|
|
23489
|
+
});
|
|
23490
|
+
return recovery.probe;
|
|
23491
|
+
}
|
|
23492
|
+
async #expireCancellationRecovery(recovery, cancellationFault) {
|
|
23493
|
+
await recovery.probe;
|
|
23494
|
+
if (this.#cancellationRecovery !== recovery)
|
|
23495
|
+
return;
|
|
23496
|
+
await this.#probeCancellationRecovery(recovery);
|
|
23497
|
+
if (this.#cancellationRecovery !== recovery)
|
|
23498
|
+
return;
|
|
23499
|
+
const fault = new PiRpcFaultError("protocolError", `Pi RPC Session did not return to confirmed idle after an unconfirmed cancellation: ${cancellationFault.message}`);
|
|
23500
|
+
await this.#faultAfterProcessCleanup(fault, "Pi RPC cancellation recovery cleanup failed");
|
|
23501
|
+
}
|
|
23502
|
+
#clearCancellationRecovery() {
|
|
23503
|
+
if (!this.#cancellationRecovery)
|
|
23504
|
+
return;
|
|
23505
|
+
clearTimeout(this.#cancellationRecovery.timer);
|
|
23506
|
+
this.#cancellationRecovery = null;
|
|
23203
23507
|
}
|
|
23204
23508
|
close() {
|
|
23509
|
+
this.#clearCancellationRecovery();
|
|
23205
23510
|
this.#pendingProgress = [];
|
|
23206
23511
|
this.#omittedProgress = 0;
|
|
23207
23512
|
this.#seenNoticeFrames.clear();
|
|
@@ -23271,6 +23576,25 @@ var PiRpcSession = class {
|
|
|
23271
23576
|
}
|
|
23272
23577
|
if (this.#subagents.handle(value))
|
|
23273
23578
|
return;
|
|
23579
|
+
const recovery = this.#cancellationRecovery;
|
|
23580
|
+
if (recovery) {
|
|
23581
|
+
if (this.#handleGotgenesWidget(value))
|
|
23582
|
+
return;
|
|
23583
|
+
if (this.#handleProgress(value))
|
|
23584
|
+
return;
|
|
23585
|
+
this.#observeUsage(value);
|
|
23586
|
+
if (value.type === "agent_start" || value.type === "compaction_start") {
|
|
23587
|
+
recovery.nativeStartGeneration += 1;
|
|
23588
|
+
}
|
|
23589
|
+
if (value.type === "agent_settled" || value.type === "compaction_end") {
|
|
23590
|
+
void Promise.resolve(recovery.probe).then(() => {
|
|
23591
|
+
if (this.#cancellationRecovery === recovery) {
|
|
23592
|
+
return this.#probeCancellationRecovery(recovery);
|
|
23593
|
+
}
|
|
23594
|
+
});
|
|
23595
|
+
}
|
|
23596
|
+
return;
|
|
23597
|
+
}
|
|
23274
23598
|
const settling = this.#activeTurn;
|
|
23275
23599
|
if (settling && settling.settlement !== "pending" && generation > settling.runGeneration) {
|
|
23276
23600
|
this.#deferredRunBytes += Buffer.byteLength(JSON.stringify(value));
|
|
@@ -23288,14 +23612,8 @@ var PiRpcSession = class {
|
|
|
23288
23612
|
this.#startAutonomousTurn(void 0, generation);
|
|
23289
23613
|
return;
|
|
23290
23614
|
}
|
|
23291
|
-
if (value
|
|
23292
|
-
const records = parseGotgenesWidget(value);
|
|
23293
|
-
if (records) {
|
|
23294
|
-
this.#gotgenesLatest = records;
|
|
23295
|
-
this.#gotgenesHandler?.(records, this.#activeTurn?.origin ?? "idle");
|
|
23296
|
-
}
|
|
23615
|
+
if (this.#handleGotgenesWidget(value))
|
|
23297
23616
|
return;
|
|
23298
|
-
}
|
|
23299
23617
|
if (this.#handleProgress(value))
|
|
23300
23618
|
return;
|
|
23301
23619
|
this.#observeUsage(value);
|
|
@@ -23455,6 +23773,17 @@ var PiRpcSession = class {
|
|
|
23455
23773
|
this.#drainProgress(active2.onEvent);
|
|
23456
23774
|
return active2;
|
|
23457
23775
|
}
|
|
23776
|
+
#handleGotgenesWidget(value) {
|
|
23777
|
+
if (value.type !== "extension_ui_request" || value.method !== "setWidget" || value.widgetKey !== GOTGENES_WIDGET) {
|
|
23778
|
+
return false;
|
|
23779
|
+
}
|
|
23780
|
+
const records = parseGotgenesWidget(value);
|
|
23781
|
+
if (records) {
|
|
23782
|
+
this.#gotgenesLatest = records;
|
|
23783
|
+
this.#gotgenesHandler?.(records, this.#activeTurn?.origin ?? "idle");
|
|
23784
|
+
}
|
|
23785
|
+
return true;
|
|
23786
|
+
}
|
|
23458
23787
|
#handleProgress(value) {
|
|
23459
23788
|
if ((value.type === "message_start" || value.type === "message_end") && isRecord9(value.message) && value.message.role === "custom") {
|
|
23460
23789
|
if (value.type !== "message_end" || !this.#state)
|
|
@@ -23928,7 +24257,7 @@ var PiRpcSession = class {
|
|
|
23928
24257
|
child.stdin.write(frame, (error51) => error51 ? reject(error51) : resolve());
|
|
23929
24258
|
});
|
|
23930
24259
|
}
|
|
23931
|
-
#send(type, payload, onResponse) {
|
|
24260
|
+
#send(type, payload, onResponse, timeoutMs = this.#options.commandTimeoutMs) {
|
|
23932
24261
|
const child = this.#child;
|
|
23933
24262
|
if (!child?.stdin.writable || this.#closed || this.#failed) {
|
|
23934
24263
|
return Promise.reject(new Error("Pi RPC stdin is unavailable"));
|
|
@@ -23945,7 +24274,7 @@ var PiRpcSession = class {
|
|
|
23945
24274
|
timeout: null
|
|
23946
24275
|
};
|
|
23947
24276
|
this.#pending.set(id2, pending);
|
|
23948
|
-
this.#armCommandTimeout(id2, pending);
|
|
24277
|
+
this.#armCommandTimeout(id2, pending, timeoutMs);
|
|
23949
24278
|
const frame = Buffer.from(`${JSON.stringify({ id: id2, type, ...payload })}
|
|
23950
24279
|
`, "utf8");
|
|
23951
24280
|
child.stdin.write(frame, (error51) => {
|
|
@@ -23958,7 +24287,7 @@ var PiRpcSession = class {
|
|
|
23958
24287
|
});
|
|
23959
24288
|
});
|
|
23960
24289
|
}
|
|
23961
|
-
#armCommandTimeout(id2, pending) {
|
|
24290
|
+
#armCommandTimeout(id2, pending, timeoutMs = this.#options.commandTimeoutMs) {
|
|
23962
24291
|
if (pending.timeout || this.#pending.get(id2) !== pending || (pending.command === "prompt" || pending.command === "compact") && this.#compactionActive) {
|
|
23963
24292
|
return;
|
|
23964
24293
|
}
|
|
@@ -23967,22 +24296,25 @@ var PiRpcSession = class {
|
|
|
23967
24296
|
return;
|
|
23968
24297
|
pending.timeout = null;
|
|
23969
24298
|
const error51 = new Error(`Pi RPC '${pending.command}' command timed out`);
|
|
23970
|
-
if (pending.command !== "prompt") {
|
|
24299
|
+
if (pending.command !== "prompt" && pending.command !== "steer") {
|
|
23971
24300
|
this.#pending.delete(id2);
|
|
23972
|
-
if (READ_ONLY_COMMANDS.has(pending.command)) {
|
|
23973
|
-
this.#
|
|
23974
|
-
if (this.#expired.size > MAX_EXPIRED_IDS) {
|
|
23975
|
-
this.#expired.delete(this.#expired.values().next().value);
|
|
23976
|
-
}
|
|
24301
|
+
if (READ_ONLY_COMMANDS.has(pending.command) || pending.command === "abort") {
|
|
24302
|
+
this.#rememberExpiredCommand(id2);
|
|
23977
24303
|
}
|
|
23978
24304
|
pending.reject(error51);
|
|
23979
24305
|
return;
|
|
23980
24306
|
}
|
|
23981
24307
|
const fault = new PiRpcFaultError("protocolError", error51.message);
|
|
23982
|
-
void this.#
|
|
23983
|
-
},
|
|
24308
|
+
void this.#faultAfterProcessCleanup(fault, pending.command === "steer" ? "Pi RPC timed-out Steer cleanup failed" : "Pi RPC timed-out Prompt cleanup failed");
|
|
24309
|
+
}, timeoutMs);
|
|
24310
|
+
}
|
|
24311
|
+
#rememberExpiredCommand(id2) {
|
|
24312
|
+
this.#expired.add(id2);
|
|
24313
|
+
if (this.#expired.size > MAX_EXPIRED_IDS) {
|
|
24314
|
+
this.#expired.delete(this.#expired.values().next().value);
|
|
24315
|
+
}
|
|
23984
24316
|
}
|
|
23985
|
-
async #
|
|
24317
|
+
async #faultAfterProcessCleanup(fault, context) {
|
|
23986
24318
|
if (this.#closed || this.#failed)
|
|
23987
24319
|
return;
|
|
23988
24320
|
this.#failed = true;
|
|
@@ -23996,7 +24328,7 @@ var PiRpcSession = class {
|
|
|
23996
24328
|
try {
|
|
23997
24329
|
await this.close();
|
|
23998
24330
|
} catch (error51) {
|
|
23999
|
-
finalFault = new PiRpcFaultError("processExited",
|
|
24331
|
+
finalFault = new PiRpcFaultError("processExited", `${context}: ${message2(error51)}`);
|
|
24000
24332
|
}
|
|
24001
24333
|
this.#rejectAll(finalFault);
|
|
24002
24334
|
this.#options.onFault?.(finalFault);
|
|
@@ -24051,6 +24383,7 @@ var PiRpcSession = class {
|
|
|
24051
24383
|
if (this.#closed || this.#failed)
|
|
24052
24384
|
return;
|
|
24053
24385
|
this.#failed = true;
|
|
24386
|
+
this.#clearCancellationRecovery();
|
|
24054
24387
|
this.#rejectAll(error51);
|
|
24055
24388
|
this.#options.onFault?.(error51);
|
|
24056
24389
|
}
|