nolo-cli 0.9.1 → 0.11.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 (114) hide show
  1. package/README.md +1 -1
  2. package/{_executeModel-UD44KGZ4.js → _executeModel-ZEDPX6OF.js} +50 -48
  3. package/{action-ZJWE3Y5S.js → action-AA4IJ5K2.js} +11 -11
  4. package/{addContentAction-TVDBNJM5.js → addContentAction-QYVO4SYP.js} +10 -10
  5. package/{addDialogAgentAction-EKH774VT.js → addDialogAgentAction-WVVKT5WQ.js} +12 -12
  6. package/{agentDeleteCommand-TCPEFJTF.js → agentDeleteCommand-RDPGYIWF.js} +25 -25
  7. package/{agentEmailCommands-CZ3UILZ4.js → agentEmailCommands-2HJJKS5F.js} +62 -59
  8. package/{agentListCommands-SJKO2FFB.js → agentListCommands-HFEVV3ZW.js} +30 -29
  9. package/{agentMachineCommands-PSNABISZ.js → agentMachineCommands-25ZOENJU.js} +29 -29
  10. package/{agentRecordCommands-MH2JKFHS.js → agentRecordCommands-GTCOAM3L.js} +53 -50
  11. package/{agentRunCommand-4KH6MIZR.js → agentRunCommand-YBS3JDLD.js} +62 -56
  12. package/{agentRuntimeLocal-SKHJUWSS.js → agentRuntimeLocal-UQBMQI2M.js} +12 -12
  13. package/{agentSlice-3WXXN4VK.js → agentSlice-6EKOBCCS.js} +11 -11
  14. package/{authCommand-PXFX6JDT.js → authCommand-O2OWACN4.js} +12 -12
  15. package/{authCommands-356AYWEK.js → authCommands-H7365TZP.js} +6 -6
  16. package/{chunk-MKMWT7SA.js → chunk-2W2VYVI5.js} +336 -92
  17. package/{chunk-TSS3XJY4.js → chunk-3NSIQZZ6.js} +5 -5
  18. package/{chunk-AUQ747NZ.js → chunk-4SOKXIW4.js} +70 -6
  19. package/{chunk-ZIG5LJ7X.js → chunk-5MOUAAMK.js} +106 -2342
  20. package/{chunk-6GANEXVO.js → chunk-5OIFWVX7.js} +1 -1
  21. package/{chunk-MGOJ5R6J.js → chunk-7D3JY6C2.js} +2 -2
  22. package/{chunk-7OOXPE3N.js → chunk-AEZAORLG.js} +4 -4
  23. package/chunk-AFON4QUU.js +112 -0
  24. package/{chunk-YBWOP46I.js → chunk-BX6U3ETE.js} +20 -13
  25. package/{chunk-2PUGVR6E.js → chunk-C2MDQQ4O.js} +1 -1
  26. package/{chunk-SL35K7AH.js → chunk-C4FTUXVF.js} +2 -82
  27. package/{chunk-GAKEBQD6.js → chunk-D6OQHXVG.js} +11 -7
  28. package/{chunk-WKM6FH35.js → chunk-DWGAEFJL.js} +1 -1
  29. package/{chunk-PG5PNA7Y.js → chunk-E4HNJSHC.js} +20 -20
  30. package/{chunk-SBR32ZZS.js → chunk-EVZKZF32.js} +73 -40
  31. package/{chunk-C3RUNRHT.js → chunk-FXXSGWAJ.js} +1 -1
  32. package/{chunk-KTVVPRJS.js → chunk-GBDSZATH.js} +4 -4
  33. package/{chunk-3TZDXYSF.js → chunk-HNW7IJSK.js} +1 -1
  34. package/{chunk-2EISRLRC.js → chunk-IPYUUY4E.js} +2 -2
  35. package/{chunk-2K2ECKSG.js → chunk-KJR5KAUQ.js} +2 -2
  36. package/{chunk-XE635NI4.js → chunk-KQQVGRA3.js} +24 -24
  37. package/{chunk-AVMKZHBC.js → chunk-L53FGHA4.js} +3 -2
  38. package/{chunk-GG4AJPSR.js → chunk-LAX2JSTX.js} +2 -2
  39. package/{chunk-5PJ3VWCS.js → chunk-LP65VRCI.js} +7 -13
  40. package/chunk-LTRXGFMS.js +83 -0
  41. package/{chunk-63SLEOLK.js → chunk-MQI77IRB.js} +4 -4
  42. package/{chunk-PCWC3JTN.js → chunk-MTU75CZ2.js} +1 -1
  43. package/{chunk-3WYQEUBI.js → chunk-NEM67FX7.js} +1 -1
  44. package/{chunk-COMXDWNM.js → chunk-O26GI2JP.js} +10 -10
  45. package/{chunk-SH2CFQOH.js → chunk-O4BU24WZ.js} +2 -181
  46. package/{chunk-EYEEHCU4.js → chunk-OOM6SJNR.js} +10 -10
  47. package/chunk-OOSFSFMA.js +271 -0
  48. package/{chunk-PAKN26FP.js → chunk-OUI3ZHYD.js} +1 -1
  49. package/{chunk-EXTIQUCI.js → chunk-PNEW2Z3T.js} +9 -9
  50. package/{chunk-CPB2YM4D.js → chunk-PXQN7IBQ.js} +2 -2
  51. package/{chunk-4IJYA27C.js → chunk-PXZAAB4L.js} +4 -4
  52. package/{chunk-4K2KKCSD.js → chunk-Q3UKJVU4.js} +12 -16
  53. package/{chunk-XKIMRZO2.js → chunk-QNMFBBZK.js} +1 -1
  54. package/{chunk-XS466O7S.js → chunk-S3GS2PRL.js} +65 -30
  55. package/{chunk-YYUCRDOK.js → chunk-SOTZ6RDN.js} +1 -1
  56. package/{chunk-G43KEVSC.js → chunk-SV5MWASH.js} +17 -17
  57. package/{chunk-7QRKCBOP.js → chunk-TACHTH5D.js} +15 -15
  58. package/chunk-VC6OZXO5.js +298 -0
  59. package/{chunk-ZQ2UM4KG.js → chunk-WZSRQNQG.js} +1 -292
  60. package/{chunk-LARL2V6G.js → chunk-X2S7JTIG.js} +298 -66
  61. package/{chunk-Q2YZULBH.js → chunk-XENYHRUE.js} +1 -1
  62. package/{chunk-ELRRLDWI.js → chunk-XFOLQLDN.js} +2 -2
  63. package/{chunk-UUJDGGAK.js → chunk-XYZA7S7V.js} +6 -6
  64. package/{chunk-KOCA5FCS.js → chunk-ZEYDOXHF.js} +185 -147
  65. package/{chunk-5KLGBAAR.js → chunk-ZPRK73XY.js} +1 -1
  66. package/{cliExecutor-DNE7TCC4.js → cliExecutor-K3F7DMRO.js} +2 -2
  67. package/{createAgentAutomationAction-63OIP6X5.js → createAgentAutomationAction-LTI5QU35.js} +25 -25
  68. package/{createDialogAction-ZLYZDYBB.js → createDialogAction-OJJ7L3L3.js} +26 -25
  69. package/{createPageAction-AL5FSDCK.js → createPageAction-5MXWVRGY.js} +30 -29
  70. package/{dbSlice-PR44QPXY.js → dbSlice-RQFQQVHT.js} +9 -9
  71. package/{deleteFile-4SKGPHOZ.js → deleteFile-7XP5BGC7.js} +6 -6
  72. package/{dialogCommands-F6YI5742.js → dialogCommands-JTJ3RPPW.js} +23 -23
  73. package/{dialogSlice-JSBNZRLR.js → dialogSlice-OWROKURJ.js} +22 -22
  74. package/{docCreateCommands-4CTO7ERT.js → docCreateCommands-WJBEW2V7.js} +23 -22
  75. package/{docDeleteCommands-VBWERDRG.js → docDeleteCommands-BVEHJOY5.js} +25 -24
  76. package/{docReadCommands-KNP4MFYB.js → docReadCommands-NEWOZIJV.js} +23 -22
  77. package/{docStore-ADP5VYY4.js → docStore-3DXRYBMD.js} +23 -23
  78. package/{docUpdateCommands-4BCBJQHA.js → docUpdateCommands-C7WHT7UU.js} +23 -22
  79. package/{fetchMessages-U6ZHN56A.js → fetchMessages-KTNM7QAR.js} +3 -3
  80. package/{handleSendMessageAction-IJDQ6ARA.js → handleSendMessageAction-B5PRR7BE.js} +27 -27
  81. package/index.js +58 -58
  82. package/{localDialogRead-Z5UTAJPU.js → localDialogRead-YSKFFRTT.js} +2 -2
  83. package/{machineCommands-EA3M4XTN.js → machineCommands-IIIREAEK.js} +67 -62
  84. package/{machineWsRunDispatch-NAPKE5ZA.js → machineWsRunDispatch-3SIU6ILW.js} +52 -49
  85. package/package.json +4 -2
  86. package/{read-RIJCIVKX.js → read-QJNKRROM.js} +6 -6
  87. package/{readDocTool-GZD2N3LO.js → readDocTool-H6X6KO6X.js} +1 -1
  88. package/{readlineWorkspace-KMWT4T4S.js → readlineWorkspace-HGP3I3OC.js} +97 -79
  89. package/{removeDialogAgentAction-GJQJNDW6.js → removeDialogAgentAction-TCT35SOF.js} +14 -14
  90. package/{runAgentClientLoop-U5Q6NDTJ.js → runAgentClientLoop-EFM4PTVI.js} +46 -44
  91. package/{setDialogExtraReferencesAction-M7OQG54N.js → setDialogExtraReferencesAction-CGYLZMFH.js} +12 -12
  92. package/{setPrimaryDialogAgentAction-46UNFJDL.js → setPrimaryDialogAgentAction-F6BFQDJU.js} +14 -14
  93. package/{settingSlice-FVUUH4JA.js → settingSlice-2I5HMG47.js} +10 -10
  94. package/skillDiscovery-UGSQGX2U.js +16 -0
  95. package/{spaceCommands-E2CFRPZJ.js → spaceCommands-MT7BWCIL.js} +32 -36
  96. package/{spaceSlice-L3R6IMXE.js → spaceSlice-BS5TSW3W.js} +22 -22
  97. package/{streamAgentChatTurn-UBDAOQWE.js → streamAgentChatTurn-I3VBFNR3.js} +85 -81
  98. package/{tableCommands-GOFP7QKA.js → tableCommands-M3DJUETS.js} +11 -11
  99. package/{toolApiClient-QI3YBNWB.js → toolApiClient-C7P7YSE4.js} +2 -2
  100. package/{tools-TMJXZTCA.js → tools-XSD2BOEN.js} +34 -32
  101. package/{tuiSummaryLlmCaller-RV3THLZF.js → tuiSummaryLlmCaller-32NRHTT2.js} +3 -3
  102. package/{understanding-GQKNDDWM.js → understanding-ZOESBLF3.js} +5 -5
  103. package/{updateDialogTitleAction-ZTWRDXI2.js → updateDialogTitleAction-7FYNJOGP.js} +25 -25
  104. package/chunk-QYXLLLGL.js +0 -4519
  105. package/{agentPullCommand-O2MTUAFR.js → agentPullCommand-GOL2S4W2.js} +1 -1
  106. package/{chunk-DZ3XJVET.js → chunk-3QAF2LTL.js} +3 -3
  107. package/{chunk-EHLHSX7R.js → chunk-5MMZUWSG.js} +3 -3
  108. package/{chunk-X7W4TNB4.js → chunk-CMKUBIGW.js} +3 -3
  109. package/{chunk-4CQLVGRV.js → chunk-ID4G2MAR.js} +3 -3
  110. package/{chunk-5MIDPSSK.js → chunk-JK7VW2FN.js} +3 -3
  111. package/{chunk-TILFE6LV.js → chunk-YOCHZD7D.js} +3 -3
  112. package/{chunk-JRKKFRAV.js → chunk-YTBMA7NO.js} +3 -3
  113. package/{db-HCJ5PRB5.js → db-6QED3ZVO.js} +3 -3
  114. package/{runtimeDoctorCommands-LRHLPDRC.js → runtimeDoctorCommands-ID43Z7VX.js} +3 -3
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  DEFAULT_AGENT_BASE_POLICY,
3
3
  DEFAULT_USER_PREFERENCE_PROFILE
4
- } from "./chunk-TSS3XJY4.js";
4
+ } from "./chunk-3NSIQZZ6.js";
5
5
 
6
6
  // packages/ai/policy/runtimePolicy.ts
7
7
  var clampLevel = (value, fallback) => {
@@ -4,12 +4,12 @@ import {
4
4
  import {
5
5
  patch,
6
6
  read
7
- } from "./chunk-COMXDWNM.js";
7
+ } from "./chunk-O26GI2JP.js";
8
8
  import {
9
9
  DEVICE_LOCAL_OWNER_ID,
10
10
  isDeviceLocalSpaceBody,
11
11
  selectIdentityUserId
12
- } from "./chunk-EYEEHCU4.js";
12
+ } from "./chunk-OOM6SJNR.js";
13
13
 
14
14
  // packages/create/space/utils/permissions.ts
15
15
  var checkSpaceMembership = (spaceData, userId) => {
@@ -2,7 +2,7 @@ import {
2
2
  buildLocalAgentLookupKeys,
3
3
  normalizeAgentHandle,
4
4
  shouldReadAgentKeyRemotely
5
- } from "./chunk-2PUGVR6E.js";
5
+ } from "./chunk-C2MDQQ4O.js";
6
6
  import {
7
7
  resolveCliAgentKeyInput
8
8
  } from "./chunk-VHBWHNVT.js";
@@ -10,6 +10,9 @@ import {
10
10
  readPipeText,
11
11
  spawnProcess
12
12
  } from "./chunk-IDZTNRP2.js";
13
+ import {
14
+ createAgentKey
15
+ } from "./chunk-O4BU24WZ.js";
13
16
  import {
14
17
  parseUserIdFromAuthToken,
15
18
  readOption,
@@ -20,9 +23,6 @@ import {
20
23
  import {
21
24
  toErrorMessage
22
25
  } from "./chunk-HNMXYYJR.js";
23
- import {
24
- createAgentKey
25
- } from "./chunk-SH2CFQOH.js";
26
26
 
27
27
  // packages/cli/agentRecordHelpers.ts
28
28
  import { readFileSync } from "node:fs";
@@ -0,0 +1,112 @@
1
+ import {
2
+ buildSkillDiscoveryLayer
3
+ } from "./chunk-C4FTUXVF.js";
4
+ import {
5
+ load
6
+ } from "./chunk-WZSRQNQG.js";
7
+
8
+ // packages/agent-runtime/skillDiscovery.ts
9
+ import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
10
+ import { join } from "node:path";
11
+ var SKILL_SCAN_DIRS = [".agents/skills", "docs/skills"];
12
+ var MAX_DISCOVERED_SKILLS = 50;
13
+ function parseSkillFrontmatter(filePath) {
14
+ try {
15
+ const content = readFileSync(filePath, "utf8").slice(0, 2048);
16
+ const fmMatch = content.match(/^---\n([\s\S]*?)\n---/);
17
+ if (!fmMatch) return {};
18
+ const fm = load(fmMatch[1]);
19
+ if (!fm || typeof fm !== "object") return {};
20
+ const name = typeof fm.name === "string" ? fm.name : void 0;
21
+ const rawDesc = fm.description;
22
+ const description = typeof rawDesc === "string" ? rawDesc : rawDesc == null ? void 0 : String(rawDesc);
23
+ const sanitize = (s) => s?.trim().replace(/^["']|["']$/g, "").replace(/[\n\r]+/g, " ").slice(0, 200);
24
+ return { name: sanitize(name), description: sanitize(description) };
25
+ } catch {
26
+ return {};
27
+ }
28
+ }
29
+ function discoverSkills(cwd) {
30
+ const skills = [];
31
+ for (const dir of SKILL_SCAN_DIRS) {
32
+ if (skills.length >= MAX_DISCOVERED_SKILLS) break;
33
+ const absDir = join(cwd, dir);
34
+ if (!existsSync(absDir) || !statSync(absDir).isDirectory()) continue;
35
+ try {
36
+ for (const entry of readdirSync(absDir)) {
37
+ if (skills.length >= MAX_DISCOVERED_SKILLS) break;
38
+ const skillMdPath = join(absDir, entry, "SKILL.md");
39
+ if (existsSync(skillMdPath)) {
40
+ const { name, description } = parseSkillFrontmatter(skillMdPath);
41
+ skills.push({ name: name ?? entry, description: description ?? "", relativePath: join(dir, entry, "SKILL.md") });
42
+ continue;
43
+ }
44
+ if (dir === "docs/skills" && entry.endsWith(".md")) {
45
+ const flatPath = join(absDir, entry);
46
+ const { name, description } = parseSkillFrontmatter(flatPath);
47
+ skills.push({ name: name ?? entry.replace(/\.md$/, ""), description: description ?? "", relativePath: join(dir, entry) });
48
+ }
49
+ }
50
+ } catch {
51
+ }
52
+ }
53
+ return skills;
54
+ }
55
+ function resolveSkillByName(cwd, name) {
56
+ const trimmed = name.trim();
57
+ if (!trimmed || trimmed.includes("/") || trimmed.includes("\\") || trimmed.includes("..")) {
58
+ return null;
59
+ }
60
+ const agentsDir = join(cwd, ".agents", "skills", trimmed);
61
+ const agentsSkillMd = join(agentsDir, "SKILL.md");
62
+ if (existsSync(agentsSkillMd)) return agentsSkillMd;
63
+ const agentsParent = join(cwd, ".agents", "skills");
64
+ if (existsSync(agentsParent) && statSync(agentsParent).isDirectory()) {
65
+ try {
66
+ for (const entry of readdirSync(agentsParent)) {
67
+ const candidate = join(agentsParent, entry, "SKILL.md");
68
+ if (!existsSync(candidate)) continue;
69
+ try {
70
+ const { name: fmName } = parseSkillFrontmatter(candidate);
71
+ if (fmName && fmName === trimmed) return candidate;
72
+ } catch {
73
+ }
74
+ }
75
+ } catch {
76
+ }
77
+ }
78
+ const docsFlat = join(cwd, "docs", "skills", `${trimmed}.md`);
79
+ if (existsSync(docsFlat)) return docsFlat;
80
+ const docsDir = join(cwd, "docs", "skills");
81
+ if (existsSync(docsDir) && statSync(docsDir).isDirectory()) {
82
+ try {
83
+ for (const entry of readdirSync(docsDir)) {
84
+ if (!entry.endsWith(".md")) continue;
85
+ const candidate = join(docsDir, entry);
86
+ try {
87
+ const { name: fmName } = parseSkillFrontmatter(candidate);
88
+ if (fmName && fmName === trimmed) return candidate;
89
+ } catch {
90
+ }
91
+ }
92
+ } catch {
93
+ }
94
+ }
95
+ return null;
96
+ }
97
+ function buildSkillDiscoveryContextBlock(cwd) {
98
+ try {
99
+ const discovered = discoverSkills(cwd);
100
+ const layer = buildSkillDiscoveryLayer(discovered, cwd);
101
+ return layer?.content ?? null;
102
+ } catch {
103
+ return null;
104
+ }
105
+ }
106
+
107
+ export {
108
+ parseSkillFrontmatter,
109
+ discoverSkills,
110
+ resolveSkillByName,
111
+ buildSkillDiscoveryContextBlock
112
+ };
@@ -5,10 +5,10 @@ import {
5
5
  readSseFrames,
6
6
  throwIfChatCompletionStreamFailed,
7
7
  toOpenAiCompatibleMessages
8
- } from "./chunk-5KLGBAAR.js";
8
+ } from "./chunk-ZPRK73XY.js";
9
9
  import {
10
10
  parseToolArgumentsJson
11
- } from "./chunk-XS466O7S.js";
11
+ } from "./chunk-S3GS2PRL.js";
12
12
  import {
13
13
  createThinkParserState,
14
14
  extractThinkContent
@@ -16,21 +16,18 @@ import {
16
16
  import {
17
17
  buildProviderAuthHeaders,
18
18
  buildProviderExecutionPlan
19
- } from "./chunk-JRKKFRAV.js";
19
+ } from "./chunk-YTBMA7NO.js";
20
20
  import {
21
21
  canonicalizeToolName,
22
22
  createGlob,
23
23
  resolveExecutableOnPath
24
- } from "./chunk-AUQ747NZ.js";
25
- import {
26
- toErrorMessage
27
- } from "./chunk-HNMXYYJR.js";
24
+ } from "./chunk-4SOKXIW4.js";
28
25
  import {
29
26
  asRecordOrEmpty
30
27
  } from "./chunk-KX6YBIHG.js";
31
28
  import {
32
29
  dialogMessageKey
33
- } from "./chunk-SH2CFQOH.js";
30
+ } from "./chunk-O4BU24WZ.js";
34
31
  import {
35
32
  asTrimmedNonEmptyStringArray
36
33
  } from "./chunk-I42VC5KR.js";
@@ -40,21 +37,24 @@ import {
40
37
  import {
41
38
  asTrimmedLowercaseString
42
39
  } from "./chunk-QSJ3HFEF.js";
40
+ import {
41
+ toErrorMessage
42
+ } from "./chunk-HNMXYYJR.js";
43
43
  import {
44
44
  asTrimmedString
45
45
  } from "./chunk-3EUW3WEO.js";
46
46
  import {
47
47
  asOptionalPositiveFiniteNumber
48
48
  } from "./chunk-U6VC4MU4.js";
49
+ import {
50
+ isRecord
51
+ } from "./chunk-KUG52IAP.js";
49
52
  import {
50
53
  normalizeServerOrigin
51
54
  } from "./chunk-CF7PE763.js";
52
55
  import {
53
56
  asOptionalTrimmedString
54
57
  } from "./chunk-G3SUCT4W.js";
55
- import {
56
- isRecord
57
- } from "./chunk-KUG52IAP.js";
58
58
 
59
59
  // packages/agent-runtime/kimiUserAgent.ts
60
60
  var KIMI_CODE_CLI_VERSION = "0.29.2";
@@ -878,7 +878,14 @@ var DEFAULT_LOCAL_TOOLS = /* @__PURE__ */ new Set([
878
878
  "searchFiles",
879
879
  "execShell",
880
880
  "launchProcess",
881
- "listProcesses"
881
+ "listProcesses",
882
+ // Scheduling tools: forking/observing sub-agents is a declared capability
883
+ // of capable agents, and the blast radius is strictly narrower than
884
+ // execShell (already default-enabled). Requiring an env allowlist for these
885
+ // while execShell is open by default inverted the risk model and forced every
886
+ // new local user to hand-edit .env files before sub-agent tasks worked.
887
+ "startAgentRun",
888
+ "controlAgentRun"
882
889
  ]);
883
890
  function parseToolAllowlist(value) {
884
891
  return (value ?? "").split(",").flatMap((item) => {
@@ -951,7 +958,7 @@ function resolveLocalToolPolicy(args) {
951
958
  return {
952
959
  allowed: false,
953
960
  toolName,
954
- reason: `${toolName} is not enabled for local runtime runs. Set NOLO_LOCAL_ALLOWED_TOOLS and make sure the agent declares the tool before using it locally.`
961
+ reason: `${toolName} is not enabled for local runtime runs. The agent must declare the tool in its manifest; in restricted mode (NOLO_LOCAL_TOOL_MODE=restricted) non-default tools also require adding to NOLO_LOCAL_ALLOWED_TOOLS (e.g. NOLO_LOCAL_ALLOWED_TOOLS=someCustomTool) and restarting the session so the env var loads.`
955
962
  };
956
963
  }
957
964
  async function executeLocalToolWithPolicy(args) {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  buildAgentRuntimeAgentLookupKeys,
3
3
  shouldFetchAgentRuntimeRecordRemotely
4
- } from "./chunk-YBWOP46I.js";
4
+ } from "./chunk-BX6U3ETE.js";
5
5
 
6
6
  // packages/cli/client/localAgentRecords.ts
7
7
  var buildLocalAgentLookupKeys = buildAgentRuntimeAgentLookupKeys;
@@ -2,85 +2,6 @@ import {
2
2
  MEMORY_USE_GUIDANCE
3
3
  } from "./chunk-KKY4B2Q2.js";
4
4
 
5
- // packages/agent-runtime/modelLayerOverride.ts
6
- var MODEL_LAYER_KEYS = [
7
- "provider",
8
- "model",
9
- "apiSource",
10
- "cliProvider",
11
- "useServerProxy",
12
- "apiKey",
13
- "apiKeyRef",
14
- "apiKeyHeader",
15
- "customProviderUrl",
16
- "credentialRef",
17
- "credentialSynced",
18
- "temperature",
19
- "top_p",
20
- "frequency_penalty",
21
- "presence_penalty",
22
- "max_tokens",
23
- "reasoning_effort",
24
- "enableThinking",
25
- "thinkingBudget"
26
- ];
27
- function mergeReferences(base, extra) {
28
- const safeBase = Array.isArray(base) ? base : [];
29
- const safeExtra = Array.isArray(extra) ? extra : [];
30
- const seen = /* @__PURE__ */ new Set();
31
- const merged = [];
32
- for (const item of [...safeBase, ...safeExtra]) {
33
- const key = item?.dbKey;
34
- if (key && seen.has(key)) continue;
35
- if (key) seen.add(key);
36
- if (item) merged.push(item);
37
- }
38
- return merged;
39
- }
40
- var asNonEmptyString = (value) => typeof value === "string" && value.trim().length > 0;
41
- function buildModelLayerOverride(agent) {
42
- if (!agent || !asNonEmptyString(agent.provider) || !asNonEmptyString(agent.model)) {
43
- return null;
44
- }
45
- const override = {
46
- provider: agent.provider,
47
- model: agent.model
48
- };
49
- for (const key of MODEL_LAYER_KEYS) {
50
- if (key === "provider" || key === "model") continue;
51
- const value = agent[key];
52
- if (value !== void 0) {
53
- override[key] = value;
54
- }
55
- }
56
- if (Array.isArray(agent.references) && agent.references.length > 0) {
57
- override.references = agent.references;
58
- }
59
- return override;
60
- }
61
- function applyModelLayerOverride(base, override) {
62
- const next = { ...base };
63
- for (const key of MODEL_LAYER_KEYS) {
64
- delete next[key];
65
- }
66
- for (const key of MODEL_LAYER_KEYS) {
67
- const value = override[key];
68
- if (value !== void 0) {
69
- next[key] = value;
70
- }
71
- }
72
- const merged = mergeReferences(
73
- base.references,
74
- override.references
75
- );
76
- if (merged.length > 0) {
77
- next.references = merged;
78
- } else {
79
- delete next.references;
80
- }
81
- return next;
82
- }
83
-
84
5
  // packages/agent-runtime/turnContext.ts
85
6
  var DEFAULT_RECENT_CONTENT_LIMIT = 10;
86
7
  var asTrimmed = (value) => typeof value === "string" ? value.trim() : "";
@@ -160,7 +81,8 @@ var buildSkillDiscoveryLayer = (skills, boundFolder) => {
160
81
  const lines = [
161
82
  "--- \u53EF\u7528\u6280\u80FD\uFF08Skills\uFF09---",
162
83
  `\u5DE5\u4F5C\u533A ${boundFolder} \u4E2D\u53D1\u73B0\u4E86 ${skills.length} \u4E2A\u6280\u80FD\uFF08SKILL.md\uFF09\uFF1A`,
163
- "\u6A21\u578B\u53EF\u6309\u9700\u7528 readFile \u8BFB\u53D6\u4EE5\u4E0B\u6587\u4EF6\u83B7\u53D6\u8BE6\u7EC6\u6307\u4EE4\uFF1A",
84
+ "\u6A21\u578B\u53EF\u6309\u9700\u7528 loadSkill \u5DE5\u5177\u6309\u540D\u52A0\u8F7D\uFF0C\u628A SKILL.md \u5168\u6587\u62C9\u8FDB\u4E0A\u4E0B\u6587\u540E\u9075\u5FAA\u5176\u6307\u4EE4\uFF1B",
85
+ "\u5982 loadSkill \u4E0D\u53EF\u7528\u6216\u60F3\u76F4\u63A5\u8BFB\u53D6\u6587\u4EF6\uFF0C\u4E0B\u65B9 path \u4ECD\u53EF\u7528 readFile \u4F5C\u4E3A fallback\uFF1A",
164
86
  "",
165
87
  ...skills.map(
166
88
  (s) => `- ${s.name}: ${s.description}
@@ -216,8 +138,6 @@ var buildMemoryUseGuidanceLayer = (args) => {
216
138
  };
217
139
 
218
140
  export {
219
- buildModelLayerOverride,
220
- applyModelLayerOverride,
221
141
  buildSpaceContextLayer,
222
142
  buildSkillDiscoveryLayer,
223
143
  buildLinkedSpacesSection,
@@ -1,3 +1,11 @@
1
+ // packages/core/drainReason.ts
2
+ var CORE_DRAIN_REASON = "core_draining";
3
+
4
+ // packages/core/gatewayHttpStatus.ts
5
+ function isGatewayHttpStatus(status) {
6
+ return status === 502 || status === 503 || status === 504;
7
+ }
8
+
1
9
  // packages/core/retryAfterMs.ts
2
10
  function normalizeNonNegativeMs(value, fallbackMs) {
3
11
  const parsed = Number(value);
@@ -18,13 +26,9 @@ function parseRetryAfterHeaderMs(value, nowMs = Date.now()) {
18
26
  return null;
19
27
  }
20
28
 
21
- // packages/core/gatewayHttpStatus.ts
22
- function isGatewayHttpStatus(status) {
23
- return status === 502 || status === 503 || status === 504;
24
- }
25
-
26
29
  export {
30
+ CORE_DRAIN_REASON,
31
+ isGatewayHttpStatus,
27
32
  normalizeNonNegativeMs,
28
- parseRetryAfterHeaderMs,
29
- isGatewayHttpStatus
33
+ parseRetryAfterHeaderMs
30
34
  };
@@ -2,7 +2,7 @@ import {
2
2
  deleteDbRecord,
3
3
  queryUserRecords,
4
4
  readDbRecord
5
- } from "./chunk-7OOXPE3N.js";
5
+ } from "./chunk-AEZAORLG.js";
6
6
  import {
7
7
  mergeAndDedupUserData
8
8
  } from "./chunk-KQHGZWSV.js";
@@ -1,16 +1,23 @@
1
- import {
2
- chooseMemoryOwners,
3
- loadMemoryCandidatesFromDb
4
- } from "./chunk-Q2YZULBH.js";
5
1
  import {
6
2
  addContentToSpace,
7
3
  prepareAndPersistMessage,
8
4
  uiAskChoiceFunc,
9
5
  uiAskChoiceFunctionSchema
10
- } from "./chunk-ZIG5LJ7X.js";
6
+ } from "./chunk-5MOUAAMK.js";
11
7
  import {
12
8
  require_date_fns
13
9
  } from "./chunk-M76ECQRD.js";
10
+ import {
11
+ read,
12
+ readAndWait,
13
+ removeCachedEntity,
14
+ upsertSSREntity,
15
+ write
16
+ } from "./chunk-O26GI2JP.js";
17
+ import {
18
+ chooseMemoryOwners,
19
+ loadMemoryCandidatesFromDb
20
+ } from "./chunk-XENYHRUE.js";
14
21
  import {
15
22
  PLATFORM_HOSTED_GLM_52_MODEL,
16
23
  PLATFORM_HOSTED_GLM_PRICE
@@ -18,37 +25,30 @@ import {
18
25
  import {
19
26
  PLATFORM_HOSTED_KIMI_PROVIDER
20
27
  } from "./chunk-IWX4UW2E.js";
21
- import {
22
- extractCustomId
23
- } from "./chunk-DFFIZ25G.js";
24
- import {
25
- read,
26
- readAndWait,
27
- removeCachedEntity,
28
- upsertSSREntity,
29
- write
30
- } from "./chunk-COMXDWNM.js";
31
28
  import {
32
29
  createAgentKey,
33
30
  createDialogKey,
34
31
  createKey,
35
32
  dialogMessageRange
36
- } from "./chunk-SH2CFQOH.js";
33
+ } from "./chunk-O4BU24WZ.js";
34
+ import {
35
+ extractCustomId
36
+ } from "./chunk-DFFIZ25G.js";
37
37
  import {
38
38
  selectIdentityUserId
39
- } from "./chunk-EYEEHCU4.js";
39
+ } from "./chunk-OOM6SJNR.js";
40
40
  import {
41
41
  asTrimmedString
42
42
  } from "./chunk-3EUW3WEO.js";
43
43
  import {
44
44
  asOptionalPositiveFiniteNumber
45
45
  } from "./chunk-U6VC4MU4.js";
46
- import {
47
- asOptionalTrimmedString
48
- } from "./chunk-G3SUCT4W.js";
49
46
  import {
50
47
  isRecord
51
48
  } from "./chunk-KUG52IAP.js";
49
+ import {
50
+ asOptionalTrimmedString
51
+ } from "./chunk-G3SUCT4W.js";
52
52
  import {
53
53
  __toESM
54
54
  } from "./chunk-4VNS5WPM.js";