nolo-cli 0.10.0 → 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 (106) hide show
  1. package/{_executeModel-YAXYAUOK.js → _executeModel-ZEDPX6OF.js} +47 -45
  2. package/{action-TLI3V62L.js → action-AA4IJ5K2.js} +9 -9
  3. package/{addContentAction-PLWJSCOZ.js → addContentAction-QYVO4SYP.js} +8 -8
  4. package/{addDialogAgentAction-BJ6SB76X.js → addDialogAgentAction-WVVKT5WQ.js} +10 -10
  5. package/{agentDeleteCommand-2VYX73U5.js → agentDeleteCommand-RDPGYIWF.js} +25 -25
  6. package/{agentEmailCommands-3GDZIX64.js → agentEmailCommands-2HJJKS5F.js} +59 -56
  7. package/{agentListCommands-UWVBT3LH.js → agentListCommands-HFEVV3ZW.js} +30 -29
  8. package/{agentMachineCommands-WOKMUG2Y.js → agentMachineCommands-25ZOENJU.js} +28 -28
  9. package/{agentRecordCommands-MVNZRH3U.js → agentRecordCommands-GTCOAM3L.js} +50 -47
  10. package/{agentRunCommand-K7THIJLA.js → agentRunCommand-YBS3JDLD.js} +57 -53
  11. package/{agentRuntimeLocal-WJIGU24U.js → agentRuntimeLocal-UQBMQI2M.js} +11 -11
  12. package/{agentSlice-LL5TKZEO.js → agentSlice-6EKOBCCS.js} +9 -9
  13. package/{authCommand-TC2SW2CQ.js → authCommand-O2OWACN4.js} +12 -12
  14. package/{authCommands-XPEHTKSM.js → authCommands-H7365TZP.js} +6 -6
  15. package/{chunk-TYSCFY6S.js → chunk-2W2VYVI5.js} +334 -90
  16. package/{chunk-4SIMLBEU.js → chunk-3NSIQZZ6.js} +3 -3
  17. package/{chunk-AUQ747NZ.js → chunk-4SOKXIW4.js} +70 -6
  18. package/{chunk-PIVFPOW6.js → chunk-5MOUAAMK.js} +75 -71
  19. package/{chunk-A67QFHAA.js → chunk-5OIFWVX7.js} +1 -1
  20. package/{chunk-5JGGZCZL.js → chunk-7D3JY6C2.js} +2 -2
  21. package/{chunk-OR2XR25C.js → chunk-AEZAORLG.js} +4 -4
  22. package/chunk-AFON4QUU.js +112 -0
  23. package/{chunk-6KUOUWMP.js → chunk-BX6U3ETE.js} +19 -12
  24. package/{chunk-CDTLMEB3.js → chunk-C2MDQQ4O.js} +1 -1
  25. package/{chunk-SL35K7AH.js → chunk-C4FTUXVF.js} +2 -82
  26. package/{chunk-GAKEBQD6.js → chunk-D6OQHXVG.js} +11 -7
  27. package/{chunk-WPE4F4Z6.js → chunk-DWGAEFJL.js} +1 -1
  28. package/{chunk-HJGEVL7C.js → chunk-E4HNJSHC.js} +19 -19
  29. package/{chunk-TNPIMII7.js → chunk-EVZKZF32.js} +72 -39
  30. package/{chunk-C3RUNRHT.js → chunk-FXXSGWAJ.js} +1 -1
  31. package/{chunk-7KNKFIRO.js → chunk-GBDSZATH.js} +3 -3
  32. package/{chunk-7U44LYTR.js → chunk-IPYUUY4E.js} +1 -1
  33. package/{chunk-QAALPJS7.js → chunk-KJR5KAUQ.js} +2 -2
  34. package/{chunk-OZMMKDBI.js → chunk-KQQVGRA3.js} +23 -23
  35. package/{chunk-AVMKZHBC.js → chunk-L53FGHA4.js} +3 -2
  36. package/{chunk-CL3IOKGK.js → chunk-LAX2JSTX.js} +2 -2
  37. package/{chunk-NPVBXJY2.js → chunk-LP65VRCI.js} +5 -5
  38. package/chunk-LTRXGFMS.js +83 -0
  39. package/{chunk-KBKYAONQ.js → chunk-MQI77IRB.js} +2 -2
  40. package/{chunk-HFASY3WO.js → chunk-NEM67FX7.js} +1 -1
  41. package/{chunk-BE2OOJ5P.js → chunk-O26GI2JP.js} +8 -8
  42. package/{chunk-PAKN26FP.js → chunk-OUI3ZHYD.js} +1 -1
  43. package/{chunk-2O4IZNTG.js → chunk-PXQN7IBQ.js} +2 -2
  44. package/{chunk-4IJYA27C.js → chunk-PXZAAB4L.js} +4 -4
  45. package/{chunk-I5URP43I.js → chunk-Q3UKJVU4.js} +9 -9
  46. package/{chunk-AS4PVWA4.js → chunk-QNMFBBZK.js} +1 -1
  47. package/{chunk-6SLCD4RB.js → chunk-S3GS2PRL.js} +10 -10
  48. package/{chunk-T7R3NGUU.js → chunk-SV5MWASH.js} +16 -16
  49. package/{chunk-6JJWFVZ6.js → chunk-TACHTH5D.js} +15 -15
  50. package/chunk-VC6OZXO5.js +298 -0
  51. package/{chunk-ZQ2UM4KG.js → chunk-WZSRQNQG.js} +1 -292
  52. package/{chunk-EXXFGKF7.js → chunk-X2S7JTIG.js} +222 -45
  53. package/{chunk-DSZUWUYB.js → chunk-XFOLQLDN.js} +1 -1
  54. package/{chunk-YIHFXH5Q.js → chunk-XYZA7S7V.js} +6 -6
  55. package/{chunk-3Y3HW5PX.js → chunk-ZEYDOXHF.js} +105 -126
  56. package/{chunk-5KLGBAAR.js → chunk-ZPRK73XY.js} +1 -1
  57. package/{cliExecutor-DNE7TCC4.js → cliExecutor-K3F7DMRO.js} +2 -2
  58. package/{createAgentAutomationAction-CCE7CWGQ.js → createAgentAutomationAction-LTI5QU35.js} +21 -21
  59. package/{createDialogAction-QTRR4AT7.js → createDialogAction-OJJ7L3L3.js} +23 -22
  60. package/{createPageAction-Y4KQOAJE.js → createPageAction-5MXWVRGY.js} +26 -25
  61. package/{dbSlice-WWNV2SGX.js → dbSlice-RQFQQVHT.js} +7 -7
  62. package/{deleteFile-OW53A6BX.js → deleteFile-7XP5BGC7.js} +5 -5
  63. package/{dialogCommands-SMKIAC3Y.js → dialogCommands-JTJ3RPPW.js} +21 -21
  64. package/{dialogSlice-PT7YBWNE.js → dialogSlice-OWROKURJ.js} +19 -19
  65. package/{docCreateCommands-RFNA4HNM.js → docCreateCommands-WJBEW2V7.js} +22 -21
  66. package/{docDeleteCommands-4YZ325M6.js → docDeleteCommands-BVEHJOY5.js} +24 -23
  67. package/{docReadCommands-RT6VAFFG.js → docReadCommands-NEWOZIJV.js} +22 -21
  68. package/{docStore-QUQZAFZF.js → docStore-3DXRYBMD.js} +20 -20
  69. package/{docUpdateCommands-EKKKNYPW.js → docUpdateCommands-C7WHT7UU.js} +22 -21
  70. package/fetchMessages-KTNM7QAR.js +1 -1
  71. package/{handleSendMessageAction-5NSYAS53.js → handleSendMessageAction-B5PRR7BE.js} +24 -24
  72. package/index.js +58 -58
  73. package/{localDialogRead-2VRI24F4.js → localDialogRead-YSKFFRTT.js} +1 -1
  74. package/{machineCommands-DOOSIUKG.js → machineCommands-IIIREAEK.js} +64 -59
  75. package/{machineWsRunDispatch-PIOIQRBW.js → machineWsRunDispatch-3SIU6ILW.js} +49 -46
  76. package/package.json +1 -1
  77. package/{read-GW7ZEI23.js → read-QJNKRROM.js} +5 -5
  78. package/{readDocTool-HUFU6OCT.js → readDocTool-H6X6KO6X.js} +1 -1
  79. package/{readlineWorkspace-QEAOH5EP.js → readlineWorkspace-HGP3I3OC.js} +80 -67
  80. package/{removeDialogAgentAction-OHMCNSSD.js → removeDialogAgentAction-TCT35SOF.js} +12 -12
  81. package/{runAgentClientLoop-AIGLXC3R.js → runAgentClientLoop-EFM4PTVI.js} +43 -41
  82. package/{setDialogExtraReferencesAction-YJUM5BWQ.js → setDialogExtraReferencesAction-CGYLZMFH.js} +10 -10
  83. package/{setPrimaryDialogAgentAction-EBAREZDM.js → setPrimaryDialogAgentAction-F6BFQDJU.js} +12 -12
  84. package/{settingSlice-UW4IUI5L.js → settingSlice-2I5HMG47.js} +8 -8
  85. package/skillDiscovery-UGSQGX2U.js +16 -0
  86. package/{spaceCommands-BKHSPR73.js → spaceCommands-MT7BWCIL.js} +27 -27
  87. package/{spaceSlice-TYNWE3OC.js → spaceSlice-BS5TSW3W.js} +19 -19
  88. package/{streamAgentChatTurn-HRMFFA7E.js → streamAgentChatTurn-I3VBFNR3.js} +82 -78
  89. package/{tableCommands-O7O2LBEG.js → tableCommands-M3DJUETS.js} +10 -10
  90. package/{toolApiClient-QI3YBNWB.js → toolApiClient-C7P7YSE4.js} +2 -2
  91. package/{tools-3JNDS3WH.js → tools-XSD2BOEN.js} +31 -29
  92. package/{tuiSummaryLlmCaller-RV3THLZF.js → tuiSummaryLlmCaller-32NRHTT2.js} +3 -3
  93. package/{updateDialogTitleAction-OCETSKCP.js → updateDialogTitleAction-7FYNJOGP.js} +22 -22
  94. package/{agentPullCommand-O2MTUAFR.js → agentPullCommand-GOL2S4W2.js} +1 -1
  95. package/{chunk-DZ3XJVET.js → chunk-3QAF2LTL.js} +3 -3
  96. package/{chunk-EHLHSX7R.js → chunk-5MMZUWSG.js} +3 -3
  97. package/{chunk-X7W4TNB4.js → chunk-CMKUBIGW.js} +3 -3
  98. package/{chunk-4CQLVGRV.js → chunk-ID4G2MAR.js} +3 -3
  99. package/{chunk-5MIDPSSK.js → chunk-JK7VW2FN.js} +3 -3
  100. package/{chunk-UTLZINAP.js → chunk-OOM6SJNR.js} +9 -9
  101. package/{chunk-VVX233PH.js → chunk-PNEW2Z3T.js} +9 -9
  102. package/{chunk-TILFE6LV.js → chunk-YOCHZD7D.js} +3 -3
  103. package/{chunk-JRKKFRAV.js → chunk-YTBMA7NO.js} +3 -3
  104. package/{db-HCJ5PRB5.js → db-6QED3ZVO.js} +3 -3
  105. package/{runtimeDoctorCommands-LRHLPDRC.js → runtimeDoctorCommands-ID43Z7VX.js} +3 -3
  106. package/{understanding-3CUQQ6SV.js → understanding-ZOESBLF3.js} +3 -3
@@ -7,7 +7,7 @@ import {
7
7
  toTimestampMs,
8
8
  upsert,
9
9
  write
10
- } from "./chunk-BE2OOJ5P.js";
10
+ } from "./chunk-O26GI2JP.js";
11
11
  import {
12
12
  asRecordOrEmpty
13
13
  } from "./chunk-KX6YBIHG.js";
@@ -21,7 +21,7 @@ import {
21
21
  } from "./chunk-QSJ3HFEF.js";
22
22
  import {
23
23
  BUILTIN_NOLO_AGENT_KEY
24
- } from "./chunk-DSZUWUYB.js";
24
+ } from "./chunk-XFOLQLDN.js";
25
25
  import {
26
26
  asyncThunkCreator,
27
27
  buildCreateSlice,
@@ -29,7 +29,7 @@ import {
29
29
  createAsyncThunk,
30
30
  createSelector,
31
31
  selectIdentityUserId
32
- } from "./chunk-UTLZINAP.js";
32
+ } from "./chunk-OOM6SJNR.js";
33
33
  import {
34
34
  getAllServers,
35
35
  getIsDesktopApp,
@@ -8,12 +8,12 @@ import {
8
8
  import {
9
9
  asOptionalFiniteNumber
10
10
  } from "./chunk-WWC7I6TA.js";
11
- import {
12
- asOptionalTrimmedString
13
- } from "./chunk-G3SUCT4W.js";
14
11
  import {
15
12
  isRecord
16
13
  } from "./chunk-KUG52IAP.js";
14
+ import {
15
+ asOptionalTrimmedString
16
+ } from "./chunk-G3SUCT4W.js";
17
17
 
18
18
  // packages/agent-runtime/toolNameAliases.ts
19
19
  var LEGACY_TOOL_NAME_ALIASES = {
@@ -102,6 +102,7 @@ var DEFAULT_PRIVATE_NOLO_WORKSPACE_TOOLS = [
102
102
  "readSpace",
103
103
  "readDoc",
104
104
  "readSkillDoc",
105
+ "loadSkill",
105
106
  "listTables",
106
107
  "queryTableRows",
107
108
  "cliWhoami",
@@ -388,6 +389,7 @@ var NOLO_WORKSPACE_TOOL_NAMES = [
388
389
  "readSpace",
389
390
  "readDoc",
390
391
  "readSkillDoc",
392
+ "loadSkill",
391
393
  "listTables",
392
394
  "queryTableRows",
393
395
  "cliWhoami",
@@ -458,6 +460,10 @@ function buildNoloWorkspaceOpenAiTools(args) {
458
460
  add("listAgents", "List the current user's agents in the Nolo workspace.", {
459
461
  space: stringToolParam("Optional space id or URL."),
460
462
  publicOnly: { type: "boolean", description: "Only show public agents." }
463
+ // 端间差异(LOW-R2-3):CLI 命令 `nolo agent list` 无 --limit(parseAgentListArgs
464
+ // 仅支持 --json/--public-only/--ids-only),本地缓存全量列出;web 端
465
+ // listAgentsFunc 另有 limit(默认 100,最大 500)。如后续对齐需在
466
+ // parseAgentListArgs / agentListCommands 增加 --limit 透传。
461
467
  });
462
468
  add("readAgent", "Read one agent config in the Nolo workspace.", {
463
469
  agent: stringToolParam("Agent key, id, alias, or URL.")
@@ -474,6 +480,9 @@ function buildNoloWorkspaceOpenAiTools(args) {
474
480
  add("readSkillDoc", "Read one skill doc in the Nolo workspace.", {
475
481
  doc: stringToolParam("Skill doc/page key.")
476
482
  }, ["doc"]);
483
+ add("loadSkill", "Load a Skill by name from the workspace skill directories (.agents/skills/<name>/SKILL.md, then docs/skills/<name>.md) and return its full SKILL.md content inline so you can follow its instructions. Use this instead of readFile when you want to activate a skill. On an unknown name the tool returns a plain text list of available skill names rather than failing.", {
484
+ name: stringToolParam("Skill name (the name advertised in the skill-discovery layer).")
485
+ }, ["name"]);
477
486
  add("listTables", "List tables in the current user scope or an optional space scope.", {
478
487
  limit: { type: "integer", description: "Maximum tables to return." },
479
488
  space: stringToolParam("Optional space id or URL."),
@@ -791,13 +800,15 @@ function buildNoloWorkspaceCommandArgs(call) {
791
800
  case "readDoc": {
792
801
  const doc = noloStringArg(args.doc ?? args.docKey ?? args.pageKey ?? args.key);
793
802
  if (!doc) throw new Error("readDoc requires doc.");
794
- return ["doc", "read", doc];
803
+ return doc.startsWith("page-") ? ["doc", "read", "--key", doc] : ["doc", "read", "--id", doc];
795
804
  }
796
805
  case "readSkillDoc": {
797
806
  const doc = noloStringArg(args.doc ?? args.docKey ?? args.pageKey ?? args.key);
798
807
  if (!doc) throw new Error("readSkillDoc requires doc.");
799
- return ["skill-doc", "read", doc];
808
+ return doc.startsWith("page-") ? ["skill-doc", "read", "--key", doc] : ["skill-doc", "read", "--id", doc];
800
809
  }
810
+ case "loadSkill":
811
+ throw new Error("loadSkill is a local-fs tool and has no CLI mapping; wire buildLoadSkillExecutor instead.");
801
812
  case "listTables": {
802
813
  const cliArgs = ["table", "list"];
803
814
  const limit = noloPositiveIntegerString(args.limit);
@@ -868,10 +879,62 @@ async function runNoloWorkspaceCliTool(call, args) {
868
879
  function buildNoloWorkspaceCliToolExecutors(args) {
869
880
  const executors = {};
870
881
  for (const toolName of NOLO_WORKSPACE_TOOL_NAMES) {
882
+ if (toolName === "loadSkill") continue;
871
883
  executors[toolName] = (call) => runNoloWorkspaceCliTool(call, args);
872
884
  }
873
885
  return executors;
874
886
  }
887
+ function buildLoadSkillExecutor(args) {
888
+ return async (call) => {
889
+ const parsed = parseNoloWorkspaceToolArguments(call.arguments);
890
+ const name = noloStringArg(parsed.name ?? parsed.skillName ?? parsed.skill);
891
+ if (!name) {
892
+ return {
893
+ content: await formatUnknownSkillMessage(args.cwd, "(no name provided)"),
894
+ metadata: { loadSkill: true, resolved: false }
895
+ };
896
+ }
897
+ const { resolveSkillByName } = await import("./skillDiscovery-UGSQGX2U.js");
898
+ const resolved = resolveSkillByName(args.cwd, name);
899
+ if (!resolved) {
900
+ return {
901
+ content: await formatUnknownSkillMessage(args.cwd, name),
902
+ metadata: { loadSkill: true, resolved: false, name, requestedName: name }
903
+ };
904
+ }
905
+ try {
906
+ const { readFileSync } = await import("node:fs");
907
+ const body = readFileSync(resolved, "utf8");
908
+ return {
909
+ content: `Skill "${name}" loaded inline. Follow its instructions.
910
+
911
+ ${body}`,
912
+ metadata: { loadSkill: true, resolved: true, name, requestedName: name, path: resolved }
913
+ };
914
+ } catch (err) {
915
+ const message = err instanceof Error ? err.message : String(err);
916
+ return {
917
+ content: `Skill "${name}" could not be read: ${message}`,
918
+ metadata: { loadSkill: true, resolved: true, name, requestedName: name, path: resolved, readError: message }
919
+ };
920
+ }
921
+ };
922
+ }
923
+ async function formatUnknownSkillMessage(cwd, requestedName) {
924
+ const { discoverSkills } = await import("./skillDiscovery-UGSQGX2U.js");
925
+ let available = [];
926
+ try {
927
+ available = discoverSkills(cwd).map((s) => s.name);
928
+ } catch {
929
+ }
930
+ const header = `Skill "${requestedName}" not found in this workspace's skill directories (.agents/skills/<name>/SKILL.md, docs/skills/<name>.md).`;
931
+ if (available.length === 0) return `${header}
932
+
933
+ No skills were discovered in this workspace.`;
934
+ return `${header}
935
+
936
+ Available skills: ${available.join(", ")}`;
937
+ }
875
938
  var nodeSpawnFallback = (options) => {
876
939
  return spawnToWebStreams({ cmd: options.cmd, env: options.env });
877
940
  };
@@ -898,5 +961,6 @@ export {
898
961
  filterNoloDialogSubjectRefEvidence,
899
962
  verifyNoloDialogSubjectRefQuery,
900
963
  buildNoloTableQueryRequest,
901
- buildNoloWorkspaceCliToolExecutors
964
+ buildNoloWorkspaceCliToolExecutors,
965
+ buildLoadSkillExecutor
902
966
  };
@@ -15,10 +15,10 @@ import {
15
15
  import {
16
16
  deleteServerSyncedCredential,
17
17
  runLlm
18
- } from "./chunk-I5URP43I.js";
18
+ } from "./chunk-Q3UKJVU4.js";
19
19
  import {
20
20
  cleanupCliSessionForDialog
21
- } from "./chunk-7KNKFIRO.js";
21
+ } from "./chunk-GBDSZATH.js";
22
22
  import {
23
23
  getDialogAgentIds,
24
24
  getPrimaryDialogAgentId
@@ -26,6 +26,13 @@ import {
26
26
  import {
27
27
  require_date_fns
28
28
  } from "./chunk-M76ECQRD.js";
29
+ import {
30
+ isSystemAdmin,
31
+ nolotusId,
32
+ selectRemoteServer,
33
+ selectRemoteServers,
34
+ selectRemoteSyncServers
35
+ } from "./chunk-3NSIQZZ6.js";
29
36
  import {
30
37
  fetchMessages
31
38
  } from "./chunk-SOTZ6RDN.js";
@@ -34,53 +41,11 @@ import {
34
41
  addContentAction,
35
42
  checkSpaceMembership,
36
43
  localSpaceAuthorityPatchStamp
37
- } from "./chunk-5JGGZCZL.js";
44
+ } from "./chunk-7D3JY6C2.js";
38
45
  import {
39
46
  createSpaceKey,
40
47
  normalizeSpaceId
41
48
  } from "./chunk-UAD2WT54.js";
42
- import {
43
- ALL_MODELS
44
- } from "./chunk-DCOA4QSN.js";
45
- import {
46
- MODEL_LOOKUP_MAP,
47
- findModelConfig,
48
- getModelConfig
49
- } from "./chunk-BBYVOSU2.js";
50
- import {
51
- createFileCredentialBroker
52
- } from "./chunk-5CS33IBL.js";
53
- import {
54
- extractCustomId,
55
- extractUserId
56
- } from "./chunk-DFFIZ25G.js";
57
- import {
58
- abortActiveControllers,
59
- addPageReferenceToRuntime,
60
- applyClearDialogStateRuntime,
61
- applyUpdateTokensFulfilled,
62
- clearActiveControllers,
63
- clearPendingAttachments,
64
- clearPendingUserInputQueue,
65
- deleteDialogRuntime,
66
- getActiveDialogKey,
67
- getDialogRuntimeTokens,
68
- require_react,
69
- resetDialogRuntimeSessionState,
70
- selectCurrentDialogKey,
71
- setActiveDialogKey,
72
- setDialogConfigError
73
- } from "./chunk-3ASDTTEI.js";
74
- import {
75
- toErrorMessage
76
- } from "./chunk-HNMXYYJR.js";
77
- import {
78
- isSystemAdmin,
79
- nolotusId,
80
- selectRemoteServer,
81
- selectRemoteServers,
82
- selectRemoteSyncServers
83
- } from "./chunk-4SIMLBEU.js";
84
49
  import {
85
50
  patch,
86
51
  read,
@@ -93,10 +58,21 @@ import {
93
58
  uploadFileAction,
94
59
  upsertSSREntity,
95
60
  write
96
- } from "./chunk-BE2OOJ5P.js";
61
+ } from "./chunk-O26GI2JP.js";
97
62
  import {
98
63
  resolveFileCategory
99
64
  } from "./chunk-AZPCASRE.js";
65
+ import {
66
+ ALL_MODELS
67
+ } from "./chunk-DCOA4QSN.js";
68
+ import {
69
+ MODEL_LOOKUP_MAP,
70
+ findModelConfig,
71
+ getModelConfig
72
+ } from "./chunk-BBYVOSU2.js";
73
+ import {
74
+ createFileCredentialBroker
75
+ } from "./chunk-5CS33IBL.js";
100
76
  import {
101
77
  asRecordOrEmpty
102
78
  } from "./chunk-KX6YBIHG.js";
@@ -132,12 +108,36 @@ import {
132
108
  import {
133
109
  asOptionalFiniteNumber
134
110
  } from "./chunk-WWC7I6TA.js";
111
+ import {
112
+ extractCustomId,
113
+ extractUserId
114
+ } from "./chunk-DFFIZ25G.js";
115
+ import {
116
+ abortActiveControllers,
117
+ addPageReferenceToRuntime,
118
+ applyClearDialogStateRuntime,
119
+ applyUpdateTokensFulfilled,
120
+ clearActiveControllers,
121
+ clearPendingAttachments,
122
+ clearPendingUserInputQueue,
123
+ deleteDialogRuntime,
124
+ getActiveDialogKey,
125
+ getDialogRuntimeTokens,
126
+ require_react,
127
+ resetDialogRuntimeSessionState,
128
+ selectCurrentDialogKey,
129
+ setActiveDialogKey,
130
+ setDialogConfigError
131
+ } from "./chunk-3ASDTTEI.js";
135
132
  import {
136
133
  asTrimmedLowercaseString
137
134
  } from "./chunk-QSJ3HFEF.js";
135
+ import {
136
+ toErrorMessage
137
+ } from "./chunk-HNMXYYJR.js";
138
138
  import {
139
139
  readAction
140
- } from "./chunk-DSZUWUYB.js";
140
+ } from "./chunk-XFOLQLDN.js";
141
141
  import {
142
142
  DEVICE_LOCAL_OWNER_ID,
143
143
  asyncThunkCreator,
@@ -158,7 +158,7 @@ import {
158
158
  selectIdentityToken,
159
159
  selectIdentityUserId,
160
160
  selectRuntimeSnapshot
161
- } from "./chunk-UTLZINAP.js";
161
+ } from "./chunk-OOM6SJNR.js";
162
162
  import {
163
163
  createClientLogger,
164
164
  fetchFromServer,
@@ -172,25 +172,25 @@ import {
172
172
  isTombstoneRecord,
173
173
  shouldReplaceWithNextRecord
174
174
  } from "./chunk-GBRG75BQ.js";
175
- import {
176
- API_ENDPOINTS,
177
- API_VERSION
178
- } from "./chunk-LCBAMY2M.js";
179
175
  import {
180
176
  asTrimmedString
181
177
  } from "./chunk-3EUW3WEO.js";
182
178
  import {
183
179
  asOptionalPositiveFiniteNumber
184
180
  } from "./chunk-U6VC4MU4.js";
181
+ import {
182
+ isRecord
183
+ } from "./chunk-KUG52IAP.js";
184
+ import {
185
+ API_ENDPOINTS,
186
+ API_VERSION
187
+ } from "./chunk-LCBAMY2M.js";
185
188
  import {
186
189
  normalizeServerOrigin
187
190
  } from "./chunk-CF7PE763.js";
188
191
  import {
189
192
  asOptionalTrimmedString
190
193
  } from "./chunk-G3SUCT4W.js";
191
- import {
192
- isRecord
193
- } from "./chunk-KUG52IAP.js";
194
194
  import {
195
195
  __commonJS,
196
196
  __require,
@@ -11385,6 +11385,10 @@ function buildFallbackActivity(toolName, args) {
11385
11385
  refs: [{ type: "file", path }]
11386
11386
  };
11387
11387
  }
11388
+ case "loadSkill": {
11389
+ const name = asTrimmedString(args.name);
11390
+ return name ? { title: "\u52A0\u8F7D\u6280\u80FD", detail: name } : void 0;
11391
+ }
11388
11392
  case "execShell": {
11389
11393
  const command = asTrimmedString(
11390
11394
  typeof args.cmd === "string" ? args.cmd : args.command
@@ -11812,7 +11816,7 @@ async function captureUnderstandingFromCompletedUiTurn(input) {
11812
11816
  if (!input.agentKey) return;
11813
11817
  const latestUserInput = getLatestUserInputFromMessages(input.messages);
11814
11818
  if (!latestUserInput) return;
11815
- const { captureUnderstandingMemoryFromDialog } = await import("./understanding-3CUQQ6SV.js");
11819
+ const { captureUnderstandingMemoryFromDialog } = await import("./understanding-ZOESBLF3.js");
11816
11820
  await captureUnderstandingMemoryFromDialog({
11817
11821
  db: input.db,
11818
11822
  userId: selectIdentityUserId(input.state),
@@ -12737,7 +12741,7 @@ var messageSlice = createSliceWithThunks({
12737
12741
  runtimeOptions: args.runtimeOptions
12738
12742
  });
12739
12743
  if (agentKeyToUse) {
12740
- const { streamAgentChatTurn } = await import("./agentSlice-LL5TKZEO.js");
12744
+ const { streamAgentChatTurn } = await import("./agentSlice-6EKOBCCS.js");
12741
12745
  await dispatch(
12742
12746
  streamAgentChatTurn({
12743
12747
  agentKey: agentKeyToUse,
@@ -15371,7 +15375,7 @@ var deleteOwnedDialogAttachments = async (args) => {
15371
15375
  metadataReadFailures
15372
15376
  });
15373
15377
  if (!plan.deleteCandidates.length) return plan;
15374
- const { deleteFileAction } = await import("./deleteFile-OW53A6BX.js");
15378
+ const { deleteFileAction } = await import("./deleteFile-7XP5BGC7.js");
15375
15379
  for (const candidate of plan.deleteCandidates) {
15376
15380
  if (candidate.fileDbKey) {
15377
15381
  await deleteFileAction(candidate.fileDbKey, args.thunkApi);
@@ -15433,7 +15437,7 @@ var deleteDialogThunk = async (payload, thunkApi) => {
15433
15437
  }
15434
15438
  if (isCurrentDialog) {
15435
15439
  await thunkApi.dispatch(resetMsgs());
15436
- const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-PT7YBWNE.js");
15440
+ const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-OWROKURJ.js");
15437
15441
  dispatch(clearPendingAttachments2());
15438
15442
  clearWorkflow();
15439
15443
  }
@@ -15442,35 +15446,35 @@ var deleteDialogThunk = async (payload, thunkApi) => {
15442
15446
 
15443
15447
  // packages/chat/dialog/dialogSlice.ts
15444
15448
  var runCreateDialogAction = async (args, thunkApi) => {
15445
- const { createDialogAction } = await import("./createDialogAction-QTRR4AT7.js");
15449
+ const { createDialogAction } = await import("./createDialogAction-OJJ7L3L3.js");
15446
15450
  return createDialogAction(args, thunkApi);
15447
15451
  };
15448
15452
  var runCreateAgentAutomationAction = async (args, thunkApi) => {
15449
- const { createAgentAutomationAction } = await import("./createAgentAutomationAction-CCE7CWGQ.js");
15453
+ const { createAgentAutomationAction } = await import("./createAgentAutomationAction-LTI5QU35.js");
15450
15454
  return createAgentAutomationAction(args, thunkApi);
15451
15455
  };
15452
15456
  var runUpdateDialogTitleAction = async (args, thunkApi) => {
15453
- const { updateDialogTitleAction } = await import("./updateDialogTitleAction-OCETSKCP.js");
15457
+ const { updateDialogTitleAction } = await import("./updateDialogTitleAction-7FYNJOGP.js");
15454
15458
  return updateDialogTitleAction(args, thunkApi);
15455
15459
  };
15456
15460
  var runAddDialogAgentAction = async (args, thunkApi) => {
15457
- const { addDialogAgentAction } = await import("./addDialogAgentAction-BJ6SB76X.js");
15461
+ const { addDialogAgentAction } = await import("./addDialogAgentAction-WVVKT5WQ.js");
15458
15462
  return addDialogAgentAction(args, thunkApi);
15459
15463
  };
15460
15464
  var runRemoveDialogAgentAction = async (args, thunkApi) => {
15461
- const { removeDialogAgentAction } = await import("./removeDialogAgentAction-OHMCNSSD.js");
15465
+ const { removeDialogAgentAction } = await import("./removeDialogAgentAction-TCT35SOF.js");
15462
15466
  return removeDialogAgentAction(args, thunkApi);
15463
15467
  };
15464
15468
  var runSetPrimaryDialogAgentAction = async (args, thunkApi) => {
15465
- const { setPrimaryDialogAgentAction } = await import("./setPrimaryDialogAgentAction-EBAREZDM.js");
15469
+ const { setPrimaryDialogAgentAction } = await import("./setPrimaryDialogAgentAction-F6BFQDJU.js");
15466
15470
  return setPrimaryDialogAgentAction(args, thunkApi);
15467
15471
  };
15468
15472
  var runSetDialogExtraReferencesAction = async (args, thunkApi) => {
15469
- const { setDialogExtraReferencesAction } = await import("./setDialogExtraReferencesAction-YJUM5BWQ.js");
15473
+ const { setDialogExtraReferencesAction } = await import("./setDialogExtraReferencesAction-CGYLZMFH.js");
15470
15474
  return setDialogExtraReferencesAction(args, thunkApi);
15471
15475
  };
15472
15476
  var runHandleSendMessageAction = async (args, thunkApi) => {
15473
- const { handleSendMessageAction } = await import("./handleSendMessageAction-5NSYAS53.js");
15477
+ const { handleSendMessageAction } = await import("./handleSendMessageAction-B5PRR7BE.js");
15474
15478
  return handleSendMessageAction(args, thunkApi);
15475
15479
  };
15476
15480
  function clearDialogState() {
@@ -15483,7 +15487,7 @@ var createPageAndAddReference = createAsyncThunk(
15483
15487
  async (payload, { dispatch, getState, rejectWithValue }) => {
15484
15488
  const { slateData, jsonData, title, type, fileId, groupId, dialogKey } = payload;
15485
15489
  try {
15486
- const { createDocState } = await import("./docStore-QUQZAFZF.js");
15490
+ const { createDocState } = await import("./docStore-3DXRYBMD.js");
15487
15491
  const pageKey = await createDocState(
15488
15492
  { slateData, title },
15489
15493
  { dispatch, getState }
@@ -19440,11 +19444,11 @@ var ENTITY_DELETE_STRATEGIES = {
19440
19444
  await dispatch(deleteTable({ dbKey: key })).unwrap();
19441
19445
  },
19442
19446
  file: async (key, { thunkAPI }) => {
19443
- const { deleteFileAction } = await import("./deleteFile-OW53A6BX.js");
19447
+ const { deleteFileAction } = await import("./deleteFile-7XP5BGC7.js");
19444
19448
  await deleteFileAction(key, thunkAPI);
19445
19449
  },
19446
19450
  image: async (key, { thunkAPI }) => {
19447
- const { deleteFileAction } = await import("./deleteFile-OW53A6BX.js");
19451
+ const { deleteFileAction } = await import("./deleteFile-7XP5BGC7.js");
19448
19452
  await deleteFileAction(key, thunkAPI);
19449
19453
  },
19450
19454
  agent: async (key, { dispatch, userId, sourceServerOrigin }) => {
@@ -21612,7 +21616,7 @@ var fetchSpaceAction = async (input, thunkAPI) => {
21612
21616
  const spaceKey = createSpaceKey.space(spaceId);
21613
21617
  const readSpace = async (dbKey) => {
21614
21618
  try {
21615
- const { read: read2, readAndWait: readAndWait2 } = await import("./dbSlice-WWNV2SGX.js");
21619
+ const { read: read2, readAndWait: readAndWait2 } = await import("./dbSlice-RQFQQVHT.js");
21616
21620
  if (fresh) {
21617
21621
  return await dispatch(readAndWait2(dbKey)).unwrap();
21618
21622
  }
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  DEFAULT_AGENT_BASE_POLICY,
3
3
  DEFAULT_USER_PREFERENCE_PROFILE
4
- } from "./chunk-4SIMLBEU.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-BE2OOJ5P.js";
7
+ } from "./chunk-O26GI2JP.js";
8
8
  import {
9
9
  DEVICE_LOCAL_OWNER_ID,
10
10
  isDeviceLocalSpaceBody,
11
11
  selectIdentityUserId
12
- } from "./chunk-UTLZINAP.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-CDTLMEB3.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-O4BU24WZ.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
+ };