@leuduan/lagent 0.0.0-stage → 44.0.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 (328) hide show
  1. package/LICENSE +16 -0
  2. package/README.md +157 -2
  3. package/dist/chunks/2GCIWSOA.js +5 -0
  4. package/dist/chunks/2P47AHNK.js +7 -0
  5. package/dist/chunks/34KW6VNQ.js +1 -0
  6. package/dist/chunks/3UMZMPWW.js +1 -0
  7. package/dist/chunks/5IRF47YB.js +1 -0
  8. package/dist/chunks/6DRCKZ2C.js +1 -0
  9. package/dist/chunks/6FRNHMCV.js +1 -0
  10. package/dist/chunks/7LI64H5X.js +17 -0
  11. package/dist/chunks/7VAPNE3L.js +1 -0
  12. package/dist/chunks/ASSQZH3F.js +1 -0
  13. package/dist/chunks/B4FXK5ER.js +77 -0
  14. package/dist/chunks/BBCW2FZK.js +1 -0
  15. package/dist/chunks/BPRCULZH.js +1 -0
  16. package/dist/chunks/CANPZYTH.js +24 -0
  17. package/dist/chunks/CQEVREBT.js +1 -0
  18. package/dist/chunks/CUK7CGC7.js +1 -0
  19. package/dist/chunks/D4PQP5MA.js +3 -0
  20. package/dist/chunks/DDANMY45.js +3 -0
  21. package/dist/chunks/DDZ7YF26.js +1 -0
  22. package/dist/chunks/EMRB4KCN.js +6 -0
  23. package/dist/chunks/EPYQ5M3B.js +3 -0
  24. package/dist/chunks/FJLU4UH3.js +1 -0
  25. package/dist/chunks/G44LG6VL.js +1 -0
  26. package/dist/chunks/GGSVIIWJ.js +2 -0
  27. package/dist/chunks/HK6ZSONF.js +1 -0
  28. package/dist/chunks/IAAEP6VL.js +30 -0
  29. package/dist/chunks/JCTBX33H.js +36 -0
  30. package/dist/chunks/JFX2MXBA.js +4 -0
  31. package/dist/chunks/JFZZXVWD.js +15 -0
  32. package/dist/chunks/KUZCL2SH.js +1 -0
  33. package/dist/chunks/MHC6VPB4.js +7 -0
  34. package/dist/chunks/MMNNZCBO.js +5 -0
  35. package/dist/chunks/MNJ4SRF7.js +1 -0
  36. package/dist/chunks/N6IXG2VL.js +1 -0
  37. package/dist/chunks/OCBPT7KE.js +1 -0
  38. package/dist/chunks/OL5A6ITQ.js +1 -0
  39. package/dist/chunks/PUSUPTAT.js +1 -0
  40. package/dist/chunks/Q75FUN7D.js +2 -0
  41. package/dist/chunks/Q7S5LFGN.js +1 -0
  42. package/dist/chunks/RCIHV3KG.js +1 -0
  43. package/dist/chunks/S34ZA2R6.js +1 -0
  44. package/dist/chunks/SS3B5W34.js +12 -0
  45. package/dist/chunks/VYMT4TXD.js +1 -0
  46. package/dist/chunks/W57RW55W.js +1 -0
  47. package/dist/compositions/base.d.ts +11 -0
  48. package/dist/compositions/codex.d.ts +66 -0
  49. package/dist/compositions/codexPrompts.d.ts +56 -0
  50. package/dist/context.d.ts +109 -0
  51. package/dist/index.d.ts +55 -0
  52. package/dist/index.js +1 -0
  53. package/dist/journal/catalog.d.ts +112 -0
  54. package/dist/journal/forkChain.d.ts +16 -0
  55. package/dist/journal/index.d.ts +15 -0
  56. package/dist/journal/journal.d.ts +475 -0
  57. package/dist/journal/projection.d.ts +87 -0
  58. package/dist/journal/store.d.ts +181 -0
  59. package/dist/llm/client.d.ts +135 -0
  60. package/dist/llm/content.d.ts +52 -0
  61. package/dist/llm/failure.d.ts +82 -0
  62. package/dist/llm/index.d.ts +22 -0
  63. package/dist/llm/index.js +1 -0
  64. package/dist/llm/primitives.d.ts +286 -0
  65. package/dist/llm/prompt.d.ts +21 -0
  66. package/dist/llm/provider.d.ts +74 -0
  67. package/dist/llm/readLedger.d.ts +24 -0
  68. package/dist/llm/request.d.ts +58 -0
  69. package/dist/loop/agent.d.ts +18 -0
  70. package/dist/loop/authorization.d.ts +41 -0
  71. package/dist/loop/auxiliary.d.ts +58 -0
  72. package/dist/loop/chunks.d.ts +27 -0
  73. package/dist/loop/completion.d.ts +17 -0
  74. package/dist/loop/errors.d.ts +139 -0
  75. package/dist/loop/hooks.d.ts +274 -0
  76. package/dist/loop/index.d.ts +16 -0
  77. package/dist/loop/runner.d.ts +134 -0
  78. package/dist/loop/runtime.d.ts +76 -0
  79. package/dist/loop/strategy.d.ts +80 -0
  80. package/dist/loop/surfacePrepare.d.ts +30 -0
  81. package/dist/loop/tool.d.ts +106 -0
  82. package/dist/loop/toolCalls.d.ts +35 -0
  83. package/dist/plugin.d.ts +50 -0
  84. package/dist/plugin.js +1 -0
  85. package/dist/plugins/agentsMd.d.ts +80 -0
  86. package/dist/plugins/agentsMd.js +1 -0
  87. package/dist/plugins/ask/index.d.ts +26 -0
  88. package/dist/plugins/ask/index.js +1 -0
  89. package/dist/plugins/ask/service.d.ts +125 -0
  90. package/dist/plugins/ask/tools.d.ts +9 -0
  91. package/dist/plugins/commands/index.d.ts +43 -0
  92. package/dist/plugins/commands/index.js +1 -0
  93. package/dist/plugins/commands/output.d.ts +115 -0
  94. package/dist/plugins/commands/record.d.ts +558 -0
  95. package/dist/plugins/commands/service.d.ts +321 -0
  96. package/dist/plugins/commands/shell.d.ts +25 -0
  97. package/dist/plugins/commands/tools.d.ts +10 -0
  98. package/dist/plugins/compaction/checkpoint.d.ts +94 -0
  99. package/dist/plugins/compaction/config.d.ts +133 -0
  100. package/dist/plugins/compaction/estimate.d.ts +37 -0
  101. package/dist/plugins/compaction/index.d.ts +87 -0
  102. package/dist/plugins/compaction/index.js +7 -0
  103. package/dist/plugins/compaction/planner.d.ts +207 -0
  104. package/dist/plugins/compaction/prune.d.ts +9 -0
  105. package/dist/plugins/compaction/record.d.ts +227 -0
  106. package/dist/plugins/compaction/segments.d.ts +23 -0
  107. package/dist/plugins/compaction/state.d.ts +68 -0
  108. package/dist/plugins/compaction/summarize.d.ts +13 -0
  109. package/dist/plugins/dateAndBranch.d.ts +47 -0
  110. package/dist/plugins/dateAndBranch.js +1 -0
  111. package/dist/plugins/delegations/answers.d.ts +39 -0
  112. package/dist/plugins/delegations/assignmentKey.d.ts +22 -0
  113. package/dist/plugins/delegations/cleanup.d.ts +161 -0
  114. package/dist/plugins/delegations/constraint.d.ts +76 -0
  115. package/dist/plugins/delegations/index.d.ts +39 -0
  116. package/dist/plugins/delegations/index.js +1 -0
  117. package/dist/plugins/delegations/notices.d.ts +261 -0
  118. package/dist/plugins/delegations/obligations.d.ts +210 -0
  119. package/dist/plugins/delegations/record.d.ts +633 -0
  120. package/dist/plugins/delegations/request.d.ts +384 -0
  121. package/dist/plugins/delegations/role.d.ts +30 -0
  122. package/dist/plugins/delegations/service.d.ts +563 -0
  123. package/dist/plugins/delegations/standing.d.ts +19 -0
  124. package/dist/plugins/delegations/stopCheck.d.ts +21 -0
  125. package/dist/plugins/delegations/tools.d.ts +71 -0
  126. package/dist/plugins/delegations/waitContracts.d.ts +118 -0
  127. package/dist/plugins/delegations/waitResolver.d.ts +116 -0
  128. package/dist/plugins/diagnostics/digest.d.ts +14 -0
  129. package/dist/plugins/diagnostics/index.d.ts +68 -0
  130. package/dist/plugins/diagnostics/index.js +1 -0
  131. package/dist/plugins/fileTools/config.d.ts +10 -0
  132. package/dist/plugins/fileTools/editFiles.d.ts +117 -0
  133. package/dist/plugins/fileTools/fsRead.d.ts +17 -0
  134. package/dist/plugins/fileTools/gitDiscovery.d.ts +9 -0
  135. package/dist/plugins/fileTools/index.d.ts +18 -0
  136. package/dist/plugins/fileTools/index.js +1 -0
  137. package/dist/plugins/fileTools/ripgrep.d.ts +20 -0
  138. package/dist/plugins/fileTools/textEdit.d.ts +67 -0
  139. package/dist/plugins/fileTools/tools.d.ts +6 -0
  140. package/dist/plugins/historyRecall/history.d.ts +9 -0
  141. package/dist/plugins/historyRecall/index.d.ts +31 -0
  142. package/dist/plugins/historyRecall/index.js +1 -0
  143. package/dist/plugins/historyRecall/render.d.ts +34 -0
  144. package/dist/plugins/historyRecall/tools.d.ts +4 -0
  145. package/dist/plugins/mcp/catalog.d.ts +36 -0
  146. package/dist/plugins/mcp/config.d.ts +63 -0
  147. package/dist/plugins/mcp/connection.d.ts +53 -0
  148. package/dist/plugins/mcp/errors.d.ts +32 -0
  149. package/dist/plugins/mcp/index.d.ts +33 -0
  150. package/dist/plugins/mcp/index.js +5 -0
  151. package/dist/plugins/mcp/mount.d.ts +98 -0
  152. package/dist/plugins/mcp/names.d.ts +25 -0
  153. package/dist/plugins/mcp/render.d.ts +29 -0
  154. package/dist/plugins/mcp/slots.d.ts +15 -0
  155. package/dist/plugins/mcp/stdio.d.ts +49 -0
  156. package/dist/plugins/mcp/tools.d.ts +41 -0
  157. package/dist/plugins/mcp/version.d.ts +2 -0
  158. package/dist/plugins/routeNotice.d.ts +22 -0
  159. package/dist/plugins/routeNotice.js +1 -0
  160. package/dist/plugins/sandbox/absent.d.ts +33 -0
  161. package/dist/plugins/sandbox/client.d.ts +39 -0
  162. package/dist/plugins/sandbox/files.d.ts +28 -0
  163. package/dist/plugins/sandbox/index.d.ts +52 -0
  164. package/dist/plugins/sandbox/index.js +4 -0
  165. package/dist/plugins/sandbox/mode.d.ts +57 -0
  166. package/dist/plugins/sandbox/policy.d.ts +163 -0
  167. package/dist/plugins/sandbox/protocol.d.ts +107 -0
  168. package/dist/plugins/sandbox/service.d.ts +153 -0
  169. package/dist/plugins/sandbox/worker.d.ts +12 -0
  170. package/dist/plugins/sandbox/worker.js +1 -0
  171. package/dist/plugins/schedules/index.d.ts +21 -0
  172. package/dist/plugins/schedules/index.js +5 -0
  173. package/dist/plugins/schedules/record.d.ts +396 -0
  174. package/dist/plugins/schedules/service.d.ts +120 -0
  175. package/dist/plugins/schedules/time.d.ts +26 -0
  176. package/dist/plugins/schedules/tools.d.ts +6 -0
  177. package/dist/plugins/skills/discovery.d.ts +83 -0
  178. package/dist/plugins/skills/index.d.ts +31 -0
  179. package/dist/plugins/skills/index.js +1 -0
  180. package/dist/plugins/skills/tools.d.ts +11 -0
  181. package/dist/plugins/subAgents/availableRoutes.d.ts +53 -0
  182. package/dist/plugins/subAgents/index.d.ts +67 -0
  183. package/dist/plugins/subAgents/index.js +1 -0
  184. package/dist/plugins/subAgents/tools.d.ts +67 -0
  185. package/dist/plugins/threadDirs.d.ts +36 -0
  186. package/dist/plugins/threadDirs.js +1 -0
  187. package/dist/plugins/toolPolicy/index.d.ts +61 -0
  188. package/dist/plugins/toolPolicy/index.js +1 -0
  189. package/dist/plugins/truncateToolOutput.d.ts +30 -0
  190. package/dist/plugins/truncateToolOutput.js +6 -0
  191. package/dist/plugins/usage/index.d.ts +26 -0
  192. package/dist/plugins/usage/index.js +1 -0
  193. package/dist/plugins/usage/tracker.d.ts +34 -0
  194. package/dist/plugins/verify/index.d.ts +27 -0
  195. package/dist/plugins/verify/index.js +6 -0
  196. package/dist/plugins/verify/judgement.d.ts +16 -0
  197. package/dist/plugins/verify/record.d.ts +382 -0
  198. package/dist/plugins/verify/service.d.ts +93 -0
  199. package/dist/plugins/verify/state.d.ts +58 -0
  200. package/dist/plugins/webTools/html.d.ts +23 -0
  201. package/dist/plugins/webTools/index.d.ts +34 -0
  202. package/dist/plugins/webTools/index.js +1 -0
  203. package/dist/plugins/webTools/network.d.ts +23 -0
  204. package/dist/plugins/webTools/web.d.ts +32 -0
  205. package/dist/plugins/workflows/assignment.d.ts +20 -0
  206. package/dist/plugins/workflows/cleanup.d.ts +38 -0
  207. package/dist/plugins/workflows/definition.d.ts +184 -0
  208. package/dist/plugins/workflows/entryPlan.d.ts +95 -0
  209. package/dist/plugins/workflows/hostBindings.d.ts +146 -0
  210. package/dist/plugins/workflows/index.d.ts +28 -0
  211. package/dist/plugins/workflows/index.js +11 -0
  212. package/dist/plugins/workflows/observations.d.ts +81 -0
  213. package/dist/plugins/workflows/participantModels.d.ts +28 -0
  214. package/dist/plugins/workflows/participants.d.ts +143 -0
  215. package/dist/plugins/workflows/policy.d.ts +112 -0
  216. package/dist/plugins/workflows/record.d.ts +2849 -0
  217. package/dist/plugins/workflows/routing.d.ts +116 -0
  218. package/dist/plugins/workflows/schema.d.ts +26 -0
  219. package/dist/plugins/workflows/service.d.ts +477 -0
  220. package/dist/plugins/workflows/state.d.ts +373 -0
  221. package/dist/plugins/workflows/stopCheck.d.ts +13 -0
  222. package/dist/plugins/workflows/tools.d.ts +13 -0
  223. package/dist/plugins/workflows/view.d.ts +103 -0
  224. package/dist/plugins/workflows/workStatus.d.ts +21 -0
  225. package/dist/plugins/workspaceNotice.d.ts +36 -0
  226. package/dist/plugins/workspaceNotice.js +1 -0
  227. package/dist/providers/anthropic.d.ts +178 -0
  228. package/dist/providers/anthropicMessages.d.ts +66 -0
  229. package/dist/providers/codex.d.ts +71 -0
  230. package/dist/providers/codexAuth.d.ts +116 -0
  231. package/dist/providers/deepseek.d.ts +59 -0
  232. package/dist/providers/failure.d.ts +23 -0
  233. package/dist/providers/gateway.d.ts +24 -0
  234. package/dist/providers/index.d.ts +18 -0
  235. package/dist/providers/index.js +6 -0
  236. package/dist/providers/openaiChat.d.ts +73 -0
  237. package/dist/providers/openaiResponses.d.ts +109 -0
  238. package/dist/providers/opencodeCopilot.d.ts +23 -0
  239. package/dist/providers/opencodeGo.d.ts +109 -0
  240. package/dist/providers/shared.d.ts +112 -0
  241. package/dist/providers/stream.d.ts +156 -0
  242. package/dist/records/index.d.ts +13 -0
  243. package/dist/records/index.js +1 -0
  244. package/dist/records/journal.d.ts +2968 -0
  245. package/dist/records/toolResult.d.ts +65 -0
  246. package/dist/services/agents.d.ts +62 -0
  247. package/dist/services/catalogContributions.d.ts +73 -0
  248. package/dist/services/confinement/files.d.ts +118 -0
  249. package/dist/services/confinement/service.d.ts +219 -0
  250. package/dist/services/core.d.ts +28 -0
  251. package/dist/services/extensionEvents.d.ts +181 -0
  252. package/dist/services/journal.d.ts +26 -0
  253. package/dist/services/llm.d.ts +82 -0
  254. package/dist/services/modes.d.ts +65 -0
  255. package/dist/services/plugins.d.ts +34 -0
  256. package/dist/services/presets/definition.d.ts +154 -0
  257. package/dist/services/presets/installations.d.ts +139 -0
  258. package/dist/services/prompts.d.ts +85 -0
  259. package/dist/services/threads/activation.d.ts +100 -0
  260. package/dist/services/threads/admission.d.ts +174 -0
  261. package/dist/services/threads/birth.d.ts +219 -0
  262. package/dist/services/threads/index.d.ts +14 -0
  263. package/dist/services/threads/runEvents.d.ts +79 -0
  264. package/dist/services/threads/runOwner.d.ts +368 -0
  265. package/dist/services/threads/service.d.ts +450 -0
  266. package/dist/services/threads/thread.d.ts +268 -0
  267. package/dist/services/threads/view.d.ts +93 -0
  268. package/dist/services/tools.d.ts +118 -0
  269. package/dist/state/birth.d.ts +62 -0
  270. package/dist/state/chain.d.ts +46 -0
  271. package/dist/state/confirmations.d.ts +64 -0
  272. package/dist/state/continuation.d.ts +167 -0
  273. package/dist/state/decide.d.ts +72 -0
  274. package/dist/state/dispatches.d.ts +54 -0
  275. package/dist/state/errors.d.ts +26 -0
  276. package/dist/state/forks.d.ts +61 -0
  277. package/dist/state/holds.d.ts +104 -0
  278. package/dist/state/inbox.d.ts +188 -0
  279. package/dist/state/index.d.ts +31 -0
  280. package/dist/state/inputs.d.ts +58 -0
  281. package/dist/state/installations.d.ts +28 -0
  282. package/dist/state/limits.d.ts +14 -0
  283. package/dist/state/prompt.d.ts +13 -0
  284. package/dist/state/recovery.d.ts +7 -0
  285. package/dist/state/replace.d.ts +33 -0
  286. package/dist/state/requests.d.ts +129 -0
  287. package/dist/state/route.d.ts +61 -0
  288. package/dist/state/summary.d.ts +16 -0
  289. package/dist/state/surface.d.ts +153 -0
  290. package/dist/state/surfaceRead.d.ts +20 -0
  291. package/dist/state/thread.d.ts +73 -0
  292. package/dist/state/turns.d.ts +87 -0
  293. package/dist/state/waits.d.ts +38 -0
  294. package/dist/state/wake.d.ts +32 -0
  295. package/dist/stores/durableObject.d.ts +23 -0
  296. package/dist/stores/durableObject.js +1 -0
  297. package/dist/stores/durableObjectConnection.d.ts +27 -0
  298. package/dist/stores/memory.d.ts +29 -0
  299. package/dist/stores/sql.d.ts +59 -0
  300. package/dist/stores/sqlite.d.ts +31 -0
  301. package/dist/stores/sqlite.js +1 -0
  302. package/dist/sys/environment.d.ts +42 -0
  303. package/dist/sys/git.d.ts +47 -0
  304. package/dist/sys/paths.d.ts +9 -0
  305. package/dist/sys/spawn.d.ts +186 -0
  306. package/dist/testing/clock.d.ts +17 -0
  307. package/dist/testing/fakeLlm.d.ts +76 -0
  308. package/dist/testing/fedLlm.d.ts +34 -0
  309. package/dist/testing/helpers.d.ts +362 -0
  310. package/dist/testing/index.d.ts +13 -0
  311. package/dist/testing/index.js +1 -0
  312. package/dist/testing/processes.d.ts +13 -0
  313. package/dist/testing/settlement.d.ts +6 -0
  314. package/dist/testing/tmpDirs.d.ts +17 -0
  315. package/dist/util/async.d.ts +8 -0
  316. package/dist/util/diff.d.ts +25 -0
  317. package/dist/util/dispatch.d.ts +8 -0
  318. package/dist/util/errors.d.ts +28 -0
  319. package/dist/util/foldState.d.ts +17 -0
  320. package/dist/util/freeze.d.ts +2 -0
  321. package/dist/util/ids.d.ts +2 -0
  322. package/dist/util/json.d.ts +37 -0
  323. package/dist/util/jsonSchema.d.ts +7 -0
  324. package/dist/util/log.d.ts +6 -0
  325. package/dist/util/retries.d.ts +25 -0
  326. package/dist/util/text.d.ts +21 -0
  327. package/dist/util/timers.d.ts +43 -0
  328. package/package.json +183 -3
@@ -0,0 +1,396 @@
1
+ import { z } from 'zod';
2
+ import type { PluginJournal } from '../../journal/index.js';
3
+ import type { ExtensionRecord } from '../../records/journal.js';
4
+ import type { DeepReadonly } from '../../util/json.js';
5
+ /**
6
+ * What the journal keeps of a scheduled wake, on the thread it wakes, as `ext` rows of this plugin:
7
+ * its creation, with its due instant fixed then; its delivery (`fired`), whose write also queues the
8
+ * input; and its cancellation. Instants are epoch milliseconds.
9
+ */
10
+ declare const ScheduleRowSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
11
+ op: z.ZodLiteral<"created">;
12
+ id: z.ZodString;
13
+ due_at: z.ZodNumber;
14
+ prompt: z.ZodString;
15
+ reason: z.ZodString;
16
+ time_zone: z.ZodString;
17
+ created_at: z.ZodNumber;
18
+ call_seq: z.ZodNullable<z.ZodNumber>;
19
+ }, z.core.$strict>, z.ZodObject<{
20
+ op: z.ZodLiteral<"fired">;
21
+ id: z.ZodString;
22
+ input_id: z.ZodString;
23
+ }, z.core.$strict>, z.ZodObject<{
24
+ op: z.ZodLiteral<"cancelled">;
25
+ id: z.ZodString;
26
+ reason: z.ZodString;
27
+ }, z.core.$strict>], "op">;
28
+ export type ScheduleRow = z.output<typeof ScheduleRowSchema>;
29
+ export type ScheduleCreated = Extract<ScheduleRow, {
30
+ op: 'created';
31
+ }>;
32
+ export declare const scheduleRow: {
33
+ record: (value: {
34
+ op: "created";
35
+ id: string;
36
+ due_at: number;
37
+ prompt: string;
38
+ reason: string;
39
+ time_zone: string;
40
+ created_at: number;
41
+ call_seq: number | null;
42
+ } | {
43
+ op: "fired";
44
+ id: string;
45
+ input_id: string;
46
+ } | {
47
+ op: "cancelled";
48
+ id: string;
49
+ reason: string;
50
+ }) => ExtensionRecord;
51
+ parse: (value: {
52
+ op: "created";
53
+ id: string;
54
+ due_at: number;
55
+ prompt: string;
56
+ reason: string;
57
+ time_zone: string;
58
+ created_at: number;
59
+ call_seq: number | null;
60
+ } | {
61
+ op: "fired";
62
+ id: string;
63
+ input_id: string;
64
+ } | {
65
+ op: "cancelled";
66
+ id: string;
67
+ reason: string;
68
+ }) => {
69
+ op: "created";
70
+ id: string;
71
+ due_at: number;
72
+ prompt: string;
73
+ reason: string;
74
+ time_zone: string;
75
+ created_at: number;
76
+ call_seq: number | null;
77
+ } | {
78
+ op: "fired";
79
+ id: string;
80
+ input_id: string;
81
+ } | {
82
+ op: "cancelled";
83
+ id: string;
84
+ reason: string;
85
+ };
86
+ entry: (value: {
87
+ op: "created";
88
+ id: string;
89
+ due_at: number;
90
+ prompt: string;
91
+ reason: string;
92
+ time_zone: string;
93
+ created_at: number;
94
+ call_seq: number | null;
95
+ } | {
96
+ op: "fired";
97
+ id: string;
98
+ input_id: string;
99
+ } | {
100
+ op: "cancelled";
101
+ id: string;
102
+ reason: string;
103
+ }, options: import("../../journal/journal.js").AppendOptions) => {
104
+ type: "ext";
105
+ data: {
106
+ plugin: string;
107
+ instance_id: string;
108
+ kind: string;
109
+ version: number;
110
+ data: z.core.util.JSONType;
111
+ };
112
+ options: import("../../journal/journal.js").AppendOptions;
113
+ };
114
+ append(journal: PluginJournal, value: {
115
+ op: "created";
116
+ id: string;
117
+ due_at: number;
118
+ prompt: string;
119
+ reason: string;
120
+ time_zone: string;
121
+ created_at: number;
122
+ call_seq: number | null;
123
+ } | {
124
+ op: "fired";
125
+ id: string;
126
+ input_id: string;
127
+ } | {
128
+ op: "cancelled";
129
+ id: string;
130
+ reason: string;
131
+ }, options: import("../../journal/journal.js").AppendOptions): Promise<import("../../records/journal.js").JournalEvent<"ext">>;
132
+ read(event: import("../../records/journal.js").JournalEvent): {
133
+ op: "created";
134
+ id: string;
135
+ due_at: number;
136
+ prompt: string;
137
+ reason: string;
138
+ time_zone: string;
139
+ created_at: number;
140
+ call_seq: number | null;
141
+ } | {
142
+ op: "fired";
143
+ id: string;
144
+ input_id: string;
145
+ } | {
146
+ op: "cancelled";
147
+ id: string;
148
+ reason: string;
149
+ } | undefined;
150
+ contribution(message: {
151
+ role?: import("../../records/journal.js").InputRole;
152
+ content: string | readonly import("../../llm/content.js").ContentPartInput[];
153
+ }, value: {
154
+ op: "created";
155
+ id: string;
156
+ due_at: number;
157
+ prompt: string;
158
+ reason: string;
159
+ time_zone: string;
160
+ created_at: number;
161
+ call_seq: number | null;
162
+ } | {
163
+ op: "fired";
164
+ id: string;
165
+ input_id: string;
166
+ } | {
167
+ op: "cancelled";
168
+ id: string;
169
+ reason: string;
170
+ }, options?: {
171
+ sourceSeqs?: readonly import("../../records/journal.js").Seq[];
172
+ }): import("../../records/journal.js").StepContribution;
173
+ matchesSource(record: DeepReadonly<ExtensionRecord>): boolean;
174
+ rejection(reason: string, value: {
175
+ op: "created";
176
+ id: string;
177
+ due_at: number;
178
+ prompt: string;
179
+ reason: string;
180
+ time_zone: string;
181
+ created_at: number;
182
+ call_seq: number | null;
183
+ } | {
184
+ op: "fired";
185
+ id: string;
186
+ input_id: string;
187
+ } | {
188
+ op: "cancelled";
189
+ id: string;
190
+ reason: string;
191
+ }): {
192
+ decision: "reject";
193
+ reason: string;
194
+ source: ExtensionRecord;
195
+ };
196
+ readContribution: (event: import("../../records/journal.js").JournalEvent) => {
197
+ op: "created";
198
+ id: string;
199
+ due_at: number;
200
+ prompt: string;
201
+ reason: string;
202
+ time_zone: string;
203
+ created_at: number;
204
+ call_seq: number | null;
205
+ } | {
206
+ op: "fired";
207
+ id: string;
208
+ input_id: string;
209
+ } | {
210
+ op: "cancelled";
211
+ id: string;
212
+ reason: string;
213
+ } | undefined;
214
+ readSource: (source: DeepReadonly<ExtensionRecord> | null) => {
215
+ op: "created";
216
+ id: string;
217
+ due_at: number;
218
+ prompt: string;
219
+ reason: string;
220
+ time_zone: string;
221
+ created_at: number;
222
+ call_seq: number | null;
223
+ } | {
224
+ op: "fired";
225
+ id: string;
226
+ input_id: string;
227
+ } | {
228
+ op: "cancelled";
229
+ id: string;
230
+ reason: string;
231
+ } | undefined;
232
+ told: import("../../journal/projection.js").PluginProjection<import("../../services/extensionEvents.js").ToldNotices<{
233
+ op: "created";
234
+ id: string;
235
+ due_at: number;
236
+ prompt: string;
237
+ reason: string;
238
+ time_zone: string;
239
+ created_at: number;
240
+ call_seq: number | null;
241
+ } | {
242
+ op: "fired";
243
+ id: string;
244
+ input_id: string;
245
+ } | {
246
+ op: "cancelled";
247
+ id: string;
248
+ reason: string;
249
+ }>>;
250
+ projection<State>(fold: {
251
+ key: string;
252
+ init(): State;
253
+ apply(state: State, value: {
254
+ op: "created";
255
+ id: string;
256
+ due_at: number;
257
+ prompt: string;
258
+ reason: string;
259
+ time_zone: string;
260
+ created_at: number;
261
+ call_seq: number | null;
262
+ } | {
263
+ op: "fired";
264
+ id: string;
265
+ input_id: string;
266
+ } | {
267
+ op: "cancelled";
268
+ id: string;
269
+ reason: string;
270
+ }, event: import("../../records/journal.js").JournalEvent<"ext">): State;
271
+ onFork?: "inherit" | "reset";
272
+ }): import("../../journal/projection.js").PluginProjection<State>;
273
+ };
274
+ /** One scheduled wake as its rows leave it. */
275
+ export type Schedule = {
276
+ readonly created: ScheduleCreated;
277
+ /** The input its delivery queued, once delivered. */
278
+ readonly delivered: string | null;
279
+ readonly cancelled: boolean;
280
+ };
281
+ /** Where a wake stands: `pending` until it fires, then `fired`, unless cancelled before or after. */
282
+ export type ScheduleStatus = 'pending' | 'fired' | 'cancelled';
283
+ export declare const scheduleStatus: (schedule: Schedule) => ScheduleStatus;
284
+ /** A thread's scheduled wakes, by id. Resets at a fork's spawn row: a fork inherits none. */
285
+ export declare const schedules: import("../../journal/projection.js").PluginProjection<Map<string, Schedule>>;
286
+ /**
287
+ * What a thread contributes to its catalog entry: the earliest due instant among its pending wakes,
288
+ * `null` with none, so due work is found from the catalog without loading anything.
289
+ */
290
+ export declare const nextWake: import("../../services/catalogContributions.js").ContributionDefinition<{
291
+ next_wake_at: number | null;
292
+ }>;
293
+ /**
294
+ * When `threadId` next needs a look: `null` for never, and for a thread whose entry cannot be read,
295
+ * which a later write of its summary corrects.
296
+ */
297
+ export declare function nextWakeOf(journal: PluginJournal, threadId: string): number | null;
298
+ declare const WakeSourceSchema: z.ZodObject<{
299
+ schedule_id: z.ZodString;
300
+ due_at: z.ZodNumber;
301
+ summary: z.ZodString;
302
+ }, z.core.$strict>;
303
+ export type ScheduledWake = z.output<typeof WakeSourceSchema>;
304
+ /**
305
+ * The source of a delivered wake: the input a schedule queues on its thread. `summary` is one
306
+ * bounded line naming the schedule and its reason, for a host to show collapsed.
307
+ */
308
+ export declare const scheduledWake: {
309
+ record: (value: {
310
+ schedule_id: string;
311
+ due_at: number;
312
+ summary: string;
313
+ }) => ExtensionRecord;
314
+ parse: (value: {
315
+ schedule_id: string;
316
+ due_at: number;
317
+ summary: string;
318
+ }) => {
319
+ schedule_id: string;
320
+ due_at: number;
321
+ summary: string;
322
+ };
323
+ entry: (value: {
324
+ schedule_id: string;
325
+ due_at: number;
326
+ summary: string;
327
+ }, options: import("../../journal/journal.js").AppendOptions) => {
328
+ type: "ext";
329
+ data: {
330
+ plugin: string;
331
+ instance_id: string;
332
+ kind: string;
333
+ version: number;
334
+ data: z.core.util.JSONType;
335
+ };
336
+ options: import("../../journal/journal.js").AppendOptions;
337
+ };
338
+ append(journal: PluginJournal, value: {
339
+ schedule_id: string;
340
+ due_at: number;
341
+ summary: string;
342
+ }, options: import("../../journal/journal.js").AppendOptions): Promise<import("../../records/journal.js").JournalEvent<"ext">>;
343
+ read(event: import("../../records/journal.js").JournalEvent): {
344
+ schedule_id: string;
345
+ due_at: number;
346
+ summary: string;
347
+ } | undefined;
348
+ contribution(message: {
349
+ role?: import("../../records/journal.js").InputRole;
350
+ content: string | readonly import("../../llm/content.js").ContentPartInput[];
351
+ }, value: {
352
+ schedule_id: string;
353
+ due_at: number;
354
+ summary: string;
355
+ }, options?: {
356
+ sourceSeqs?: readonly import("../../records/journal.js").Seq[];
357
+ }): import("../../records/journal.js").StepContribution;
358
+ matchesSource(record: DeepReadonly<ExtensionRecord>): boolean;
359
+ rejection(reason: string, value: {
360
+ schedule_id: string;
361
+ due_at: number;
362
+ summary: string;
363
+ }): {
364
+ decision: "reject";
365
+ reason: string;
366
+ source: ExtensionRecord;
367
+ };
368
+ readContribution: (event: import("../../records/journal.js").JournalEvent) => {
369
+ schedule_id: string;
370
+ due_at: number;
371
+ summary: string;
372
+ } | undefined;
373
+ readSource: (source: DeepReadonly<ExtensionRecord> | null) => {
374
+ schedule_id: string;
375
+ due_at: number;
376
+ summary: string;
377
+ } | undefined;
378
+ told: import("../../journal/projection.js").PluginProjection<import("../../services/extensionEvents.js").ToldNotices<{
379
+ schedule_id: string;
380
+ due_at: number;
381
+ summary: string;
382
+ }>>;
383
+ projection<State>(fold: {
384
+ key: string;
385
+ init(): State;
386
+ apply(state: State, value: {
387
+ schedule_id: string;
388
+ due_at: number;
389
+ summary: string;
390
+ }, event: import("../../records/journal.js").JournalEvent<"ext">): State;
391
+ onFork?: "inherit" | "reset";
392
+ }): import("../../journal/projection.js").PluginProjection<State>;
393
+ };
394
+ /** What a wake's source carries, when `source` is one; `undefined` for any other. For a host drawing it. */
395
+ export declare const readScheduledWake: (source: DeepReadonly<ExtensionRecord> | null) => ScheduledWake | undefined;
396
+ export {};
@@ -0,0 +1,120 @@
1
+ import { Service, type Context } from '@leuduan/cordis';
2
+ import { z } from 'zod';
3
+ import type { AppendEntry } from '../../journal/index.js';
4
+ import { type ScheduleStatus } from './record.js';
5
+ declare module '@leuduan/cordis' {
6
+ interface Context {
7
+ /** Scheduled wakes of root threads (optional plugin). */
8
+ schedules: SchedulesService;
9
+ }
10
+ }
11
+ export declare const SchedulesConfigSchema: z.ZodObject<{
12
+ clock: z.ZodCustom<import("../../util/timers.js").Clock, import("../../util/timers.js").Clock>;
13
+ timeZone: z.ZodString;
14
+ maxDelayMs: z.ZodNumber;
15
+ maxPendingPerThread: z.ZodNumber;
16
+ }, z.core.$strict>;
17
+ export type SchedulesConfig = z.input<typeof SchedulesConfigSchema>;
18
+ /** What a wake is asked for: when, what to deliver, and one line saying why, for the person. */
19
+ export type ScheduleRequest = {
20
+ readonly when: {
21
+ readonly in_seconds: number;
22
+ } | {
23
+ readonly at: string;
24
+ };
25
+ readonly prompt: string;
26
+ readonly reason: string;
27
+ };
28
+ /** A wake as a host or a tool reports it. Instants are epoch milliseconds. */
29
+ export type ScheduleInfo = {
30
+ readonly id: string;
31
+ readonly threadId: string;
32
+ readonly dueAt: number;
33
+ readonly timeZone: string;
34
+ readonly prompt: string;
35
+ readonly reason: string;
36
+ readonly status: ScheduleStatus;
37
+ /** A fired wake whose delivery is still queued: the conversation has not read it, and a cancel withdraws it. */
38
+ readonly unread: boolean;
39
+ readonly createdAt: number;
40
+ };
41
+ /** Why a wake was not created or cancelled, in words for the model or the person. */
42
+ export declare class ScheduleRefusedError extends Error {
43
+ constructor(message: string);
44
+ }
45
+ export declare const ORIGIN_REFUSAL = "Scheduled wakes are for conversations a person talks to; an agent working for another agent cannot schedule one.";
46
+ /** Why a wake is not created outside a person's turn. */
47
+ export declare const PERSON_TURN_REFUSAL = "A scheduled wake can be created only in a turn a person started, not from a wake or a notice. Tell the person what to schedule, or ask them.";
48
+ /** The wake a `schedule_wake` call creates: its id is the call, so a redispatch finds it. */
49
+ export declare const scheduleIdOf: (callSeq: number) => string;
50
+ /** The input id of a delivery: a redelivery queues nothing. */
51
+ export declare const wakeInputId: (scheduleId: string) => string;
52
+ /** An instant as the model and the person read it: ISO, in UTC, without empty milliseconds. */
53
+ export declare const iso: (instant: number) => string;
54
+ /**
55
+ * Scheduled wakes: at its due instant a wake delivers its prompt to the root thread that owns it,
56
+ * as sourced user input with a `fresh` cause, the `fired` record in the same write. A delivery and
57
+ * a cancel each decide inside their own write, which the journal orders: a cancel that commits
58
+ * first stops the delivery, and one that commits after it withdraws the delivery, keyed by the
59
+ * wake, in the same write. Due work is found from the catalog (`next_wake_at`) and kept on one timer queue; at
60
+ * startup it fires through a repair-only constraint registration. Reasons in `docs/records/schedules.md`.
61
+ */
62
+ export declare class SchedulesService extends Service<SchedulesConfig> {
63
+ static inject: string[];
64
+ readonly config: z.output<typeof SchedulesConfigSchema>;
65
+ private readonly queue;
66
+ /** Wake checks, deliveries and cancels in flight, which shutdown waits for. */
67
+ private readonly inFlight;
68
+ private refreshed;
69
+ /** Set once startup's due work is done: rows arm the queue from then on. */
70
+ private armed;
71
+ /** Due checks that failed, by thread: the next is put off, not retried at once. */
72
+ private readonly retries;
73
+ private closed;
74
+ constructor(ctx: Context, config: SchedulesConfig);
75
+ /**
76
+ * Every wake of `threadId`, oldest first, whatever its status. Synchronous, by a caller that holds
77
+ * the thread, as `ctx.threads.view` is: a tool running on it, or a host retaining it.
78
+ */
79
+ list({ threadId }: {
80
+ readonly threadId: string;
81
+ }): ScheduleInfo[];
82
+ /**
83
+ * Creates a wake on root thread `threadId`, due within `maxDelayMs`; the per-thread cap and the
84
+ * due instant are checked again inside its write. `callSeq` is the `tool/call` creating it, whose
85
+ * redispatch returns the wake it made, whatever would be refused now; the host passes none.
86
+ * `requirePersonTurn` refuses it unless the thread's open turn has a person's authority, as the
87
+ * tool asks. Refusals throw {@link ScheduleRefusedError}.
88
+ */
89
+ create(threadId: string, request: ScheduleRequest, options?: {
90
+ readonly callSeq?: number;
91
+ readonly requirePersonTurn?: boolean;
92
+ }): Promise<ScheduleInfo>;
93
+ /**
94
+ * Cancels wake `id` of `threadId`: it does not fire, and a delivery still queued is withdrawn in
95
+ * the same write. Resolves with whether one was withdrawn. An unknown id is refused.
96
+ */
97
+ cancel(threadId: string, id: string, reason?: string): Promise<{
98
+ withdrawn: boolean;
99
+ }>;
100
+ /**
101
+ * The rows that cancel every pending wake of `threadId`, for a host's thread `cancel` to carry
102
+ * (`rows`): built inside that write, which clears the inbox, and so any queued delivery, itself.
103
+ */
104
+ cancelRows(threadId: string, reason?: string): AppendEntry<'ext'>[];
105
+ private thread;
106
+ /** The `created` row for `request`, its due instant checked against now; refusals throw. */
107
+ private createdRow;
108
+ /** Runs `task`, which shutdown waits for while it is in flight. */
109
+ private track;
110
+ /** Startup's due work, then arming: run at `start`, or at registration once started. */
111
+ private catchUp;
112
+ /** Sets the thread's timer entry from its catalog contribution, which is current when a row's subscriber runs. */
113
+ private arm;
114
+ /** Delivers whatever of `threadId`'s wakes is due now; in flight from its entry, so shutdown waits for its read too. */
115
+ private check;
116
+ private deliverDue;
117
+ /** Delivers wake `id`, unless a cancel or another delivery committed first. */
118
+ private fire;
119
+ private shutdown;
120
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Wall-clock times in a recorded IANA zone, computed through `Intl.DateTimeFormat` offsets, with no
3
+ * dependency. A local time inside a daylight-saving gap occurs at the gap's end, the first valid
4
+ * instant; a local time that repeats occurs once, at the earlier instant.
5
+ */
6
+ /** Whether `zone` is an IANA time zone this runtime knows. */
7
+ export declare function validZone(zone: string): boolean;
8
+ /** A wall-clock time in some zone, minute precision. */
9
+ export type LocalTime = {
10
+ readonly year: number;
11
+ readonly month: number;
12
+ readonly day: number;
13
+ readonly hour: number;
14
+ readonly minute: number;
15
+ };
16
+ /**
17
+ * The instant `local` occurs in `zone`: its earlier instant when it repeats, and the end of the gap
18
+ * when it falls inside one.
19
+ */
20
+ export declare function instantOf(local: LocalTime, zone: string): number;
21
+ /**
22
+ * An `at` time: an ISO date and time with an explicit offset (`Z`, `+02:00`), read as given, or
23
+ * without one, read in `zone`. `null` when it is not such a time, or names a date or time that does
24
+ * not exist on the calendar (month 13, 30 February, second 61).
25
+ */
26
+ export declare function parseAt(text: string, zone: string): number | null;
@@ -0,0 +1,6 @@
1
+ import type { Tool } from '../../loop/index.js';
2
+ export declare const scheduleWakeTool: Tool;
3
+ export declare const listWakesTool: Tool;
4
+ export declare const cancelWakeTool: Tool;
5
+ /** The tools `schedules` registers, by name. */
6
+ export declare const SCHEDULE_TOOLS: readonly ["schedule_wake", "list_wakes", "cancel_wake"];
@@ -0,0 +1,83 @@
1
+ import type { FileScope } from '../../services/confinement/files.js';
2
+ export type SkillDocument = {
3
+ name: string;
4
+ directoryName: string;
5
+ path: string;
6
+ description: string;
7
+ whenToUse: string;
8
+ aliases: string[];
9
+ body: string;
10
+ frontmatter: Record<string, unknown>;
11
+ };
12
+ /** Splits a `SKILL.md` into its YAML frontmatter and body. */
13
+ export declare function parseFrontmatter(text: string): {
14
+ frontmatter: Record<string, unknown>;
15
+ body: string;
16
+ };
17
+ /** Where a thread's own skills live, relative to its `cwd`, searched before the host's roots. */
18
+ export declare const DEFAULT_WORKSPACE_SKILL_ROOTS: readonly string[];
19
+ /**
20
+ * The user's own skill root under `home`, `<home>/.claude/skills`, for a host to pass as a root of
21
+ * its own: lagent never looks in a home directory by itself.
22
+ */
23
+ export declare const userSkillRoots: (home: string) => string[];
24
+ /** A thread's search order: its workspace roots under `cwd` first, then the host's absolute roots. */
25
+ export declare function resolveSkillRoots(cwd: string, roots: {
26
+ readonly workspace: readonly string[];
27
+ readonly host: readonly string[];
28
+ }): string[];
29
+ /**
30
+ * A skill document that cannot be used as it is: not a regular file, too large, or its frontmatter does
31
+ * not parse. Never a refusal, a missing file or a stop: those are the facade's own errors.
32
+ */
33
+ export declare class SkillDocumentError extends Error {
34
+ constructor(message: string, options?: ErrorOptions);
35
+ }
36
+ /**
37
+ * Reads the skill document at `path` through `files`, the verified handle and the policy of the
38
+ * operation it belongs to, which is the one way any skill file is read.
39
+ */
40
+ export declare function readSkillDocument(files: FileScope, path: string, directoryName: string): Promise<SkillDocument>;
41
+ /** A file or directory discovery skipped, and why. */
42
+ export type SkippedSkill = {
43
+ readonly path: string;
44
+ readonly reason: string;
45
+ };
46
+ /**
47
+ * Walks the roots for `SKILL.md` files, through `files`; the first skill claiming a name or alias
48
+ * wins. A document that cannot be read or parsed, a directory that cannot be listed and a root the
49
+ * policy refuses are skipped and passed to `skipped`, so one broken skill never hides the others. A
50
+ * root that does not exist is not a problem. Nothing here touches the file system but through `files`.
51
+ */
52
+ export declare function discoverSkills(files: FileScope, roots: readonly string[], skipped?: (skip: SkippedSkill) => void, signal?: AbortSignal): Promise<SkillDocument[]>;
53
+ /**
54
+ * What one thread's activation found: the roots it searched from its `cwd`, and the skills in them,
55
+ * read under one policy (`identity`) at one state of the confinement (`epoch`). Content read under
56
+ * another is not delivered: see the `skill` tool and the listing.
57
+ */
58
+ export type SkillCatalog = {
59
+ readonly workspaceRoot: string;
60
+ readonly roots: readonly string[];
61
+ readonly skills: readonly SkillDocument[];
62
+ /** How the facade it was read through judged reads (`FileScope.identity`). */
63
+ readonly identity: string;
64
+ /** `ConfinementService.epoch` before it was read. */
65
+ readonly epoch: number;
66
+ /** Why there is no catalog, when the operation it needed was refused; else `null`. */
67
+ readonly unavailable: string | null;
68
+ };
69
+ /**
70
+ * Searches the roots for a thread working in `cwd`, once, through `files`: everything after reads
71
+ * the result. What discovery skipped goes to `skipped`.
72
+ */
73
+ export declare function prepareSkillCatalog(files: FileScope, cwd: string, roots: {
74
+ readonly workspace: readonly string[];
75
+ readonly host: readonly string[];
76
+ }, noted: {
77
+ readonly identity: string;
78
+ readonly epoch: number;
79
+ }, skipped?: (skip: SkippedSkill) => void, signal?: AbortSignal): Promise<SkillCatalog>;
80
+ /** The catalog of a thread whose operation was refused: no skills, and why. */
81
+ export declare const unavailableCatalog: (cwd: string, epoch: number, reason: string) => SkillCatalog;
82
+ /** The catalog as the model reads it: one line per skill, paths relative to the workspace where inside it. */
83
+ export declare function formatSkillListing({ skills, workspaceRoot, roots }: SkillCatalog): string;
@@ -0,0 +1,31 @@
1
+ import { type Plugin } from '@leuduan/cordis';
2
+ import { z } from 'zod';
3
+ export { DEFAULT_WORKSPACE_SKILL_ROOTS, userSkillRoots } from './discovery.js';
4
+ export { SKILL_TOOL } from './tools.js';
5
+ declare const SkillsConfigSchema: z.ZodObject<{
6
+ roots: z.ZodArray<z.ZodString>;
7
+ workspaceRoots: z.ZodDefault<z.ZodArray<z.ZodString>>;
8
+ agents: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodLiteral<"global">, z.ZodLiteral<"all">]>>;
9
+ autoload: z.ZodDefault<z.ZodBoolean>;
10
+ }, z.core.$strict>;
11
+ export type SkillsConfig = z.input<typeof SkillsConfigSchema>;
12
+ /**
13
+ * Filesystem-backed skills: the `skill` tool that loads one by name, and the prompt listing that
14
+ * tells an agent that may call it which are available. The roots outside a workspace are the host's,
15
+ * so the host mounts it, once, on the root, and a preset such as `codexPreset` grants the tool.
16
+ *
17
+ * A thread's activation gets the catalog of its `cwd` and keeps it for as long as it lives: the
18
+ * prompt listing, the tool's listing and its loads all read that one snapshot, skill bodies
19
+ * included, and nothing searches the filesystem while a prompt is rendered or a call runs. The
20
+ * roots are searched when an activation finds no live activation in the same workspace holding a
21
+ * catalog, which it otherwise shares; the last activation to hold one drops it, so a root mount
22
+ * serving several workspaces holds at most one catalog per workspace with a live activation. A
23
+ * document that cannot be read or parsed is skipped and reported once through `reportError`; it
24
+ * never fails an activation. Rebuild rule: an activation in a workspace no live activation holds
25
+ * searches again; `rebuildPrompt` re-renders from the current activation's catalog, so a skill added
26
+ * since is listed only once the workspace's activations have all gone and the thread is activated
27
+ * afresh (a configuration change, a release, a restart). A fork inherits its source's recorded
28
+ * prompt, listing included, while its own activation may hold a newer catalog, which its `skill`
29
+ * calls then read.
30
+ */
31
+ export declare const skills: Plugin.Object<SkillsConfig>;
@@ -0,0 +1 @@
1
+ import{a,b,c,d}from"../../chunks/2P47AHNK.js";import"../../chunks/VYMT4TXD.js";import"../../chunks/3UMZMPWW.js";import"../../chunks/34KW6VNQ.js";import"../../chunks/JFX2MXBA.js";import"../../chunks/S34ZA2R6.js";import"../../chunks/CUK7CGC7.js";import"../../chunks/BPRCULZH.js";import"../../chunks/FJLU4UH3.js";import"../../chunks/DDANMY45.js";import"../../chunks/BBCW2FZK.js";import"../../chunks/MMNNZCBO.js";import"../../chunks/G44LG6VL.js";import"../../chunks/D4PQP5MA.js";export{a as DEFAULT_WORKSPACE_SKILL_ROOTS,c as SKILL_TOOL,d as skills,b as userSkillRoots};
@@ -0,0 +1,11 @@
1
+ import type { Tool } from '../../loop/index.js';
2
+ import { type SkillCatalog } from './discovery.js';
3
+ /** The tool's name, which a preset grants. */
4
+ export declare const SKILL_TOOL = "skill";
5
+ /**
6
+ * Loads filesystem-backed skills on demand; contents are returned only when asked for by name.
7
+ * `catalogOf` gives the calling thread's catalog, the one its activation prepared, so a call lists
8
+ * and loads what the prompt listed rather than searching again; `undefined` for a thread activated
9
+ * before the catalog's owner was mounted.
10
+ */
11
+ export declare const skillTool: (catalogOf: (threadId: string) => SkillCatalog | undefined) => Tool;