nolo-cli 0.16.0-alpha.9 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/{_executeModel-ABTND4KZ.js → _executeModel-WPNX5DH4.js} +46 -41
  2. package/{action-F5JACQBG.js → action-LT7BRFLK.js} +10 -9
  3. package/{addContentAction-AQXEYRBE.js → addContentAction-PL3KKBDH.js} +9 -8
  4. package/{addDialogAgentAction-EJHHJZWW.js → addDialogAgentAction-FCMSKYAF.js} +8 -7
  5. package/{agentDeleteCommand-ARMAV46L.js → agentDeleteCommand-L3357EFL.js} +28 -26
  6. package/{agentEmailCommands-BKPZP4UP.js → agentEmailCommands-N65AVLEI.js} +58 -53
  7. package/{agentListCommands-5J7RRXUO.js → agentListCommands-CH27FTI2.js} +27 -25
  8. package/{agentMachineCommands-VXWJXXPF.js → agentMachineCommands-PPK5HJZB.js} +26 -24
  9. package/{agentPullCommand-6HWUT3SW.js → agentPullCommand-ZZGU5KOY.js} +4 -4
  10. package/{agentRecordCommands-INDJINPN.js → agentRecordCommands-HTVXD4TT.js} +53 -48
  11. package/{agentRunCommand-KBN6HBY4.js → agentRunCommand-MGLVJUA5.js} +59 -51
  12. package/{agentRunControl-6ADXVYMR.js → agentRunControl-P75VPTGS.js} +24 -1
  13. package/{agentRuntimeLocal-AH2RYWGP.js → agentRuntimeLocal-QUTBSY3I.js} +22 -20
  14. package/{agentSlice-R4PELU57.js → agentSlice-DOGRCMWK.js} +9 -8
  15. package/{appDeleteCommands-FRWMPQNS.js → appDeleteCommands-FEEVXUBG.js} +25 -23
  16. package/{appDeployCommands-IRF3T35Z.js → appDeployCommands-C4HCGC4B.js} +25 -23
  17. package/{appDeployStatusCommands-ADFERYPU.js → appDeployStatusCommands-IR5ZUZBQ.js} +25 -23
  18. package/{appGetCommands-FTEOXWMS.js → appGetCommands-6RJGZ66Z.js} +25 -23
  19. package/{appListCommands-WBY7UWYD.js → appListCommands-VMTF5YZF.js} +25 -23
  20. package/{authCommand-QU5BXRBH.js → authCommand-WJZPOLSS.js} +13 -12
  21. package/{authCommands-YXGOXNBZ.js → authCommands-XTBV7OFZ.js} +6 -5
  22. package/{chunk-XPC5C7BK.js → chunk-3ND52WIL.js} +2 -2
  23. package/{chunk-SOTZ6RDN.js → chunk-3Q7WHGCB.js} +1 -1
  24. package/{chunk-WVDAUR2S.js → chunk-45BY7RLP.js} +2 -8
  25. package/{chunk-KKY4B2Q2.js → chunk-4PWB7JRR.js} +4 -1
  26. package/{chunk-6N4KODMN.js → chunk-4T5F7YZQ.js} +1 -1
  27. package/chunk-7BUYEZ6U.js +671 -0
  28. package/{chunk-AS3ZQ3O2.js → chunk-7OBMZCRD.js} +1 -1
  29. package/{chunk-4N7QA72L.js → chunk-AAODAAUQ.js} +1 -1
  30. package/{chunk-QLUFR47U.js → chunk-AL2V7U3E.js} +1 -1
  31. package/{chunk-MTU75CZ2.js → chunk-B5TOXZAK.js} +1 -1
  32. package/{chunk-VK2HVKAO.js → chunk-BT6K76S7.js} +192 -249
  33. package/{chunk-G63IH3ZK.js → chunk-CEFXYF66.js} +1 -1
  34. package/{chunk-RLCXU7A5.js → chunk-D3HVJJIA.js} +1 -1
  35. package/{chunk-B4KT7RN2.js → chunk-DKZFOK24.js} +18 -89
  36. package/chunk-DL6EPNIK.js +50 -0
  37. package/{chunk-OELQ67TN.js → chunk-EGPCU42M.js} +57 -7
  38. package/{chunk-IWLUTMYX.js → chunk-ELT65PZW.js} +2 -2
  39. package/chunk-FKXFCYVO.js +221 -0
  40. package/{chunk-5Y5KEB7V.js → chunk-FPKLD4KB.js} +4 -4
  41. package/{chunk-FMYTM25W.js → chunk-FVIPEIVX.js} +10 -3
  42. package/{chunk-66X4VSRC.js → chunk-HQPG2PIV.js} +41 -1
  43. package/{chunk-ZPPTWRPT.js → chunk-HV2A3B4W.js} +1 -1
  44. package/{chunk-ASZ2C44S.js → chunk-IOOMJJ4Z.js} +1 -1
  45. package/{setDialogExtraReferencesAction-LR6MSIXO.js → chunk-JLA4FXYC.js} +2 -17
  46. package/{chunk-IFPY2BIE.js → chunk-JP7REMYP.js} +18 -0
  47. package/{chunk-R6ALN5F5.js → chunk-L2MLZQXU.js} +3 -3
  48. package/{chunk-HSLJ7QER.js → chunk-L6NVTGI7.js} +1 -1
  49. package/{chunk-BHVBFI6B.js → chunk-MD3V54DA.js} +6 -6
  50. package/{chunk-ZVDRAEZL.js → chunk-MUCU6ATG.js} +1 -1
  51. package/{chunk-KFHN5NGJ.js → chunk-MVQ4TBSD.js} +1 -1
  52. package/{chunk-7HECYFOI.js → chunk-NEKFSXOP.js} +316 -212
  53. package/{chunk-LSHKV3S7.js → chunk-NVB267BZ.js} +397 -324
  54. package/{chunk-SGRDLYRZ.js → chunk-NYUXSXLY.js} +33 -14
  55. package/{chunk-PEDT43JF.js → chunk-PZCBZO4J.js} +2 -2
  56. package/{chunk-LZYEWFPK.js → chunk-QCJITMYO.js} +16 -10
  57. package/{chunk-OOSFSFMA.js → chunk-R5V5G73M.js} +2 -0
  58. package/{chunk-QLWU2KOT.js → chunk-RG2U2MTJ.js} +1 -1
  59. package/{chunk-2XA3QGOH.js → chunk-RRGVDPH3.js} +3 -3
  60. package/{chunk-EABWT43X.js → chunk-RVOUXDFU.js} +5 -5
  61. package/{chunk-JTINRTBT.js → chunk-SKDNBYZK.js} +2 -2
  62. package/{chunk-BG7AP3Q7.js → chunk-SNZV4QCE.js} +34 -18
  63. package/{chunk-KMQPSTMJ.js → chunk-TRT4I4UD.js} +2 -2
  64. package/{chunk-MYMMNKYL.js → chunk-TSIYZBTH.js} +156 -6
  65. package/{chunk-J3VQSU5W.js → chunk-UB4RYYNQ.js} +1 -1
  66. package/{chunk-YJKXGHJ6.js → chunk-UGUW3FHG.js} +4 -4
  67. package/{chunk-XECKIDGJ.js → chunk-UZY4BEBR.js} +938 -91
  68. package/chunk-V5R4NZP2.js +78 -0
  69. package/{chunk-GWESD7AS.js → chunk-VDNQF5VI.js} +6 -6
  70. package/{chunk-ZVC2PCZN.js → chunk-VGMJ6PDJ.js} +5 -5
  71. package/{chunk-W4NVOSFF.js → chunk-WFHXMLHZ.js} +1 -1
  72. package/{chunk-H33743XH.js → chunk-WJRJDX2W.js} +1 -1
  73. package/chunk-X4Q4UZEY.js +26 -0
  74. package/{chunk-RPDGJO4D.js → chunk-XHG22OEX.js} +4 -4
  75. package/{chunk-DVRHHFEA.js → chunk-XMLRJUU5.js} +1 -1
  76. package/{chunk-3S2VOMIF.js → chunk-XRZJGPFI.js} +7 -7
  77. package/{chunk-AFNJWHKL.js → chunk-YLRTBX4Y.js} +26 -14
  78. package/{chunk-4EME3YTO.js → chunk-YXTRNO5W.js} +3 -3
  79. package/{chunk-VAT72PDP.js → chunk-ZJZCMKOR.js} +103 -174
  80. package/{chunk-F6JSVFHX.js → chunk-ZVOZH2HW.js} +1 -1
  81. package/chunk-ZZ2MH7LE.js +84 -0
  82. package/{cliExecutor-K3F7DMRO.js → cliExecutor-DNE7TCC4.js} +2 -2
  83. package/codingSkills-36KN5NQT.js +48 -0
  84. package/{createAgentAutomationAction-3KKRAYGE.js → createAgentAutomationAction-PMOLEPGJ.js} +18 -17
  85. package/{createDialogAction-S7NMQ4TZ.js → createDialogAction-DPRTYNAK.js} +20 -19
  86. package/{createPageAction-2EFBT4LQ.js → createPageAction-JGZK3WAM.js} +24 -23
  87. package/{dbSlice-7KQH6GOU.js → dbSlice-CGSRFJN3.js} +8 -7
  88. package/{deleteFile-WPWVZE4B.js → deleteFile-WDZ3VM7B.js} +3 -3
  89. package/{dialogCommands-J7XFIQRD.js → dialogCommands-XED6DKLV.js} +26 -24
  90. package/{dialogSlice-LNRRBUIC.js → dialogSlice-KO4NRNKC.js} +18 -17
  91. package/{docCreateCommands-MKO5WB34.js → docCreateCommands-P6DYWHH3.js} +24 -22
  92. package/{docDeleteCommands-RCBHRKUE.js → docDeleteCommands-KUWXAMSN.js} +25 -23
  93. package/{docReadCommands-66527P4G.js → docReadCommands-ECW55TKB.js} +24 -22
  94. package/{docStore-67MYPX7P.js → docStore-6KMERNUY.js} +19 -18
  95. package/{docUpdateCommands-UT5HSLOJ.js → docUpdateCommands-5J4BTJQN.js} +24 -22
  96. package/{fetchMessages-KTNM7QAR.js → fetchMessages-BMGVZVSE.js} +4 -3
  97. package/{getPricing-P4XRJRZB.js → getPricing-RYY6OBA4.js} +2 -2
  98. package/{handleSendMessageAction-VZ7226PB.js → handleSendMessageAction-R3ZHTVU4.js} +19 -18
  99. package/index.js +68 -68
  100. package/{localDialogRead-2VRI24F4.js → localDialogRead-HQZPVIE3.js} +1 -1
  101. package/{localRuntimeDb-LGDF6FQP.js → localRuntimeDb-THJZGAOJ.js} +1 -1
  102. package/{machineCommands-ATA7OSBJ.js → machineCommands-JF2YL34J.js} +59 -54
  103. package/{machineWsRunDispatch-ZDCZ645H.js → machineWsRunDispatch-ON4AEOJL.js} +51 -46
  104. package/package.json +1 -1
  105. package/queryRunOverlay-O4LOMMPO.js +161 -0
  106. package/{read-CN3TNXIP.js → read-3FMPZPER.js} +3 -3
  107. package/{readDocTool-WF3675ED.js → readDocTool-VSYHKK3V.js} +1 -1
  108. package/{readlineWorkspace-UUNABTLB.js → readlineWorkspace-SUCINTL7.js} +302 -134
  109. package/{removeDialogAgentAction-YDHBFEGI.js → removeDialogAgentAction-OAGA2G3U.js} +10 -9
  110. package/{runAgentClientLoop-2A577WBM.js → runAgentClientLoop-OBD2AVEL.js} +41 -36
  111. package/runOverlayPresentation-ZO4VCWEU.js +11 -0
  112. package/{runtimeDoctorCommands-THIHX2SY.js → runtimeDoctorCommands-E2OUORHK.js} +6 -6
  113. package/setDialogExtraReferencesAction-JZEXA5SL.js +27 -0
  114. package/{setPrimaryDialogAgentAction-IIVDCY5C.js → setPrimaryDialogAgentAction-4ZUQQKDG.js} +26 -17
  115. package/{settingSlice-O23YDK2O.js → settingSlice-7MNKHZ6R.js} +9 -8
  116. package/{skillDiscovery-6M2BZUFN.js → skillDiscovery-KJWT7JBU.js} +3 -3
  117. package/{spaceCommands-UNZVR2OS.js → spaceCommands-32NTNLHS.js} +27 -25
  118. package/{spaceSlice-MC7FYPMZ.js → spaceSlice-P7VOXLY6.js} +18 -17
  119. package/{streamAgentChatTurn-IEKPNM33.js → streamAgentChatTurn-UHEMNI3X.js} +91 -48
  120. package/{tableCommands-3P7MJ3PF.js → tableCommands-BEQAGE4I.js} +1 -1
  121. package/{tools-E6FHKTCF.js → tools-BMXIXHMB.js} +31 -26
  122. package/{tuiSummaryLlmCaller-QHPDD4WP.js → tuiSummaryLlmCaller-VUNVBRX3.js} +3 -3
  123. package/types-ZSTJ7MPR.js +7 -0
  124. package/{updateDialogTitleAction-SQJEEW2K.js → updateDialogTitleAction-LJBDYZLH.js} +21 -20
  125. package/{chunk-O4BU24WZ.js → chunk-6Y7A3OQQ.js} +3 -3
  126. package/{chunk-CMKUBIGW.js → chunk-X7W4TNB4.js} +3 -3
  127. package/{localRuntimeAuthority-TEGCOWX4.js → localRuntimeAuthority-4IXJCHZ7.js} +3 -3
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  requireTokenUser
3
- } from "./chunk-5Y5KEB7V.js";
3
+ } from "./chunk-FPKLD4KB.js";
4
4
  import {
5
5
  resolveServerUrl
6
6
  } from "./chunk-A7GB5UGH.js";
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-CWMSB67P.js";
7
7
  import {
8
8
  getModelConfig
9
- } from "./chunk-66X4VSRC.js";
9
+ } from "./chunk-HQPG2PIV.js";
10
10
  import {
11
11
  asOptionalFiniteNumber
12
12
  } from "./chunk-WWC7I6TA.js";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  asRecordOrEmpty
3
3
  } from "./chunk-KX6YBIHG.js";
4
+ import {
5
+ asOptionalFiniteNumber
6
+ } from "./chunk-WWC7I6TA.js";
4
7
  import {
5
8
  asNonEmptyStringArray,
6
9
  asTrimmedNonEmptyStringArray
7
10
  } from "./chunk-I42VC5KR.js";
8
- import {
9
- asOptionalFiniteNumber
10
- } from "./chunk-WWC7I6TA.js";
11
11
  import {
12
12
  isRecord
13
13
  } from "./chunk-KUG52IAP.js";
@@ -15,85 +15,6 @@ import {
15
15
  asOptionalTrimmedString
16
16
  } from "./chunk-G3SUCT4W.js";
17
17
 
18
- // packages/agent-runtime/toolNameAliases.ts
19
- var LEGACY_TOOL_NAME_ALIASES = {
20
- createPage: "createDoc",
21
- updatePage: "updateDoc",
22
- update_page: "updateDoc",
23
- create_page: "createDoc",
24
- fetchwebpage: "fetchWebpage",
25
- fetch_webpage: "fetchWebpage",
26
- "fetch-page": "fetchWebpage",
27
- exasearch: "exa_search",
28
- "exa-search": "exa_search",
29
- exa_search: "exa_search",
30
- firecrawlscrape: "firecrawl_scrape",
31
- "firecrawl-scrape": "firecrawl_scrape",
32
- firecrawl_scrape: "firecrawl_scrape",
33
- firecrawlsearch: "firecrawl_search",
34
- "firecrawl-search": "firecrawl_search",
35
- firecrawl_search: "firecrawl_search",
36
- readDoc: "readDoc",
37
- readpage: "readDoc",
38
- read_page: "readDoc",
39
- read_doc: "readDoc",
40
- createdoc: "createDoc",
41
- updateDocTool: "updateDoc",
42
- terminalCommand: "execShell",
43
- terminal_command: "execShell",
44
- runCommand: "execShell",
45
- run_command: "execShell",
46
- runInBash: "execShell",
47
- run_in_bash: "execShell",
48
- executeCommand: "execShell",
49
- execute_command: "execShell",
50
- // Codex CLI 风格工具名 → nolo 原生工具名
51
- bash: "execShell",
52
- shell: "execShell",
53
- read: "readFile",
54
- edit: "editFile",
55
- write: "writeFile",
56
- glob: "globFiles",
57
- grep: "searchFiles",
58
- // 联网搜索别名
59
- web_search: "exa_search",
60
- websearch: "exa_search",
61
- search_web: "exa_search",
62
- searchweb: "exa_search",
63
- webfetch: "fetchWebpage",
64
- web_fetch: "fetchWebpage",
65
- fetchweb: "fetchWebpage",
66
- fetch_web: "fetchWebpage",
67
- // 模型偶尔会把 loadSkill 幻觉成 readSkill(参数风格 name= 一致),
68
- // 规范化到 loadSkill,避免 localToolPolicy 把这种调用直接拦死。
69
- readSkill: "loadSkill"
70
- };
71
- var normalizeToolName = (name) => name.replace(/[-_]/g, "").toLowerCase();
72
- var canonicalizeToolName = (rawName) => {
73
- const trimmedName = rawName.trim();
74
- if (!trimmedName) return rawName;
75
- if (LEGACY_TOOL_NAME_ALIASES[trimmedName]) {
76
- return LEGACY_TOOL_NAME_ALIASES[trimmedName];
77
- }
78
- const normalizedRawName = normalizeToolName(trimmedName);
79
- const matchedAlias = Object.entries(LEGACY_TOOL_NAME_ALIASES).find(
80
- ([alias]) => normalizeToolName(alias) === normalizedRawName
81
- );
82
- return matchedAlias?.[1] ?? trimmedName;
83
- };
84
- var canonicalizeToolNames = (toolNames) => Array.from(
85
- new Set(
86
- toolNames.filter((toolName) => typeof toolName === "string").map(canonicalizeToolName)
87
- )
88
- );
89
- var prioritizeToolNames = (toolNames, preferredToolNames) => {
90
- const canonicalTools = canonicalizeToolNames(toolNames);
91
- const preferred = new Set(canonicalizeToolNames(preferredToolNames));
92
- const prioritized = canonicalTools.filter((toolName) => preferred.has(toolName));
93
- const remaining = canonicalTools.filter((toolName) => !preferred.has(toolName));
94
- return [...prioritized, ...remaining];
95
- };
96
-
97
18
  // packages/agent-runtime/runtimeToolSurface.ts
98
19
  var DEFAULT_PRIVATE_NOLO_WORKSPACE_TOOLS = [
99
20
  "listDialogs",
@@ -462,8 +383,8 @@ function buildNoloWorkspaceOpenAiTools(args) {
462
383
  // listAgentsFunc 另有 limit(默认 100,最大 500)。如后续对齐需在
463
384
  // parseAgentListArgs / agentListCommands 增加 --limit 透传。
464
385
  });
465
- add("readAgent", "Read one agent config in the Nolo workspace.", {
466
- agent: stringToolParam("Agent key, id, alias, or URL.")
386
+ add("readAgent", "Read one agent's full config from the Nolo workspace. Accepts an agent dbKey (agent-xxx), plain id, alias, or agent URL; resolves it (including public agents via agent-pub-<id>; the server runtime also falls back to handle lookup) and returns the runnable agentKey plus a redacted record with fields such as model, provider, apiSource, tools, prompt, inputPrice, outputPrice, and isPublic. Use it before delegation to confirm an agent's identity and capabilities, or to resolve the agentKey that startAgentRun requires.", {
387
+ agent: stringToolParam("Agent dbKey (e.g. agent-xxx), agent id, alias, or agent URL.")
467
388
  }, ["agent"]);
468
389
  add("listSpaces", "List joined spaces in the Nolo workspace.", {});
469
390
  add("readSpace", "Read one space in the Nolo workspace.", {
@@ -892,9 +813,20 @@ function buildLoadSkillExecutor(args) {
892
813
  metadata: { loadSkill: true, resolved: false }
893
814
  };
894
815
  }
895
- const { resolveSkillByName } = await import("./skillDiscovery-6M2BZUFN.js");
816
+ const { resolveSkillByName } = await import("./skillDiscovery-KJWT7JBU.js");
896
817
  const resolved = resolveSkillByName(args.cwd, name);
897
818
  if (!resolved) {
819
+ const { resolveCodingBuiltinSlug, buildCodingSkillContentBySlug } = await import("./codingSkills-36KN5NQT.js");
820
+ const builtinSlug = resolveCodingBuiltinSlug(name);
821
+ if (builtinSlug) {
822
+ const body = buildCodingSkillContentBySlug(builtinSlug);
823
+ return {
824
+ content: `Skill "${name}" loaded inline. Follow its instructions.
825
+
826
+ ${body}`,
827
+ metadata: { loadSkill: true, resolved: true, name, requestedName: name, builtin: true }
828
+ };
829
+ }
898
830
  return {
899
831
  content: await formatUnknownSkillMessage(args.cwd, name),
900
832
  metadata: { loadSkill: true, resolved: false, name, requestedName: name }
@@ -919,7 +851,7 @@ ${body}`,
919
851
  };
920
852
  }
921
853
  async function formatUnknownSkillMessage(cwd, requestedName) {
922
- const { discoverSkills } = await import("./skillDiscovery-6M2BZUFN.js");
854
+ const { discoverSkills } = await import("./skillDiscovery-KJWT7JBU.js");
923
855
  let available = [];
924
856
  try {
925
857
  available = discoverSkills(cwd).map((s) => s.name);
@@ -938,9 +870,6 @@ var nodeSpawnFallback = (options) => {
938
870
  };
939
871
 
940
872
  export {
941
- canonicalizeToolName,
942
- canonicalizeToolNames,
943
- prioritizeToolNames,
944
873
  resolveRuntimeToolSurfaceForAgent,
945
874
  redactAgentRecordForWorkspaceTool,
946
875
  resolveExecutableOnPath,
@@ -0,0 +1,50 @@
1
+ // packages/core/chat/runOverlayMachine.ts
2
+ var initialRunOverlayState = {
3
+ runs: /* @__PURE__ */ new Map()
4
+ };
5
+ function reduceRunOverlay(state, event) {
6
+ switch (event.type) {
7
+ case "run-state-chg": {
8
+ const prev = state.runs.get(event.runId);
9
+ const now = Date.now();
10
+ const merged = prev ? { ...prev, ...event.info, runId: event.runId, updatedAt: now } : {
11
+ runId: event.runId,
12
+ name: event.info.name ?? "",
13
+ status: event.info.status ?? "running",
14
+ summary: event.info.summary,
15
+ batchId: event.info.batchId,
16
+ parentDialogId: event.info.parentDialogId,
17
+ errorMessage: event.info.errorMessage,
18
+ updatedAt: now
19
+ };
20
+ if (prev && shallowEqualRun(prev, merged)) {
21
+ return state;
22
+ }
23
+ const runs = new Map(state.runs);
24
+ runs.set(event.runId, merged);
25
+ return { runs };
26
+ }
27
+ case "run-removed": {
28
+ if (!state.runs.has(event.runId)) return state;
29
+ const runs = new Map(state.runs);
30
+ runs.delete(event.runId);
31
+ return { runs };
32
+ }
33
+ case "clear-all": {
34
+ if (state.runs.size === 0) return state;
35
+ return { runs: /* @__PURE__ */ new Map() };
36
+ }
37
+ default: {
38
+ const _exhaustive = event;
39
+ return state;
40
+ }
41
+ }
42
+ }
43
+ function shallowEqualRun(a, b) {
44
+ return a.runId === b.runId && a.name === b.name && a.status === b.status && a.summary === b.summary && a.batchId === b.batchId && a.parentDialogId === b.parentDialogId && a.errorMessage === b.errorMessage;
45
+ }
46
+
47
+ export {
48
+ initialRunOverlayState,
49
+ reduceRunOverlay
50
+ };
@@ -1,18 +1,22 @@
1
1
  import {
2
2
  MODEL_LOOKUP_MAP
3
- } from "./chunk-66X4VSRC.js";
3
+ } from "./chunk-HQPG2PIV.js";
4
+ import {
5
+ addContentAction
6
+ } from "./chunk-ELT65PZW.js";
4
7
  import {
5
8
  ALL_MODELS
6
9
  } from "./chunk-RK5NYQEL.js";
7
- import {
8
- addContentAction
9
- } from "./chunk-IWLUTMYX.js";
10
10
  import {
11
11
  upload
12
- } from "./chunk-3S2VOMIF.js";
12
+ } from "./chunk-XRZJGPFI.js";
13
+ import {
14
+ PUBLIC_DEEPSEEK_V4_FLASH_AGENT_KEY,
15
+ PUBLIC_KIMI_K26_IMAGE_AGENT_KEY
16
+ } from "./chunk-3ND52WIL.js";
13
17
  import {
14
18
  getRuntimeServerContext
15
- } from "./chunk-DVRHHFEA.js";
19
+ } from "./chunk-XMLRJUU5.js";
16
20
  import {
17
21
  API_ENDPOINTS
18
22
  } from "./chunk-LCBAMY2M.js";
@@ -539,6 +543,50 @@ function planCompression(input) {
539
543
  };
540
544
  }
541
545
 
546
+ // packages/agent-runtime/autoExecutionProfiles.ts
547
+ var createProfile = (input) => ({
548
+ id: input.id,
549
+ tier: input.tier,
550
+ legacyAgentKey: input.legacyAgentKey,
551
+ key: input.legacyAgentKey,
552
+ name: input.name,
553
+ provider: "nolo",
554
+ model: input.model,
555
+ apiSource: "platform",
556
+ useServerProxy: true,
557
+ rawRecord: {
558
+ dbKey: input.legacyAgentKey,
559
+ isPublic: true,
560
+ provider: "nolo",
561
+ model: input.model,
562
+ apiSource: "platform",
563
+ useServerProxy: true
564
+ }
565
+ });
566
+ var FLASH_PROFILE = createProfile({
567
+ id: "builtin:auto:deepseek-v4-flash",
568
+ tier: "flash",
569
+ legacyAgentKey: PUBLIC_DEEPSEEK_V4_FLASH_AGENT_KEY,
570
+ name: "DeepSeek V4 Flash",
571
+ model: "deepseek-v4-flash"
572
+ });
573
+ var IMAGE_PROFILE = createProfile({
574
+ id: "builtin:auto:kimi-k2.6",
575
+ tier: "image",
576
+ legacyAgentKey: PUBLIC_KIMI_K26_IMAGE_AGENT_KEY,
577
+ name: "Kimi K2.6",
578
+ model: "kimi-k2.6"
579
+ });
580
+ var AUTO_EXECUTION_PROFILES = {
581
+ flash: FLASH_PROFILE,
582
+ balanced: { ...FLASH_PROFILE, tier: "balanced" },
583
+ quality: { ...FLASH_PROFILE, tier: "quality" },
584
+ image: IMAGE_PROFILE
585
+ };
586
+ var DEFAULT_AUTO_EXECUTION_TIER = "flash";
587
+ var DEFAULT_AUTO_EXECUTION_PROFILE = AUTO_EXECUTION_PROFILES[DEFAULT_AUTO_EXECUTION_TIER];
588
+ var resolveAutoExecutionProfile = (tier) => AUTO_EXECUTION_PROFILES[tier ?? DEFAULT_AUTO_EXECUTION_TIER] ?? DEFAULT_AUTO_EXECUTION_PROFILE;
589
+
542
590
  export {
543
591
  planContextUsage,
544
592
  estimateTokenCount,
@@ -548,5 +596,7 @@ export {
548
596
  buildDatabaseFileContentUrl,
549
597
  serializeMessageContent,
550
598
  normalizeAssistantContentBuffer,
551
- planCompression
599
+ planCompression,
600
+ DEFAULT_AUTO_EXECUTION_PROFILE,
601
+ resolveAutoExecutionProfile
552
602
  };
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  patch,
3
3
  read
4
- } from "./chunk-3S2VOMIF.js";
4
+ } from "./chunk-XRZJGPFI.js";
5
5
  import {
6
6
  DEVICE_LOCAL_OWNER_ID,
7
7
  isDeviceLocalSpaceBody,
8
8
  selectIdentityUserId
9
- } from "./chunk-DVRHHFEA.js";
9
+ } from "./chunk-XMLRJUU5.js";
10
10
 
11
11
  // packages/create/space/spaceKeys.ts
12
12
  var SEPARATOR = "-";
@@ -0,0 +1,221 @@
1
+ // packages/ai/tools/agent/agentRunDisplayHelpers.ts
2
+ function getAgentRunStatusIcon(status) {
3
+ switch (status) {
4
+ case "running":
5
+ case "pending":
6
+ return "\u23F3";
7
+ case "done":
8
+ return "\u2713";
9
+ case "failed":
10
+ case "timeout":
11
+ return "\u2717";
12
+ case "killed":
13
+ case "cancelled":
14
+ case "cancelling":
15
+ return "\u{1F6D1}";
16
+ case "orphaned":
17
+ return "\u{1F47B}";
18
+ case "not_found":
19
+ default:
20
+ return "?";
21
+ }
22
+ }
23
+ var DEFAULT_LABELS = {
24
+ runStatus: "Run status",
25
+ runStarted: "Run started",
26
+ runStopped: "Run stopped",
27
+ runFinished: "Run finished",
28
+ logTail: "Log tail:",
29
+ runs: (count) => `Runs (${count})`
30
+ };
31
+ function resolveLabels(labels) {
32
+ return {
33
+ runStatus: labels?.runStatus ?? DEFAULT_LABELS.runStatus,
34
+ runStarted: labels?.runStarted ?? DEFAULT_LABELS.runStarted,
35
+ runStopped: labels?.runStopped ?? DEFAULT_LABELS.runStopped,
36
+ runFinished: labels?.runFinished ?? DEFAULT_LABELS.runFinished,
37
+ logTail: labels?.logTail ?? DEFAULT_LABELS.logTail,
38
+ runs: labels?.runs ?? DEFAULT_LABELS.runs
39
+ };
40
+ }
41
+ function shortRunId(runId) {
42
+ const trimmed = typeof runId === "string" ? runId.trim() : "";
43
+ if (!trimmed) return "";
44
+ const segments = trimmed.split("-").filter(Boolean);
45
+ let pick = segments[segments.length - 1] ?? trimmed;
46
+ if (pick.length < 4 && segments.length >= 2) pick = segments.slice(-2).join("-");
47
+ if (!pick) pick = trimmed;
48
+ return pick.length > 8 ? pick.slice(-8) : pick;
49
+ }
50
+ function clipText(text, max) {
51
+ const collapsed = text.replace(/\s+/g, " ").trim();
52
+ return collapsed.length > max ? `${collapsed.slice(0, max - 1)}\u2026` : collapsed;
53
+ }
54
+ function formatDuration(ms) {
55
+ const totalSec = Math.max(0, Math.floor(ms / 1e3));
56
+ if (totalSec < 60) return `${totalSec}s`;
57
+ const totalMin = Math.floor(totalSec / 60);
58
+ if (totalMin < 60) return `${totalMin}m${String(totalSec % 60).padStart(2, "0")}s`;
59
+ return `${Math.floor(totalMin / 60)}h${String(totalMin % 60).padStart(2, "0")}m`;
60
+ }
61
+ function formatRunAge(timing, now = Date.now()) {
62
+ const startedAt = timing?.startedAt;
63
+ if (typeof startedAt !== "number" || !Number.isFinite(startedAt) || startedAt <= 0) {
64
+ return "";
65
+ }
66
+ const end = typeof timing?.finishedAt === "number" && Number.isFinite(timing.finishedAt) && timing.finishedAt > 0 ? timing.finishedAt : now;
67
+ return formatDuration(end - startedAt);
68
+ }
69
+ function formatIdentityRow(agentName, runId) {
70
+ const parts = [];
71
+ if (!isAgentNameFallback(agentName)) parts.push(agentName);
72
+ const short = shortRunId(runId);
73
+ if (short) parts.push(`#${short}`);
74
+ return parts.join(" ");
75
+ }
76
+ function isAgentNameFallback(agentName) {
77
+ const trimmed = typeof agentName === "string" ? agentName.trim() : "";
78
+ return !trimmed || trimmed === "agent";
79
+ }
80
+ function resolveRunLabel(run) {
81
+ for (const candidate of [run.agentName, run.name, run.agentKey, run.runId]) {
82
+ if (typeof candidate === "string" && !isAgentNameFallback(candidate)) {
83
+ return candidate.trim();
84
+ }
85
+ }
86
+ return "agent";
87
+ }
88
+ function formatStartRunCard(agentName, status = "running", opts) {
89
+ const L = resolveLabels(opts?.labels);
90
+ const icon = getAgentRunStatusIcon(status);
91
+ const lines = [L.runStarted];
92
+ const identity = formatIdentityRow(agentName, opts?.runId);
93
+ if (identity) {
94
+ lines.push(` agent ${identity}`);
95
+ }
96
+ lines.push(` status ${icon} ${status}`);
97
+ const task = opts?.task?.trim();
98
+ if (task) {
99
+ lines.push(` task ${clipText(task, TASK_PREVIEW_MAX)}`);
100
+ }
101
+ return lines.join("\n");
102
+ }
103
+ var TASK_PREVIEW_MAX = 72;
104
+ var NOTE_PREVIEW_MAX = 72;
105
+ function formatProgressRow(toolCallCount, lastToolNames) {
106
+ const parts = [];
107
+ if (typeof toolCallCount === "number" && Number.isFinite(toolCallCount)) {
108
+ parts.push(`${toolCallCount} tools`);
109
+ }
110
+ if (lastToolNames && lastToolNames.length > 0) {
111
+ parts.push(lastToolNames.join(", "));
112
+ }
113
+ return parts.join(" \xB7 ");
114
+ }
115
+ function formatStatusRunCard(agentName, status = "running", opts) {
116
+ const L = resolveLabels(opts?.labels);
117
+ const icon = getAgentRunStatusIcon(status);
118
+ const age = formatRunAge(opts?.timing, opts?.now);
119
+ const lines = [L.runStatus, ` ${icon} ${status}${age ? ` ${age}` : ""}`];
120
+ const identity = formatIdentityRow(agentName, opts?.runId);
121
+ if (identity) {
122
+ lines.push(` agent ${identity}`);
123
+ }
124
+ const progress = formatProgressRow(opts?.toolCallCount, opts?.lastToolNames);
125
+ if (progress) {
126
+ lines.push(` tools ${progress}`);
127
+ }
128
+ const note = opts?.lastAssistantText?.trim();
129
+ if (note) {
130
+ lines.push(` note ${clipText(note, NOTE_PREVIEW_MAX)}`);
131
+ }
132
+ if (opts?.errorMessage?.trim()) {
133
+ lines.push(` error ${opts.errorMessage.trim()}`);
134
+ }
135
+ if (shouldShowLogTail(status, opts?.includeLogTail, opts?.logLines)) {
136
+ lines.push("", L.logTail, ...opts.logLines.map((l) => ` ${l}`));
137
+ }
138
+ return lines.join("\n");
139
+ }
140
+ function runShowsLogTail(status) {
141
+ return status === "failed" || status === "timeout";
142
+ }
143
+ function shouldShowLogTail(status, includeLogTail, logLines) {
144
+ if (includeLogTail === false) return false;
145
+ if (!logLines || logLines.length === 0) return false;
146
+ return runShowsLogTail(status);
147
+ }
148
+ function formatFinishedRunCard(agentName, status, opts) {
149
+ const L = resolveLabels(opts?.labels);
150
+ const icon = getAgentRunStatusIcon(status);
151
+ const age = formatRunAge(opts?.timing, opts?.now);
152
+ const summary = [status, age, formatProgressRow(opts?.toolCallCount, opts?.lastToolNames)].filter(Boolean).join(" \xB7 ");
153
+ const lines = [L.runFinished, ` ${icon} ${summary}`];
154
+ const identity = formatIdentityRow(agentName, opts?.runId);
155
+ if (identity) {
156
+ lines.push(` agent ${identity}`);
157
+ }
158
+ const note = opts?.lastAssistantText?.trim();
159
+ if (note) {
160
+ lines.push(` note ${clipText(note, NOTE_PREVIEW_MAX)}`);
161
+ }
162
+ if (opts?.errorMessage?.trim()) {
163
+ lines.push(` error ${opts.errorMessage.trim()}`);
164
+ }
165
+ if (shouldShowLogTail(status, opts?.includeLogTail, opts?.logLines)) {
166
+ lines.push("", L.logTail, ...opts.logLines.map((l) => ` ${l}`));
167
+ }
168
+ return lines.join("\n");
169
+ }
170
+ function formatStopRunCard(status = "killed", labels) {
171
+ const L = resolveLabels(labels);
172
+ const icon = getAgentRunStatusIcon(status);
173
+ return `${L.runStopped}
174
+ ${icon} ${status}`;
175
+ }
176
+ function formatListRunsCard(runs, labels) {
177
+ const L = resolveLabels(labels);
178
+ const lines = [L.runs(runs.length)];
179
+ for (const run of runs) {
180
+ const status = run.status ?? "\u2014";
181
+ const icon = getAgentRunStatusIcon(status);
182
+ lines.push(` ${icon} ${resolveRunLabel(run)}`);
183
+ }
184
+ return lines.join("\n");
185
+ }
186
+ function formatNotFoundRunCard(labels) {
187
+ const L = resolveLabels(labels);
188
+ return `${L.runStatus}
189
+ ? not_found`;
190
+ }
191
+ var AGENT_RUN_TERMINAL_STATUSES = /* @__PURE__ */ new Set([
192
+ "done",
193
+ "failed",
194
+ "timeout",
195
+ "killed",
196
+ "cancelled",
197
+ // orphaned: pid gone but the run record was still "running" — the process
198
+ // died (killed/OOM/crashed) before writing its own terminal status. Treated
199
+ // as terminal by all display/filter/GC consumers.
200
+ "orphaned"
201
+ ]);
202
+ function isAgentRunTerminalStatus(status) {
203
+ return typeof status === "string" && AGENT_RUN_TERMINAL_STATUSES.has(status);
204
+ }
205
+
206
+ export {
207
+ getAgentRunStatusIcon,
208
+ shortRunId,
209
+ formatRunAge,
210
+ isAgentNameFallback,
211
+ resolveRunLabel,
212
+ formatStartRunCard,
213
+ TASK_PREVIEW_MAX,
214
+ formatStatusRunCard,
215
+ runShowsLogTail,
216
+ formatFinishedRunCard,
217
+ formatStopRunCard,
218
+ formatListRunsCard,
219
+ formatNotFoundRunCard,
220
+ isAgentRunTerminalStatus
221
+ };
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  readDbRecord,
3
3
  writeAgentRecord
4
- } from "./chunk-FMYTM25W.js";
4
+ } from "./chunk-FVIPEIVX.js";
5
5
  import {
6
6
  buildSkillSummaryMarker
7
7
  } from "./chunk-VF4K2QE6.js";
8
+ import {
9
+ createSpaceKey
10
+ } from "./chunk-ELT65PZW.js";
8
11
  import {
9
12
  parseUserIdFromAuthToken,
10
13
  readOption,
11
14
  resolveAuthToken,
12
15
  resolveServerUrl
13
16
  } from "./chunk-A7GB5UGH.js";
14
- import {
15
- createSpaceKey
16
- } from "./chunk-IWLUTMYX.js";
17
17
  import {
18
18
  asTrimmedLowercaseString
19
19
  } from "./chunk-QSJ3HFEF.js";
@@ -1,8 +1,7 @@
1
1
  import {
2
2
  buildLocalAgentLookupKeys,
3
- normalizeAgentHandle,
4
3
  shouldReadAgentKeyRemotely
5
- } from "./chunk-WVDAUR2S.js";
4
+ } from "./chunk-45BY7RLP.js";
6
5
  import {
7
6
  resolveCliAgentKeyInput
8
7
  } from "./chunk-VHBWHNVT.js";
@@ -22,10 +21,17 @@ import {
22
21
  } from "./chunk-A7GB5UGH.js";
23
22
  import {
24
23
  createAgentKey
25
- } from "./chunk-O4BU24WZ.js";
24
+ } from "./chunk-6Y7A3OQQ.js";
26
25
 
27
26
  // packages/cli/agentRecordHelpers.ts
28
27
  import { readFileSync } from "node:fs";
28
+
29
+ // packages/core/agentHandle.ts
30
+ function normalizeAgentHandle(value) {
31
+ return typeof value === "string" && value.trim() ? value.trim().toLowerCase().replace(/\s+/g, " ") : void 0;
32
+ }
33
+
34
+ // packages/cli/agentRecordHelpers.ts
29
35
  var PROVIDER_COPY_FIELDS = [
30
36
  "apiSource",
31
37
  "provider",
@@ -612,6 +618,7 @@ async function buildUpdatedAgentRecord(args) {
612
618
  }
613
619
 
614
620
  export {
621
+ normalizeAgentHandle,
615
622
  fetchWithTransportFallback,
616
623
  readAgentRecord,
617
624
  readDbRecord,
@@ -78,6 +78,45 @@ var anthropicModels = [
78
78
  }
79
79
  ];
80
80
 
81
+ // packages/integrations/anthropic/anthropicOAuthModels.ts
82
+ var oauthModel = ({ name, displayName, contextWindow, thinkingMode, maxOutputTokens }) => ({
83
+ name,
84
+ displayName,
85
+ hasVision: true,
86
+ description: `OAuth \u8BA2\u9605\u6A21\u578B\uFF08${displayName}\uFF0C${thinkingMode === "adaptive" ? "Adaptive thinking" : "Extended thinking"}\uFF09`,
87
+ contextWindow,
88
+ ...maxOutputTokens ? { maxOutputTokens } : {},
89
+ supportsReasoningEffort: true,
90
+ price: { input: 0, output: 0 }
91
+ });
92
+ var anthropicOAuthModels = [
93
+ // 5 代(1M + Adaptive thinking always-on;官方 max output 128k)
94
+ oauthModel({ name: "claude-fable-5", displayName: "Claude Fable 5", contextWindow: 1e6, thinkingMode: "adaptive", maxOutputTokens: 128e3 }),
95
+ oauthModel({ name: "claude-opus-5", displayName: "Claude Opus 5", contextWindow: 1e6, thinkingMode: "adaptive", maxOutputTokens: 128e3 }),
96
+ oauthModel({ name: "claude-sonnet-5", displayName: "Claude Sonnet 5", contextWindow: 1e6, thinkingMode: "adaptive", maxOutputTokens: 128e3 }),
97
+ // 4.6/4.7/4.8 系(Adaptive thinking;context 官方未单列,参照 fuzzy claude-4.6→1M)
98
+ oauthModel({ name: "claude-opus-4-8", displayName: "Claude Opus 4.8", contextWindow: 1e6, thinkingMode: "adaptive" }),
99
+ oauthModel({ name: "claude-opus-4-7", displayName: "Claude Opus 4.7", contextWindow: 1e6, thinkingMode: "adaptive" }),
100
+ oauthModel({ name: "claude-sonnet-4-6", displayName: "Claude Sonnet 4.6", contextWindow: 1e6, thinkingMode: "adaptive" }),
101
+ oauthModel({ name: "claude-opus-4-6", displayName: "Claude Opus 4.6", contextWindow: 1e6, thinkingMode: "adaptive" }),
102
+ // 4.5 系(Extended thinking;官方发布规格 1M)
103
+ oauthModel({ name: "claude-opus-4-5-20251101", displayName: "Claude Opus 4.5", contextWindow: 1e6, thinkingMode: "extended" }),
104
+ oauthModel({ name: "claude-sonnet-4-5-20250929", displayName: "Claude Sonnet 4.5", contextWindow: 1e6, thinkingMode: "extended" }),
105
+ // haiku-4-5(官方明确 context=200k + Extended thinking)
106
+ oauthModel({ name: "claude-haiku-4-5-20251001", displayName: "Claude Haiku 4.5", contextWindow: 2e5, thinkingMode: "extended" })
107
+ ];
108
+ var OAUTH_MODEL_THINKING_MODE = new Map(
109
+ anthropicOAuthModels.map((m) => [m.name, m.thinkingMode])
110
+ );
111
+ function isAdaptiveThinkingModelId(model) {
112
+ if (!model) return false;
113
+ const tableMode = OAUTH_MODEL_THINKING_MODE.get(model);
114
+ if (tableMode === "adaptive") return true;
115
+ if (tableMode === "extended") return false;
116
+ const n = model.toLowerCase();
117
+ return n.includes("fable-5") || n.includes("opus-5") || n.includes("sonnet-5") || n.includes("opus-4-8") || n.includes("opus-4-7") || n.includes("sonnet-4-6") || n.includes("opus-4-6");
118
+ }
119
+
81
120
  // packages/integrations/qwen/models.ts
82
121
  var qwenModels = [
83
122
  // ── Qwen3 旗舰 ──
@@ -4683,7 +4722,7 @@ var MODEL_MAP = {
4683
4722
  moonshot: moonshotAllModels
4684
4723
  };
4685
4724
  var MODEL_LOOKUP_MAP = {
4686
- anthropic: anthropicModels,
4725
+ anthropic: [...anthropicModels, ...anthropicOAuthModels],
4687
4726
  xai: xaiModels,
4688
4727
  ...MODEL_MAP
4689
4728
  };
@@ -4892,6 +4931,7 @@ function getApiEndpoint(agent) {
4892
4931
  }
4893
4932
 
4894
4933
  export {
4934
+ isAdaptiveThinkingModelId,
4895
4935
  isModelSupportReasoningEffort,
4896
4936
  clampReasoningEffort,
4897
4937
  MODEL_LOOKUP_MAP,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  fetchReferenceContents,
3
3
  resolveReferenceAssets
4
- } from "./chunk-VAT72PDP.js";
4
+ } from "./chunk-ZJZCMKOR.js";
5
5
 
6
6
  // packages/ai/agent/fetchAgentContexts.ts
7
7
  async function fetchAgentContexts(references, dispatch) {