nolo-cli 0.8.0 → 0.9.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 (183) hide show
  1. package/_executeModel-UD44KGZ4.js +203 -0
  2. package/action-ZJWE3Y5S.js +28 -0
  3. package/addContentAction-TVDBNJM5.js +26 -0
  4. package/addDialogAgentAction-EKH774VT.js +68 -0
  5. package/agentDeleteCommand-TCPEFJTF.js +327 -0
  6. package/agentEmailCommands-CZ3UILZ4.js +626 -0
  7. package/agentListCommands-SJKO2FFB.js +223 -0
  8. package/agentMachineCommands-PSNABISZ.js +425 -0
  9. package/agentPullCommand-O2MTUAFR.js +122 -0
  10. package/agentRecordCommands-MH2JKFHS.js +94 -0
  11. package/agentRunCommand-4KH6MIZR.js +110 -0
  12. package/agentRunControl-K4VKNEHF.js +57 -0
  13. package/agentRuntimeLocal-SKHJUWSS.js +104 -0
  14. package/agentSlice-3WXXN4VK.js +42 -0
  15. package/authCommand-PXFX6JDT.js +581 -0
  16. package/authCommands-356AYWEK.js +35 -0
  17. package/chunk-2EISRLRC.js +238 -0
  18. package/chunk-2FTTDCD4.js +675 -0
  19. package/chunk-2K2ECKSG.js +222 -0
  20. package/chunk-2PUGVR6E.js +19 -0
  21. package/chunk-3ASDTTEI.js +1774 -0
  22. package/chunk-3EUW3WEO.js +8 -0
  23. package/chunk-3LY4F7SV.js +9293 -0
  24. package/chunk-3TZDXYSF.js +71 -0
  25. package/chunk-3WYQEUBI.js +34 -0
  26. package/chunk-4CQLVGRV.js +50 -0
  27. package/chunk-4IJYA27C.js +342 -0
  28. package/chunk-4K2KKCSD.js +577 -0
  29. package/chunk-4SN6J65J.js +38 -0
  30. package/chunk-4VNS5WPM.js +42 -0
  31. package/chunk-4ZDM73SD.js +34 -0
  32. package/chunk-5CS33IBL.js +301 -0
  33. package/chunk-5KLGBAAR.js +386 -0
  34. package/chunk-5MIDPSSK.js +206 -0
  35. package/chunk-5MMAK75Q.js +15 -0
  36. package/chunk-5PJ3VWCS.js +360 -0
  37. package/chunk-63SLEOLK.js +175 -0
  38. package/chunk-63W5N6P3.js +150 -0
  39. package/chunk-6GANEXVO.js +231 -0
  40. package/chunk-6HYVJV7B.js +102 -0
  41. package/chunk-6WD3OOJS.js +20 -0
  42. package/chunk-7OOXPE3N.js +628 -0
  43. package/chunk-7QRKCBOP.js +1078 -0
  44. package/chunk-ATNTHIZI.js +13 -0
  45. package/chunk-AUQ747NZ.js +902 -0
  46. package/chunk-AVMKZHBC.js +85 -0
  47. package/chunk-AZPCASRE.js +36 -0
  48. package/chunk-BBYVOSU2.js +792 -0
  49. package/chunk-C3RUNRHT.js +51 -0
  50. package/chunk-CF2WZF4N.js +134 -0
  51. package/chunk-CF7PE763.js +10 -0
  52. package/chunk-CKOJQDKR.js +198 -0
  53. package/chunk-COMXDWNM.js +807 -0
  54. package/chunk-CPB2YM4D.js +171 -0
  55. package/chunk-CWMSB67P.js +34 -0
  56. package/chunk-DCOA4QSN.js +105 -0
  57. package/chunk-DFFIZ25G.js +30 -0
  58. package/chunk-DWLEOOGR.js +8 -0
  59. package/chunk-DZ3XJVET.js +231 -0
  60. package/chunk-EHLHSX7R.js +1433 -0
  61. package/chunk-ELRRLDWI.js +478 -0
  62. package/chunk-EXTIQUCI.js +482 -0
  63. package/chunk-EYEEHCU4.js +3066 -0
  64. package/chunk-G3SUCT4W.js +8 -0
  65. package/chunk-G43KEVSC.js +1447 -0
  66. package/chunk-GAKEBQD6.js +30 -0
  67. package/chunk-GBRG75BQ.js +86 -0
  68. package/chunk-GG4AJPSR.js +191 -0
  69. package/chunk-H33743XH.js +25 -0
  70. package/chunk-HNMXYYJR.js +12 -0
  71. package/chunk-I42VC5KR.js +15 -0
  72. package/chunk-IDZTNRP2.js +85 -0
  73. package/chunk-ISNCLGUZ.js +146 -0
  74. package/chunk-IWX4UW2E.js +548 -0
  75. package/chunk-JBTJAPUF.js +35 -0
  76. package/chunk-JEXVIMYZ.js +55 -0
  77. package/chunk-JRKKFRAV.js +537 -0
  78. package/chunk-JZPBVBIY.js +94 -0
  79. package/chunk-KKY4B2Q2.js +21 -0
  80. package/chunk-KOCA5FCS.js +4750 -0
  81. package/chunk-KQHGZWSV.js +63 -0
  82. package/chunk-KTVVPRJS.js +138 -0
  83. package/chunk-KUG52IAP.js +8 -0
  84. package/chunk-KX6YBIHG.js +8 -0
  85. package/chunk-LARL2V6G.js +9017 -0
  86. package/chunk-LCBAMY2M.js +60 -0
  87. package/chunk-LM6IYQ3F.js +16 -0
  88. package/chunk-M76ECQRD.js +13658 -0
  89. package/chunk-MGOJ5R6J.js +113 -0
  90. package/chunk-MKMWT7SA.js +27196 -0
  91. package/chunk-MRC4Q34M.js +188 -0
  92. package/chunk-OLZBQWZU.js +6 -0
  93. package/chunk-OPZYGHUC.js +89 -0
  94. package/chunk-OWOHNGCN.js +50 -0
  95. package/chunk-PAKN26FP.js +239 -0
  96. package/chunk-PCWC3JTN.js +91 -0
  97. package/chunk-PG5PNA7Y.js +939 -0
  98. package/chunk-Q2YZULBH.js +104 -0
  99. package/chunk-QSJ3HFEF.js +8 -0
  100. package/chunk-QYXLLLGL.js +4519 -0
  101. package/chunk-ROWQEJRP.js +139 -0
  102. package/chunk-S7Z2HMCN.js +25 -0
  103. package/chunk-SBR32ZZS.js +1901 -0
  104. package/chunk-SH2CFQOH.js +3391 -0
  105. package/chunk-SL35K7AH.js +226 -0
  106. package/chunk-TILFE6LV.js +381 -0
  107. package/chunk-TSS3XJY4.js +2052 -0
  108. package/chunk-U4TRT5V4.js +246 -0
  109. package/chunk-U6VC4MU4.js +8 -0
  110. package/chunk-UAD2WT54.js +64 -0
  111. package/chunk-UUJDGGAK.js +421 -0
  112. package/chunk-VF4K2QE6.js +21 -0
  113. package/chunk-VHBWHNVT.js +59 -0
  114. package/chunk-VIDPVFP3.js +20 -0
  115. package/chunk-VP4WJWKW.js +8882 -0
  116. package/chunk-W4NVOSFF.js +37 -0
  117. package/chunk-WKM6FH35.js +190 -0
  118. package/chunk-WWC7I6TA.js +8 -0
  119. package/chunk-X7W4TNB4.js +1550 -0
  120. package/chunk-XE635NI4.js +1948 -0
  121. package/chunk-XKIMRZO2.js +221 -0
  122. package/chunk-XS466O7S.js +933 -0
  123. package/chunk-Y5GCAMGP.js +9 -0
  124. package/chunk-YBWOP46I.js +3272 -0
  125. package/chunk-YPRZSPF3.js +148 -0
  126. package/chunk-YYUCRDOK.js +69 -0
  127. package/chunk-Z4NR32XR.js +50 -0
  128. package/chunk-ZIG5LJ7X.js +24765 -0
  129. package/chunk-ZNFJWEN4.js +56 -0
  130. package/chunk-ZQ2UM4KG.js +2878 -0
  131. package/cliExecutor-DNE7TCC4.js +36 -0
  132. package/clipboardy-BVE3LVEH.js +12001 -0
  133. package/createAgentAutomationAction-63OIP6X5.js +866 -0
  134. package/createDialogAction-ZLYZDYBB.js +54 -0
  135. package/createPageAction-AL5FSDCK.js +171 -0
  136. package/db-HCJ5PRB5.js +271 -0
  137. package/dbSlice-PR44QPXY.js +60 -0
  138. package/deleteFile-4SKGPHOZ.js +41 -0
  139. package/dialogCommands-F6YI5742.js +63 -0
  140. package/dialogSlice-JSBNZRLR.js +148 -0
  141. package/docCreateCommands-4CTO7ERT.js +219 -0
  142. package/docDeleteCommands-VBWERDRG.js +180 -0
  143. package/docReadCommands-KNP4MFYB.js +133 -0
  144. package/docStore-ADP5VYY4.js +98 -0
  145. package/docUpdateCommands-4BCBJQHA.js +317 -0
  146. package/fetchMessages-U6ZHN56A.js +17 -0
  147. package/getPricing-3E6UNPKL.js +30 -0
  148. package/handleSendMessageAction-IJDQ6ARA.js +185 -0
  149. package/index.js +188 -112943
  150. package/lib-FYYBQIXS.js +19839 -0
  151. package/localDialogRead-Z5UTAJPU.js +26 -0
  152. package/localFirstLog-DHNOY2NA.js +19 -0
  153. package/localRuntimeAuthority-TEGCOWX4.js +471 -0
  154. package/localRuntimeDb-LGDF6FQP.js +12 -0
  155. package/machineCommands-EA3M4XTN.js +779 -0
  156. package/machineInfo-M6KB6HZN.js +10 -0
  157. package/machineWsRunDispatch-NAPKE5ZA.js +110 -0
  158. package/memoryCommands-O4MIPIWQ.js +476 -0
  159. package/models-4OPOOLFS.js +9 -0
  160. package/offlineMarxistsAgentCommand-BCPJITJL.js +242 -0
  161. package/package.json +3 -25
  162. package/read-RIJCIVKX.js +17 -0
  163. package/readDocTool-GZD2N3LO.js +16 -0
  164. package/readlineWorkspace-KMWT4T4S.js +5509 -0
  165. package/removeDialogAgentAction-GJQJNDW6.js +73 -0
  166. package/runAgentClientLoop-U5Q6NDTJ.js +291 -0
  167. package/runtimeDoctorCommands-LRHLPDRC.js +289 -0
  168. package/setDialogExtraReferencesAction-M7OQG54N.js +60 -0
  169. package/setPrimaryDialogAgentAction-46UNFJDL.js +80 -0
  170. package/settingSlice-FVUUH4JA.js +199 -0
  171. package/skillSummaryMarker-42HKSXYY.js +9 -0
  172. package/slateToRenderMarkdown-Y5IYN73U.js +7 -0
  173. package/slateUtils-2M7MUTWX.js +19 -0
  174. package/spaceCommands-E2CFRPZJ.js +454 -0
  175. package/spaceSlice-L3R6IMXE.js +147 -0
  176. package/streamAgentChatTurn-UBDAOQWE.js +4528 -0
  177. package/tableCommands-GOFP7QKA.js +1286 -0
  178. package/toolApiClient-QI3YBNWB.js +26 -0
  179. package/tools-TMJXZTCA.js +85 -0
  180. package/tuiSummaryLlmCaller-RV3THLZF.js +78 -0
  181. package/understanding-GQKNDDWM.js +271 -0
  182. package/updateCommands-VOSPKXFF.js +31 -0
  183. package/updateDialogTitleAction-ZTWRDXI2.js +188 -0
@@ -0,0 +1,148 @@
1
+ import {
2
+ abortAllMessages,
3
+ addDialogAgent,
4
+ clearDialogState,
5
+ createAgentAutomation,
6
+ createDialog,
7
+ createPageAndAddReference,
8
+ deleteDialog,
9
+ handleSendMessage,
10
+ initDialog,
11
+ removeDialogAgent,
12
+ selectCurrentDialogAgentIds,
13
+ selectCurrentDialogConfig,
14
+ selectCurrentDialogTokens,
15
+ selectCurrentPrimaryAgentId,
16
+ selectDialogConfigByKey,
17
+ selectTotalDialogTokens,
18
+ setDialogExtraReferences,
19
+ setPrimaryDialogAgent,
20
+ updateDialogTitle,
21
+ updateTokens
22
+ } from "./chunk-ZIG5LJ7X.js";
23
+ import "./chunk-4ZDM73SD.js";
24
+ import "./chunk-MRC4Q34M.js";
25
+ import "./chunk-PCWC3JTN.js";
26
+ import "./chunk-CWMSB67P.js";
27
+ import "./chunk-4K2KKCSD.js";
28
+ import "./chunk-KTVVPRJS.js";
29
+ import "./chunk-Z4NR32XR.js";
30
+ import "./chunk-M76ECQRD.js";
31
+ import "./chunk-YYUCRDOK.js";
32
+ import "./chunk-MGOJ5R6J.js";
33
+ import "./chunk-UAD2WT54.js";
34
+ import "./chunk-DCOA4QSN.js";
35
+ import "./chunk-5MMAK75Q.js";
36
+ import "./chunk-BBYVOSU2.js";
37
+ import "./chunk-5CS33IBL.js";
38
+ import "./chunk-JZPBVBIY.js";
39
+ import "./chunk-IWX4UW2E.js";
40
+ import "./chunk-DFFIZ25G.js";
41
+ import {
42
+ GLOBAL_DIALOG_RUNTIME_KEY,
43
+ addActiveController,
44
+ addPendingFile,
45
+ clearActiveControllers,
46
+ clearDialogRuntimeState,
47
+ clearPendingAttachments,
48
+ clearPendingUserInputQueue,
49
+ dequeueUserInput,
50
+ enqueueUserInput,
51
+ removeActiveController,
52
+ removePendingFile,
53
+ selectActiveControllers,
54
+ selectConfigError,
55
+ selectCurrentDialogKey,
56
+ selectDialogRuntimeByKey,
57
+ selectDialogRuntimeTokens,
58
+ selectLoopStopReason,
59
+ selectPendingFiles,
60
+ selectPendingRawData,
61
+ selectPendingRawDataByPageKey,
62
+ selectPendingUserInputQueue,
63
+ setLoopStopReason,
64
+ tokenUsageLiveUpdate,
65
+ useActiveControllers,
66
+ useCurrentDialogKey,
67
+ useDialogConfigError,
68
+ useDialogRuntimeTokens,
69
+ useLoopStopReason,
70
+ usePendingFiles,
71
+ usePendingUserInputQueue
72
+ } from "./chunk-3ASDTTEI.js";
73
+ import "./chunk-DWLEOOGR.js";
74
+ import "./chunk-HNMXYYJR.js";
75
+ import "./chunk-TSS3XJY4.js";
76
+ import "./chunk-Y5GCAMGP.js";
77
+ import "./chunk-COMXDWNM.js";
78
+ import "./chunk-AZPCASRE.js";
79
+ import "./chunk-2EISRLRC.js";
80
+ import "./chunk-KX6YBIHG.js";
81
+ import "./chunk-SH2CFQOH.js";
82
+ import "./chunk-I42VC5KR.js";
83
+ import "./chunk-WWC7I6TA.js";
84
+ import "./chunk-QSJ3HFEF.js";
85
+ import "./chunk-ELRRLDWI.js";
86
+ import "./chunk-EYEEHCU4.js";
87
+ import "./chunk-QYXLLLGL.js";
88
+ import "./chunk-GBRG75BQ.js";
89
+ import "./chunk-4SN6J65J.js";
90
+ import "./chunk-LCBAMY2M.js";
91
+ import "./chunk-3EUW3WEO.js";
92
+ import "./chunk-U6VC4MU4.js";
93
+ import "./chunk-CF7PE763.js";
94
+ import "./chunk-G3SUCT4W.js";
95
+ import "./chunk-KUG52IAP.js";
96
+ import "./chunk-4VNS5WPM.js";
97
+ export {
98
+ GLOBAL_DIALOG_RUNTIME_KEY,
99
+ abortAllMessages,
100
+ addActiveController,
101
+ addDialogAgent,
102
+ addPendingFile,
103
+ clearActiveControllers,
104
+ clearDialogRuntimeState,
105
+ clearDialogState,
106
+ clearPendingAttachments,
107
+ clearPendingUserInputQueue,
108
+ createAgentAutomation,
109
+ createDialog,
110
+ createPageAndAddReference,
111
+ deleteDialog,
112
+ dequeueUserInput,
113
+ enqueueUserInput,
114
+ handleSendMessage,
115
+ initDialog,
116
+ removeActiveController,
117
+ removeDialogAgent,
118
+ removePendingFile,
119
+ selectActiveControllers,
120
+ selectConfigError,
121
+ selectCurrentDialogAgentIds,
122
+ selectCurrentDialogConfig,
123
+ selectCurrentDialogKey,
124
+ selectCurrentDialogTokens,
125
+ selectCurrentPrimaryAgentId,
126
+ selectDialogConfigByKey,
127
+ selectDialogRuntimeByKey,
128
+ selectDialogRuntimeTokens,
129
+ selectLoopStopReason,
130
+ selectPendingFiles,
131
+ selectPendingRawData,
132
+ selectPendingRawDataByPageKey,
133
+ selectPendingUserInputQueue,
134
+ selectTotalDialogTokens,
135
+ setDialogExtraReferences,
136
+ setLoopStopReason,
137
+ setPrimaryDialogAgent,
138
+ tokenUsageLiveUpdate,
139
+ updateDialogTitle,
140
+ updateTokens,
141
+ useActiveControllers,
142
+ useCurrentDialogKey,
143
+ useDialogConfigError,
144
+ useDialogRuntimeTokens,
145
+ useLoopStopReason,
146
+ usePendingFiles,
147
+ usePendingUserInputQueue
148
+ };
@@ -0,0 +1,219 @@
1
+ import {
2
+ findPotentialSecrets,
3
+ formatSecretFindings
4
+ } from "./chunk-S7Z2HMCN.js";
5
+ import {
6
+ buildPageKey,
7
+ buildPageRecord,
8
+ buildSkillDocId,
9
+ buildSkillPageKey,
10
+ buildSkillPageRecord,
11
+ buildSkillSummaryForRecord,
12
+ createPageId,
13
+ hasFlag,
14
+ hasHelpArg,
15
+ parseJsonArg,
16
+ readBodyArg,
17
+ readTitle,
18
+ requireTokenUser,
19
+ resolveDocKind,
20
+ resolveWriteTargets,
21
+ writePageRecord
22
+ } from "./chunk-5PJ3VWCS.js";
23
+ import "./chunk-7OOXPE3N.js";
24
+ import "./chunk-2PUGVR6E.js";
25
+ import "./chunk-VHBWHNVT.js";
26
+ import "./chunk-VF4K2QE6.js";
27
+ import "./chunk-ZQ2UM4KG.js";
28
+ import "./chunk-UAD2WT54.js";
29
+ import "./chunk-IDZTNRP2.js";
30
+ import {
31
+ readOption
32
+ } from "./chunk-ISNCLGUZ.js";
33
+ import "./chunk-OLZBQWZU.js";
34
+ import "./chunk-YBWOP46I.js";
35
+ import "./chunk-5KLGBAAR.js";
36
+ import "./chunk-ZNFJWEN4.js";
37
+ import "./chunk-TILFE6LV.js";
38
+ import "./chunk-XS466O7S.js";
39
+ import "./chunk-OPZYGHUC.js";
40
+ import "./chunk-PAKN26FP.js";
41
+ import "./chunk-JRKKFRAV.js";
42
+ import "./chunk-AUQ747NZ.js";
43
+ import "./chunk-5MMAK75Q.js";
44
+ import "./chunk-BBYVOSU2.js";
45
+ import "./chunk-5CS33IBL.js";
46
+ import "./chunk-JZPBVBIY.js";
47
+ import "./chunk-IWX4UW2E.js";
48
+ import "./chunk-DWLEOOGR.js";
49
+ import "./chunk-HNMXYYJR.js";
50
+ import "./chunk-KX6YBIHG.js";
51
+ import "./chunk-SH2CFQOH.js";
52
+ import "./chunk-I42VC5KR.js";
53
+ import "./chunk-WWC7I6TA.js";
54
+ import "./chunk-QSJ3HFEF.js";
55
+ import "./chunk-4SN6J65J.js";
56
+ import "./chunk-LCBAMY2M.js";
57
+ import "./chunk-3EUW3WEO.js";
58
+ import "./chunk-U6VC4MU4.js";
59
+ import "./chunk-CF7PE763.js";
60
+ import "./chunk-G3SUCT4W.js";
61
+ import "./chunk-KUG52IAP.js";
62
+ import "./chunk-4VNS5WPM.js";
63
+
64
+ // packages/cli/docCreateCommands.ts
65
+ function printDocCreateUsage(output) {
66
+ output.write(`Usage:
67
+ nolo doc create --title <title> [--body ... | --body-file path] [--id ...] [--space ...]
68
+
69
+ Options:
70
+ --description <text> Optional page description stored in meta.
71
+ --sync local,main,us Choose write targets. Values may also be full URLs.
72
+ --local-only Write only to the local server target.
73
+ --no-local Exclude local targets when --sync includes them.
74
+ --dry-run Build and validate without writing.
75
+ --json Print machine-readable JSON.
76
+ --allow-secrets Allow bodies that look like credentials.
77
+ --server <url> Default write target when --sync is omitted.
78
+ --token <jwt> Auth token. Required for writes.
79
+ `);
80
+ }
81
+ function printSkillDocCreateUsage(output) {
82
+ output.write(`Usage:
83
+ nolo skill-doc create --title <title> --description <text> [--body ... | --body-file path]
84
+ nolo skill create-doc --title <title> --description <text> [--body ... | --body-file path]
85
+
86
+ Options:
87
+ --tools '["readDoc"]' Tool names this skill expects.
88
+ --required-skills '["skill-a"]' Required skill references.
89
+ --recommended-skills '["skill-b"]' Recommended skill references.
90
+ --preferred-agents '["agent-key"]' Preferred agent keys.
91
+ --trigger-mode explicit|required|recommended
92
+ --budget-tier low|medium|high
93
+ --prompt-patch <text>
94
+ --page | --kind page Create a normal page instead of a skill-backed page.
95
+ --sync local,main,us Choose write targets. Values may also be full URLs.
96
+ --dry-run Build and validate without writing.
97
+ --json Print machine-readable JSON.
98
+ --token <jwt> Auth token. Required for writes.
99
+ `);
100
+ }
101
+ async function runCreateCommand(args, deps, options) {
102
+ if (hasHelpArg(args)) {
103
+ options.usage(process.stdout);
104
+ return 0;
105
+ }
106
+ const title = readTitle(args);
107
+ const description = readOption(args, "--description") ?? "";
108
+ const docKind = resolveDocKind(args, options.defaultKind);
109
+ const shouldDryRun = hasFlag(args, "--dry-run");
110
+ const shouldOutputJson = hasFlag(args, "--json");
111
+ const allowSecrets = hasFlag(args, "--allow-secrets");
112
+ const spaceId = readOption(args, "--space") ?? null;
113
+ if (!title || docKind === "skill" && !description) {
114
+ options.usage(process.stderr);
115
+ return 1;
116
+ }
117
+ const body = readBodyArg(args, "");
118
+ const secretFindings = findPotentialSecrets(body);
119
+ if (secretFindings.length && !allowSecrets) {
120
+ throw new Error(
121
+ [
122
+ "Document body appears to contain credentials or secrets. Pass --allow-secrets to write it anyway.",
123
+ formatSecretFindings(secretFindings)
124
+ ].join("\n")
125
+ );
126
+ }
127
+ const { authToken, userId } = requireTokenUser(args, deps.env, shouldDryRun);
128
+ const targets = resolveWriteTargets(args, deps.env);
129
+ if (!targets.length) {
130
+ throw new Error("No write targets resolved. Check --sync / --local-only / --no-local.");
131
+ }
132
+ const explicitId = readOption(args, "--id");
133
+ const docId = explicitId ?? (docKind === "skill" ? buildSkillDocId(title) : createPageId());
134
+ const dbKey = docKind === "skill" ? buildSkillPageKey(userId, docId) : buildPageKey(userId, docId);
135
+ const record = docKind === "skill" ? buildSkillPageRecord({
136
+ dbKey,
137
+ skillId: docId,
138
+ title,
139
+ spaceId,
140
+ body,
141
+ skillConfig: {
142
+ version: "0.1",
143
+ kind: "skill",
144
+ id: docId,
145
+ name: title,
146
+ description,
147
+ ...parseJsonArg(readOption(args, "--tools"), []).length ? { toolNames: parseJsonArg(readOption(args, "--tools"), []) } : {},
148
+ ...parseJsonArg(readOption(args, "--required-skills"), []).length ? { requiredSkills: parseJsonArg(readOption(args, "--required-skills"), []) } : {},
149
+ ...parseJsonArg(readOption(args, "--recommended-skills"), []).length ? { recommendedSkills: parseJsonArg(readOption(args, "--recommended-skills"), []) } : {},
150
+ ...parseJsonArg(readOption(args, "--preferred-agents"), []).length ? { preferredAgents: parseJsonArg(readOption(args, "--preferred-agents"), []) } : {},
151
+ ...readOption(args, "--trigger-mode") ? { triggerMode: readOption(args, "--trigger-mode") } : {},
152
+ ...readOption(args, "--budget-tier") ? { budgetTier: readOption(args, "--budget-tier") } : {},
153
+ ...readOption(args, "--prompt-patch") ? { promptPatch: readOption(args, "--prompt-patch") } : {}
154
+ }
155
+ }) : buildPageRecord({
156
+ dbKey,
157
+ pageId: docId,
158
+ title,
159
+ spaceId,
160
+ content: body,
161
+ meta: description ? { description } : void 0
162
+ });
163
+ const skillSummary = buildSkillSummaryForRecord(record);
164
+ const summary = {
165
+ dryRun: shouldDryRun,
166
+ kind: docKind,
167
+ title,
168
+ dbKey,
169
+ id: docId,
170
+ userId,
171
+ spaceId,
172
+ syncTargets: targets,
173
+ writtenTargets: [],
174
+ secretFindingCount: secretFindings.length,
175
+ secretFindings
176
+ };
177
+ if (!shouldDryRun) {
178
+ for (const serverUrl of targets) {
179
+ await writePageRecord({
180
+ authToken,
181
+ dbKey,
182
+ record,
183
+ serverUrl,
184
+ spaceId,
185
+ title,
186
+ userId,
187
+ skillSummary
188
+ });
189
+ summary.writtenTargets.push(serverUrl);
190
+ }
191
+ }
192
+ if (shouldOutputJson) {
193
+ process.stdout.write(`${JSON.stringify(summary, null, 2)}
194
+ `);
195
+ } else if (shouldDryRun) {
196
+ process.stdout.write(`dry-run ok: ${dbKey}
197
+ `);
198
+ } else {
199
+ process.stdout.write(`created ${docKind}: ${dbKey}
200
+ `);
201
+ }
202
+ return 0;
203
+ }
204
+ async function runDocCreateCommand(args, deps) {
205
+ return runCreateCommand(args, deps, {
206
+ defaultKind: "page",
207
+ usage: printDocCreateUsage
208
+ });
209
+ }
210
+ async function runSkillDocCreateCommand(args, deps) {
211
+ return runCreateCommand(args, deps, {
212
+ defaultKind: "skill",
213
+ usage: printSkillDocCreateUsage
214
+ });
215
+ }
216
+ export {
217
+ runDocCreateCommand,
218
+ runSkillDocCreateCommand
219
+ };
@@ -0,0 +1,180 @@
1
+ import {
2
+ buildPageKey,
3
+ buildSkillPageKey,
4
+ hasFlag,
5
+ hasHelpArg,
6
+ readPageRecord,
7
+ removePageFromSpace,
8
+ requireTokenUser,
9
+ resolveDocKind,
10
+ resolveWriteTargets
11
+ } from "./chunk-5PJ3VWCS.js";
12
+ import {
13
+ deleteDbRecordOnServers
14
+ } from "./chunk-WKM6FH35.js";
15
+ import "./chunk-7OOXPE3N.js";
16
+ import "./chunk-2PUGVR6E.js";
17
+ import "./chunk-VHBWHNVT.js";
18
+ import "./chunk-VF4K2QE6.js";
19
+ import "./chunk-KQHGZWSV.js";
20
+ import "./chunk-ZQ2UM4KG.js";
21
+ import "./chunk-UAD2WT54.js";
22
+ import "./chunk-IDZTNRP2.js";
23
+ import {
24
+ readOption
25
+ } from "./chunk-ISNCLGUZ.js";
26
+ import "./chunk-OLZBQWZU.js";
27
+ import "./chunk-YBWOP46I.js";
28
+ import "./chunk-5KLGBAAR.js";
29
+ import "./chunk-ZNFJWEN4.js";
30
+ import "./chunk-TILFE6LV.js";
31
+ import "./chunk-XS466O7S.js";
32
+ import "./chunk-OPZYGHUC.js";
33
+ import "./chunk-PAKN26FP.js";
34
+ import "./chunk-JRKKFRAV.js";
35
+ import "./chunk-AUQ747NZ.js";
36
+ import "./chunk-5MMAK75Q.js";
37
+ import "./chunk-BBYVOSU2.js";
38
+ import "./chunk-5CS33IBL.js";
39
+ import "./chunk-JZPBVBIY.js";
40
+ import "./chunk-IWX4UW2E.js";
41
+ import "./chunk-DWLEOOGR.js";
42
+ import "./chunk-HNMXYYJR.js";
43
+ import "./chunk-KX6YBIHG.js";
44
+ import "./chunk-SH2CFQOH.js";
45
+ import "./chunk-I42VC5KR.js";
46
+ import "./chunk-WWC7I6TA.js";
47
+ import "./chunk-QSJ3HFEF.js";
48
+ import "./chunk-GBRG75BQ.js";
49
+ import "./chunk-4SN6J65J.js";
50
+ import "./chunk-LCBAMY2M.js";
51
+ import "./chunk-3EUW3WEO.js";
52
+ import "./chunk-U6VC4MU4.js";
53
+ import "./chunk-CF7PE763.js";
54
+ import "./chunk-G3SUCT4W.js";
55
+ import "./chunk-KUG52IAP.js";
56
+ import "./chunk-4VNS5WPM.js";
57
+
58
+ // packages/cli/docDeleteCommands.ts
59
+ function printDocDeleteUsage(output) {
60
+ output.write(`Usage:
61
+ nolo doc delete (--id <pageId> | --key <pageKey>)
62
+
63
+ Options:
64
+ --id <pageId> Page id (without user prefix).
65
+ --key <pageKey> Full dbKey, e.g. page-<userId>-<pageId>.
66
+ --sync local,main,us Choose delete targets. Values may also be full URLs.
67
+ --local-only Delete only on the local server target.
68
+ --no-local Exclude local targets when --sync includes them.
69
+ --dry-run Show what would be deleted without deleting.
70
+ --json Print machine-readable JSON.
71
+ --server <url> Default target when --sync is omitted.
72
+ --token <jwt> Auth token. Required for deletes.
73
+ `);
74
+ }
75
+ function printSkillDocDeleteUsage(output) {
76
+ output.write(`Usage:
77
+ nolo skill-doc delete (--id <skillId> | --key <pageKey>)
78
+
79
+ Options:
80
+ --id <skillId> Skill id (without user prefix).
81
+ --key <pageKey> Full dbKey, e.g. page-<userId>-<skillId>.
82
+ --sync local,main,us Choose delete targets. Values may also be full URLs.
83
+ --local-only Delete only on the local server target.
84
+ --no-local Exclude local targets when --sync includes them.
85
+ --dry-run Show what would be deleted without deleting.
86
+ --json Print machine-readable JSON.
87
+ --token <jwt> Auth token. Required for deletes.
88
+ `);
89
+ }
90
+ async function runDeleteCommand(args, deps, options) {
91
+ if (hasHelpArg(args)) {
92
+ options.usage(process.stdout);
93
+ return 0;
94
+ }
95
+ const explicitId = readOption(args, "--id");
96
+ const explicitKey = readOption(args, "--key");
97
+ if (!explicitId && !explicitKey) {
98
+ options.usage(process.stderr);
99
+ return 1;
100
+ }
101
+ const docKind = resolveDocKind(args, options.defaultKind);
102
+ const shouldDryRun = hasFlag(args, "--dry-run");
103
+ const shouldOutputJson = hasFlag(args, "--json");
104
+ const { authToken, userId } = requireTokenUser(args, deps.env, shouldDryRun);
105
+ const targets = resolveWriteTargets(args, deps.env);
106
+ if (!targets.length) {
107
+ throw new Error("No delete targets resolved. Check --sync / --local-only / --no-local.");
108
+ }
109
+ const dbKey = explicitKey ?? (docKind === "skill" ? buildSkillPageKey(userId, explicitId) : buildPageKey(userId, explicitId));
110
+ const existing = await readPageRecord({ authToken, dbKey, serverUrl: targets[0] });
111
+ if (docKind === "page" && existing?.meta?.kind === "skill") {
112
+ throw new Error(`Target page is a skill doc. Use nolo skill-doc delete --key ${dbKey}`);
113
+ }
114
+ if (docKind === "skill" && existing?.meta?.kind !== "skill") {
115
+ throw new Error(`Target page is not a skill doc. Use nolo doc delete --key ${dbKey}`);
116
+ }
117
+ const spaceId = typeof existing?.spaceId === "string" ? existing.spaceId : null;
118
+ const summary = {
119
+ dryRun: shouldDryRun,
120
+ kind: docKind,
121
+ dbKey,
122
+ userId,
123
+ spaceId,
124
+ syncTargets: targets,
125
+ deletedTargets: []
126
+ };
127
+ if (!shouldDryRun) {
128
+ if (spaceId) {
129
+ for (const serverUrl of targets) {
130
+ await removePageFromSpace({
131
+ baseUrl: serverUrl,
132
+ userId,
133
+ authToken,
134
+ spaceId,
135
+ contentKey: dbKey
136
+ }).catch(() => null);
137
+ }
138
+ }
139
+ const results = await deleteDbRecordOnServers({
140
+ authToken,
141
+ dbKey,
142
+ fetchImpl: fetch,
143
+ serverUrls: targets
144
+ });
145
+ const failed = results.filter((result) => !result.ok);
146
+ if (failed.length) {
147
+ throw new Error(
148
+ `delete ${dbKey} failed on ${failed.map((result) => `${result.serverUrl}: ${result.error}`).join("; ")}`
149
+ );
150
+ }
151
+ summary.deletedTargets.push(...results.map((result) => result.serverUrl));
152
+ }
153
+ if (shouldOutputJson) {
154
+ process.stdout.write(`${JSON.stringify(summary, null, 2)}
155
+ `);
156
+ } else if (shouldDryRun) {
157
+ process.stdout.write(`dry-run ok: ${dbKey}
158
+ `);
159
+ } else {
160
+ process.stdout.write(`deleted ${docKind}: ${dbKey}
161
+ `);
162
+ }
163
+ return 0;
164
+ }
165
+ async function runDocDeleteCommand(args, deps) {
166
+ return runDeleteCommand(args, deps, {
167
+ defaultKind: "page",
168
+ usage: printDocDeleteUsage
169
+ });
170
+ }
171
+ async function runSkillDocDeleteCommand(args, deps) {
172
+ return runDeleteCommand(args, deps, {
173
+ defaultKind: "skill",
174
+ usage: printSkillDocDeleteUsage
175
+ });
176
+ }
177
+ export {
178
+ runDocDeleteCommand,
179
+ runSkillDocDeleteCommand
180
+ };
@@ -0,0 +1,133 @@
1
+ import {
2
+ buildPageKey,
3
+ buildSkillPageKey,
4
+ hasFlag,
5
+ hasHelpArg,
6
+ readPageRecord,
7
+ requireTokenUser,
8
+ resolveDocKind,
9
+ resolveWriteTargets
10
+ } from "./chunk-5PJ3VWCS.js";
11
+ import "./chunk-7OOXPE3N.js";
12
+ import "./chunk-2PUGVR6E.js";
13
+ import "./chunk-VHBWHNVT.js";
14
+ import "./chunk-VF4K2QE6.js";
15
+ import "./chunk-ZQ2UM4KG.js";
16
+ import "./chunk-UAD2WT54.js";
17
+ import "./chunk-IDZTNRP2.js";
18
+ import {
19
+ readOption
20
+ } from "./chunk-ISNCLGUZ.js";
21
+ import "./chunk-OLZBQWZU.js";
22
+ import "./chunk-YBWOP46I.js";
23
+ import "./chunk-5KLGBAAR.js";
24
+ import "./chunk-ZNFJWEN4.js";
25
+ import "./chunk-TILFE6LV.js";
26
+ import "./chunk-XS466O7S.js";
27
+ import "./chunk-OPZYGHUC.js";
28
+ import "./chunk-PAKN26FP.js";
29
+ import "./chunk-JRKKFRAV.js";
30
+ import "./chunk-AUQ747NZ.js";
31
+ import "./chunk-5MMAK75Q.js";
32
+ import "./chunk-BBYVOSU2.js";
33
+ import "./chunk-5CS33IBL.js";
34
+ import "./chunk-JZPBVBIY.js";
35
+ import "./chunk-IWX4UW2E.js";
36
+ import "./chunk-DWLEOOGR.js";
37
+ import "./chunk-HNMXYYJR.js";
38
+ import "./chunk-KX6YBIHG.js";
39
+ import "./chunk-SH2CFQOH.js";
40
+ import "./chunk-I42VC5KR.js";
41
+ import "./chunk-WWC7I6TA.js";
42
+ import "./chunk-QSJ3HFEF.js";
43
+ import "./chunk-4SN6J65J.js";
44
+ import "./chunk-LCBAMY2M.js";
45
+ import "./chunk-3EUW3WEO.js";
46
+ import "./chunk-U6VC4MU4.js";
47
+ import "./chunk-CF7PE763.js";
48
+ import "./chunk-G3SUCT4W.js";
49
+ import "./chunk-KUG52IAP.js";
50
+ import "./chunk-4VNS5WPM.js";
51
+
52
+ // packages/cli/docReadCommands.ts
53
+ function printDocReadUsage(output) {
54
+ output.write(`Usage:
55
+ nolo doc read (--id <pageId> | --key <pageKey>)
56
+
57
+ Options:
58
+ --id <pageId> Page id (without user prefix).
59
+ --key <pageKey> Full dbKey, e.g. page-<userId>-<pageId>.
60
+ --server <url> Server to read from.
61
+ --token <jwt> Auth token. Required for reads.
62
+ `);
63
+ }
64
+ function printSkillDocReadUsage(output) {
65
+ output.write(`Usage:
66
+ nolo skill-doc read (--id <skillId> | --key <pageKey>)
67
+
68
+ Options:
69
+ --id <skillId> Skill id (without user prefix).
70
+ --key <pageKey> Full dbKey, e.g. page-<userId>-<skillId>.
71
+ --server <url> Server to read from.
72
+ --token <jwt> Auth token. Required for reads.
73
+ `);
74
+ }
75
+ async function runReadCommand(args, deps, options) {
76
+ if (hasHelpArg(args)) {
77
+ options.usage(process.stdout);
78
+ return 0;
79
+ }
80
+ const explicitId = readOption(args, "--id");
81
+ const explicitKey = readOption(args, "--key");
82
+ if (!explicitId && !explicitKey) {
83
+ options.usage(process.stderr);
84
+ return 1;
85
+ }
86
+ const docKind = resolveDocKind(args, options.defaultKind);
87
+ const shouldOutputJson = hasFlag(args, "--json");
88
+ const { authToken, userId } = requireTokenUser(args, deps.env, false);
89
+ const targets = resolveWriteTargets(args, deps.env);
90
+ if (!targets.length) {
91
+ throw new Error("No read targets resolved. Check --server.");
92
+ }
93
+ const dbKey = explicitKey ?? (docKind === "skill" ? buildSkillPageKey(userId, explicitId) : buildPageKey(userId, explicitId));
94
+ let record = null;
95
+ for (const serverUrl of targets) {
96
+ try {
97
+ record = await readPageRecord({ authToken, dbKey, serverUrl });
98
+ if (record) break;
99
+ } catch {
100
+ }
101
+ }
102
+ if (!record) {
103
+ throw new Error(`doc not found: ${dbKey}`);
104
+ }
105
+ if (shouldOutputJson) {
106
+ process.stdout.write(`${JSON.stringify({ dbKey, record }, null, 2)}
107
+ `);
108
+ } else {
109
+ process.stdout.write(`read ${docKind}: ${dbKey}
110
+ `);
111
+ process.stdout.write(`title: ${record.title ?? "(none)"}
112
+ `);
113
+ process.stdout.write(`spaceId: ${record.spaceId ?? "(none)"}
114
+ `);
115
+ }
116
+ return 0;
117
+ }
118
+ async function runDocReadCommand(args, deps) {
119
+ return runReadCommand(args, deps, {
120
+ defaultKind: "page",
121
+ usage: printDocReadUsage
122
+ });
123
+ }
124
+ async function runSkillDocReadCommand(args, deps) {
125
+ return runReadCommand(args, deps, {
126
+ defaultKind: "skill",
127
+ usage: printSkillDocReadUsage
128
+ });
129
+ }
130
+ export {
131
+ runDocReadCommand,
132
+ runSkillDocReadCommand
133
+ };