@codexhost/cli-darwin-x64 0.9.2 → 0.10.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/THIRD_PARTY_NOTICES.txt +0 -4
- package/app/codexhost-distribution.json +1 -1
- package/app/desktop-controller.mjs +49 -18
- package/app/host-runtime.mjs +1050 -673
- package/app/plugins/antigravity/plugin.mjs +18 -3
- package/app/plugins/claude-code/plugin.mjs +214 -7
- package/app/plugins/codebuddy/plugin.mjs +103 -5
- package/app/plugins/cursor-cli/plugin.mjs +152 -53
- package/app/plugins/deepseek-harness/plugin.mjs +622 -109
- package/app/plugins/enabled.json +2 -1
- package/app/plugins/grok/plugin.mjs +272 -79
- package/app/plugins/hermes/plugin.mjs +162 -63
- package/app/plugins/kimi-code/manifest.json +11 -0
- package/app/plugins/kimi-code/plugin.mjs +24226 -0
- package/app/plugins/kiro-cli/plugin.mjs +257 -65
- package/app/plugins/omp/plugin.mjs +407 -156
- package/app/plugins/opencode/plugin.mjs +18 -3
- package/app/plugins/pi/plugin.mjs +215 -5
- package/app/plugins/qoder/plugin.mjs +279 -187
- package/app/plugins/qoder-cn/plugin.mjs +279 -187
- package/app/plugins/workbuddy/plugin.mjs +102 -5
- package/app/renderer-extension.js +1445 -497
- package/bin/codexhost +0 -0
- package/libexec/codexhost-shim +0 -0
- package/libexec/codexhost-updater +0 -0
- package/package.json +1 -1
- package/licenses/opencodex-LICENSE.txt +0 -21
|
@@ -27866,10 +27866,21 @@ var harnessCommandDescriptorSchema = external_exports.object({
|
|
|
27866
27866
|
invocation: commandInvocationSchema,
|
|
27867
27867
|
label: commandLabelSchema,
|
|
27868
27868
|
description: commandDescriptionSchema.optional(),
|
|
27869
|
-
argumentMode: external_exports.enum(["none", "text"])
|
|
27869
|
+
argumentMode: external_exports.enum(["none", "text"]),
|
|
27870
|
+
/**
|
|
27871
|
+
* Native distinction reported by the Harness. Omitted when the Harness does
|
|
27872
|
+
* not tell skills and commands apart; consumers treat that as "command".
|
|
27873
|
+
*/
|
|
27874
|
+
kind: external_exports.enum(["command", "skill"]).optional()
|
|
27870
27875
|
}).strict();
|
|
27871
27876
|
var harnessCommandCatalogSchema = external_exports.object({
|
|
27872
|
-
commands: external_exports.array(harnessCommandDescriptorSchema)
|
|
27877
|
+
commands: external_exports.array(harnessCommandDescriptorSchema),
|
|
27878
|
+
/**
|
|
27879
|
+
* `live` when the catalog includes what a native Session reports for its
|
|
27880
|
+
* workspace (custom commands, skills); `static` for Adapter built-ins only.
|
|
27881
|
+
* Omitted by Adapters; set by the Host on inspection results.
|
|
27882
|
+
*/
|
|
27883
|
+
source: external_exports.enum(["live", "static"]).optional()
|
|
27873
27884
|
}).strict().superRefine((catalog, context) => {
|
|
27874
27885
|
const ids = /* @__PURE__ */ new Set();
|
|
27875
27886
|
for (const [index, command] of catalog.commands.entries()) {
|
|
@@ -27883,7 +27894,11 @@ var harnessCommandCatalogSchema = external_exports.object({
|
|
|
27883
27894
|
ids.add(command.id);
|
|
27884
27895
|
}
|
|
27885
27896
|
});
|
|
27886
|
-
var harnessCommandsInspectParamsSchema = external_exports.object({
|
|
27897
|
+
var harnessCommandsInspectParamsSchema = external_exports.object({
|
|
27898
|
+
harnessId: harnessIdSchema,
|
|
27899
|
+
/** Workspace of a draft without a Thread, for its live catalog when known. */
|
|
27900
|
+
cwd: external_exports.string().min(1).optional()
|
|
27901
|
+
}).strict();
|
|
27887
27902
|
var threadCommandsInspectParamsSchema = external_exports.object({
|
|
27888
27903
|
threadId: hostThreadIdSchema
|
|
27889
27904
|
}).strict();
|
|
@@ -28453,6 +28468,265 @@ function mapQoderException(error51) {
|
|
|
28453
28468
|
};
|
|
28454
28469
|
}
|
|
28455
28470
|
|
|
28471
|
+
// ../../harness-adapter/dist/approval.js
|
|
28472
|
+
function invalidRequest(message) {
|
|
28473
|
+
return { code: "invalidRequest", message, retryable: false };
|
|
28474
|
+
}
|
|
28475
|
+
function validateHostApprovalResponse(interaction, response) {
|
|
28476
|
+
return interaction.actions.some(({ id }) => id === response.actionId) ? null : invalidRequest("Approval Response contains an undeclared action ID");
|
|
28477
|
+
}
|
|
28478
|
+
|
|
28479
|
+
// ../../harness-adapter/dist/question.js
|
|
28480
|
+
function invalidRequest2(message) {
|
|
28481
|
+
return { code: "invalidRequest", message, retryable: false };
|
|
28482
|
+
}
|
|
28483
|
+
function validateHostQuestionResponse(interaction, response) {
|
|
28484
|
+
const questionIds = new Set(interaction.questions.map(({ id }) => id));
|
|
28485
|
+
if (response.cancelled) {
|
|
28486
|
+
return Object.keys(response.answers).length === 0 ? null : invalidRequest2("Cancelled Question Response must not contain answers");
|
|
28487
|
+
}
|
|
28488
|
+
for (const answerId of Object.keys(response.answers)) {
|
|
28489
|
+
if (!questionIds.has(answerId)) {
|
|
28490
|
+
return invalidRequest2("Question Response contains an unknown Question ID");
|
|
28491
|
+
}
|
|
28492
|
+
}
|
|
28493
|
+
for (const question of interaction.questions) {
|
|
28494
|
+
const answers = response.answers[question.id] ?? [];
|
|
28495
|
+
if (!question.optional && answers.length === 0) {
|
|
28496
|
+
return invalidRequest2("Question Response omits a required answer");
|
|
28497
|
+
}
|
|
28498
|
+
if (question.type === "text") {
|
|
28499
|
+
if (answers.length > 1) {
|
|
28500
|
+
return invalidRequest2("Text Question accepts at most one answer");
|
|
28501
|
+
}
|
|
28502
|
+
continue;
|
|
28503
|
+
}
|
|
28504
|
+
if (!question.multiple && answers.length > 1) {
|
|
28505
|
+
return invalidRequest2("Single-choice Question accepts at most one answer");
|
|
28506
|
+
}
|
|
28507
|
+
const declared = new Set(question.options.map(({ value }) => value));
|
|
28508
|
+
if (!question.allowOther && answers.some((answer) => !declared.has(answer))) {
|
|
28509
|
+
return invalidRequest2("Question Response contains an undeclared choice");
|
|
28510
|
+
}
|
|
28511
|
+
}
|
|
28512
|
+
return null;
|
|
28513
|
+
}
|
|
28514
|
+
|
|
28515
|
+
// ../../harness-adapter/dist/output-channel.js
|
|
28516
|
+
var HarnessOutputChannel = class {
|
|
28517
|
+
outputs;
|
|
28518
|
+
#consumerCreated = false;
|
|
28519
|
+
#ended = false;
|
|
28520
|
+
#pending = [];
|
|
28521
|
+
#values = [];
|
|
28522
|
+
constructor() {
|
|
28523
|
+
this.outputs = {
|
|
28524
|
+
[Symbol.asyncIterator]: () => {
|
|
28525
|
+
if (this.#consumerCreated) {
|
|
28526
|
+
throw new Error("Harness outputs allow only one consumer");
|
|
28527
|
+
}
|
|
28528
|
+
this.#consumerCreated = true;
|
|
28529
|
+
return {
|
|
28530
|
+
next: () => this.#next()
|
|
28531
|
+
};
|
|
28532
|
+
}
|
|
28533
|
+
};
|
|
28534
|
+
}
|
|
28535
|
+
emit(value) {
|
|
28536
|
+
if (this.#ended)
|
|
28537
|
+
return false;
|
|
28538
|
+
const resolve = this.#pending.shift();
|
|
28539
|
+
if (resolve)
|
|
28540
|
+
resolve({ done: false, value });
|
|
28541
|
+
else
|
|
28542
|
+
this.#values.push(value);
|
|
28543
|
+
return true;
|
|
28544
|
+
}
|
|
28545
|
+
end() {
|
|
28546
|
+
if (this.#ended)
|
|
28547
|
+
return;
|
|
28548
|
+
this.#ended = true;
|
|
28549
|
+
if (this.#values.length !== 0)
|
|
28550
|
+
return;
|
|
28551
|
+
for (const resolve of this.#pending.splice(0))
|
|
28552
|
+
resolve({ done: true, value: void 0 });
|
|
28553
|
+
}
|
|
28554
|
+
#next() {
|
|
28555
|
+
const value = this.#values.shift();
|
|
28556
|
+
if (value !== void 0)
|
|
28557
|
+
return Promise.resolve({ done: false, value });
|
|
28558
|
+
if (this.#ended)
|
|
28559
|
+
return Promise.resolve({ done: true, value: void 0 });
|
|
28560
|
+
return new Promise((resolve) => this.#pending.push(resolve));
|
|
28561
|
+
}
|
|
28562
|
+
};
|
|
28563
|
+
|
|
28564
|
+
// ../../harness-adapter/dist/usage.js
|
|
28565
|
+
var tokenFields = [
|
|
28566
|
+
"inputTokens",
|
|
28567
|
+
"cachedInputTokens",
|
|
28568
|
+
"cacheWriteInputTokens",
|
|
28569
|
+
"outputTokens",
|
|
28570
|
+
"outputTokensPerSecond",
|
|
28571
|
+
"reasoningOutputTokens",
|
|
28572
|
+
"totalTokens",
|
|
28573
|
+
"contextWindowTokens",
|
|
28574
|
+
"contextUsedTokens"
|
|
28575
|
+
];
|
|
28576
|
+
var safeIntegerFields = [
|
|
28577
|
+
"planFiveHourResetsAtUnix",
|
|
28578
|
+
"planSevenDayResetsAtUnix"
|
|
28579
|
+
];
|
|
28580
|
+
var percentFields = [
|
|
28581
|
+
"cacheHitRatePercent",
|
|
28582
|
+
"planFiveHourUsedPercent",
|
|
28583
|
+
"planSevenDayUsedPercent"
|
|
28584
|
+
];
|
|
28585
|
+
var usageFields = /* @__PURE__ */ new Set([
|
|
28586
|
+
...tokenFields,
|
|
28587
|
+
...safeIntegerFields,
|
|
28588
|
+
...percentFields,
|
|
28589
|
+
"totalCostUsd",
|
|
28590
|
+
"totalCredits",
|
|
28591
|
+
"contextUsagePercent"
|
|
28592
|
+
]);
|
|
28593
|
+
function isRecord(value) {
|
|
28594
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
28595
|
+
}
|
|
28596
|
+
function parseHostUsage(value) {
|
|
28597
|
+
if (!isRecord(value))
|
|
28598
|
+
throw new Error("Harness Usage must be an object");
|
|
28599
|
+
const keys = Object.keys(value);
|
|
28600
|
+
if (keys.length === 0)
|
|
28601
|
+
throw new Error("Harness Usage must contain a reliable field");
|
|
28602
|
+
for (const key of keys) {
|
|
28603
|
+
if (!usageFields.has(key)) {
|
|
28604
|
+
throw new Error(`Harness Usage contains unknown field '${key}'`);
|
|
28605
|
+
}
|
|
28606
|
+
}
|
|
28607
|
+
for (const field of ["totalCredits", "contextUsagePercent"]) {
|
|
28608
|
+
const candidate = value[field];
|
|
28609
|
+
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0)) {
|
|
28610
|
+
throw new Error(`Harness Usage '${field}' must be a finite non-negative number`);
|
|
28611
|
+
}
|
|
28612
|
+
}
|
|
28613
|
+
for (const field of tokenFields) {
|
|
28614
|
+
const candidate = value[field];
|
|
28615
|
+
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
|
|
28616
|
+
throw new Error(`Harness Usage '${field}' must be a non-negative safe integer`);
|
|
28617
|
+
}
|
|
28618
|
+
}
|
|
28619
|
+
for (const field of safeIntegerFields) {
|
|
28620
|
+
const candidate = value[field];
|
|
28621
|
+
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
|
|
28622
|
+
throw new Error(`Harness Usage '${field}' must be a non-negative safe integer`);
|
|
28623
|
+
}
|
|
28624
|
+
}
|
|
28625
|
+
if (value.outputTokensPerSecond !== void 0 && (typeof value.outputTokensPerSecond !== "number" || !Number.isFinite(value.outputTokensPerSecond) || value.outputTokensPerSecond < 0)) {
|
|
28626
|
+
throw new Error("Harness Usage 'outputTokensPerSecond' must be a finite non-negative number");
|
|
28627
|
+
}
|
|
28628
|
+
if (value.totalCostUsd !== void 0 && (typeof value.totalCostUsd !== "number" || !Number.isFinite(value.totalCostUsd) || value.totalCostUsd < 0)) {
|
|
28629
|
+
throw new Error("Harness Usage 'totalCostUsd' must be a finite non-negative number");
|
|
28630
|
+
}
|
|
28631
|
+
for (const field of percentFields) {
|
|
28632
|
+
const candidate = value[field];
|
|
28633
|
+
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0 || candidate > 100)) {
|
|
28634
|
+
throw new Error(`Harness Usage '${field}' must be between 0 and 100`);
|
|
28635
|
+
}
|
|
28636
|
+
}
|
|
28637
|
+
const hasContextUsed = value.contextUsedTokens !== void 0;
|
|
28638
|
+
const hasContextWindow = value.contextWindowTokens !== void 0;
|
|
28639
|
+
if (hasContextUsed !== hasContextWindow) {
|
|
28640
|
+
throw new Error("Harness Usage context fields must be provided together");
|
|
28641
|
+
}
|
|
28642
|
+
if (hasContextWindow && value.contextWindowTokens === 0) {
|
|
28643
|
+
throw new Error("Harness Usage 'contextWindowTokens' must be greater than zero");
|
|
28644
|
+
}
|
|
28645
|
+
if (value.planFiveHourResetsAtUnix !== void 0 && value.planFiveHourUsedPercent === void 0) {
|
|
28646
|
+
throw new Error("Harness Usage 'planFiveHourResetsAtUnix' must be provided with 'planFiveHourUsedPercent'");
|
|
28647
|
+
}
|
|
28648
|
+
if (value.planSevenDayResetsAtUnix !== void 0 && value.planSevenDayUsedPercent === void 0) {
|
|
28649
|
+
throw new Error("Harness Usage 'planSevenDayResetsAtUnix' must be provided with 'planSevenDayUsedPercent'");
|
|
28650
|
+
}
|
|
28651
|
+
return { ...value };
|
|
28652
|
+
}
|
|
28653
|
+
|
|
28654
|
+
// ../../harness-adapter/dist/live-command-catalog.js
|
|
28655
|
+
var COMMON_EXCLUDED_LIVE_COMMANDS = /* @__PURE__ */ new Set([
|
|
28656
|
+
// Session lifecycle
|
|
28657
|
+
"branch",
|
|
28658
|
+
"clear",
|
|
28659
|
+
"exit",
|
|
28660
|
+
"fork",
|
|
28661
|
+
"fresh",
|
|
28662
|
+
"new",
|
|
28663
|
+
"quit",
|
|
28664
|
+
"rename",
|
|
28665
|
+
"rename-chat",
|
|
28666
|
+
"reset",
|
|
28667
|
+
"resume",
|
|
28668
|
+
"rewind",
|
|
28669
|
+
"session",
|
|
28670
|
+
"sessions",
|
|
28671
|
+
// Desktop-owned configuration
|
|
28672
|
+
"autocompact",
|
|
28673
|
+
"color",
|
|
28674
|
+
"config",
|
|
28675
|
+
"effort",
|
|
28676
|
+
"fast",
|
|
28677
|
+
"keybindings",
|
|
28678
|
+
"model",
|
|
28679
|
+
"models",
|
|
28680
|
+
"output-style",
|
|
28681
|
+
"permissions",
|
|
28682
|
+
"settings",
|
|
28683
|
+
"statusline",
|
|
28684
|
+
"terminal-setup",
|
|
28685
|
+
"theme",
|
|
28686
|
+
"vim",
|
|
28687
|
+
// Trust and approval policy
|
|
28688
|
+
"always-approve",
|
|
28689
|
+
"auto-mode-setup",
|
|
28690
|
+
// Native login
|
|
28691
|
+
"login",
|
|
28692
|
+
"logout",
|
|
28693
|
+
// Work outliving the Turn
|
|
28694
|
+
"autopilot",
|
|
28695
|
+
"background",
|
|
28696
|
+
"bg",
|
|
28697
|
+
"goal",
|
|
28698
|
+
"jobs",
|
|
28699
|
+
"loop",
|
|
28700
|
+
"multitask",
|
|
28701
|
+
"queue",
|
|
28702
|
+
"remote-control",
|
|
28703
|
+
"schedule",
|
|
28704
|
+
"steer",
|
|
28705
|
+
// Native terminal UI
|
|
28706
|
+
"copy",
|
|
28707
|
+
"debug",
|
|
28708
|
+
"feedback",
|
|
28709
|
+
"heapdump",
|
|
28710
|
+
"share",
|
|
28711
|
+
"shell",
|
|
28712
|
+
// Plugin and MCP management
|
|
28713
|
+
"marketplace",
|
|
28714
|
+
"mcp",
|
|
28715
|
+
"plugins",
|
|
28716
|
+
"reload-plugins"
|
|
28717
|
+
]);
|
|
28718
|
+
var COMMON_EXCLUDED_LIVE_COMMAND_PREFIXES = ["__", "hooks-"];
|
|
28719
|
+
function isExcludedLiveCommand(name, kind, extra = {}) {
|
|
28720
|
+
const normalized = name.trim().replace(/^\//u, "");
|
|
28721
|
+
if (new Set(extra.names ?? []).has(normalized))
|
|
28722
|
+
return true;
|
|
28723
|
+
if (extra.prefixes?.some((prefix) => normalized.startsWith(prefix)))
|
|
28724
|
+
return true;
|
|
28725
|
+
if (kind === "skill")
|
|
28726
|
+
return false;
|
|
28727
|
+
return COMMON_EXCLUDED_LIVE_COMMANDS.has(normalized) || COMMON_EXCLUDED_LIVE_COMMAND_PREFIXES.some((prefix) => normalized.startsWith(prefix));
|
|
28728
|
+
}
|
|
28729
|
+
|
|
28456
28730
|
// ../qoder/dist/qoder-slash-commands.js
|
|
28457
28731
|
var QODER_FALLBACK_COMMAND_CATALOG = harnessCommandCatalogSchema.parse({
|
|
28458
28732
|
commands: [
|
|
@@ -28491,7 +28765,7 @@ function mapQoderSlashCommands(commands) {
|
|
|
28491
28765
|
if (typeof rawName !== "string")
|
|
28492
28766
|
continue;
|
|
28493
28767
|
const cleanName = rawName.replace(/^\//, "").trim().toLowerCase();
|
|
28494
|
-
if (!cleanName)
|
|
28768
|
+
if (!cleanName || isExcludedLiveCommand(cleanName, "command"))
|
|
28495
28769
|
continue;
|
|
28496
28770
|
const id = `qoder.${cleanName}`;
|
|
28497
28771
|
if (seenIds.has(id))
|
|
@@ -29089,189 +29363,6 @@ function mapToQoderPermissionMode(id) {
|
|
|
29089
29363
|
// ../qoder/dist/qoder-sdk-transport.js
|
|
29090
29364
|
import { randomUUID } from "node:crypto";
|
|
29091
29365
|
|
|
29092
|
-
// ../../harness-adapter/dist/approval.js
|
|
29093
|
-
function invalidRequest(message) {
|
|
29094
|
-
return { code: "invalidRequest", message, retryable: false };
|
|
29095
|
-
}
|
|
29096
|
-
function validateHostApprovalResponse(interaction, response) {
|
|
29097
|
-
return interaction.actions.some(({ id }) => id === response.actionId) ? null : invalidRequest("Approval Response contains an undeclared action ID");
|
|
29098
|
-
}
|
|
29099
|
-
|
|
29100
|
-
// ../../harness-adapter/dist/question.js
|
|
29101
|
-
function invalidRequest2(message) {
|
|
29102
|
-
return { code: "invalidRequest", message, retryable: false };
|
|
29103
|
-
}
|
|
29104
|
-
function validateHostQuestionResponse(interaction, response) {
|
|
29105
|
-
const questionIds = new Set(interaction.questions.map(({ id }) => id));
|
|
29106
|
-
if (response.cancelled) {
|
|
29107
|
-
return Object.keys(response.answers).length === 0 ? null : invalidRequest2("Cancelled Question Response must not contain answers");
|
|
29108
|
-
}
|
|
29109
|
-
for (const answerId of Object.keys(response.answers)) {
|
|
29110
|
-
if (!questionIds.has(answerId)) {
|
|
29111
|
-
return invalidRequest2("Question Response contains an unknown Question ID");
|
|
29112
|
-
}
|
|
29113
|
-
}
|
|
29114
|
-
for (const question of interaction.questions) {
|
|
29115
|
-
const answers = response.answers[question.id] ?? [];
|
|
29116
|
-
if (!question.optional && answers.length === 0) {
|
|
29117
|
-
return invalidRequest2("Question Response omits a required answer");
|
|
29118
|
-
}
|
|
29119
|
-
if (question.type === "text") {
|
|
29120
|
-
if (answers.length > 1) {
|
|
29121
|
-
return invalidRequest2("Text Question accepts at most one answer");
|
|
29122
|
-
}
|
|
29123
|
-
continue;
|
|
29124
|
-
}
|
|
29125
|
-
if (!question.multiple && answers.length > 1) {
|
|
29126
|
-
return invalidRequest2("Single-choice Question accepts at most one answer");
|
|
29127
|
-
}
|
|
29128
|
-
const declared = new Set(question.options.map(({ value }) => value));
|
|
29129
|
-
if (!question.allowOther && answers.some((answer) => !declared.has(answer))) {
|
|
29130
|
-
return invalidRequest2("Question Response contains an undeclared choice");
|
|
29131
|
-
}
|
|
29132
|
-
}
|
|
29133
|
-
return null;
|
|
29134
|
-
}
|
|
29135
|
-
|
|
29136
|
-
// ../../harness-adapter/dist/output-channel.js
|
|
29137
|
-
var HarnessOutputChannel = class {
|
|
29138
|
-
outputs;
|
|
29139
|
-
#consumerCreated = false;
|
|
29140
|
-
#ended = false;
|
|
29141
|
-
#pending = [];
|
|
29142
|
-
#values = [];
|
|
29143
|
-
constructor() {
|
|
29144
|
-
this.outputs = {
|
|
29145
|
-
[Symbol.asyncIterator]: () => {
|
|
29146
|
-
if (this.#consumerCreated) {
|
|
29147
|
-
throw new Error("Harness outputs allow only one consumer");
|
|
29148
|
-
}
|
|
29149
|
-
this.#consumerCreated = true;
|
|
29150
|
-
return {
|
|
29151
|
-
next: () => this.#next()
|
|
29152
|
-
};
|
|
29153
|
-
}
|
|
29154
|
-
};
|
|
29155
|
-
}
|
|
29156
|
-
emit(value) {
|
|
29157
|
-
if (this.#ended)
|
|
29158
|
-
return false;
|
|
29159
|
-
const resolve = this.#pending.shift();
|
|
29160
|
-
if (resolve)
|
|
29161
|
-
resolve({ done: false, value });
|
|
29162
|
-
else
|
|
29163
|
-
this.#values.push(value);
|
|
29164
|
-
return true;
|
|
29165
|
-
}
|
|
29166
|
-
end() {
|
|
29167
|
-
if (this.#ended)
|
|
29168
|
-
return;
|
|
29169
|
-
this.#ended = true;
|
|
29170
|
-
if (this.#values.length !== 0)
|
|
29171
|
-
return;
|
|
29172
|
-
for (const resolve of this.#pending.splice(0))
|
|
29173
|
-
resolve({ done: true, value: void 0 });
|
|
29174
|
-
}
|
|
29175
|
-
#next() {
|
|
29176
|
-
const value = this.#values.shift();
|
|
29177
|
-
if (value !== void 0)
|
|
29178
|
-
return Promise.resolve({ done: false, value });
|
|
29179
|
-
if (this.#ended)
|
|
29180
|
-
return Promise.resolve({ done: true, value: void 0 });
|
|
29181
|
-
return new Promise((resolve) => this.#pending.push(resolve));
|
|
29182
|
-
}
|
|
29183
|
-
};
|
|
29184
|
-
|
|
29185
|
-
// ../../harness-adapter/dist/usage.js
|
|
29186
|
-
var tokenFields = [
|
|
29187
|
-
"inputTokens",
|
|
29188
|
-
"cachedInputTokens",
|
|
29189
|
-
"cacheWriteInputTokens",
|
|
29190
|
-
"outputTokens",
|
|
29191
|
-
"outputTokensPerSecond",
|
|
29192
|
-
"reasoningOutputTokens",
|
|
29193
|
-
"totalTokens",
|
|
29194
|
-
"contextWindowTokens",
|
|
29195
|
-
"contextUsedTokens"
|
|
29196
|
-
];
|
|
29197
|
-
var safeIntegerFields = [
|
|
29198
|
-
"planFiveHourResetsAtUnix",
|
|
29199
|
-
"planSevenDayResetsAtUnix"
|
|
29200
|
-
];
|
|
29201
|
-
var percentFields = [
|
|
29202
|
-
"cacheHitRatePercent",
|
|
29203
|
-
"planFiveHourUsedPercent",
|
|
29204
|
-
"planSevenDayUsedPercent"
|
|
29205
|
-
];
|
|
29206
|
-
var usageFields = /* @__PURE__ */ new Set([
|
|
29207
|
-
...tokenFields,
|
|
29208
|
-
...safeIntegerFields,
|
|
29209
|
-
...percentFields,
|
|
29210
|
-
"totalCostUsd",
|
|
29211
|
-
"totalCredits",
|
|
29212
|
-
"contextUsagePercent"
|
|
29213
|
-
]);
|
|
29214
|
-
function isRecord(value) {
|
|
29215
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
29216
|
-
}
|
|
29217
|
-
function parseHostUsage(value) {
|
|
29218
|
-
if (!isRecord(value))
|
|
29219
|
-
throw new Error("Harness Usage must be an object");
|
|
29220
|
-
const keys = Object.keys(value);
|
|
29221
|
-
if (keys.length === 0)
|
|
29222
|
-
throw new Error("Harness Usage must contain a reliable field");
|
|
29223
|
-
for (const key of keys) {
|
|
29224
|
-
if (!usageFields.has(key)) {
|
|
29225
|
-
throw new Error(`Harness Usage contains unknown field '${key}'`);
|
|
29226
|
-
}
|
|
29227
|
-
}
|
|
29228
|
-
for (const field of ["totalCredits", "contextUsagePercent"]) {
|
|
29229
|
-
const candidate = value[field];
|
|
29230
|
-
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0)) {
|
|
29231
|
-
throw new Error(`Harness Usage '${field}' must be a finite non-negative number`);
|
|
29232
|
-
}
|
|
29233
|
-
}
|
|
29234
|
-
for (const field of tokenFields) {
|
|
29235
|
-
const candidate = value[field];
|
|
29236
|
-
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
|
|
29237
|
-
throw new Error(`Harness Usage '${field}' must be a non-negative safe integer`);
|
|
29238
|
-
}
|
|
29239
|
-
}
|
|
29240
|
-
for (const field of safeIntegerFields) {
|
|
29241
|
-
const candidate = value[field];
|
|
29242
|
-
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
|
|
29243
|
-
throw new Error(`Harness Usage '${field}' must be a non-negative safe integer`);
|
|
29244
|
-
}
|
|
29245
|
-
}
|
|
29246
|
-
if (value.outputTokensPerSecond !== void 0 && (typeof value.outputTokensPerSecond !== "number" || !Number.isFinite(value.outputTokensPerSecond) || value.outputTokensPerSecond < 0)) {
|
|
29247
|
-
throw new Error("Harness Usage 'outputTokensPerSecond' must be a finite non-negative number");
|
|
29248
|
-
}
|
|
29249
|
-
if (value.totalCostUsd !== void 0 && (typeof value.totalCostUsd !== "number" || !Number.isFinite(value.totalCostUsd) || value.totalCostUsd < 0)) {
|
|
29250
|
-
throw new Error("Harness Usage 'totalCostUsd' must be a finite non-negative number");
|
|
29251
|
-
}
|
|
29252
|
-
for (const field of percentFields) {
|
|
29253
|
-
const candidate = value[field];
|
|
29254
|
-
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0 || candidate > 100)) {
|
|
29255
|
-
throw new Error(`Harness Usage '${field}' must be between 0 and 100`);
|
|
29256
|
-
}
|
|
29257
|
-
}
|
|
29258
|
-
const hasContextUsed = value.contextUsedTokens !== void 0;
|
|
29259
|
-
const hasContextWindow = value.contextWindowTokens !== void 0;
|
|
29260
|
-
if (hasContextUsed !== hasContextWindow) {
|
|
29261
|
-
throw new Error("Harness Usage context fields must be provided together");
|
|
29262
|
-
}
|
|
29263
|
-
if (hasContextWindow && value.contextWindowTokens === 0) {
|
|
29264
|
-
throw new Error("Harness Usage 'contextWindowTokens' must be greater than zero");
|
|
29265
|
-
}
|
|
29266
|
-
if (value.planFiveHourResetsAtUnix !== void 0 && value.planFiveHourUsedPercent === void 0) {
|
|
29267
|
-
throw new Error("Harness Usage 'planFiveHourResetsAtUnix' must be provided with 'planFiveHourUsedPercent'");
|
|
29268
|
-
}
|
|
29269
|
-
if (value.planSevenDayResetsAtUnix !== void 0 && value.planSevenDayUsedPercent === void 0) {
|
|
29270
|
-
throw new Error("Harness Usage 'planSevenDayResetsAtUnix' must be provided with 'planSevenDayUsedPercent'");
|
|
29271
|
-
}
|
|
29272
|
-
return { ...value };
|
|
29273
|
-
}
|
|
29274
|
-
|
|
29275
29366
|
// ../../../node_modules/@qoder-ai/qoder-agent-sdk/dist/index.js
|
|
29276
29367
|
var dist_exports = {};
|
|
29277
29368
|
__export(dist_exports, {
|
|
@@ -51955,6 +52046,7 @@ var QoderAdapter = class {
|
|
|
51955
52046
|
harnessId;
|
|
51956
52047
|
#variant;
|
|
51957
52048
|
commandCatalog = QODER_FALLBACK_COMMAND_CATALOG;
|
|
52049
|
+
liveCommandCatalog = true;
|
|
51958
52050
|
#commandOverride;
|
|
51959
52051
|
#environment;
|
|
51960
52052
|
#platform;
|
|
@@ -15282,10 +15282,21 @@ var harnessCommandDescriptorSchema = external_exports.object({
|
|
|
15282
15282
|
invocation: commandInvocationSchema,
|
|
15283
15283
|
label: commandLabelSchema,
|
|
15284
15284
|
description: commandDescriptionSchema.optional(),
|
|
15285
|
-
argumentMode: external_exports.enum(["none", "text"])
|
|
15285
|
+
argumentMode: external_exports.enum(["none", "text"]),
|
|
15286
|
+
/**
|
|
15287
|
+
* Native distinction reported by the Harness. Omitted when the Harness does
|
|
15288
|
+
* not tell skills and commands apart; consumers treat that as "command".
|
|
15289
|
+
*/
|
|
15290
|
+
kind: external_exports.enum(["command", "skill"]).optional()
|
|
15286
15291
|
}).strict();
|
|
15287
15292
|
var harnessCommandCatalogSchema = external_exports.object({
|
|
15288
|
-
commands: external_exports.array(harnessCommandDescriptorSchema)
|
|
15293
|
+
commands: external_exports.array(harnessCommandDescriptorSchema),
|
|
15294
|
+
/**
|
|
15295
|
+
* `live` when the catalog includes what a native Session reports for its
|
|
15296
|
+
* workspace (custom commands, skills); `static` for Adapter built-ins only.
|
|
15297
|
+
* Omitted by Adapters; set by the Host on inspection results.
|
|
15298
|
+
*/
|
|
15299
|
+
source: external_exports.enum(["live", "static"]).optional()
|
|
15289
15300
|
}).strict().superRefine((catalog, context) => {
|
|
15290
15301
|
const ids = /* @__PURE__ */ new Set();
|
|
15291
15302
|
for (const [index, command] of catalog.commands.entries()) {
|
|
@@ -15299,7 +15310,11 @@ var harnessCommandCatalogSchema = external_exports.object({
|
|
|
15299
15310
|
ids.add(command.id);
|
|
15300
15311
|
}
|
|
15301
15312
|
});
|
|
15302
|
-
var harnessCommandsInspectParamsSchema = external_exports.object({
|
|
15313
|
+
var harnessCommandsInspectParamsSchema = external_exports.object({
|
|
15314
|
+
harnessId: harnessIdSchema,
|
|
15315
|
+
/** Workspace of a draft without a Thread, for its live catalog when known. */
|
|
15316
|
+
cwd: external_exports.string().min(1).optional()
|
|
15317
|
+
}).strict();
|
|
15303
15318
|
var threadCommandsInspectParamsSchema = external_exports.object({
|
|
15304
15319
|
threadId: hostThreadIdSchema
|
|
15305
15320
|
}).strict();
|
|
@@ -15655,6 +15670,82 @@ function parseHostUsage(value) {
|
|
|
15655
15670
|
return { ...value };
|
|
15656
15671
|
}
|
|
15657
15672
|
|
|
15673
|
+
// ../../harness-adapter/dist/live-command-catalog.js
|
|
15674
|
+
var COMMON_EXCLUDED_LIVE_COMMANDS = /* @__PURE__ */ new Set([
|
|
15675
|
+
// Session lifecycle
|
|
15676
|
+
"branch",
|
|
15677
|
+
"clear",
|
|
15678
|
+
"exit",
|
|
15679
|
+
"fork",
|
|
15680
|
+
"fresh",
|
|
15681
|
+
"new",
|
|
15682
|
+
"quit",
|
|
15683
|
+
"rename",
|
|
15684
|
+
"rename-chat",
|
|
15685
|
+
"reset",
|
|
15686
|
+
"resume",
|
|
15687
|
+
"rewind",
|
|
15688
|
+
"session",
|
|
15689
|
+
"sessions",
|
|
15690
|
+
// Desktop-owned configuration
|
|
15691
|
+
"autocompact",
|
|
15692
|
+
"color",
|
|
15693
|
+
"config",
|
|
15694
|
+
"effort",
|
|
15695
|
+
"fast",
|
|
15696
|
+
"keybindings",
|
|
15697
|
+
"model",
|
|
15698
|
+
"models",
|
|
15699
|
+
"output-style",
|
|
15700
|
+
"permissions",
|
|
15701
|
+
"settings",
|
|
15702
|
+
"statusline",
|
|
15703
|
+
"terminal-setup",
|
|
15704
|
+
"theme",
|
|
15705
|
+
"vim",
|
|
15706
|
+
// Trust and approval policy
|
|
15707
|
+
"always-approve",
|
|
15708
|
+
"auto-mode-setup",
|
|
15709
|
+
// Native login
|
|
15710
|
+
"login",
|
|
15711
|
+
"logout",
|
|
15712
|
+
// Work outliving the Turn
|
|
15713
|
+
"autopilot",
|
|
15714
|
+
"background",
|
|
15715
|
+
"bg",
|
|
15716
|
+
"goal",
|
|
15717
|
+
"jobs",
|
|
15718
|
+
"loop",
|
|
15719
|
+
"multitask",
|
|
15720
|
+
"queue",
|
|
15721
|
+
"remote-control",
|
|
15722
|
+
"schedule",
|
|
15723
|
+
"steer",
|
|
15724
|
+
// Native terminal UI
|
|
15725
|
+
"copy",
|
|
15726
|
+
"debug",
|
|
15727
|
+
"feedback",
|
|
15728
|
+
"heapdump",
|
|
15729
|
+
"share",
|
|
15730
|
+
"shell",
|
|
15731
|
+
// Plugin and MCP management
|
|
15732
|
+
"marketplace",
|
|
15733
|
+
"mcp",
|
|
15734
|
+
"plugins",
|
|
15735
|
+
"reload-plugins"
|
|
15736
|
+
]);
|
|
15737
|
+
var COMMON_EXCLUDED_LIVE_COMMAND_PREFIXES = ["__", "hooks-"];
|
|
15738
|
+
function isExcludedLiveCommand(name, kind, extra = {}) {
|
|
15739
|
+
const normalized = name.trim().replace(/^\//u, "");
|
|
15740
|
+
if (new Set(extra.names ?? []).has(normalized))
|
|
15741
|
+
return true;
|
|
15742
|
+
if (extra.prefixes?.some((prefix) => normalized.startsWith(prefix)))
|
|
15743
|
+
return true;
|
|
15744
|
+
if (kind === "skill")
|
|
15745
|
+
return false;
|
|
15746
|
+
return COMMON_EXCLUDED_LIVE_COMMANDS.has(normalized) || COMMON_EXCLUDED_LIVE_COMMAND_PREFIXES.some((prefix) => normalized.startsWith(prefix));
|
|
15747
|
+
}
|
|
15748
|
+
|
|
15658
15749
|
// ../../harness-broker/dist/protocol.js
|
|
15659
15750
|
var HARNESS_BROKER_PROTOCOL_VERSION = 1;
|
|
15660
15751
|
var HARNESS_BROKER_MAX_FRAME_BYTES = 8 * 1024 * 1024;
|
|
@@ -16450,6 +16541,7 @@ var BrokeredHarnessSession = class {
|
|
|
16450
16541
|
var BrokeredHarnessAdapter = class {
|
|
16451
16542
|
#sessions = /* @__PURE__ */ new Set();
|
|
16452
16543
|
commandCatalog;
|
|
16544
|
+
liveCommandCatalog;
|
|
16453
16545
|
harnessId;
|
|
16454
16546
|
#descriptorPath;
|
|
16455
16547
|
#forwardEnvironment;
|
|
@@ -16472,6 +16564,8 @@ var BrokeredHarnessAdapter = class {
|
|
|
16472
16564
|
this.#forwardEnvironment = input.forwardDelegationEnvironment === true;
|
|
16473
16565
|
if (input.commandCatalog)
|
|
16474
16566
|
this.commandCatalog = input.commandCatalog;
|
|
16567
|
+
if (input.liveCommandCatalog)
|
|
16568
|
+
this.liveCommandCatalog = true;
|
|
16475
16569
|
this.#descriptorPath = input.descriptorPath ?? defaultHarnessBrokerDescriptorPath(input.environment, this.harnessId);
|
|
16476
16570
|
}
|
|
16477
16571
|
async inspectAccount() {
|
|
@@ -21840,7 +21934,8 @@ function commandCatalog(value, profile = CODEBUDDY_RUNTIME_PROFILE) {
|
|
|
21840
21934
|
return {
|
|
21841
21935
|
commands: rows(value).flatMap((entry) => {
|
|
21842
21936
|
const name = text(entry.name).replace(/^\//u, "");
|
|
21843
|
-
|
|
21937
|
+
const skill = record2(entry._meta).type === "skill";
|
|
21938
|
+
if (excluded.has(name) || seen.has(name) || isExcludedLiveCommand(name, skill ? "skill" : "command"))
|
|
21844
21939
|
return [];
|
|
21845
21940
|
const parsed = harnessCommandCatalogSchema.safeParse({
|
|
21846
21941
|
commands: [
|
|
@@ -21849,7 +21944,8 @@ function commandCatalog(value, profile = CODEBUDDY_RUNTIME_PROFILE) {
|
|
|
21849
21944
|
invocation: `/${name}`,
|
|
21850
21945
|
label: name,
|
|
21851
21946
|
...text(entry.description).trim() ? { description: text(entry.description).trim().slice(0, 512) } : {},
|
|
21852
|
-
argumentMode: name === "compact" || record2(entry.input).hint || record2(entry._meta).type === "skill" ? "text" : "none"
|
|
21947
|
+
argumentMode: name === "compact" || record2(entry.input).hint || record2(entry._meta).type === "skill" ? "text" : "none",
|
|
21948
|
+
...record2(entry._meta).type === "skill" ? { kind: "skill" } : {}
|
|
21853
21949
|
}
|
|
21854
21950
|
]
|
|
21855
21951
|
});
|
|
@@ -24307,6 +24403,7 @@ var CodeBuddyAdapter = class {
|
|
|
24307
24403
|
options;
|
|
24308
24404
|
harnessId;
|
|
24309
24405
|
commandCatalog;
|
|
24406
|
+
liveCommandCatalog = true;
|
|
24310
24407
|
subagents = {
|
|
24311
24408
|
readSnapshot: async ({ parent, nativeSubagentId, cwd }) => {
|
|
24312
24409
|
try {
|