@levelcode/sdk 0.2.3 → 0.2.5

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 (324) hide show
  1. package/dist/index.cjs +493 -289
  2. package/dist/index.cjs.map +8 -7
  3. package/dist/index.mjs +564 -360
  4. package/dist/index.mjs.map +8 -7
  5. package/package.json +1 -1
  6. package/dist/agents/constants.d.ts +0 -1
  7. package/dist/agents/team/apprentice.d.ts +0 -3
  8. package/dist/agents/team/coordinator.d.ts +0 -3
  9. package/dist/agents/team/cto.d.ts +0 -3
  10. package/dist/agents/team/designer.d.ts +0 -3
  11. package/dist/agents/team/director.d.ts +0 -3
  12. package/dist/agents/team/distinguished-engineer.d.ts +0 -3
  13. package/dist/agents/team/fellow.d.ts +0 -3
  14. package/dist/agents/team/index.d.ts +0 -27
  15. package/dist/agents/team/intern.d.ts +0 -3
  16. package/dist/agents/team/junior-engineer.d.ts +0 -3
  17. package/dist/agents/team/manager.d.ts +0 -3
  18. package/dist/agents/team/mid-level-engineer.d.ts +0 -3
  19. package/dist/agents/team/principal-engineer.d.ts +0 -3
  20. package/dist/agents/team/product-lead.d.ts +0 -3
  21. package/dist/agents/team/researcher.d.ts +0 -3
  22. package/dist/agents/team/role-hierarchy.d.ts +0 -24
  23. package/dist/agents/team/scientist.d.ts +0 -3
  24. package/dist/agents/team/senior-engineer.d.ts +0 -3
  25. package/dist/agents/team/senior-staff-engineer.d.ts +0 -3
  26. package/dist/agents/team/staff-engineer.d.ts +0 -3
  27. package/dist/agents/team/sub-manager.d.ts +0 -3
  28. package/dist/agents/team/tester.d.ts +0 -3
  29. package/dist/agents/team/vp-engineering.d.ts +0 -3
  30. package/dist/agents/types/agent-definition.d.ts +0 -296
  31. package/dist/agents/types/secret-agent-definition.d.ts +0 -19
  32. package/dist/agents/types/tools.d.ts +0 -308
  33. package/dist/agents/types/util-types.d.ts +0 -134
  34. package/dist/common/src/actions.d.ts +0 -176
  35. package/dist/common/src/analytics-core.d.ts +0 -52
  36. package/dist/common/src/analytics.d.ts +0 -9
  37. package/dist/common/src/browser-actions.d.ts +0 -1200
  38. package/dist/common/src/constants/agents.d.ts +0 -47
  39. package/dist/common/src/constants/analytics-events.d.ts +0 -111
  40. package/dist/common/src/constants/byok.d.ts +0 -2
  41. package/dist/common/src/constants/claude-oauth.d.ts +0 -36
  42. package/dist/common/src/constants/index.d.ts +0 -4
  43. package/dist/common/src/constants/knowledge.d.ts +0 -21
  44. package/dist/common/src/constants/limits.d.ts +0 -14
  45. package/dist/common/src/constants/model-config.d.ts +0 -117
  46. package/dist/common/src/constants/paths.d.ts +0 -23
  47. package/dist/common/src/constants/skills.d.ts +0 -42
  48. package/dist/common/src/constants/ui.d.ts +0 -14
  49. package/dist/common/src/env-ci.d.ts +0 -22
  50. package/dist/common/src/env-process.d.ts +0 -28
  51. package/dist/common/src/env-schema.d.ts +0 -24
  52. package/dist/common/src/env.d.ts +0 -16
  53. package/dist/common/src/mcp/client.d.ts +0 -6
  54. package/dist/common/src/old-constants.d.ts +0 -10
  55. package/dist/common/src/project-file-tree.d.ts +0 -27
  56. package/dist/common/src/templates/agent-validation.d.ts +0 -48
  57. package/dist/common/src/templates/initial-agents-dir/types/agent-definition.d.ts +0 -296
  58. package/dist/common/src/templates/initial-agents-dir/types/tools.d.ts +0 -308
  59. package/dist/common/src/templates/initial-agents-dir/types/util-types.d.ts +0 -128
  60. package/dist/common/src/testing/errors.d.ts +0 -14
  61. package/dist/common/src/testing/mock-modules.d.ts +0 -11
  62. package/dist/common/src/testing/mock-types.d.ts +0 -97
  63. package/dist/common/src/testing/mocks/analytics.d.ts +0 -182
  64. package/dist/common/src/testing/mocks/child-process.d.ts +0 -29
  65. package/dist/common/src/testing/mocks/crypto.d.ts +0 -159
  66. package/dist/common/src/testing/mocks/database.d.ts +0 -197
  67. package/dist/common/src/testing/mocks/fetch.d.ts +0 -35
  68. package/dist/common/src/testing/mocks/filesystem.d.ts +0 -31
  69. package/dist/common/src/testing/mocks/index.d.ts +0 -25
  70. package/dist/common/src/testing/mocks/logger.d.ts +0 -35
  71. package/dist/common/src/testing/mocks/stream.d.ts +0 -203
  72. package/dist/common/src/testing/mocks/timers.d.ts +0 -27
  73. package/dist/common/src/testing/mocks/tree-sitter.d.ts +0 -58
  74. package/dist/common/src/testing-env-process.d.ts +0 -7
  75. package/dist/common/src/tools/constants.d.ts +0 -17
  76. package/dist/common/src/tools/list.d.ts +0 -1152
  77. package/dist/common/src/tools/params/tool/add-message.d.ts +0 -19
  78. package/dist/common/src/tools/params/tool/add-subgoal.d.ts +0 -26
  79. package/dist/common/src/tools/params/tool/ask-user.d.ts +0 -59
  80. package/dist/common/src/tools/params/tool/browser-logs.d.ts +0 -127
  81. package/dist/common/src/tools/params/tool/code-search.d.ts +0 -30
  82. package/dist/common/src/tools/params/tool/create-plan.d.ts +0 -30
  83. package/dist/common/src/tools/params/tool/end-turn.d.ts +0 -13
  84. package/dist/common/src/tools/params/tool/find-files.d.ts +0 -31
  85. package/dist/common/src/tools/params/tool/glob.d.ts +0 -26
  86. package/dist/common/src/tools/params/tool/list-directory.d.ts +0 -25
  87. package/dist/common/src/tools/params/tool/lookup-agent-info.d.ts +0 -13
  88. package/dist/common/src/tools/params/tool/propose-str-replace.d.ts +0 -40
  89. package/dist/common/src/tools/params/tool/propose-write-file.d.ts +0 -29
  90. package/dist/common/src/tools/params/tool/read-docs.d.ts +0 -19
  91. package/dist/common/src/tools/params/tool/read-files.d.ts +0 -35
  92. package/dist/common/src/tools/params/tool/read-subtree.d.ts +0 -40
  93. package/dist/common/src/tools/params/tool/run-file-change-hooks.d.ts +0 -63
  94. package/dist/common/src/tools/params/tool/run-terminal-command.d.ts +0 -88
  95. package/dist/common/src/tools/params/tool/send-message.d.ts +0 -26
  96. package/dist/common/src/tools/params/tool/set-messages.d.ts +0 -15
  97. package/dist/common/src/tools/params/tool/set-output.d.ts +0 -15
  98. package/dist/common/src/tools/params/tool/skill.d.ts +0 -28
  99. package/dist/common/src/tools/params/tool/spawn-agent-inline.d.ts +0 -17
  100. package/dist/common/src/tools/params/tool/spawn-agents.d.ts +0 -26
  101. package/dist/common/src/tools/params/tool/str-replace.d.ts +0 -43
  102. package/dist/common/src/tools/params/tool/suggest-followups.d.ts +0 -26
  103. package/dist/common/src/tools/params/tool/task-completed.d.ts +0 -13
  104. package/dist/common/src/tools/params/tool/task-create.d.ts +0 -24
  105. package/dist/common/src/tools/params/tool/task-get.d.ts +0 -15
  106. package/dist/common/src/tools/params/tool/task-list.d.ts +0 -13
  107. package/dist/common/src/tools/params/tool/task-update.d.ts +0 -29
  108. package/dist/common/src/tools/params/tool/team-create.d.ts +0 -17
  109. package/dist/common/src/tools/params/tool/team-delete.d.ts +0 -13
  110. package/dist/common/src/tools/params/tool/think-deeply.d.ts +0 -15
  111. package/dist/common/src/tools/params/tool/update-subgoal.d.ts +0 -25
  112. package/dist/common/src/tools/params/tool/web-search.d.ts +0 -25
  113. package/dist/common/src/tools/params/tool/write-file.d.ts +0 -31
  114. package/dist/common/src/tools/params/tool/write-todos.d.ts +0 -18
  115. package/dist/common/src/tools/params/utils.d.ts +0 -35
  116. package/dist/common/src/tools/utils.d.ts +0 -4
  117. package/dist/common/src/types/agent-template.d.ts +0 -156
  118. package/dist/common/src/types/contracts/agent-runtime.d.ts +0 -36
  119. package/dist/common/src/types/contracts/analytics.d.ts +0 -8
  120. package/dist/common/src/types/contracts/billing.d.ts +0 -40
  121. package/dist/common/src/types/contracts/client.d.ts +0 -45
  122. package/dist/common/src/types/contracts/database.d.ts +0 -80
  123. package/dist/common/src/types/contracts/env.d.ts +0 -150
  124. package/dist/common/src/types/contracts/llm.d.ts +0 -102
  125. package/dist/common/src/types/contracts/logger.d.ts +0 -8
  126. package/dist/common/src/types/dynamic-agent-template.d.ts +0 -227
  127. package/dist/common/src/types/filesystem.d.ts +0 -6
  128. package/dist/common/src/types/function-params.d.ts +0 -15
  129. package/dist/common/src/types/grant.d.ts +0 -2
  130. package/dist/common/src/types/json.d.ts +0 -9
  131. package/dist/common/src/types/mcp.d.ts +0 -31
  132. package/dist/common/src/types/messages/content-part.d.ts +0 -46
  133. package/dist/common/src/types/messages/data-content.d.ts +0 -3
  134. package/dist/common/src/types/messages/levelcode-message.d.ts +0 -37
  135. package/dist/common/src/types/messages/provider-metadata.d.ts +0 -3
  136. package/dist/common/src/types/print-mode.d.ts +0 -155
  137. package/dist/common/src/types/session-state.d.ts +0 -94
  138. package/dist/common/src/types/skill.d.ts +0 -31
  139. package/dist/common/src/types/source.d.ts +0 -8
  140. package/dist/common/src/types/spawn.d.ts +0 -8
  141. package/dist/common/src/types/team-config-schemas.d.ts +0 -217
  142. package/dist/common/src/types/team-config.d.ts +0 -42
  143. package/dist/common/src/types/team-hook-events.d.ts +0 -36
  144. package/dist/common/src/types/team-protocol.d.ts +0 -64
  145. package/dist/common/src/util/agent-id-parsing.d.ts +0 -22
  146. package/dist/common/src/util/agent-name-normalization.d.ts +0 -12
  147. package/dist/common/src/util/array.d.ts +0 -6
  148. package/dist/common/src/util/credentials.d.ts +0 -11
  149. package/dist/common/src/util/error.d.ts +0 -128
  150. package/dist/common/src/util/file.d.ts +0 -133
  151. package/dist/common/src/util/format-code-search.d.ts +0 -16
  152. package/dist/common/src/util/lru-cache.d.ts +0 -30
  153. package/dist/common/src/util/messages.d.ts +0 -46
  154. package/dist/common/src/util/model-utils.d.ts +0 -8
  155. package/dist/common/src/util/object.d.ts +0 -22
  156. package/dist/common/src/util/promise.d.ts +0 -16
  157. package/dist/common/src/util/random.d.ts +0 -1
  158. package/dist/common/src/util/skills.d.ts +0 -5
  159. package/dist/common/src/util/stop-sequence.d.ts +0 -14
  160. package/dist/common/src/util/string.d.ts +0 -82
  161. package/dist/common/src/util/xml.d.ts +0 -12
  162. package/dist/common/src/util/zod-schema.d.ts +0 -5
  163. package/dist/common/src/utils/dev-phases.d.ts +0 -23
  164. package/dist/common/src/utils/file-lock.d.ts +0 -13
  165. package/dist/common/src/utils/team-analytics.d.ts +0 -16
  166. package/dist/common/src/utils/team-discovery.d.ts +0 -47
  167. package/dist/common/src/utils/team-fs.d.ts +0 -20
  168. package/dist/common/src/utils/team-hook-emitter.d.ts +0 -40
  169. package/dist/common/src/utils/team-presets.d.ts +0 -35
  170. package/dist/packages/agent-runtime/src/constants.d.ts +0 -1
  171. package/dist/packages/agent-runtime/src/fast-rewrite.d.ts +0 -45
  172. package/dist/packages/agent-runtime/src/find-files/request-files-prompt.d.ts +0 -71
  173. package/dist/packages/agent-runtime/src/generate-diffs-prompt.d.ts +0 -53
  174. package/dist/packages/agent-runtime/src/get-file-reading-updates.d.ts +0 -8
  175. package/dist/packages/agent-runtime/src/inbox-poller.d.ts +0 -81
  176. package/dist/packages/agent-runtime/src/llm-api/claude.d.ts +0 -5
  177. package/dist/packages/agent-runtime/src/llm-api/context7-api.d.ts +0 -55
  178. package/dist/packages/agent-runtime/src/llm-api/gemini-with-fallbacks.d.ts +0 -40
  179. package/dist/packages/agent-runtime/src/llm-api/levelcode-web-api.d.ts +0 -49
  180. package/dist/packages/agent-runtime/src/llm-api/relace-api.d.ts +0 -16
  181. package/dist/packages/agent-runtime/src/main-prompt.d.ts +0 -29
  182. package/dist/packages/agent-runtime/src/mcp-constants.d.ts +0 -12
  183. package/dist/packages/agent-runtime/src/mcp.d.ts +0 -10
  184. package/dist/packages/agent-runtime/src/message-formatter.d.ts +0 -12
  185. package/dist/packages/agent-runtime/src/process-file-block.d.ts +0 -56
  186. package/dist/packages/agent-runtime/src/process-str-replace.d.ts +0 -21
  187. package/dist/packages/agent-runtime/src/prompt-agent-stream.d.ts +0 -28
  188. package/dist/packages/agent-runtime/src/run-agent-step.d.ts +0 -73
  189. package/dist/packages/agent-runtime/src/run-programmatic-step.d.ts +0 -40
  190. package/dist/packages/agent-runtime/src/system-prompt/prompts.d.ts +0 -19
  191. package/dist/packages/agent-runtime/src/system-prompt/search-system-prompt.d.ts +0 -14
  192. package/dist/packages/agent-runtime/src/system-prompt/team-context-prompt.d.ts +0 -9
  193. package/dist/packages/agent-runtime/src/system-prompt/team-prompt.d.ts +0 -9
  194. package/dist/packages/agent-runtime/src/system-prompt/truncate-file-tree.d.ts +0 -13
  195. package/dist/packages/agent-runtime/src/team-context.d.ts +0 -14
  196. package/dist/packages/agent-runtime/src/templates/agent-registry.d.ts +0 -35
  197. package/dist/packages/agent-runtime/src/templates/prompts.d.ts +0 -35
  198. package/dist/packages/agent-runtime/src/templates/strings.d.ts +0 -32
  199. package/dist/packages/agent-runtime/src/templates/types.d.ts +0 -13
  200. package/dist/packages/agent-runtime/src/tool-stream-parser.d.ts +0 -31
  201. package/dist/packages/agent-runtime/src/tools/handlers/handler-function-type.d.ts +0 -51
  202. package/dist/packages/agent-runtime/src/tools/handlers/list.d.ts +0 -370
  203. package/dist/packages/agent-runtime/src/tools/handlers/tool/add-message.d.ts +0 -9
  204. package/dist/packages/agent-runtime/src/tools/handlers/tool/add-subgoal.d.ts +0 -9
  205. package/dist/packages/agent-runtime/src/tools/handlers/tool/ask-user.d.ts +0 -10
  206. package/dist/packages/agent-runtime/src/tools/handlers/tool/browser-logs.d.ts +0 -8
  207. package/dist/packages/agent-runtime/src/tools/handlers/tool/code-search.d.ts +0 -8
  208. package/dist/packages/agent-runtime/src/tools/handlers/tool/create-plan.d.ts +0 -13
  209. package/dist/packages/agent-runtime/src/tools/handlers/tool/end-turn.d.ts +0 -7
  210. package/dist/packages/agent-runtime/src/tools/handlers/tool/find-files.d.ts +0 -27
  211. package/dist/packages/agent-runtime/src/tools/handlers/tool/glob.d.ts +0 -10
  212. package/dist/packages/agent-runtime/src/tools/handlers/tool/list-directory.d.ts +0 -10
  213. package/dist/packages/agent-runtime/src/tools/handlers/tool/lookup-agent-info.d.ts +0 -14
  214. package/dist/packages/agent-runtime/src/tools/handlers/tool/propose-str-replace.d.ts +0 -15
  215. package/dist/packages/agent-runtime/src/tools/handlers/tool/propose-write-file.d.ts +0 -7
  216. package/dist/packages/agent-runtime/src/tools/handlers/tool/proposed-content-store.d.ts +0 -27
  217. package/dist/packages/agent-runtime/src/tools/handlers/tool/read-docs.d.ts +0 -21
  218. package/dist/packages/agent-runtime/src/tools/handlers/tool/read-files.d.ts +0 -13
  219. package/dist/packages/agent-runtime/src/tools/handlers/tool/read-subtree.d.ts +0 -13
  220. package/dist/packages/agent-runtime/src/tools/handlers/tool/run-file-change-hooks.d.ts +0 -10
  221. package/dist/packages/agent-runtime/src/tools/handlers/tool/run-terminal-command.d.ts +0 -10
  222. package/dist/packages/agent-runtime/src/tools/handlers/tool/send-message.d.ts +0 -15
  223. package/dist/packages/agent-runtime/src/tools/handlers/tool/set-messages.d.ts +0 -9
  224. package/dist/packages/agent-runtime/src/tools/handlers/tool/set-output.d.ts +0 -18
  225. package/dist/packages/agent-runtime/src/tools/handlers/tool/skill.d.ts +0 -11
  226. package/dist/packages/agent-runtime/src/tools/handlers/tool/spawn-agent-inline.d.ts +0 -29
  227. package/dist/packages/agent-runtime/src/tools/handlers/tool/spawn-agent-utils.d.ts +0 -130
  228. package/dist/packages/agent-runtime/src/tools/handlers/tool/spawn-agents.d.ts +0 -37
  229. package/dist/packages/agent-runtime/src/tools/handlers/tool/str-replace.d.ts +0 -16
  230. package/dist/packages/agent-runtime/src/tools/handlers/tool/suggest-followups.d.ts +0 -9
  231. package/dist/packages/agent-runtime/src/tools/handlers/tool/task-completed.d.ts +0 -15
  232. package/dist/packages/agent-runtime/src/tools/handlers/tool/task-create.d.ts +0 -10
  233. package/dist/packages/agent-runtime/src/tools/handlers/tool/task-get.d.ts +0 -10
  234. package/dist/packages/agent-runtime/src/tools/handlers/tool/task-list.d.ts +0 -10
  235. package/dist/packages/agent-runtime/src/tools/handlers/tool/task-update.d.ts +0 -15
  236. package/dist/packages/agent-runtime/src/tools/handlers/tool/team-create.d.ts +0 -15
  237. package/dist/packages/agent-runtime/src/tools/handlers/tool/team-delete.d.ts +0 -15
  238. package/dist/packages/agent-runtime/src/tools/handlers/tool/think-deeply.d.ts +0 -9
  239. package/dist/packages/agent-runtime/src/tools/handlers/tool/update-subgoal.d.ts +0 -11
  240. package/dist/packages/agent-runtime/src/tools/handlers/tool/web-search.d.ts +0 -22
  241. package/dist/packages/agent-runtime/src/tools/handlers/tool/write-file.d.ts +0 -49
  242. package/dist/packages/agent-runtime/src/tools/handlers/tool/write-todos.d.ts +0 -9
  243. package/dist/packages/agent-runtime/src/tools/prompts.d.ts +0 -31
  244. package/dist/packages/agent-runtime/src/tools/stream-parser.d.ts +0 -33
  245. package/dist/packages/agent-runtime/src/tools/tool-executor.d.ts +0 -87
  246. package/dist/packages/agent-runtime/src/util/agent-output.d.ts +0 -3
  247. package/dist/packages/agent-runtime/src/util/messages.d.ts +0 -68
  248. package/dist/packages/agent-runtime/src/util/parse-tool-calls-from-text.d.ts +0 -38
  249. package/dist/packages/agent-runtime/src/util/render-read-files-result.d.ts +0 -15
  250. package/dist/packages/agent-runtime/src/util/simplify-tool-results.d.ts +0 -7
  251. package/dist/packages/agent-runtime/src/util/stream-xml-parser.d.ts +0 -34
  252. package/dist/packages/agent-runtime/src/util/token-counter.d.ts +0 -3
  253. package/dist/packages/code-map/src/index.d.ts +0 -3
  254. package/dist/packages/code-map/src/init-node.d.ts +0 -4
  255. package/dist/packages/code-map/src/languages.d.ts +0 -36
  256. package/dist/packages/code-map/src/parse.d.ts +0 -21
  257. package/dist/packages/code-map/src/types.d.ts +0 -8
  258. package/dist/packages/code-map/src/utils.d.ts +0 -1
  259. package/dist/sdk/src/__tests__/client.test.d.ts +0 -1
  260. package/dist/sdk/src/__tests__/code-search.test.d.ts +0 -1
  261. package/dist/sdk/src/__tests__/credentials.test.d.ts +0 -1
  262. package/dist/sdk/src/__tests__/database.test.d.ts +0 -1
  263. package/dist/sdk/src/__tests__/env.test.d.ts +0 -1
  264. package/dist/sdk/src/__tests__/error-utils.test.d.ts +0 -1
  265. package/dist/sdk/src/__tests__/initial-session-state.test.d.ts +0 -1
  266. package/dist/sdk/src/__tests__/knowledge-file-selection.test.d.ts +0 -1
  267. package/dist/sdk/src/__tests__/load-agents.test.d.ts +0 -1
  268. package/dist/sdk/src/__tests__/load-mcp-config.test.d.ts +0 -1
  269. package/dist/sdk/src/__tests__/model-provider.test.d.ts +0 -1
  270. package/dist/sdk/src/__tests__/read-files.test.d.ts +0 -1
  271. package/dist/sdk/src/__tests__/run-cancellation.test.d.ts +0 -1
  272. package/dist/sdk/src/__tests__/run-file-filter.test.d.ts +0 -1
  273. package/dist/sdk/src/__tests__/run-handle-event.test.d.ts +0 -1
  274. package/dist/sdk/src/__tests__/run.integration.test.d.ts +0 -1
  275. package/dist/sdk/src/__tests__/team-api.test.d.ts +0 -1
  276. package/dist/sdk/src/__tests__/user-knowledge-files.test.d.ts +0 -1
  277. package/dist/sdk/src/__tests__/validate-agents.test.d.ts +0 -1
  278. package/dist/sdk/src/agents/load-agents.d.ts +0 -106
  279. package/dist/sdk/src/agents/load-mcp-config.d.ts +0 -69
  280. package/dist/sdk/src/client.d.ts +0 -71
  281. package/dist/sdk/src/constants.d.ts +0 -4
  282. package/dist/sdk/src/credentials.d.ts +0 -58
  283. package/dist/sdk/src/custom-tool.d.ts +0 -32
  284. package/dist/sdk/src/env.d.ts +0 -31
  285. package/dist/sdk/src/error-utils.d.ts +0 -55
  286. package/dist/sdk/src/impl/__tests__/prompt-result.test.d.ts +0 -1
  287. package/dist/sdk/src/impl/agent-runtime.d.ts +0 -8
  288. package/dist/sdk/src/impl/database.d.ts +0 -7
  289. package/dist/sdk/src/impl/llm.d.ts +0 -8
  290. package/dist/sdk/src/impl/model-provider.d.ts +0 -61
  291. package/dist/sdk/src/index.d.ts +0 -42
  292. package/dist/sdk/src/native/ripgrep.d.ts +0 -7
  293. package/dist/sdk/src/retry-config.d.ts +0 -46
  294. package/dist/sdk/src/run-state.d.ts +0 -81
  295. package/dist/sdk/src/run.d.ts +0 -79
  296. package/dist/sdk/src/skills/load-skills.d.ts +0 -42
  297. package/dist/sdk/src/team.d.ts +0 -49
  298. package/dist/sdk/src/testing/env.d.ts +0 -5
  299. package/dist/sdk/src/tools/change-file.d.ts +0 -7
  300. package/dist/sdk/src/tools/code-search.d.ts +0 -13
  301. package/dist/sdk/src/tools/glob.d.ts +0 -8
  302. package/dist/sdk/src/tools/index.d.ts +0 -16
  303. package/dist/sdk/src/tools/list-directory.d.ts +0 -7
  304. package/dist/sdk/src/tools/read-files.d.ts +0 -16
  305. package/dist/sdk/src/tools/run-file-change-hooks.d.ts +0 -4
  306. package/dist/sdk/src/tools/run-terminal-command.d.ts +0 -8
  307. package/dist/sdk/src/types/env.d.ts +0 -30
  308. package/dist/sdk/src/validate-agents.d.ts +0 -45
  309. package/dist/vendor/ripgrep/arm64-darwin/rg +0 -0
  310. package/dist/vendor/ripgrep/arm64-linux/rg +0 -0
  311. package/dist/vendor/ripgrep/x64-darwin/rg +0 -0
  312. package/dist/vendor/ripgrep/x64-linux/rg +0 -0
  313. package/dist/vendor/ripgrep/x64-win32/rg.exe +0 -0
  314. package/dist/wasm/tree-sitter-c-sharp.wasm +0 -0
  315. package/dist/wasm/tree-sitter-cpp.wasm +0 -0
  316. package/dist/wasm/tree-sitter-go.wasm +0 -0
  317. package/dist/wasm/tree-sitter-java.wasm +0 -0
  318. package/dist/wasm/tree-sitter-javascript.wasm +0 -0
  319. package/dist/wasm/tree-sitter-python.wasm +0 -0
  320. package/dist/wasm/tree-sitter-ruby.wasm +0 -0
  321. package/dist/wasm/tree-sitter-rust.wasm +0 -0
  322. package/dist/wasm/tree-sitter-tsx.wasm +0 -0
  323. package/dist/wasm/tree-sitter-typescript.wasm +0 -0
  324. package/dist/wasm/tree-sitter.wasm +0 -0
@@ -1,133 +0,0 @@
1
- import { z } from 'zod/v4';
2
- import type { LevelCodeFileSystem } from '../types/filesystem';
3
- import type { SkillsMap } from '../types/skill';
4
- export declare const FileTreeNodeSchema: z.ZodType<FileTreeNode>;
5
- export interface FileTreeNode {
6
- name: string;
7
- type: 'file' | 'directory';
8
- filePath: string;
9
- lastReadTime?: number;
10
- children?: FileTreeNode[];
11
- }
12
- export interface DirectoryNode extends FileTreeNode {
13
- type: 'directory';
14
- children: FileTreeNode[];
15
- }
16
- export interface FileNode extends FileTreeNode {
17
- type: 'file';
18
- lastReadTime: number;
19
- }
20
- export declare const FileVersionSchema: z.ZodObject<{
21
- path: z.ZodString;
22
- content: z.ZodString;
23
- }, z.core.$strip>;
24
- export type FileVersion = z.infer<typeof FileVersionSchema>;
25
- export declare const customToolDefinitionsSchema: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
26
- inputSchema: z.ZodCustom<Record<string, unknown> | z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
27
- endsAgentStep: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
28
- description: z.ZodOptional<z.ZodString>;
29
- exampleInputs: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodAny>>>;
30
- }, z.core.$strip>>>;
31
- export type CustomToolDefinitions = NonNullable<z.input<typeof customToolDefinitionsSchema>>;
32
- export declare const ProjectFileContextSchema: z.ZodObject<{
33
- projectRoot: z.ZodString;
34
- cwd: z.ZodString;
35
- fileTree: z.ZodArray<z.ZodCustom<FileTreeNode, FileTreeNode>>;
36
- fileTokenScores: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodNumber>>;
37
- tokenCallers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>>;
38
- knowledgeFiles: z.ZodRecord<z.ZodString, z.ZodString>;
39
- userKnowledgeFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
40
- agentTemplates: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
41
- customToolDefinitions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
42
- inputSchema: z.ZodCustom<Record<string, unknown> | z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, Record<string, unknown> | z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
43
- endsAgentStep: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
44
- description: z.ZodOptional<z.ZodString>;
45
- exampleInputs: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodAny>>>;
46
- }, z.core.$strip>>>;
47
- skills: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
48
- gitChanges: z.ZodObject<{
49
- status: z.ZodString;
50
- diff: z.ZodString;
51
- diffCached: z.ZodString;
52
- lastCommitMessages: z.ZodString;
53
- }, z.core.$strip>;
54
- changesSinceLastChat: z.ZodRecord<z.ZodString, z.ZodString>;
55
- shellConfigFiles: z.ZodRecord<z.ZodString, z.ZodString>;
56
- systemInfo: z.ZodObject<{
57
- platform: z.ZodString;
58
- shell: z.ZodString;
59
- nodeVersion: z.ZodString;
60
- arch: z.ZodString;
61
- homedir: z.ZodString;
62
- cpus: z.ZodNumber;
63
- }, z.core.$strip>;
64
- }, z.core.$strip>;
65
- export type ProjectFileContext = {
66
- projectRoot: string;
67
- cwd: string;
68
- fileTree: FileTreeNode[];
69
- fileTokenScores: Record<string, Record<string, number>>;
70
- tokenCallers?: Record<string, Record<string, string[]>>;
71
- knowledgeFiles: Record<string, string>;
72
- userKnowledgeFiles?: Record<string, string>;
73
- agentTemplates: Record<string, any>;
74
- customToolDefinitions: CustomToolDefinitions;
75
- skills?: SkillsMap;
76
- gitChanges: {
77
- status: string;
78
- diff: string;
79
- diffCached: string;
80
- lastCommitMessages: string;
81
- };
82
- changesSinceLastChat: Record<string, string>;
83
- shellConfigFiles: Record<string, string>;
84
- systemInfo: {
85
- platform: string;
86
- shell: string;
87
- nodeVersion: string;
88
- arch: string;
89
- homedir: string;
90
- cpus: number;
91
- };
92
- };
93
- export declare const fileRegex: RegExp;
94
- export declare const fileWithNoPathRegex: RegExp;
95
- export declare const parseFileBlocks: (fileBlocks: string) => Record<string, string>;
96
- export declare const getStubProjectFileContext: () => ProjectFileContext;
97
- export declare const createMarkdownFileBlock: (filePath: string, content: string) => string;
98
- export declare const parseMarkdownCodeBlock: (content: string) => string;
99
- export declare const createSearchReplaceBlock: (search: string, replace: string) => string;
100
- export declare function printFileTree(nodes: FileTreeNode[], depth?: number): string;
101
- export declare function printFileTreeWithTokens(nodes: FileTreeNode[], fileTokenScores: Record<string, Record<string, number>>, path?: string[]): string;
102
- /**
103
- * Ensures the given file contents ends with a newline character.
104
- * @param contents - The file contents
105
- * @returns the file contents with a newline character.
106
- */
107
- export declare const ensureEndsWithNewline: (contents: string | null) => string | null;
108
- /**
109
- * Node-compatible file existence check.
110
- * Uses fs.stat instead of Bun-specific fs.exists.
111
- */
112
- export declare function fileExists(params: {
113
- filePath: string;
114
- fs: LevelCodeFileSystem;
115
- }): Promise<boolean>;
116
- export declare const ensureDirectoryExists: (params: {
117
- baseDir: string;
118
- fs: LevelCodeFileSystem;
119
- }) => Promise<void>;
120
- /**
121
- * Removes markdown code block syntax if present, including any language tag
122
- */
123
- export declare const cleanMarkdownCodeBlock: (content: string) => string;
124
- export declare function isValidFilePath(path: string): boolean;
125
- export declare function isDir(params: {
126
- path: string;
127
- fs: LevelCodeFileSystem;
128
- }): Promise<boolean>;
129
- /**
130
- * Returns true if the `toPath` is a subdirectory of `fromPath`.
131
- */
132
- export declare function isSubdir(fromPath: string, toPath: string): boolean;
133
- export declare function isValidProjectRoot(dir: string): boolean;
@@ -1,16 +0,0 @@
1
- /**
2
- * Formats code search output to group matches by file.
3
- *
4
- * Input format: ./file.ts:line content
5
- * Output format:
6
- * ./file.ts:
7
- * line content
8
- * another line content
9
- * yet another line content
10
- *
11
- * (double newline between distinct files)
12
- *
13
- * @param stdout The raw stdout from ripgrep
14
- * @returns Formatted output with matches grouped by file
15
- */
16
- export declare function formatCodeSearchOutput(stdout: string): string;
@@ -1,30 +0,0 @@
1
- /**
2
- * A simple Least Recently Used (LRU) cache implementation using a Map.
3
- * It leverages the fact that Map objects maintain insertion order.
4
- */
5
- export declare class LRUCache<K, V> {
6
- private maxSize;
7
- private cache;
8
- constructor(maxSize: number);
9
- /**
10
- * Retrieves an item from the cache. If found, marks it as recently used.
11
- * @param key The key of the item to retrieve.
12
- * @returns The value associated with the key, or undefined if not found.
13
- */
14
- get(key: K): V | undefined;
15
- /**
16
- * Adds or updates an item in the cache. If the cache exceeds maxSize,
17
- * the least recently used item is evicted.
18
- * @param key The key of the item to set.
19
- * @param value The value to associate with the key.
20
- */
21
- set(key: K, value: V): void;
22
- /**
23
- * Returns the current number of items in the cache.
24
- */
25
- get size(): number;
26
- /**
27
- * Clears all items from the cache.
28
- */
29
- clear(): void;
30
- }
@@ -1,46 +0,0 @@
1
- import type { Logger } from '../types/contracts/logger';
2
- import type { JSONValue } from '../types/json';
3
- import type { AssistantMessage, Message, SystemMessage, UserMessage } from '../types/messages/levelcode-message';
4
- import type { ToolResultOutput } from '../types/messages/content-part';
5
- import type { ProviderMetadata } from '../types/messages/provider-metadata';
6
- import type { ModelMessage } from 'ai';
7
- export declare function toContentString(msg: ModelMessage): string;
8
- export declare function withCacheControl<T extends {
9
- providerOptions?: ProviderMetadata;
10
- }>(obj: T): T;
11
- export declare function withoutCacheControl<T extends {
12
- providerOptions?: ProviderMetadata;
13
- }>(obj: T): T;
14
- export declare function convertCbToModelMessages({ messages, includeCacheControl, logger, }: {
15
- messages: Message[];
16
- includeCacheControl?: boolean;
17
- logger?: Logger;
18
- }): ModelMessage[];
19
- export type SystemContent = string | SystemMessage['content'][number] | SystemMessage['content'];
20
- export declare function systemContent(content: SystemContent): SystemMessage['content'];
21
- export declare function systemMessage(params: SystemContent | ({
22
- content: SystemContent;
23
- } & Omit<SystemMessage, 'role' | 'content'>)): SystemMessage;
24
- export type UserContent = string | UserMessage['content'][number] | UserMessage['content'];
25
- export declare function userContent(content: UserContent): UserMessage['content'];
26
- export declare function userMessage(params: UserContent | ({
27
- content: UserContent;
28
- } & Omit<UserMessage, 'role' | 'content'>)): UserMessage;
29
- export type AssistantContent = string | AssistantMessage['content'][number] | AssistantMessage['content'];
30
- export declare function assistantContent(content: AssistantContent): AssistantMessage['content'];
31
- export declare function assistantMessage(params: AssistantContent | ({
32
- content: AssistantContent;
33
- } & Omit<AssistantMessage, 'role' | 'content'>)): AssistantMessage;
34
- export declare function jsonToolResult<T extends JSONValue>(value: T): [
35
- Extract<ToolResultOutput, {
36
- type: 'json';
37
- }> & {
38
- value: T;
39
- }
40
- ];
41
- export declare function mediaToolResult(params: {
42
- data: string;
43
- mediaType: string;
44
- }): [Extract<ToolResultOutput, {
45
- type: 'media';
46
- }>];
@@ -1,8 +0,0 @@
1
- import type { Model } from '../old-constants';
2
- /**
3
- * Check if a model is explicitly defined in the models constant object.
4
- * This is used to determine if a model should allow fallbacks or support cache control.
5
- * @param model - The model to check
6
- * @returns boolean - True if the model is explicitly defined, false otherwise
7
- */
8
- export declare function isExplicitlyDefinedModel(model: Model): boolean;
@@ -1,22 +0,0 @@
1
- type RemoveUndefined<T extends object> = {
2
- [K in keyof T as T[K] extends undefined ? never : K]: Exclude<T[K], undefined>;
3
- };
4
- export declare const removeUndefinedProps: <T extends object>(obj: T) => RemoveUndefined<T>;
5
- export declare const removeNullOrUndefinedProps: <T extends object>(obj: T, exceptions?: string[]) => T;
6
- export declare const addObjects: <T extends {
7
- [key: string]: number;
8
- }>(obj1: T, obj2: T) => T;
9
- export declare const subtractObjects: <T extends {
10
- [key: string]: number;
11
- }>(obj1: T, obj2: T) => T;
12
- export declare const hasChanges: <T extends object>(obj: T, partial: Partial<T>) => boolean;
13
- export declare const hasSignificantDeepChanges: <T extends object>(obj: T, partial: Partial<T>, epsilonForNumbers: number) => boolean;
14
- export declare const filterObject: <T extends object>(obj: T, predicate: (value: any, key: keyof T) => boolean) => { [P in keyof T]: T[P]; };
15
- /**
16
- * Asserts that a condition is true. If the condition is false, it throws an error with the provided message.
17
- * @param condition The condition to check
18
- * @param message The error message to display if the condition is false
19
- * @throws {Error} If the condition is false
20
- */
21
- export declare function assert(condition: boolean, message: string): asserts condition;
22
- export {};
@@ -1,16 +0,0 @@
1
- export declare const INITIAL_RETRY_DELAY = 1000;
2
- export declare function withRetry<T>(operation: () => Promise<T>, options?: {
3
- maxRetries?: number;
4
- retryIf?: (error: any) => boolean;
5
- onRetry?: (error: any, attempt: number) => void;
6
- retryDelayMs?: number;
7
- }): Promise<T>;
8
- export declare const sleep: (ms: number) => Promise<unknown>;
9
- /**
10
- * Wraps a promise with a timeout
11
- * @param promise The promise to wrap
12
- * @param timeoutMs Timeout in milliseconds
13
- * @param timeoutMessage Optional message for the timeout error
14
- * @returns A promise that resolves with the result of the original promise or rejects with a timeout error
15
- */
16
- export declare function withTimeout<T>(promise: Promise<T>, timeoutMs: number, timeoutMessage?: string): Promise<T>;
@@ -1 +0,0 @@
1
- export declare function sampleSizeWithSeed<T>(array: T[], size: number, seed: string): T[];
@@ -1,5 +0,0 @@
1
- import type { SkillsMap } from '../types/skill';
2
- /**
3
- * Formats available skills as XML for inclusion in tool descriptions.
4
- */
5
- export declare function formatAvailableSkillsXml(skills: SkillsMap): string;
@@ -1,14 +0,0 @@
1
- export declare class StopSequenceHandler {
2
- private buffer;
3
- private finished;
4
- private stopSequences;
5
- constructor(stopSequences?: string[]);
6
- process(text: string): {
7
- text: string;
8
- endOfStream: boolean;
9
- } | {
10
- text: null;
11
- endOfStream: true;
12
- };
13
- flush(): string;
14
- }
@@ -1,82 +0,0 @@
1
- export declare const truncateString: (str: string, maxLength: number) => string;
2
- export declare const truncateStringWithMessage: ({ str, maxLength, message, remove, }: {
3
- str: string;
4
- maxLength: number;
5
- message?: string;
6
- remove?: "END" | "START" | "MIDDLE";
7
- }) => string;
8
- /**
9
- * Check if a character is a whitespace character according
10
- * to the XML spec (space, carriage return, line feed or tab)
11
- *
12
- * @param character Character to check
13
- * @return Whether the character is whitespace or not
14
- */
15
- export declare const isWhitespace: (character: string) => boolean;
16
- export declare const replaceNonStandardPlaceholderComments: (content: string, replacement: string) => string;
17
- export declare const randBoolFromStr: (str: string) => boolean;
18
- export declare const pluralize: (count: number, word: string, { includeCount }?: {
19
- includeCount?: boolean;
20
- }) => string;
21
- /**
22
- * Safely replaces all occurrences of a search string with a replacement string,
23
- * escaping special replacement patterns (like $) in the replacement string.
24
- */
25
- export declare const capitalize: (str: string) => string;
26
- /**
27
- * Converts a snake_case string to Title Case
28
- * Example: "add_subgoal" -> "Add Subgoal"
29
- */
30
- export declare const snakeToTitleCase: (str: string) => string;
31
- /**
32
- * Ensures a URL has the appropriate protocol (http:// or https://)
33
- * Uses http:// for localhost and local IPs, https:// for all other domains
34
- */
35
- export declare const ensureUrlProtocol: (url: string) => string;
36
- export declare const safeReplace: (content: string, searchStr: string, replaceStr: string) => string;
37
- export declare const hasLazyEdit: (content: string) => boolean;
38
- /**
39
- * Extracts a JSON field from a string, transforms it, and puts it back.
40
- * Handles both array and object JSON values.
41
- * @param content The string containing JSON-like content
42
- * @param field The field name to find and transform
43
- * @param transform Function to transform the parsed JSON value
44
- * @param fallback String to use if parsing fails
45
- * @returns The content string with the transformed JSON field
46
- */
47
- export declare function transformJsonInString<T = unknown>(content: string, field: string, transform: (json: T) => unknown, fallback: string): string;
48
- /**
49
- * Generates a compact unique identifier by combining timestamp bits with random bits.
50
- * Uses 40 bits of timestamp (enough for ~34 years) and 24 random bits for exactly 64 total bits.
51
- * Encodes in base64url for compact, URL-safe strings (~11 chars).
52
- * @param prefix Optional prefix to add to the ID
53
- * @returns A unique string ID
54
- * @example
55
- * generateCompactId() // => "1a2b3c4d5e6"
56
- * generateCompactId('msg-') // => "msg-1a2b3c4d5e6"
57
- */
58
- export declare const generateCompactId: (prefix?: string) => string;
59
- /**
60
- * Removes null characters from a string
61
- */
62
- export declare const stripNullChars: (str: string) => string;
63
- export declare function stripColors(str: string): string;
64
- export declare function stripAnsi(str: string): string;
65
- export declare function includesMatch(array: (string | RegExp)[], value: string): boolean;
66
- /**
67
- * Finds the longest substring that is **both** a suffix of `source`
68
- * **and** a prefix of `next`.
69
- * Useful when concatenating strings while avoiding duplicate overlap.
70
- *
71
- * @example
72
- * ```ts
73
- * suffixPrefixOverlap('foobar', 'barbaz'); // ➜ 'bar'
74
- * suffixPrefixOverlap('abc', 'def'); // ➜ ''
75
- * ```
76
- *
77
- * @param source The string whose **suffix** is inspected.
78
- * @param next The string whose **prefix** is inspected.
79
- * @returns The longest overlapping edge, or an empty string if none exists.
80
- */
81
- export declare function suffixPrefixOverlap(source: string, next: string): string;
82
- export declare const escapeString: (str: string) => string;
@@ -1,12 +0,0 @@
1
- /**
2
- * Generate a closing XML tag for a single tool name
3
- * @param toolName Single tool name to generate closing tag for
4
- * @returns Closing XML tag string
5
- */
6
- export declare function closeXml(toolName: string): string;
7
- /**
8
- * Generate stop sequences (closing XML tags) for a list of tool names
9
- * @param toolNames Array of tool names to generate closing tags for
10
- * @returns Array of closing XML tag strings
11
- */
12
- export declare function getStopSequences(toolNames: readonly string[]): string[];
@@ -1,5 +0,0 @@
1
- import z from 'zod/v4';
2
- /**
3
- * Convert a Zod4 schema to JSON string representation.
4
- */
5
- export declare function schemaToJsonStr(schema: z.ZodTypeAny | undefined | Record<string, any>, options?: Parameters<typeof z.toJSONSchema>[1]): string;
@@ -1,23 +0,0 @@
1
- import type { ToolName } from '../tools/constants.js';
2
- import type { DevPhase, TeamConfig } from '../types/team-config.js';
3
- export declare const PHASE_ORDER: readonly DevPhase[];
4
- export declare function getPhaseOrder(phase: DevPhase): number;
5
- export declare function canTransition(currentPhase: DevPhase, targetPhase: DevPhase): boolean;
6
- export declare function transitionPhase(teamConfig: TeamConfig, targetPhase: DevPhase): TeamConfig;
7
- export declare function getPhaseDescription(phase: DevPhase): string;
8
- /**
9
- * Team tool names that are subject to phase gating.
10
- * Non-team tools (read_files, str_replace, etc.) are not gated by dev phase.
11
- */
12
- export declare const TEAM_TOOL_NAMES: readonly ToolName[];
13
- export declare function getPhaseTools(phase: DevPhase): ToolName[];
14
- /**
15
- * Checks whether a specific tool is allowed in the given dev phase.
16
- * Only team tools are gated by phase. Non-team tools always return true.
17
- */
18
- export declare function isToolAllowedInPhase(toolName: string, phase: DevPhase): boolean;
19
- /**
20
- * Returns the minimum phase required to use a given team tool.
21
- * Returns null for non-team tools (they are always allowed).
22
- */
23
- export declare function getMinimumPhaseForTool(toolName: string): DevPhase | null;
@@ -1,13 +0,0 @@
1
- /**
2
- * Acquire an exclusive lock on a file path using a .lock sidecar file.
3
- * Returns a release function that must be called when done.
4
- *
5
- * The lock file contains a timestamp. If the lock is older than `staleMs`,
6
- * it is considered abandoned and will be forcibly acquired.
7
- */
8
- export declare function acquireLock(filePath: string, timeout?: number): Promise<() => void>;
9
- /**
10
- * Execute a function while holding an exclusive file lock.
11
- * The lock is automatically released when the function completes or throws.
12
- */
13
- export declare function withLock<T>(filePath: string, fn: () => T | Promise<T>): Promise<T>;
@@ -1,16 +0,0 @@
1
- import type { TrackEventFn } from '../types/contracts/analytics';
2
- import type { Logger } from '../types/contracts/logger';
3
- import type { DevPhase } from '../types/team-config';
4
- type TrackingContext = {
5
- trackEvent: TrackEventFn;
6
- userId: string;
7
- logger: Logger;
8
- };
9
- export declare function trackTeamCreated(ctx: TrackingContext, teamName: string, memberCount: number): void;
10
- export declare function trackTeamDeleted(ctx: TrackingContext, teamName: string): void;
11
- export declare function trackTeammateIdle(ctx: TrackingContext, teamName: string, agentName: string, role: string): void;
12
- export declare function trackTaskCompleted(ctx: TrackingContext, teamName: string, taskId: string, taskSubject: string, owner: string): void;
13
- export declare function trackPhaseTransition(ctx: TrackingContext, teamName: string, fromPhase: DevPhase, toPhase: DevPhase): void;
14
- export declare function trackMessageSent(ctx: TrackingContext, teamName: string, type: 'dm' | 'broadcast' | 'shutdown'): void;
15
- export declare function trackAgentSpawned(ctx: TrackingContext, teamName: string, role: string, agentName: string): void;
16
- export {};
@@ -1,47 +0,0 @@
1
- import type { TeamConfig, DevPhase, TeamRole } from '../types/team-config';
2
- export interface TeamAndAgent {
3
- teamName: string;
4
- agentName: string;
5
- config: TeamConfig;
6
- }
7
- export interface AgentTeamContext {
8
- teamName: string;
9
- agentName: string;
10
- role: TeamRole;
11
- isLeader: boolean;
12
- phase: DevPhase;
13
- }
14
- export interface TeamSummary {
15
- name: string;
16
- phase: DevPhase;
17
- memberCount: number;
18
- }
19
- /**
20
- * Finds the team that an agent belongs to, returning the team name and config.
21
- * Matches against both the raw agentId and a "lead-" prefixed variant.
22
- */
23
- export declare function findCurrentTeam(agentId: string): {
24
- teamName: string;
25
- config: TeamConfig;
26
- } | null;
27
- /**
28
- * Finds the team and the matched agent name for a given agent identifier.
29
- * This is the richer variant that also returns which member name was matched.
30
- */
31
- export declare function findCurrentTeamAndAgent(agentId: string): TeamAndAgent | null;
32
- /**
33
- * Direct lookup of a team by name.
34
- */
35
- export declare function findTeamByName(name: string): TeamConfig | null;
36
- /**
37
- * Lists all teams with summary information.
38
- */
39
- export declare function listAllTeams(): TeamSummary[];
40
- /**
41
- * Returns full context for an agent's team membership including role and leadership status.
42
- */
43
- export declare function getAgentTeamContext(agentId: string): AgentTeamContext | null;
44
- /**
45
- * Checks whether an agent is a member of a specific team.
46
- */
47
- export declare function isAgentInTeam(agentId: string, teamName: string): boolean;
@@ -1,20 +0,0 @@
1
- import type { TeamConfig, TeamMember, TeamTask } from '../types/team-config';
2
- import type { TeamProtocolMessage } from '../types/team-protocol';
3
- export declare function validateTeamName(teamName: string): void;
4
- export declare function validateAgentName(agentName: string): void;
5
- export declare function validateTaskId(taskId: string): void;
6
- export declare function getTeamsDir(): string;
7
- export declare function getTasksDir(teamName: string): string;
8
- export declare function createTeam(config: TeamConfig): void;
9
- export declare function loadTeamConfig(teamName: string): TeamConfig | null;
10
- export declare function saveTeamConfig(teamName: string, config: TeamConfig): Promise<void>;
11
- export declare function deleteTeam(teamName: string): void;
12
- export declare function addTeamMember(teamName: string, member: TeamMember): Promise<void>;
13
- export declare function removeTeamMember(teamName: string, agentId: string): Promise<void>;
14
- export declare function createTask(teamName: string, task: TeamTask): Promise<void>;
15
- export declare function updateTask(teamName: string, taskId: string, updates: Partial<TeamTask>): Promise<void>;
16
- export declare function listTasks(teamName: string): TeamTask[];
17
- export declare function getTask(teamName: string, taskId: string): TeamTask | null;
18
- export declare function sendMessage(teamName: string, to: string, message: TeamProtocolMessage): Promise<void>;
19
- export declare function readInbox(teamName: string, agentName: string): TeamProtocolMessage[];
20
- export declare function clearInbox(teamName: string, agentName: string): void;
@@ -1,40 +0,0 @@
1
- import type { TrackEventFn } from '../types/contracts/analytics';
2
- import type { Logger } from '../types/contracts/logger';
3
- import type { TeamHookEvent } from '../types/team-hook-events';
4
- import type { DevPhase } from '../types/team-config';
5
- /**
6
- * Subscribe to all team hook events.
7
- * Returns an unsubscribe function.
8
- */
9
- export declare function onTeamHookEvent(listener: (event: TeamHookEvent) => void): () => void;
10
- /**
11
- * Dispatch a team hook event to all registered listeners.
12
- * Exported for use in contexts (e.g. CLI) where the full emit helpers
13
- * cannot be used because a server-side TrackEventFn is not available.
14
- */
15
- export declare function dispatchTeamHookEvent(event: TeamHookEvent): void;
16
- export declare function emitTeammateIdle(params: {
17
- agentName: string;
18
- teamName: string;
19
- lastTaskId?: string;
20
- trackEvent: TrackEventFn;
21
- userId: string;
22
- logger: Logger;
23
- }): void;
24
- export declare function emitTaskCompleted(params: {
25
- taskId: string;
26
- taskSubject: string;
27
- owner: string;
28
- teamName: string;
29
- trackEvent: TrackEventFn;
30
- userId: string;
31
- logger: Logger;
32
- }): void;
33
- export declare function emitPhaseTransition(params: {
34
- teamName: string;
35
- fromPhase: DevPhase;
36
- toPhase: DevPhase;
37
- trackEvent: TrackEventFn;
38
- userId: string;
39
- logger: Logger;
40
- }): void;
@@ -1,35 +0,0 @@
1
- import type { TeamRole, DevPhase } from '../types/team-config';
2
- /**
3
- * A preset member definition. Contains the role and descriptive name
4
- * but not runtime fields (agentId, joinedAt, status, cwd) which are
5
- * assigned at spawn time.
6
- */
7
- export interface PresetMember {
8
- name: string;
9
- role: TeamRole;
10
- agentType: string;
11
- model: string;
12
- }
13
- /**
14
- * A preset configuration that can be used to bootstrap a team.
15
- * Contains the member list and default settings but no runtime state.
16
- */
17
- export interface PresetConfig {
18
- presetName: string;
19
- description: string;
20
- defaultPhase: DevPhase;
21
- members: PresetMember[];
22
- settings: {
23
- maxMembers: number;
24
- autoAssign: boolean;
25
- };
26
- }
27
- /**
28
- * Returns a preset team configuration by name, or null if not found.
29
- * Preset names are case-insensitive.
30
- */
31
- export declare function getTeamPreset(name: string): PresetConfig | null;
32
- /**
33
- * Returns the list of all available preset names.
34
- */
35
- export declare function listPresets(): string[];
@@ -1 +0,0 @@
1
- export declare const globalStopSequence: string;
@@ -1,45 +0,0 @@
1
- import { promptFlashWithFallbacks } from './llm-api/gemini-with-fallbacks';
2
- import { promptRelaceAI } from './llm-api/relace-api';
3
- import type { PromptAiSdkFn } from '@levelcode/common/types/contracts/llm';
4
- import type { Logger } from '@levelcode/common/types/contracts/logger';
5
- import type { ParamsExcluding } from '@levelcode/common/types/function-params';
6
- import type { Message } from '@levelcode/common/types/messages/levelcode-message';
7
- /**
8
- * Rewrites file content using Relace AI with fallback to OpenAI.
9
- *
10
- * @throws {Error} When the request is aborted by user. Check with `isAbortError()`.
11
- */
12
- export declare function fastRewrite(params: {
13
- initialContent: string;
14
- editSnippet: string;
15
- filePath: string;
16
- userMessage: string | undefined;
17
- logger: Logger;
18
- } & ParamsExcluding<typeof promptRelaceAI, 'initialCode'> & ParamsExcluding<typeof rewriteWithOpenAI, 'oldContent'>): Promise<string>;
19
- /**
20
- * Rewrites file content using OpenAI's o3-mini model when Gemini Flash output limit is exceeded.
21
- * Gemini flash can only output 8k tokens, openai models can do at least 16k tokens.
22
- *
23
- * @throws {Error} When the request is aborted by user. Check with `isAbortError()`.
24
- */
25
- export declare function rewriteWithOpenAI(params: {
26
- oldContent: string;
27
- editSnippet: string;
28
- promptAiSdk: PromptAiSdkFn;
29
- } & ParamsExcluding<PromptAiSdkFn, 'messages' | 'model'>): Promise<string>;
30
- /**
31
- * Checks if Claude forgot to add "... existing code ..." placeholders.
32
- *
33
- * This handles a specific case where Claude sketches an update to a single function,
34
- * but forgets to add ... existing code ... above and below the function.
35
- *
36
- * @throws {Error} When the request is aborted by user. Check with `isAbortError()`.
37
- */
38
- export declare const shouldAddFilePlaceholders: (params: {
39
- filePath: string;
40
- oldContent: string;
41
- rewrittenNewContent: string;
42
- messageHistory: Message[];
43
- fullResponse: string;
44
- logger: Logger;
45
- } & ParamsExcluding<typeof promptFlashWithFallbacks, "messages" | "model">) => Promise<boolean>;