@codexhost/cli-win32-arm64 0.27.0 → 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 +340 -161
- package/app/console-web.js +194 -5
- package/app/desktop-controller.mjs +105 -4
- package/app/host-runtime.mjs +1891 -1006
- 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 +107 -4
- package/app/renderer-extension.js +12013 -11533
- package/app/web/assets/{index-nw2RXcDu.css → index-DBPgg32z.css} +1 -1
- package/app/web/assets/index-DWxiVzuS.js +204 -0
- package/app/web/codexhost-settings.js +81 -46
- 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-tool/client.js +18 -18
- package/app/web/plugins/deepseek-ai__dsh-client-ui-workspace/client.js +8 -8
- package/app/web-modules/server.mjs +2476 -1131
- 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
|
@@ -20525,11 +20525,21 @@ var harnessThinkingOptionsSchema = external_exports.array(harnessThinkingOptionS
|
|
|
20525
20525
|
ids.add(option.id);
|
|
20526
20526
|
}
|
|
20527
20527
|
});
|
|
20528
|
+
var harnessThinkingOptionsScopeSchema = external_exports.enum(["catalog", "activeModel"]);
|
|
20528
20529
|
var harnessModelCatalogSchema = external_exports.object({
|
|
20529
20530
|
models: external_exports.array(harnessModelSchema),
|
|
20530
20531
|
defaultModel: harnessModelRefSchema.optional(),
|
|
20531
20532
|
thinkingOptions: harnessThinkingOptionsSchema,
|
|
20532
|
-
defaultThinkingOptionId: harnessThinkingOptionIdSchema.optional()
|
|
20533
|
+
defaultThinkingOptionId: harnessThinkingOptionIdSchema.optional(),
|
|
20534
|
+
/**
|
|
20535
|
+
* Scope of per-Model `supportedThinkingOptionIds` in this catalog.
|
|
20536
|
+
* Omitted or `"catalog"` means each Model's `supportedThinkingOptionIds`
|
|
20537
|
+
* reflects its own options (omitted or `[]` means none).
|
|
20538
|
+
* `"activeModel"` means only the active Model's Thinking options were
|
|
20539
|
+
* observed; other Models omit `supportedThinkingOptionIds` and must be
|
|
20540
|
+
* validated by the Adapter after selecting the Model.
|
|
20541
|
+
*/
|
|
20542
|
+
thinkingOptionsScope: harnessThinkingOptionsScopeSchema.optional()
|
|
20533
20543
|
}).strict().superRefine((catalog, context) => {
|
|
20534
20544
|
const refs = [];
|
|
20535
20545
|
const thinkingIds = new Set(catalog.thinkingOptions.map(({ id: id2 }) => id2));
|
|
@@ -21443,7 +21453,12 @@ var clientProjectlessWorkspaceSchema = external_exports.object({
|
|
|
21443
21453
|
prompt: external_exports.string().max(16384).optional()
|
|
21444
21454
|
}).strict();
|
|
21445
21455
|
var clientWorkspaceSnapshotSchema = external_exports.object({
|
|
21446
|
-
projects: external_exports.array(external_exports.object({
|
|
21456
|
+
projects: external_exports.array(external_exports.object({
|
|
21457
|
+
id: external_exports.string(),
|
|
21458
|
+
name: external_exports.string(),
|
|
21459
|
+
rootPaths: external_exports.array(external_exports.string()),
|
|
21460
|
+
createdAt: external_exports.number().int().optional()
|
|
21461
|
+
})),
|
|
21447
21462
|
nativeProjects: external_exports.literal(true).optional(),
|
|
21448
21463
|
assignments: external_exports.record(external_exports.string(), external_exports.string()),
|
|
21449
21464
|
projectless: external_exports.array(external_exports.string()),
|
|
@@ -21856,6 +21871,7 @@ var delegationReadParamsSchema = external_exports.strictObject({
|
|
|
21856
21871
|
// ../../shared-contracts/dist/remote-peers.js
|
|
21857
21872
|
var REMOTE_PEER_ID_PATTERN = /^[a-zA-Z0-9_-]{1,64}$/u;
|
|
21858
21873
|
var remotePeerIdSchema = external_exports.string().regex(REMOTE_PEER_ID_PATTERN);
|
|
21874
|
+
var remotePeerNodeIdSchema = external_exports.string().regex(REMOTE_PEER_ID_PATTERN);
|
|
21859
21875
|
var remotePeerHostIdSchema = external_exports.string().regex(/^remote-peer:[a-zA-Z0-9_-]{1,64}$/u);
|
|
21860
21876
|
var remotePeerTransportKindSchema = external_exports.enum(["relay", "tailscale", "lan", "custom"]);
|
|
21861
21877
|
var REMOTE_PEER_COLORS = [
|
|
@@ -21879,6 +21895,7 @@ var remotePeerStateSchema = external_exports.enum([
|
|
|
21879
21895
|
var remotePeerSummarySchema = external_exports.object({
|
|
21880
21896
|
peerId: remotePeerIdSchema,
|
|
21881
21897
|
hostId: remotePeerHostIdSchema,
|
|
21898
|
+
nodeId: remotePeerNodeIdSchema.optional(),
|
|
21882
21899
|
name: external_exports.string().min(1).max(120),
|
|
21883
21900
|
color: remotePeerColorSchema.optional(),
|
|
21884
21901
|
origin: external_exports.string().min(1).max(2048),
|
|
@@ -21886,6 +21903,11 @@ var remotePeerSummarySchema = external_exports.object({
|
|
|
21886
21903
|
encrypted: external_exports.boolean(),
|
|
21887
21904
|
enabled: external_exports.boolean(),
|
|
21888
21905
|
state: remotePeerStateSchema,
|
|
21906
|
+
supportsPeerPairing: external_exports.boolean().optional(),
|
|
21907
|
+
/** Omitted when either side's node mapping is unknown. */
|
|
21908
|
+
pairedBack: external_exports.boolean().optional(),
|
|
21909
|
+
/** Other configured remote peerIds on this Hub present in this peer's `manifest.peerNodes`. */
|
|
21910
|
+
linkedPeerIds: external_exports.array(remotePeerIdSchema).max(128).optional(),
|
|
21889
21911
|
latencyMs: external_exports.number().int().nonnegative().optional(),
|
|
21890
21912
|
version: external_exports.string().max(128).optional(),
|
|
21891
21913
|
platform: external_exports.string().max(64).optional(),
|
|
@@ -21904,8 +21926,48 @@ var remotePeerAddParamsSchema = external_exports.object({
|
|
|
21904
21926
|
origin: external_exports.string().min(1).max(2048).optional(),
|
|
21905
21927
|
token: external_exports.string().min(1).max(2048).optional(),
|
|
21906
21928
|
name: external_exports.string().trim().min(1).max(120).optional(),
|
|
21907
|
-
color: remotePeerColorSchema.optional()
|
|
21929
|
+
color: remotePeerColorSchema.optional(),
|
|
21930
|
+
pairBack: external_exports.boolean().optional(),
|
|
21931
|
+
meshPeerIds: external_exports.array(remotePeerIdSchema).max(64).optional(),
|
|
21932
|
+
selfOrigin: external_exports.string().min(1).max(2048).optional()
|
|
21908
21933
|
}).refine((input3) => Boolean(input3.connectionUrl) || Boolean(input3.origin) && Boolean(input3.token), "Provide either connectionUrl or both origin and token");
|
|
21934
|
+
var remotePeerIntroduceParamsSchema = external_exports.strictObject({
|
|
21935
|
+
origin: external_exports.string().min(1).max(2048),
|
|
21936
|
+
token: external_exports.string().min(1).max(2048),
|
|
21937
|
+
name: external_exports.string().trim().min(1).max(120).optional(),
|
|
21938
|
+
color: remotePeerColorSchema.optional(),
|
|
21939
|
+
expectedNodeId: remotePeerNodeIdSchema.optional()
|
|
21940
|
+
});
|
|
21941
|
+
var remotePeerIntroduceResultSchema = external_exports.object({
|
|
21942
|
+
status: external_exports.enum(["added", "updated", "existing"]),
|
|
21943
|
+
peerId: remotePeerIdSchema,
|
|
21944
|
+
hostId: remotePeerHostIdSchema,
|
|
21945
|
+
nodeId: remotePeerNodeIdSchema.optional()
|
|
21946
|
+
});
|
|
21947
|
+
var remotePeerPairingStatusSchema = external_exports.enum([
|
|
21948
|
+
"added",
|
|
21949
|
+
"updated",
|
|
21950
|
+
"existing",
|
|
21951
|
+
"failed",
|
|
21952
|
+
"skipped"
|
|
21953
|
+
]);
|
|
21954
|
+
var remotePeerPairingStepSchema = external_exports.object({
|
|
21955
|
+
targetPeerId: remotePeerIdSchema,
|
|
21956
|
+
targetName: external_exports.string().min(1).max(120),
|
|
21957
|
+
introducedHost: external_exports.union([external_exports.literal("local"), remotePeerIdSchema]),
|
|
21958
|
+
introducedName: external_exports.string().min(1).max(120),
|
|
21959
|
+
status: remotePeerPairingStatusSchema,
|
|
21960
|
+
error: external_exports.string().max(1e3).optional()
|
|
21961
|
+
});
|
|
21962
|
+
var remotePeerPairingReportSchema = external_exports.object({
|
|
21963
|
+
results: external_exports.array(remotePeerPairingStepSchema)
|
|
21964
|
+
});
|
|
21965
|
+
var remotePeerSyncMeshParamsSchema = external_exports.object({
|
|
21966
|
+
peerIds: external_exports.array(remotePeerIdSchema).max(64).optional(),
|
|
21967
|
+
includeSelf: external_exports.boolean().optional(),
|
|
21968
|
+
includeMesh: external_exports.boolean().optional(),
|
|
21969
|
+
selfOrigin: external_exports.string().min(1).max(2048).optional()
|
|
21970
|
+
});
|
|
21909
21971
|
var remotePeerUpdateParamsSchema = external_exports.object({
|
|
21910
21972
|
peerId: remotePeerIdSchema,
|
|
21911
21973
|
name: external_exports.string().trim().min(1).max(120).optional(),
|
|
@@ -21934,6 +21996,9 @@ var remotePeerTestProjectSchema = external_exports.object({
|
|
|
21934
21996
|
});
|
|
21935
21997
|
var remotePeerTestResultSchema = external_exports.object({
|
|
21936
21998
|
ok: external_exports.boolean(),
|
|
21999
|
+
nodeId: remotePeerNodeIdSchema.optional(),
|
|
22000
|
+
supportsPeerPairing: external_exports.boolean().optional(),
|
|
22001
|
+
pairedBack: external_exports.boolean().optional(),
|
|
21937
22002
|
latencyMs: external_exports.number().int().nonnegative().optional(),
|
|
21938
22003
|
origin: external_exports.string().max(2048).optional(),
|
|
21939
22004
|
transportKind: remotePeerTransportKindSchema.optional(),
|
|
@@ -21960,7 +22025,9 @@ var remotePeerCapabilitiesSchema = external_exports.object({
|
|
|
21960
22025
|
/** Peer supports officeToPdf/render over /api/peer/v1/workspace-files/rpc. */
|
|
21961
22026
|
officePreview: external_exports.literal(1).optional(),
|
|
21962
22027
|
/** /api/peer/v1/delegation is available for fixed-whitelist cross-host delegation. */
|
|
21963
|
-
delegation: external_exports.literal(1).optional()
|
|
22028
|
+
delegation: external_exports.literal(1).optional(),
|
|
22029
|
+
/** POST /api/peer/v1/peers is available. */
|
|
22030
|
+
peerPairing: external_exports.literal(1).optional()
|
|
21964
22031
|
});
|
|
21965
22032
|
var remotePeerManifestSchema = external_exports.object({
|
|
21966
22033
|
version: external_exports.string().max(128),
|
|
@@ -21968,6 +22035,8 @@ var remotePeerManifestSchema = external_exports.object({
|
|
|
21968
22035
|
hostname: external_exports.string().max(255),
|
|
21969
22036
|
homeDir: external_exports.string().max(4096).optional(),
|
|
21970
22037
|
epoch: external_exports.string().min(1).max(256),
|
|
22038
|
+
nodeId: remotePeerNodeIdSchema.optional(),
|
|
22039
|
+
peerNodes: external_exports.record(remotePeerHostIdSchema, remotePeerNodeIdSchema).refine((v) => Object.keys(v).length <= 128).optional(),
|
|
21971
22040
|
projects: external_exports.array(remotePeerManifestProjectSchema),
|
|
21972
22041
|
capabilities: remotePeerCapabilitiesSchema.optional()
|
|
21973
22042
|
});
|
|
@@ -22054,6 +22123,29 @@ var remotePeerWorkspaceMutationResultSchema = external_exports.object({
|
|
|
22054
22123
|
workspaceId: external_exports.string().min(1).max(1024).optional(),
|
|
22055
22124
|
manifest: remotePeerManifestSchema
|
|
22056
22125
|
});
|
|
22126
|
+
var delegationRemoteHostsParamsSchema = external_exports.object({
|
|
22127
|
+
sessionHostId: external_exports.string().min(1).max(128).optional()
|
|
22128
|
+
});
|
|
22129
|
+
var delegationRemoteHostOptionSchema = external_exports.object({
|
|
22130
|
+
hostId: external_exports.union([external_exports.literal("local"), remotePeerHostIdSchema]),
|
|
22131
|
+
name: external_exports.string().min(1).max(120),
|
|
22132
|
+
isLocal: external_exports.boolean().optional(),
|
|
22133
|
+
color: remotePeerColorSchema.optional(),
|
|
22134
|
+
hostname: external_exports.string().max(255).optional()
|
|
22135
|
+
});
|
|
22136
|
+
var delegationRemoteHostsResultSchema = external_exports.object({
|
|
22137
|
+
hosts: external_exports.array(delegationRemoteHostOptionSchema)
|
|
22138
|
+
});
|
|
22139
|
+
var delegationHostHarnessesParamsSchema = external_exports.object({
|
|
22140
|
+
hostId: external_exports.union([external_exports.literal("local"), remotePeerHostIdSchema])
|
|
22141
|
+
});
|
|
22142
|
+
var delegationHostHarnessOptionSchema = external_exports.object({
|
|
22143
|
+
id: external_exports.string().regex(/^[a-z0-9][a-z0-9-]*$/u),
|
|
22144
|
+
name: external_exports.string().min(1).max(120)
|
|
22145
|
+
});
|
|
22146
|
+
var delegationHostHarnessesResultSchema = external_exports.object({
|
|
22147
|
+
harnesses: external_exports.array(delegationHostHarnessOptionSchema)
|
|
22148
|
+
});
|
|
22057
22149
|
|
|
22058
22150
|
// ../../shared-contracts/dist/peer-delegation.js
|
|
22059
22151
|
var PEER_DELEGATION_BRIDGE_VERSION = 1;
|
|
@@ -22097,6 +22189,7 @@ var peerDelegationHostProjectSchema = external_exports.strictObject({
|
|
|
22097
22189
|
});
|
|
22098
22190
|
var peerDelegationHostSummarySchema = external_exports.strictObject({
|
|
22099
22191
|
hostId: remotePeerHostIdSchema,
|
|
22192
|
+
nodeId: remotePeerNodeIdSchema.optional(),
|
|
22100
22193
|
displayName: external_exports.string().min(1).max(120),
|
|
22101
22194
|
online: external_exports.boolean(),
|
|
22102
22195
|
state: remotePeerStateSchema,
|
|
@@ -22989,6 +23082,13 @@ var updatePhaseSchema = external_exports.enum([
|
|
|
22989
23082
|
"succeeded",
|
|
22990
23083
|
"failed"
|
|
22991
23084
|
]);
|
|
23085
|
+
var npmDownloadProgressSchema = external_exports.strictObject({
|
|
23086
|
+
completed: external_exports.number().int().nonnegative(),
|
|
23087
|
+
total: external_exports.number().int().positive()
|
|
23088
|
+
}).refine((progress) => progress.completed <= progress.total, {
|
|
23089
|
+
path: ["completed"],
|
|
23090
|
+
message: "completed must not exceed total"
|
|
23091
|
+
});
|
|
22992
23092
|
var updateStatusSchema = external_exports.strictObject({
|
|
22993
23093
|
version: updateSemanticVersionSchema,
|
|
22994
23094
|
installation: updateInstallationSchema,
|
|
@@ -22996,6 +23096,7 @@ var updateStatusSchema = external_exports.strictObject({
|
|
|
22996
23096
|
updatedAt: external_exports.number().int().nonnegative(),
|
|
22997
23097
|
downloadedBytes: external_exports.number().int().nonnegative().optional(),
|
|
22998
23098
|
totalBytes: external_exports.number().int().positive().optional(),
|
|
23099
|
+
npmDownload: npmDownloadProgressSchema.optional(),
|
|
22999
23100
|
error: external_exports.string().min(1).max(UPDATE_ERROR_MAX_LENGTH).nullable(),
|
|
23000
23101
|
serviceStopOutput: external_exports.string().optional()
|
|
23001
23102
|
}).superRefine((status, context) => {
|
|
@@ -23823,9 +23924,8 @@ function configureSubagentSnapshot(snapshot, parent) {
|
|
|
23823
23924
|
|
|
23824
23925
|
// ../../harness-adapter/dist/usage-statistics.js
|
|
23825
23926
|
import { createReadStream } from "node:fs";
|
|
23826
|
-
import { lstat,
|
|
23927
|
+
import { lstat, readdir } from "node:fs/promises";
|
|
23827
23928
|
import path4 from "node:path";
|
|
23828
|
-
import { createInterface } from "node:readline";
|
|
23829
23929
|
var MAX_SESSION_ID_LENGTH = 512;
|
|
23830
23930
|
var MAX_CWD_LENGTH = 4096;
|
|
23831
23931
|
var MAX_SESSION_TITLE_LENGTH = 200;
|
|
@@ -23879,40 +23979,101 @@ function usageEntryFromRequest(request, occurredAtMs) {
|
|
|
23879
23979
|
...request.reasoningOutputTokens !== void 0 ? { reasoningOutputTokens: request.reasoningOutputTokens } : {}
|
|
23880
23980
|
};
|
|
23881
23981
|
}
|
|
23982
|
+
var JSONL_CHUNK_BYTES = 128 * 1024;
|
|
23983
|
+
var JSONL_HEADER_CHUNK_BYTES = 16 * 1024;
|
|
23882
23984
|
async function jsonlUsageSources(root, maxDepth, signal) {
|
|
23883
23985
|
const sources = [];
|
|
23884
23986
|
const visit2 = async (directory, depth) => {
|
|
23885
23987
|
signal.throwIfAborted();
|
|
23886
|
-
const entries = await
|
|
23988
|
+
const entries = await readdir(directory, { withFileTypes: true }).catch((error62) => {
|
|
23887
23989
|
if (error62.code === "ENOENT")
|
|
23888
23990
|
return null;
|
|
23889
23991
|
throw error62;
|
|
23890
23992
|
});
|
|
23891
23993
|
if (!entries)
|
|
23892
23994
|
return;
|
|
23893
|
-
|
|
23894
|
-
|
|
23995
|
+
const subdirectories = [];
|
|
23996
|
+
const files = [];
|
|
23997
|
+
for (const entry of entries) {
|
|
23895
23998
|
const file2 = path4.join(directory, entry.name);
|
|
23896
23999
|
if (entry.isDirectory()) {
|
|
23897
24000
|
if (depth < maxDepth)
|
|
23898
|
-
|
|
24001
|
+
subdirectories.push(file2);
|
|
23899
24002
|
} else if (entry.isFile() && entry.name.endsWith(".jsonl")) {
|
|
23900
|
-
|
|
23901
|
-
|
|
23902
|
-
|
|
24003
|
+
files.push(file2);
|
|
24004
|
+
}
|
|
24005
|
+
}
|
|
24006
|
+
if (files.length > 0) {
|
|
24007
|
+
const stats = await Promise.all(files.map((file2) => lstat(file2).catch(() => null)));
|
|
24008
|
+
signal.throwIfAborted();
|
|
24009
|
+
for (let i = 0; i < files.length; i++) {
|
|
24010
|
+
const file2 = files[i];
|
|
24011
|
+
const info = stats[i];
|
|
24012
|
+
if (file2 && info?.isFile() && info.size > 0) {
|
|
24013
|
+
sources.push({
|
|
24014
|
+
id: file2,
|
|
24015
|
+
fingerprint: `${info.ino}:${info.size}:${info.mtimeMs}`
|
|
24016
|
+
});
|
|
23903
24017
|
}
|
|
23904
24018
|
}
|
|
23905
24019
|
}
|
|
24020
|
+
for (const subdirectory of subdirectories)
|
|
24021
|
+
await visit2(subdirectory, depth + 1);
|
|
23906
24022
|
};
|
|
23907
24023
|
await visit2(root, 0);
|
|
23908
24024
|
return sources;
|
|
23909
24025
|
}
|
|
24026
|
+
function concatParts(parts, total) {
|
|
24027
|
+
const [single] = parts;
|
|
24028
|
+
return single && parts.length === 1 ? single : Buffer.concat(parts, total);
|
|
24029
|
+
}
|
|
24030
|
+
async function* jsonlLineSlices(file2, signal, highWaterMark) {
|
|
24031
|
+
const stream = createReadStream(file2, { highWaterMark, signal });
|
|
24032
|
+
let parts = [];
|
|
24033
|
+
let buffered = 0;
|
|
24034
|
+
try {
|
|
24035
|
+
for await (const raw of stream) {
|
|
24036
|
+
signal.throwIfAborted();
|
|
24037
|
+
const chunk = raw;
|
|
24038
|
+
let start = 0;
|
|
24039
|
+
let end;
|
|
24040
|
+
while ((end = chunk.indexOf(10, start)) >= 0) {
|
|
24041
|
+
const lineEnd = end > start && chunk[end - 1] === 13 ? end - 1 : end;
|
|
24042
|
+
const slice = chunk.subarray(start, lineEnd);
|
|
24043
|
+
if (buffered === 0) {
|
|
24044
|
+
yield slice;
|
|
24045
|
+
} else {
|
|
24046
|
+
if (slice.length > 0) {
|
|
24047
|
+
parts.push(slice);
|
|
24048
|
+
buffered += slice.length;
|
|
24049
|
+
}
|
|
24050
|
+
const combined = concatParts(parts, buffered);
|
|
24051
|
+
parts = [];
|
|
24052
|
+
buffered = 0;
|
|
24053
|
+
yield combined.length > 0 && combined[combined.length - 1] === 13 ? combined.subarray(0, combined.length - 1) : combined;
|
|
24054
|
+
}
|
|
24055
|
+
start = end + 1;
|
|
24056
|
+
}
|
|
24057
|
+
if (start < chunk.length) {
|
|
24058
|
+
const rest = chunk.subarray(start);
|
|
24059
|
+
parts.push(rest);
|
|
24060
|
+
buffered += rest.length;
|
|
24061
|
+
}
|
|
24062
|
+
}
|
|
24063
|
+
if (buffered > 0) {
|
|
24064
|
+
const combined = concatParts(parts, buffered);
|
|
24065
|
+
yield combined.length > 0 && combined[combined.length - 1] === 13 ? combined.subarray(0, combined.length - 1) : combined;
|
|
24066
|
+
}
|
|
24067
|
+
} finally {
|
|
24068
|
+
stream.destroy();
|
|
24069
|
+
}
|
|
24070
|
+
}
|
|
23910
24071
|
async function* jsonlRecords(file2, marker, signal) {
|
|
23911
|
-
const
|
|
23912
|
-
|
|
23913
|
-
|
|
23914
|
-
|
|
23915
|
-
|
|
24072
|
+
const markerBytes = marker.length > 0 ? Buffer.from(marker, "utf8") : null;
|
|
24073
|
+
for await (const rawLine of jsonlLineSlices(file2, signal, JSONL_CHUNK_BYTES)) {
|
|
24074
|
+
if (markerBytes && !rawLine.includes(markerBytes))
|
|
24075
|
+
continue;
|
|
24076
|
+
const line = rawLine.toString("utf8");
|
|
23916
24077
|
if (!line.includes(marker))
|
|
23917
24078
|
continue;
|
|
23918
24079
|
let value;
|
|
@@ -23927,30 +24088,23 @@ async function* jsonlRecords(file2, marker, signal) {
|
|
|
23927
24088
|
}
|
|
23928
24089
|
}
|
|
23929
24090
|
async function jsonlHeader(file2, match, signal, maxLines = 4) {
|
|
23930
|
-
const stream = createReadStream(file2, { encoding: "utf8", signal });
|
|
23931
|
-
const lines = createInterface({ input: stream, crlfDelay: Infinity });
|
|
23932
24091
|
let seen = 0;
|
|
23933
|
-
|
|
23934
|
-
|
|
23935
|
-
|
|
23936
|
-
|
|
23937
|
-
|
|
23938
|
-
|
|
23939
|
-
|
|
23940
|
-
|
|
23941
|
-
|
|
23942
|
-
|
|
23943
|
-
|
|
23944
|
-
|
|
23945
|
-
|
|
23946
|
-
return record3;
|
|
23947
|
-
}
|
|
24092
|
+
for await (const rawLine of jsonlLineSlices(file2, signal, JSONL_HEADER_CHUNK_BYTES)) {
|
|
24093
|
+
if (++seen > maxLines)
|
|
24094
|
+
break;
|
|
24095
|
+
let value;
|
|
24096
|
+
try {
|
|
24097
|
+
value = JSON.parse(rawLine.toString("utf8"));
|
|
24098
|
+
} catch {
|
|
24099
|
+
continue;
|
|
24100
|
+
}
|
|
24101
|
+
if (typeof value === "object" && value !== null && !Array.isArray(value)) {
|
|
24102
|
+
const record3 = value;
|
|
24103
|
+
if (match(record3))
|
|
24104
|
+
return record3;
|
|
23948
24105
|
}
|
|
23949
|
-
return null;
|
|
23950
|
-
} finally {
|
|
23951
|
-
lines.close();
|
|
23952
|
-
stream.destroy();
|
|
23953
24106
|
}
|
|
24107
|
+
return null;
|
|
23954
24108
|
}
|
|
23955
24109
|
function nativeTimeMs(value) {
|
|
23956
24110
|
const time3 = typeof value === "number" ? value : typeof value === "string" ? Date.parse(value) : Number.NaN;
|
|
@@ -23959,10 +24113,10 @@ function nativeTimeMs(value) {
|
|
|
23959
24113
|
|
|
23960
24114
|
// dist/session-import.js
|
|
23961
24115
|
import { createReadStream as createReadStream2 } from "node:fs";
|
|
23962
|
-
import { opendir
|
|
24116
|
+
import { opendir, realpath, stat } from "node:fs/promises";
|
|
23963
24117
|
import os2 from "node:os";
|
|
23964
24118
|
import path5 from "node:path";
|
|
23965
|
-
import { createInterface
|
|
24119
|
+
import { createInterface } from "node:readline";
|
|
23966
24120
|
|
|
23967
24121
|
// ../../harness-adapter/dist/session-import.js
|
|
23968
24122
|
import { lstat as lstat2 } from "node:fs/promises";
|
|
@@ -24106,7 +24260,7 @@ function messageText(content) {
|
|
|
24106
24260
|
}
|
|
24107
24261
|
async function readFacts(file2, signal) {
|
|
24108
24262
|
const stream = createReadStream2(file2, { encoding: "utf8", signal });
|
|
24109
|
-
const lines =
|
|
24263
|
+
const lines = createInterface({ input: stream, crlfDelay: Infinity });
|
|
24110
24264
|
let header = null;
|
|
24111
24265
|
let nativeTitle = null;
|
|
24112
24266
|
let firstPrompt = null;
|
|
@@ -24202,7 +24356,7 @@ var OmpSessionImport = class {
|
|
|
24202
24356
|
throw new Error("Omp Session store is not a directory");
|
|
24203
24357
|
const files = [];
|
|
24204
24358
|
const visit2 = async (current, projectLevel) => {
|
|
24205
|
-
const entries = await
|
|
24359
|
+
const entries = await opendir(current).catch((error62) => {
|
|
24206
24360
|
if (isMissingFileError(error62))
|
|
24207
24361
|
return null;
|
|
24208
24362
|
throw error62;
|
|
@@ -24991,8 +25145,12 @@ async function readOmpSessionHeader(sessionFile) {
|
|
|
24991
25145
|
if (newline < 0 && bytesRead === buffer.length) {
|
|
24992
25146
|
throw new Error("Omp Session header exceeds the supported size");
|
|
24993
25147
|
}
|
|
24994
|
-
|
|
24995
|
-
|
|
25148
|
+
for (let start = 0; start < contents.length; ) {
|
|
25149
|
+
const end = contents.indexOf(10, start);
|
|
25150
|
+
if (end < 0 && bytesRead === buffer.length)
|
|
25151
|
+
break;
|
|
25152
|
+
const line = utf8Decoder.decode(contents.subarray(start, end < 0 ? contents.length : end));
|
|
25153
|
+
start = end < 0 ? contents.length : end + 1;
|
|
24996
25154
|
if (line.length === 0)
|
|
24997
25155
|
continue;
|
|
24998
25156
|
let parsed;
|
|
@@ -29435,6 +29593,64 @@ var OmpAdapter = class {
|
|
|
29435
29593
|
harnessId = ompHarnessId2;
|
|
29436
29594
|
sessionImport;
|
|
29437
29595
|
usageStatistics;
|
|
29596
|
+
async readSnapshot(input3) {
|
|
29597
|
+
if (this.#closePromise) {
|
|
29598
|
+
return { ok: false, error: invalidState("Omp Adapter is closed") };
|
|
29599
|
+
}
|
|
29600
|
+
const parsedRef = nativeSessionRefSchema.safeParse(input3.nativeRef);
|
|
29601
|
+
if (!parsedRef.success || parsedRef.data.harnessId !== this.harnessId) {
|
|
29602
|
+
return {
|
|
29603
|
+
ok: false,
|
|
29604
|
+
error: {
|
|
29605
|
+
code: "invalidRequest",
|
|
29606
|
+
message: "Omp Native Session reference is invalid",
|
|
29607
|
+
retryable: false
|
|
29608
|
+
}
|
|
29609
|
+
};
|
|
29610
|
+
}
|
|
29611
|
+
const sourceRef = parsedRef.data;
|
|
29612
|
+
if (!isRecord10(sourceRef.locator) || typeof sourceRef.locator.sessionFile !== "string" || sourceRef.locator.sessionFile.length === 0) {
|
|
29613
|
+
return {
|
|
29614
|
+
ok: false,
|
|
29615
|
+
error: {
|
|
29616
|
+
code: "unsupported",
|
|
29617
|
+
message: "Omp Native Session Ref has no resumable Session file",
|
|
29618
|
+
retryable: false
|
|
29619
|
+
}
|
|
29620
|
+
};
|
|
29621
|
+
}
|
|
29622
|
+
try {
|
|
29623
|
+
const sessionFile = sourceRef.locator.sessionFile;
|
|
29624
|
+
const header = await readOmpSessionHeader(sessionFile);
|
|
29625
|
+
if (header.id !== sourceRef.nativeSessionId) {
|
|
29626
|
+
throw new OmpAdapterFaultError({
|
|
29627
|
+
code: "sessionNotFound",
|
|
29628
|
+
message: "Omp Session header identity does not match the persisted Native Session Ref",
|
|
29629
|
+
retryable: false
|
|
29630
|
+
});
|
|
29631
|
+
}
|
|
29632
|
+
const history = await readOmpSessionHistory(sessionFile);
|
|
29633
|
+
return {
|
|
29634
|
+
ok: true,
|
|
29635
|
+
value: mapOmpSnapshot(history, {
|
|
29636
|
+
sessionId: sourceRef.nativeSessionId,
|
|
29637
|
+
model: null
|
|
29638
|
+
})
|
|
29639
|
+
};
|
|
29640
|
+
} catch (error62) {
|
|
29641
|
+
if (isRecord10(error62) && error62.code === "ENOENT") {
|
|
29642
|
+
return {
|
|
29643
|
+
ok: false,
|
|
29644
|
+
error: {
|
|
29645
|
+
code: "sessionNotFound",
|
|
29646
|
+
message: "Omp Native Session is unavailable",
|
|
29647
|
+
retryable: false
|
|
29648
|
+
}
|
|
29649
|
+
};
|
|
29650
|
+
}
|
|
29651
|
+
return { ok: false, error: normalizedError(error62, "nativeFailure") };
|
|
29652
|
+
}
|
|
29653
|
+
}
|
|
29438
29654
|
subagents = {
|
|
29439
29655
|
readSnapshot: async (input3) => {
|
|
29440
29656
|
if (input3.parent.harnessId !== this.harnessId || input3.nativeSubagentId.trim().length === 0 || input3.cwd.length === 0) {
|