@super-one/cli 0.67.0-alpha.1 → 0.67.0-alpha.2
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 +293 -45
- package/package.json +1 -1
package/MANIFEST.json
CHANGED
package/lib/cli.mjs
CHANGED
|
@@ -400,7 +400,7 @@ var init_superone_tool_descriptions = __esm({
|
|
|
400
400
|
AUTOMATION_LIST_DESCRIPTION = "List project automations with schedule and last/next run. Pass id for full prompt, agentConfig, and schedule; filter by query or enabled. Find unknown ids here before automation_apply or automation_delete; check for duplicates before creation when needed.";
|
|
401
401
|
AUTOMATION_APPLY_DESCRIPTION = 'Create or update a project automation. create needs name, prompt, schedule; update needs id plus any field (pause via enabled=false). Call automation_list first for ids; remove with automation_delete. Always opens a user confirmation dialog and applies nothing without approval. For schedule and agentConfig shapes see read_manual({ domain: "product", topic: "automation" }).';
|
|
402
402
|
AUTOMATION_DELETE_DESCRIPTION = "Permanently delete project automations by id (from automation_list). Always opens a user confirmation dialog. Current project only. Prefer automation_list to choose ids first.";
|
|
403
|
-
TERMINAL_TABS_DESCRIPTION = "Manage terminal tabs
|
|
403
|
+
TERMINAL_TABS_DESCRIPTION = "Manage activity-panel terminal tabs for long-lived or interactive processes: dev servers, watch modes, REPLs, TUIs, ssh, wizards. One-shot commands (build, test, git) belong in your shell tool. action=list (default) returns this session's tabs plus the user's as a TOON table; other sessions' tabs are hidden. action=run asks to approve `command`, types it into a new or idle tab, and returns the screen; you control the tab only while that command is in the foreground. action=attach asks to control a command already running in a user tab. action=close kills a tab you opened, never one the user is using. Follow with terminal_act / terminal_wait_for / terminal_snapshot.";
|
|
404
404
|
TERMINAL_SNAPSHOT_DESCRIPTION = "Read a terminal tab as rendered text. `include` picks sections: screen (visible rows, default), scrollback (last `tail` lines including scrolled-off output), cursor, meta (title, cwd, status, foreground command, control). Use screen for prompts and full-screen programs, scrollback for server logs. Output over the tail cap is spilled to a file and returned as path + preview. Prefer this before terminal_act; use terminal_wait_for instead of polling.";
|
|
405
405
|
TERMINAL_ACT_DESCRIPTION = 'Send input to a terminal tab you control. actions is an array, e.g. [{type:"type",text:"yes"}] or [{type:"key",key:"Ctrl+C"}]; types: type (Enter by default), key (Enter, Tab, Escape, Up, Ctrl+C, F1\u2026), raw, resize, wait. ONE action per call by default; batch 2\u201320 only for an uninterruptible sequence (answer a wizard). Fail-fast. expect holds the call open until a screen condition is met (text, textGone, idleMs, exited); the screen after the batch is returned. Rejected with status=rejected when the approved command has exited or the user took over \u2014 do not retry, call terminal_tabs run again or ask. description is shown to the user instead of raw keystrokes.';
|
|
406
406
|
TERMINAL_WAIT_FOR_DESCRIPTION = "Block until a terminal tab reaches a state; conditions AND-combine: text (substring visible on screen or in new output), textGone, idleMs (no output for that long), exited (foreground command finished). Use after terminal_tabs run or terminal_act when output arrives asynchronously (a server banner, a build finishing). timeoutMs default 15000, max 120000. Do not sleep+poll with terminal_snapshot yourself.";
|
|
@@ -3670,6 +3670,10 @@ var init_host_action_terminal_descriptors = __esm({
|
|
|
3670
3670
|
description: "Tab id from list. run: reuse this idle tab instead of opening one. attach/close: the target (close accepts an array)."
|
|
3671
3671
|
},
|
|
3672
3672
|
command: { type: "string", description: "run only. The command the user approves and that is typed into the shell." },
|
|
3673
|
+
rule: {
|
|
3674
|
+
type: "string",
|
|
3675
|
+
description: 'run only. The rule offered as "always allow in this project" next to the approval: the command cut down to its stable leading words plus ":*", e.g. "bun run:*" for "bun run dev", "git commit:*" for "git commit -m \u2026". It must match `command`; keep it as narrow as the user would want (never a bare "sudo:*" / "ssh:*"). Default: derived from the command.'
|
|
3676
|
+
},
|
|
3673
3677
|
cwd: { type: "string", description: "run only. Absolute working directory for a new tab. Default: the session working directory." },
|
|
3674
3678
|
title: { type: "string", description: "run only. Tab title shown to the user. Default: the command name." },
|
|
3675
3679
|
size: {
|
|
@@ -11122,6 +11126,187 @@ var init_slash_commands = __esm({
|
|
|
11122
11126
|
}
|
|
11123
11127
|
});
|
|
11124
11128
|
|
|
11129
|
+
// ../../packages/shared/src/harness/acp-brand.ts
|
|
11130
|
+
function isGrokAcpAgent(agentId) {
|
|
11131
|
+
if (!agentId) return false;
|
|
11132
|
+
const id = agentId.toLowerCase();
|
|
11133
|
+
return id.includes("grok");
|
|
11134
|
+
}
|
|
11135
|
+
function isOpenCodeAcpAgent(agentId) {
|
|
11136
|
+
if (!agentId) return false;
|
|
11137
|
+
return agentId.toLowerCase().includes("opencode");
|
|
11138
|
+
}
|
|
11139
|
+
function resolveHarnessBrandKey(harnessId, acpAgentId) {
|
|
11140
|
+
if (!harnessId) return "claude";
|
|
11141
|
+
if (harnessId !== "acp") return harnessId;
|
|
11142
|
+
if (isGrokAcpAgent(acpAgentId)) return "acp-grok";
|
|
11143
|
+
if (isOpenCodeAcpAgent(acpAgentId)) return "acp-opencode";
|
|
11144
|
+
if (acpAgentId?.trim()) {
|
|
11145
|
+
const short = acpAgentId.trim().toLowerCase().replace(/-build$/, "").replace(/[^a-z0-9]+/g, "-");
|
|
11146
|
+
return short ? `acp-${short}` : "acp";
|
|
11147
|
+
}
|
|
11148
|
+
return "acp";
|
|
11149
|
+
}
|
|
11150
|
+
function acpAgentDisplayName(agentId, catalogName) {
|
|
11151
|
+
if (catalogName?.trim()) {
|
|
11152
|
+
return catalogName.trim().replace(/\s+Build$/i, "");
|
|
11153
|
+
}
|
|
11154
|
+
if (isGrokAcpAgent(agentId)) return "Grok";
|
|
11155
|
+
if (isOpenCodeAcpAgent(agentId)) return "OpenCode";
|
|
11156
|
+
if (agentId?.trim()) {
|
|
11157
|
+
return agentId.trim().replace(/-build$/i, "").split(/[-_]/).filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(" ");
|
|
11158
|
+
}
|
|
11159
|
+
return "ACP";
|
|
11160
|
+
}
|
|
11161
|
+
var init_acp_brand = __esm({
|
|
11162
|
+
"../../packages/shared/src/harness/acp-brand.ts"() {
|
|
11163
|
+
"use strict";
|
|
11164
|
+
}
|
|
11165
|
+
});
|
|
11166
|
+
|
|
11167
|
+
// ../../packages/shared/src/harness/harness-capabilities.ts
|
|
11168
|
+
var HARNESS_CAPABILITIES, ALL_GOAL_LIFECYCLE_ARGS;
|
|
11169
|
+
var init_harness_capabilities = __esm({
|
|
11170
|
+
"../../packages/shared/src/harness/harness-capabilities.ts"() {
|
|
11171
|
+
"use strict";
|
|
11172
|
+
init_acp_brand();
|
|
11173
|
+
HARNESS_CAPABILITIES = {
|
|
11174
|
+
claude: {
|
|
11175
|
+
supportsMcp: true,
|
|
11176
|
+
supportsPlanMode: true,
|
|
11177
|
+
supportsTodos: true,
|
|
11178
|
+
supportsSubagents: true,
|
|
11179
|
+
supportsCompact: true,
|
|
11180
|
+
supportsStreamingToolInput: true,
|
|
11181
|
+
supportsQueuedSteer: true,
|
|
11182
|
+
supportsQueuedSteerSoon: true,
|
|
11183
|
+
// SDK `additionalDirectories`.
|
|
11184
|
+
supportsAdditionalDirs: true,
|
|
11185
|
+
// SDK `forkSession()` copies + remaps the transcript jsonl.
|
|
11186
|
+
supportsFork: true,
|
|
11187
|
+
// Built-in `/goal <condition>`: a Stop hook re-checks the condition after
|
|
11188
|
+
// each turn and keeps going until it is met, so there is no paused state —
|
|
11189
|
+
// the goal is either live or cleared.
|
|
11190
|
+
goal: { lifecycleArgs: ["clear"], canPause: false, transport: "slash", semantics: "condition" },
|
|
11191
|
+
displayName: "Claude"
|
|
11192
|
+
},
|
|
11193
|
+
codex: {
|
|
11194
|
+
supportsMcp: true,
|
|
11195
|
+
supportsPlanMode: true,
|
|
11196
|
+
supportsTodos: false,
|
|
11197
|
+
supportsSubagents: false,
|
|
11198
|
+
supportsCompact: true,
|
|
11199
|
+
supportsStreamingToolInput: false,
|
|
11200
|
+
supportsQueuedSteer: true,
|
|
11201
|
+
// Core's queue item either interrupts the turn or waits it out.
|
|
11202
|
+
supportsQueuedSteerSoon: false,
|
|
11203
|
+
// sandbox_workspace_write.writable_roots, re-sent every turn.
|
|
11204
|
+
supportsAdditionalDirs: true,
|
|
11205
|
+
// app-server thread fork, truncatable at a turn id.
|
|
11206
|
+
supportsFork: true,
|
|
11207
|
+
// `thread/goal/{get,set,clear}` over the app server; SuperOne drives the
|
|
11208
|
+
// follow-up turns itself, so every transition is an explicit RPC.
|
|
11209
|
+
goal: { lifecycleArgs: [], canPause: true, transport: "rpc", semantics: "objective" },
|
|
11210
|
+
displayName: "Codex"
|
|
11211
|
+
},
|
|
11212
|
+
acp: {
|
|
11213
|
+
// Host injects SuperOne MCP on every ACP session; user MCP attach is a separate gap.
|
|
11214
|
+
supportsMcp: true,
|
|
11215
|
+
// Agent-driven plan + x.ai/exit_plan_mode approval is shipped (not host enter-plan).
|
|
11216
|
+
supportsPlanMode: true,
|
|
11217
|
+
// ACP session/update plan entries map to todo_write-style UI events.
|
|
11218
|
+
supportsTodos: true,
|
|
11219
|
+
// Subagent_* notifications already map to task rows, but there is no nested
|
|
11220
|
+
// child chrome for ACP. Keep false until Task UI can host those sessions.
|
|
11221
|
+
supportsSubagents: false,
|
|
11222
|
+
// Host intercepts `/compact` → `x.ai/compact_conversation`.
|
|
11223
|
+
supportsCompact: true,
|
|
11224
|
+
supportsStreamingToolInput: false,
|
|
11225
|
+
// Mid-turn send queues; steer inserts via `x.ai/interject` (no abort).
|
|
11226
|
+
// Interject has no now/next split — Claude's "soon" is a second SDK
|
|
11227
|
+
// priority, which Grok does not have.
|
|
11228
|
+
supportsQueuedSteer: true,
|
|
11229
|
+
supportsQueuedSteerSoon: false,
|
|
11230
|
+
// session/new additionalDirectories, gated per agent capability.
|
|
11231
|
+
supportsAdditionalDirs: true,
|
|
11232
|
+
// Cold `x.ai/session/fork` copies Grok session files; SuperOne then resumes the child.
|
|
11233
|
+
supportsFork: true,
|
|
11234
|
+
// Grok only — see `resolveGoalCapability`. The agent owns the loop and
|
|
11235
|
+
// reports back over `goal_updated`; the host just posts `/goal …` lines.
|
|
11236
|
+
goal: {
|
|
11237
|
+
lifecycleArgs: ["status", "pause", "resume", "clear"],
|
|
11238
|
+
canPause: true,
|
|
11239
|
+
transport: "slash",
|
|
11240
|
+
semantics: "objective"
|
|
11241
|
+
},
|
|
11242
|
+
displayName: "Others"
|
|
11243
|
+
},
|
|
11244
|
+
opencode: {
|
|
11245
|
+
supportsMcp: true,
|
|
11246
|
+
supportsPlanMode: true,
|
|
11247
|
+
supportsTodos: true,
|
|
11248
|
+
supportsSubagents: true,
|
|
11249
|
+
supportsCompact: true,
|
|
11250
|
+
supportsStreamingToolInput: false,
|
|
11251
|
+
supportsQueuedSteer: false,
|
|
11252
|
+
supportsQueuedSteerSoon: false,
|
|
11253
|
+
// Single `directory` only.
|
|
11254
|
+
supportsAdditionalDirs: false,
|
|
11255
|
+
// Server-side `forkSession(id, anchor)` + `moveSession`.
|
|
11256
|
+
supportsFork: true,
|
|
11257
|
+
goal: null,
|
|
11258
|
+
displayName: "OpenCode"
|
|
11259
|
+
},
|
|
11260
|
+
cursor: {
|
|
11261
|
+
supportsMcp: true,
|
|
11262
|
+
supportsPlanMode: true,
|
|
11263
|
+
// updateTodos / task tool deltas when event map lands (PR5+)
|
|
11264
|
+
supportsTodos: true,
|
|
11265
|
+
supportsSubagents: true,
|
|
11266
|
+
supportsCompact: false,
|
|
11267
|
+
supportsStreamingToolInput: true,
|
|
11268
|
+
supportsQueuedSteer: false,
|
|
11269
|
+
supportsQueuedSteerSoon: false,
|
|
11270
|
+
// Single cwd; multi-root parked in the harness design doc.
|
|
11271
|
+
supportsAdditionalDirs: false,
|
|
11272
|
+
// SDK has no transcript-fork API; the adapter creates a blank agent.
|
|
11273
|
+
supportsFork: false,
|
|
11274
|
+
goal: null,
|
|
11275
|
+
displayName: "Cursor"
|
|
11276
|
+
},
|
|
11277
|
+
dsh: {
|
|
11278
|
+
// In-process dsh Cordis tree (docs/draft/deepseek-harness-integration.md).
|
|
11279
|
+
// Flags flip only when the corresponding event path is wired: streaming
|
|
11280
|
+
// tool input → tool-call-delta mapping.
|
|
11281
|
+
// `supportsCompact`: `compaction-basic` compacts automatically at context
|
|
11282
|
+
// pressure and on provider overflow; `/compact` drives `compactNow()`.
|
|
11283
|
+
// `supportsMcp` covers both SuperOne's own tools (native dsh rows) and
|
|
11284
|
+
// third-party servers read from dsh's own profile patch layer.
|
|
11285
|
+
// `supportsSubagents`: foreground delegation (`dsh-tool-subagent` over the
|
|
11286
|
+
// in-process spawn provider), rendered as a Task block with the child's
|
|
11287
|
+
// steps nested under it. Background and continuable children are not wired.
|
|
11288
|
+
supportsMcp: true,
|
|
11289
|
+
supportsPlanMode: false,
|
|
11290
|
+
supportsTodos: true,
|
|
11291
|
+
supportsSubagents: true,
|
|
11292
|
+
supportsCompact: true,
|
|
11293
|
+
supportsStreamingToolInput: false,
|
|
11294
|
+
supportsQueuedSteer: false,
|
|
11295
|
+
supportsQueuedSteerSoon: false,
|
|
11296
|
+
// Single cwd.
|
|
11297
|
+
supportsAdditionalDirs: false,
|
|
11298
|
+
// `runtime.forkSession` copies the log prefix up to an event seq.
|
|
11299
|
+
supportsFork: true,
|
|
11300
|
+
goal: null,
|
|
11301
|
+
displayName: "DeepSeek"
|
|
11302
|
+
}
|
|
11303
|
+
};
|
|
11304
|
+
ALL_GOAL_LIFECYCLE_ARGS = [...new Set(
|
|
11305
|
+
Object.values(HARNESS_CAPABILITIES).flatMap((caps) => caps.goal?.lifecycleArgs ?? [])
|
|
11306
|
+
)];
|
|
11307
|
+
}
|
|
11308
|
+
});
|
|
11309
|
+
|
|
11125
11310
|
// ../../packages/shared/src/session-goal.ts
|
|
11126
11311
|
function sessionGoalFromClaudeActive(raw) {
|
|
11127
11312
|
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return null;
|
|
@@ -11132,13 +11317,13 @@ function sessionGoalFromClaudeActive(raw) {
|
|
|
11132
11317
|
return {
|
|
11133
11318
|
objective: condition,
|
|
11134
11319
|
status: "active",
|
|
11135
|
-
...typeof value.iterations === "number" && Number.isFinite(value.iterations) ? { iterations: value.iterations } : {},
|
|
11136
11320
|
...lastReason ? { lastReason } : {}
|
|
11137
11321
|
};
|
|
11138
11322
|
}
|
|
11139
11323
|
var init_session_goal = __esm({
|
|
11140
11324
|
"../../packages/shared/src/session-goal.ts"() {
|
|
11141
11325
|
"use strict";
|
|
11326
|
+
init_harness_capabilities();
|
|
11142
11327
|
}
|
|
11143
11328
|
});
|
|
11144
11329
|
|
|
@@ -53148,7 +53333,7 @@ function tryParseJsonObject(text2) {
|
|
|
53148
53333
|
}
|
|
53149
53334
|
}
|
|
53150
53335
|
}
|
|
53151
|
-
var XAI_SESSION_NOTIFICATION, XAI_SESSION_UPDATE, XAI_TASK_BACKGROUNDED, XAI_TASK_COMPLETED, XAI_MONITOR_EVENT, XAI_FOLLOW_UPS, XAI_SCHEDULED_TASK_CREATED, XAI_SCHEDULED_TASK_FIRED, XAI_SCHEDULED_TASK_DELETED, XAI_SCHEDULED_TASK_INJECT_PROMPT, XAI_MCP_ELICIT, XAI_MCP_ELICIT_COMPLETE, XAI_SETTINGS_UPDATE, XAI_SESSION_INTERJECTION, SUBAGENT_LIFECYCLE, XAI_EXT_NOTIFICATION_METHODS;
|
|
53336
|
+
var XAI_SESSION_NOTIFICATION, XAI_SESSION_UPDATE, XAI_TASK_BACKGROUNDED, XAI_TASK_COMPLETED, XAI_MONITOR_EVENT, XAI_FOLLOW_UPS, XAI_SCHEDULED_TASK_CREATED, XAI_SCHEDULED_TASK_FIRED, XAI_SCHEDULED_TASK_DELETED, XAI_SCHEDULED_TASK_INJECT_PROMPT, XAI_ASK_USER_QUESTION, XAI_EXIT_PLAN_MODE, XAI_MCP_ELICIT, XAI_MCP_ELICIT_COMPLETE, XAI_SETTINGS_UPDATE, XAI_SESSION_INTERJECTION, SUBAGENT_LIFECYCLE, XAI_EXT_NOTIFICATION_METHODS;
|
|
53152
53337
|
var init_xai_state = __esm({
|
|
53153
53338
|
"../../packages/acp/src/xai-state.ts"() {
|
|
53154
53339
|
"use strict";
|
|
@@ -53162,6 +53347,8 @@ var init_xai_state = __esm({
|
|
|
53162
53347
|
XAI_SCHEDULED_TASK_FIRED = "x.ai/scheduled_task_fired";
|
|
53163
53348
|
XAI_SCHEDULED_TASK_DELETED = "x.ai/scheduled_task_deleted";
|
|
53164
53349
|
XAI_SCHEDULED_TASK_INJECT_PROMPT = "x.ai/scheduled_task_inject_prompt";
|
|
53350
|
+
XAI_ASK_USER_QUESTION = "x.ai/ask_user_question";
|
|
53351
|
+
XAI_EXIT_PLAN_MODE = "x.ai/exit_plan_mode";
|
|
53165
53352
|
XAI_MCP_ELICIT = "x.ai/mcp/elicit";
|
|
53166
53353
|
XAI_MCP_ELICIT_COMPLETE = "x.ai/mcp/elicit_complete";
|
|
53167
53354
|
XAI_SETTINGS_UPDATE = "x.ai/settings/update";
|
|
@@ -54816,6 +55003,42 @@ function grokElicitToPendingInteraction(raw) {
|
|
|
54816
55003
|
function formatGrokElicitOutcome(allow) {
|
|
54817
55004
|
return { outcome: allow ? "accept" : "cancel" };
|
|
54818
55005
|
}
|
|
55006
|
+
function formatGrokAskUserCancelled() {
|
|
55007
|
+
return { outcome: "cancelled" };
|
|
55008
|
+
}
|
|
55009
|
+
function formatGrokAskUserAccepted(answers) {
|
|
55010
|
+
if (!answers || typeof answers !== "object" || Array.isArray(answers)) {
|
|
55011
|
+
return formatGrokAskUserCancelled();
|
|
55012
|
+
}
|
|
55013
|
+
const record2 = answers;
|
|
55014
|
+
const wrapped = record2.answers !== null && typeof record2.answers === "object" && !Array.isArray(record2.answers);
|
|
55015
|
+
const source = wrapped ? record2.answers : record2;
|
|
55016
|
+
const normalized = {};
|
|
55017
|
+
for (const [question, value] of Object.entries(source)) {
|
|
55018
|
+
if (typeof value === "string") {
|
|
55019
|
+
if (value) normalized[question] = value.split(", ").map((part) => part.trim()).filter(Boolean);
|
|
55020
|
+
} else if (Array.isArray(value) && value.every((part) => typeof part === "string")) {
|
|
55021
|
+
normalized[question] = value;
|
|
55022
|
+
} else {
|
|
55023
|
+
return formatGrokAskUserCancelled();
|
|
55024
|
+
}
|
|
55025
|
+
}
|
|
55026
|
+
if (Object.keys(normalized).length === 0) return formatGrokAskUserCancelled();
|
|
55027
|
+
return {
|
|
55028
|
+
outcome: "accepted",
|
|
55029
|
+
answers: normalized,
|
|
55030
|
+
...wrapped && record2.annotations && typeof record2.annotations === "object" && !Array.isArray(record2.annotations) ? { annotations: record2.annotations } : {}
|
|
55031
|
+
};
|
|
55032
|
+
}
|
|
55033
|
+
function formatGrokExitPlanCancelled(feedback) {
|
|
55034
|
+
const trimmed = feedback?.trim();
|
|
55035
|
+
return { outcome: "cancelled", ...trimmed ? { feedback: trimmed } : {} };
|
|
55036
|
+
}
|
|
55037
|
+
function formatGrokExitPlanFromDecision(decision, options) {
|
|
55038
|
+
if (decision === "approve") return { outcome: "approved" };
|
|
55039
|
+
const feedback = typeof options?.feedback === "string" ? options.feedback : void 0;
|
|
55040
|
+
return formatGrokExitPlanCancelled(feedback);
|
|
55041
|
+
}
|
|
54819
55042
|
var init_xai_elicit = __esm({
|
|
54820
55043
|
"../../packages/acp/src/xai-elicit.ts"() {
|
|
54821
55044
|
"use strict";
|
|
@@ -54873,7 +55096,42 @@ function createAcpAgentTurnRunner(opts = {}) {
|
|
|
54873
55096
|
});
|
|
54874
55097
|
});
|
|
54875
55098
|
};
|
|
54876
|
-
|
|
55099
|
+
const handleAskUser = async (ctx) => {
|
|
55100
|
+
if (!input.onQuestion) return formatGrokAskUserCancelled();
|
|
55101
|
+
const raw = ctx.params && typeof ctx.params === "object" && !Array.isArray(ctx.params) ? ctx.params : {};
|
|
55102
|
+
const toolCallId = typeof raw.toolCallId === "string" ? raw.toolCallId : typeof raw.tool_call_id === "string" ? raw.tool_call_id : `acp_ask_${Date.now().toString(36)}`;
|
|
55103
|
+
try {
|
|
55104
|
+
const answers = await input.onQuestion({
|
|
55105
|
+
interactionId: toolCallId,
|
|
55106
|
+
kind: "question",
|
|
55107
|
+
toolUseId: toolCallId,
|
|
55108
|
+
input: raw,
|
|
55109
|
+
createdAt: Date.now()
|
|
55110
|
+
});
|
|
55111
|
+
return formatGrokAskUserAccepted(answers);
|
|
55112
|
+
} catch {
|
|
55113
|
+
return formatGrokAskUserCancelled();
|
|
55114
|
+
}
|
|
55115
|
+
};
|
|
55116
|
+
const handleExitPlan = async (ctx) => {
|
|
55117
|
+
if (!input.onPlan) return formatGrokExitPlanCancelled();
|
|
55118
|
+
const raw = ctx.params && typeof ctx.params === "object" && !Array.isArray(ctx.params) ? ctx.params : {};
|
|
55119
|
+
const toolCallId = typeof raw.toolCallId === "string" ? raw.toolCallId : typeof raw.tool_call_id === "string" ? raw.tool_call_id : `acp_plan_${Date.now().toString(36)}`;
|
|
55120
|
+
const planContent = typeof raw.planContent === "string" ? raw.planContent : typeof raw.plan_content === "string" ? raw.plan_content : "";
|
|
55121
|
+
try {
|
|
55122
|
+
const result = await input.onPlan({
|
|
55123
|
+
interactionId: toolCallId,
|
|
55124
|
+
kind: "plan",
|
|
55125
|
+
toolUseId: toolCallId,
|
|
55126
|
+
input: { planContent, ...raw },
|
|
55127
|
+
createdAt: Date.now()
|
|
55128
|
+
});
|
|
55129
|
+
return formatGrokExitPlanFromDecision(result.decision, result.options);
|
|
55130
|
+
} catch {
|
|
55131
|
+
return formatGrokExitPlanCancelled();
|
|
55132
|
+
}
|
|
55133
|
+
};
|
|
55134
|
+
let clientBuilder = client({ name: opts.clientName ?? "superone-node" }).onRequest(XAI_MCP_ELICIT, (raw) => raw, handleElicit).onRequest(`_${XAI_MCP_ELICIT}`, (raw) => raw, handleElicit).onRequest(XAI_ASK_USER_QUESTION, (raw) => raw, handleAskUser).onRequest(`_${XAI_ASK_USER_QUESTION}`, (raw) => raw, handleAskUser).onRequest(XAI_EXIT_PLAN_MODE, (raw) => raw, handleExitPlan).onRequest(`_${XAI_EXIT_PLAN_MODE}`, (raw) => raw, handleExitPlan).onRequest(methods.client.session.requestPermission, async (ctx) => {
|
|
54877
55135
|
const mapped = mapPermissionRequest(ctx.params);
|
|
54878
55136
|
pendingOptions = mapped.options;
|
|
54879
55137
|
if (!input.onPermission) {
|
|
@@ -54928,7 +55186,12 @@ function createAcpAgentTurnRunner(opts = {}) {
|
|
|
54928
55186
|
await connection.agent.request(methods.agent.initialize, {
|
|
54929
55187
|
protocolVersion: PROTOCOL_VERSION,
|
|
54930
55188
|
clientInfo: { name: opts.clientName ?? "superone-node", version: "0.0.0" },
|
|
54931
|
-
clientCapabilities: {}
|
|
55189
|
+
clientCapabilities: {},
|
|
55190
|
+
_meta: {
|
|
55191
|
+
askUserQuestion: true,
|
|
55192
|
+
exitPlanMode: true,
|
|
55193
|
+
clientIdentifier: "superone"
|
|
55194
|
+
}
|
|
54932
55195
|
});
|
|
54933
55196
|
const mcpServers = opts.getMcpServers?.(input.session.sessionId) ?? opts.mcpServers ?? [];
|
|
54934
55197
|
const active = await connection.agent.buildSession({ cwd, mcpServers }).start();
|
|
@@ -72299,8 +72562,8 @@ import { fileURLToPath } from "node:url";
|
|
|
72299
72562
|
function resolveCliReleaseVersion() {
|
|
72300
72563
|
const fromEnv = process.env.SUPERONE_CLI_VERSION?.trim();
|
|
72301
72564
|
if (fromEnv) return fromEnv;
|
|
72302
|
-
if ("0.67.0-alpha.
|
|
72303
|
-
return "0.67.0-alpha.
|
|
72565
|
+
if ("0.67.0-alpha.2".trim()) {
|
|
72566
|
+
return "0.67.0-alpha.2".trim();
|
|
72304
72567
|
}
|
|
72305
72568
|
const fromDist = readDistManifestVersion();
|
|
72306
72569
|
if (fromDist) return fromDist;
|
|
@@ -79037,6 +79300,20 @@ var HarnessManager = class {
|
|
|
79037
79300
|
diagnostic: buildHarnessDiagnostic("simulated")
|
|
79038
79301
|
};
|
|
79039
79302
|
}
|
|
79303
|
+
getExternalLaunchConfig(id) {
|
|
79304
|
+
const row = this.db.prepare("SELECT config_json FROM harness_installations WHERE harness_id = ?").get(id);
|
|
79305
|
+
try {
|
|
79306
|
+
const config2 = JSON.parse(row?.config_json || "{}");
|
|
79307
|
+
return {
|
|
79308
|
+
...typeof config2.usesDefaultArgs === "boolean" ? { usesDefaultArgs: config2.usesDefaultArgs } : {},
|
|
79309
|
+
...typeof config2.command === "string" ? { command: config2.command } : {},
|
|
79310
|
+
...["path", "explicit"].includes(config2.commandSource) ? { commandSource: config2.commandSource } : {},
|
|
79311
|
+
...Array.isArray(config2.args) && config2.args.every((arg) => typeof arg === "string") ? { args: config2.args } : {}
|
|
79312
|
+
};
|
|
79313
|
+
} catch {
|
|
79314
|
+
return {};
|
|
79315
|
+
}
|
|
79316
|
+
}
|
|
79040
79317
|
readPersisted(id) {
|
|
79041
79318
|
const row = this.db.prepare(
|
|
79042
79319
|
`SELECT harness_id, enabled, state, runtime_version, command,
|
|
@@ -83939,7 +84216,7 @@ function enableDeepseek(manager) {
|
|
|
83939
84216
|
function enableAcpGrok(manager, opts) {
|
|
83940
84217
|
const defaultArgs = ["agent", "stdio"];
|
|
83941
84218
|
const args = sanitizeHarnessArgs(opts.args.length > 0 ? opts.args : defaultArgs);
|
|
83942
|
-
const resolved = resolveExternalCommand(opts.command, ["grok"]);
|
|
84219
|
+
const resolved = resolveExternalCommand(opts.command, ["grok"], { preserveSymlinks: true });
|
|
83943
84220
|
if (!resolved) {
|
|
83944
84221
|
return manager.update("acp-grok", {
|
|
83945
84222
|
enabled: true,
|
|
@@ -83947,7 +84224,7 @@ function enableAcpGrok(manager, opts) {
|
|
|
83947
84224
|
command: null,
|
|
83948
84225
|
diagnosticCode: "not_found",
|
|
83949
84226
|
lastProbedAt: Date.now(),
|
|
83950
|
-
configJson: JSON.stringify({ args, usesDefaultArgs: opts.args.length === 0 })
|
|
84227
|
+
configJson: JSON.stringify({ commandSource: opts.command ? "explicit" : "path", command: opts.command, args, usesDefaultArgs: opts.args.length === 0 })
|
|
83951
84228
|
});
|
|
83952
84229
|
}
|
|
83953
84230
|
return manager.update("acp-grok", {
|
|
@@ -83958,6 +84235,7 @@ function enableAcpGrok(manager, opts) {
|
|
|
83958
84235
|
lastProbedAt: Date.now(),
|
|
83959
84236
|
configJson: JSON.stringify({
|
|
83960
84237
|
command: resolved,
|
|
84238
|
+
commandSource: opts.command ? "explicit" : "path",
|
|
83961
84239
|
args,
|
|
83962
84240
|
usesDefaultArgs: opts.args.length === 0
|
|
83963
84241
|
})
|
|
@@ -83974,7 +84252,7 @@ function requireRegularReadableFile(path) {
|
|
|
83974
84252
|
accessSync2(abs, constants2.R_OK);
|
|
83975
84253
|
return realpathSync3(abs);
|
|
83976
84254
|
}
|
|
83977
|
-
function resolveExternalCommand(explicit, searchNames) {
|
|
84255
|
+
function resolveExternalCommand(explicit, searchNames, options = {}) {
|
|
83978
84256
|
if (explicit) {
|
|
83979
84257
|
const abs = isAbsolute5(explicit) ? explicit : resolve9(explicit);
|
|
83980
84258
|
if (!existsSync33(abs)) return null;
|
|
@@ -83984,9 +84262,9 @@ function resolveExternalCommand(explicit, searchNames) {
|
|
|
83984
84262
|
} catch {
|
|
83985
84263
|
return null;
|
|
83986
84264
|
}
|
|
83987
|
-
return realpathSync3(abs);
|
|
84265
|
+
return options.preserveSymlinks ? abs : realpathSync3(abs);
|
|
83988
84266
|
}
|
|
83989
|
-
const pathEnv = process.env.PATH
|
|
84267
|
+
const pathEnv = options.pathEnv ?? process.env.PATH ?? "";
|
|
83990
84268
|
const dirs = pathEnv.split(process.platform === "win32" ? ";" : ":");
|
|
83991
84269
|
for (const name of searchNames) {
|
|
83992
84270
|
for (const dir of dirs) {
|
|
@@ -83996,7 +84274,7 @@ function resolveExternalCommand(explicit, searchNames) {
|
|
|
83996
84274
|
try {
|
|
83997
84275
|
if (!statSync12(candidate).isFile()) continue;
|
|
83998
84276
|
accessSync2(candidate, constants2.X_OK);
|
|
83999
|
-
return realpathSync3(candidate);
|
|
84277
|
+
return options.preserveSymlinks ? candidate : realpathSync3(candidate);
|
|
84000
84278
|
} catch {
|
|
84001
84279
|
}
|
|
84002
84280
|
}
|
|
@@ -85651,38 +85929,8 @@ import { createHash as createHash9, randomBytes as randomBytes5, randomUUID as r
|
|
|
85651
85929
|
import { existsSync as existsSync39, statSync as statSync15 } from "node:fs";
|
|
85652
85930
|
import { resolve as pathResolve2 } from "node:path";
|
|
85653
85931
|
|
|
85654
|
-
// ../../packages/shared/src/
|
|
85655
|
-
|
|
85656
|
-
if (!agentId) return false;
|
|
85657
|
-
const id = agentId.toLowerCase();
|
|
85658
|
-
return id.includes("grok");
|
|
85659
|
-
}
|
|
85660
|
-
function isOpenCodeAcpAgent(agentId) {
|
|
85661
|
-
if (!agentId) return false;
|
|
85662
|
-
return agentId.toLowerCase().includes("opencode");
|
|
85663
|
-
}
|
|
85664
|
-
function resolveHarnessBrandKey(harnessId, acpAgentId) {
|
|
85665
|
-
if (!harnessId) return "claude";
|
|
85666
|
-
if (harnessId !== "acp") return harnessId;
|
|
85667
|
-
if (isGrokAcpAgent(acpAgentId)) return "acp-grok";
|
|
85668
|
-
if (isOpenCodeAcpAgent(acpAgentId)) return "acp-opencode";
|
|
85669
|
-
if (acpAgentId?.trim()) {
|
|
85670
|
-
const short = acpAgentId.trim().toLowerCase().replace(/-build$/, "").replace(/[^a-z0-9]+/g, "-");
|
|
85671
|
-
return short ? `acp-${short}` : "acp";
|
|
85672
|
-
}
|
|
85673
|
-
return "acp";
|
|
85674
|
-
}
|
|
85675
|
-
function acpAgentDisplayName(agentId, catalogName) {
|
|
85676
|
-
if (catalogName?.trim()) {
|
|
85677
|
-
return catalogName.trim().replace(/\s+Build$/i, "");
|
|
85678
|
-
}
|
|
85679
|
-
if (isGrokAcpAgent(agentId)) return "Grok";
|
|
85680
|
-
if (isOpenCodeAcpAgent(agentId)) return "OpenCode";
|
|
85681
|
-
if (agentId?.trim()) {
|
|
85682
|
-
return agentId.trim().replace(/-build$/i, "").split(/[-_]/).filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(" ");
|
|
85683
|
-
}
|
|
85684
|
-
return "ACP";
|
|
85685
|
-
}
|
|
85932
|
+
// ../../packages/shared/src/acp-brand.ts
|
|
85933
|
+
init_acp_brand();
|
|
85686
85934
|
|
|
85687
85935
|
// src/session/collaboration.ts
|
|
85688
85936
|
init_resolve_service();
|
package/package.json
CHANGED