akanjs 3.0.0-alpha.7 → 3.0.0-alpha.71

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 (719) hide show
  1. package/CHANGELOG.md +103 -0
  2. package/README.ko.md +1 -1
  3. package/README.md +1 -1
  4. package/base/baseEnv.ts +7 -4
  5. package/base/primitiveRegistry.ts +59 -12
  6. package/base/symbols.ts +4 -0
  7. package/client/capacitor.ts +34 -0
  8. package/client/clientRuntime.ts +5 -0
  9. package/client/csrTypes.ts +4 -3
  10. package/client/index.ts +1 -0
  11. package/client/locale.ts +2 -2
  12. package/client/router.ts +7 -7
  13. package/client/sharedContext.ts +31 -0
  14. package/client/translator.ts +2 -2
  15. package/client/types.ts +3 -3
  16. package/common/Logger.ts +280 -67
  17. package/common/clientAddress.ts +40 -0
  18. package/common/deepObjectify.ts +24 -9
  19. package/common/index.ts +42 -1
  20. package/common/logContext.ts +27 -0
  21. package/common/mcpExposure.ts +114 -0
  22. package/common/pathGetLoose.ts +31 -0
  23. package/common/pathSet.ts +17 -5
  24. package/common/plainFieldsOf.ts +13 -0
  25. package/common/routeConvention.ts +22 -12
  26. package/common/websocketBinaryFrame.ts +46 -0
  27. package/constant/crystalize.ts +94 -28
  28. package/constant/dateSlot.ts +62 -0
  29. package/constant/deserialize.ts +3 -2
  30. package/constant/fieldInfo.ts +43 -3
  31. package/constant/fieldQueryMeta.ts +35 -0
  32. package/constant/getDefault.ts +16 -11
  33. package/constant/hydrationPlan.ts +72 -0
  34. package/constant/immerify.ts +4 -6
  35. package/constant/index.ts +5 -0
  36. package/constant/labelOf.ts +26 -0
  37. package/constant/mask.ts +67 -0
  38. package/constant/purify.ts +17 -11
  39. package/constant/textFieldPaths.ts +13 -7
  40. package/constant/types.ts +19 -13
  41. package/constant/via.ts +24 -17
  42. package/dictionary/DictionaryLookup.ts +30 -0
  43. package/dictionary/agent.dictionary.ts +31 -0
  44. package/dictionary/agentTurn.dictionary.ts +29 -0
  45. package/dictionary/base.dictionary.ts +81 -0
  46. package/dictionary/dictInfo.ts +11 -2
  47. package/dictionary/dictionary.ts +9 -3
  48. package/dictionary/index.ts +1 -0
  49. package/dictionary/trans.ts +2 -2
  50. package/document/documentQuery.ts +1 -0
  51. package/document/filterMeta.ts +77 -12
  52. package/document/index.ts +1 -0
  53. package/document/noDocumentError.ts +12 -0
  54. package/document/types.ts +0 -1
  55. package/fetch/agentTurn.ts +19 -0
  56. package/fetch/client/fetchClient.ts +137 -37
  57. package/fetch/client/httpClient.ts +95 -20
  58. package/fetch/client/wsClient.ts +27 -12
  59. package/fetch/fetchType/appliedReturn.type.ts +65 -44
  60. package/fetch/fetchType/endpointFetch.type.ts +17 -8
  61. package/fetch/fetchType/sliceFetch.type.ts +27 -50
  62. package/fetch/index.ts +1 -0
  63. package/index.ts +80 -6
  64. package/local/apps/akan/akan-local.db +0 -0
  65. package/local/apps/akan/akan-local.db-shm +0 -0
  66. package/local/apps/akan/akan-local.db-wal +0 -0
  67. package/local/apps/akan/akan-local_solid.db +0 -0
  68. package/local/apps/akan/akan-local_solid.db-shm +0 -0
  69. package/local/apps/akan/akan-local_solid.db-wal +0 -0
  70. package/local/apps/serverLifecycle/serverLifecycle-local.db +0 -0
  71. package/local/apps/serverLifecycle/serverLifecycle-local.db-shm +0 -0
  72. package/local/apps/serverLifecycle/serverLifecycle-local.db-wal +0 -0
  73. package/local/apps/serverLifecycle/serverLifecycle-local_solid.db +0 -0
  74. package/local/apps/serverLifecycle/serverLifecycle-local_solid.db-shm +0 -0
  75. package/local/apps/serverLifecycle/serverLifecycle-local_solid.db-wal +0 -0
  76. package/package.json +27 -18
  77. package/server/akanApp.ts +278 -138
  78. package/server/akanAppHeaders.ts +16 -2
  79. package/server/akanOption.ts +63 -8
  80. package/server/akanServer.ts +387 -32
  81. package/server/animatedImage.ts +83 -0
  82. package/server/assetEncoding.ts +4 -24
  83. package/server/binaryPubsub.ts +55 -0
  84. package/server/console.ts +110 -101
  85. package/server/consoleEvaluator.ts +51 -0
  86. package/server/consolePasteFilter.ts +91 -0
  87. package/server/consoleSession.ts +242 -0
  88. package/server/contentEncoding.ts +83 -0
  89. package/server/devtools/signalSerializer.ts +2 -2
  90. package/server/devtools/types.ts +4 -4
  91. package/server/di/diLifecycle.ts +123 -13
  92. package/server/di/predefinedAdaptor.ts +6 -0
  93. package/server/di/utils.ts +40 -0
  94. package/server/imageOptimizer.ts +154 -57
  95. package/server/lifecycle/runtimeDir.ts +14 -0
  96. package/server/lifecycle/shutdownManager.ts +1 -1
  97. package/server/logging/childOutputReader.ts +137 -0
  98. package/server/logging/hubFileSink.ts +39 -0
  99. package/server/logging/logControlSocket.ts +173 -0
  100. package/server/logging/logForwarder.ts +131 -0
  101. package/server/logging/logHub.ts +0 -0
  102. package/server/logging/logQuery.ts +130 -0
  103. package/server/logging/logStdoutWriter.ts +39 -0
  104. package/server/logging/logStreamRoute.ts +87 -0
  105. package/server/logging/logTailClient.ts +161 -0
  106. package/server/mcp/McpAuth.ts +177 -0
  107. package/server/mcp/McpDispatcher.ts +289 -0
  108. package/server/mcp/McpEventStream.ts +24 -0
  109. package/server/mcp/McpExecutionContext.ts +105 -0
  110. package/server/mcp/McpRouter.ts +621 -0
  111. package/server/mcp/index.ts +5 -0
  112. package/server/processMetricsCollector.ts +1 -1
  113. package/server/resolver/database.resolver.ts +5 -4
  114. package/server/resolver/signal.resolver.ts +208 -86
  115. package/server/routeTreeBuilder.ts +10 -8
  116. package/server/routing/apiRouter.ts +44 -14
  117. package/server/routing/appWsData.ts +24 -2
  118. package/server/routing/eventStream.ts +93 -0
  119. package/server/routing/soloAppRoutes.ts +50 -0
  120. package/server/rscWorker.tsx +36 -22
  121. package/server/rscWorkerHost.ts +59 -8
  122. package/server/semaphore.ts +22 -0
  123. package/server/subRouteIndexDocument.tsx +61 -0
  124. package/server/systemPageDocument.tsx +3 -3
  125. package/server/systemPages.tsx +49 -16
  126. package/server/types.tsx +28 -0
  127. package/server/vendor/akanjs-fetch.ts +1 -0
  128. package/server/webRouter.ts +96 -39
  129. package/service/adapt.ts +4 -4
  130. package/service/agent.service.ts +81 -0
  131. package/service/base.service.ts +2 -1
  132. package/service/index.ts +1 -0
  133. package/service/injectInfo.ts +8 -3
  134. package/service/ipcTypes.ts +6 -0
  135. package/service/predefinedAdaptor/compress.adaptor.ts +5 -1
  136. package/service/predefinedAdaptor/database.adaptor.ts +68 -37
  137. package/service/predefinedAdaptor/deepseekLlm.ts +271 -0
  138. package/service/predefinedAdaptor/index.ts +3 -0
  139. package/service/predefinedAdaptor/insightQuery.ts +183 -0
  140. package/service/predefinedAdaptor/llm.adaptor.ts +115 -0
  141. package/service/predefinedAdaptor/logging.adaptor.ts +1 -1
  142. package/service/predefinedAdaptor/queue.adaptor.ts +5 -2
  143. package/service/predefinedAdaptor/role.adaptor.ts +2 -0
  144. package/service/predefinedAdaptor/schedule.adaptor.ts +12 -5
  145. package/service/predefinedAdaptor/solidPubsub.adaptor.ts +10 -6
  146. package/service/predefinedAdaptor/solidQueue.adaptor.ts +6 -2
  147. package/service/predefinedAdaptor/solidSqlite.ts +11 -9
  148. package/service/predefinedAdaptor/websocket.adaptor.ts +6 -1
  149. package/service/serve.ts +16 -9
  150. package/service/toolNames.ts +119 -0
  151. package/signal/agent/AgentCatalogue.ts +165 -0
  152. package/signal/agent/index.ts +1 -0
  153. package/signal/agent.signal.ts +38 -0
  154. package/signal/agentTurn.ts +8 -0
  155. package/signal/agentTurnStream.ts +60 -0
  156. package/signal/base.signal.ts +2 -1
  157. package/signal/endpointInfo.ts +38 -2
  158. package/signal/guard.ts +28 -1
  159. package/signal/guards.ts +49 -1
  160. package/signal/index.ts +6 -0
  161. package/signal/intercept.ts +4 -4
  162. package/signal/internalArg.ts +21 -4
  163. package/signal/mcp/McpDocument.ts +326 -0
  164. package/signal/mcp/McpProgress.ts +106 -0
  165. package/signal/mcp/McpUriTemplate.ts +80 -0
  166. package/signal/mcp/Msg.ts +368 -0
  167. package/signal/mcp/index.ts +5 -0
  168. package/signal/mcp/mcpProtocol.ts +120 -0
  169. package/signal/middleware.ts +3 -3
  170. package/signal/openapi/openapi.ts +36 -173
  171. package/signal/schema/JsonSchemaBuilder.ts +221 -0
  172. package/signal/schema/index.ts +1 -0
  173. package/signal/serializer/fetch.serializer.ts +51 -0
  174. package/signal/signalContext.ts +324 -76
  175. package/signal/slice.ts +62 -27
  176. package/signal/trace.ts +268 -9
  177. package/signal/types.ts +55 -4
  178. package/store/action.ts +34 -41
  179. package/store/actionTag.ts +33 -0
  180. package/store/agent/AgentBridge.ts +87 -0
  181. package/store/agent/AgentContext.ts +71 -0
  182. package/store/agent/AgentPrompts.ts +111 -0
  183. package/store/agent/ScreenReader.ts +349 -0
  184. package/store/agent/ScreenSettle.ts +45 -0
  185. package/store/agent/ScreenTarget.ts +135 -0
  186. package/store/agent/StoreCatalogue.ts +116 -0
  187. package/store/agent/StoreSurfaceSource.ts +225 -0
  188. package/store/agent/index.ts +13 -0
  189. package/store/agent/storeSurface.ts +28 -0
  190. package/store/agent/types.ts +16 -0
  191. package/store/agentic/AgentValue.ts +119 -0
  192. package/store/agentic/StExposeBuilder.ts +47 -0
  193. package/store/agentic/StExposeDraft.ts +24 -0
  194. package/store/agentic/StStateBuilder.ts +85 -0
  195. package/store/agentic/StStateDraft.ts +23 -0
  196. package/store/agentic/StToolBuilder.ts +279 -0
  197. package/store/agentic/StToolDraft.ts +22 -0
  198. package/store/agentic/attachAgentic.ts +33 -0
  199. package/store/agentic/formFields.ts +194 -0
  200. package/store/agentic/index.ts +12 -0
  201. package/store/agentic/useFieldTool.ts +183 -0
  202. package/store/agentic/useFormTools.ts +77 -0
  203. package/store/agentic/useRelationFieldTool.ts +113 -0
  204. package/store/baseSt.ts +1 -1
  205. package/store/databaseStateNames.ts +31 -0
  206. package/store/formSetterNames.ts +35 -0
  207. package/store/index.ts +8 -0
  208. package/store/rootStore.ts +3 -1
  209. package/store/sliceRole.ts +36 -0
  210. package/store/state.ts +2 -12
  211. package/store/store.ts +9 -0
  212. package/store/storeInstance.ts +185 -20
  213. package/store/storeRegistry.ts +39 -1
  214. package/store/types.ts +5 -0
  215. package/store/withSelector.ts +5 -4
  216. package/test/index.ts +1 -1
  217. package/test/registerDom.ts +4 -0
  218. package/test/sampleOf.ts +2 -0
  219. package/test/signalTestRuntime.ts +5 -5
  220. package/test/testServer.ts +14 -11
  221. package/types/base/baseEnv.d.ts +1 -1
  222. package/types/base/primitiveRegistry.d.ts +20 -8
  223. package/types/base/symbols.d.ts +4 -0
  224. package/types/client/capacitor.d.ts +39 -0
  225. package/types/client/clientRuntime.d.ts +7 -0
  226. package/types/client/index.d.ts +1 -0
  227. package/types/client/sharedContext.d.ts +21 -0
  228. package/types/client/types.d.ts +5 -3
  229. package/types/common/Logger.d.ts +88 -6
  230. package/types/common/clientAddress.d.ts +19 -0
  231. package/types/common/deepObjectify.d.ts +4 -2
  232. package/types/common/index.d.ts +8 -2
  233. package/types/common/logContext.d.ts +17 -0
  234. package/types/common/mcpExposure.d.ts +64 -0
  235. package/types/common/pathGetLoose.d.ts +8 -0
  236. package/types/common/plainFieldsOf.d.ts +6 -0
  237. package/types/common/routeConvention.d.ts +6 -0
  238. package/types/common/websocketBinaryFrame.d.ts +17 -0
  239. package/types/constant/constantRegistry.d.ts +2 -10
  240. package/types/constant/crystalize.d.ts +5 -0
  241. package/types/constant/dateSlot.d.ts +14 -0
  242. package/types/constant/fieldInfo.d.ts +20 -3
  243. package/types/constant/fieldQueryMeta.d.ts +17 -0
  244. package/types/constant/getDefault.d.ts +8 -0
  245. package/types/constant/hydrationPlan.d.ts +24 -0
  246. package/types/constant/index.d.ts +5 -0
  247. package/types/constant/labelOf.d.ts +7 -0
  248. package/types/constant/mask.d.ts +41 -0
  249. package/types/constant/purify.d.ts +2 -2
  250. package/types/constant/types.d.ts +5 -5
  251. package/types/dictionary/DictionaryLookup.d.ts +14 -0
  252. package/types/dictionary/agent.dictionary.d.ts +1 -0
  253. package/types/dictionary/agentTurn.dictionary.d.ts +1 -0
  254. package/types/dictionary/base.dictionary.d.ts +1 -1
  255. package/types/dictionary/dictInfo.d.ts +7 -1
  256. package/types/dictionary/dictionary.d.ts +11 -9
  257. package/types/dictionary/index.d.ts +1 -0
  258. package/types/document/filterMeta.d.ts +24 -4
  259. package/types/document/index.d.ts +1 -0
  260. package/types/document/noDocumentError.d.ts +12 -0
  261. package/types/document/types.d.ts +0 -1
  262. package/types/fetch/agentTurn.d.ts +475 -0
  263. package/types/fetch/client/fetchClient.d.ts +12 -0
  264. package/types/fetch/client/httpClient.d.ts +2 -1
  265. package/types/fetch/fetchType/appliedReturn.type.d.ts +37 -18
  266. package/types/fetch/fetchType/endpointFetch.type.d.ts +8 -5
  267. package/types/fetch/fetchType/sliceFetch.type.d.ts +11 -15
  268. package/types/fetch/index.d.ts +1 -0
  269. package/types/index.d.ts +74 -10
  270. package/types/server/akanApp.d.ts +12 -0
  271. package/types/server/akanAppHeaders.d.ts +7 -1
  272. package/types/server/akanOption.d.ts +36 -6
  273. package/types/server/akanServer.d.ts +67 -9
  274. package/types/server/animatedImage.d.ts +7 -0
  275. package/types/server/assetEncoding.d.ts +1 -1
  276. package/types/server/binaryPubsub.d.ts +18 -0
  277. package/types/server/console.d.ts +11 -1
  278. package/types/server/consoleEvaluator.d.ts +2 -0
  279. package/types/server/consolePasteFilter.d.ts +11 -0
  280. package/types/server/consoleSession.d.ts +22 -0
  281. package/types/server/contentEncoding.d.ts +28 -0
  282. package/types/server/devtools/types.d.ts +4 -4
  283. package/types/server/di/diLifecycle.d.ts +10 -2
  284. package/types/server/di/predefinedAdaptor.d.ts +4 -1
  285. package/types/server/di/utils.d.ts +16 -0
  286. package/types/server/lifecycle/runtimeDir.d.ts +5 -0
  287. package/types/server/logging/childOutputReader.d.ts +40 -0
  288. package/types/server/logging/hubFileSink.d.ts +18 -0
  289. package/types/server/logging/logControlSocket.d.ts +60 -0
  290. package/types/server/logging/logForwarder.d.ts +37 -0
  291. package/types/server/logging/logHub.d.ts +70 -0
  292. package/types/server/logging/logQuery.d.ts +31 -0
  293. package/types/server/logging/logStdoutWriter.d.ts +35 -0
  294. package/types/server/logging/logStreamRoute.d.ts +20 -0
  295. package/types/server/logging/logTailClient.d.ts +42 -0
  296. package/types/server/mcp/McpAuth.d.ts +62 -0
  297. package/types/server/mcp/McpDispatcher.d.ts +61 -0
  298. package/types/server/mcp/McpEventStream.d.ts +17 -0
  299. package/types/server/mcp/McpExecutionContext.d.ts +44 -0
  300. package/types/server/mcp/McpRouter.d.ts +65 -0
  301. package/types/server/mcp/index.d.ts +5 -0
  302. package/types/server/mcp.d.ts +1 -0
  303. package/types/server/resolver/signal.resolver.d.ts +7 -4
  304. package/types/server/routing/apiRouter.d.ts +2 -1
  305. package/types/server/routing/appWsData.d.ts +13 -1
  306. package/types/server/routing/eventStream.d.ts +23 -0
  307. package/types/server/routing/soloAppRoutes.d.ts +17 -0
  308. package/types/server/rscWorkerHost.d.ts +4 -1
  309. package/types/server/semaphore.d.ts +5 -0
  310. package/types/server/subRouteIndexDocument.d.ts +8 -0
  311. package/types/server/systemPageDocument.d.ts +1 -0
  312. package/types/server/systemPages.d.ts +5 -0
  313. package/types/server/types.d.ts +16 -0
  314. package/types/server/vendor/akanjs-fetch.d.ts +1 -0
  315. package/types/server/webRouter.d.ts +15 -4
  316. package/types/service/adapt.d.ts +2 -2
  317. package/types/service/agent.service.d.ts +32 -0
  318. package/types/service/base.service.d.ts +4 -0
  319. package/types/service/index.d.ts +1 -0
  320. package/types/service/injectInfo.d.ts +2 -2
  321. package/types/service/ipcTypes.d.ts +12 -0
  322. package/types/service/predefinedAdaptor/compress.adaptor.d.ts +1 -1
  323. package/types/service/predefinedAdaptor/database.adaptor.d.ts +9 -3
  324. package/types/service/predefinedAdaptor/deepseekLlm.d.ts +76 -0
  325. package/types/service/predefinedAdaptor/index.d.ts +3 -0
  326. package/types/service/predefinedAdaptor/insightQuery.d.ts +50 -0
  327. package/types/service/predefinedAdaptor/llm.adaptor.d.ts +105 -0
  328. package/types/service/predefinedAdaptor/queue.adaptor.d.ts +3 -2
  329. package/types/service/predefinedAdaptor/role.adaptor.d.ts +2 -0
  330. package/types/service/predefinedAdaptor/schedule.adaptor.d.ts +10 -6
  331. package/types/service/predefinedAdaptor/solidQueue.adaptor.d.ts +6 -2
  332. package/types/service/predefinedAdaptor/solidSqlite.d.ts +2 -2
  333. package/types/service/serve.d.ts +3 -3
  334. package/types/service/toolNames.d.ts +35 -0
  335. package/types/signal/agent/AgentCatalogue.d.ts +100 -0
  336. package/types/signal/agent/index.d.ts +1 -0
  337. package/types/signal/agent.d.ts +1 -0
  338. package/types/signal/agent.signal.d.ts +24 -0
  339. package/types/signal/agentTurn.d.ts +9 -0
  340. package/types/signal/agentTurnStream.d.ts +24 -0
  341. package/types/signal/base.signal.d.ts +1 -1
  342. package/types/signal/endpointInfo.d.ts +21 -3
  343. package/types/signal/guard.d.ts +12 -0
  344. package/types/signal/guards.d.ts +23 -1
  345. package/types/signal/index.d.ts +6 -0
  346. package/types/signal/intercept.d.ts +2 -2
  347. package/types/signal/internalArg.d.ts +22 -6
  348. package/types/signal/mcp/McpDocument.d.ts +84 -0
  349. package/types/signal/mcp/McpProgress.d.ts +40 -0
  350. package/types/signal/mcp/McpUriTemplate.d.ts +25 -0
  351. package/types/signal/mcp/Msg.d.ts +143 -0
  352. package/types/signal/mcp/index.d.ts +5 -0
  353. package/types/signal/mcp/mcpProtocol.d.ts +107 -0
  354. package/types/signal/mcp.d.ts +1 -0
  355. package/types/signal/middleware.d.ts +7 -7
  356. package/types/signal/openapi/openapi.d.ts +3 -3
  357. package/types/signal/schema/JsonSchemaBuilder.d.ts +51 -0
  358. package/types/signal/schema/index.d.ts +1 -0
  359. package/types/signal/schema.d.ts +1 -0
  360. package/types/signal/signalContext.d.ts +67 -8
  361. package/types/signal/slice.d.ts +42 -15
  362. package/types/signal/trace.d.ts +52 -2
  363. package/types/signal/types.d.ts +53 -4
  364. package/types/store/action.d.ts +7 -5
  365. package/types/store/actionTag.d.ts +21 -0
  366. package/types/store/agent/AgentBridge.d.ts +37 -0
  367. package/types/store/agent/AgentContext.d.ts +16 -0
  368. package/types/store/agent/AgentPrompts.d.ts +31 -0
  369. package/types/store/agent/ScreenReader.d.ts +29 -0
  370. package/types/store/agent/ScreenSettle.d.ts +22 -0
  371. package/types/store/agent/ScreenTarget.d.ts +34 -0
  372. package/types/store/agent/StoreCatalogue.d.ts +26 -0
  373. package/types/store/agent/StoreSurfaceSource.d.ts +30 -0
  374. package/types/store/agent/index.d.ts +11 -0
  375. package/types/store/agent/storeSurface.d.ts +14 -0
  376. package/types/store/agent/types.d.ts +15 -0
  377. package/types/store/agent.d.ts +1 -0
  378. package/types/store/agentic/AgentValue.d.ts +43 -0
  379. package/types/store/agentic/StExposeBuilder.d.ts +21 -0
  380. package/types/store/agentic/StExposeDraft.d.ts +13 -0
  381. package/types/store/agentic/StStateBuilder.d.ts +21 -0
  382. package/types/store/agentic/StStateDraft.d.ts +12 -0
  383. package/types/store/agentic/StToolBuilder.d.ts +56 -0
  384. package/types/store/agentic/StToolDraft.d.ts +13 -0
  385. package/types/store/agentic/attachAgentic.d.ts +25 -0
  386. package/types/store/agentic/formFields.d.ts +53 -0
  387. package/types/store/agentic/index.d.ts +12 -0
  388. package/types/store/agentic/useFieldTool.d.ts +22 -0
  389. package/types/store/agentic/useFormTools.d.ts +19 -0
  390. package/types/store/agentic/useRelationFieldTool.d.ts +27 -0
  391. package/types/store/agentic.d.ts +1 -0
  392. package/types/store/baseSt.d.ts +35 -39
  393. package/types/store/databaseStateNames.d.ts +25 -0
  394. package/types/store/formSetterNames.d.ts +30 -0
  395. package/types/store/index.d.ts +7 -0
  396. package/types/store/rootStore.d.ts +5 -1
  397. package/types/store/sliceRole.d.ts +25 -0
  398. package/types/store/store.d.ts +5 -1
  399. package/types/store/storeInstance.d.ts +33 -1
  400. package/types/store/storeRegistry.d.ts +5 -0
  401. package/types/store/types.d.ts +4 -0
  402. package/types/store/withSelector.d.ts +5 -4
  403. package/types/test/index.d.ts +1 -1
  404. package/types/test/registerDom.d.ts +1 -0
  405. package/types/test/signalTestRuntime.d.ts +2 -3
  406. package/types/test/testServer.d.ts +6 -4
  407. package/types/ui/Agent/Approval.d.ts +8 -0
  408. package/types/ui/Agent/Attach.d.ts +16 -0
  409. package/types/ui/Agent/Bubble.d.ts +26 -0
  410. package/types/ui/Agent/Chat.d.ts +91 -0
  411. package/types/ui/Agent/ChatCommands.d.ts +34 -0
  412. package/types/ui/Agent/Composer.d.ts +23 -0
  413. package/types/ui/Agent/Context.d.ts +13 -0
  414. package/types/ui/Agent/Dock.d.ts +17 -0
  415. package/types/ui/Agent/Guide.d.ts +9 -0
  416. package/types/ui/Agent/History.d.ts +26 -0
  417. package/types/ui/Agent/Launcher.d.ts +16 -0
  418. package/types/ui/Agent/Markdown.d.ts +19 -0
  419. package/types/ui/Agent/Menu.d.ts +18 -0
  420. package/types/ui/Agent/Mic.d.ts +8 -0
  421. package/types/ui/Agent/Question.d.ts +14 -0
  422. package/types/ui/Agent/Section.d.ts +10 -0
  423. package/types/ui/Agent/Skip.d.ts +22 -0
  424. package/types/ui/Agent/StateKey.d.ts +16 -0
  425. package/types/ui/Agent/Tool.d.ts +15 -0
  426. package/types/ui/Agent/Transcript.d.ts +13 -0
  427. package/types/ui/Agent/Zone.d.ts +48 -0
  428. package/types/ui/Agent/agentSessionOf.d.ts +27 -0
  429. package/types/ui/Agent/attachment.d.ts +34 -0
  430. package/types/ui/Agent/fetchRunner.d.ts +12 -0
  431. package/types/ui/Agent/index.d.ts +19 -0
  432. package/types/ui/Agent/index_.d.ts +1 -0
  433. package/types/ui/Agent/markdownBlocks.d.ts +35 -0
  434. package/types/ui/Agent/markdownSpans.d.ts +2 -0
  435. package/types/ui/Agent/markdownTable.d.ts +16 -0
  436. package/types/ui/Agent/sessionHistory.d.ts +14 -0
  437. package/types/ui/Agent/sessionView.d.ts +15 -0
  438. package/types/ui/Agent/tokenCount.d.ts +6 -0
  439. package/types/ui/Agent/useChatAttachments.d.ts +24 -0
  440. package/types/ui/Agent/useChatVoice.d.ts +30 -0
  441. package/types/ui/Agent/useDraftRecall.d.ts +14 -0
  442. package/types/ui/Agent/useKeyboardInset.d.ts +8 -0
  443. package/types/ui/Agent/useSlashMenu.d.ts +24 -0
  444. package/types/ui/Agent/voice.d.ts +71 -0
  445. package/types/ui/Agent.d.ts +1 -0
  446. package/types/ui/Badge.d.ts +1 -1
  447. package/types/ui/Button.d.ts +1 -1
  448. package/types/ui/Constant/Graph.d.ts +10 -0
  449. package/types/ui/Constant/index.d.ts +2 -1
  450. package/types/ui/Constant/schemaGraph.d.ts +39 -0
  451. package/types/ui/Data/Dashboard.d.ts +16 -3
  452. package/types/ui/Data/Insight.d.ts +1 -1
  453. package/types/ui/Data/ListContainer.d.ts +15 -7
  454. package/types/ui/Data/QueryMaker.d.ts +45 -3
  455. package/types/ui/Data/RefPicker.d.ts +16 -0
  456. package/types/ui/Data/dataExport.d.ts +5 -0
  457. package/types/ui/Data/dataText.d.ts +6 -0
  458. package/types/ui/Data/index.d.ts +2 -0
  459. package/types/ui/Data/index_.d.ts +1 -0
  460. package/types/ui/DatePicker.d.ts +15 -11
  461. package/types/ui/Dialog/LegacyModal.d.ts +13 -0
  462. package/types/ui/Dialog/Provider.d.ts +3 -1
  463. package/types/ui/Dialog/context.d.ts +9 -1
  464. package/types/ui/Dialog/index.d.ts +1 -0
  465. package/types/ui/DraggableList.d.ts +1 -1
  466. package/types/ui/Dropdown.d.ts +5 -1
  467. package/types/ui/Field.d.ts +13 -12
  468. package/types/ui/Layout/BottomTab.d.ts +3 -2
  469. package/types/ui/LegacyModal.d.ts +24 -0
  470. package/types/ui/Loading/ProgressBar.d.ts +4 -0
  471. package/types/ui/Loading/Spin.d.ts +2 -1
  472. package/types/ui/Model/AdminPanel.d.ts +15 -3
  473. package/types/ui/Model/EditModal.d.ts +1 -1
  474. package/types/ui/Model/New.d.ts +3 -1
  475. package/types/ui/Model/NewWrapper.d.ts +2 -0
  476. package/types/ui/Model/NewWrapper_Client.d.ts +2 -1
  477. package/types/ui/Pagination.d.ts +2 -2
  478. package/types/ui/Radio.d.ts +1 -1
  479. package/types/ui/RecentTime.d.ts +18 -1
  480. package/types/ui/Reference/Collapse.d.ts +11 -0
  481. package/types/ui/Reference/Panel.d.ts +29 -0
  482. package/types/ui/Reference/Segmented.d.ts +17 -0
  483. package/types/ui/Reference/Summary.d.ts +13 -0
  484. package/types/ui/Reference/Toolbar.d.ts +21 -0
  485. package/types/ui/Reference/dictText.d.ts +6 -0
  486. package/types/ui/Reference/index.d.ts +7 -0
  487. package/types/ui/Reference/style.d.ts +20 -0
  488. package/types/ui/Reference.d.ts +1 -0
  489. package/types/ui/ScreenNavigator.d.ts +3 -1
  490. package/types/ui/Signal/Arg.d.ts +7 -3
  491. package/types/ui/Signal/Doc.d.ts +4 -6
  492. package/types/ui/Signal/Object.d.ts +2 -1
  493. package/types/ui/Signal/RestApi.d.ts +2 -1
  494. package/types/ui/Signal/WebSocket.d.ts +2 -1
  495. package/types/ui/Signal/endpointEntries.d.ts +20 -0
  496. package/types/ui/Signal/style.d.ts +9 -8
  497. package/types/ui/System/Client.d.ts +1 -2
  498. package/types/ui/System/Common.d.ts +3 -4
  499. package/types/ui/System/Messages.d.ts +1 -1
  500. package/types/ui/Tab/Provider.d.ts +3 -1
  501. package/types/ui/Tab/context.d.ts +4 -2
  502. package/types/ui/ToggleSelect.d.ts +1 -0
  503. package/types/ui/UiOverride/context.d.ts +18 -1
  504. package/types/ui/agentAttrs.d.ts +14 -0
  505. package/types/ui/index.d.ts +22 -1
  506. package/types/ui/overlayLayer.d.ts +13 -0
  507. package/types/ui/overlayPosition.d.ts +28 -0
  508. package/types/ui/recipe/badgeRecipe.d.ts +2 -2
  509. package/types/ui/recipe/buttonRecipe.d.ts +2 -2
  510. package/types/vendor/use-agentic/AgentAbort.d.ts +17 -0
  511. package/types/vendor/use-agentic/AgentProgress.d.ts +27 -0
  512. package/types/vendor/use-agentic/AgentProvider.d.ts +17 -0
  513. package/types/vendor/use-agentic/AgentScope.d.ts +9 -0
  514. package/types/vendor/use-agentic/AgentSession.d.ts +163 -0
  515. package/types/vendor/use-agentic/Agentic.d.ts +21 -0
  516. package/types/vendor/use-agentic/AgenticSurface.d.ts +58 -0
  517. package/types/vendor/use-agentic/Compaction.d.ts +48 -0
  518. package/types/vendor/use-agentic/ToolOutput.d.ts +21 -0
  519. package/types/vendor/use-agentic/Transcript.d.ts +18 -0
  520. package/types/vendor/use-agentic/httpRunner.d.ts +15 -0
  521. package/types/vendor/use-agentic/index.d.ts +19 -0
  522. package/types/vendor/use-agentic/sharedContext.d.ts +15 -0
  523. package/types/vendor/use-agentic/surfaceContext.d.ts +5 -0
  524. package/types/vendor/use-agentic/types.d.ts +182 -0
  525. package/types/vendor/use-agentic/useAgent.d.ts +4 -0
  526. package/types/vendor/use-agentic/useAgentGuide.d.ts +6 -0
  527. package/types/vendor/use-agentic/useAgentResource.d.ts +12 -0
  528. package/types/vendor/use-agentic/useAgentState.d.ts +16 -0
  529. package/types/vendor/use-agentic/useAgentTool.d.ts +16 -0
  530. package/types/vendor/use-agentic.d.ts +1 -0
  531. package/types/webkit/index.d.ts +4 -0
  532. package/types/webkit/useBodyScrollLock.d.ts +2 -0
  533. package/types/webkit/usePageTool.d.ts +19 -0
  534. package/types/webkit/useScreenScope.d.ts +25 -0
  535. package/ui/Agent/Approval.tsx +32 -0
  536. package/ui/Agent/Attach.tsx +77 -0
  537. package/ui/Agent/Bubble.tsx +192 -0
  538. package/ui/Agent/Chat.tsx +525 -0
  539. package/ui/Agent/ChatCommands.ts +141 -0
  540. package/ui/Agent/Composer.tsx +94 -0
  541. package/ui/Agent/Context.tsx +49 -0
  542. package/ui/Agent/Dock.tsx +77 -0
  543. package/ui/Agent/Guide.tsx +16 -0
  544. package/ui/Agent/History.tsx +49 -0
  545. package/ui/Agent/Launcher.tsx +60 -0
  546. package/ui/Agent/Markdown.tsx +142 -0
  547. package/ui/Agent/Menu.tsx +55 -0
  548. package/ui/Agent/Mic.tsx +27 -0
  549. package/ui/Agent/Question.tsx +63 -0
  550. package/ui/Agent/Section.tsx +24 -0
  551. package/ui/Agent/Skip.tsx +30 -0
  552. package/ui/Agent/StateKey.tsx +46 -0
  553. package/ui/Agent/Tool.tsx +59 -0
  554. package/ui/Agent/Transcript.tsx +33 -0
  555. package/ui/Agent/Zone.tsx +116 -0
  556. package/ui/Agent/agentSessionOf.ts +60 -0
  557. package/ui/Agent/attachment.ts +73 -0
  558. package/ui/Agent/fetchRunner.ts +44 -0
  559. package/ui/Agent/index.ts +27 -0
  560. package/ui/Agent/index_.tsx +4 -0
  561. package/ui/Agent/markdownBlocks.ts +137 -0
  562. package/ui/Agent/markdownSpans.tsx +49 -0
  563. package/ui/Agent/markdownTable.ts +54 -0
  564. package/ui/Agent/sessionHistory.ts +62 -0
  565. package/ui/Agent/sessionView.ts +38 -0
  566. package/ui/Agent/tokenCount.ts +10 -0
  567. package/ui/Agent/useChatAttachments.ts +84 -0
  568. package/ui/Agent/useChatVoice.ts +129 -0
  569. package/ui/Agent/useDraftRecall.ts +42 -0
  570. package/ui/Agent/useKeyboardInset.ts +26 -0
  571. package/ui/Agent/useSlashMenu.ts +58 -0
  572. package/ui/Agent/voice.ts +177 -0
  573. package/ui/Badge.tsx +1 -1
  574. package/ui/BottomSheet.tsx +32 -36
  575. package/ui/Button.tsx +3 -1
  576. package/ui/Clipboard.tsx +3 -6
  577. package/ui/Constant/Doc.tsx +265 -254
  578. package/ui/Constant/Graph.tsx +151 -0
  579. package/ui/Constant/index.ts +3 -2
  580. package/ui/Constant/schemaGraph.ts +232 -0
  581. package/ui/Data/CardList.tsx +14 -3
  582. package/ui/Data/Dashboard.tsx +70 -52
  583. package/ui/Data/Insight.tsx +18 -12
  584. package/ui/Data/Item.tsx +42 -56
  585. package/ui/Data/ListContainer.tsx +246 -132
  586. package/ui/Data/Pagination.tsx +10 -3
  587. package/ui/Data/QueryMaker.tsx +160 -11
  588. package/ui/Data/RefPicker.tsx +202 -0
  589. package/ui/Data/TableList.tsx +22 -13
  590. package/ui/Data/dataExport.ts +54 -0
  591. package/ui/Data/dataText.ts +22 -0
  592. package/ui/Data/index.ts +13 -1
  593. package/ui/Data/index_.tsx +1 -0
  594. package/ui/DatePicker.tsx +110 -128
  595. package/ui/Dialog/Close.tsx +3 -7
  596. package/ui/Dialog/LegacyModal.tsx +241 -0
  597. package/ui/Dialog/Modal.tsx +62 -195
  598. package/ui/Dialog/Provider.tsx +47 -3
  599. package/ui/Dialog/Trigger.tsx +3 -7
  600. package/ui/Dialog/context.ts +14 -2
  601. package/ui/Dialog/index.tsx +2 -0
  602. package/ui/DragAction.tsx +3 -2
  603. package/ui/DraggableList.tsx +9 -4
  604. package/ui/Dropdown.tsx +89 -27
  605. package/ui/Empty.tsx +6 -4
  606. package/ui/Field.tsx +128 -58
  607. package/ui/Input.tsx +27 -5
  608. package/ui/KeyboardAvoiding.tsx +2 -2
  609. package/ui/Layout/BottomTab.tsx +32 -37
  610. package/ui/Layout/Sider.tsx +37 -14
  611. package/ui/LegacyModal.tsx +53 -0
  612. package/ui/Link/CsrLink.tsx +1 -1
  613. package/ui/Load/Pagination.tsx +15 -8
  614. package/ui/Load/Units.tsx +30 -7
  615. package/ui/Load/View.tsx +10 -3
  616. package/ui/Loading/Area.tsx +7 -6
  617. package/ui/Loading/Button.tsx +7 -9
  618. package/ui/Loading/Input.tsx +7 -9
  619. package/ui/Loading/ProgressBar.tsx +16 -7
  620. package/ui/Loading/Skeleton.tsx +8 -13
  621. package/ui/Loading/Spin.tsx +20 -14
  622. package/ui/Menu.tsx +1 -1
  623. package/ui/Model/AdminPanel.tsx +52 -12
  624. package/ui/Model/EditModal.tsx +28 -6
  625. package/ui/Model/EditWrapper.tsx +16 -4
  626. package/ui/Model/New.tsx +4 -0
  627. package/ui/Model/NewWrapper.tsx +2 -0
  628. package/ui/Model/NewWrapper_Client.tsx +20 -6
  629. package/ui/Model/Remove.tsx +18 -6
  630. package/ui/Model/RemoveWrapper.tsx +12 -2
  631. package/ui/Model/SureToRemove.tsx +18 -6
  632. package/ui/Model/ViewEditModal.tsx +64 -15
  633. package/ui/Model/ViewModal.tsx +25 -11
  634. package/ui/Model/ViewWrapper.tsx +15 -4
  635. package/ui/Model/index_.tsx +1 -1
  636. package/ui/Pagination.tsx +51 -66
  637. package/ui/Popconfirm.tsx +88 -78
  638. package/ui/Radio.tsx +53 -24
  639. package/ui/RecentTime.tsx +83 -35
  640. package/ui/Reference/Collapse.tsx +26 -0
  641. package/ui/Reference/Panel.tsx +79 -0
  642. package/ui/Reference/Segmented.tsx +41 -0
  643. package/ui/Reference/Summary.tsx +25 -0
  644. package/ui/Reference/Toolbar.tsx +44 -0
  645. package/ui/Reference/dictText.ts +9 -0
  646. package/ui/Reference/index.ts +7 -0
  647. package/ui/Reference/style.ts +45 -0
  648. package/ui/ScreenNavigator.tsx +17 -2
  649. package/ui/Select.tsx +96 -57
  650. package/ui/Signal/Arg.tsx +83 -68
  651. package/ui/Signal/Doc.tsx +163 -129
  652. package/ui/Signal/Listener.tsx +40 -29
  653. package/ui/Signal/Message.tsx +87 -135
  654. package/ui/Signal/Object.tsx +79 -57
  655. package/ui/Signal/PubSub.tsx +72 -113
  656. package/ui/Signal/Request.tsx +2 -22
  657. package/ui/Signal/Response.tsx +19 -45
  658. package/ui/Signal/RestApi.tsx +170 -200
  659. package/ui/Signal/WebSocket.tsx +29 -26
  660. package/ui/Signal/endpointEntries.ts +59 -0
  661. package/ui/Signal/makeExample.ts +10 -3
  662. package/ui/Signal/style.ts +34 -29
  663. package/ui/Switch.tsx +4 -0
  664. package/ui/System/CSR.tsx +1 -1
  665. package/ui/System/Client.tsx +31 -15
  666. package/ui/System/Common.tsx +3 -4
  667. package/ui/System/DevModeToggle.tsx +1 -1
  668. package/ui/System/Gtag.tsx +2 -2
  669. package/ui/System/Messages.tsx +52 -31
  670. package/ui/System/Reconnect.tsx +22 -56
  671. package/ui/System/SelectLanguage.tsx +24 -15
  672. package/ui/System/ThemeToggle.tsx +25 -13
  673. package/ui/Tab/Menu.tsx +24 -12
  674. package/ui/Tab/Menus.tsx +6 -3
  675. package/ui/Tab/Provider.tsx +30 -3
  676. package/ui/Tab/context.ts +8 -4
  677. package/ui/Table.tsx +66 -60
  678. package/ui/ToggleSelect.tsx +8 -7
  679. package/ui/Tooltip.tsx +15 -1
  680. package/ui/UiOverride/context.ts +21 -2
  681. package/ui/Unauthorized.tsx +6 -4
  682. package/ui/agentAttrs.ts +19 -0
  683. package/ui/index.ts +49 -1
  684. package/ui/overlayLayer.ts +12 -2
  685. package/ui/overlayPosition.ts +104 -0
  686. package/ui/recipe/buttonRecipe.ts +2 -2
  687. package/ui/styles.css +31 -0
  688. package/vendor/use-agentic/AgentAbort.ts +29 -0
  689. package/vendor/use-agentic/AgentProgress.ts +40 -0
  690. package/vendor/use-agentic/AgentProvider.tsx +39 -0
  691. package/vendor/use-agentic/AgentScope.tsx +20 -0
  692. package/vendor/use-agentic/AgentSession.ts +750 -0
  693. package/vendor/use-agentic/Agentic.tsx +44 -0
  694. package/vendor/use-agentic/AgenticSurface.ts +333 -0
  695. package/vendor/use-agentic/Compaction.ts +120 -0
  696. package/vendor/use-agentic/ToolOutput.ts +60 -0
  697. package/vendor/use-agentic/Transcript.ts +50 -0
  698. package/vendor/use-agentic/WIRE.md +86 -0
  699. package/vendor/use-agentic/httpRunner.ts +131 -0
  700. package/vendor/use-agentic/index.ts +20 -0
  701. package/vendor/use-agentic/sharedContext.ts +25 -0
  702. package/vendor/use-agentic/surfaceContext.ts +10 -0
  703. package/vendor/use-agentic/types.ts +192 -0
  704. package/vendor/use-agentic/useAgent.ts +18 -0
  705. package/vendor/use-agentic/useAgentGuide.ts +16 -0
  706. package/vendor/use-agentic/useAgentResource.ts +36 -0
  707. package/vendor/use-agentic/useAgentState.ts +64 -0
  708. package/vendor/use-agentic/useAgentTool.ts +55 -0
  709. package/webkit/bootCsr.tsx +10 -8
  710. package/webkit/index.ts +4 -0
  711. package/webkit/lazy.tsx +5 -1
  712. package/webkit/useBodyScrollLock.tsx +29 -0
  713. package/webkit/useFrameRuntime.ts +1 -1
  714. package/webkit/usePageTool.tsx +37 -0
  715. package/webkit/useScreenScope.tsx +60 -0
  716. package/types/ui/Constant/Mermaid.d.ts +0 -8
  717. package/types/ui/Signal/Collapse.d.ts +0 -12
  718. package/ui/Constant/Mermaid.tsx +0 -149
  719. package/ui/Signal/Collapse.tsx +0 -29
@@ -2,11 +2,11 @@ import { DEFAULT_VALUE, FIELD_META, type PrimitiveScalar } from "akanjs/base";
2
2
  import type { FieldObject } from ".";
3
3
  import type { DefaultOf } from "./types";
4
4
 
5
- interface DefaultPlan {
5
+ export interface DefaultPlan {
6
6
  /** Fields whose default is a value that can be shared: a primitive, `null`, or the field's own literal. */
7
7
  shared: Record<string, unknown>;
8
8
  /** Fields that have to be produced per call — a thunk, a fresh array, or a nested scalar record. */
9
- perCall: [key: string, make: () => unknown][];
9
+ perCall: Map<string, () => unknown>;
10
10
  }
11
11
 
12
12
  const planCache = new WeakMap<FieldObject, DefaultPlan>();
@@ -17,28 +17,33 @@ const planCache = new WeakMap<FieldObject, DefaultPlan>();
17
17
  * sharing one. Only values that were already shared before this cache existed live in `shared`.
18
18
  */
19
19
  export const getDefault = <T>(fieldObj: FieldObject): DefaultOf<T> => {
20
- let plan = planCache.get(fieldObj);
21
- if (!plan) {
22
- plan = buildPlan(fieldObj);
23
- planCache.set(fieldObj, plan);
24
- }
20
+ const plan = defaultPlanOf(fieldObj);
25
21
  const result: Record<string, unknown> = { ...plan.shared };
26
22
  for (const [key, make] of plan.perCall) result[key] = make();
27
23
  return result as DefaultOf<T>;
28
24
  };
29
25
 
26
+ /** The per-field default rules, split as above; `HydrationPlan` reads them per field so a present value skips its thunk. */
27
+ export const defaultPlanOf = (fieldObj: FieldObject): DefaultPlan => {
28
+ const cached = planCache.get(fieldObj);
29
+ if (cached) return cached;
30
+ const plan = buildPlan(fieldObj);
31
+ planCache.set(fieldObj, plan);
32
+ return plan;
33
+ };
34
+
30
35
  const buildPlan = (fieldObj: FieldObject): DefaultPlan => {
31
36
  const shared: Record<string, unknown> = {};
32
- const perCall: [string, () => unknown][] = [];
37
+ const perCall = new Map<string, () => unknown>();
33
38
  for (const [key, field] of Object.entries(fieldObj)) {
34
39
  if (field.fieldType === "hidden" || field.fieldType === "secret") shared[key] = null;
35
40
  else if (field.default !== undefined && field.default !== null) {
36
- if (typeof field.default === "function") perCall.push([key, field.default as () => unknown]);
41
+ if (typeof field.default === "function") perCall.set(key, field.default as () => unknown);
37
42
  else shared[key] = field.default as object;
38
- } else if (field.isArray) perCall.push([key, () => []]);
43
+ } else if (field.isArray) perCall.set(key, () => []);
39
44
  else if (field.nullable) shared[key] = null;
40
45
  else if (field.isClass) {
41
- if (field.isScalar) perCall.push([key, () => getDefault(field.modelRef[FIELD_META])]);
46
+ if (field.isScalar) perCall.set(key, () => getDefault(field.modelRef[FIELD_META]));
42
47
  else shared[key] = null;
43
48
  } else shared[key] = (field.modelRef as unknown as typeof PrimitiveScalar)[DEFAULT_VALUE];
44
49
  }
@@ -0,0 +1,72 @@
1
+ import { FIELD_META } from "akanjs/base";
2
+
3
+ import { type Converter, converterOf } from "./crystalize";
4
+ import { dateSlotOf, isDateSlotField, toDateValue } from "./dateSlot";
5
+ import type { FieldObject } from "./fieldInfo";
6
+ import { defaultPlanOf } from "./getDefault";
7
+
8
+ interface PlanEntry {
9
+ key: string;
10
+ /** The own property the value lands on: the key itself, or a Date field's slot symbol. */
11
+ target: string | symbol;
12
+ convert: Converter;
13
+ makeDefault: () => unknown;
14
+ }
15
+ type PlanTarget = Record<string | symbol, unknown>;
16
+ interface PlanOwner {
17
+ [FIELD_META]: FieldObject;
18
+ }
19
+
20
+ /**
21
+ * One hydration plan per model class, compiled from `FIELD_META` on the first instance. Reading the field map,
22
+ * resolving `getProps()` and dispatching on the field kind used to happen per field per instance, and was most of
23
+ * what a listing paid after the dayjs objects — a plan turns a row into a plain loop over precomputed converters.
24
+ *
25
+ * Cached per class rather than per field map because `fullModelOf` extends a lib model's `FIELD_META` in place;
26
+ * `applyConstantStatics` resets the entry whenever it finishes wiring a class.
27
+ */
28
+ export class HydrationPlan {
29
+ static #byClass = new WeakMap<object, HydrationPlan>();
30
+ static of(cls: PlanOwner): HydrationPlan {
31
+ const cached = HydrationPlan.#byClass.get(cls);
32
+ if (cached) return cached;
33
+ const plan = new HydrationPlan(cls[FIELD_META]);
34
+ HydrationPlan.#byClass.set(cls, plan);
35
+ return plan;
36
+ }
37
+ static reset(cls: object) {
38
+ HydrationPlan.#byClass.delete(cls);
39
+ }
40
+
41
+ #entries: PlanEntry[];
42
+ constructor(fieldObj: FieldObject) {
43
+ const defaults = defaultPlanOf(fieldObj);
44
+ this.#entries = Object.entries(fieldObj).map(([key, field]) => {
45
+ const props = field.getProps();
46
+ const isDateSlot = isDateSlotField(props);
47
+ const convert: Converter = isDateSlot ? toDateValue : converterOf(props);
48
+ const perCall = defaults.perCall.get(key);
49
+ const rawDefault = perCall ?? (() => defaults.shared[key]);
50
+
51
+ return { key, target: isDateSlot ? dateSlotOf(key) : key, convert, makeDefault: () => convert(rawDefault()) };
52
+ });
53
+ }
54
+
55
+ /** Fills every field: the value when the source carries one, the field's default otherwise. */
56
+ construct(instance: object, source?: Record<string, unknown> | null) {
57
+ const target = instance as PlanTarget;
58
+ for (const entry of this.#entries) {
59
+ const value = source === undefined || source === null ? undefined : source[entry.key];
60
+ target[entry.target] = value === undefined ? entry.makeDefault() : entry.convert(value);
61
+ }
62
+ }
63
+
64
+ /** Overwrites only the fields the source names; `in` rather than own keys, so another instance's accessors count. */
65
+ assign(instance: object, source: Record<string, unknown>) {
66
+ const target = instance as PlanTarget;
67
+ for (const entry of this.#entries) {
68
+ if (!(entry.key in source)) continue;
69
+ target[entry.target] = entry.convert(source[entry.key]);
70
+ }
71
+ }
72
+ }
@@ -1,16 +1,14 @@
1
1
  import { FIELD_META } from "akanjs/base";
2
+ import { plainFieldsOf } from "akanjs/common";
2
3
  import { immerable } from "immer";
3
4
  import type { ConstantModelRef } from ".";
4
5
 
5
6
  export const immerify = <T extends object>(modelRef: ConstantModelRef, objOrArr: T): T => {
6
7
  if (Array.isArray(objOrArr)) return objOrArr.map((val) => immerify(modelRef, val as object)) as T;
7
- const immeredObj = Object.assign({}, objOrArr, {
8
- [immerable]: true,
9
- }) as Record<string, unknown>;
10
- const objRecord = objOrArr as Record<string, unknown>;
8
+ const immeredObj = Object.assign(plainFieldsOf(objOrArr), { [immerable]: true }) as Record<string, unknown>;
11
9
  Object.entries(modelRef[FIELD_META]).forEach(([key, field]) => {
12
- if (field.isScalar && field.isClass && !!objRecord[key])
13
- immeredObj[key] = immerify(field.modelRef, objRecord[key] as object);
10
+ if (field.isScalar && field.isClass && immeredObj[key])
11
+ immeredObj[key] = immerify(field.modelRef, immeredObj[key] as object);
14
12
  });
15
13
  return immeredObj as T;
16
14
  };
package/constant/index.ts CHANGED
@@ -1,10 +1,15 @@
1
1
  export * from "./cascadePaths";
2
2
  export * from "./constantRegistry";
3
3
  export * from "./crystalize";
4
+ export * from "./dateSlot";
4
5
  export * from "./deserialize";
5
6
  export * from "./fieldInfo";
7
+ export * from "./fieldQueryMeta";
6
8
  export * from "./getDefault";
9
+ export * from "./hydrationPlan";
7
10
  export * from "./immerify";
11
+ export * from "./labelOf";
12
+ export * from "./mask";
8
13
  export * from "./purify";
9
14
  export * from "./serialize";
10
15
  export * from "./textFieldPathSet";
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The one line a human scans for. A model that writes its own `Light<Model>.label()` owns the answer, since
3
+ * display logic is the Light class's job; otherwise it is derived from what the model already declared — the
4
+ * `text: "title"` search role names exactly that field, so an agent-facing label costs no new declaration.
5
+ * Falls back to the conventional `title`/`name` keys; the id is the caller's floor.
6
+ */
7
+ export const labelOf = (model: unknown, value: unknown): string | undefined => {
8
+ if (!value || typeof value !== "object") return undefined;
9
+ const source = value as Record<string, unknown>;
10
+ const written = source.label;
11
+ if (typeof written === "function") {
12
+ try {
13
+ const label = (written as () => unknown).call(source);
14
+ if (typeof label === "string" && label) return label;
15
+ } catch {
16
+ }
17
+ }
18
+ const paths = (model as { text?: { title?: Iterable<string> } } | null)?.text?.title;
19
+ const titlePath = [...(paths ?? [])].find((path) => !path.includes(".") && !path.includes("["));
20
+ for (const key of [titlePath, "title", "name"]) {
21
+ if (!key) continue;
22
+ const candidate = source[key];
23
+ if (typeof candidate === "string" && candidate) return candidate;
24
+ }
25
+ return undefined;
26
+ };
@@ -0,0 +1,67 @@
1
+ import { FIELD_META } from "akanjs/base";
2
+
3
+ /**
4
+ * A model as masking reads it — the constructor, for the field metadata it carries at runtime.
5
+ *
6
+ * Structural rather than `ConstantModelRef` so that anything holding the class can name it, and read through
7
+ * `FIELD_META` the way `resolveReturn` reads it.
8
+ */
9
+ export interface MaskModel {
10
+ name: string;
11
+ }
12
+
13
+ /** The part of a field's metadata masking turns on. Mirrors what `resolveReturn` branches over. */
14
+ interface MaskField {
15
+ fieldType?: string;
16
+ isClass?: boolean;
17
+ modelRef?: MaskModel;
18
+ visual?: boolean;
19
+ }
20
+
21
+ export const maskFieldsOf = (model: MaskModel): Record<string, MaskField> | null => {
22
+ const fields = (model as unknown as { [key: symbol]: unknown })[FIELD_META];
23
+ return fields && typeof fields === "object" ? (fields as Record<string, MaskField>) : null;
24
+ };
25
+
26
+ /**
27
+ * The `hidden` and `secret` field names of `model` that `value` still carries populated.
28
+ *
29
+ * `visual` is deliberately not among them. A refusal here means a value must not be published at all, and a blur
30
+ * placeholder is not a secret — it is merely not worth its tokens, which masking answers by dropping it.
31
+ */
32
+ export const leakingFieldsOf = (model: MaskModel, value: Record<string, unknown>): string[] => {
33
+ const fields = maskFieldsOf(model);
34
+ if (!fields) return [];
35
+ return Object.entries(fields)
36
+ .filter(([key, field]) => (field.fieldType === "hidden" || field.fieldType === "secret") && key in value)
37
+ .map(([key]) => key);
38
+ };
39
+
40
+ /**
41
+ * Strips what a model marks `hidden`, `secret`, or `visual`, by the model the caller names rather than by the one
42
+ * the value happens to still carry. The first two are secrecy and the third is cost, but the answer is the same
43
+ * one — leave the field out — and this is the only place every AI-facing read already passes through.
44
+ *
45
+ * That distinction is the whole point. A check that reads the class off the value can only mask what arrives as an
46
+ * instance, so a `{ ...doc }` spread, a `toJSON()`, an `immerify()`, or a round-trip through `JSON.stringify` reaches
47
+ * its destination with the metadata already gone and nothing can be done about it. A named model is metadata the
48
+ * value cannot lose, so a hydrated document and a plain object copied out of one mask identically.
49
+ *
50
+ * This is the field half of `resolveReturn` and deliberately not the whole of it. That one also loads every relation
51
+ * it walks past, which is right for a query's return value and wrong here, where the value is already in hand.
52
+ *
53
+ * Returns `unknown` rather than the argument's type, because what comes back is missing fields that type promises.
54
+ */
55
+ export const mask = (model: MaskModel, value: unknown): unknown => {
56
+ if (value === null || value === undefined || typeof value !== "object") return value;
57
+ if (Array.isArray(value)) return value.map((item: unknown) => mask(model, item));
58
+ const fields = maskFieldsOf(model);
59
+ if (!fields) return value;
60
+ const source = value as Record<string, unknown>;
61
+ const masked: Record<string, unknown> = {};
62
+ for (const [key, field] of Object.entries(fields)) {
63
+ if (field.fieldType === "hidden" || field.fieldType === "secret" || field.visual || !(key in source)) continue;
64
+ masked[key] = field.isClass && field.modelRef ? mask(field.modelRef, source[key]) : source[key];
65
+ }
66
+ return masked;
67
+ };
@@ -31,18 +31,24 @@ type Purified<O> = O extends BaseObject
31
31
  : O extends object
32
32
  ? PurifiedModel<O>
33
33
  : O;
34
- type PurifiedWithObjectToId<T, StateKeys extends keyof GetStateObject<T> = keyof GetStateObject<T>> = {
35
- [K in StateKeys as null extends T[K] ? never : K]: Purified<T[K]>;
36
- } & {
37
- [K in StateKeys as null extends T[K] ? K : never]?: Purified<T[K]> | undefined;
38
- };
39
- export type PurifiedModel<T> = T extends (infer S)[]
40
- ? PurifiedModel<S>[]
41
- : T extends string | number | boolean | Dayjs | File
34
+ type PurifiedWithObjectToId<T, StateKeys extends keyof GetStateObject<T> = keyof GetStateObject<T>> =
35
+
36
+ unknown extends T
42
37
  ? T
43
- : T extends Map<infer K, infer V>
44
- ? Map<K, PurifiedModel<V>>
45
- : PurifiedWithObjectToId<T>;
38
+ : {
39
+ [K in StateKeys as null extends T[K] ? never : K]: Purified<T[K]>;
40
+ } & {
41
+ [K in StateKeys as null extends T[K] ? K : never]?: Purified<T[K]> | undefined;
42
+ };
43
+ export type PurifiedModel<T> = unknown extends T
44
+ ? T
45
+ : T extends (infer S)[]
46
+ ? PurifiedModel<S>[]
47
+ : T extends string | number | boolean | Dayjs | File
48
+ ? T
49
+ : T extends Map<infer K, infer V>
50
+ ? Map<K, PurifiedModel<V>>
51
+ : PurifiedWithObjectToId<T>;
46
52
 
47
53
  export type UploadableClientArg<T> = [T] extends [File[]] ? File[] | FileList : T;
48
54
 
@@ -34,17 +34,23 @@ export class TextFieldPaths extends TextFieldPathSet {
34
34
  }
35
35
 
36
36
  #assertReachable(path: string, parent: ConstantField) {
37
- if (parent.fieldType === "secret") throw new Error(`Text field "${path}" is under a secret field`);
38
- if (parent.fieldType === "hidden") throw new Error(`Text field "${path}" is under a hidden field`);
39
- if (parent.fieldType === "resolve") throw new Error(`Text field "${path}" is under a resolved field`);
37
+
38
+ const fix = `Drop the text role on "${path}", or leave the parent unmasked.`;
39
+ if (parent.fieldType === "secret") throw new Error(`Text field "${path}" is under a secret field. ${fix}`);
40
+ if (parent.fieldType === "hidden") throw new Error(`Text field "${path}" is under a hidden field. ${fix}`);
41
+ if (parent.fieldType === "resolve") throw new Error(`Text field "${path}" is under a resolved field. ${fix}`);
40
42
  if (parent.arrDepth > 1) throw new Error(`Text field "${path}" is under a nested array and cannot be indexed`);
41
43
  }
42
44
 
43
45
  #assertIndexable(key: string, role: TextFieldRole, field: ConstantField) {
44
-
45
- if (field.fieldType === "secret") throw new Error(`Text field "${key}" is secret and must not be indexed`);
46
- if (field.fieldType === "hidden") throw new Error(`Text field "${key}" is hidden and must not be indexed`);
47
- if (field.fieldType === "resolve") throw new Error(`Text field "${key}" is resolved and is absent from _doc`);
46
+
47
+ const masked = `The search mirror stores plaintext. Drop the text role on "${key}", or make the field plain.`;
48
+ if (field.fieldType === "secret")
49
+ throw new Error(`Text field "${key}" is secret and must not be indexed. ${masked}`);
50
+ if (field.fieldType === "hidden")
51
+ throw new Error(`Text field "${key}" is hidden and must not be indexed. ${masked}`);
52
+ if (field.fieldType === "resolve")
53
+ throw new Error(`Text field "${key}" is resolved and is absent from _doc. Drop the text role on "${key}".`);
48
54
  if (field.isMap) throw new Error(`Text field "${key}" is a Map and cannot be indexed`);
49
55
  if (field.arrDepth > 1) throw new Error(`Text field "${key}" is a nested array and cannot be indexed`);
50
56
  const modelRef = field.modelRef as unknown as Cls;
package/constant/types.ts CHANGED
@@ -14,21 +14,27 @@ type ObjectToId<O> = O extends BaseObject
14
14
  ? DocumentModel<O>
15
15
  : O;
16
16
 
17
- type Docify<T, _StateKeys extends keyof GetStateObject<T> = keyof GetStateObject<T>> = {
18
- [K in _StateKeys as null extends T[K] ? never : K]-?: ObjectToId<NonNullable<T[K]>>;
19
- } & {
20
- [K in _StateKeys as null extends T[K] ? K : never]?: ObjectToId<NonNullable<T[K]>> | undefined;
21
- };
22
- export type DocumentModel<T> = T extends (infer S)[]
23
- ? DocumentModel<S>[]
24
- : T extends string | number | boolean | Dayjs | File
25
- ? T
26
- : T extends Map<infer K, infer V>
27
- ? Map<K, DocumentModel<V>>
28
- : Docify<T>;
17
+ type Docify<T, _StateKeys extends keyof GetStateObject<T> = keyof GetStateObject<T>> = unknown extends T
18
+ ? T
19
+ : { [K in _StateKeys as null extends T[K] ? never : K]-?: ObjectToId<NonNullable<T[K]>> } & {
20
+ [K in _StateKeys as null extends T[K] ? K : never]?: ObjectToId<NonNullable<T[K]>> | undefined;
21
+ };
22
+ export type DocumentModel<T> = unknown extends T
23
+ ? T
24
+ : T extends (infer S)[]
25
+ ? DocumentModel<S>[]
26
+ : T extends string | number | boolean | Dayjs | File
27
+ ? T
28
+ : T extends Map<infer K, infer V>
29
+ ? Map<K, DocumentModel<V>>
30
+ : Docify<T>;
29
31
 
30
32
  export type FieldState<T> = T extends { id: string } ? T | null : T;
31
- export type DefaultOf<S> = GetStateObject<{ [K in keyof S]: FieldState<S[K]> }>;
33
+ export type DefaultOf<S> = {
34
+ [K in keyof S as S[K] extends (...args: never[]) => unknown ? never : K extends "prototype" ? never : K]: FieldState<
35
+ S[K]
36
+ >;
37
+ };
32
38
 
33
39
  export type DefaultOfSchema<Schema, RelationKey = never> = [RelationKey] extends [never]
34
40
  ? Schema
package/constant/via.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import {
2
+ Binary,
2
3
  CLIENT_VALUE,
3
4
  type Cls,
4
5
  DEFAULT_VALUE,
@@ -9,12 +10,13 @@ import {
9
10
  PURIFIED_VALUE,
10
11
  SERVER_VALUE,
11
12
  } from "akanjs/base";
12
- import { applyMixins } from "akanjs/common";
13
+ import { applyMixins, plainFieldsOf } from "akanjs/common";
13
14
  import { immerable } from "immer";
14
15
 
15
- import { crystalize, getDefault } from ".";
16
+ import { getDefault } from ".";
16
17
  import { CascadePaths } from "./cascadePaths";
17
18
  import { ConstantRegistry } from "./constantRegistry";
19
+ import { dateAccessorOf, isDateSlotField } from "./dateSlot";
18
20
  import {
19
21
  ConstantField,
20
22
  type ExtractFieldInfoObject,
@@ -26,6 +28,7 @@ import {
26
28
  field,
27
29
  resolve,
28
30
  } from "./fieldInfo";
31
+ import { HydrationPlan } from "./hydrationPlan";
29
32
  import { makePurify, type PurifiedModel, type PurifyFunc } from "./purify";
30
33
  import { TextFieldPaths } from "./textFieldPaths";
31
34
  import type { BaseInsight, BaseObject, ConstantType, DefaultOf, DefaultOfSchema, NonFunctionalKeys } from "./types";
@@ -200,22 +203,16 @@ const getBaseConstantClass = (field: FieldObject, modelType: ConstantType = "sca
200
203
  static enums: Set<EnumInstance> = new Set();
201
204
  [immerable] = true;
202
205
  constructor(obj?: Partial<unknown>) {
203
- this.set({
204
- ...(this.constructor as ConstantCls).getDefault(),
205
- ...((obj ?? {}) as Partial<typeof this>),
206
- });
206
+ HydrationPlan.of(this.constructor as ConstantCls).construct(this, obj as Record<string, unknown> | undefined);
207
207
  }
208
208
  set(obj: Partial<typeof this>) {
209
- Object.entries(obj).forEach(([key, value]) => {
210
-
211
- if (!(this.constructor as ConstantCls)[FIELD_META][key] as unknown as object | undefined) return;
212
- const field = (this.constructor as ConstantCls)[FIELD_META][key];
213
- if (!field) throw new Error(`Field ${key} not found`);
214
- const fieldProp = field.getProps();
215
- (this as Record<string, unknown>)[key] = crystalize(fieldProp, value);
216
- });
209
+ HydrationPlan.of(this.constructor as ConstantCls).assign(this, obj as Record<string, unknown>);
217
210
  return this;
218
211
  }
212
+
213
+ toJSON() {
214
+ return plainFieldsOf(this);
215
+ }
219
216
  }
220
217
  return BaseConstant as unknown as ConstantCls;
221
218
  };
@@ -430,12 +427,18 @@ declare global {
430
427
  }
431
428
 
432
429
  const applyConstantStatics = <Model>(model: ConstantCls<Model>, fieldMap: FieldObject): ConstantCls<Model> => {
433
- const defaultValue = getDefault(model[FIELD_META]);
430
+
431
+ let defaultValue: DefaultOf<Model> | undefined;
434
432
  Object.assign(model, {
435
433
  purify: makePurify(model),
436
- getDefault: () => ({ ...defaultValue }),
434
+ getDefault: () => {
435
+ defaultValue ??= getDefault<Model>(model[FIELD_META]);
436
+ return { ...defaultValue };
437
+ },
437
438
  });
438
- Object.entries(fieldMap).forEach(([, field]) => {
439
+ Object.entries(fieldMap).forEach(([key, field]) => {
440
+ if ((field.modelRef as unknown) === Binary || (field.of as unknown) === Binary)
441
+ throw new Error(`Field "${key}" is Binary, which is not storable. Reference the File model instead.`);
439
442
  if (field.enum) model.enums.add(field.enum);
440
443
  if (!field.isClass) return;
441
444
  if (field.isScalar) model.children.add(field.modelRef);
@@ -446,6 +449,10 @@ const applyConstantStatics = <Model>(model: ConstantCls<Model>, fieldMap: FieldO
446
449
  });
447
450
  model.text.collect(fieldMap);
448
451
  model.cascade.collect(fieldMap);
452
+
453
+ for (const [key, field] of Object.entries(model[FIELD_META]))
454
+ if (isDateSlotField(field.getProps())) Object.defineProperty(model.prototype, key, dateAccessorOf(key));
455
+ HydrationPlan.reset(model);
449
456
  return model as unknown as ConstantCls<Model>;
450
457
  };
451
458
 
@@ -0,0 +1,30 @@
1
+ import { pathGetLoose } from "akanjs/common";
2
+ import { DictionaryRegistry } from "./dictionaryRegistry";
3
+ import type { DictionaryNode } from "./trans";
4
+
5
+ /**
6
+ * Reads translated text out of the merged dictionary tree by dotted key (`user.signal.createUser.arg.data.desc`).
7
+ *
8
+ * Unlike `translate`, a missing key resolves to `undefined` rather than echoing the key back: callers here are
9
+ * document generators (OpenAPI, MCP) that must omit an absent description instead of emitting `"user.signal.…"`
10
+ * as if it were prose. The merged root is snapshotted once per instance, so build a fresh one per document.
11
+ */
12
+ export class DictionaryLookup {
13
+ readonly language: string;
14
+ readonly #models: Record<string, DictionaryNode>;
15
+ constructor(language?: string) {
16
+ const root = DictionaryRegistry.getRoot();
17
+ this.language = language && root[language] ? language : (Object.keys(root).at(0) ?? "en");
18
+ this.#models = root[this.language] ?? {};
19
+ }
20
+
21
+ /** A bare refName names the model node itself, which holds no text of its own — its label is `<refName>.modelName`. */
22
+ text(key: string): string | undefined {
23
+ const [refName, ...rest] = key.split(".");
24
+ if (!refName) return undefined;
25
+ const model = this.#models[refName];
26
+ const node = (rest.length ? pathGetLoose(rest, model) : model) as { t?: unknown } | null;
27
+ const text = node?.t;
28
+ return typeof text === "string" && text.length ? text : undefined;
29
+ }
30
+ }
@@ -0,0 +1,31 @@
1
+ import type { AgentEndpoint } from "akanjs/signal";
2
+
3
+ import { serviceDictionary } from "./dictInfo";
4
+
5
+ export const agentDictionary = serviceDictionary(["en", "ko"])
6
+ .endpoint<AgentEndpoint>((fn) => ({
7
+ runAgentTurn: fn(["Run Agent Turn", "에이전트 턴 실행"])
8
+ .desc([
9
+ "Relays one in-page agent turn to the model and returns its answer; tools execute in the caller's browser",
10
+ "인페이지 에이전트 턴 하나를 모델에 릴레이하고 응답을 돌려준다. 툴 실행은 호출자의 브라우저에서 한다",
11
+ ])
12
+ .arg((t) => ({
13
+ messages: t(["Messages", "메시지"]).desc(["The whole transcript in wire shape", "와이어 형태의 전체 대화"]),
14
+ tools: t(["Tools", "툴"]).desc(["The published tool catalogue, schemas only", "게시된 툴 카탈로그 (스키마만)"]),
15
+ context: t(["Context", "컨텍스트"]).desc([
16
+ "Screen context blocks, forwarded as data",
17
+ "화면 컨텍스트 블록 (데이터로 전달)",
18
+ ]),
19
+ instructions: t(["Instructions", "지시문"]).desc(["App-level system instructions", "앱 수준 시스템 지시문"]),
20
+ })),
21
+ }))
22
+ .error({
23
+ llmUnavailable: [
24
+ "The agent is unavailable — this app has no language model configured",
25
+ "에이전트를 사용할 수 없습니다. 이 앱에 언어 모델이 설정되어 있지 않습니다",
26
+ ],
27
+ deepseekRequestFailed: [
28
+ "DeepSeek refused this turn with status {status}. Reason: {reason}",
29
+ "DeepSeek가 이번 턴을 거절했습니다 (status {status}). 사유: {reason}",
30
+ ],
31
+ });
@@ -0,0 +1,29 @@
1
+ import type { AgentStop, AgentTurn } from "akanjs/signal";
2
+
3
+ import { scalarDictionary } from "./dictInfo";
4
+
5
+ export const agentTurnDictionary = scalarDictionary(["en", "ko"])
6
+ .of((t) =>
7
+ t(["Agent Turn", "에이전트 턴"]).desc([
8
+ "One assistant answer of an in-page agent turn",
9
+ "인페이지 에이전트 턴의 어시스턴트 응답 하나",
10
+ ]),
11
+ )
12
+ .model<AgentTurn>((t) => ({
13
+ text: t(["Text", "텍스트"]).desc([
14
+ "What the assistant said; empty when the turn is only tool calls",
15
+ "어시스턴트가 말한 내용. 툴 호출뿐인 턴에서는 비어 있다",
16
+ ]),
17
+ toolCalls: t(["Tool Calls", "툴 호출"]).desc([
18
+ "Tool calls the client should execute, as { id, name, args }",
19
+ "클라이언트가 실행할 툴 호출 목록 ({ id, name, args })",
20
+ ]),
21
+ stop: t(["Stop", "종료 사유"]).desc([
22
+ "Why the turn ended — end, or toolUse when tool results are awaited",
23
+ "턴이 끝난 이유 — end 또는 툴 결과를 기다리는 toolUse",
24
+ ]),
25
+ }))
26
+ .enum<AgentStop>("agentStop", (t) => ({
27
+ end: t(["End", "종료"]).desc(["The final answer", "최종 응답"]),
28
+ toolUse: t(["Tool Use", "툴 사용"]).desc(["The model awaits tool results", "모델이 툴 결과를 기다린다"]),
29
+ }));