@super-one/cli 0.50.1-alpha → 0.50.3-alpha
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/MANIFEST.json +2 -2
- package/lib/cli.mjs +243 -28
- package/package.json +1 -1
package/MANIFEST.json
CHANGED
package/lib/cli.mjs
CHANGED
|
@@ -372,7 +372,7 @@ var init_host_action_superone_descriptors = __esm({
|
|
|
372
372
|
},
|
|
373
373
|
{
|
|
374
374
|
"name": "read_manual",
|
|
375
|
-
"description": "Read bundled SuperOne manuals. Omit domain to list all domains; pass domain to list its topics; pass domain with topic to read one topic. For widget, pass either topic or modules, never both. Use product/debug for support and runtime paths, miniapp/overview before mini-app development, and media/overview before provider-specific options. Use config_read for live settings and widget_list_templates for saved widgets.",
|
|
375
|
+
"description": "Read bundled SuperOne manuals. Omit domain to list all domains; pass domain to list its topics; pass domain with topic to read one topic. For widget, pass either topic or modules, never both. Use product/contribute for GitHub issues and PRs (issue-first, optional red\u2013green), product/debug for support and runtime paths, miniapp/overview before mini-app development, and media/overview before provider-specific options. Use config_read for live settings and widget_list_templates for saved widgets.",
|
|
376
376
|
"inputSchema": {
|
|
377
377
|
"type": "object",
|
|
378
378
|
"properties": {
|
|
@@ -9945,6 +9945,40 @@ var init_resolve_sdk_binary = __esm({
|
|
|
9945
9945
|
}
|
|
9946
9946
|
});
|
|
9947
9947
|
|
|
9948
|
+
// ../../packages/claude/src/root-permission-guard.ts
|
|
9949
|
+
function isRootWithoutSandboxOptIn(opts) {
|
|
9950
|
+
if (opts.uid !== 0) return false;
|
|
9951
|
+
const env = opts.env ?? {};
|
|
9952
|
+
if (env.IS_SANDBOX === "1") return false;
|
|
9953
|
+
if (env.CLAUDE_CODE_BUBBLEWRAP) return false;
|
|
9954
|
+
return true;
|
|
9955
|
+
}
|
|
9956
|
+
function applyRootPermissionGuard(input) {
|
|
9957
|
+
const mode = input.permissionMode?.trim() ? input.permissionMode.trim() : void 0;
|
|
9958
|
+
if (!isRootWithoutSandboxOptIn(input)) {
|
|
9959
|
+
return {
|
|
9960
|
+
permissionMode: mode,
|
|
9961
|
+
allowDangerouslySkipPermissions: true,
|
|
9962
|
+
applied: false,
|
|
9963
|
+
downgradedFrom: null
|
|
9964
|
+
};
|
|
9965
|
+
}
|
|
9966
|
+
const downgrade = mode === "bypassPermissions";
|
|
9967
|
+
return {
|
|
9968
|
+
permissionMode: downgrade ? ROOT_SAFE_PERMISSION_MODE : mode,
|
|
9969
|
+
allowDangerouslySkipPermissions: false,
|
|
9970
|
+
applied: true,
|
|
9971
|
+
downgradedFrom: downgrade ? mode : null
|
|
9972
|
+
};
|
|
9973
|
+
}
|
|
9974
|
+
var ROOT_SAFE_PERMISSION_MODE;
|
|
9975
|
+
var init_root_permission_guard = __esm({
|
|
9976
|
+
"../../packages/claude/src/root-permission-guard.ts"() {
|
|
9977
|
+
"use strict";
|
|
9978
|
+
ROOT_SAFE_PERMISSION_MODE = "acceptEdits";
|
|
9979
|
+
}
|
|
9980
|
+
});
|
|
9981
|
+
|
|
9948
9982
|
// ../../packages/claude/src/run-sdk-turn.ts
|
|
9949
9983
|
import { query as sdkQuery } from "@anthropic-ai/claude-agent-sdk";
|
|
9950
9984
|
var init_run_sdk_turn = __esm({
|
|
@@ -9955,6 +9989,7 @@ var init_run_sdk_turn = __esm({
|
|
|
9955
9989
|
init_map_sdk_message();
|
|
9956
9990
|
init_agent_event_mapper2();
|
|
9957
9991
|
init_resolve_sdk_binary();
|
|
9992
|
+
init_root_permission_guard();
|
|
9958
9993
|
}
|
|
9959
9994
|
});
|
|
9960
9995
|
|
|
@@ -10103,6 +10138,11 @@ function buildLiveOptions(opts, onPermission, onQuestion, onPlan, signal, timing
|
|
|
10103
10138
|
autoAllowBashIfSandboxed: opts.sandboxMode === "auto",
|
|
10104
10139
|
failIfUnavailable: false
|
|
10105
10140
|
} : void 0;
|
|
10141
|
+
const permissions = applyRootPermissionGuard({
|
|
10142
|
+
permissionMode: opts.permissionMode,
|
|
10143
|
+
uid: opts.uid === void 0 ? process.getuid?.() : opts.uid,
|
|
10144
|
+
env: env ?? process.env
|
|
10145
|
+
});
|
|
10106
10146
|
const base = {
|
|
10107
10147
|
cwd: opts.cwd,
|
|
10108
10148
|
...binaryPath ? { pathToClaudeCodeExecutable: binaryPath } : {},
|
|
@@ -10115,8 +10155,8 @@ function buildLiveOptions(opts, onPermission, onQuestion, onPlan, signal, timing
|
|
|
10115
10155
|
enableFileCheckpointing: true,
|
|
10116
10156
|
agentProgressSummaries: true,
|
|
10117
10157
|
extraArgs: { "replay-user-messages": null },
|
|
10118
|
-
permissionMode:
|
|
10119
|
-
allowDangerouslySkipPermissions:
|
|
10158
|
+
permissionMode: permissions.permissionMode || "default",
|
|
10159
|
+
allowDangerouslySkipPermissions: permissions.allowDangerouslySkipPermissions,
|
|
10120
10160
|
canUseTool,
|
|
10121
10161
|
abortController,
|
|
10122
10162
|
settingSources: ["user", "project", "local"],
|
|
@@ -10156,6 +10196,7 @@ var init_claude_live_session = __esm({
|
|
|
10156
10196
|
init_agent_event_mapper2();
|
|
10157
10197
|
init_map_sdk_message();
|
|
10158
10198
|
init_resolve_sdk_binary();
|
|
10199
|
+
init_root_permission_guard();
|
|
10159
10200
|
init_superone_system_prompt();
|
|
10160
10201
|
init_superone_host_owned_tools();
|
|
10161
10202
|
ClaudeLiveSession = class _ClaudeLiveSession {
|
|
@@ -10393,6 +10434,90 @@ var init_claude_live_session = __esm({
|
|
|
10393
10434
|
}
|
|
10394
10435
|
});
|
|
10395
10436
|
|
|
10437
|
+
// ../../packages/claude/src/fetch-models.ts
|
|
10438
|
+
import { query as sdkQuery3 } from "@anthropic-ai/claude-agent-sdk";
|
|
10439
|
+
function extractModelName(descPrefix) {
|
|
10440
|
+
const match = descPrefix.match(MODEL_NAME_RE);
|
|
10441
|
+
if (!match) return null;
|
|
10442
|
+
return match[2] ? `${match[1]} ${match[2]}` : match[1];
|
|
10443
|
+
}
|
|
10444
|
+
function mapClaudeModelInfo(m2) {
|
|
10445
|
+
const raw = m2.description ?? "";
|
|
10446
|
+
const sepIdx = raw.indexOf("\xB7");
|
|
10447
|
+
const descPrefix = sepIdx !== -1 ? raw.slice(0, sepIdx).trim() : "";
|
|
10448
|
+
const name = extractModelName(descPrefix) ?? m2.displayName;
|
|
10449
|
+
const base = { id: m2.value, name, description: raw };
|
|
10450
|
+
if (m2.resolvedModel) base.resolvedModel = m2.resolvedModel;
|
|
10451
|
+
if (m2.supportsEffort) base.supportsEffort = true;
|
|
10452
|
+
if (m2.supportedEffortLevels?.length) {
|
|
10453
|
+
base.supportedEffortLevels = m2.supportedEffortLevels;
|
|
10454
|
+
}
|
|
10455
|
+
if (m2.supportsAdaptiveThinking) base.supportsAdaptiveThinking = true;
|
|
10456
|
+
if (m2.supportsFastMode) base.supportsFastMode = true;
|
|
10457
|
+
if (m2.supportsAutoMode) base.supportsAutoMode = true;
|
|
10458
|
+
return base;
|
|
10459
|
+
}
|
|
10460
|
+
async function fetchClaudeModels(opts) {
|
|
10461
|
+
const binaryPath = opts.binaryPath ?? resolveSdkClaudeBinary();
|
|
10462
|
+
const permissions = applyRootPermissionGuard({
|
|
10463
|
+
permissionMode: "default",
|
|
10464
|
+
uid: opts.uid === void 0 ? process.getuid?.() : opts.uid,
|
|
10465
|
+
env: opts.env ?? process.env
|
|
10466
|
+
});
|
|
10467
|
+
const options = {
|
|
10468
|
+
cwd: opts.cwd,
|
|
10469
|
+
...binaryPath ? { pathToClaudeCodeExecutable: binaryPath } : {},
|
|
10470
|
+
maxTurns: 0,
|
|
10471
|
+
permissionMode: permissions.permissionMode,
|
|
10472
|
+
persistSession: false,
|
|
10473
|
+
...opts.env ? { env: opts.env } : {}
|
|
10474
|
+
};
|
|
10475
|
+
let q;
|
|
10476
|
+
try {
|
|
10477
|
+
q = (opts.queryFn ?? sdkQuery3)({ prompt: "hi", options });
|
|
10478
|
+
const models = await withTimeout(
|
|
10479
|
+
(async () => {
|
|
10480
|
+
await q.initializationResult();
|
|
10481
|
+
return await q.supportedModels();
|
|
10482
|
+
})(),
|
|
10483
|
+
opts.timeoutMs ?? DEFAULT_PROBE_TIMEOUT_MS
|
|
10484
|
+
);
|
|
10485
|
+
return models.map(mapClaudeModelInfo);
|
|
10486
|
+
} catch {
|
|
10487
|
+
return [];
|
|
10488
|
+
} finally {
|
|
10489
|
+
try {
|
|
10490
|
+
q?.close();
|
|
10491
|
+
} catch {
|
|
10492
|
+
}
|
|
10493
|
+
}
|
|
10494
|
+
}
|
|
10495
|
+
function withTimeout(promise2, ms) {
|
|
10496
|
+
return new Promise((resolve13, reject) => {
|
|
10497
|
+
const timer = setTimeout(() => reject(new Error(`claude model probe timed out after ${ms}ms`)), ms);
|
|
10498
|
+
promise2.then(
|
|
10499
|
+
(v2) => {
|
|
10500
|
+
clearTimeout(timer);
|
|
10501
|
+
resolve13(v2);
|
|
10502
|
+
},
|
|
10503
|
+
(e) => {
|
|
10504
|
+
clearTimeout(timer);
|
|
10505
|
+
reject(e);
|
|
10506
|
+
}
|
|
10507
|
+
);
|
|
10508
|
+
});
|
|
10509
|
+
}
|
|
10510
|
+
var MODEL_NAME_RE, DEFAULT_PROBE_TIMEOUT_MS;
|
|
10511
|
+
var init_fetch_models = __esm({
|
|
10512
|
+
"../../packages/claude/src/fetch-models.ts"() {
|
|
10513
|
+
"use strict";
|
|
10514
|
+
init_resolve_sdk_binary();
|
|
10515
|
+
init_root_permission_guard();
|
|
10516
|
+
MODEL_NAME_RE = /^(\w+ [\d.]+)(?:\s+with\s+(\w+)\s+context)?/;
|
|
10517
|
+
DEFAULT_PROBE_TIMEOUT_MS = 2e4;
|
|
10518
|
+
}
|
|
10519
|
+
});
|
|
10520
|
+
|
|
10396
10521
|
// ../../packages/claude/src/fork-session.ts
|
|
10397
10522
|
import { existsSync as existsSync7, mkdirSync as mkdirSync4, readdirSync, realpathSync, renameSync } from "node:fs";
|
|
10398
10523
|
import { homedir as homedir2 } from "node:os";
|
|
@@ -10460,6 +10585,8 @@ var init_src2 = __esm({
|
|
|
10460
10585
|
init_claude_live_session();
|
|
10461
10586
|
init_agent_event_mapper2();
|
|
10462
10587
|
init_resolve_sdk_binary();
|
|
10588
|
+
init_fetch_models();
|
|
10589
|
+
init_root_permission_guard();
|
|
10463
10590
|
init_map_sdk_message();
|
|
10464
10591
|
init_fork_session();
|
|
10465
10592
|
}
|
|
@@ -14019,8 +14146,19 @@ async function collectHarnessResources(input) {
|
|
|
14019
14146
|
opencode: emptyOpenCode(),
|
|
14020
14147
|
acp: emptyAcp()
|
|
14021
14148
|
};
|
|
14149
|
+
const resolveModels = async (harnessId) => {
|
|
14150
|
+
const listed = input.listModels(harnessId, input.apiProviderId);
|
|
14151
|
+
if (Array.isArray(listed) && listed.length > 0) return listed;
|
|
14152
|
+
if (!input.probeModels) return [];
|
|
14153
|
+
try {
|
|
14154
|
+
const probed = await input.probeModels(harnessId);
|
|
14155
|
+
return Array.isArray(probed) ? probed : [];
|
|
14156
|
+
} catch {
|
|
14157
|
+
return [];
|
|
14158
|
+
}
|
|
14159
|
+
};
|
|
14022
14160
|
if (want("claude")) {
|
|
14023
|
-
const models =
|
|
14161
|
+
const models = await resolveModels("claude");
|
|
14024
14162
|
let account = {};
|
|
14025
14163
|
if (input.probeAccount) {
|
|
14026
14164
|
try {
|
|
@@ -14056,14 +14194,14 @@ async function collectHarnessResources(input) {
|
|
|
14056
14194
|
};
|
|
14057
14195
|
}
|
|
14058
14196
|
if (want("codex")) {
|
|
14059
|
-
const models =
|
|
14197
|
+
const models = await resolveModels("codex");
|
|
14060
14198
|
bundle.codex = {
|
|
14061
14199
|
models: Array.isArray(models) ? models : [],
|
|
14062
14200
|
prompts: discoverCodexUserPrompts({ homeDir })
|
|
14063
14201
|
};
|
|
14064
14202
|
}
|
|
14065
14203
|
if (want("opencode")) {
|
|
14066
|
-
const models =
|
|
14204
|
+
const models = await resolveModels("opencode");
|
|
14067
14205
|
bundle.opencode = {
|
|
14068
14206
|
models: Array.isArray(models) ? models : [],
|
|
14069
14207
|
agents: [],
|
|
@@ -18122,6 +18260,26 @@ function consumerForHarness(harness) {
|
|
|
18122
18260
|
if (harness === "codex") return "chat:codex";
|
|
18123
18261
|
return null;
|
|
18124
18262
|
}
|
|
18263
|
+
function listHarnessApiProviders(store, harness) {
|
|
18264
|
+
const consumer = consumerForHarness(harness);
|
|
18265
|
+
if (!consumer) return [];
|
|
18266
|
+
const platforms = platformsForNode(store);
|
|
18267
|
+
const out = [];
|
|
18268
|
+
for (const cred of store.listCredentials()) {
|
|
18269
|
+
const platform2 = findPlatform(platforms, cred.platformId);
|
|
18270
|
+
const plan = findPlan(platform2, cred.planId);
|
|
18271
|
+
if (!platform2 || !plan) continue;
|
|
18272
|
+
const endpoints = effectiveEndpoints(platform2, plan, cred);
|
|
18273
|
+
if (!selectEndpoint(plan, consumer, void 0, cred, endpoints)) continue;
|
|
18274
|
+
out.push({
|
|
18275
|
+
id: cred.id,
|
|
18276
|
+
name: platform2.name ?? cred.name,
|
|
18277
|
+
...platform2.brand ? { brand: platform2.brand } : {},
|
|
18278
|
+
...cred.name ? { keyName: cred.name } : {}
|
|
18279
|
+
});
|
|
18280
|
+
}
|
|
18281
|
+
return out;
|
|
18282
|
+
}
|
|
18125
18283
|
function buildHarnessEnv(harness, resolved) {
|
|
18126
18284
|
if (!resolved) return {};
|
|
18127
18285
|
const env = { ...resolved.extraEnv ?? {} };
|
|
@@ -18178,7 +18336,7 @@ function resolveHarnessService(store, harness, apiProviderId) {
|
|
|
18178
18336
|
binding && binding.credentialId === cred.id ? { endpointId: binding.endpointId, config: binding.config } : null
|
|
18179
18337
|
);
|
|
18180
18338
|
}
|
|
18181
|
-
function
|
|
18339
|
+
function listHarnessProviderModels(store, harness, apiProviderId) {
|
|
18182
18340
|
const resolved = resolveHarnessService(store, harness, apiProviderId);
|
|
18183
18341
|
if (resolved) {
|
|
18184
18342
|
const mapped = /* @__PURE__ */ new Map();
|
|
@@ -18208,6 +18366,11 @@ function listHarnessModels(store, harness, apiProviderId) {
|
|
|
18208
18366
|
const list = [...mapped.values()];
|
|
18209
18367
|
if (list.length > 0) return list;
|
|
18210
18368
|
}
|
|
18369
|
+
return [];
|
|
18370
|
+
}
|
|
18371
|
+
function listHarnessModels(store, harness, apiProviderId) {
|
|
18372
|
+
const fromProvider = listHarnessProviderModels(store, harness, apiProviderId);
|
|
18373
|
+
if (fromProvider.length > 0) return fromProvider;
|
|
18211
18374
|
if (harness === "claude") return DEFAULT_CLAUDE_MODELS;
|
|
18212
18375
|
if (harness === "codex") return DEFAULT_CODEX_MODELS;
|
|
18213
18376
|
return [];
|
|
@@ -21088,6 +21251,18 @@ function createNodeClaudeTurnRunner(opts) {
|
|
|
21088
21251
|
...opts.env,
|
|
21089
21252
|
...providerEnv
|
|
21090
21253
|
};
|
|
21254
|
+
const uid = opts.getuid ? opts.getuid() : process.getuid?.();
|
|
21255
|
+
const permissions = applyRootPermissionGuard({
|
|
21256
|
+
permissionMode: input.permissionMode,
|
|
21257
|
+
uid,
|
|
21258
|
+
env: authEnv
|
|
21259
|
+
});
|
|
21260
|
+
if (permissions.downgradedFrom) {
|
|
21261
|
+
input.onAgentEvent?.({
|
|
21262
|
+
type: "agent_setting_change",
|
|
21263
|
+
patch: { permissionMode: permissions.permissionMode }
|
|
21264
|
+
});
|
|
21265
|
+
}
|
|
21091
21266
|
const priorSession = parseClaudeSessionResume(input.session.providerResume);
|
|
21092
21267
|
const sessionKey = input.session.sessionId;
|
|
21093
21268
|
const mergedProbe = ensureMcpMerge({
|
|
@@ -21125,7 +21300,8 @@ function createNodeClaudeTurnRunner(opts) {
|
|
|
21125
21300
|
sessionId: priorSession,
|
|
21126
21301
|
model: input.model && input.model.trim() ? input.model.trim() : void 0,
|
|
21127
21302
|
effort: input.effort && input.effort.trim() ? input.effort.trim() : void 0,
|
|
21128
|
-
permissionMode:
|
|
21303
|
+
permissionMode: permissions.permissionMode,
|
|
21304
|
+
uid,
|
|
21129
21305
|
sandboxMode: input.sandboxMode && input.sandboxMode.trim() ? input.sandboxMode.trim() : void 0,
|
|
21130
21306
|
additionalDirectories: input.additionalDirectories?.filter(Boolean),
|
|
21131
21307
|
enabledSkills: resolveEnabledSkills(cwd, input.enabledSkills, input.disabledSkills),
|
|
@@ -40791,6 +40967,7 @@ function createXaiCorrelationState() {
|
|
|
40791
40967
|
workflowToolByRunId: /* @__PURE__ */ new Map(),
|
|
40792
40968
|
workflowRevision: /* @__PURE__ */ new Map(),
|
|
40793
40969
|
workflowStarted: /* @__PURE__ */ new Set(),
|
|
40970
|
+
workflowOwnedSubagents: /* @__PURE__ */ new Set(),
|
|
40794
40971
|
subagentToolById: /* @__PURE__ */ new Map(),
|
|
40795
40972
|
subagentStarted: /* @__PURE__ */ new Set(),
|
|
40796
40973
|
bgTaskById: /* @__PURE__ */ new Map(),
|
|
@@ -41081,15 +41258,16 @@ function mapWorkflowUpdated(u, state) {
|
|
|
41081
41258
|
}
|
|
41082
41259
|
if (WORKFLOW_TERMINAL.has(status)) {
|
|
41083
41260
|
const taskStatus = status === "complete" || status === "completed" ? "completed" : status === "cancelled" || status === "canceled" ? "stopped" : "failed";
|
|
41261
|
+
const resultText = resultSummary || pauseMessage || lastEventDetail || void 0;
|
|
41084
41262
|
events.push({
|
|
41085
41263
|
type: "task_notification",
|
|
41086
41264
|
taskId: runId,
|
|
41087
41265
|
...toolUseId ? { toolUseId } : {},
|
|
41088
41266
|
taskStatus,
|
|
41089
41267
|
outputFile: "",
|
|
41090
|
-
summary: phaseLine ||
|
|
41268
|
+
summary: resultSummary || phaseLine || pauseMessage || status,
|
|
41091
41269
|
usage: usage2,
|
|
41092
|
-
...
|
|
41270
|
+
...resultText ? { resultText } : {},
|
|
41093
41271
|
...phaseFields
|
|
41094
41272
|
});
|
|
41095
41273
|
return events;
|
|
@@ -41099,9 +41277,9 @@ function mapWorkflowUpdated(u, state) {
|
|
|
41099
41277
|
taskId: runId,
|
|
41100
41278
|
...toolUseId ? { toolUseId } : {},
|
|
41101
41279
|
description,
|
|
41102
|
-
summary: phaseLine || status,
|
|
41280
|
+
summary: phaseLine || pauseMessage || status,
|
|
41103
41281
|
usage: usage2,
|
|
41104
|
-
...lastEventDetail || lastEvent ? { activityText: lastEventDetail ?? lastEvent } : {},
|
|
41282
|
+
...lastEventDetail || lastEvent || pauseMessage ? { activityText: pauseMessage ?? lastEventDetail ?? lastEvent } : {},
|
|
41105
41283
|
...phaseFields
|
|
41106
41284
|
});
|
|
41107
41285
|
return events;
|
|
@@ -41171,16 +41349,16 @@ function mapSubagentSpawned(u, state) {
|
|
|
41171
41349
|
state.subagentStarted.add(id);
|
|
41172
41350
|
const description = strField(u, "description") ?? id;
|
|
41173
41351
|
const subagentType = strField(u, "subagent_type", "subagentType");
|
|
41174
|
-
const toolUseId = state.subagentToolById.get(id);
|
|
41175
41352
|
const workflowRunId = strField(u, "workflow_run_id", "workflowRunId");
|
|
41176
|
-
if (workflowRunId
|
|
41177
|
-
|
|
41178
|
-
|
|
41353
|
+
if (workflowRunId) {
|
|
41354
|
+
state.workflowOwnedSubagents.add(id);
|
|
41355
|
+
state.subagentToolById.delete(id);
|
|
41179
41356
|
}
|
|
41357
|
+
const toolUseId = workflowRunId ? void 0 : state.subagentToolById.get(id);
|
|
41180
41358
|
return [{
|
|
41181
41359
|
type: "task_started",
|
|
41182
41360
|
taskId: id,
|
|
41183
|
-
...
|
|
41361
|
+
...toolUseId ? { toolUseId } : {},
|
|
41184
41362
|
description,
|
|
41185
41363
|
...subagentType ? { taskType: subagentType } : {}
|
|
41186
41364
|
}];
|
|
@@ -41188,6 +41366,7 @@ function mapSubagentSpawned(u, state) {
|
|
|
41188
41366
|
function mapSubagentProgress(u, state) {
|
|
41189
41367
|
const id = strField(u, "subagent_id", "subagentId");
|
|
41190
41368
|
if (!id) return [];
|
|
41369
|
+
if (state.workflowOwnedSubagents.has(id)) return [];
|
|
41191
41370
|
const events = [];
|
|
41192
41371
|
if (!state.subagentStarted.has(id)) {
|
|
41193
41372
|
state.subagentStarted.add(id);
|
|
@@ -41217,6 +41396,7 @@ function mapSubagentProgress(u, state) {
|
|
|
41217
41396
|
function mapSubagentFinished(u, state) {
|
|
41218
41397
|
const id = strField(u, "subagent_id", "subagentId");
|
|
41219
41398
|
if (!id) return [];
|
|
41399
|
+
if (state.workflowOwnedSubagents.has(id)) return [];
|
|
41220
41400
|
const status = (strField(u, "status") ?? "completed").toLowerCase();
|
|
41221
41401
|
const taskStatus = status === "completed" || status === "complete" ? "completed" : status === "cancelled" || status === "canceled" ? "stopped" : "failed";
|
|
41222
41402
|
const toolUseId = state.subagentToolById.get(id);
|
|
@@ -56999,8 +57179,8 @@ import { fileURLToPath } from "node:url";
|
|
|
56999
57179
|
function resolveCliReleaseVersion() {
|
|
57000
57180
|
const fromEnv = process.env.SUPERONE_CLI_VERSION?.trim();
|
|
57001
57181
|
if (fromEnv) return fromEnv;
|
|
57002
|
-
if ("0.50.
|
|
57003
|
-
return "0.50.
|
|
57182
|
+
if ("0.50.3-alpha".trim()) {
|
|
57183
|
+
return "0.50.3-alpha".trim();
|
|
57004
57184
|
}
|
|
57005
57185
|
const fromDist = readDistManifestVersion();
|
|
57006
57186
|
if (fromDist) return fromDist;
|
|
@@ -60983,6 +61163,25 @@ function handleDelete(payload, ctx) {
|
|
|
60983
61163
|
init_environment();
|
|
60984
61164
|
init_session();
|
|
60985
61165
|
init_resolve_service();
|
|
61166
|
+
init_claude_turn_runner();
|
|
61167
|
+
|
|
61168
|
+
// src/session/claude-model-catalog.ts
|
|
61169
|
+
init_src2();
|
|
61170
|
+
var CATALOG_TTL_MS = 5 * 6e4;
|
|
61171
|
+
var cache = /* @__PURE__ */ new Map();
|
|
61172
|
+
async function getNodeClaudeModelCatalog(opts) {
|
|
61173
|
+
const now = opts.now ?? Date.now;
|
|
61174
|
+
const key = opts.binaryPath ?? "sdk-bundled";
|
|
61175
|
+
const hit = cache.get(key);
|
|
61176
|
+
if (hit && now() - hit.fetchedAt < CATALOG_TTL_MS) return hit.models;
|
|
61177
|
+
const fetchModels = opts.fetchModels ?? fetchClaudeModels;
|
|
61178
|
+
const models = await fetchModels({ cwd: opts.cwd, binaryPath: opts.binaryPath });
|
|
61179
|
+
if (models.length > 0) cache.set(key, { fetchedAt: now(), models });
|
|
61180
|
+
else cache.delete(key);
|
|
61181
|
+
return models;
|
|
61182
|
+
}
|
|
61183
|
+
|
|
61184
|
+
// src/rpc/harness-resources-handlers.ts
|
|
60986
61185
|
function requireScopes5(client3, scopes) {
|
|
60987
61186
|
if (!hasAllScopes(client3.scopes, scopes)) {
|
|
60988
61187
|
return { error: { code: "forbidden", message: `missing scopes: ${scopes.join(", ")}` } };
|
|
@@ -60992,6 +61191,14 @@ function requireScopes5(client3, scopes) {
|
|
|
60992
61191
|
function asRecord13(payload) {
|
|
60993
61192
|
return payload && typeof payload === "object" ? payload : {};
|
|
60994
61193
|
}
|
|
61194
|
+
function defaultProbeModels(ctx) {
|
|
61195
|
+
return async (harnessId, cwd) => {
|
|
61196
|
+
if (harnessId !== "claude") return [];
|
|
61197
|
+
const binaryPath = resolveClaudeBinaryPath({ harnesses: ctx.harnesses });
|
|
61198
|
+
if (!binaryPath) return [];
|
|
61199
|
+
return getNodeClaudeModelCatalog({ cwd, binaryPath });
|
|
61200
|
+
};
|
|
61201
|
+
}
|
|
60995
61202
|
function mapThrown5(err) {
|
|
60996
61203
|
const e = err;
|
|
60997
61204
|
const code = e.code ?? "internal";
|
|
@@ -61020,12 +61227,19 @@ async function handleHarnessResources(payload, ctx) {
|
|
|
61020
61227
|
const harnessId = typeof p2.harnessId === "string" && p2.harnessId.trim() ? p2.harnessId.trim() : null;
|
|
61021
61228
|
const apiProviderId = typeof p2.apiProviderId === "string" && p2.apiProviderId.trim() ? p2.apiProviderId.trim() : p2.apiProviderId === null ? null : void 0;
|
|
61022
61229
|
const listModels = (hid, apiId) => {
|
|
61023
|
-
return
|
|
61230
|
+
return listHarnessProviderModels(ctx.providers, hid, apiId ?? null);
|
|
61231
|
+
};
|
|
61232
|
+
const probeModels = async (hid) => {
|
|
61233
|
+
const probe = ctx.probeModels ?? defaultProbeModels(ctx);
|
|
61234
|
+
const probed = await probe(hid, project.path);
|
|
61235
|
+
if (probed.length > 0) return probed;
|
|
61236
|
+
return listHarnessModels(ctx.providers, hid, apiProviderId ?? null);
|
|
61024
61237
|
};
|
|
61025
61238
|
const bundle = await collectHarnessResources({
|
|
61026
61239
|
projectPath: project.path,
|
|
61027
61240
|
homeDir: ctx.homeDir,
|
|
61028
61241
|
listModels,
|
|
61242
|
+
probeModels,
|
|
61029
61243
|
apiProviderId: apiProviderId ?? null,
|
|
61030
61244
|
harnessId
|
|
61031
61245
|
});
|
|
@@ -61201,7 +61415,8 @@ async function dispatchRpcInner(method, payload, ctx) {
|
|
|
61201
61415
|
const harnessResources = await dispatchHarnessResourcesRpc(method, payload, {
|
|
61202
61416
|
client: ctx.client,
|
|
61203
61417
|
projects: ctx.projects,
|
|
61204
|
-
providers: ctx.providers
|
|
61418
|
+
providers: ctx.providers,
|
|
61419
|
+
harnesses: ctx.harnesses
|
|
61205
61420
|
});
|
|
61206
61421
|
if (harnessResources) return harnessResources;
|
|
61207
61422
|
const codex = await dispatchCodexRpc(method, payload, {
|
|
@@ -65452,7 +65667,7 @@ var CollaborationService = class {
|
|
|
65452
65667
|
},
|
|
65453
65668
|
models: models.length > 0 ? models : [{ id: "default", name: "Default" }],
|
|
65454
65669
|
efforts: [...efforts],
|
|
65455
|
-
apiProviders:
|
|
65670
|
+
apiProviders: listHarnessApiProviders(providers, harnessId)
|
|
65456
65671
|
});
|
|
65457
65672
|
};
|
|
65458
65673
|
if (sessionProviders) {
|
|
@@ -66992,14 +67207,14 @@ var Response2 = class _Response {
|
|
|
66992
67207
|
}
|
|
66993
67208
|
}
|
|
66994
67209
|
get headers() {
|
|
66995
|
-
const
|
|
66996
|
-
if (
|
|
66997
|
-
if (!(
|
|
66998
|
-
|
|
66999
|
-
|
|
67210
|
+
const cache2 = this[cacheKey];
|
|
67211
|
+
if (cache2) {
|
|
67212
|
+
if (!(cache2[2] instanceof Headers)) {
|
|
67213
|
+
cache2[2] = new Headers(
|
|
67214
|
+
cache2[2] || { "content-type": "text/plain; charset=UTF-8" }
|
|
67000
67215
|
);
|
|
67001
67216
|
}
|
|
67002
|
-
return
|
|
67217
|
+
return cache2[2];
|
|
67003
67218
|
}
|
|
67004
67219
|
return this[getResponseCache]().headers;
|
|
67005
67220
|
}
|
package/package.json
CHANGED