@super-one/cli 0.67.0 → 0.68.0-alpha.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/MANIFEST.json +2 -2
- package/lib/cli.mjs +1225 -112
- package/package.json +1 -1
package/lib/cli.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
process.env.SUPERONE_VARIANT = "
|
|
1
|
+
process.env.SUPERONE_VARIANT = "alpha";
|
|
2
2
|
import { createRequire as __superoneCreateRequire } from 'node:module';
|
|
3
3
|
import { fileURLToPath as __superoneFileURLToPath } from 'node:url';
|
|
4
4
|
import { dirname as __superoneDirname } from 'node:path';
|
|
@@ -400,10 +400,10 @@ 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 = "
|
|
403
|
+
TERMINAL_TABS_DESCRIPTION = "Only for commands that run until stopped (servers, watchers) or need keyboard input (REPLs, TUIs, ssh, wizards). Non-interactive commands that finish (build, test, install, git) use your shell tool, even if slow. 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. For open tabs: 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
|
-
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
|
|
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 watch rebuild finishing). timeoutMs default 15000, max 120000. Do not sleep+poll with terminal_snapshot yourself.";
|
|
407
407
|
}
|
|
408
408
|
});
|
|
409
409
|
|
|
@@ -2220,6 +2220,127 @@ var init_host_action_browser_descriptors = __esm({
|
|
|
2220
2220
|
"additionalProperties": false
|
|
2221
2221
|
}
|
|
2222
2222
|
},
|
|
2223
|
+
{
|
|
2224
|
+
"name": "browser_run",
|
|
2225
|
+
"description": "Experimental (requires the Jev fast loop setting): delegate a multi-step page goal \u2014 clicks, typing, scrolling \u2014 to a fast model that chooses each step and judges completion itself, so you do not pay a turn per click. Start with goal; add presets for values it may type (never passwords) and, optionally, done_when when the finish is machine-checkable. Before anything irreversible (submit, pay, delete, send, leaving the site) or when unsure, the call returns status=paused with a question; answer it by calling again with runId + answer. Every result carries the final snapshot: verify it. Use for click/fill-heavy tasks on one tab; use browser_act for single steps, drag, keys, uploads.",
|
|
2226
|
+
"inputSchema": {
|
|
2227
|
+
"type": "object",
|
|
2228
|
+
"properties": {
|
|
2229
|
+
"description": {
|
|
2230
|
+
"description": "Short, human-friendly summary of the goal for the user watching, in the conversation's language.",
|
|
2231
|
+
"type": "string"
|
|
2232
|
+
},
|
|
2233
|
+
"goal": {
|
|
2234
|
+
"description": 'What to achieve, said as what the page shows when it is done: the loop judges completion from the page text, so name the visible end state, not the steps. "Report.txt is listed inside Archive" rather than "drag Report.txt onto Archive"; "no sheet is open over the document window" rather than "press Escape". When a native condition can say it, pass done_when as well. Required to start a run.',
|
|
2235
|
+
"type": "string"
|
|
2236
|
+
},
|
|
2237
|
+
"presets": {
|
|
2238
|
+
"description": "Values the loop may type. Never include passwords.",
|
|
2239
|
+
"maxItems": 20,
|
|
2240
|
+
"type": "array",
|
|
2241
|
+
"items": {
|
|
2242
|
+
"type": "object",
|
|
2243
|
+
"properties": {
|
|
2244
|
+
"key": {
|
|
2245
|
+
"type": "string",
|
|
2246
|
+
"minLength": 1,
|
|
2247
|
+
"description": "Short name, e.g. Title."
|
|
2248
|
+
},
|
|
2249
|
+
"value": {
|
|
2250
|
+
"type": "string",
|
|
2251
|
+
"description": "The full text to type."
|
|
2252
|
+
},
|
|
2253
|
+
"field": {
|
|
2254
|
+
"description": 'Hint naming the field it belongs in, e.g. "the title textbox".',
|
|
2255
|
+
"type": "string"
|
|
2256
|
+
}
|
|
2257
|
+
},
|
|
2258
|
+
"required": [
|
|
2259
|
+
"key",
|
|
2260
|
+
"value"
|
|
2261
|
+
],
|
|
2262
|
+
"additionalProperties": false
|
|
2263
|
+
}
|
|
2264
|
+
},
|
|
2265
|
+
"maxSteps": {
|
|
2266
|
+
"description": "Default 30.",
|
|
2267
|
+
"type": "integer",
|
|
2268
|
+
"minimum": 1,
|
|
2269
|
+
"maximum": 100
|
|
2270
|
+
},
|
|
2271
|
+
"maxWallMs": {
|
|
2272
|
+
"description": "Wall-clock budget per call before pausing. Default 45000.",
|
|
2273
|
+
"type": "integer",
|
|
2274
|
+
"minimum": 5e3,
|
|
2275
|
+
"maximum": 3e5
|
|
2276
|
+
},
|
|
2277
|
+
"runId": {
|
|
2278
|
+
"description": "From a paused result. Resumes that run with `answer`.",
|
|
2279
|
+
"type": "string"
|
|
2280
|
+
},
|
|
2281
|
+
"answer": {
|
|
2282
|
+
"description": "Reply to the pending question when resuming.",
|
|
2283
|
+
"type": "object",
|
|
2284
|
+
"properties": {
|
|
2285
|
+
"questionId": {
|
|
2286
|
+
"type": "string"
|
|
2287
|
+
},
|
|
2288
|
+
"choice": {
|
|
2289
|
+
"description": 'An option key from the question, or "abort".',
|
|
2290
|
+
"type": "string"
|
|
2291
|
+
},
|
|
2292
|
+
"value": {
|
|
2293
|
+
"description": "For type=value questions: { text }; for reason=capability: { actions?: <this platform's *_act actions, run on snapshot.stateId>, presets?: [{ key, value, field? }] }.",
|
|
2294
|
+
"type": "object",
|
|
2295
|
+
"propertyNames": {
|
|
2296
|
+
"type": "string"
|
|
2297
|
+
},
|
|
2298
|
+
"additionalProperties": {}
|
|
2299
|
+
},
|
|
2300
|
+
"goal": {
|
|
2301
|
+
"description": "Optionally revise the goal.",
|
|
2302
|
+
"type": "string"
|
|
2303
|
+
},
|
|
2304
|
+
"abort": {
|
|
2305
|
+
"type": "boolean"
|
|
2306
|
+
}
|
|
2307
|
+
},
|
|
2308
|
+
"required": [
|
|
2309
|
+
"questionId"
|
|
2310
|
+
],
|
|
2311
|
+
"additionalProperties": false
|
|
2312
|
+
},
|
|
2313
|
+
"tab": {
|
|
2314
|
+
"description": "Browser view id. Omit to target the focused browser view.",
|
|
2315
|
+
"type": "string"
|
|
2316
|
+
},
|
|
2317
|
+
"done_when": {
|
|
2318
|
+
"description": "Optional machine-checkable finish (AND-combined, same vocabulary as browser_wait_for). The loop judges completion itself; give this when a URL or element defines it exactly.",
|
|
2319
|
+
"type": "object",
|
|
2320
|
+
"properties": {
|
|
2321
|
+
"selector": {
|
|
2322
|
+
"type": "string"
|
|
2323
|
+
},
|
|
2324
|
+
"selectorGone": {
|
|
2325
|
+
"type": "string"
|
|
2326
|
+
},
|
|
2327
|
+
"text": {
|
|
2328
|
+
"type": "string"
|
|
2329
|
+
},
|
|
2330
|
+
"urlIncludes": {
|
|
2331
|
+
"type": "string"
|
|
2332
|
+
},
|
|
2333
|
+
"urlMatches": {
|
|
2334
|
+
"description": "JavaScript regex source matched against the page URL.",
|
|
2335
|
+
"type": "string"
|
|
2336
|
+
}
|
|
2337
|
+
},
|
|
2338
|
+
"additionalProperties": false
|
|
2339
|
+
}
|
|
2340
|
+
},
|
|
2341
|
+
"additionalProperties": false
|
|
2342
|
+
}
|
|
2343
|
+
},
|
|
2223
2344
|
{
|
|
2224
2345
|
"name": "browser_action",
|
|
2225
2346
|
"description": "Saved semantic browser actions (dynamic catalog \u2014 list then do). action=list (optional domain/name; includeArchived to find archived flows). action=read returns one complete definition by domain+name. action=archive hides a flow and prevents execution; archived=false restores it. action=do runs one saved action with input. action=save creates or replaces a named flow (domain+name) \u2014 read the manual first. This does not record prior browser calls. Use browser_act for one-off clicks/types.",
|
|
@@ -2395,7 +2516,7 @@ var init_host_action_computer_descriptors = __esm({
|
|
|
2395
2516
|
HOST_ACTION_COMPUTER_DESCRIPTORS = [
|
|
2396
2517
|
{
|
|
2397
2518
|
"name": "computer_apps",
|
|
2398
|
-
"description": "Discover and open desktop apps. action=list (default) returns a compact TOON app catalog: one row per app with app, bundleId, running, frontmost, granted, grantScope, pid, windows. Use query to keyword-filter by display name / bundle id / localized aliases (e.g. query=Notes or com.apple.TextEdit). Paginate with offset + limit (default limit 25, max 100); hasMore means call again with offset+=limit. Rows are sorted running/frontmost/granted first. action=focus|launch accepts display name (any locale) or reverse-DNS bundleId; host resolves to a stable bundleId before the permission grant so one allow covers later snapshot/act. Launch/focus returns a slim {target} confirmation. If the user only asks to open an app, launch once and stop when target is returned.
|
|
2519
|
+
"description": "Discover and open desktop apps. action=list (default) returns a compact TOON app catalog: one row per app with app, bundleId, running, frontmost, granted, grantScope, pid, windows. Use query to keyword-filter by display name / bundle id / localized aliases (e.g. query=Notes or com.apple.TextEdit). Paginate with offset + limit (default limit 25, max 100); hasMore means call again with offset+=limit. Rows are sorted running/frontmost/granted first. action=focus|launch accepts display name (any locale) or reverse-DNS bundleId; host resolves to a stable bundleId before the permission grant so one allow covers later snapshot/act. Launch/focus returns a slim {target} confirmation. If the user only asks to open an app, launch once and stop when target is returned. For navigation, forms or search, prefer computer_run when Jev is enabled; batch known button sequences with computer_act. Focus only raises the window and leaves the app in the background; pass activate=true only when the app must stay the active app for a sequence of foreground-only steps (menu bar commands and \u2318 shortcuts work in the background; no activation is needed for them).",
|
|
2399
2520
|
"inputSchema": {
|
|
2400
2521
|
"type": "object",
|
|
2401
2522
|
"properties": {
|
|
@@ -2418,6 +2539,10 @@ var init_host_action_computer_descriptors = __esm({
|
|
|
2418
2539
|
"description": "Display name (any locale) or reverse-DNS bundle id for focus/launch. Prefer bundleId from a prior list when known.",
|
|
2419
2540
|
"type": "string"
|
|
2420
2541
|
},
|
|
2542
|
+
"activate": {
|
|
2543
|
+
"description": "focus only: make the app frontmost and keep it there. Leave unset so the user keeps their current app; menu bar commands do not need it.",
|
|
2544
|
+
"type": "boolean"
|
|
2545
|
+
},
|
|
2421
2546
|
"query": {
|
|
2422
2547
|
"description": "list only: keyword filter on app name / bundleId / aliases",
|
|
2423
2548
|
"type": "string"
|
|
@@ -2447,7 +2572,7 @@ var init_host_action_computer_descriptors = __esm({
|
|
|
2447
2572
|
},
|
|
2448
2573
|
{
|
|
2449
2574
|
"name": "computer_snapshot",
|
|
2450
|
-
"description": "Capture an immutable UI snapshot and return stateId (analogous to browser_snapshot for desktop apps). All subsequent query/act/wait_for calls must reference this stateId. mode=visual (and fused) saves the image to a temporary file and returns image.path (not base64). The image is NOT loaded into your context automatically; call Read on image.path if you need to look at pixels, and embed image.path in your reply when it is evidence of the result (read_manual product/show-your-work). mode=semantic returns accessibility outline with @eN refs (no image). mode=fused = screenshot + AX. The outline is a TOON table, not JSON: a header row outline[N]{ref,depth,role,name,value,x,y,w,h,can,state}: followed by one CSV-style row per node, in depth-first reading order. depth is the nesting level (a row is a child of the nearest row above it with a smaller depth). can lists only the supported actions, pipe-joined (press|setText|typeText|scroll|focus); empty means the node is inert. state lists only non-default flags (disabled|focused). x,y,w,h are the frame in capture space, empty when the node reports none. truncation.nodesOmitted > 0 means the returned outline was folded \u2014 reach the rest with computer_query, do not recapture. truncation.sourceTruncated means the native accessibility walk itself hit a limit, so those nodes are missing from the full tree too and computer_query cannot reach them either \u2014 narrow the target with capture=window or a specific rootId instead. Use computer_query on the cached outline for search/expand/inspect without recapturing. capture=window (default) captures only the selected window; coordinates are local to that image and remain valid if the window moves. Use capture=display explicitly when the whole display is required. If the window is resized or moves to a different display scale, input fails closed and a successor observation is created.",
|
|
2575
|
+
"description": "Capture an immutable UI snapshot and return stateId (analogous to browser_snapshot for desktop apps). All subsequent query/act/wait_for calls must reference this stateId. mode=visual (and fused) saves the image to a temporary file and returns image.path (not base64). The image is NOT loaded into your context automatically; call Read on image.path if you need to look at pixels, and embed image.path in your reply when it is evidence of the result (read_manual product/show-your-work). mode=semantic returns accessibility outline with @eN refs (no image). mode=fused = screenshot + AX. The outline is a TOON table, not JSON: a header row outline[N]{ref,depth,role,name,value,x,y,w,h,can,state}: followed by one CSV-style row per node, in depth-first reading order. depth is the nesting level (a row is a child of the nearest row above it with a smaller depth). can lists only the supported actions, pipe-joined (press|select|open|setText|typeText|scroll|focus); empty means the node is inert. state lists only non-default flags (disabled|focused). x,y,w,h are the frame in capture space, empty when the node reports none. truncation.nodesOmitted > 0 means the returned outline was folded \u2014 reach the rest with computer_query, do not recapture. truncation.sourceTruncated means the native accessibility walk itself hit a limit, so those nodes are missing from the full tree too and computer_query cannot reach them either \u2014 narrow the target with capture=window or a specific rootId instead. Use computer_query on the cached outline for search/expand/inspect without recapturing. capture=window (default) captures only the selected window; coordinates are local to that image and remain valid if the window moves. Use capture=display explicitly when the whole display is required. If the window is resized or moves to a different display scale, input fails closed and a successor observation is created.",
|
|
2451
2576
|
"inputSchema": {
|
|
2452
2577
|
"type": "object",
|
|
2453
2578
|
"properties": {
|
|
@@ -2576,7 +2701,7 @@ var init_host_action_computer_descriptors = __esm({
|
|
|
2576
2701
|
},
|
|
2577
2702
|
{
|
|
2578
2703
|
"name": "computer_act",
|
|
2579
|
-
"description":
|
|
2704
|
+
"description": `Submit 1\u201320 related UI actions as a checked transaction against a stateId. Batch a known button sequence here; prefer computer_run when each next target must be found from new UI state and Jev is enabled. Everything runs in the background: the host drives a ref through its native action when it has one and otherwise posts input to the app; the app is never brought forward and the user keeps their keyboard and pointer. Menu bar commands and \u2318 shortcuts (keypress keys=["cmd+s"]) work there too. Actions: click, typeText, keypress, scroll(dx,dy[,x,y|ref]), drag(path\u22652 points), moveMouse, press/select/open/setText (AX). click on a ref with a native press is that press; otherwise a pointer click at x,y or the ref's center. select chooses a selectable item; open invokes its observed native open action. typeText is keystrokes at the insertion point, subject to the app's own autocorrect and auto-capitalisation; setText sets a value exactly. scroll: positive dy scrolls content down; a ref with a scroll bar is paged by the bar and reports when it has no room left; else a wheel at x,y (capture space), the ref center or the window center. drag: path is capture-space points; virtual cursor animates along the path. Returns outcome worked|didnt|unknown based on re-observation (not API success codes): worked when AX readback, expect, typed text, or a meaningful successor outline diff confirms effect; unknown only when applied but unprovable; didnt on hard failure or failed expect. When the successor has pixels, successorImage.path contains the fresh screenshot. Set recording=true to save a short video containing only this action transaction. Stale stateId (UI changed since snapshot) is rejected before side effects. System-wide hotkeys (\u2318Space, \u2318Tab, screenshots) are not available; they belong to no app.`,
|
|
2580
2705
|
"inputSchema": {
|
|
2581
2706
|
"type": "object",
|
|
2582
2707
|
"properties": {
|
|
@@ -2600,6 +2725,8 @@ var init_host_action_computer_descriptors = __esm({
|
|
|
2600
2725
|
"type": "string",
|
|
2601
2726
|
"enum": [
|
|
2602
2727
|
"press",
|
|
2728
|
+
"select",
|
|
2729
|
+
"open",
|
|
2603
2730
|
"click",
|
|
2604
2731
|
"setText",
|
|
2605
2732
|
"typeText",
|
|
@@ -2677,17 +2804,36 @@ var init_host_action_computer_descriptors = __esm({
|
|
|
2677
2804
|
"notExists",
|
|
2678
2805
|
"textEquals",
|
|
2679
2806
|
"textContains",
|
|
2680
|
-
"valueEquals"
|
|
2807
|
+
"valueEquals",
|
|
2808
|
+
"newRoot"
|
|
2681
2809
|
]
|
|
2682
2810
|
},
|
|
2683
2811
|
"ref": {
|
|
2812
|
+
"description": "Required except for newRoot: the target element ref from the starting snapshot.",
|
|
2684
2813
|
"type": "string"
|
|
2685
2814
|
},
|
|
2686
2815
|
"text": {
|
|
2816
|
+
"description": "For textEquals/textContains: element name or value. For newRoot: substring in the new root outline.",
|
|
2687
2817
|
"type": "string"
|
|
2688
2818
|
},
|
|
2689
2819
|
"value": {
|
|
2820
|
+
"description": "Required for valueEquals: the exact element value to wait for.",
|
|
2690
2821
|
"type": "string"
|
|
2822
|
+
},
|
|
2823
|
+
"title": {
|
|
2824
|
+
"description": "newRoot: exact title of a visible window, panel, sheet or menu in the same app that was absent at the starting snapshot.",
|
|
2825
|
+
"type": "string"
|
|
2826
|
+
},
|
|
2827
|
+
"rootKind": {
|
|
2828
|
+
"description": "newRoot: optional kind filter. Supply title and/or text; all supplied filters must match.",
|
|
2829
|
+
"type": "string",
|
|
2830
|
+
"enum": [
|
|
2831
|
+
"window",
|
|
2832
|
+
"sheet",
|
|
2833
|
+
"dialog",
|
|
2834
|
+
"menu",
|
|
2835
|
+
"popover"
|
|
2836
|
+
]
|
|
2691
2837
|
}
|
|
2692
2838
|
},
|
|
2693
2839
|
"required": [
|
|
@@ -2695,24 +2841,15 @@ var init_host_action_computer_descriptors = __esm({
|
|
|
2695
2841
|
],
|
|
2696
2842
|
"additionalProperties": false
|
|
2697
2843
|
},
|
|
2698
|
-
"recording": {
|
|
2699
|
-
"description": "Save a video of only this action transaction. Default false.",
|
|
2700
|
-
"type": "boolean"
|
|
2701
|
-
},
|
|
2702
2844
|
"timeoutMs": {
|
|
2703
2845
|
"description": "Maximum wait for expect before the action is judged. Default 5000.",
|
|
2704
2846
|
"type": "integer",
|
|
2705
2847
|
"minimum": 100,
|
|
2706
2848
|
"maximum": 6e4
|
|
2707
2849
|
},
|
|
2708
|
-
"
|
|
2709
|
-
"description": "
|
|
2710
|
-
"type": "
|
|
2711
|
-
"enum": [
|
|
2712
|
-
"semantic",
|
|
2713
|
-
"app-directed",
|
|
2714
|
-
"physical"
|
|
2715
|
-
]
|
|
2850
|
+
"recording": {
|
|
2851
|
+
"description": "Save a video of only this action transaction. Default false.",
|
|
2852
|
+
"type": "boolean"
|
|
2716
2853
|
}
|
|
2717
2854
|
},
|
|
2718
2855
|
"required": [
|
|
@@ -2723,9 +2860,164 @@ var init_host_action_computer_descriptors = __esm({
|
|
|
2723
2860
|
"additionalProperties": false
|
|
2724
2861
|
}
|
|
2725
2862
|
},
|
|
2863
|
+
{
|
|
2864
|
+
"name": "computer_run",
|
|
2865
|
+
"description": `Experimental (Jev setting): pursue desktop UI goals with clicks, typing and scrolling chosen without a model turn per step. Start with app (launched in the background if it is not running) or root, and goal; no computer_apps or computer_snapshot call is needed first. If the exact sequence of buttons is already known, use computer_act with a batch instead. Example: presets=[{key:"Query",value:"cats",field:"Search"}], done_when={kind:"valueEquals",ref:"@e7",value:"cats"}. Native computer_wait_for conditions bind at run start. The loop judges each step's risk and the goal's completion itself; before anything irreversible (save, send, delete, quit, leaving the app) or when unsure it pauses with a question. Resume a pause with runId + answer. Phrase goal as the end state the window will show \u2014 a row inside a folder, a text area ending with a line, no sheet open, an icon in a corner of the icon view \u2014 since the loop reads state sentences like these off the window; prefer done_when when a condition can say it. Uses existing grants and tiers; skips secure fields. Use computer_act for single steps, drag, shortcuts or pixels.`,
|
|
2866
|
+
"inputSchema": {
|
|
2867
|
+
"type": "object",
|
|
2868
|
+
"properties": {
|
|
2869
|
+
"description": {
|
|
2870
|
+
"type": "string",
|
|
2871
|
+
"minLength": 1,
|
|
2872
|
+
"maxLength": 160,
|
|
2873
|
+
"description": "Short, human-friendly explanation of the goal for the user watching, in the conversation's language."
|
|
2874
|
+
},
|
|
2875
|
+
"goal": {
|
|
2876
|
+
"description": 'What to achieve, said as what the page shows when it is done: the loop judges completion from the page text, so name the visible end state, not the steps. "Report.txt is listed inside Archive" rather than "drag Report.txt onto Archive"; "no sheet is open over the document window" rather than "press Escape". When a native condition can say it, pass done_when as well. Required to start a run.',
|
|
2877
|
+
"type": "string"
|
|
2878
|
+
},
|
|
2879
|
+
"presets": {
|
|
2880
|
+
"description": "Values the loop may type. Never include passwords.",
|
|
2881
|
+
"maxItems": 20,
|
|
2882
|
+
"type": "array",
|
|
2883
|
+
"items": {
|
|
2884
|
+
"type": "object",
|
|
2885
|
+
"properties": {
|
|
2886
|
+
"key": {
|
|
2887
|
+
"type": "string",
|
|
2888
|
+
"minLength": 1,
|
|
2889
|
+
"description": "Short name, e.g. Title."
|
|
2890
|
+
},
|
|
2891
|
+
"value": {
|
|
2892
|
+
"type": "string",
|
|
2893
|
+
"description": "The full text to type."
|
|
2894
|
+
},
|
|
2895
|
+
"field": {
|
|
2896
|
+
"description": 'Hint naming the field it belongs in, e.g. "the title textbox".',
|
|
2897
|
+
"type": "string"
|
|
2898
|
+
}
|
|
2899
|
+
},
|
|
2900
|
+
"required": [
|
|
2901
|
+
"key",
|
|
2902
|
+
"value"
|
|
2903
|
+
],
|
|
2904
|
+
"additionalProperties": false
|
|
2905
|
+
}
|
|
2906
|
+
},
|
|
2907
|
+
"maxSteps": {
|
|
2908
|
+
"description": "Default 30.",
|
|
2909
|
+
"type": "integer",
|
|
2910
|
+
"minimum": 1,
|
|
2911
|
+
"maximum": 100
|
|
2912
|
+
},
|
|
2913
|
+
"maxWallMs": {
|
|
2914
|
+
"description": "Wall-clock budget per call before pausing. Default 45000.",
|
|
2915
|
+
"type": "integer",
|
|
2916
|
+
"minimum": 5e3,
|
|
2917
|
+
"maximum": 3e5
|
|
2918
|
+
},
|
|
2919
|
+
"runId": {
|
|
2920
|
+
"description": "From a paused result. Resumes that run with `answer`.",
|
|
2921
|
+
"type": "string"
|
|
2922
|
+
},
|
|
2923
|
+
"answer": {
|
|
2924
|
+
"description": "Reply to the pending question when resuming.",
|
|
2925
|
+
"type": "object",
|
|
2926
|
+
"properties": {
|
|
2927
|
+
"questionId": {
|
|
2928
|
+
"type": "string"
|
|
2929
|
+
},
|
|
2930
|
+
"choice": {
|
|
2931
|
+
"description": 'An option key from the question, or "abort".',
|
|
2932
|
+
"type": "string"
|
|
2933
|
+
},
|
|
2934
|
+
"value": {
|
|
2935
|
+
"description": "For type=value questions: { text }; for reason=capability: { actions?: <this platform's *_act actions, run on snapshot.stateId>, presets?: [{ key, value, field? }] }.",
|
|
2936
|
+
"type": "object",
|
|
2937
|
+
"propertyNames": {
|
|
2938
|
+
"type": "string"
|
|
2939
|
+
},
|
|
2940
|
+
"additionalProperties": {}
|
|
2941
|
+
},
|
|
2942
|
+
"goal": {
|
|
2943
|
+
"description": "Optionally revise the goal.",
|
|
2944
|
+
"type": "string"
|
|
2945
|
+
},
|
|
2946
|
+
"abort": {
|
|
2947
|
+
"type": "boolean"
|
|
2948
|
+
}
|
|
2949
|
+
},
|
|
2950
|
+
"required": [
|
|
2951
|
+
"questionId"
|
|
2952
|
+
],
|
|
2953
|
+
"additionalProperties": false
|
|
2954
|
+
},
|
|
2955
|
+
"app": {
|
|
2956
|
+
"description": "App name (any locale) or bundle id. Resolves the app grant and its window; an app that is not running or has no window is launched in the background and its first window awaited. Use app or root, not both.",
|
|
2957
|
+
"type": "string"
|
|
2958
|
+
},
|
|
2959
|
+
"root": {
|
|
2960
|
+
"description": "Root id from computer_snapshot/computer_apps. Omit to use the existing target.",
|
|
2961
|
+
"type": "string"
|
|
2962
|
+
},
|
|
2963
|
+
"done_when": {
|
|
2964
|
+
"description": 'Same conditions as computer_wait_for. Bind ref to an element in the starting snapshot, or use {kind:"newRoot",title:"Fonts"} for a new same-app window/panel. newRoot needs title and/or text; supplied filters must all match. No future ref is needed.',
|
|
2965
|
+
"type": "object",
|
|
2966
|
+
"properties": {
|
|
2967
|
+
"kind": {
|
|
2968
|
+
"type": "string",
|
|
2969
|
+
"enum": [
|
|
2970
|
+
"exists",
|
|
2971
|
+
"notExists",
|
|
2972
|
+
"textEquals",
|
|
2973
|
+
"textContains",
|
|
2974
|
+
"valueEquals",
|
|
2975
|
+
"newRoot"
|
|
2976
|
+
]
|
|
2977
|
+
},
|
|
2978
|
+
"ref": {
|
|
2979
|
+
"description": "Required except for newRoot: the target element ref from the starting snapshot.",
|
|
2980
|
+
"type": "string"
|
|
2981
|
+
},
|
|
2982
|
+
"text": {
|
|
2983
|
+
"description": "For textEquals/textContains: element name or value. For newRoot: substring in the new root outline.",
|
|
2984
|
+
"type": "string"
|
|
2985
|
+
},
|
|
2986
|
+
"value": {
|
|
2987
|
+
"description": "Required for valueEquals: the exact element value to wait for.",
|
|
2988
|
+
"type": "string"
|
|
2989
|
+
},
|
|
2990
|
+
"title": {
|
|
2991
|
+
"description": "newRoot: exact title of a visible window, panel, sheet or menu in the same app that was absent at the starting snapshot.",
|
|
2992
|
+
"type": "string"
|
|
2993
|
+
},
|
|
2994
|
+
"rootKind": {
|
|
2995
|
+
"description": "newRoot: optional kind filter. Supply title and/or text; all supplied filters must match.",
|
|
2996
|
+
"type": "string",
|
|
2997
|
+
"enum": [
|
|
2998
|
+
"window",
|
|
2999
|
+
"sheet",
|
|
3000
|
+
"dialog",
|
|
3001
|
+
"menu",
|
|
3002
|
+
"popover"
|
|
3003
|
+
]
|
|
3004
|
+
}
|
|
3005
|
+
},
|
|
3006
|
+
"required": [
|
|
3007
|
+
"kind"
|
|
3008
|
+
],
|
|
3009
|
+
"additionalProperties": false
|
|
3010
|
+
}
|
|
3011
|
+
},
|
|
3012
|
+
"required": [
|
|
3013
|
+
"description"
|
|
3014
|
+
],
|
|
3015
|
+
"additionalProperties": false
|
|
3016
|
+
}
|
|
3017
|
+
},
|
|
2726
3018
|
{
|
|
2727
3019
|
"name": "computer_wait_for",
|
|
2728
|
-
"description": "Wait until a UI condition holds. Distinguishes preexisting (already true) from verified (became true). Do not sleep+poll with snapshot yourself.",
|
|
3020
|
+
"description": "Wait until a UI condition holds. Distinguishes preexisting (already true) from verified (became true); failed means the timeout ran out, and observed then carries what the element read as. Do not sleep+poll with snapshot yourself.",
|
|
2729
3021
|
"inputSchema": {
|
|
2730
3022
|
"type": "object",
|
|
2731
3023
|
"properties": {
|
|
@@ -2748,17 +3040,36 @@ var init_host_action_computer_descriptors = __esm({
|
|
|
2748
3040
|
"notExists",
|
|
2749
3041
|
"textEquals",
|
|
2750
3042
|
"textContains",
|
|
2751
|
-
"valueEquals"
|
|
3043
|
+
"valueEquals",
|
|
3044
|
+
"newRoot"
|
|
2752
3045
|
]
|
|
2753
3046
|
},
|
|
2754
3047
|
"ref": {
|
|
3048
|
+
"description": "Required except for newRoot: the target element ref from the starting snapshot.",
|
|
2755
3049
|
"type": "string"
|
|
2756
3050
|
},
|
|
2757
3051
|
"text": {
|
|
3052
|
+
"description": "For textEquals/textContains: element name or value. For newRoot: substring in the new root outline.",
|
|
2758
3053
|
"type": "string"
|
|
2759
3054
|
},
|
|
2760
3055
|
"value": {
|
|
3056
|
+
"description": "Required for valueEquals: the exact element value to wait for.",
|
|
2761
3057
|
"type": "string"
|
|
3058
|
+
},
|
|
3059
|
+
"title": {
|
|
3060
|
+
"description": "newRoot: exact title of a visible window, panel, sheet or menu in the same app that was absent at the starting snapshot.",
|
|
3061
|
+
"type": "string"
|
|
3062
|
+
},
|
|
3063
|
+
"rootKind": {
|
|
3064
|
+
"description": "newRoot: optional kind filter. Supply title and/or text; all supplied filters must match.",
|
|
3065
|
+
"type": "string",
|
|
3066
|
+
"enum": [
|
|
3067
|
+
"window",
|
|
3068
|
+
"sheet",
|
|
3069
|
+
"dialog",
|
|
3070
|
+
"menu",
|
|
3071
|
+
"popover"
|
|
3072
|
+
]
|
|
2762
3073
|
}
|
|
2763
3074
|
},
|
|
2764
3075
|
"required": [
|
|
@@ -3441,6 +3752,145 @@ var init_host_action_device_descriptors = __esm({
|
|
|
3441
3752
|
"additionalProperties": false
|
|
3442
3753
|
}
|
|
3443
3754
|
},
|
|
3755
|
+
{
|
|
3756
|
+
"name": "device_run",
|
|
3757
|
+
"description": 'Experimental (Jev setting): pursue a multi-step touch-device goal with taps, typing, swipes on the list that needs them, going back and long-presses chosen without a model turn per step. Requires existing device_request_control approval; never requests control. Start with goal (said as what the screen shows when done), optional device, presets and done_when; the loop judges risk and completion itself. Example: done_when={kind:"exists",label:"About"}. Risky or uncertain steps pause; resume with runId + answer. A capability pause takes device_act actions; its target bounds are screen fractions. Use device_act for known sequences, single steps, gestures or pixels.',
|
|
3758
|
+
"inputSchema": {
|
|
3759
|
+
"type": "object",
|
|
3760
|
+
"properties": {
|
|
3761
|
+
"description": {
|
|
3762
|
+
"type": "string",
|
|
3763
|
+
"minLength": 1,
|
|
3764
|
+
"maxLength": 160,
|
|
3765
|
+
"description": "Short, human-friendly explanation of the goal for the user watching, in the conversation's language."
|
|
3766
|
+
},
|
|
3767
|
+
"goal": {
|
|
3768
|
+
"description": 'What to achieve, said as what the page shows when it is done: the loop judges completion from the page text, so name the visible end state, not the steps. "Report.txt is listed inside Archive" rather than "drag Report.txt onto Archive"; "no sheet is open over the document window" rather than "press Escape". When a native condition can say it, pass done_when as well. Required to start a run.',
|
|
3769
|
+
"type": "string"
|
|
3770
|
+
},
|
|
3771
|
+
"presets": {
|
|
3772
|
+
"description": "Values the loop may type. Never include passwords.",
|
|
3773
|
+
"maxItems": 20,
|
|
3774
|
+
"type": "array",
|
|
3775
|
+
"items": {
|
|
3776
|
+
"type": "object",
|
|
3777
|
+
"properties": {
|
|
3778
|
+
"key": {
|
|
3779
|
+
"type": "string",
|
|
3780
|
+
"minLength": 1,
|
|
3781
|
+
"description": "Short name, e.g. Title."
|
|
3782
|
+
},
|
|
3783
|
+
"value": {
|
|
3784
|
+
"type": "string",
|
|
3785
|
+
"description": "The full text to type."
|
|
3786
|
+
},
|
|
3787
|
+
"field": {
|
|
3788
|
+
"description": 'Hint naming the field it belongs in, e.g. "the title textbox".',
|
|
3789
|
+
"type": "string"
|
|
3790
|
+
}
|
|
3791
|
+
},
|
|
3792
|
+
"required": [
|
|
3793
|
+
"key",
|
|
3794
|
+
"value"
|
|
3795
|
+
],
|
|
3796
|
+
"additionalProperties": false
|
|
3797
|
+
}
|
|
3798
|
+
},
|
|
3799
|
+
"maxSteps": {
|
|
3800
|
+
"description": "Default 30.",
|
|
3801
|
+
"type": "integer",
|
|
3802
|
+
"minimum": 1,
|
|
3803
|
+
"maximum": 100
|
|
3804
|
+
},
|
|
3805
|
+
"maxWallMs": {
|
|
3806
|
+
"description": "Wall-clock budget per call before pausing. Default 45000.",
|
|
3807
|
+
"type": "integer",
|
|
3808
|
+
"minimum": 5e3,
|
|
3809
|
+
"maximum": 3e5
|
|
3810
|
+
},
|
|
3811
|
+
"runId": {
|
|
3812
|
+
"description": "From a paused result. Resumes that run with `answer`.",
|
|
3813
|
+
"type": "string"
|
|
3814
|
+
},
|
|
3815
|
+
"answer": {
|
|
3816
|
+
"description": "Reply to the pending question when resuming.",
|
|
3817
|
+
"type": "object",
|
|
3818
|
+
"properties": {
|
|
3819
|
+
"questionId": {
|
|
3820
|
+
"type": "string"
|
|
3821
|
+
},
|
|
3822
|
+
"choice": {
|
|
3823
|
+
"description": 'An option key from the question, or "abort".',
|
|
3824
|
+
"type": "string"
|
|
3825
|
+
},
|
|
3826
|
+
"value": {
|
|
3827
|
+
"description": "For type=value questions: { text }; for reason=capability: { actions?: <this platform's *_act actions, run on snapshot.stateId>, presets?: [{ key, value, field? }] }.",
|
|
3828
|
+
"type": "object",
|
|
3829
|
+
"propertyNames": {
|
|
3830
|
+
"type": "string"
|
|
3831
|
+
},
|
|
3832
|
+
"additionalProperties": {}
|
|
3833
|
+
},
|
|
3834
|
+
"goal": {
|
|
3835
|
+
"description": "Optionally revise the goal.",
|
|
3836
|
+
"type": "string"
|
|
3837
|
+
},
|
|
3838
|
+
"abort": {
|
|
3839
|
+
"type": "boolean"
|
|
3840
|
+
}
|
|
3841
|
+
},
|
|
3842
|
+
"required": [
|
|
3843
|
+
"questionId"
|
|
3844
|
+
],
|
|
3845
|
+
"additionalProperties": false
|
|
3846
|
+
},
|
|
3847
|
+
"device": {
|
|
3848
|
+
"description": "A device already controlled by this session. Required when starting with more than one held device. A resumed run keeps its original device.",
|
|
3849
|
+
"type": "string"
|
|
3850
|
+
},
|
|
3851
|
+
"done_when": {
|
|
3852
|
+
"description": 'Same vocabulary as device_wait_for. label matches the entire accessibility name, which may combine a title and value; prefer an observed identifier. Refs are positional. Example: {kind:"exists",identifier:"details-page"}.',
|
|
3853
|
+
"type": "object",
|
|
3854
|
+
"properties": {
|
|
3855
|
+
"kind": {
|
|
3856
|
+
"type": "string",
|
|
3857
|
+
"enum": [
|
|
3858
|
+
"exists",
|
|
3859
|
+
"notExists",
|
|
3860
|
+
"textEquals",
|
|
3861
|
+
"textContains"
|
|
3862
|
+
]
|
|
3863
|
+
},
|
|
3864
|
+
"ref": {
|
|
3865
|
+
"description": "Only valid within the snapshot it came from; prefer label or identifier when waiting.",
|
|
3866
|
+
"type": "string"
|
|
3867
|
+
},
|
|
3868
|
+
"label": {
|
|
3869
|
+
"description": "Visible name of the element.",
|
|
3870
|
+
"type": "string"
|
|
3871
|
+
},
|
|
3872
|
+
"identifier": {
|
|
3873
|
+
"description": "Developer-assigned id. Survives copy changes and translation \u2014 the most durable target.",
|
|
3874
|
+
"type": "string"
|
|
3875
|
+
},
|
|
3876
|
+
"text": {
|
|
3877
|
+
"description": "The string textEquals/textContains compares against. Required by those two kinds, and NOT a way to name an element \u2014 use label for that.",
|
|
3878
|
+
"type": "string",
|
|
3879
|
+
"minLength": 1
|
|
3880
|
+
}
|
|
3881
|
+
},
|
|
3882
|
+
"required": [
|
|
3883
|
+
"kind"
|
|
3884
|
+
],
|
|
3885
|
+
"additionalProperties": false
|
|
3886
|
+
}
|
|
3887
|
+
},
|
|
3888
|
+
"required": [
|
|
3889
|
+
"description"
|
|
3890
|
+
],
|
|
3891
|
+
"additionalProperties": false
|
|
3892
|
+
}
|
|
3893
|
+
},
|
|
3444
3894
|
{
|
|
3445
3895
|
"name": "device_wait_for",
|
|
3446
3896
|
"description": "Wait until the screen satisfies a condition, instead of snapshotting in a loop. Target the element by label or identifier, never by ref: refs belong to one snapshot and what you are waiting for usually does not exist yet \u2014 text only says what to compare, it never selects. Returns a fresh settled stateId and tree, and reports preexisting vs verified.",
|
|
@@ -3672,7 +4122,7 @@ var init_host_action_terminal_descriptors = __esm({
|
|
|
3672
4122
|
command: { type: "string", description: "run only. The command the user approves and that is typed into the shell." },
|
|
3673
4123
|
rule: {
|
|
3674
4124
|
type: "string",
|
|
3675
|
-
description: 'run only. The rule offered as "always allow in this project"
|
|
4125
|
+
description: 'run only. The rule offered next to the approval as "allow for this session" / "always allow in this project": a JavaScript regular expression matched against the whole normalized command, e.g. "bun run( .*)?" for "bun run dev", "(\\w+=\\S+ )*bun run dev( .*)?" for "REMOTE_DEBUGGING_PORT=9361 bun run dev", "git commit( .*)?" for "git commit -m \u2026". It must match `command`; keep it as narrow as the user would want (never "sudo.*" / "ssh.*"). Default: derived from the command.'
|
|
3676
4126
|
},
|
|
3677
4127
|
cwd: { type: "string", description: "run only. Absolute working directory for a new tab. Default: the session working directory." },
|
|
3678
4128
|
title: { type: "string", description: "run only. Tab title shown to the user. Default: the command name." },
|
|
@@ -8589,9 +9039,9 @@ var init_superone_system_prompt = __esm({
|
|
|
8589
9039
|
|
|
8590
9040
|
SuperOne tools cover browser, terminal and device control, media, widgets, sessions, collaboration, automations, settings, and mini-apps. Read only the manual topics needed for the task; reuse guidance already in context.
|
|
8591
9041
|
|
|
8592
|
-
Prefer SuperOne's built-in tools unless the user explicitly requests another tool or no suitable SuperOne tool is available.
|
|
9042
|
+
Prefer SuperOne's built-in tools for browser, device, media, widget and session work unless the user explicitly requests another tool or no suitable SuperOne tool is available. Running commands is the exception: your own shell tool stays the default (see Terminals).
|
|
8593
9043
|
|
|
8594
|
-
Terminals: your
|
|
9044
|
+
Terminals: run commands that finish without input in your shell tool, regardless of duration \u2014 a long build, a test suite or an install still belongs there. Use terminal_tabs run only for commands that run until stopped (dev server, watch mode, docker compose up, tail -f) or need keyboard input after launch (REPL, TUI, ssh, interactive wizard). Run those in the foreground of a tab instead of backgrounding them in the shell tool with \`&\`, nohup or setsid. Once a tab is open, use terminal_wait_for for the ready line or prompt, terminal_snapshot to read the screen, terminal_act to type or send keys, and terminal_tabs close when its job is done. Each command is approved by the user and your control ends when it exits; a rejected result means stop and ask, not retry.
|
|
8595
9045
|
|
|
8596
9046
|
Experience memory:
|
|
8597
9047
|
SuperOne keeps per-target experience notes on this node: browser_memory_* (domain), computer_memory_* (platform + appId), device_memory_* (platform + appId).
|
|
@@ -10898,7 +11348,7 @@ function isStaticHostOwnedSuperoneBareName(bare) {
|
|
|
10898
11348
|
function isStaticHostOwnedSuperoneToolQualified(qualifiedName) {
|
|
10899
11349
|
if (!qualifiedName.startsWith(MCP_SUPERONE_TOOL_PREFIX)) return false;
|
|
10900
11350
|
const bare = qualifiedName.slice(MCP_SUPERONE_TOOL_PREFIX.length);
|
|
10901
|
-
return isStaticHostOwnedSuperoneBareName(bare);
|
|
11351
|
+
return isStaticHostOwnedSuperoneBareName(bare) && !isNeverAutoAllowSuperoneBareName(bare);
|
|
10902
11352
|
}
|
|
10903
11353
|
function isNeverAutoAllowSuperoneBareName(bare) {
|
|
10904
11354
|
return NEVER_AUTO_ALLOW_SUPERONE_BARE_NAMES.includes(bare);
|
|
@@ -10938,6 +11388,7 @@ var init_superone_host_owned_tools = __esm({
|
|
|
10938
11388
|
"browser_emulate",
|
|
10939
11389
|
"browser_mock",
|
|
10940
11390
|
"browser_perf_measure",
|
|
11391
|
+
"browser_run",
|
|
10941
11392
|
"browser_tools_list",
|
|
10942
11393
|
"browser_tools_call"
|
|
10943
11394
|
];
|
|
@@ -10961,6 +11412,7 @@ var init_superone_host_owned_tools = __esm({
|
|
|
10961
11412
|
"browser_network",
|
|
10962
11413
|
"browser_perf",
|
|
10963
11414
|
"browser_action",
|
|
11415
|
+
"browser_run",
|
|
10964
11416
|
"browser_tools_list",
|
|
10965
11417
|
"browser_tools_call"
|
|
10966
11418
|
];
|
|
@@ -10977,6 +11429,7 @@ var init_superone_host_owned_tools = __esm({
|
|
|
10977
11429
|
"device_snapshot",
|
|
10978
11430
|
"device_query",
|
|
10979
11431
|
"device_act",
|
|
11432
|
+
"device_run",
|
|
10980
11433
|
"device_wait_for",
|
|
10981
11434
|
"device_release"
|
|
10982
11435
|
];
|
|
@@ -11028,7 +11481,7 @@ var init_superone_host_owned_tools = __esm({
|
|
|
11028
11481
|
];
|
|
11029
11482
|
MINIAPP_LIST_BARE_NAME = "miniapp_list";
|
|
11030
11483
|
MINIAPP_CALL_BARE_NAME = "miniapp_call";
|
|
11031
|
-
NEVER_AUTO_ALLOW_SUPERONE_BARE_NAMES = ["browser_tools_call"];
|
|
11484
|
+
NEVER_AUTO_ALLOW_SUPERONE_BARE_NAMES = ["browser_tools_call", "terminal_tabs"];
|
|
11032
11485
|
STATIC_HOST_OWNED_SUPERONE_QUALIFIED_TOOL_NAMES = [
|
|
11033
11486
|
...BUILT_IN_SUPERONE_TOOL_NAMES,
|
|
11034
11487
|
MINIAPP_LIST_BARE_NAME,
|
|
@@ -11037,6 +11490,70 @@ var init_superone_host_owned_tools = __esm({
|
|
|
11037
11490
|
}
|
|
11038
11491
|
});
|
|
11039
11492
|
|
|
11493
|
+
// ../../packages/shared/src/dead-stream-ledger.ts
|
|
11494
|
+
function evict(topLevel, attempt) {
|
|
11495
|
+
const blocks = [...attempt.toolUseIds].map((toolUseId) => ({ type: "tool_use", toolUseId }));
|
|
11496
|
+
if (topLevel && attempt.text) blocks.push({ type: "text", text: attempt.text, fromEnd: true });
|
|
11497
|
+
if (topLevel && attempt.thinking) blocks.push({ type: "thinking", thinking: attempt.thinking, fromEnd: true });
|
|
11498
|
+
return blocks.length > 0 ? { type: "content_retracted", messageId: attempt.messageId, blocks } : null;
|
|
11499
|
+
}
|
|
11500
|
+
function createDeadStreamLedger() {
|
|
11501
|
+
const attempts = /* @__PURE__ */ new Map();
|
|
11502
|
+
const attemptOf = (parentToolUseId, messageId) => {
|
|
11503
|
+
const key = scopeKey(parentToolUseId);
|
|
11504
|
+
let attempt = attempts.get(key);
|
|
11505
|
+
if (!attempt) {
|
|
11506
|
+
attempt = { messageId, toolUseIds: /* @__PURE__ */ new Set(), text: "", thinking: "" };
|
|
11507
|
+
attempts.set(key, attempt);
|
|
11508
|
+
}
|
|
11509
|
+
return attempt;
|
|
11510
|
+
};
|
|
11511
|
+
return {
|
|
11512
|
+
begin(parentToolUseId, messageId) {
|
|
11513
|
+
const key = scopeKey(parentToolUseId);
|
|
11514
|
+
const previous = attempts.get(key);
|
|
11515
|
+
attempts.set(key, { messageId, toolUseIds: /* @__PURE__ */ new Set(), text: "", thinking: "" });
|
|
11516
|
+
const retracted = previous ? evict(key === "", previous) : null;
|
|
11517
|
+
return retracted ? [retracted] : [];
|
|
11518
|
+
},
|
|
11519
|
+
announceToolUse(parentToolUseId, messageId, toolUseId) {
|
|
11520
|
+
if (toolUseId) attemptOf(parentToolUseId, messageId).toolUseIds.add(toolUseId);
|
|
11521
|
+
},
|
|
11522
|
+
announceText(parentToolUseId, messageId, text2) {
|
|
11523
|
+
if (parentToolUseId === null) attemptOf(parentToolUseId, messageId).text += text2;
|
|
11524
|
+
},
|
|
11525
|
+
announceThinking(parentToolUseId, messageId, thinking) {
|
|
11526
|
+
if (parentToolUseId === null) attemptOf(parentToolUseId, messageId).thinking += thinking;
|
|
11527
|
+
},
|
|
11528
|
+
confirm(parentToolUseId, content) {
|
|
11529
|
+
const attempt = attempts.get(scopeKey(parentToolUseId));
|
|
11530
|
+
if (!attempt || !Array.isArray(content)) return;
|
|
11531
|
+
for (const block of content) {
|
|
11532
|
+
if (!block || typeof block !== "object") continue;
|
|
11533
|
+
if (block.type === "tool_use" && typeof block.id === "string") attempt.toolUseIds.delete(block.id);
|
|
11534
|
+
else if (block.type === "text") attempt.text = "";
|
|
11535
|
+
else if (block.type === "thinking") attempt.thinking = "";
|
|
11536
|
+
}
|
|
11537
|
+
},
|
|
11538
|
+
flush() {
|
|
11539
|
+
const events = [];
|
|
11540
|
+
for (const [key, attempt] of attempts) {
|
|
11541
|
+
const retracted = evict(key === "", attempt);
|
|
11542
|
+
if (retracted) events.push(retracted);
|
|
11543
|
+
}
|
|
11544
|
+
attempts.clear();
|
|
11545
|
+
return events;
|
|
11546
|
+
}
|
|
11547
|
+
};
|
|
11548
|
+
}
|
|
11549
|
+
var scopeKey;
|
|
11550
|
+
var init_dead_stream_ledger = __esm({
|
|
11551
|
+
"../../packages/shared/src/dead-stream-ledger.ts"() {
|
|
11552
|
+
"use strict";
|
|
11553
|
+
scopeKey = (parentToolUseId) => parentToolUseId ?? "";
|
|
11554
|
+
}
|
|
11555
|
+
});
|
|
11556
|
+
|
|
11040
11557
|
// ../../packages/shared/src/model-fallback-wire.ts
|
|
11041
11558
|
function str(value) {
|
|
11042
11559
|
return typeof value === "string" && value ? value : void 0;
|
|
@@ -11188,6 +11705,7 @@ var init_harness_capabilities = __esm({
|
|
|
11188
11705
|
// each turn and keeps going until it is met, so there is no paused state —
|
|
11189
11706
|
// the goal is either live or cleared.
|
|
11190
11707
|
goal: { lifecycleArgs: ["clear"], canPause: false, transport: "slash", semantics: "condition" },
|
|
11708
|
+
terminalCommandApproval: "harness",
|
|
11191
11709
|
displayName: "Claude"
|
|
11192
11710
|
},
|
|
11193
11711
|
codex: {
|
|
@@ -11207,6 +11725,7 @@ var init_harness_capabilities = __esm({
|
|
|
11207
11725
|
// `thread/goal/{get,set,clear}` over the app server; SuperOne drives the
|
|
11208
11726
|
// follow-up turns itself, so every transition is an explicit RPC.
|
|
11209
11727
|
goal: { lifecycleArgs: [], canPause: true, transport: "rpc", semantics: "objective" },
|
|
11728
|
+
terminalCommandApproval: "harness",
|
|
11210
11729
|
displayName: "Codex"
|
|
11211
11730
|
},
|
|
11212
11731
|
acp: {
|
|
@@ -11239,6 +11758,7 @@ var init_harness_capabilities = __esm({
|
|
|
11239
11758
|
transport: "slash",
|
|
11240
11759
|
semantics: "objective"
|
|
11241
11760
|
},
|
|
11761
|
+
terminalCommandApproval: "harness",
|
|
11242
11762
|
displayName: "Others"
|
|
11243
11763
|
},
|
|
11244
11764
|
opencode: {
|
|
@@ -11255,6 +11775,7 @@ var init_harness_capabilities = __esm({
|
|
|
11255
11775
|
// Server-side `forkSession(id, anchor)` + `moveSession`.
|
|
11256
11776
|
supportsFork: true,
|
|
11257
11777
|
goal: null,
|
|
11778
|
+
terminalCommandApproval: "harness",
|
|
11258
11779
|
displayName: "OpenCode"
|
|
11259
11780
|
},
|
|
11260
11781
|
cursor: {
|
|
@@ -11272,6 +11793,8 @@ var init_harness_capabilities = __esm({
|
|
|
11272
11793
|
// SDK has no transcript-fork API; the adapter creates a blank agent.
|
|
11273
11794
|
supportsFork: false,
|
|
11274
11795
|
goal: null,
|
|
11796
|
+
// The @cursor/sdk local executor auto-approves custom tools with no host hook.
|
|
11797
|
+
terminalCommandApproval: "executor",
|
|
11275
11798
|
displayName: "Cursor"
|
|
11276
11799
|
},
|
|
11277
11800
|
dsh: {
|
|
@@ -11298,6 +11821,7 @@ var init_harness_capabilities = __esm({
|
|
|
11298
11821
|
// `runtime.forkSession` copies the log prefix up to an event seq.
|
|
11299
11822
|
supportsFork: true,
|
|
11300
11823
|
goal: null,
|
|
11824
|
+
terminalCommandApproval: "harness",
|
|
11301
11825
|
displayName: "DeepSeek"
|
|
11302
11826
|
}
|
|
11303
11827
|
};
|
|
@@ -11497,6 +12021,7 @@ function createClaudeAgentEventMapper(options) {
|
|
|
11497
12021
|
let lastAssistantUsage = null;
|
|
11498
12022
|
let lastTopLevelAssistantUuid = "";
|
|
11499
12023
|
const retractions = createRetractionLedger();
|
|
12024
|
+
const deadStreams = createDeadStreamLedger();
|
|
11500
12025
|
let lastReplayCheckpointId = "";
|
|
11501
12026
|
let lastAssistantTypedError;
|
|
11502
12027
|
let lastAssistantRequestId;
|
|
@@ -11824,6 +12349,7 @@ function createClaudeAgentEventMapper(options) {
|
|
|
11824
12349
|
const requestId = raw.request_id ?? raw.requestId;
|
|
11825
12350
|
if (requestId) lastAssistantRequestId = String(requestId);
|
|
11826
12351
|
if (raw.message?.model) lastAssistantModel = String(raw.message.model);
|
|
12352
|
+
deadStreams.confirm(assistantParent, raw.message?.content);
|
|
11827
12353
|
if (!assistantParent) {
|
|
11828
12354
|
lastTopLevelAssistantUuid = raw.uuid ?? "";
|
|
11829
12355
|
for (const retracted of retractions.resolve(raw.supersedes)) emit(retracted);
|
|
@@ -11900,16 +12426,19 @@ ${text2}` : text2;
|
|
|
11900
12426
|
const toolName = event.content_block.name ?? "unknown";
|
|
11901
12427
|
activeToolBlocks.set(event.index, toolUseId);
|
|
11902
12428
|
toolIdToName.set(toolUseId, toolName);
|
|
12429
|
+
deadStreams.announceToolUse(streamParent, messageId, toolUseId);
|
|
11903
12430
|
emit({ type: "content_delta", messageId, delta: { type: "tool_use", toolName, toolUseId, input: "", status: "streaming", parentToolUseId: streamParent } });
|
|
11904
12431
|
} else if (event.type === "content_block_start" && event.content_block?.type === "thinking") {
|
|
11905
12432
|
const timestamp = now();
|
|
11906
12433
|
emit({ type: "content_delta", messageId, delta: { type: "thinking", thinking: "", parentToolUseId: streamParent, startedAt: timestamp, endedAt: timestamp } });
|
|
11907
12434
|
} else if (event.type === "content_block_delta") {
|
|
11908
12435
|
if (event.delta?.type === "text_delta" && event.delta.text) {
|
|
12436
|
+
deadStreams.announceText(streamParent, messageId, event.delta.text);
|
|
11909
12437
|
emit({ type: "content_delta", messageId, delta: { type: "text", text: event.delta.text, parentToolUseId: streamParent } });
|
|
11910
12438
|
return { ...emptyResult(sessionId), textDelta: event.delta.text };
|
|
11911
12439
|
}
|
|
11912
12440
|
if (event.delta?.type === "thinking_delta" && typeof event.delta.thinking === "string") {
|
|
12441
|
+
deadStreams.announceThinking(streamParent, messageId, event.delta.thinking);
|
|
11913
12442
|
emit({ type: "content_delta", messageId, delta: { type: "thinking", thinking: event.delta.thinking, parentToolUseId: streamParent, endedAt: now() } });
|
|
11914
12443
|
} else if (event.delta?.type === "input_json_delta" && event.delta.partial_json) {
|
|
11915
12444
|
emit({
|
|
@@ -11923,6 +12452,7 @@ ${text2}` : text2;
|
|
|
11923
12452
|
} else if (event.type === "content_block_stop") {
|
|
11924
12453
|
activeToolBlocks.delete(event.index);
|
|
11925
12454
|
} else if (event.type === "message_start") {
|
|
12455
|
+
for (const retracted of deadStreams.begin(streamParent, messageId)) emit(retracted);
|
|
11926
12456
|
emit({ type: "stream_message_start", messageId, apiMessageId: event.message?.id ?? "", model: event.message?.model ?? "", parentToolUseId: streamParent });
|
|
11927
12457
|
} else if (event.type === "message_stop") {
|
|
11928
12458
|
emit({ type: "stream_message_stop", messageId, parentToolUseId: streamParent });
|
|
@@ -11993,6 +12523,8 @@ ${text2}` : text2;
|
|
|
11993
12523
|
rejectedRateLimit: hasRejectedRateLimit,
|
|
11994
12524
|
resetsAt: rejectedRateLimitResetsAt
|
|
11995
12525
|
});
|
|
12526
|
+
const ghosts = deadStreams.flush();
|
|
12527
|
+
if (!interrupted) for (const retracted of ghosts) emit(retracted);
|
|
11996
12528
|
if (interrupted) {
|
|
11997
12529
|
emit({ type: "message_interrupted", messageId, metadata });
|
|
11998
12530
|
activeBackgroundTasks.clear();
|
|
@@ -12057,6 +12589,7 @@ ${text2}` : text2;
|
|
|
12057
12589
|
var init_agent_event_mapper2 = __esm({
|
|
12058
12590
|
"../../packages/claude/src/agent-event-mapper.ts"() {
|
|
12059
12591
|
"use strict";
|
|
12592
|
+
init_dead_stream_ledger();
|
|
12060
12593
|
init_model_fallback_wire();
|
|
12061
12594
|
init_slash_commands();
|
|
12062
12595
|
init_session_goal();
|
|
@@ -12277,6 +12810,22 @@ var init_map_sdk_message = __esm({
|
|
|
12277
12810
|
}
|
|
12278
12811
|
});
|
|
12279
12812
|
|
|
12813
|
+
// ../../packages/claude/src/provider-settings-env.ts
|
|
12814
|
+
function providerSettingsEnv(providerEnv) {
|
|
12815
|
+
if (!providerEnv) return void 0;
|
|
12816
|
+
const env = {};
|
|
12817
|
+
for (const [key, value] of Object.entries(providerEnv)) {
|
|
12818
|
+
if (value !== void 0) env[key] = value;
|
|
12819
|
+
}
|
|
12820
|
+
if (env.ANTHROPIC_API_KEY && !("ANTHROPIC_AUTH_TOKEN" in env)) env.ANTHROPIC_AUTH_TOKEN = "";
|
|
12821
|
+
return Object.keys(env).length > 0 ? env : void 0;
|
|
12822
|
+
}
|
|
12823
|
+
var init_provider_settings_env = __esm({
|
|
12824
|
+
"../../packages/claude/src/provider-settings-env.ts"() {
|
|
12825
|
+
"use strict";
|
|
12826
|
+
}
|
|
12827
|
+
});
|
|
12828
|
+
|
|
12280
12829
|
// ../../packages/claude/src/resolve-sdk-binary.ts
|
|
12281
12830
|
import { createRequire } from "node:module";
|
|
12282
12831
|
import { existsSync as existsSync5 } from "node:fs";
|
|
@@ -12444,6 +12993,7 @@ var init_run_sdk_turn = __esm({
|
|
|
12444
12993
|
init_superone_host_owned_tools();
|
|
12445
12994
|
init_map_sdk_message();
|
|
12446
12995
|
init_agent_event_mapper2();
|
|
12996
|
+
init_provider_settings_env();
|
|
12447
12997
|
init_resolve_sdk_binary();
|
|
12448
12998
|
init_root_permission_guard();
|
|
12449
12999
|
init_ask_user_question_bridge();
|
|
@@ -12533,9 +13083,21 @@ function hasProviderModelMappingEnv(env) {
|
|
|
12533
13083
|
if (!env) return false;
|
|
12534
13084
|
return MODEL_MAPPING_ENV_IDS.some((key) => !!env[key]);
|
|
12535
13085
|
}
|
|
13086
|
+
function claudeIdToBucket(id) {
|
|
13087
|
+
const lower = id.toLowerCase();
|
|
13088
|
+
if (lower.includes("opus")) return "opus";
|
|
13089
|
+
if (lower.includes("sonnet")) return "sonnet";
|
|
13090
|
+
if (lower.includes("haiku")) return "haiku";
|
|
13091
|
+
return "default";
|
|
13092
|
+
}
|
|
12536
13093
|
function resolveMappedClaudeModelId(model, env) {
|
|
12537
|
-
if (!model || !
|
|
12538
|
-
|
|
13094
|
+
if (!model || !env || !hasProviderModelMappingEnv(env)) return model;
|
|
13095
|
+
const bucket = claudeIdToBucket(model);
|
|
13096
|
+
if (bucket !== "default" && env[BUCKET_ENV_KEYS[bucket].id]) return bucket;
|
|
13097
|
+
const defaultSlot = env[BUCKET_ENV_KEYS.default.id];
|
|
13098
|
+
if (defaultSlot) return defaultSlot;
|
|
13099
|
+
if (env[BUCKET_ENV_KEYS.opus.id]) return "opus";
|
|
13100
|
+
return stripOneM(model);
|
|
12539
13101
|
}
|
|
12540
13102
|
var SESSION_AGENT_LAUNCHES_FIELD, SESSION_AGENT_TASK_MAX, DEFAULT_CONTEXT_WINDOW, CODEX_GPT_5_6_CONTEXT_WINDOW, CODEX_PERMISSION_PRESETS, DEFAULT_CODEX_PERMISSION_PRESET, DEFAULT_CODEX_PERMISSION_PROFILE, MODEL_BUCKETS, BUCKET_ENV_KEYS, ONE_M_SUFFIX, MODEL_MAPPING_ENV_IDS;
|
|
12541
13103
|
var init_agent_types = __esm({
|
|
@@ -12662,6 +13224,7 @@ function buildLiveOptions(opts, onPermission, onQuestion, onPlan, signal, timing
|
|
|
12662
13224
|
const binaryPath = (opts.binaryPath && existsSync6(opts.binaryPath) ? opts.binaryPath : null) ?? resolveSdkClaudeBinary() ?? void 0;
|
|
12663
13225
|
const effort = opts.effort === "low" || opts.effort === "medium" || opts.effort === "high" || opts.effort === "xhigh" || opts.effort === "max" ? opts.effort : void 0;
|
|
12664
13226
|
const env = opts.env ? { ...process.env, ...opts.env } : void 0;
|
|
13227
|
+
const settingsEnv = providerSettingsEnv(opts.env);
|
|
12665
13228
|
const sandbox = opts.sandboxMode === "on" || opts.sandboxMode === "auto" ? {
|
|
12666
13229
|
enabled: true,
|
|
12667
13230
|
autoAllowBashIfSandboxed: opts.sandboxMode === "auto",
|
|
@@ -12707,7 +13270,8 @@ function buildLiveOptions(opts, onPermission, onQuestion, onPlan, signal, timing
|
|
|
12707
13270
|
...opts.sessionId ? { resume: opts.sessionId } : {},
|
|
12708
13271
|
...opts.resumeSessionAt ? { resumeSessionAt: opts.resumeSessionAt } : {},
|
|
12709
13272
|
...opts.resumeDropsTurn ? { resumeDropsTurn: opts.resumeDropsTurn } : {},
|
|
12710
|
-
...env ? { env } : {}
|
|
13273
|
+
...env ? { env } : {},
|
|
13274
|
+
...settingsEnv ? { settings: { env: settingsEnv } } : {}
|
|
12711
13275
|
};
|
|
12712
13276
|
return {
|
|
12713
13277
|
...base,
|
|
@@ -12734,6 +13298,7 @@ var init_claude_live_session = __esm({
|
|
|
12734
13298
|
init_message_bridge();
|
|
12735
13299
|
init_agent_event_mapper2();
|
|
12736
13300
|
init_map_sdk_message();
|
|
13301
|
+
init_provider_settings_env();
|
|
12737
13302
|
init_resolve_sdk_binary();
|
|
12738
13303
|
init_root_permission_guard();
|
|
12739
13304
|
init_ask_user_question_bridge();
|
|
@@ -13137,6 +13702,7 @@ var init_src2 = __esm({
|
|
|
13137
13702
|
"../../packages/claude/src/index.ts"() {
|
|
13138
13703
|
"use strict";
|
|
13139
13704
|
init_run_sdk_turn();
|
|
13705
|
+
init_provider_settings_env();
|
|
13140
13706
|
init_message_bridge();
|
|
13141
13707
|
init_claude_live_session();
|
|
13142
13708
|
init_agent_event_mapper2();
|
|
@@ -14186,10 +14752,126 @@ var init_capability_prompt_tags = __esm({
|
|
|
14186
14752
|
}
|
|
14187
14753
|
});
|
|
14188
14754
|
|
|
14755
|
+
// ../../packages/shared/src/fuzzy-match.ts
|
|
14756
|
+
function forwardMatchFrom(queryLower, textLower, start) {
|
|
14757
|
+
const indices = [];
|
|
14758
|
+
let qi2 = 0;
|
|
14759
|
+
for (let pi2 = start; pi2 < textLower.length && qi2 < queryLower.length; pi2++) {
|
|
14760
|
+
if (textLower[pi2] === queryLower[qi2]) {
|
|
14761
|
+
indices.push(pi2);
|
|
14762
|
+
qi2++;
|
|
14763
|
+
}
|
|
14764
|
+
}
|
|
14765
|
+
return indices;
|
|
14766
|
+
}
|
|
14767
|
+
function scoreIndices(indices, query, text2) {
|
|
14768
|
+
let score = 0;
|
|
14769
|
+
for (let i = 0; i < indices.length; i++) {
|
|
14770
|
+
const idx = indices[i];
|
|
14771
|
+
if (i > 0 && idx === indices[i - 1] + 1) score += 5;
|
|
14772
|
+
if (text2[idx] === query[i]) score += 1;
|
|
14773
|
+
}
|
|
14774
|
+
if (indices.length > 0 && indices[0] === 0) score += 10;
|
|
14775
|
+
score -= text2.length * 0.1;
|
|
14776
|
+
return score;
|
|
14777
|
+
}
|
|
14778
|
+
function fuzzyMatch(query, text2) {
|
|
14779
|
+
if (!query) return { match: true, score: 0, indices: [] };
|
|
14780
|
+
const queryLower = query.toLowerCase();
|
|
14781
|
+
const textLower = text2.toLowerCase();
|
|
14782
|
+
const fwd = forwardMatchFrom(queryLower, textLower, 0);
|
|
14783
|
+
if (fwd.length < queryLower.length) return { match: false, score: 0, indices: [] };
|
|
14784
|
+
let bestIndices = fwd;
|
|
14785
|
+
let bestScore = scoreIndices(fwd, query, text2);
|
|
14786
|
+
const startPositions = /* @__PURE__ */ new Set();
|
|
14787
|
+
for (let pi2 = 1; pi2 < textLower.length; pi2++) {
|
|
14788
|
+
if (textLower[pi2] === queryLower[0]) startPositions.add(pi2);
|
|
14789
|
+
}
|
|
14790
|
+
for (const start of startPositions) {
|
|
14791
|
+
const candidate = forwardMatchFrom(queryLower, textLower, start);
|
|
14792
|
+
if (candidate.length < queryLower.length) continue;
|
|
14793
|
+
const s4 = scoreIndices(candidate, query, text2);
|
|
14794
|
+
if (s4 > bestScore) {
|
|
14795
|
+
bestScore = s4;
|
|
14796
|
+
bestIndices = candidate;
|
|
14797
|
+
}
|
|
14798
|
+
}
|
|
14799
|
+
return { match: true, score: bestScore, indices: bestIndices };
|
|
14800
|
+
}
|
|
14801
|
+
var init_fuzzy_match = __esm({
|
|
14802
|
+
"../../packages/shared/src/fuzzy-match.ts"() {
|
|
14803
|
+
"use strict";
|
|
14804
|
+
}
|
|
14805
|
+
});
|
|
14806
|
+
|
|
14807
|
+
// ../../packages/shared/src/git-mention-query.ts
|
|
14808
|
+
function gitMentionPortalOf(kind) {
|
|
14809
|
+
return GIT_MENTION_PORTALS.gh.includes(kind) ? "gh" : "git";
|
|
14810
|
+
}
|
|
14811
|
+
function isGitHubRefKind(kind) {
|
|
14812
|
+
return gitMentionPortalOf(kind) === "gh";
|
|
14813
|
+
}
|
|
14814
|
+
function isGitMentionRefKind(value) {
|
|
14815
|
+
return typeof value === "string" && GIT_MENTION_REF_KINDS.includes(value);
|
|
14816
|
+
}
|
|
14817
|
+
function gitRefNameMatches(text2, query) {
|
|
14818
|
+
const q2 = query.trim();
|
|
14819
|
+
if (!q2) return true;
|
|
14820
|
+
return fuzzyMatch(q2, text2).match;
|
|
14821
|
+
}
|
|
14822
|
+
function titledKind(kind) {
|
|
14823
|
+
return kind === "commit" || isGitHubRefKind(kind);
|
|
14824
|
+
}
|
|
14825
|
+
function gitRefMatches(ref, query) {
|
|
14826
|
+
return gitRefNameMatches(titledKind(ref.kind) ? ref.detail : ref.label, query);
|
|
14827
|
+
}
|
|
14828
|
+
var GIT_MENTION_REF_KINDS, GIT_MENTION_PORTALS, GIT_MENTION_KEYWORD, GH_MENTION_KEYWORD, GIT_MENTION_NAV_PREFIX, GH_MENTION_NAV_PREFIX, GIT_HOST_PROVIDERS, GIT_MENTION_REF_LIMIT;
|
|
14829
|
+
var init_git_mention_query = __esm({
|
|
14830
|
+
"../../packages/shared/src/git-mention-query.ts"() {
|
|
14831
|
+
"use strict";
|
|
14832
|
+
init_fuzzy_match();
|
|
14833
|
+
GIT_MENTION_REF_KINDS = ["branch", "commit", "worktree", "tag", "issue", "pr"];
|
|
14834
|
+
GIT_MENTION_PORTALS = {
|
|
14835
|
+
git: ["branch", "commit", "worktree", "tag"],
|
|
14836
|
+
gh: ["issue", "pr"]
|
|
14837
|
+
};
|
|
14838
|
+
GIT_MENTION_KEYWORD = "git";
|
|
14839
|
+
GH_MENTION_KEYWORD = "gh";
|
|
14840
|
+
GIT_MENTION_NAV_PREFIX = `${GIT_MENTION_KEYWORD} `;
|
|
14841
|
+
GH_MENTION_NAV_PREFIX = `${GH_MENTION_KEYWORD} `;
|
|
14842
|
+
GIT_HOST_PROVIDERS = ["github"];
|
|
14843
|
+
GIT_MENTION_REF_LIMIT = 50;
|
|
14844
|
+
}
|
|
14845
|
+
});
|
|
14846
|
+
|
|
14847
|
+
// ../../packages/shared/src/git-mention-tags.ts
|
|
14848
|
+
function unescapeGitTagText(value) {
|
|
14849
|
+
return value.replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&");
|
|
14850
|
+
}
|
|
14851
|
+
function gitTagDisplayName(name) {
|
|
14852
|
+
return unescapeGitTagText(name).trim();
|
|
14853
|
+
}
|
|
14854
|
+
function replaceGitTagsWithMention(text2) {
|
|
14855
|
+
return text2.replace(GIT_TAG_REGEX, (_full, _kind, name) => `@${gitTagDisplayName(String(name))}`).replace(GIT_HOST_TAG_REGEX, (_full, _host, _kind, name) => `@${gitTagDisplayName(String(name))}`);
|
|
14856
|
+
}
|
|
14857
|
+
var INNER, GIT_TAG_REGEX, GIT_HOST_TAG_REGEX;
|
|
14858
|
+
var init_git_mention_tags = __esm({
|
|
14859
|
+
"../../packages/shared/src/git-mention-tags.ts"() {
|
|
14860
|
+
"use strict";
|
|
14861
|
+
init_git_mention_query();
|
|
14862
|
+
INNER = "\\s*<kind>([\\s\\S]*?)<\\/kind>\\s*<name>([\\s\\S]*?)<\\/name>\\s*<id>([\\s\\S]*?)<\\/id>\\s*";
|
|
14863
|
+
GIT_TAG_REGEX = new RegExp(`<superone-git>${INNER}<\\/superone-git>`, "g");
|
|
14864
|
+
GIT_HOST_TAG_REGEX = new RegExp(
|
|
14865
|
+
`<superone-(${GIT_HOST_PROVIDERS.join("|")})>${INNER}<\\/superone-\\1>`,
|
|
14866
|
+
"g"
|
|
14867
|
+
);
|
|
14868
|
+
}
|
|
14869
|
+
});
|
|
14870
|
+
|
|
14189
14871
|
// ../../packages/shared/src/miniapp-prompt-tags.ts
|
|
14190
14872
|
function stripMiniAppMarkup(text2) {
|
|
14191
14873
|
return stripCapabilityMarkup(
|
|
14192
|
-
text2.replace(MINIAPP_REMINDER_REGEX, "").replace(SESSION_REMINDER_REGEX, "").replace(DESKTOP_APP_REMINDER_REGEX, "").replace(MINIAPP_TAG_REGEX, (_3, appName) => `@${String(appName).trim()}`).replace(SESSION_TAG_REGEX, (_3, title) => `@${String(title).trim()}`).replace(DESKTOP_APP_TAG_REGEX, (_3, name) => `@${String(name).trim()}`).replace(PATH_REF_TAG_REGEX, (_full, _kind, name, value) => {
|
|
14874
|
+
replaceGitTagsWithMention(text2).replace(MINIAPP_REMINDER_REGEX, "").replace(SESSION_REMINDER_REGEX, "").replace(DESKTOP_APP_REMINDER_REGEX, "").replace(MINIAPP_TAG_REGEX, (_3, appName) => `@${String(appName).trim()}`).replace(SESSION_TAG_REGEX, (_3, title) => `@${String(title).trim()}`).replace(DESKTOP_APP_TAG_REGEX, (_3, name) => `@${String(name).trim()}`).replace(PATH_REF_TAG_REGEX, (_full, _kind, name, value) => {
|
|
14193
14875
|
const n = String(name).trim();
|
|
14194
14876
|
const v3 = String(value).trim();
|
|
14195
14877
|
return `@${n || v3}`;
|
|
@@ -14202,6 +14884,7 @@ var init_miniapp_prompt_tags = __esm({
|
|
|
14202
14884
|
"use strict";
|
|
14203
14885
|
init_miniapp_mention_marker();
|
|
14204
14886
|
init_capability_prompt_tags();
|
|
14887
|
+
init_git_mention_tags();
|
|
14205
14888
|
MINIAPP_TAG_REGEX = /<superone-miniapp>\s*<appname>([\s\S]*?)<\/appname>\s*<appid>([\s\S]*?)<\/appid>\s*<\/superone-miniapp>/g;
|
|
14206
14889
|
MINIAPP_REMINDER_REGEX = /\n*<superone-miniapp-reminder>[\s\S]*?<\/superone-miniapp-reminder>\n*/g;
|
|
14207
14890
|
SESSION_TAG_REGEX = /<superone-session>\s*<title>([\s\S]*?)<\/title>\s*<sessionId>([\s\S]*?)<\/sessionId>\s*<\/superone-session>/g;
|
|
@@ -17868,11 +18551,20 @@ function protocolServes(protocol, task) {
|
|
|
17868
18551
|
function isVideoWire(protocol) {
|
|
17869
18552
|
return VIDEO_WIRES.includes(protocol);
|
|
17870
18553
|
}
|
|
18554
|
+
function isVersionedRoot(url2) {
|
|
18555
|
+
return VERSIONED_ROOT.test(url2);
|
|
18556
|
+
}
|
|
17871
18557
|
function familyBaseUrl(family, baseUrl) {
|
|
17872
18558
|
const trimmed = baseUrl.replace(/\/+$/, "");
|
|
17873
|
-
if (!trimmed ||
|
|
18559
|
+
if (!trimmed || isVersionedRoot(trimmed)) return trimmed;
|
|
17874
18560
|
return `${trimmed}${FAMILY_PATH[family]}`;
|
|
17875
18561
|
}
|
|
18562
|
+
function joinRootAndPrefix(root, prefix, family) {
|
|
18563
|
+
if (!prefix) return root;
|
|
18564
|
+
if (root.endsWith(prefix)) return root;
|
|
18565
|
+
if (prefix === FAMILY_PATH[family] && isVersionedRoot(root)) return root;
|
|
18566
|
+
return `${root}${prefix}`;
|
|
18567
|
+
}
|
|
17876
18568
|
function protocolRoute(protocol) {
|
|
17877
18569
|
return `${FAMILY_PATH[PROTOCOL_FAMILY[protocol]]}${PROTOCOL_ROUTE[protocol]}`;
|
|
17878
18570
|
}
|
|
@@ -17901,10 +18593,12 @@ function normalizeRouteShape(route) {
|
|
|
17901
18593
|
function endpointBaseUrl(siteRoot, endpoint, protocol) {
|
|
17902
18594
|
const root = (endpoint.baseUrl || siteRoot).replace(/\/+$/, "");
|
|
17903
18595
|
if (!root) return "";
|
|
18596
|
+
const family = PROTOCOL_FAMILY[protocol];
|
|
17904
18597
|
const route = endpointRoute(endpoint, protocol);
|
|
17905
18598
|
const suffix = PROTOCOL_ROUTE[protocol];
|
|
17906
|
-
|
|
17907
|
-
|
|
18599
|
+
if (root.endsWith(suffix)) return root.slice(0, root.length - suffix.length);
|
|
18600
|
+
const prefix = route.endsWith(suffix) ? route.slice(0, route.length - suffix.length) : FAMILY_PATH[family];
|
|
18601
|
+
return joinRootAndPrefix(root, prefix, family);
|
|
17908
18602
|
}
|
|
17909
18603
|
function harnessChatProtocols(harness, options) {
|
|
17910
18604
|
if (harness === "claude" && options?.experimentalClaudeOpenAiChatEnabled) {
|
|
@@ -17912,7 +18606,7 @@ function harnessChatProtocols(harness, options) {
|
|
|
17912
18606
|
}
|
|
17913
18607
|
return HARNESS_CHAT_PROTOCOLS[harness];
|
|
17914
18608
|
}
|
|
17915
|
-
var PROTOCOL_TASKS, PROTOCOL_FAMILIES, FAMILY_PROTOCOLS, PROTOCOL_FAMILY, WIRE_PROTOCOLS, PROTOCOL_ORDER, VIDEO_WIRES, FAMILY_PATH, PROTOCOL_ROUTE, ROUTE_PROTOCOL, HARNESS_CHAT_PROTOCOLS, PROXY_TRANSFORMERS_ENV;
|
|
18609
|
+
var PROTOCOL_TASKS, PROTOCOL_FAMILIES, FAMILY_PROTOCOLS, PROTOCOL_FAMILY, WIRE_PROTOCOLS, PROTOCOL_ORDER, VIDEO_WIRES, FAMILY_PATH, VERSIONED_ROOT, PROTOCOL_ROUTE, ROUTE_PROTOCOL, HARNESS_CHAT_PROTOCOLS, PROXY_TRANSFORMERS_ENV;
|
|
17916
18610
|
var init_protocols = __esm({
|
|
17917
18611
|
"../../packages/shared/src/platform-registry/protocols.ts"() {
|
|
17918
18612
|
"use strict";
|
|
@@ -17950,6 +18644,7 @@ var init_protocols = __esm({
|
|
|
17950
18644
|
newapi: "/v1",
|
|
17951
18645
|
google: "/v1beta"
|
|
17952
18646
|
};
|
|
18647
|
+
VERSIONED_ROOT = /\/(?:api\/)?v\d+(?:alpha|beta)?$/;
|
|
17953
18648
|
PROTOCOL_ROUTE = {
|
|
17954
18649
|
"anthropic-messages": "/v1/messages",
|
|
17955
18650
|
"openai-chat": "/chat/completions",
|
|
@@ -18124,6 +18819,19 @@ var init_capabilities2 = __esm({
|
|
|
18124
18819
|
}
|
|
18125
18820
|
});
|
|
18126
18821
|
|
|
18822
|
+
// ../../packages/shared/src/platform-registry/claude-env.ts
|
|
18823
|
+
function claudeThirdPartyEnv(resolved) {
|
|
18824
|
+
if (CLI_KNOWN_BRANDS.has(resolved.brand)) return {};
|
|
18825
|
+
return { CLAUDE_CODE_MODEL_CAPABILITIES: "-mid_conv_tool_change" };
|
|
18826
|
+
}
|
|
18827
|
+
var CLI_KNOWN_BRANDS;
|
|
18828
|
+
var init_claude_env = __esm({
|
|
18829
|
+
"../../packages/shared/src/platform-registry/claude-env.ts"() {
|
|
18830
|
+
"use strict";
|
|
18831
|
+
CLI_KNOWN_BRANDS = /* @__PURE__ */ new Set(["anthropic", "claude", "bedrock", "vertexai"]);
|
|
18832
|
+
}
|
|
18833
|
+
});
|
|
18834
|
+
|
|
18127
18835
|
// ../../packages/shared/src/model-tasks.ts
|
|
18128
18836
|
var init_model_tasks = __esm({
|
|
18129
18837
|
"../../packages/shared/src/model-tasks.ts"() {
|
|
@@ -18310,16 +19018,16 @@ function openaiChat(prefix, opts = {}) {
|
|
|
18310
19018
|
models: opts.models
|
|
18311
19019
|
};
|
|
18312
19020
|
}
|
|
18313
|
-
var XIAOMI_MODELS, BAILIAN_CODING_PLAN_MODELS, BAILIAN_TOKEN_PLAN_MODELS, BAILIAN_API_MODELS, GLM_MODELS, MINIMAX_MODELS, DOUBAO_MODELS, SEEDANCE_MODELS, SORA_MODELS, VEO_MODELS, ARK_CODE_MODELS, KIMI_API_MODELS, KIMI_ANDANTE_MODELS, KIMI_ANDANTE_ENDPOINT_MODELS, KIMI_MODERATO_MODELS, KIMI_MODERATO_ENDPOINT_MODELS, KIMI_ALLEGRETTO_MODELS, KIMI_ALLEGRETTO_ENDPOINT_MODELS, NVIDIA_MODELS, CODING_TIMEOUT, DISABLE_NONESSENTIAL, EMPTY_AUTH_TOKEN, KIMI_BASE_EXTRA_ENV, KIMI_CTX_256K, KIMI_CTX_1M, KIMI_ANDANTE_EXTRA_ENV, KIMI_MODERATO_EXTRA_ENV, KIMI_ALLEGRETTO_EXTRA_ENV, KIMI_EXTRA_ENV, BUILTIN_PLATFORMS;
|
|
19021
|
+
var XIAOMI_MODELS, BAILIAN_CODING_PLAN_MODELS, BAILIAN_TOKEN_PLAN_MODELS, BAILIAN_API_MODELS, GLM_MODELS, MINIMAX_MODELS, DOUBAO_MODELS, SEEDANCE_MODELS, SORA_MODELS, VEO_MODELS, ARK_CODE_MODELS, KIMI_API_MODELS, KIMI_PLUS_MODELS, KIMI_PLUS_ENDPOINT_MODELS, KIMI_PRO_MODELS, KIMI_PRO_ENDPOINT_MODELS, KIMI_ANDANTE_MODELS, KIMI_ANDANTE_ENDPOINT_MODELS, KIMI_MODERATO_MODELS, KIMI_MODERATO_ENDPOINT_MODELS, KIMI_ALLEGRETTO_MODELS, KIMI_ALLEGRETTO_ENDPOINT_MODELS, KAT_CODER_MODELS, NVIDIA_MODELS, CODING_TIMEOUT, DISABLE_NONESSENTIAL, EMPTY_AUTH_TOKEN, MINIMAX_EXTRA_ENV, KIMI_BASE_EXTRA_ENV, KIMI_CTX_256K, KIMI_CTX_1M, KIMI_ANDANTE_EXTRA_ENV, KIMI_PLUS_EXTRA_ENV, KIMI_PRO_EXTRA_ENV, KIMI_MODERATO_EXTRA_ENV, KIMI_ALLEGRETTO_EXTRA_ENV, KIMI_EXTRA_ENV, BUILTIN_PLATFORMS;
|
|
18314
19022
|
var init_builtin = __esm({
|
|
18315
19023
|
"../../packages/shared/src/platform-registry/builtin.ts"() {
|
|
18316
19024
|
"use strict";
|
|
18317
19025
|
init_effective_endpoints();
|
|
18318
19026
|
init_protocols();
|
|
18319
19027
|
XIAOMI_MODELS = {
|
|
18320
|
-
default: { id: "mimo-v2.5-pro", name: "MiMo V2.5 Pro" },
|
|
18321
|
-
opus: { id: "mimo-v2.5-pro", name: "MiMo V2.5 Pro" },
|
|
18322
|
-
sonnet: { id: "mimo-v2.5-pro", name: "MiMo V2.5 Pro" },
|
|
19028
|
+
default: { id: "mimo-v2.5-pro[1m]", name: "MiMo V2.5 Pro" },
|
|
19029
|
+
opus: { id: "mimo-v2.5-pro[1m]", name: "MiMo V2.5 Pro" },
|
|
19030
|
+
sonnet: { id: "mimo-v2.5-pro[1m]", name: "MiMo V2.5 Pro" },
|
|
18323
19031
|
haiku: { id: "mimo-v2.5-pro", name: "MiMo V2.5 Pro" }
|
|
18324
19032
|
};
|
|
18325
19033
|
BAILIAN_CODING_PLAN_MODELS = {
|
|
@@ -18330,11 +19038,11 @@ var init_builtin = __esm({
|
|
|
18330
19038
|
subagent: { id: "qwen3.7-plus", name: "Qwen 3.7 Plus" }
|
|
18331
19039
|
};
|
|
18332
19040
|
BAILIAN_TOKEN_PLAN_MODELS = {
|
|
18333
|
-
default: { id: "qwen3.
|
|
18334
|
-
opus: { id: "qwen3.
|
|
18335
|
-
sonnet: { id: "qwen3.
|
|
19041
|
+
default: { id: "qwen3.8-flash", name: "Qwen 3.8 Flash" },
|
|
19042
|
+
opus: { id: "qwen3.8-flash", name: "Qwen 3.8 Flash" },
|
|
19043
|
+
sonnet: { id: "qwen3.8-flash", name: "Qwen 3.8 Flash" },
|
|
18336
19044
|
haiku: { id: "qwen3.6-flash", name: "Qwen 3.6 Flash" },
|
|
18337
|
-
subagent: { id: "qwen3.
|
|
19045
|
+
subagent: { id: "qwen3.8-flash", name: "Qwen 3.8 Flash" }
|
|
18338
19046
|
};
|
|
18339
19047
|
BAILIAN_API_MODELS = {
|
|
18340
19048
|
default: { id: "qwen3.7-max", name: "Qwen 3.7 Max" },
|
|
@@ -18344,22 +19052,23 @@ var init_builtin = __esm({
|
|
|
18344
19052
|
subagent: { id: "qwen3.7-max", name: "Qwen 3.7 Max" }
|
|
18345
19053
|
};
|
|
18346
19054
|
GLM_MODELS = {
|
|
18347
|
-
default: { id: "glm-5.
|
|
18348
|
-
opus: { id: "glm-5.
|
|
18349
|
-
sonnet: { id: "glm-5.
|
|
18350
|
-
haiku: { id: "glm-
|
|
19055
|
+
default: { id: "glm-5.3[1m]", name: "GLM-5.3" },
|
|
19056
|
+
opus: { id: "glm-5.3[1m]", name: "GLM-5.3" },
|
|
19057
|
+
sonnet: { id: "glm-5.3[1m]", name: "GLM-5.3" },
|
|
19058
|
+
haiku: { id: "glm-5.3-flash[1m]", name: "GLM-5.3 Flash" }
|
|
18351
19059
|
};
|
|
18352
19060
|
MINIMAX_MODELS = {
|
|
18353
19061
|
default: { id: "MiniMax-M3[1m]", name: "MiniMax M3" },
|
|
18354
19062
|
opus: { id: "MiniMax-M3[1m]", name: "MiniMax M3" },
|
|
18355
|
-
sonnet: { id: "MiniMax-M3", name: "MiniMax M3" },
|
|
18356
|
-
haiku: { id: "MiniMax-M3", name: "MiniMax M3" }
|
|
19063
|
+
sonnet: { id: "MiniMax-M3[1m]", name: "MiniMax M3" },
|
|
19064
|
+
haiku: { id: "MiniMax-M3[1m]", name: "MiniMax M3" }
|
|
18357
19065
|
};
|
|
18358
19066
|
DOUBAO_MODELS = {
|
|
18359
|
-
default: { id: "doubao-seed-
|
|
18360
|
-
opus: { id: "doubao-seed-
|
|
18361
|
-
sonnet: { id: "doubao-seed-
|
|
18362
|
-
haiku: { id: "doubao-seed-
|
|
19067
|
+
default: { id: "doubao-seed-evolving", name: "Doubao Seed Evolving" },
|
|
19068
|
+
opus: { id: "doubao-seed-evolving", name: "Doubao Seed Evolving" },
|
|
19069
|
+
sonnet: { id: "doubao-seed-evolving", name: "Doubao Seed Evolving" },
|
|
19070
|
+
haiku: { id: "doubao-seed-evolving", name: "Doubao Seed Evolving" },
|
|
19071
|
+
subagent: { id: "doubao-seed-evolving", name: "Doubao Seed Evolving" }
|
|
18363
19072
|
};
|
|
18364
19073
|
SEEDANCE_MODELS = [
|
|
18365
19074
|
{ id: "doubao-seedance-2-0-260128", name: "Seedance 2.0", tasks: ["video"] },
|
|
@@ -18384,15 +19093,39 @@ var init_builtin = __esm({
|
|
|
18384
19093
|
default: { id: "ark-code-latest", name: "Ark Code Latest" },
|
|
18385
19094
|
opus: { id: "ark-code-latest", name: "Ark Code Latest" },
|
|
18386
19095
|
sonnet: { id: "ark-code-latest", name: "Ark Code Latest" },
|
|
18387
|
-
haiku: { id: "ark-code-latest", name: "Ark Code Latest" }
|
|
19096
|
+
haiku: { id: "ark-code-latest", name: "Ark Code Latest" },
|
|
19097
|
+
subagent: { id: "ark-code-latest", name: "Ark Code Latest" }
|
|
18388
19098
|
};
|
|
18389
19099
|
KIMI_API_MODELS = {
|
|
18390
|
-
default: { id: "kimi-k3", name: "Kimi K3" },
|
|
18391
|
-
opus: { id: "kimi-k3", name: "Kimi K3" },
|
|
18392
|
-
sonnet: { id: "kimi-k3", name: "Kimi K3" },
|
|
18393
|
-
haiku: { id: "kimi-k2.7-code
|
|
18394
|
-
subagent: { id: "kimi-k3", name: "Kimi K3" }
|
|
19100
|
+
default: { id: "kimi-k3[1m]", name: "Kimi K3" },
|
|
19101
|
+
opus: { id: "kimi-k3[1m]", name: "Kimi K3" },
|
|
19102
|
+
sonnet: { id: "kimi-k3[1m]", name: "Kimi K3" },
|
|
19103
|
+
haiku: { id: "kimi-k2.7-code", name: "Kimi K2.7 Code" },
|
|
19104
|
+
subagent: { id: "kimi-k3[1m]", name: "Kimi K3" }
|
|
19105
|
+
};
|
|
19106
|
+
KIMI_PLUS_MODELS = {
|
|
19107
|
+
default: { id: "k3-256k", name: "Kimi K3 (256K)" },
|
|
19108
|
+
opus: { id: "k3-256k", name: "Kimi K3 (256K)" },
|
|
19109
|
+
sonnet: { id: "k3-256k", name: "Kimi K3 (256K)" },
|
|
19110
|
+
haiku: { id: "k3-256k", name: "Kimi K3 (256K)" },
|
|
19111
|
+
subagent: { id: "k3-256k", name: "Kimi K3 (256K)" }
|
|
19112
|
+
};
|
|
19113
|
+
KIMI_PLUS_ENDPOINT_MODELS = [
|
|
19114
|
+
{ id: "k3", name: "Kimi K3", tasks: ["chat"] },
|
|
19115
|
+
{ id: "k3-256k", name: "Kimi K3 (256K)", tasks: ["chat"] },
|
|
19116
|
+
{ id: "kimi-for-coding", name: "Kimi for Coding", tasks: ["chat"] }
|
|
19117
|
+
];
|
|
19118
|
+
KIMI_PRO_MODELS = {
|
|
19119
|
+
default: { id: "k3[1m]", name: "Kimi K3" },
|
|
19120
|
+
opus: { id: "k3[1m]", name: "Kimi K3" },
|
|
19121
|
+
sonnet: { id: "k3[1m]", name: "Kimi K3" },
|
|
19122
|
+
haiku: { id: "k3[1m]", name: "Kimi K3" },
|
|
19123
|
+
subagent: { id: "k3[1m]", name: "Kimi K3" }
|
|
18395
19124
|
};
|
|
19125
|
+
KIMI_PRO_ENDPOINT_MODELS = [
|
|
19126
|
+
...KIMI_PLUS_ENDPOINT_MODELS,
|
|
19127
|
+
{ id: "kimi-for-coding-highspeed", name: "Kimi for Coding HighSpeed", tasks: ["chat"] }
|
|
19128
|
+
];
|
|
18396
19129
|
KIMI_ANDANTE_MODELS = {
|
|
18397
19130
|
default: { id: "kimi-for-coding", name: "Kimi for Coding" },
|
|
18398
19131
|
opus: { id: "kimi-for-coding", name: "Kimi for Coding" },
|
|
@@ -18410,10 +19143,7 @@ var init_builtin = __esm({
|
|
|
18410
19143
|
haiku: { id: "kimi-for-coding", name: "Kimi for Coding" },
|
|
18411
19144
|
subagent: { id: "k3", name: "Kimi K3" }
|
|
18412
19145
|
};
|
|
18413
|
-
KIMI_MODERATO_ENDPOINT_MODELS =
|
|
18414
|
-
{ id: "k3", name: "Kimi K3", tasks: ["chat"] },
|
|
18415
|
-
{ id: "kimi-for-coding", name: "Kimi for Coding", tasks: ["chat"] }
|
|
18416
|
-
];
|
|
19146
|
+
KIMI_MODERATO_ENDPOINT_MODELS = KIMI_PLUS_ENDPOINT_MODELS;
|
|
18417
19147
|
KIMI_ALLEGRETTO_MODELS = {
|
|
18418
19148
|
default: { id: "k3[1m]", name: "Kimi K3" },
|
|
18419
19149
|
opus: { id: "k3[1m]", name: "Kimi K3" },
|
|
@@ -18421,11 +19151,14 @@ var init_builtin = __esm({
|
|
|
18421
19151
|
haiku: { id: "kimi-for-coding", name: "Kimi for Coding" },
|
|
18422
19152
|
subagent: { id: "k3[1m]", name: "Kimi K3" }
|
|
18423
19153
|
};
|
|
18424
|
-
KIMI_ALLEGRETTO_ENDPOINT_MODELS =
|
|
18425
|
-
|
|
18426
|
-
{ id: "
|
|
18427
|
-
{ id: "
|
|
18428
|
-
|
|
19154
|
+
KIMI_ALLEGRETTO_ENDPOINT_MODELS = KIMI_PRO_ENDPOINT_MODELS;
|
|
19155
|
+
KAT_CODER_MODELS = {
|
|
19156
|
+
default: { id: "kat-coder-pro-v2.5", name: "KAT-Coder Pro V2.5" },
|
|
19157
|
+
opus: { id: "kat-coder-pro-v2.5", name: "KAT-Coder Pro V2.5" },
|
|
19158
|
+
sonnet: { id: "kat-coder-pro-v2.5", name: "KAT-Coder Pro V2.5" },
|
|
19159
|
+
haiku: { id: "kat-coder-pro-v2.5", name: "KAT-Coder Pro V2.5" },
|
|
19160
|
+
subagent: { id: "kat-coder-pro-v2.5", name: "KAT-Coder Pro V2.5" }
|
|
19161
|
+
};
|
|
18429
19162
|
NVIDIA_MODELS = {
|
|
18430
19163
|
default: { id: "moonshotai/kimi-k3", name: "Kimi K3" },
|
|
18431
19164
|
opus: { id: "moonshotai/kimi-k3", name: "Kimi K3" },
|
|
@@ -18435,6 +19168,12 @@ var init_builtin = __esm({
|
|
|
18435
19168
|
CODING_TIMEOUT = { API_TIMEOUT_MS: "3000000" };
|
|
18436
19169
|
DISABLE_NONESSENTIAL = { CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC: "1" };
|
|
18437
19170
|
EMPTY_AUTH_TOKEN = { ANTHROPIC_AUTH_TOKEN: "" };
|
|
19171
|
+
MINIMAX_EXTRA_ENV = {
|
|
19172
|
+
...CODING_TIMEOUT,
|
|
19173
|
+
CLAUDE_CODE_AUTO_COMPACT_WINDOW: "1000000",
|
|
19174
|
+
...DISABLE_NONESSENTIAL,
|
|
19175
|
+
...EMPTY_AUTH_TOKEN
|
|
19176
|
+
};
|
|
18438
19177
|
KIMI_BASE_EXTRA_ENV = {
|
|
18439
19178
|
...CODING_TIMEOUT,
|
|
18440
19179
|
ENABLE_TOOL_SEARCH: "false",
|
|
@@ -18451,21 +19190,24 @@ var init_builtin = __esm({
|
|
|
18451
19190
|
};
|
|
18452
19191
|
KIMI_ANDANTE_EXTRA_ENV = {
|
|
18453
19192
|
...KIMI_BASE_EXTRA_ENV,
|
|
18454
|
-
...
|
|
19193
|
+
...KIMI_CTX_1M
|
|
18455
19194
|
};
|
|
18456
|
-
|
|
19195
|
+
KIMI_PLUS_EXTRA_ENV = {
|
|
18457
19196
|
...KIMI_BASE_EXTRA_ENV,
|
|
18458
19197
|
...KIMI_CTX_256K,
|
|
18459
|
-
CLAUDE_CODE_EFFORT_LEVEL: "
|
|
19198
|
+
CLAUDE_CODE_EFFORT_LEVEL: "high"
|
|
18460
19199
|
};
|
|
18461
|
-
|
|
19200
|
+
KIMI_PRO_EXTRA_ENV = {
|
|
18462
19201
|
...KIMI_BASE_EXTRA_ENV,
|
|
18463
19202
|
...KIMI_CTX_1M,
|
|
18464
|
-
CLAUDE_CODE_EFFORT_LEVEL: "
|
|
19203
|
+
CLAUDE_CODE_EFFORT_LEVEL: "high"
|
|
18465
19204
|
};
|
|
19205
|
+
KIMI_MODERATO_EXTRA_ENV = KIMI_PLUS_EXTRA_ENV;
|
|
19206
|
+
KIMI_ALLEGRETTO_EXTRA_ENV = KIMI_PRO_EXTRA_ENV;
|
|
18466
19207
|
KIMI_EXTRA_ENV = {
|
|
18467
19208
|
...KIMI_BASE_EXTRA_ENV,
|
|
18468
|
-
...KIMI_CTX_1M
|
|
19209
|
+
...KIMI_CTX_1M,
|
|
19210
|
+
CLAUDE_CODE_EFFORT_LEVEL: "max"
|
|
18469
19211
|
};
|
|
18470
19212
|
BUILTIN_PLATFORMS = [
|
|
18471
19213
|
// Official subscription (OAuth) — Credential rows exist so bindings have a target, but hold no secret.
|
|
@@ -18617,10 +19359,67 @@ var init_builtin = __esm({
|
|
|
18617
19359
|
description: "Kimi Code \u2014 \u7F16\u7A0B\u5957\u9910\u8BA2\u9605\uFF0C\u6309\u4F1A\u5458\u6863\u4F4D\u533A\u5206\u6A21\u578B\u4E0E\u4E0A\u4E0B\u6587\u914D\u7F6E",
|
|
18618
19360
|
catalogProviderId: "moonshotai",
|
|
18619
19361
|
plans: [
|
|
19362
|
+
{
|
|
19363
|
+
id: "plus",
|
|
19364
|
+
name: "Plus",
|
|
19365
|
+
description: "Kimi Code Plus \u2014 k3-256k / kimi-for-coding\uFF0CK3 \u9650 256k \u4E0A\u4E0B\u6587",
|
|
19366
|
+
auth: "api-key",
|
|
19367
|
+
baseUrl: "https://api.kimi.com",
|
|
19368
|
+
apiKeyUrl: "https://www.kimi.com/code/console",
|
|
19369
|
+
endpoints: [
|
|
19370
|
+
anthropic("/coding", {
|
|
19371
|
+
extraEnv: KIMI_PLUS_EXTRA_ENV,
|
|
19372
|
+
modelMapping: KIMI_PLUS_MODELS,
|
|
19373
|
+
models: KIMI_PLUS_ENDPOINT_MODELS
|
|
19374
|
+
}),
|
|
19375
|
+
openaiChat("/coding/v1", {
|
|
19376
|
+
modelMapping: KIMI_PLUS_MODELS,
|
|
19377
|
+
models: KIMI_PLUS_ENDPOINT_MODELS
|
|
19378
|
+
})
|
|
19379
|
+
]
|
|
19380
|
+
},
|
|
19381
|
+
{
|
|
19382
|
+
id: "pro",
|
|
19383
|
+
name: "Pro",
|
|
19384
|
+
description: "Kimi Code Pro \u2014 k3[1m] / HighSpeed\uFF0C\u6700\u9AD8 1M \u4E0A\u4E0B\u6587",
|
|
19385
|
+
auth: "api-key",
|
|
19386
|
+
baseUrl: "https://api.kimi.com",
|
|
19387
|
+
apiKeyUrl: "https://www.kimi.com/code/console",
|
|
19388
|
+
endpoints: [
|
|
19389
|
+
anthropic("/coding", {
|
|
19390
|
+
extraEnv: KIMI_PRO_EXTRA_ENV,
|
|
19391
|
+
modelMapping: KIMI_PRO_MODELS,
|
|
19392
|
+
models: KIMI_PRO_ENDPOINT_MODELS
|
|
19393
|
+
}),
|
|
19394
|
+
openaiChat("/coding/v1", {
|
|
19395
|
+
modelMapping: KIMI_PRO_MODELS,
|
|
19396
|
+
models: KIMI_PRO_ENDPOINT_MODELS
|
|
19397
|
+
})
|
|
19398
|
+
]
|
|
19399
|
+
},
|
|
19400
|
+
{
|
|
19401
|
+
id: "max",
|
|
19402
|
+
name: "Max",
|
|
19403
|
+
description: "Kimi Code Max \u2014 \u4E0E Pro \u540C\u6A21\u578B\u96C6\uFF0C\u989D\u5EA6\u66F4\u9AD8",
|
|
19404
|
+
auth: "api-key",
|
|
19405
|
+
baseUrl: "https://api.kimi.com",
|
|
19406
|
+
apiKeyUrl: "https://www.kimi.com/code/console",
|
|
19407
|
+
endpoints: [
|
|
19408
|
+
anthropic("/coding", {
|
|
19409
|
+
extraEnv: KIMI_PRO_EXTRA_ENV,
|
|
19410
|
+
modelMapping: KIMI_PRO_MODELS,
|
|
19411
|
+
models: KIMI_PRO_ENDPOINT_MODELS
|
|
19412
|
+
}),
|
|
19413
|
+
openaiChat("/coding/v1", {
|
|
19414
|
+
modelMapping: KIMI_PRO_MODELS,
|
|
19415
|
+
models: KIMI_PRO_ENDPOINT_MODELS
|
|
19416
|
+
})
|
|
19417
|
+
]
|
|
19418
|
+
},
|
|
18620
19419
|
{
|
|
18621
19420
|
id: "andante",
|
|
18622
|
-
name: "Andante",
|
|
18623
|
-
description: "Kimi Code Andante
|
|
19421
|
+
name: "Andante\uFF08\u5DF2\u505C\u552E\uFF09",
|
|
19422
|
+
description: "Kimi Code Andante\uFF08\u65E7\u5957\u9910\uFF0C\u5DF2\u505C\u552E\uFF09\u2014 kimi-for-coding\uFF0C1M \u4E0A\u4E0B\u6587",
|
|
18624
19423
|
auth: "api-key",
|
|
18625
19424
|
baseUrl: "https://api.kimi.com",
|
|
18626
19425
|
apiKeyUrl: "https://www.kimi.com/code/console",
|
|
@@ -18638,8 +19437,8 @@ var init_builtin = __esm({
|
|
|
18638
19437
|
},
|
|
18639
19438
|
{
|
|
18640
19439
|
id: "moderato",
|
|
18641
|
-
name: "Moderato",
|
|
18642
|
-
description: "Kimi Code Moderato \u2014 k3 / kimi-for-coding\
|
|
19440
|
+
name: "Moderato\uFF08\u5DF2\u505C\u552E\uFF09",
|
|
19441
|
+
description: "Kimi Code Moderato\uFF08\u65E7\u5957\u9910\uFF0C\u5DF2\u505C\u552E\uFF0C\u5BF9\u5E94 Plus\uFF09\u2014 k3 / kimi-for-coding\uFF0CK3 \u9650 256k \u4E0A\u4E0B\u6587",
|
|
18643
19442
|
auth: "api-key",
|
|
18644
19443
|
baseUrl: "https://api.kimi.com",
|
|
18645
19444
|
apiKeyUrl: "https://www.kimi.com/code/console",
|
|
@@ -18657,8 +19456,8 @@ var init_builtin = __esm({
|
|
|
18657
19456
|
},
|
|
18658
19457
|
{
|
|
18659
19458
|
id: "allegretto",
|
|
18660
|
-
name: "Allegretto
|
|
18661
|
-
description: "Kimi Code Allegretto \u53CA\u4EE5\u4E0A \u2014 k3[1m] / HighSpeed\uFF0C\u6700\u9AD8 1M \u4E0A\u4E0B\u6587",
|
|
19459
|
+
name: "Allegretto+\uFF08\u5DF2\u505C\u552E\uFF09",
|
|
19460
|
+
description: "Kimi Code Allegretto \u53CA\u4EE5\u4E0A\uFF08\u65E7\u5957\u9910\uFF0C\u5DF2\u505C\u552E\uFF0C\u5BF9\u5E94 Pro\uFF09\u2014 k3[1m] / HighSpeed\uFF0C\u6700\u9AD8 1M \u4E0A\u4E0B\u6587",
|
|
18662
19461
|
auth: "api-key",
|
|
18663
19462
|
baseUrl: "https://api.kimi.com",
|
|
18664
19463
|
apiKeyUrl: "https://www.kimi.com/code/console",
|
|
@@ -18732,11 +19531,11 @@ var init_builtin = __esm({
|
|
|
18732
19531
|
name: "\u4E2D\u56FD\u7248",
|
|
18733
19532
|
description: "MiniMax \u7F16\u7A0B\u5957\u9910\u6216 API \u2014 \u4E2D\u56FD\u533A\uFF0C\u6D77\u87BA AI \u4EE3\u7801\u6A21\u578B",
|
|
18734
19533
|
auth: "api-key",
|
|
18735
|
-
baseUrl: "https://api.
|
|
18736
|
-
apiKeyUrl: "https://platform.
|
|
19534
|
+
baseUrl: "https://api.minimax.cn",
|
|
19535
|
+
apiKeyUrl: "https://platform.minimax.cn/user-center/basic-information/interface-key",
|
|
18737
19536
|
endpoints: [
|
|
18738
19537
|
anthropic("/anthropic", {
|
|
18739
|
-
extraEnv:
|
|
19538
|
+
extraEnv: MINIMAX_EXTRA_ENV,
|
|
18740
19539
|
modelMapping: MINIMAX_MODELS
|
|
18741
19540
|
}),
|
|
18742
19541
|
openaiChat("/v1", {
|
|
@@ -18753,7 +19552,7 @@ var init_builtin = __esm({
|
|
|
18753
19552
|
apiKeyUrl: "https://platform.minimax.io/user-center/basic-information/interface-key",
|
|
18754
19553
|
endpoints: [
|
|
18755
19554
|
anthropic("/anthropic", {
|
|
18756
|
-
extraEnv:
|
|
19555
|
+
extraEnv: MINIMAX_EXTRA_ENV,
|
|
18757
19556
|
modelMapping: MINIMAX_MODELS
|
|
18758
19557
|
}),
|
|
18759
19558
|
openaiChat("/v1", {
|
|
@@ -18780,7 +19579,7 @@ var init_builtin = __esm({
|
|
|
18780
19579
|
catalogProviderId: "volcengine-agent-plan",
|
|
18781
19580
|
endpoints: [
|
|
18782
19581
|
anthropic("/api/plan", {
|
|
18783
|
-
extraEnv: { ...CODING_TIMEOUT, ...EMPTY_AUTH_TOKEN },
|
|
19582
|
+
extraEnv: { ...CODING_TIMEOUT, ...DISABLE_NONESSENTIAL, ...EMPTY_AUTH_TOKEN },
|
|
18784
19583
|
modelMapping: ARK_CODE_MODELS
|
|
18785
19584
|
}),
|
|
18786
19585
|
// Agent Plan OpenAI path — do not use /api/v3 (bypasses plan quota).
|
|
@@ -18798,7 +19597,7 @@ var init_builtin = __esm({
|
|
|
18798
19597
|
catalogProviderId: "volcengine-coding-plan",
|
|
18799
19598
|
endpoints: [
|
|
18800
19599
|
anthropic("/api/coding", {
|
|
18801
|
-
extraEnv: { ...CODING_TIMEOUT, ...EMPTY_AUTH_TOKEN },
|
|
19600
|
+
extraEnv: { ...CODING_TIMEOUT, ...DISABLE_NONESSENTIAL, ...EMPTY_AUTH_TOKEN },
|
|
18802
19601
|
modelMapping: ARK_CODE_MODELS
|
|
18803
19602
|
}),
|
|
18804
19603
|
// Coding Plan OpenAI path — do not use /api/v3 (bypasses plan quota).
|
|
@@ -18816,7 +19615,7 @@ var init_builtin = __esm({
|
|
|
18816
19615
|
catalogProviderId: "volcengine",
|
|
18817
19616
|
endpoints: [
|
|
18818
19617
|
anthropic("/api/compatible", {
|
|
18819
|
-
extraEnv: { ...CODING_TIMEOUT, ...EMPTY_AUTH_TOKEN },
|
|
19618
|
+
extraEnv: { ...CODING_TIMEOUT, ...DISABLE_NONESSENTIAL, ...EMPTY_AUTH_TOKEN },
|
|
18820
19619
|
modelMapping: DOUBAO_MODELS
|
|
18821
19620
|
}),
|
|
18822
19621
|
openaiChat("/api/v3", {
|
|
@@ -18898,12 +19697,13 @@ var init_builtin = __esm({
|
|
|
18898
19697
|
id: "token",
|
|
18899
19698
|
name: "Token Plan",
|
|
18900
19699
|
auth: "api-key",
|
|
18901
|
-
baseUrl: "https://
|
|
19700
|
+
baseUrl: "https://token-plan.cn-beijing.maas.aliyuncs.com",
|
|
18902
19701
|
apiKeyUrl: "https://bailian.console.aliyun.com/?tab=model#/api-key",
|
|
18903
19702
|
catalogProviderId: "alibaba-token-plan-cn",
|
|
18904
19703
|
endpoints: [
|
|
18905
19704
|
anthropic("/apps/anthropic", {
|
|
18906
|
-
|
|
19705
|
+
// qwen3.8-flash's usable window as published in the Token Plan Claude Code guide.
|
|
19706
|
+
extraEnv: { ...EMPTY_AUTH_TOKEN, CLAUDE_CODE_MAX_CONTEXT_TOKENS: "983616" },
|
|
18907
19707
|
modelMapping: BAILIAN_TOKEN_PLAN_MODELS
|
|
18908
19708
|
}),
|
|
18909
19709
|
openaiChat("/compatible-mode/v1", {
|
|
@@ -18934,23 +19734,39 @@ var init_builtin = __esm({
|
|
|
18934
19734
|
id: "kat-coder",
|
|
18935
19735
|
brand: "kwaikat",
|
|
18936
19736
|
name: "KAT-Coder",
|
|
18937
|
-
description: "KAT-Coder \u2014 \u5FEB\u624B\u65D7\u4E0B AI \u7F16\u7A0B\u6A21\u578B\
|
|
19737
|
+
description: "KAT-Coder \u2014 \u5FEB\u624B\u65D7\u4E0B AI \u7F16\u7A0B\u6A21\u578B\uFF08StreamLake \u4E07\u64CE\uFF09",
|
|
18938
19738
|
plans: [
|
|
18939
19739
|
{
|
|
18940
19740
|
id: "coding",
|
|
18941
19741
|
name: "Coding Plan",
|
|
19742
|
+
description: "StreamLake Coding Plan \u2014 \u8BA2\u9605\u989D\u5EA6\uFF0C\u56FA\u5B9A Claude Code \u7F51\u5173",
|
|
18942
19743
|
auth: "api-key",
|
|
18943
19744
|
baseUrl: "https://vanchin.streamlake.ai",
|
|
18944
|
-
apiKeyUrl: "https://console.streamlake.
|
|
19745
|
+
apiKeyUrl: "https://console.streamlake.ai/console/home/index",
|
|
18945
19746
|
endpoints: [
|
|
18946
|
-
anthropic("/api/gateway/
|
|
18947
|
-
extraEnv: { ...EMPTY_AUTH_TOKEN },
|
|
18948
|
-
modelMapping:
|
|
18949
|
-
|
|
18950
|
-
|
|
18951
|
-
|
|
18952
|
-
|
|
18953
|
-
|
|
19747
|
+
anthropic("/api/gateway/coding/kat-coder-pro-v2.5/claude-code-proxy", {
|
|
19748
|
+
extraEnv: { ...CODING_TIMEOUT, ...EMPTY_AUTH_TOKEN },
|
|
19749
|
+
modelMapping: KAT_CODER_MODELS
|
|
19750
|
+
}),
|
|
19751
|
+
openaiChat("/api/gateway/coding/v1", {
|
|
19752
|
+
modelMapping: KAT_CODER_MODELS
|
|
19753
|
+
})
|
|
19754
|
+
]
|
|
19755
|
+
},
|
|
19756
|
+
{
|
|
19757
|
+
id: "api",
|
|
19758
|
+
name: "API",
|
|
19759
|
+
description: "StreamLake \u6309\u91CF\u8BA1\u8D39 \u2014 \u6309\u5B9E\u9645 token \u4ED8\u8D39",
|
|
19760
|
+
auth: "api-key",
|
|
19761
|
+
baseUrl: "https://vanchin.streamlake.ai",
|
|
19762
|
+
apiKeyUrl: "https://console.streamlake.ai/console/home/index",
|
|
19763
|
+
endpoints: [
|
|
19764
|
+
anthropic("/api/gateway/v1/endpoints/kat-coder-pro-v2.5/claude-code-proxy", {
|
|
19765
|
+
extraEnv: { ...CODING_TIMEOUT, ...EMPTY_AUTH_TOKEN },
|
|
19766
|
+
modelMapping: KAT_CODER_MODELS
|
|
19767
|
+
}),
|
|
19768
|
+
openaiChat("/api/gateway/v1/endpoints", {
|
|
19769
|
+
modelMapping: KAT_CODER_MODELS
|
|
18954
19770
|
})
|
|
18955
19771
|
]
|
|
18956
19772
|
}
|
|
@@ -18972,14 +19788,14 @@ var init_builtin = __esm({
|
|
|
18972
19788
|
anthropic("/anthropic", {
|
|
18973
19789
|
extraEnv: {
|
|
18974
19790
|
...EMPTY_AUTH_TOKEN,
|
|
18975
|
-
CLAUDE_CODE_MAX_OUTPUT_TOKENS: "
|
|
19791
|
+
CLAUDE_CODE_MAX_OUTPUT_TOKENS: "131072",
|
|
18976
19792
|
...DISABLE_NONESSENTIAL
|
|
18977
19793
|
},
|
|
18978
19794
|
modelMapping: {
|
|
18979
|
-
default: { id: "LongCat-
|
|
18980
|
-
opus: { id: "LongCat-
|
|
18981
|
-
sonnet: { id: "LongCat-
|
|
18982
|
-
haiku: { id: "LongCat-
|
|
19795
|
+
default: { id: "LongCat-2.0", name: "LongCat 2.0" },
|
|
19796
|
+
opus: { id: "LongCat-2.0", name: "LongCat 2.0" },
|
|
19797
|
+
sonnet: { id: "LongCat-2.0", name: "LongCat 2.0" },
|
|
19798
|
+
haiku: { id: "LongCat-2.0", name: "LongCat 2.0" }
|
|
18983
19799
|
}
|
|
18984
19800
|
})
|
|
18985
19801
|
]
|
|
@@ -19030,7 +19846,7 @@ var init_builtin = __esm({
|
|
|
19030
19846
|
default: { id: "deepseek-v4-pro", name: "DeepSeek V4 Pro" },
|
|
19031
19847
|
opus: { id: "deepseek-v4-pro", name: "DeepSeek V4 Pro" },
|
|
19032
19848
|
sonnet: { id: "deepseek-v4-pro", name: "DeepSeek V4 Pro" },
|
|
19033
|
-
haiku: { id: "deepseek-
|
|
19849
|
+
haiku: { id: "deepseek-flash", name: "DeepSeek Flash" },
|
|
19034
19850
|
subagent: { id: "deepseek-v4-pro", name: "DeepSeek V4 Pro" }
|
|
19035
19851
|
}
|
|
19036
19852
|
})
|
|
@@ -19076,10 +19892,10 @@ var init_builtin = __esm({
|
|
|
19076
19892
|
anthropic("", {
|
|
19077
19893
|
extraEnv: { ...EMPTY_AUTH_TOKEN },
|
|
19078
19894
|
modelMapping: {
|
|
19079
|
-
default: { id: "ZhipuAI/GLM-5.
|
|
19080
|
-
opus: { id: "ZhipuAI/GLM-5.
|
|
19081
|
-
sonnet: { id: "ZhipuAI/GLM-5.
|
|
19082
|
-
haiku: { id: "ZhipuAI/GLM-5.
|
|
19895
|
+
default: { id: "ZhipuAI/GLM-5.2", name: "GLM-5.2" },
|
|
19896
|
+
opus: { id: "ZhipuAI/GLM-5.2", name: "GLM-5.2" },
|
|
19897
|
+
sonnet: { id: "ZhipuAI/GLM-5.2", name: "GLM-5.2" },
|
|
19898
|
+
haiku: { id: "ZhipuAI/GLM-5.2", name: "GLM-5.2" }
|
|
19083
19899
|
}
|
|
19084
19900
|
})
|
|
19085
19901
|
]
|
|
@@ -19304,6 +20120,7 @@ var init_platform_registry = __esm({
|
|
|
19304
20120
|
init_protocols();
|
|
19305
20121
|
init_types2();
|
|
19306
20122
|
init_capabilities2();
|
|
20123
|
+
init_claude_env();
|
|
19307
20124
|
init_merge();
|
|
19308
20125
|
init_relay_discovery();
|
|
19309
20126
|
init_relay_identify();
|
|
@@ -22149,7 +22966,10 @@ function listHarnessApiProviders(store, harness, options) {
|
|
|
22149
22966
|
}
|
|
22150
22967
|
function buildHarnessEnv(harness, resolved) {
|
|
22151
22968
|
if (!resolved) return {};
|
|
22152
|
-
const env = {
|
|
22969
|
+
const env = {
|
|
22970
|
+
...harness === "claude" ? claudeThirdPartyEnv(resolved) : {},
|
|
22971
|
+
...resolved.extraEnv ?? {}
|
|
22972
|
+
};
|
|
22153
22973
|
if (harness === "claude") {
|
|
22154
22974
|
if (resolved.apiKey) {
|
|
22155
22975
|
env.ANTHROPIC_API_KEY = resolved.apiKey;
|
|
@@ -52932,6 +53752,23 @@ var init_computer_use_result_shape = __esm({
|
|
|
52932
53752
|
}
|
|
52933
53753
|
});
|
|
52934
53754
|
|
|
53755
|
+
// ../../packages/shared/src/jev-run-result-shape.ts
|
|
53756
|
+
function isJevRunToolName(toolName) {
|
|
53757
|
+
if (!toolName) return false;
|
|
53758
|
+
return /(?:^|__)(?:browser|computer|device)_run$/.test(toolName);
|
|
53759
|
+
}
|
|
53760
|
+
function looksLikeJevRunResult(obj) {
|
|
53761
|
+
const status = obj.status;
|
|
53762
|
+
if (status !== "paused" && status !== "done" && status !== "aborted") return false;
|
|
53763
|
+
if (typeof obj.runId !== "string") return false;
|
|
53764
|
+
return Array.isArray(obj.since_last) || typeof obj.progress === "object" && obj.progress !== null || typeof obj.steps === "number";
|
|
53765
|
+
}
|
|
53766
|
+
var init_jev_run_result_shape = __esm({
|
|
53767
|
+
"../../packages/shared/src/jev-run-result-shape.ts"() {
|
|
53768
|
+
"use strict";
|
|
53769
|
+
}
|
|
53770
|
+
});
|
|
53771
|
+
|
|
52935
53772
|
// ../../packages/acp/src/tool-result-map.ts
|
|
52936
53773
|
function formatAcpRawOutput(raw) {
|
|
52937
53774
|
return formatAgentToolOutput(raw);
|
|
@@ -53037,11 +53874,12 @@ function shouldKeepFullToolResult(summary2, toolName) {
|
|
|
53037
53874
|
if (looksLikeSessionArchiveToon(summary2)) return true;
|
|
53038
53875
|
if (isComputerUseToolName(toolName)) return true;
|
|
53039
53876
|
if (looksLikeComputerUseOutline(summary2)) return true;
|
|
53877
|
+
if (isJevRunToolName(toolName)) return true;
|
|
53040
53878
|
const trimmed = summary2.trim();
|
|
53041
53879
|
if (!trimmed.startsWith("{")) return false;
|
|
53042
53880
|
try {
|
|
53043
53881
|
const obj = JSON.parse(trimmed);
|
|
53044
|
-
return typeof obj.widget_code === "string" && obj.widget_code.length > 0 || obj.kind === "native" && typeof obj.nativeType === "string" || looksLikeCollabResult(obj) || looksLikeSessionArchiveJson(obj) || looksLikeComputerUseResult(obj);
|
|
53882
|
+
return typeof obj.widget_code === "string" && obj.widget_code.length > 0 || obj.kind === "native" && typeof obj.nativeType === "string" || looksLikeCollabResult(obj) || looksLikeSessionArchiveJson(obj) || looksLikeComputerUseResult(obj) || looksLikeJevRunResult(obj);
|
|
53045
53883
|
} catch {
|
|
53046
53884
|
return false;
|
|
53047
53885
|
}
|
|
@@ -53055,6 +53893,7 @@ var init_tool_result_map = __esm({
|
|
|
53055
53893
|
init_capability_prompt_tags();
|
|
53056
53894
|
init_session_archive_result_shape();
|
|
53057
53895
|
init_computer_use_result_shape();
|
|
53896
|
+
init_jev_run_result_shape();
|
|
53058
53897
|
init_tool_ui();
|
|
53059
53898
|
init_tool_normalization();
|
|
53060
53899
|
}
|
|
@@ -72562,8 +73401,8 @@ import { fileURLToPath } from "node:url";
|
|
|
72562
73401
|
function resolveCliReleaseVersion() {
|
|
72563
73402
|
const fromEnv = process.env.SUPERONE_CLI_VERSION?.trim();
|
|
72564
73403
|
if (fromEnv) return fromEnv;
|
|
72565
|
-
if ("0.
|
|
72566
|
-
return "0.
|
|
73404
|
+
if ("0.68.0-alpha.1".trim()) {
|
|
73405
|
+
return "0.68.0-alpha.1".trim();
|
|
72567
73406
|
}
|
|
72568
73407
|
const fromDist = readDistManifestVersion();
|
|
72569
73408
|
if (fromDist) return fromDist;
|
|
@@ -74662,6 +75501,7 @@ async function cloneRepository(input) {
|
|
|
74662
75501
|
}
|
|
74663
75502
|
|
|
74664
75503
|
// src/rpc/handlers.ts
|
|
75504
|
+
init_git_mention_query();
|
|
74665
75505
|
import { existsSync as existsSync26, mkdirSync as mkdirSync15, readdirSync as readdirSync9, statSync as statSync6 } from "node:fs";
|
|
74666
75506
|
import { join as pathJoin, resolve as pathResolve } from "node:path";
|
|
74667
75507
|
import { arch, cpus, freemem, homedir as homedir7, hostname as hostname4, platform, totalmem, uptime } from "node:os";
|
|
@@ -77080,6 +77920,10 @@ async function dispatchRpcInner(method, payload, ctx) {
|
|
|
77080
77920
|
return handleGitCreateBranch(payload, ctx);
|
|
77081
77921
|
case "git.worktrees":
|
|
77082
77922
|
return handleGitWorktrees(payload, ctx);
|
|
77923
|
+
case "git.mentionRefs":
|
|
77924
|
+
return handleGitMentionRefs(payload, ctx);
|
|
77925
|
+
case "git.mentionCapabilities":
|
|
77926
|
+
return handleGitMentionCapabilities(payload, ctx);
|
|
77083
77927
|
case "git.worktreeActivate":
|
|
77084
77928
|
return handleGitWorktreeActivate(payload, ctx);
|
|
77085
77929
|
case "git.worktreeCheckedOutBranches":
|
|
@@ -78133,6 +78977,41 @@ function handleGitCreateBranch(payload, ctx) {
|
|
|
78133
78977
|
return mapThrown8(err);
|
|
78134
78978
|
}
|
|
78135
78979
|
}
|
|
78980
|
+
async function handleGitMentionCapabilities(payload, ctx) {
|
|
78981
|
+
const denied = requireScopes8(ctx.client, OPERATION_SCOPES.readWorkspace);
|
|
78982
|
+
if (denied) return denied;
|
|
78983
|
+
const p3 = asRecord24(payload);
|
|
78984
|
+
try {
|
|
78985
|
+
return {
|
|
78986
|
+
result: await ctx.workspaceGit.mentionCapabilities(
|
|
78987
|
+
String(p3.projectId ?? ""),
|
|
78988
|
+
typeof p3.cwd === "string" ? p3.cwd : null
|
|
78989
|
+
)
|
|
78990
|
+
};
|
|
78991
|
+
} catch (err) {
|
|
78992
|
+
return mapThrown8(err);
|
|
78993
|
+
}
|
|
78994
|
+
}
|
|
78995
|
+
async function handleGitMentionRefs(payload, ctx) {
|
|
78996
|
+
const denied = requireScopes8(ctx.client, OPERATION_SCOPES.readWorkspace);
|
|
78997
|
+
if (denied) return denied;
|
|
78998
|
+
const p3 = asRecord24(payload);
|
|
78999
|
+
if (!isGitMentionRefKind(p3.kind)) {
|
|
79000
|
+
return { error: { code: "invalid_argument", message: "kind must be branch | commit | worktree | tag | issue | pr" } };
|
|
79001
|
+
}
|
|
79002
|
+
try {
|
|
79003
|
+
return {
|
|
79004
|
+
result: await ctx.workspaceGit.mentionRefs(
|
|
79005
|
+
String(p3.projectId ?? ""),
|
|
79006
|
+
p3.kind,
|
|
79007
|
+
typeof p3.query === "string" ? p3.query : "",
|
|
79008
|
+
typeof p3.cwd === "string" ? p3.cwd : null
|
|
79009
|
+
)
|
|
79010
|
+
};
|
|
79011
|
+
} catch (err) {
|
|
79012
|
+
return mapThrown8(err);
|
|
79013
|
+
}
|
|
79014
|
+
}
|
|
78136
79015
|
function handleGitWorktrees(payload, ctx) {
|
|
78137
79016
|
const denied = requireScopes8(ctx.client, OPERATION_SCOPES.readWorkspace);
|
|
78138
79017
|
if (denied) return denied;
|
|
@@ -85248,6 +86127,10 @@ function gitErrorMessage(err) {
|
|
|
85248
86127
|
if (stderr) return stderr;
|
|
85249
86128
|
return err?.message ?? "Unknown git error";
|
|
85250
86129
|
}
|
|
86130
|
+
var NOT_A_REPO_RE = /not a git repository/i;
|
|
86131
|
+
function isNotGitRepoError(err) {
|
|
86132
|
+
return NOT_A_REPO_RE.test(gitErrorMessage(err));
|
|
86133
|
+
}
|
|
85251
86134
|
|
|
85252
86135
|
// ../../packages/runtime/src/git/shortstat.ts
|
|
85253
86136
|
function parseShortstat(shortstat) {
|
|
@@ -85306,6 +86189,220 @@ function gitRunSync(folderPath, args, env) {
|
|
|
85306
86189
|
}
|
|
85307
86190
|
}
|
|
85308
86191
|
|
|
86192
|
+
// ../../packages/runtime/src/git/mention-refs.ts
|
|
86193
|
+
init_git_mention_query();
|
|
86194
|
+
|
|
86195
|
+
// ../../packages/runtime/src/git/gh-run.ts
|
|
86196
|
+
init_spawn_env();
|
|
86197
|
+
import { execFile as execFile4 } from "child_process";
|
|
86198
|
+
var GH_MAX_BUFFER = 16 * 1024 * 1024;
|
|
86199
|
+
function isGhMissingError(err) {
|
|
86200
|
+
return err?.code === "ENOENT";
|
|
86201
|
+
}
|
|
86202
|
+
function ghRun(folderPath, args, timeoutMs, env) {
|
|
86203
|
+
return new Promise((resolve17, reject) => {
|
|
86204
|
+
execFile4(
|
|
86205
|
+
"gh",
|
|
86206
|
+
args,
|
|
86207
|
+
{
|
|
86208
|
+
cwd: folderPath,
|
|
86209
|
+
env: { ...env ? buildSafeEnv(env) : process.env, GH_PROMPT_DISABLED: "1", GH_NO_UPDATE_NOTIFIER: "1" },
|
|
86210
|
+
maxBuffer: GH_MAX_BUFFER,
|
|
86211
|
+
timeout: timeoutMs
|
|
86212
|
+
},
|
|
86213
|
+
(err, stdout, stderr) => {
|
|
86214
|
+
if (err) {
|
|
86215
|
+
const annotated = err;
|
|
86216
|
+
if (stderr && !annotated.stderr) annotated.stderr = String(stderr);
|
|
86217
|
+
annotated.ghArgs = args;
|
|
86218
|
+
reject(annotated);
|
|
86219
|
+
} else {
|
|
86220
|
+
resolve17(stdout.trimEnd());
|
|
86221
|
+
}
|
|
86222
|
+
}
|
|
86223
|
+
);
|
|
86224
|
+
});
|
|
86225
|
+
}
|
|
86226
|
+
|
|
86227
|
+
// ../../packages/runtime/src/git/mention-refs.ts
|
|
86228
|
+
var REF_SCAN_LIMIT = 500;
|
|
86229
|
+
var COMMIT_SCAN_LIMIT = 500;
|
|
86230
|
+
var REF_FORMAT = ["%(refname:short)", "%(objectname)", "%(subject)", "%(committerdate:iso-strict)", "%(HEAD)"].join("%00");
|
|
86231
|
+
var TAG_FORMAT = ["%(refname:short)", "%(objectname)", "%(subject)", "%(creatordate:iso-strict)"].join("%00");
|
|
86232
|
+
var LOG_FORMAT = ["%H", "%s", "%an", "%aI"].join("%x00");
|
|
86233
|
+
var HEX_PREFIX_RE = /^[0-9a-f]{4,40}$/i;
|
|
86234
|
+
var ISSUE_NUMBER_RE = /^#?(\d+)$/;
|
|
86235
|
+
var GH_ITEM_FIELDS = "number,title,state,author,updatedAt";
|
|
86236
|
+
var GH_PR_FIELDS = `${GH_ITEM_FIELDS},isDraft`;
|
|
86237
|
+
async function listGitMentionRefs(kind, query, runners, limit = GIT_MENTION_REF_LIMIT) {
|
|
86238
|
+
const { git: git2, gh } = typeof runners === "function" ? { git: runners } : runners;
|
|
86239
|
+
const needle = query.trim();
|
|
86240
|
+
if (isGitHubRefKind(kind)) {
|
|
86241
|
+
if (!gh) return { ok: false, reason: "gh-unavailable" };
|
|
86242
|
+
try {
|
|
86243
|
+
return { ok: true, refs: (await listGitHubItems(kind, needle, gh)).slice(0, limit) };
|
|
86244
|
+
} catch (err) {
|
|
86245
|
+
if (isGhMissingError(err)) return { ok: false, reason: "gh-unavailable" };
|
|
86246
|
+
return { ok: false, reason: "error", error: ghErrorMessage(err) };
|
|
86247
|
+
}
|
|
86248
|
+
}
|
|
86249
|
+
try {
|
|
86250
|
+
const refs = await listRefs(kind, needle, git2);
|
|
86251
|
+
return { ok: true, refs: refs.slice(0, limit) };
|
|
86252
|
+
} catch (err) {
|
|
86253
|
+
if (isNotGitRepoError(err)) return { ok: false, reason: "not-repo" };
|
|
86254
|
+
return { ok: false, reason: "error", error: err.message };
|
|
86255
|
+
}
|
|
86256
|
+
}
|
|
86257
|
+
async function probeGitMentionCapabilities(runners) {
|
|
86258
|
+
let repo = "ready";
|
|
86259
|
+
try {
|
|
86260
|
+
await runners.git(["rev-parse", "--git-dir"]);
|
|
86261
|
+
} catch {
|
|
86262
|
+
repo = "not-repo";
|
|
86263
|
+
}
|
|
86264
|
+
if (repo !== "ready" || !runners.gh) return { repo, github: false };
|
|
86265
|
+
try {
|
|
86266
|
+
await runners.gh(["repo", "view", "--json", "nameWithOwner"]);
|
|
86267
|
+
return { repo, github: true };
|
|
86268
|
+
} catch {
|
|
86269
|
+
return { repo, github: false };
|
|
86270
|
+
}
|
|
86271
|
+
}
|
|
86272
|
+
function ghErrorMessage(err) {
|
|
86273
|
+
const e = err;
|
|
86274
|
+
const stderr = e.stderr?.trim();
|
|
86275
|
+
return stderr ? stderr.split("\n")[0] : e.message ?? "gh failed";
|
|
86276
|
+
}
|
|
86277
|
+
async function listRefs(kind, needle, run) {
|
|
86278
|
+
switch (kind) {
|
|
86279
|
+
case "branch":
|
|
86280
|
+
return listBranches(needle, run);
|
|
86281
|
+
case "tag":
|
|
86282
|
+
return listTags(needle, run);
|
|
86283
|
+
case "commit":
|
|
86284
|
+
return listCommits(needle, run);
|
|
86285
|
+
case "worktree":
|
|
86286
|
+
return listWorktrees(needle, run);
|
|
86287
|
+
case "issue":
|
|
86288
|
+
case "pr":
|
|
86289
|
+
throw new Error(`${kind} is a GitHub kind`);
|
|
86290
|
+
}
|
|
86291
|
+
}
|
|
86292
|
+
function ghItemState(item) {
|
|
86293
|
+
if (item.isDraft) return "draft";
|
|
86294
|
+
const s4 = item.state.toLowerCase();
|
|
86295
|
+
return s4 === "merged" ? "merged" : s4 === "closed" ? "closed" : "open";
|
|
86296
|
+
}
|
|
86297
|
+
function parseGhItems(kind, raw) {
|
|
86298
|
+
const items = JSON.parse(raw || "[]");
|
|
86299
|
+
return (Array.isArray(items) ? items : [items]).map((item) => ({
|
|
86300
|
+
kind,
|
|
86301
|
+
id: String(item.number),
|
|
86302
|
+
label: `#${item.number}`,
|
|
86303
|
+
detail: item.title ?? "",
|
|
86304
|
+
date: item.updatedAt,
|
|
86305
|
+
author: item.author?.login,
|
|
86306
|
+
state: ghItemState(item),
|
|
86307
|
+
host: "github"
|
|
86308
|
+
}));
|
|
86309
|
+
}
|
|
86310
|
+
async function listGitHubItems(kind, needle, gh) {
|
|
86311
|
+
const fields = kind === "pr" ? GH_PR_FIELDS : GH_ITEM_FIELDS;
|
|
86312
|
+
const list = (extra) => gh([kind, "list", "--limit", String(GIT_MENTION_REF_LIMIT), "--json", fields, ...extra]);
|
|
86313
|
+
if (!needle) return parseGhItems(kind, await list(["--state", "open"]));
|
|
86314
|
+
const searched = parseGhItems(kind, await list(["--state", "all", "--search", needle]));
|
|
86315
|
+
const number4 = ISSUE_NUMBER_RE.exec(needle)?.[1];
|
|
86316
|
+
if (!number4) return searched;
|
|
86317
|
+
let exact = [];
|
|
86318
|
+
try {
|
|
86319
|
+
exact = parseGhItems(kind, await gh([kind, "view", number4, "--json", fields]));
|
|
86320
|
+
} catch {
|
|
86321
|
+
}
|
|
86322
|
+
const seen = new Set(exact.map((r) => r.id));
|
|
86323
|
+
return [...exact, ...searched.filter((r) => !seen.has(r.id))];
|
|
86324
|
+
}
|
|
86325
|
+
async function listBranches(needle, run) {
|
|
86326
|
+
const raw = await run([
|
|
86327
|
+
"for-each-ref",
|
|
86328
|
+
"refs/heads",
|
|
86329
|
+
"--sort=-committerdate",
|
|
86330
|
+
`--count=${REF_SCAN_LIMIT}`,
|
|
86331
|
+
`--format=${REF_FORMAT}`
|
|
86332
|
+
]);
|
|
86333
|
+
const refs = [];
|
|
86334
|
+
for (const line of raw.split("\n")) {
|
|
86335
|
+
if (!line) continue;
|
|
86336
|
+
const [name = "", , subject = "", date5 = "", head = ""] = line.split("\0");
|
|
86337
|
+
const ref = { kind: "branch", id: name, label: name, detail: subject, date: date5, current: head === "*" };
|
|
86338
|
+
if (gitRefMatches(ref, needle)) refs.push(ref);
|
|
86339
|
+
}
|
|
86340
|
+
refs.sort((a, b3) => Number(b3.current === true) - Number(a.current === true));
|
|
86341
|
+
return refs;
|
|
86342
|
+
}
|
|
86343
|
+
async function listTags(needle, run) {
|
|
86344
|
+
const raw = await run([
|
|
86345
|
+
"for-each-ref",
|
|
86346
|
+
"refs/tags",
|
|
86347
|
+
"--sort=-creatordate",
|
|
86348
|
+
`--count=${REF_SCAN_LIMIT}`,
|
|
86349
|
+
`--format=${TAG_FORMAT}`
|
|
86350
|
+
]);
|
|
86351
|
+
const refs = [];
|
|
86352
|
+
for (const line of raw.split("\n")) {
|
|
86353
|
+
if (!line) continue;
|
|
86354
|
+
const [name = "", , subject = "", date5 = ""] = line.split("\0");
|
|
86355
|
+
const ref = { kind: "tag", id: name, label: name, detail: subject, date: date5 };
|
|
86356
|
+
if (gitRefMatches(ref, needle)) refs.push(ref);
|
|
86357
|
+
}
|
|
86358
|
+
return refs;
|
|
86359
|
+
}
|
|
86360
|
+
function parseLog(raw) {
|
|
86361
|
+
const refs = [];
|
|
86362
|
+
for (const line of raw.split("\n")) {
|
|
86363
|
+
if (!line) continue;
|
|
86364
|
+
const [sha = "", subject = "", author = "", date5 = ""] = line.split("\0");
|
|
86365
|
+
if (!sha) continue;
|
|
86366
|
+
refs.push({ kind: "commit", id: sha, label: sha.slice(0, 7), detail: subject, date: date5, author });
|
|
86367
|
+
}
|
|
86368
|
+
return refs;
|
|
86369
|
+
}
|
|
86370
|
+
async function listCommits(needle, run) {
|
|
86371
|
+
if (!needle) return parseLog(await run(["log", `-n${GIT_MENTION_REF_LIMIT}`, `--format=${LOG_FORMAT}`]));
|
|
86372
|
+
const recent = parseLog(await run(["log", `-n${COMMIT_SCAN_LIMIT}`, `--format=${LOG_FORMAT}`]));
|
|
86373
|
+
const byMessage = recent.filter((r) => gitRefMatches(r, needle)).slice(0, GIT_MENTION_REF_LIMIT);
|
|
86374
|
+
if (!HEX_PREFIX_RE.test(needle)) return byMessage;
|
|
86375
|
+
let bySha = [];
|
|
86376
|
+
try {
|
|
86377
|
+
bySha = parseLog(await run(["log", "-n1", `--format=${LOG_FORMAT}`, needle, "--"]));
|
|
86378
|
+
} catch {
|
|
86379
|
+
}
|
|
86380
|
+
const seen = new Set(bySha.map((r) => r.id));
|
|
86381
|
+
return [...bySha, ...byMessage.filter((r) => !seen.has(r.id))];
|
|
86382
|
+
}
|
|
86383
|
+
async function listWorktrees(needle, run) {
|
|
86384
|
+
const [raw, toplevel] = await Promise.all([
|
|
86385
|
+
run(["worktree", "list", "--porcelain"]),
|
|
86386
|
+
run(["rev-parse", "--show-toplevel"]).catch(() => "")
|
|
86387
|
+
]);
|
|
86388
|
+
const here = toplevel.trim().replace(/[\\/]+$/, "");
|
|
86389
|
+
const refs = [];
|
|
86390
|
+
for (const wt2 of parseWorktreePorcelain(raw)) {
|
|
86391
|
+
if (wt2.bare) continue;
|
|
86392
|
+
const label = wt2.branch ?? (wt2.head ? `detached @ ${wt2.head.slice(0, 7)}` : wt2.path);
|
|
86393
|
+
const ref = {
|
|
86394
|
+
kind: "worktree",
|
|
86395
|
+
id: wt2.path,
|
|
86396
|
+
label,
|
|
86397
|
+
detail: wt2.path,
|
|
86398
|
+
current: !!here && wt2.path.replace(/[\\/]+$/, "") === here
|
|
86399
|
+
};
|
|
86400
|
+
if (gitRefMatches(ref, needle)) refs.push(ref);
|
|
86401
|
+
}
|
|
86402
|
+
refs.sort((a, b3) => Number(b3.current === true) - Number(a.current === true));
|
|
86403
|
+
return refs;
|
|
86404
|
+
}
|
|
86405
|
+
|
|
85309
86406
|
// ../../packages/runtime/src/git/worktree-plan.ts
|
|
85310
86407
|
import { basename as basename3, dirname as dirname17, join as join32, resolve as resolve12, sep as sep4 } from "node:path";
|
|
85311
86408
|
import { homedir as homedir8 } from "node:os";
|
|
@@ -85352,6 +86449,7 @@ function parseNumstat(numstat) {
|
|
|
85352
86449
|
}
|
|
85353
86450
|
|
|
85354
86451
|
// src/workspace/git-service.ts
|
|
86452
|
+
var GH_TIMEOUT_MS = 15e3;
|
|
85355
86453
|
function git(cwd, args, env) {
|
|
85356
86454
|
return gitRunSync(cwd, args, env);
|
|
85357
86455
|
}
|
|
@@ -85494,6 +86592,21 @@ var WorkspaceGitService = class {
|
|
|
85494
86592
|
return { ok: false, error: gitErrorMessage(err) };
|
|
85495
86593
|
}
|
|
85496
86594
|
}
|
|
86595
|
+
/** `@git` / `@gh` popup rows; `absolutePath` narrows to a linked worktree of the project. */
|
|
86596
|
+
mentionRefs(projectId, kind, query, absolutePath) {
|
|
86597
|
+
return listGitMentionRefs(kind, query, this.mentionRunners(projectId, absolutePath));
|
|
86598
|
+
}
|
|
86599
|
+
/** What the `@git` / `@gh` portals may offer for the project (or one of its worktrees). */
|
|
86600
|
+
mentionCapabilities(projectId, absolutePath) {
|
|
86601
|
+
return probeGitMentionCapabilities(this.mentionRunners(projectId, absolutePath));
|
|
86602
|
+
}
|
|
86603
|
+
mentionRunners(projectId, absolutePath) {
|
|
86604
|
+
const cwd = absolutePath ? this.assertRepoWorktreePath(projectId, absolutePath) : this.root(projectId);
|
|
86605
|
+
return {
|
|
86606
|
+
git: async (args) => gitRunSync(cwd, args),
|
|
86607
|
+
gh: (args) => ghRun(cwd, args, GH_TIMEOUT_MS)
|
|
86608
|
+
};
|
|
86609
|
+
}
|
|
85497
86610
|
worktrees(projectId) {
|
|
85498
86611
|
const cwd = this.root(projectId);
|
|
85499
86612
|
try {
|