@codexhost/cli-win32-arm64 0.27.0 → 0.28.1
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 +369 -163
- package/app/console-web.js +223 -9
- package/app/desktop-controller.mjs +105 -4
- package/app/host-runtime.mjs +1938 -1024
- package/app/plugins/antigravity/plugin.mjs +390 -135
- package/app/plugins/claude-code/plugin.mjs +383 -32
- package/app/plugins/codebuddy/plugin.mjs +213 -30
- package/app/plugins/codex-usage/plugin.mjs +370 -52
- package/app/plugins/copilot/plugin.mjs +105 -4
- package/app/plugins/cursor-cli/plugin.mjs +126 -4
- package/app/plugins/deepseek-harness/plugin.mjs +107 -4
- package/app/plugins/devin/plugin.mjs +106 -4
- package/app/plugins/grok/plugin.mjs +186 -25
- package/app/plugins/hermes/plugin.mjs +107 -4
- package/app/plugins/kimi-code/plugin.mjs +105 -4
- package/app/plugins/kiro-cli/plugin.mjs +105 -4
- package/app/plugins/omp/plugin.mjs +261 -45
- package/app/plugins/opencode/plugin.mjs +107 -4
- package/app/plugins/pi/plugin.mjs +312 -48
- package/app/plugins/qoder/plugin.mjs +179 -18
- package/app/plugins/qoder-cn/plugin.mjs +179 -18
- package/app/plugins/qwen-code/plugin.mjs +105 -4
- package/app/plugins/workbuddy/plugin.mjs +213 -30
- package/app/plugins/zcode/plugin.mjs +225 -85
- package/app/renderer-extension.js +11973 -11468
- package/app/web/assets/index-BJq8mT6r.js +204 -0
- package/app/web/assets/index-CMDliP5b.css +1 -0
- package/app/web/codexhost-settings.js +110 -49
- 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-ui-chat/client.js +75 -75
- package/app/web/plugins/deepseek-ai__dsh-client-ui-codexhost/client.js +72 -72
- package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +14 -14
- 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-sidebar-documentpreview/client.pdf.js +2 -2
- 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 +7 -7
- package/app/web-modules/server.mjs +2494 -1132
- 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-D9l7_ThH.js +0 -199
- package/app/web/assets/index-nw2RXcDu.css +0 -1
|
@@ -20126,11 +20126,21 @@ var harnessThinkingOptionsSchema = external_exports.array(harnessThinkingOptionS
|
|
|
20126
20126
|
ids.add(option.id);
|
|
20127
20127
|
}
|
|
20128
20128
|
});
|
|
20129
|
+
var harnessThinkingOptionsScopeSchema = external_exports.enum(["catalog", "activeModel"]);
|
|
20129
20130
|
var harnessModelCatalogSchema = external_exports.object({
|
|
20130
20131
|
models: external_exports.array(harnessModelSchema),
|
|
20131
20132
|
defaultModel: harnessModelRefSchema.optional(),
|
|
20132
20133
|
thinkingOptions: harnessThinkingOptionsSchema,
|
|
20133
|
-
defaultThinkingOptionId: harnessThinkingOptionIdSchema.optional()
|
|
20134
|
+
defaultThinkingOptionId: harnessThinkingOptionIdSchema.optional(),
|
|
20135
|
+
/**
|
|
20136
|
+
* Scope of per-Model `supportedThinkingOptionIds` in this catalog.
|
|
20137
|
+
* Omitted or `"catalog"` means each Model's `supportedThinkingOptionIds`
|
|
20138
|
+
* reflects its own options (omitted or `[]` means none).
|
|
20139
|
+
* `"activeModel"` means only the active Model's Thinking options were
|
|
20140
|
+
* observed; other Models omit `supportedThinkingOptionIds` and must be
|
|
20141
|
+
* validated by the Adapter after selecting the Model.
|
|
20142
|
+
*/
|
|
20143
|
+
thinkingOptionsScope: harnessThinkingOptionsScopeSchema.optional()
|
|
20134
20144
|
}).strict().superRefine((catalog, context) => {
|
|
20135
20145
|
const refs = [];
|
|
20136
20146
|
const thinkingIds = new Set(catalog.thinkingOptions.map(({ id: id2 }) => id2));
|
|
@@ -21044,7 +21054,12 @@ var clientProjectlessWorkspaceSchema = external_exports.object({
|
|
|
21044
21054
|
prompt: external_exports.string().max(16384).optional()
|
|
21045
21055
|
}).strict();
|
|
21046
21056
|
var clientWorkspaceSnapshotSchema = external_exports.object({
|
|
21047
|
-
projects: external_exports.array(external_exports.object({
|
|
21057
|
+
projects: external_exports.array(external_exports.object({
|
|
21058
|
+
id: external_exports.string(),
|
|
21059
|
+
name: external_exports.string(),
|
|
21060
|
+
rootPaths: external_exports.array(external_exports.string()),
|
|
21061
|
+
createdAt: external_exports.number().int().optional()
|
|
21062
|
+
})),
|
|
21048
21063
|
nativeProjects: external_exports.literal(true).optional(),
|
|
21049
21064
|
assignments: external_exports.record(external_exports.string(), external_exports.string()),
|
|
21050
21065
|
projectless: external_exports.array(external_exports.string()),
|
|
@@ -21457,6 +21472,7 @@ var delegationReadParamsSchema = external_exports.strictObject({
|
|
|
21457
21472
|
// ../../shared-contracts/dist/remote-peers.js
|
|
21458
21473
|
var REMOTE_PEER_ID_PATTERN = /^[a-zA-Z0-9_-]{1,64}$/u;
|
|
21459
21474
|
var remotePeerIdSchema = external_exports.string().regex(REMOTE_PEER_ID_PATTERN);
|
|
21475
|
+
var remotePeerNodeIdSchema = external_exports.string().regex(REMOTE_PEER_ID_PATTERN);
|
|
21460
21476
|
var remotePeerHostIdSchema = external_exports.string().regex(/^remote-peer:[a-zA-Z0-9_-]{1,64}$/u);
|
|
21461
21477
|
var remotePeerTransportKindSchema = external_exports.enum(["relay", "tailscale", "lan", "custom"]);
|
|
21462
21478
|
var REMOTE_PEER_COLORS = [
|
|
@@ -21480,6 +21496,7 @@ var remotePeerStateSchema = external_exports.enum([
|
|
|
21480
21496
|
var remotePeerSummarySchema = external_exports.object({
|
|
21481
21497
|
peerId: remotePeerIdSchema,
|
|
21482
21498
|
hostId: remotePeerHostIdSchema,
|
|
21499
|
+
nodeId: remotePeerNodeIdSchema.optional(),
|
|
21483
21500
|
name: external_exports.string().min(1).max(120),
|
|
21484
21501
|
color: remotePeerColorSchema.optional(),
|
|
21485
21502
|
origin: external_exports.string().min(1).max(2048),
|
|
@@ -21487,6 +21504,11 @@ var remotePeerSummarySchema = external_exports.object({
|
|
|
21487
21504
|
encrypted: external_exports.boolean(),
|
|
21488
21505
|
enabled: external_exports.boolean(),
|
|
21489
21506
|
state: remotePeerStateSchema,
|
|
21507
|
+
supportsPeerPairing: external_exports.boolean().optional(),
|
|
21508
|
+
/** Omitted when either side's node mapping is unknown. */
|
|
21509
|
+
pairedBack: external_exports.boolean().optional(),
|
|
21510
|
+
/** Other configured remote peerIds on this Hub present in this peer's `manifest.peerNodes`. */
|
|
21511
|
+
linkedPeerIds: external_exports.array(remotePeerIdSchema).max(128).optional(),
|
|
21490
21512
|
latencyMs: external_exports.number().int().nonnegative().optional(),
|
|
21491
21513
|
version: external_exports.string().max(128).optional(),
|
|
21492
21514
|
platform: external_exports.string().max(64).optional(),
|
|
@@ -21505,8 +21527,48 @@ var remotePeerAddParamsSchema = external_exports.object({
|
|
|
21505
21527
|
origin: external_exports.string().min(1).max(2048).optional(),
|
|
21506
21528
|
token: external_exports.string().min(1).max(2048).optional(),
|
|
21507
21529
|
name: external_exports.string().trim().min(1).max(120).optional(),
|
|
21508
|
-
color: remotePeerColorSchema.optional()
|
|
21530
|
+
color: remotePeerColorSchema.optional(),
|
|
21531
|
+
pairBack: external_exports.boolean().optional(),
|
|
21532
|
+
meshPeerIds: external_exports.array(remotePeerIdSchema).max(64).optional(),
|
|
21533
|
+
selfOrigin: external_exports.string().min(1).max(2048).optional()
|
|
21509
21534
|
}).refine((input3) => Boolean(input3.connectionUrl) || Boolean(input3.origin) && Boolean(input3.token), "Provide either connectionUrl or both origin and token");
|
|
21535
|
+
var remotePeerIntroduceParamsSchema = external_exports.strictObject({
|
|
21536
|
+
origin: external_exports.string().min(1).max(2048),
|
|
21537
|
+
token: external_exports.string().min(1).max(2048),
|
|
21538
|
+
name: external_exports.string().trim().min(1).max(120).optional(),
|
|
21539
|
+
color: remotePeerColorSchema.optional(),
|
|
21540
|
+
expectedNodeId: remotePeerNodeIdSchema.optional()
|
|
21541
|
+
});
|
|
21542
|
+
var remotePeerIntroduceResultSchema = external_exports.object({
|
|
21543
|
+
status: external_exports.enum(["added", "updated", "existing"]),
|
|
21544
|
+
peerId: remotePeerIdSchema,
|
|
21545
|
+
hostId: remotePeerHostIdSchema,
|
|
21546
|
+
nodeId: remotePeerNodeIdSchema.optional()
|
|
21547
|
+
});
|
|
21548
|
+
var remotePeerPairingStatusSchema = external_exports.enum([
|
|
21549
|
+
"added",
|
|
21550
|
+
"updated",
|
|
21551
|
+
"existing",
|
|
21552
|
+
"failed",
|
|
21553
|
+
"skipped"
|
|
21554
|
+
]);
|
|
21555
|
+
var remotePeerPairingStepSchema = external_exports.object({
|
|
21556
|
+
targetPeerId: remotePeerIdSchema,
|
|
21557
|
+
targetName: external_exports.string().min(1).max(120),
|
|
21558
|
+
introducedHost: external_exports.union([external_exports.literal("local"), remotePeerIdSchema]),
|
|
21559
|
+
introducedName: external_exports.string().min(1).max(120),
|
|
21560
|
+
status: remotePeerPairingStatusSchema,
|
|
21561
|
+
error: external_exports.string().max(1e3).optional()
|
|
21562
|
+
});
|
|
21563
|
+
var remotePeerPairingReportSchema = external_exports.object({
|
|
21564
|
+
results: external_exports.array(remotePeerPairingStepSchema)
|
|
21565
|
+
});
|
|
21566
|
+
var remotePeerSyncMeshParamsSchema = external_exports.object({
|
|
21567
|
+
peerIds: external_exports.array(remotePeerIdSchema).max(64).optional(),
|
|
21568
|
+
includeSelf: external_exports.boolean().optional(),
|
|
21569
|
+
includeMesh: external_exports.boolean().optional(),
|
|
21570
|
+
selfOrigin: external_exports.string().min(1).max(2048).optional()
|
|
21571
|
+
});
|
|
21510
21572
|
var remotePeerUpdateParamsSchema = external_exports.object({
|
|
21511
21573
|
peerId: remotePeerIdSchema,
|
|
21512
21574
|
name: external_exports.string().trim().min(1).max(120).optional(),
|
|
@@ -21535,6 +21597,9 @@ var remotePeerTestProjectSchema = external_exports.object({
|
|
|
21535
21597
|
});
|
|
21536
21598
|
var remotePeerTestResultSchema = external_exports.object({
|
|
21537
21599
|
ok: external_exports.boolean(),
|
|
21600
|
+
nodeId: remotePeerNodeIdSchema.optional(),
|
|
21601
|
+
supportsPeerPairing: external_exports.boolean().optional(),
|
|
21602
|
+
pairedBack: external_exports.boolean().optional(),
|
|
21538
21603
|
latencyMs: external_exports.number().int().nonnegative().optional(),
|
|
21539
21604
|
origin: external_exports.string().max(2048).optional(),
|
|
21540
21605
|
transportKind: remotePeerTransportKindSchema.optional(),
|
|
@@ -21561,7 +21626,9 @@ var remotePeerCapabilitiesSchema = external_exports.object({
|
|
|
21561
21626
|
/** Peer supports officeToPdf/render over /api/peer/v1/workspace-files/rpc. */
|
|
21562
21627
|
officePreview: external_exports.literal(1).optional(),
|
|
21563
21628
|
/** /api/peer/v1/delegation is available for fixed-whitelist cross-host delegation. */
|
|
21564
|
-
delegation: external_exports.literal(1).optional()
|
|
21629
|
+
delegation: external_exports.literal(1).optional(),
|
|
21630
|
+
/** POST /api/peer/v1/peers is available. */
|
|
21631
|
+
peerPairing: external_exports.literal(1).optional()
|
|
21565
21632
|
});
|
|
21566
21633
|
var remotePeerManifestSchema = external_exports.object({
|
|
21567
21634
|
version: external_exports.string().max(128),
|
|
@@ -21569,6 +21636,8 @@ var remotePeerManifestSchema = external_exports.object({
|
|
|
21569
21636
|
hostname: external_exports.string().max(255),
|
|
21570
21637
|
homeDir: external_exports.string().max(4096).optional(),
|
|
21571
21638
|
epoch: external_exports.string().min(1).max(256),
|
|
21639
|
+
nodeId: remotePeerNodeIdSchema.optional(),
|
|
21640
|
+
peerNodes: external_exports.record(remotePeerHostIdSchema, remotePeerNodeIdSchema).refine((v) => Object.keys(v).length <= 128).optional(),
|
|
21572
21641
|
projects: external_exports.array(remotePeerManifestProjectSchema),
|
|
21573
21642
|
capabilities: remotePeerCapabilitiesSchema.optional()
|
|
21574
21643
|
});
|
|
@@ -21655,6 +21724,29 @@ var remotePeerWorkspaceMutationResultSchema = external_exports.object({
|
|
|
21655
21724
|
workspaceId: external_exports.string().min(1).max(1024).optional(),
|
|
21656
21725
|
manifest: remotePeerManifestSchema
|
|
21657
21726
|
});
|
|
21727
|
+
var delegationRemoteHostsParamsSchema = external_exports.object({
|
|
21728
|
+
sessionHostId: external_exports.string().min(1).max(128).optional()
|
|
21729
|
+
});
|
|
21730
|
+
var delegationRemoteHostOptionSchema = external_exports.object({
|
|
21731
|
+
hostId: external_exports.union([external_exports.literal("local"), remotePeerHostIdSchema]),
|
|
21732
|
+
name: external_exports.string().min(1).max(120),
|
|
21733
|
+
isLocal: external_exports.boolean().optional(),
|
|
21734
|
+
color: remotePeerColorSchema.optional(),
|
|
21735
|
+
hostname: external_exports.string().max(255).optional()
|
|
21736
|
+
});
|
|
21737
|
+
var delegationRemoteHostsResultSchema = external_exports.object({
|
|
21738
|
+
hosts: external_exports.array(delegationRemoteHostOptionSchema)
|
|
21739
|
+
});
|
|
21740
|
+
var delegationHostHarnessesParamsSchema = external_exports.object({
|
|
21741
|
+
hostId: external_exports.union([external_exports.literal("local"), remotePeerHostIdSchema])
|
|
21742
|
+
});
|
|
21743
|
+
var delegationHostHarnessOptionSchema = external_exports.object({
|
|
21744
|
+
id: external_exports.string().regex(/^[a-z0-9][a-z0-9-]*$/u),
|
|
21745
|
+
name: external_exports.string().min(1).max(120)
|
|
21746
|
+
});
|
|
21747
|
+
var delegationHostHarnessesResultSchema = external_exports.object({
|
|
21748
|
+
harnesses: external_exports.array(delegationHostHarnessOptionSchema)
|
|
21749
|
+
});
|
|
21658
21750
|
|
|
21659
21751
|
// ../../shared-contracts/dist/peer-delegation.js
|
|
21660
21752
|
var PEER_DELEGATION_BRIDGE_VERSION = 1;
|
|
@@ -21698,6 +21790,7 @@ var peerDelegationHostProjectSchema = external_exports.strictObject({
|
|
|
21698
21790
|
});
|
|
21699
21791
|
var peerDelegationHostSummarySchema = external_exports.strictObject({
|
|
21700
21792
|
hostId: remotePeerHostIdSchema,
|
|
21793
|
+
nodeId: remotePeerNodeIdSchema.optional(),
|
|
21701
21794
|
displayName: external_exports.string().min(1).max(120),
|
|
21702
21795
|
online: external_exports.boolean(),
|
|
21703
21796
|
state: remotePeerStateSchema,
|
|
@@ -22590,6 +22683,13 @@ var updatePhaseSchema = external_exports.enum([
|
|
|
22590
22683
|
"succeeded",
|
|
22591
22684
|
"failed"
|
|
22592
22685
|
]);
|
|
22686
|
+
var npmDownloadProgressSchema = external_exports.strictObject({
|
|
22687
|
+
completed: external_exports.number().int().nonnegative(),
|
|
22688
|
+
total: external_exports.number().int().positive()
|
|
22689
|
+
}).refine((progress) => progress.completed <= progress.total, {
|
|
22690
|
+
path: ["completed"],
|
|
22691
|
+
message: "completed must not exceed total"
|
|
22692
|
+
});
|
|
22593
22693
|
var updateStatusSchema = external_exports.strictObject({
|
|
22594
22694
|
version: updateSemanticVersionSchema,
|
|
22595
22695
|
installation: updateInstallationSchema,
|
|
@@ -22597,6 +22697,7 @@ var updateStatusSchema = external_exports.strictObject({
|
|
|
22597
22697
|
updatedAt: external_exports.number().int().nonnegative(),
|
|
22598
22698
|
downloadedBytes: external_exports.number().int().nonnegative().optional(),
|
|
22599
22699
|
totalBytes: external_exports.number().int().positive().optional(),
|
|
22700
|
+
npmDownload: npmDownloadProgressSchema.optional(),
|
|
22600
22701
|
error: external_exports.string().min(1).max(UPDATE_ERROR_MAX_LENGTH).nullable(),
|
|
22601
22702
|
serviceStopOutput: external_exports.string().optional()
|
|
22602
22703
|
}).superRefine((status, context) => {
|
|
@@ -23424,6 +23525,7 @@ var harnessBrokerMethodSchema = external_exports.enum([
|
|
|
23424
23525
|
"adapter.open",
|
|
23425
23526
|
"adapter.sessionImport.list",
|
|
23426
23527
|
"adapter.sessionImport.resolve",
|
|
23528
|
+
"adapter.readSnapshot",
|
|
23427
23529
|
"adapter.subagent.readSnapshot",
|
|
23428
23530
|
"session.readSnapshot",
|
|
23429
23531
|
"session.readCapabilities",
|
|
@@ -23685,6 +23787,11 @@ var sessionExecuteParamsSchema = sessionParamsSchema.extend({
|
|
|
23685
23787
|
var sessionCommandExecuteParamsSchema = sessionParamsSchema.extend({
|
|
23686
23788
|
command: brokerCommandInvocationSchema
|
|
23687
23789
|
});
|
|
23790
|
+
var adapterReadSnapshotSchema = external_exports.object({
|
|
23791
|
+
nativeRef: nativeSessionRefSchema,
|
|
23792
|
+
cwd: cwdSchema,
|
|
23793
|
+
environment: brokerEnvironmentSchema.optional()
|
|
23794
|
+
}).strict();
|
|
23688
23795
|
var subagentReadSnapshotSchema = external_exports.object({
|
|
23689
23796
|
parent: nativeSessionRefSchema,
|
|
23690
23797
|
nativeSubagentId: external_exports.string().min(1).max(4096),
|
|
@@ -23695,6 +23802,8 @@ var harnessErrorSchema = external_exports.object({
|
|
|
23695
23802
|
"notInstalled",
|
|
23696
23803
|
"unavailable",
|
|
23697
23804
|
"authenticationRequired",
|
|
23805
|
+
"rateLimited",
|
|
23806
|
+
"quotaExhausted",
|
|
23698
23807
|
"sessionNotFound",
|
|
23699
23808
|
"sessionBusy",
|
|
23700
23809
|
"checkpointNotFound",
|
|
@@ -23708,6 +23817,7 @@ var harnessErrorSchema = external_exports.object({
|
|
|
23708
23817
|
]),
|
|
23709
23818
|
message: external_exports.string().max(65536),
|
|
23710
23819
|
retryable: external_exports.boolean(),
|
|
23820
|
+
resetsAt: external_exports.string().min(1).max(128).refine((value) => !Number.isNaN(Date.parse(value)), "resetsAt must be a valid timestamp").optional(),
|
|
23711
23821
|
diagnostic: external_exports.string().max(65536).optional(),
|
|
23712
23822
|
stage: external_exports.string().max(1024).optional(),
|
|
23713
23823
|
durationMs: external_exports.number().finite().nonnegative().optional(),
|
|
@@ -24066,6 +24176,7 @@ function parseHarnessResult(value) {
|
|
|
24066
24176
|
code: parsed.code,
|
|
24067
24177
|
message: parsed.message,
|
|
24068
24178
|
retryable: parsed.retryable,
|
|
24179
|
+
...parsed.resetsAt ? { resetsAt: parsed.resetsAt } : {},
|
|
24069
24180
|
...parsed.diagnostic ? { diagnostic: parsed.diagnostic } : {},
|
|
24070
24181
|
...parsed.stage ? { stage: parsed.stage } : {},
|
|
24071
24182
|
...parsed.durationMs !== void 0 ? { durationMs: parsed.durationMs } : {},
|
|
@@ -24575,6 +24686,17 @@ var BrokeredHarnessAdapter = class {
|
|
|
24575
24686
|
#closed = false;
|
|
24576
24687
|
#credits = null;
|
|
24577
24688
|
#creditsRefresh = null;
|
|
24689
|
+
async readSnapshot(input3) {
|
|
24690
|
+
try {
|
|
24691
|
+
return parseHarnessResult(await this.#request("adapter.readSnapshot", {
|
|
24692
|
+
nativeRef: input3.nativeRef,
|
|
24693
|
+
cwd: input3.cwd,
|
|
24694
|
+
environment: input3.environment
|
|
24695
|
+
}, true));
|
|
24696
|
+
} catch (error62) {
|
|
24697
|
+
return { ok: false, error: this.#error(error62) };
|
|
24698
|
+
}
|
|
24699
|
+
}
|
|
24578
24700
|
subagents = {
|
|
24579
24701
|
readSnapshot: async (input3) => {
|
|
24580
24702
|
try {
|
|
@@ -24785,9 +24907,8 @@ import path4 from "node:path";
|
|
|
24785
24907
|
|
|
24786
24908
|
// ../../harness-adapter/dist/usage-statistics.js
|
|
24787
24909
|
import { createReadStream } from "node:fs";
|
|
24788
|
-
import { lstat as lstat2,
|
|
24910
|
+
import { lstat as lstat2, readdir } from "node:fs/promises";
|
|
24789
24911
|
import path2 from "node:path";
|
|
24790
|
-
import { createInterface } from "node:readline";
|
|
24791
24912
|
var MAX_SESSION_ID_LENGTH = 512;
|
|
24792
24913
|
var MAX_CWD_LENGTH = 4096;
|
|
24793
24914
|
var MAX_SESSION_TITLE_LENGTH = 200;
|
|
@@ -24841,40 +24962,101 @@ function usageEntryFromRequest(request, occurredAtMs) {
|
|
|
24841
24962
|
...request.reasoningOutputTokens !== void 0 ? { reasoningOutputTokens: request.reasoningOutputTokens } : {}
|
|
24842
24963
|
};
|
|
24843
24964
|
}
|
|
24965
|
+
var JSONL_CHUNK_BYTES = 128 * 1024;
|
|
24966
|
+
var JSONL_HEADER_CHUNK_BYTES = 16 * 1024;
|
|
24844
24967
|
async function jsonlUsageSources(root, maxDepth, signal) {
|
|
24845
24968
|
const sources = [];
|
|
24846
24969
|
const visit2 = async (directory, depth) => {
|
|
24847
24970
|
signal.throwIfAborted();
|
|
24848
|
-
const entries = await
|
|
24971
|
+
const entries = await readdir(directory, { withFileTypes: true }).catch((error62) => {
|
|
24849
24972
|
if (error62.code === "ENOENT")
|
|
24850
24973
|
return null;
|
|
24851
24974
|
throw error62;
|
|
24852
24975
|
});
|
|
24853
24976
|
if (!entries)
|
|
24854
24977
|
return;
|
|
24855
|
-
|
|
24856
|
-
|
|
24978
|
+
const subdirectories = [];
|
|
24979
|
+
const files = [];
|
|
24980
|
+
for (const entry of entries) {
|
|
24857
24981
|
const file2 = path2.join(directory, entry.name);
|
|
24858
24982
|
if (entry.isDirectory()) {
|
|
24859
24983
|
if (depth < maxDepth)
|
|
24860
|
-
|
|
24984
|
+
subdirectories.push(file2);
|
|
24861
24985
|
} else if (entry.isFile() && entry.name.endsWith(".jsonl")) {
|
|
24862
|
-
|
|
24863
|
-
|
|
24864
|
-
|
|
24986
|
+
files.push(file2);
|
|
24987
|
+
}
|
|
24988
|
+
}
|
|
24989
|
+
if (files.length > 0) {
|
|
24990
|
+
const stats = await Promise.all(files.map((file2) => lstat2(file2).catch(() => null)));
|
|
24991
|
+
signal.throwIfAborted();
|
|
24992
|
+
for (let i = 0; i < files.length; i++) {
|
|
24993
|
+
const file2 = files[i];
|
|
24994
|
+
const info = stats[i];
|
|
24995
|
+
if (file2 && info?.isFile() && info.size > 0) {
|
|
24996
|
+
sources.push({
|
|
24997
|
+
id: file2,
|
|
24998
|
+
fingerprint: `${info.ino}:${info.size}:${info.mtimeMs}`
|
|
24999
|
+
});
|
|
24865
25000
|
}
|
|
24866
25001
|
}
|
|
24867
25002
|
}
|
|
25003
|
+
for (const subdirectory of subdirectories)
|
|
25004
|
+
await visit2(subdirectory, depth + 1);
|
|
24868
25005
|
};
|
|
24869
25006
|
await visit2(root, 0);
|
|
24870
25007
|
return sources;
|
|
24871
25008
|
}
|
|
25009
|
+
function concatParts(parts, total) {
|
|
25010
|
+
const [single] = parts;
|
|
25011
|
+
return single && parts.length === 1 ? single : Buffer.concat(parts, total);
|
|
25012
|
+
}
|
|
25013
|
+
async function* jsonlLineSlices(file2, signal, highWaterMark) {
|
|
25014
|
+
const stream = createReadStream(file2, { highWaterMark, signal });
|
|
25015
|
+
let parts = [];
|
|
25016
|
+
let buffered = 0;
|
|
25017
|
+
try {
|
|
25018
|
+
for await (const raw of stream) {
|
|
25019
|
+
signal.throwIfAborted();
|
|
25020
|
+
const chunk = raw;
|
|
25021
|
+
let start = 0;
|
|
25022
|
+
let end;
|
|
25023
|
+
while ((end = chunk.indexOf(10, start)) >= 0) {
|
|
25024
|
+
const lineEnd = end > start && chunk[end - 1] === 13 ? end - 1 : end;
|
|
25025
|
+
const slice = chunk.subarray(start, lineEnd);
|
|
25026
|
+
if (buffered === 0) {
|
|
25027
|
+
yield slice;
|
|
25028
|
+
} else {
|
|
25029
|
+
if (slice.length > 0) {
|
|
25030
|
+
parts.push(slice);
|
|
25031
|
+
buffered += slice.length;
|
|
25032
|
+
}
|
|
25033
|
+
const combined = concatParts(parts, buffered);
|
|
25034
|
+
parts = [];
|
|
25035
|
+
buffered = 0;
|
|
25036
|
+
yield combined.length > 0 && combined[combined.length - 1] === 13 ? combined.subarray(0, combined.length - 1) : combined;
|
|
25037
|
+
}
|
|
25038
|
+
start = end + 1;
|
|
25039
|
+
}
|
|
25040
|
+
if (start < chunk.length) {
|
|
25041
|
+
const rest = chunk.subarray(start);
|
|
25042
|
+
parts.push(rest);
|
|
25043
|
+
buffered += rest.length;
|
|
25044
|
+
}
|
|
25045
|
+
}
|
|
25046
|
+
if (buffered > 0) {
|
|
25047
|
+
const combined = concatParts(parts, buffered);
|
|
25048
|
+
yield combined.length > 0 && combined[combined.length - 1] === 13 ? combined.subarray(0, combined.length - 1) : combined;
|
|
25049
|
+
}
|
|
25050
|
+
} finally {
|
|
25051
|
+
stream.destroy();
|
|
25052
|
+
}
|
|
25053
|
+
}
|
|
24872
25054
|
async function* jsonlRecords(file2, marker, signal) {
|
|
24873
|
-
const
|
|
24874
|
-
|
|
24875
|
-
|
|
24876
|
-
|
|
24877
|
-
|
|
25055
|
+
const markerBytes = marker.length > 0 ? Buffer.from(marker, "utf8") : null;
|
|
25056
|
+
for await (const rawLine of jsonlLineSlices(file2, signal, JSONL_CHUNK_BYTES)) {
|
|
25057
|
+
if (markerBytes && !rawLine.includes(markerBytes))
|
|
25058
|
+
continue;
|
|
25059
|
+
const line = rawLine.toString("utf8");
|
|
24878
25060
|
if (!line.includes(marker))
|
|
24879
25061
|
continue;
|
|
24880
25062
|
let value;
|
|
@@ -24896,7 +25078,7 @@ function nativeTimeMs(value) {
|
|
|
24896
25078
|
// ../codebuddy/dist/history.js
|
|
24897
25079
|
import { createHash } from "node:crypto";
|
|
24898
25080
|
import { realpathSync } from "node:fs";
|
|
24899
|
-
import { access, readdir, realpath as realpath2 } from "node:fs/promises";
|
|
25081
|
+
import { access, readdir as readdir2, realpath as realpath2 } from "node:fs/promises";
|
|
24900
25082
|
import { homedir } from "node:os";
|
|
24901
25083
|
import path3 from "node:path";
|
|
24902
25084
|
import { isDeepStrictEqual } from "node:util";
|
|
@@ -25058,6 +25240,7 @@ function configuration(value, profile = CODEBUDDY_RUNTIME_PROFILE) {
|
|
|
25058
25240
|
})),
|
|
25059
25241
|
defaultModel: currentModel.ref,
|
|
25060
25242
|
thinkingOptions,
|
|
25243
|
+
thinkingOptionsScope: "activeModel",
|
|
25061
25244
|
...currentThinking ? { defaultThinkingOptionId: currentThinking.id } : {}
|
|
25062
25245
|
});
|
|
25063
25246
|
const permissionModes = harnessPermissionModeCatalogSchema.parse({
|
|
@@ -26002,7 +26185,7 @@ async function codeBuddyHistory(cwd, ref, environment, tolerateIncompleteTail, p
|
|
|
26002
26185
|
throw error62;
|
|
26003
26186
|
if (transaction?.requirePrimary || provenance)
|
|
26004
26187
|
throw new CodeBuddyError("sessionNotFound", "Native Session history was not found");
|
|
26005
|
-
const directories = await
|
|
26188
|
+
const directories = await readdir2(root, { withFileTypes: true }).catch((error63) => {
|
|
26006
26189
|
if (record3(error63).code === "ENOENT")
|
|
26007
26190
|
return [];
|
|
26008
26191
|
throw error63;
|
|
@@ -30683,12 +30866,12 @@ var ClientSideConnection = class {
|
|
|
30683
30866
|
import { randomBytes } from "node:crypto";
|
|
30684
30867
|
|
|
30685
30868
|
// ../codebuddy/dist/acp-stdio.js
|
|
30686
|
-
import { createInterface
|
|
30869
|
+
import { createInterface } from "node:readline";
|
|
30687
30870
|
import { Readable } from "node:stream";
|
|
30688
30871
|
import { stripVTControlCharacters } from "node:util";
|
|
30689
30872
|
function codeBuddyAcpOutput(stdout, onLine) {
|
|
30690
30873
|
return Readable.from((async function* () {
|
|
30691
|
-
for await (const line of
|
|
30874
|
+
for await (const line of createInterface({ input: stdout })) {
|
|
30692
30875
|
onLine?.(stripVTControlCharacters(line));
|
|
30693
30876
|
if (line.trimStart().startsWith("{"))
|
|
30694
30877
|
yield Buffer.from(`${line}
|
|
@@ -32082,9 +32265,9 @@ async function deriveCodeBuddySession(options) {
|
|
|
32082
32265
|
|
|
32083
32266
|
// ../codebuddy/dist/session-import.js
|
|
32084
32267
|
import { createReadStream as createReadStream2 } from "node:fs";
|
|
32085
|
-
import { opendir
|
|
32268
|
+
import { opendir, readFile as readFile4, stat as stat2 } from "node:fs/promises";
|
|
32086
32269
|
import path9 from "node:path";
|
|
32087
|
-
import { createInterface as
|
|
32270
|
+
import { createInterface as createInterface2 } from "node:readline";
|
|
32088
32271
|
|
|
32089
32272
|
// ../../harness-adapter/dist/session-import.js
|
|
32090
32273
|
import { lstat as lstat4 } from "node:fs/promises";
|
|
@@ -32227,7 +32410,7 @@ function userText(row) {
|
|
|
32227
32410
|
}
|
|
32228
32411
|
async function readFacts(file2, signal) {
|
|
32229
32412
|
const stream = createReadStream2(file2, { encoding: "utf8", signal });
|
|
32230
|
-
const lines =
|
|
32413
|
+
const lines = createInterface2({ input: stream, crlfDelay: Infinity });
|
|
32231
32414
|
let cwd = null;
|
|
32232
32415
|
let customTitle = null;
|
|
32233
32416
|
let generatedTitle = null;
|
|
@@ -32320,7 +32503,7 @@ var CodeBuddySessionImport = class {
|
|
|
32320
32503
|
async #activeSessions(signal) {
|
|
32321
32504
|
const active2 = /* @__PURE__ */ new Set();
|
|
32322
32505
|
const directory = path9.join(this.#root(), "sessions");
|
|
32323
|
-
const markers = await
|
|
32506
|
+
const markers = await opendir(directory).catch((error62) => {
|
|
32324
32507
|
if (isMissingFileError(error62) || record3(error62).code === "ENOTDIR")
|
|
32325
32508
|
return null;
|
|
32326
32509
|
throw error62;
|
|
@@ -32355,12 +32538,12 @@ var CodeBuddySessionImport = class {
|
|
|
32355
32538
|
return found;
|
|
32356
32539
|
if (!info.isDirectory())
|
|
32357
32540
|
throw new Error(`${this.#profile.displayName} Session store is not a directory`);
|
|
32358
|
-
for await (const project2 of await
|
|
32541
|
+
for await (const project2 of await opendir(root)) {
|
|
32359
32542
|
signal.throwIfAborted();
|
|
32360
32543
|
if (!project2.isDirectory())
|
|
32361
32544
|
continue;
|
|
32362
32545
|
const projectDirectory = path9.join(root, project2.name);
|
|
32363
|
-
const entries = await
|
|
32546
|
+
const entries = await opendir(projectDirectory).catch((error62) => {
|
|
32364
32547
|
if (isMissingFileError(error62))
|
|
32365
32548
|
return null;
|
|
32366
32549
|
throw error62;
|
|
@@ -32561,7 +32744,7 @@ var CodeBuddyInteractions = class {
|
|
|
32561
32744
|
};
|
|
32562
32745
|
|
|
32563
32746
|
// ../codebuddy/dist/subagent-history.js
|
|
32564
|
-
import { readdir as
|
|
32747
|
+
import { readdir as readdir3, realpath as realpath5 } from "node:fs/promises";
|
|
32565
32748
|
import path10 from "node:path";
|
|
32566
32749
|
var equalPath2 = (a, b) => process.platform === "win32" ? a.toLowerCase() === b.toLowerCase() : a === b;
|
|
32567
32750
|
var MAX_CACHED_CHILDREN = 16;
|
|
@@ -32671,7 +32854,7 @@ var CodeBuddyChildObserver = class {
|
|
|
32671
32854
|
if (!requestId)
|
|
32672
32855
|
return void 0;
|
|
32673
32856
|
const directory = await this.#directory();
|
|
32674
|
-
const files = (await
|
|
32857
|
+
const files = (await readdir3(directory, { withFileTypes: true })).filter((entry) => entry.isFile() && /^agent-[\w-]+\.jsonl$/u.test(entry.name));
|
|
32675
32858
|
if (files.length > 256)
|
|
32676
32859
|
throw new CodeBuddyError("unsupported", "Too many native Subagent transcripts");
|
|
32677
32860
|
const matches = [];
|