@agentteams/cli 0.1.96 → 0.1.98

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 (224) hide show
  1. package/.eslintcache +1 -1
  2. package/README.md +81 -23
  3. package/dist/auth/credentialStore.d.ts +70 -10
  4. package/dist/auth/credentialStore.d.ts.map +1 -1
  5. package/dist/auth/credentialStore.js +207 -20
  6. package/dist/auth/credentialStore.js.map +1 -1
  7. package/dist/auth/fileCredentialStore.d.ts +172 -0
  8. package/dist/auth/fileCredentialStore.d.ts.map +1 -0
  9. package/dist/auth/fileCredentialStore.js +445 -0
  10. package/dist/auth/fileCredentialStore.js.map +1 -0
  11. package/dist/auth/personalTokenClient.d.ts +7 -1
  12. package/dist/auth/personalTokenClient.d.ts.map +1 -1
  13. package/dist/auth/personalTokenClient.js +19 -4
  14. package/dist/auth/personalTokenClient.js.map +1 -1
  15. package/dist/auth/personalTokenStore.d.ts +1 -1
  16. package/dist/auth/personalTokenStore.d.ts.map +1 -1
  17. package/dist/auth/personalTokenStore.js +7 -2
  18. package/dist/auth/personalTokenStore.js.map +1 -1
  19. package/dist/auth/refreshLock.d.ts +5 -2
  20. package/dist/auth/refreshLock.d.ts.map +1 -1
  21. package/dist/auth/refreshLock.js +8 -4
  22. package/dist/auth/refreshLock.js.map +1 -1
  23. package/dist/auth/slotHash.d.ts +15 -0
  24. package/dist/auth/slotHash.d.ts.map +1 -0
  25. package/dist/auth/slotHash.js +18 -0
  26. package/dist/auth/slotHash.js.map +1 -0
  27. package/dist/commands/auth.d.ts +8 -1
  28. package/dist/commands/auth.d.ts.map +1 -1
  29. package/dist/commands/auth.js +41 -7
  30. package/dist/commands/auth.js.map +1 -1
  31. package/dist/commands/coaction.d.ts.map +1 -1
  32. package/dist/commands/coaction.js +6 -21
  33. package/dist/commands/coaction.js.map +1 -1
  34. package/dist/commands/codeReview.d.ts.map +1 -1
  35. package/dist/commands/codeReview.js +1 -2
  36. package/dist/commands/codeReview.js.map +1 -1
  37. package/dist/commands/doctor.js +1 -1
  38. package/dist/commands/doctor.js.map +1 -1
  39. package/dist/commands/document.d.ts +0 -1
  40. package/dist/commands/document.d.ts.map +1 -1
  41. package/dist/commands/document.js +1 -1
  42. package/dist/commands/document.js.map +1 -1
  43. package/dist/commands/init.d.ts +1 -0
  44. package/dist/commands/init.d.ts.map +1 -1
  45. package/dist/commands/init.js +2 -0
  46. package/dist/commands/init.js.map +1 -1
  47. package/dist/commands/plan.d.ts.map +1 -1
  48. package/dist/commands/plan.js +10 -53
  49. package/dist/commands/plan.js.map +1 -1
  50. package/dist/commands/postmortem.d.ts.map +1 -1
  51. package/dist/commands/postmortem.js +1 -5
  52. package/dist/commands/postmortem.js.map +1 -1
  53. package/dist/commands/report.d.ts.map +1 -1
  54. package/dist/commands/report.js +1 -5
  55. package/dist/commands/report.js.map +1 -1
  56. package/dist/commands/task.js +2 -2
  57. package/dist/commands/task.js.map +1 -1
  58. package/dist/index.js +3 -1350
  59. package/dist/index.js.map +1 -1
  60. package/dist/mcp/context.d.ts +1 -1
  61. package/dist/mcp/context.js +1 -1
  62. package/dist/mcp/context.js.map +1 -1
  63. package/dist/mcp-registration/index.js +3 -3
  64. package/dist/mcp-registration/index.js.map +1 -1
  65. package/dist/mcp-registration/serverSpec.d.ts +1 -1
  66. package/dist/program/agentConfig.d.ts +3 -0
  67. package/dist/program/agentConfig.d.ts.map +1 -0
  68. package/dist/program/agentConfig.js +14 -0
  69. package/dist/program/agentConfig.js.map +1 -0
  70. package/dist/program/attachment.d.ts +3 -0
  71. package/dist/program/attachment.d.ts.map +1 -0
  72. package/dist/program/attachment.js +17 -0
  73. package/dist/program/attachment.js.map +1 -0
  74. package/dist/program/auth.d.ts +3 -0
  75. package/dist/program/auth.d.ts.map +1 -0
  76. package/dist/program/auth.js +39 -0
  77. package/dist/program/auth.js.map +1 -0
  78. package/dist/program/changeSet.d.ts +4 -0
  79. package/dist/program/changeSet.d.ts.map +1 -0
  80. package/dist/program/changeSet.js +53 -0
  81. package/dist/program/changeSet.js.map +1 -0
  82. package/dist/program/coaction.d.ts +7 -0
  83. package/dist/program/coaction.d.ts.map +1 -0
  84. package/dist/program/coaction.js +81 -0
  85. package/dist/program/coaction.js.map +1 -0
  86. package/dist/program/codeReview.d.ts +4 -0
  87. package/dist/program/codeReview.d.ts.map +1 -0
  88. package/dist/program/codeReview.js +100 -0
  89. package/dist/program/codeReview.js.map +1 -0
  90. package/dist/program/comment.d.ts +4 -0
  91. package/dist/program/comment.d.ts.map +1 -0
  92. package/dist/program/comment.js +50 -0
  93. package/dist/program/comment.js.map +1 -0
  94. package/dist/program/config.d.ts +3 -0
  95. package/dist/program/config.d.ts.map +1 -0
  96. package/dist/program/config.js +9 -0
  97. package/dist/program/config.js.map +1 -0
  98. package/dist/program/convention.d.ts +4 -0
  99. package/dist/program/convention.d.ts.map +1 -0
  100. package/dist/program/convention.js +37 -0
  101. package/dist/program/convention.js.map +1 -0
  102. package/dist/program/dependency.d.ts +3 -0
  103. package/dist/program/dependency.d.ts.map +1 -0
  104. package/dist/program/dependency.js +15 -0
  105. package/dist/program/dependency.js.map +1 -0
  106. package/dist/program/doctor.d.ts +6 -0
  107. package/dist/program/doctor.d.ts.map +1 -0
  108. package/dist/program/doctor.js +31 -0
  109. package/dist/program/doctor.js.map +1 -0
  110. package/dist/program/document.d.ts +7 -0
  111. package/dist/program/document.d.ts.map +1 -0
  112. package/dist/program/document.js +87 -0
  113. package/dist/program/document.js.map +1 -0
  114. package/dist/program/feedback.d.ts +3 -0
  115. package/dist/program/feedback.d.ts.map +1 -0
  116. package/dist/program/feedback.js +10 -0
  117. package/dist/program/feedback.js.map +1 -0
  118. package/dist/program/index.d.ts +3 -0
  119. package/dist/program/index.d.ts.map +1 -0
  120. package/dist/program/index.js +66 -0
  121. package/dist/program/index.js.map +1 -0
  122. package/dist/program/init.d.ts +6 -0
  123. package/dist/program/init.d.ts.map +1 -0
  124. package/dist/program/init.js +50 -0
  125. package/dist/program/init.js.map +1 -0
  126. package/dist/program/linear.d.ts +3 -0
  127. package/dist/program/linear.d.ts.map +1 -0
  128. package/dist/program/linear.js +25 -0
  129. package/dist/program/linear.js.map +1 -0
  130. package/dist/program/mcp.d.ts +6 -0
  131. package/dist/program/mcp.d.ts.map +1 -0
  132. package/dist/program/mcp.js +95 -0
  133. package/dist/program/mcp.js.map +1 -0
  134. package/dist/program/options/completionReport.d.ts +5 -0
  135. package/dist/program/options/completionReport.d.ts.map +1 -0
  136. package/dist/program/options/completionReport.js +19 -0
  137. package/dist/program/options/completionReport.js.map +1 -0
  138. package/dist/program/options/connection.d.ts +3 -0
  139. package/dist/program/options/connection.d.ts.map +1 -0
  140. package/dist/program/options/connection.js +8 -0
  141. package/dist/program/options/connection.js.map +1 -0
  142. package/dist/program/options/output.d.ts +3 -0
  143. package/dist/program/options/output.d.ts.map +1 -0
  144. package/dist/program/options/output.js +6 -0
  145. package/dist/program/options/output.js.map +1 -0
  146. package/dist/program/options/pagination.d.ts +3 -0
  147. package/dist/program/options/pagination.d.ts.map +1 -0
  148. package/dist/program/options/pagination.js +6 -0
  149. package/dist/program/options/pagination.js.map +1 -0
  150. package/dist/program/options/resource.d.ts +6 -0
  151. package/dist/program/options/resource.d.ts.map +1 -0
  152. package/dist/program/options/resource.js +29 -0
  153. package/dist/program/options/resource.js.map +1 -0
  154. package/dist/program/plan.d.ts +7 -0
  155. package/dist/program/plan.d.ts.map +1 -0
  156. package/dist/program/plan.js +137 -0
  157. package/dist/program/plan.js.map +1 -0
  158. package/dist/program/postmortem.d.ts +4 -0
  159. package/dist/program/postmortem.d.ts.map +1 -0
  160. package/dist/program/postmortem.js +27 -0
  161. package/dist/program/postmortem.js.map +1 -0
  162. package/dist/program/report.d.ts +4 -0
  163. package/dist/program/report.d.ts.map +1 -0
  164. package/dist/program/report.js +38 -0
  165. package/dist/program/report.js.map +1 -0
  166. package/dist/program/resolve.d.ts +6 -0
  167. package/dist/program/resolve.d.ts.map +1 -0
  168. package/dist/program/resolve.js +30 -0
  169. package/dist/program/resolve.js.map +1 -0
  170. package/dist/program/search.d.ts +6 -0
  171. package/dist/program/search.d.ts.map +1 -0
  172. package/dist/program/search.js +43 -0
  173. package/dist/program/search.js.map +1 -0
  174. package/dist/program/shared.d.ts +32 -0
  175. package/dist/program/shared.d.ts.map +1 -0
  176. package/dist/program/shared.js +96 -0
  177. package/dist/program/shared.js.map +1 -0
  178. package/dist/program/sync.d.ts +6 -0
  179. package/dist/program/sync.d.ts.map +1 -0
  180. package/dist/program/sync.js +35 -0
  181. package/dist/program/sync.js.map +1 -0
  182. package/dist/program/task.d.ts +3 -0
  183. package/dist/program/task.d.ts.map +1 -0
  184. package/dist/program/task.js +13 -0
  185. package/dist/program/task.js.map +1 -0
  186. package/dist/program/worktree.d.ts +3 -0
  187. package/dist/program/worktree.d.ts.map +1 -0
  188. package/dist/program/worktree.js +30 -0
  189. package/dist/program/worktree.js.map +1 -0
  190. package/dist/types/index.d.ts +3 -1
  191. package/dist/types/index.d.ts.map +1 -1
  192. package/dist/utils/apiContext.d.ts.map +1 -1
  193. package/dist/utils/apiContext.js +6 -1
  194. package/dist/utils/apiContext.js.map +1 -1
  195. package/dist/utils/apiKeyInput.d.ts +1 -3
  196. package/dist/utils/apiKeyInput.d.ts.map +1 -1
  197. package/dist/utils/apiKeyInput.js +1 -9
  198. package/dist/utils/apiKeyInput.js.map +1 -1
  199. package/dist/utils/apiOrigin.d.ts +43 -0
  200. package/dist/utils/apiOrigin.d.ts.map +1 -0
  201. package/dist/utils/apiOrigin.js +78 -0
  202. package/dist/utils/apiOrigin.js.map +1 -0
  203. package/dist/utils/authFormat.d.ts.map +1 -1
  204. package/dist/utils/authFormat.js +32 -11
  205. package/dist/utils/authFormat.js.map +1 -1
  206. package/dist/utils/config.d.ts +10 -4
  207. package/dist/utils/config.d.ts.map +1 -1
  208. package/dist/utils/config.js +13 -5
  209. package/dist/utils/config.js.map +1 -1
  210. package/dist/utils/httpClient.d.ts.map +1 -1
  211. package/dist/utils/httpClient.js +50 -0
  212. package/dist/utils/httpClient.js.map +1 -1
  213. package/dist/utils/initOutput.d.ts.map +1 -1
  214. package/dist/utils/initOutput.js +14 -3
  215. package/dist/utils/initOutput.js.map +1 -1
  216. package/dist/utils/outputPolicy.d.ts +6 -7
  217. package/dist/utils/outputPolicy.d.ts.map +1 -1
  218. package/dist/utils/outputPolicy.js +0 -5
  219. package/dist/utils/outputPolicy.js.map +1 -1
  220. package/dist/utils/projectRootHash.d.ts +30 -0
  221. package/dist/utils/projectRootHash.d.ts.map +1 -0
  222. package/dist/utils/projectRootHash.js +43 -0
  223. package/dist/utils/projectRootHash.js.map +1 -0
  224. package/package.json +1 -1
@@ -0,0 +1,38 @@
1
+ import { CONVENTION_HINT } from './shared.js';
2
+ import { addCompletionReportMetricsOptions, addCompletionReportMetricValueOptions, } from './options/completionReport.js';
3
+ import { addPaginationOptions } from './options/pagination.js';
4
+ import { addJsonResourceLeaf } from './options/resource.js';
5
+ /** 액션 인벤토리: list/get/create/update/dismiss-review/delete/download. */
6
+ export function registerReportCommand(program) {
7
+ const root = program.command('report').description('Manage completion reports').addHelpText('after', CONVENTION_HINT);
8
+ const addLeaf = (action, description, configure = (command) => command) => addJsonResourceLeaf(root, 'report', action, description, configure);
9
+ addLeaf('list', 'List completion reports', (command) => addPaginationOptions(command)
10
+ .option('--plan-id <id>', 'Plan ID')
11
+ .option('--status <status>', 'Report status')
12
+ .option('--search <text>', 'Title keyword search'));
13
+ addLeaf('get', 'Get a completion report', (command) => command.option('--id <id>', 'Report ID'));
14
+ addLeaf('create', 'Create a completion report', (command) => addCompletionReportMetricsOptions(command)
15
+ .option('--plan-id <id>', 'Plan ID')
16
+ .option('--title <title>', 'Report title')
17
+ .option('--file <path>', 'Read report content from a local file')
18
+ .option('--keep-temp', 'Keep the uploaded temporary file', false)
19
+ .option('--status <status>', 'Report status (COMPLETED, FAILED, PARTIAL)')
20
+ .option('--quality-score <n>', 'Quality score 0-100')
21
+ .option('--review-recommendation <value>', 'Code review recommendation: REQUIRED or NOT_NEEDED')
22
+ .option('--review-reason <text>', 'One-line reason for the review recommendation')
23
+ .option('--repository-remote-url <url>', 'Repository remote origin URL (defaults to git origin)')
24
+ .option('--runner-type <type>', 'Runner type snapshot')
25
+ .option('--model <model>', 'Model ID snapshot'));
26
+ addLeaf('update', 'Update a completion report', (command) => addCompletionReportMetricValueOptions(command)
27
+ .option('--id <id>', 'Report ID')
28
+ .option('--title <title>', 'Report title')
29
+ .option('--file <path>', 'Read report content from a local file')
30
+ .option('--status <status>', 'Report status (COMPLETED, FAILED, PARTIAL)')
31
+ .option('--quality-score <n>', 'Quality score 0-100')
32
+ .option('--review-recommendation <value>', 'Compatibility notice only')
33
+ .option('--review-reason <text>', 'Compatibility notice only'));
34
+ addLeaf('dismiss-review', 'Dismiss a report review recommendation', (command) => command.option('--id <id>', 'Report ID'));
35
+ addLeaf('delete', 'Delete a completion report', (command) => command.option('--id <id>', 'Report ID'));
36
+ addLeaf('download', 'Download a completion report', (command) => command.option('--id <id>', 'Report ID'));
37
+ }
38
+ //# sourceMappingURL=report.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report.js","sourceRoot":"","sources":["../../src/program/report.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,eAAe,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EACL,iCAAiC,EACjC,qCAAqC,GACtC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,sEAAsE;AACtE,MAAM,UAAU,qBAAqB,CAAC,OAAgB;IACpD,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,2BAA2B,CAAC,CAAC,WAAW,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;IACtH,MAAM,OAAO,GAAG,CACd,MAAc,EACd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AO,EAAE,EAAE,CAC1D,qCAAqC,CAAC,OAAO,CAAC;SAC3C,MAAM,CAAC,WAAW,EAAE,WAAW,CAAC;SAChC,MAAM,CAAC,iBAAiB,EAAE,cAAc,CAAC;SACzC,MAAM,CAAC,eAAe,EAAE,uCAAuC,CAAC;SAChE,MAAM,CAAC,mBAAmB,EAAE,4CAA4C,CAAC;SACzE,MAAM,CAAC,qBAAqB,EAAE,qBAAqB,CAAC;SACpD,MAAM,CAAC,iCAAiC,EAAE,2BAA2B,CAAC;SACtE,MAAM,CAAC,wBAAwB,EAAE,2BAA2B,CAAC,CACjE,CAAC;IACF,OAAO,CAAC,gBAAgB,EAAE,wCAAwC,EAAE,CAAC,OAAO,EAAE,EAAE,CAC9E,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,WAAW,CAAC,CACzC,CAAC;IACF,OAAO,CAAC,QAAQ,EAAE,4BAA4B,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;IACvG,OAAO,CAAC,UAAU,EAAE,8BAA8B,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;AAC7G,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { Command } from './shared.js';
2
+ /**
3
+ * 액션 인벤토리: 액션: get. 실사용 옵션: ref. 별칭/도움말 불일치: 없음.
4
+ */
5
+ export declare function registerResolveCommand(program: Command): void;
6
+ //# sourceMappingURL=resolve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/program/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAoE,MAAM,aAAa,CAAC;AAExG;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA8B7D"}
@@ -0,0 +1,30 @@
1
+ import { CONVENTION_HINT, executeCommand, handleError, printCommandResult } from './shared.js';
2
+ /**
3
+ * 액션 인벤토리: 액션: get. 실사용 옵션: ref. 별칭/도움말 불일치: 없음.
4
+ */
5
+ export function registerResolveCommand(program) {
6
+ program
7
+ .command('resolve')
8
+ .description('Resolve an entity reference token to the right entity and fetch it')
9
+ .argument('<ref>', 'Reference token, e.g. "plan:agentteams_pln_<uuid>", "agentteams_doc_<uuid>", or a whole [label](type:id) link')
10
+ .option('--output-file <path>', 'Write full output to a file (stdout prints a short summary)')
11
+ .option('--verbose', 'Print full raw output to stdout; with --output-file, also echo it', false)
12
+ .addHelpText('after', `\nReturns a "kind" that tells you what to do next:\n file read "filePath" (the entity body was downloaded)\n record use "record" (structured payload, already inline)\n localFile read "filePath" (the reference carried a local path)\n external open "url" or run "suggestedCommand" (gh/glab)\n${CONVENTION_HINT}`)
13
+ .action(async (ref, options) => {
14
+ try {
15
+ const result = await executeCommand('resolve', 'get', { ref });
16
+ printCommandResult({
17
+ result,
18
+ outputFile: options.outputFile,
19
+ verbose: options.verbose,
20
+ resource: 'resolve',
21
+ action: 'get',
22
+ });
23
+ }
24
+ catch (error) {
25
+ console.error(handleError(error));
26
+ process.exit(1);
27
+ }
28
+ });
29
+ }
30
+ //# sourceMappingURL=resolve.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../src/program/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,eAAe,EAAE,cAAc,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAExG;;GAEG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAAgB;IACrD,OAAO;SACJ,OAAO,CAAC,SAAS,CAAC;SAClB,WAAW,CAAC,oEAAoE,CAAC;SACjF,QAAQ,CACP,OAAO,EACP,+GAA+G,CAChH;SACA,MAAM,CAAC,sBAAsB,EAAE,6DAA6D,CAAC;SAC7F,MAAM,CAAC,WAAW,EAAE,mEAAmE,EAAE,KAAK,CAAC;SAC/F,WAAW,CACV,OAAO,EACP,sTAAsT,eAAe,EAAE,CACxU;SACA,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE;QAC7B,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;YAE/D,kBAAkB,CAAC;gBACjB,MAAM;gBACN,UAAU,EAAE,OAAO,CAAC,UAAU;gBAC9B,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,QAAQ,EAAE,SAAS;gBACnB,MAAM,EAAE,KAAK;aACd,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;YAClC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { Command } from './shared.js';
2
+ /**
3
+ * 액션 인벤토리: 단일 액션형 커맨드. 실사용 옵션: query,types,limit,maxTokens 및 접속 옵션. limit은 유일한 페이징 옵션이며 별칭이 아님.
4
+ */
5
+ export declare function registerSearchCommand(program: Command): void;
6
+ //# sourceMappingURL=search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/program/search.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAMR,MAAM,aAAa,CAAC;AAErB;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA0C5D"}
@@ -0,0 +1,43 @@
1
+ import { CONVENTION_HINT, createApiKeyFileOption, executeCommand, handleError, printCommandResult, } from './shared.js';
2
+ /**
3
+ * 액션 인벤토리: 단일 액션형 커맨드. 실사용 옵션: query,types,limit,maxTokens 및 접속 옵션. limit은 유일한 페이징 옵션이며 별칭이 아님.
4
+ */
5
+ export function registerSearchCommand(program) {
6
+ program
7
+ .command('search')
8
+ .description('Search across all entity types (plans, co-actions, reports, post-mortems, conventions, code reviews, documents)')
9
+ .option('--query <text>', 'Search query (required)')
10
+ .option('--types <types>', 'Comma-separated entity types to filter (PLAN, CO_ACTION, COMPLETION_REPORT, POST_MORTEM, CONVENTION, CODE_REVIEW, DOCUMENT)')
11
+ .option('--limit <n>', 'Max results (1-100, default: 20)')
12
+ .option('--max-tokens <n>', 'Token budget for response')
13
+ .option('--api-url <url>', 'Override API URL (optional)')
14
+ .addOption(createApiKeyFileOption())
15
+ .option('--project-id <id>', 'Override project ID (optional)')
16
+ .option('--output-file <path>', 'Write full output to a file (stdout prints a short summary)')
17
+ .option('--verbose', 'Print full raw output to stdout; with --output-file, also echo it', false)
18
+ .addHelpText('after', CONVENTION_HINT)
19
+ .action(async (options) => {
20
+ try {
21
+ const result = await executeCommand('search', '', {
22
+ query: options.query,
23
+ types: options.types,
24
+ limit: options.limit,
25
+ maxTokens: options.maxTokens,
26
+ apiUrl: options.apiUrl,
27
+ apiKey: options.apiKey,
28
+ projectId: options.projectId,
29
+ });
30
+ printCommandResult({
31
+ result,
32
+ outputFile: options.outputFile,
33
+ verbose: options.verbose,
34
+ resource: 'search',
35
+ });
36
+ }
37
+ catch (error) {
38
+ console.error(handleError(error));
39
+ process.exit(1);
40
+ }
41
+ });
42
+ }
43
+ //# sourceMappingURL=search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/program/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EACf,sBAAsB,EACtB,cAAc,EACd,WAAW,EACX,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAErB;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAAgB;IACpD,OAAO;SACJ,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CACV,iHAAiH,CAClH;SACA,MAAM,CAAC,gBAA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1
+ import { Command, Option } from 'commander';
2
+ import { executeCommand } from '../commands/index.js';
3
+ import type { DoctorResult } from '../commands/doctor.js';
4
+ import { formatAuthResultText } from '../utils/authFormat.js';
5
+ import { printDoctorResult, resolveDoctorExitCode } from '../utils/doctorOutput.js';
6
+ import { handleError } from '../utils/errors.js';
7
+ import { formatOutput } from '../utils/formatter.js';
8
+ import { printInitResult } from '../utils/initOutput.js';
9
+ import { executeValidatedInteractiveCommand, normalizeInteractiveFormat } from '../utils/interactiveCommand.js';
10
+ import { type OutputFormat } from '../utils/outputPolicy.js';
11
+ import { MCP_CLIENT_IDS } from '../mcp-registration/types.js';
12
+ export { Command, Option, executeCommand, executeValidatedInteractiveCommand, formatAuthResultText, formatOutput, handleError, MCP_CLIENT_IDS, normalizeInteractiveFormat, printDoctorResult, printInitResult, resolveDoctorExitCode, };
13
+ export type { DoctorResult, OutputFormat };
14
+ export declare function createApiKeyFileOption(): Option;
15
+ export declare function registerApiKeyHook(program: Command): void;
16
+ export declare function removedContractHint(text: string): string | undefined;
17
+ export declare function normalizeFormat(format: unknown): OutputFormat;
18
+ /**
19
+ * 출력 정책: 기본은 전체 결과, `--output-file`이 있으면 저장 경로 + 요약,
20
+ * 거기에 `--verbose`까지 있으면 요약 뒤에 전체 결과를 덧붙입니다.
21
+ */
22
+ export declare function printCommandResult(params: {
23
+ result: unknown;
24
+ outputFile?: string;
25
+ verbose?: boolean;
26
+ resource?: string;
27
+ action?: string;
28
+ }): void;
29
+ export declare const DEVICE_AUTH_OPTION_DESCRIPTION = "authorize with a short code on another device instead of a local browser callback (for SSH, containers, and other headless shells)";
30
+ export declare const DEVICE_AUTH_SET_DEFAULT_DESCRIPTION = "with --device-auth: remember device-code login as this machine's default in ~/.agentteams/config.json";
31
+ export declare const CONVENTION_HINT = "\nFor workflow rules and reporting guidelines, see: .agentteams/convention.md";
32
+ //# sourceMappingURL=shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","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,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,IAAI,CAcP;AAED,eAAO,MAAM,8BAA8B,uIAC2F,CAAC;AACvI,eAAO,MAAM,mCAAmC,0GACyD,CAAC;AAC1G,eAAO,MAAM,eAAe,kFAAkF,CAAC"}
@@ -0,0 +1,96 @@
1
+ import { mkdirSync, writeFileSync } from 'node:fs';
2
+ import { dirname, resolve } from 'node:path';
3
+ import { Command, Option } from 'commander';
4
+ import { executeCommand } from '../commands/index.js';
5
+ import { formatAuthResultText } from '../utils/authFormat.js';
6
+ import { resolveApiKeyInput } from '../utils/apiKeyInput.js';
7
+ import { printDoctorResult, resolveDoctorExitCode } from '../utils/doctorOutput.js';
8
+ import { handleError } from '../utils/errors.js';
9
+ import { formatOutput } from '../utils/formatter.js';
10
+ import { printInitResult } from '../utils/initOutput.js';
11
+ import { executeValidatedInteractiveCommand, normalizeInteractiveFormat } from '../utils/interactiveCommand.js';
12
+ import { createSummaryLines } from '../utils/outputPolicy.js';
13
+ import { MCP_CLIENT_IDS } from '../mcp-registration/types.js';
14
+ export { Command, Option, executeCommand, executeValidatedInteractiveCommand, formatAuthResultText, formatOutput, handleError, MCP_CLIENT_IDS, normalizeInteractiveFormat, printDoctorResult, printInitResult, resolveDoctorExitCode, };
15
+ export function createApiKeyFileOption() {
16
+ return new Option('--api-key-file <path>', 'Read the API key from a file, or use "-" to read stdin.');
17
+ }
18
+ export function registerApiKeyHook(program) {
19
+ program.hook('preAction', (_thisCommand, actionCommand) => {
20
+ try {
21
+ const commands = [];
22
+ for (let command = actionCommand; command; command = command.parent) {
23
+ commands.push(command);
24
+ }
25
+ const apiKeyFileCommand = commands.find((command) => command.opts().apiKeyFile !== undefined);
26
+ if (!apiKeyFileCommand)
27
+ return;
28
+ const apiKeyFile = apiKeyFileCommand?.opts().apiKeyFile;
29
+ const resolvedApiKey = resolveApiKeyInput({ apiKeyFile });
30
+ apiKeyFileCommand.setOptionValue('apiKey', resolvedApiKey);
31
+ }
32
+ catch (error) {
33
+ console.error(handleError(error));
34
+ process.exit(1);
35
+ }
36
+ });
37
+ }
38
+ /**
39
+ * 제거된 공개 인자는 commander가 `unknown option '--format'`으로만 끝냅니다.
40
+ * 각 프로젝트에 이미 배포된 `.agentteams/convention.md` 사본이나 기존 CI 스크립트는
41
+ * 갱신 경로 없이 그대로 깨지므로, 오류 뒤에 대체 수단을 한 줄 덧붙입니다.
42
+ */
43
+ const REMOVED_OPTION_HINTS = {
44
+ '--format': '--format only exists on init, auth, sync, and doctor. Every other command already prints JSON; use --verbose for the full payload when --output-file is set.',
45
+ '--api-key': '--api-key was removed. Use --api-key-file <path> or set the AGENTTEAMS_API_KEY environment variable.',
46
+ '--team-id': '--team-id was removed. Set the AGENTTEAMS_TEAM_ID environment variable or the teamId field in your CLI config.',
47
+ '--limit': '--limit was removed from list actions. Use --page-size.',
48
+ };
49
+ const REMOVED_COMMAND_HINTS = {
50
+ show: "The 'show' alias was removed. Use 'get'.",
51
+ };
52
+ export function removedContractHint(text) {
53
+ const option = /unknown option '(--[\w-]+)'/.exec(text)?.[1];
54
+ if (option && REMOVED_OPTION_HINTS[option])
55
+ return REMOVED_OPTION_HINTS[option];
56
+ const command = /unknown command '([\w-]+)'/.exec(text)?.[1];
57
+ if (command && REMOVED_COMMAND_HINTS[command])
58
+ return REMOVED_COMMAND_HINTS[command];
59
+ return undefined;
60
+ }
61
+ export function normalizeFormat(format) {
62
+ if (format === undefined || format === null || format === '')
63
+ return 'json';
64
+ if (format === 'json')
65
+ return 'json';
66
+ throw new Error(`Unsupported output format: ${String(format)}. Only json is supported.`);
67
+ }
68
+ function writeOutputFile(outputFile, content) {
69
+ const resolvedPath = resolve(outputFile);
70
+ mkdirSync(dirname(resolvedPath), { recursive: true });
71
+ writeFileSync(resolvedPath, content, 'utf-8');
72
+ const bytes = Buffer.byteLength(content, 'utf-8');
73
+ return { resolvedPath, bytes };
74
+ }
75
+ /**
76
+ * 출력 정책: 기본은 전체 결과, `--output-file`이 있으면 저장 경로 + 요약,
77
+ * 거기에 `--verbose`까지 있으면 요약 뒤에 전체 결과를 덧붙입니다.
78
+ */
79
+ export function printCommandResult(params) {
80
+ const outputText = typeof params.result === 'string' ? params.result : formatOutput(params.result);
81
+ if (typeof params.outputFile === 'string' && params.outputFile.trim().length > 0) {
82
+ const { resolvedPath, bytes } = writeOutputFile(params.outputFile, outputText);
83
+ console.log(`Saved output to ${resolvedPath} (${bytes} bytes).`);
84
+ for (const line of createSummaryLines(params.result, { resource: params.resource, action: params.action })) {
85
+ console.log(line);
86
+ }
87
+ if (params.verbose)
88
+ console.log(outputText);
89
+ return;
90
+ }
91
+ console.log(outputText);
92
+ }
93
+ export const DEVICE_AUTH_OPTION_DESCRIPTION = 'authorize with a short code on another device instead of a local browser callback (for SSH, containers, and other headless shells)';
94
+ export const DEVICE_AUTH_SET_DEFAULT_DESCRIPTION = "with --device-auth: remember device-code login as this machine's default in ~/.agentteams/config.json";
95
+ export const CONVENTION_HINT = '\nFor workflow rules and reporting guidelines, see: .agentteams/convention.md';
96
+ //# sourceMappingURL=shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/program/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,E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AG,CAAC,UAAU,CAAC,CAAC;QAC5C,OAAO;IACT,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AAC1B,CAAC;AAED,MAAM,CAAC,MAAM,8BAA8B,GACzC,oIAAoI,CAAC;AACvI,MAAM,CAAC,MAAM,mCAAmC,GAC9C,uGAAuG,CAAC;AAC1G,MAAM,CAAC,MAAM,eAAe,GAAG,+EAA+E,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { Command } from './shared.js';
2
+ /**
3
+ * 액션 인벤토리: 액션: download. 실사용 옵션: cwd. 별칭/도움말 불일치: 없음.
4
+ */
5
+ export declare function registerSyncCommand(program: Command): void;
6
+ //# sourceMappingURL=sync.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/program/sync.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAOR,MAAM,aAAa,CAAC;AAErB;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA8B1D"}
@@ -0,0 +1,35 @@
1
+ import { CONVENTION_HINT, executeCommand, formatOutput, handleError, normalizeInteractiveFormat, printCommandResult, } from './shared.js';
2
+ /**
3
+ * 액션 인벤토리: 액션: download. 실사용 옵션: cwd. 별칭/도움말 불일치: 없음.
4
+ */
5
+ export function registerSyncCommand(program) {
6
+ program
7
+ .command('sync')
8
+ .description('Sync local convention files from API')
9
+ .option('--format <format>', 'Output format (json; defaults to human-readable view)')
10
+ .option('--output-file <path>', 'Write full output to a file (stdout prints a short summary)')
11
+ .option('--verbose', 'Print full raw output to stdout; with --output-file, also echo it', false)
12
+ .addHelpText('after', CONVENTION_HINT)
13
+ .action(async (options) => {
14
+ try {
15
+ const result = await executeCommand('sync', 'download', {
16
+ cwd: process.cwd(),
17
+ });
18
+ const format = normalizeInteractiveFormat(options.format);
19
+ if (format === 'human' && !options.outputFile) {
20
+ console.log(typeof result === 'string' ? result : formatOutput(result));
21
+ return;
22
+ }
23
+ printCommandResult({
24
+ result: format === 'json' && typeof result === 'string' ? { message: result } : result,
25
+ outputFile: options.outputFile,
26
+ verbose: options.verbose,
27
+ });
28
+ }
29
+ catch (error) {
30
+ console.error(handleError(error));
31
+ process.exit(1);
32
+ }
33
+ });
34
+ }
35
+ //# sourceMappingURL=sync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync.js","sourceRoot":"","sources":["../../src/program/sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EACf,cAAc,EACd,YAAY,EACZ,WAAW,EACX,0BAA0B,EAC1B,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAErB;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAgB;IAClD,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,sCAAsC,CAAC;SACnD,MAAM,CAAC,mBAAmB,EAAE,uDAAuD,CAAC;SACpF,MAAM,CAAC,sBAAsB,EAAE,6DAA6D,CAAC;SAC7F,MAAM,CAAC,WAAW,EAAE,mEAAmE,EAAE,KAAK,CAAC;SAC/F,WAAW,CAAC,OAAO,EAAE,eAAe,CAAC;SACrC,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QACxB,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE;gBACtD,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;aACnB,CAAC,CAAC;YACH,MAAM,MAAM,GAAG,0BAA0B,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YAE1D,IAAI,MAAM,KAAK,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;gBAC9C,OAAO,CAAC,GAAG,CAAC,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;gBACxE,OAAO;YACT,CAAC;YAED,kBAAkB,CAAC;gBACjB,MAAM,EAAE,MAAM,KAAK,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM;gBACtF,UAAU,EAAE,OAAO,CAAC,UAAU;gBAC9B,OAAO,EAAE,OAAO,CAAC,OAAO;aACzB,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;YAClC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from './shared.js';
2
+ export declare function registerTaskCommand(program: Command): void;
3
+ //# sourceMappingURL=task.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task.d.ts","sourceRoot":"","sources":["../../src/program/task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAmB,MAAM,aAAa,CAAC;AAGvD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAgB1D"}
@@ -0,0 +1,13 @@
1
+ import { CONVENTION_HINT } from './shared.js';
2
+ import { addJsonResourceLeaf } from './options/resource.js';
3
+ export function registerTaskCommand(program) {
4
+ const root = program.command('task').description('Manage plan tasks').addHelpText('after', CONVENTION_HINT);
5
+ const addLeaf = (action, description, configure) => addJsonResourceLeaf(root, 'task', action, description, configure, { connection: false });
6
+ addLeaf('get', 'Get a plan task', (command) => command.option('--plan-id <id>', 'Plan ID (optional for bare task focus)').option('--task-id <id>', 'Plan task ID'));
7
+ addLeaf('start', 'Start a plan task', (command) => command.option('--plan-id <id>', 'Plan ID').option('--task-id <id>', 'Plan task ID'));
8
+ addLeaf('finish', 'Finish a plan task', (command) => command
9
+ .option('--plan-id <id>', 'Plan ID')
10
+ .option('--task-id <id>', 'Plan task ID')
11
+ .option('--status <status>', 'Task finish status: DONE, BLOCKED, or SKIPPED'));
12
+ }
13
+ //# sourceMappingURL=task.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task.js","sourceRoot":"","sources":["../../src/program/task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,eAAe,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,UAAU,mBAAmB,CAAC,OAAgB;IAClD,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC,WAAW,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;IAC5G,MAAM,OAAO,GAAG,CAAC,MAAc,EAAE,WAAmB,EAAE,SAAwC,EAAE,EAAE,CAChG,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;IAC3F,OAAO,CAAC,KAAK,EAAE,iBAAiB,EAAE,CAAC,OAAO,EAAE,EAAE,CAC5C,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,wCAAwC,CAAC,CAAC,MAAM,CAAC,gBAAgB,EAAE,cAAc,CAAC,CACpH,CAAC;IACF,OAAO,CAAC,OAAO,EAAE,mBAAmB,EAAE,CAAC,OAAO,EAAE,EAAE,CAChD,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,gBAAgB,EAAE,cAAc,CAAC,CACrF,CAAC;IACF,OAAO,CAAC,QAAQ,EAAE,oBAAoB,EAAE,CAAC,OAAO,EAAE,EAAE,CAClD,OAAO;SACJ,MAAM,CAAC,gBAAgB,EAAE,SAAS,CAAC;SACnC,MAAM,CAAC,gBAAgB,EAAE,cAAc,CAAC;SACxC,MAAM,CAAC,mBAAmB,EAAE,+CAA+C,CAAC,CAChF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from './shared.js';
2
+ export declare function registerWorktreeCommand(program: Command): void;
3
+ //# sourceMappingURL=worktree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worktree.d.ts","sourceRoot":"","sources":["../../src/program/worktree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAmD,MAAM,aAAa,CAAC;AAEvF,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAyB9D"}
@@ -0,0 +1,30 @@
1
+ import { executeCommand, handleError, printCommandResult } from './shared.js';
2
+ export function registerWorktreeCommand(program) {
3
+ const root = program.command('worktree').description('Report Orca worktree lifecycle events');
4
+ const addLeaf = (action, description) => {
5
+ const command = root
6
+ .command(action)
7
+ .description(description)
8
+ .option('--repository-id <id>', 'AgentTeams repository ID (optional when remote origin matches)')
9
+ .option('--local-key <key>', 'Opaque worktree identity')
10
+ .option('--event-id <id>', 'Stable event ID for retries')
11
+ .option('--occurred-at <timestamp>', 'Event timestamp in ISO 8601 format')
12
+ .option('--quiet', 'Do not print a successful result', false);
13
+ if (action === 'notify-deleted')
14
+ command.option('--after-removal', 'Send only after the worktree path disappears', false);
15
+ command.action(async (options) => {
16
+ try {
17
+ const result = await executeCommand('worktree', action, { ...options, cwd: process.cwd() });
18
+ if (!options.quiet)
19
+ printCommandResult({ result, resource: 'worktree', action });
20
+ }
21
+ catch (error) {
22
+ console.error(handleError(error));
23
+ process.exit(1);
24
+ }
25
+ });
26
+ };
27
+ addLeaf('notify-created', 'Report a created worktree');
28
+ addLeaf('notify-deleted', 'Report a deleted worktree');
29
+ }
30
+ //# sourceMappingURL=worktree.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worktree.js","sourceRoot":"","sources":["../../src/program/worktree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,cAAc,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAA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,OAAO,CAAC,gBAAgB,EAAE,2BAA2B,CAAC,CAAC;IACvD,OAAO,CAAC,gBAAgB,EAAE,2BAA2B,CAAC,CAAC;AACzD,CAAC"}
@@ -10,7 +10,9 @@
10
10
  * Which credential family this project is configured to authenticate with.
11
11
  *
12
12
  * `personal-token` is the default: project config stays secret-free while a
13
- * rotating refresh token lives in the OS credential store. `api-key` is the
13
+ * rotating refresh token lives outside the repository, in the OS credential
14
+ * store or in a permission-protected file when that store is unavailable.
15
+ * `api-key` is the
14
16
  * explicit compatibility path for existing automation and legacy projects.
15
17
  */
16
18
  export type AuthMode = 'api-key' | 'personal-token';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH;;;GAGG;AACH;;;;;;GAMG;AACH,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,gBAAgB,CAAC;AAEpD,MAAM,WAAW,MAAM;IACrB,8BAA8B;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,iCAAiC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,mDAAmD;IACnD,MAAM,EAAE,MAAM,CAAC;IACf,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,kFAAkF;IAClF,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAMD;;;GAGG;AACH,MAAM,WAAW,IAAI;IACnB,wBAAwB;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,2DAA2D;IAC3D,MAAM,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,qDAAqD;IACrD,QAAQ,EAAE,MAAM,CAAC;IACjB,iBAAiB,CAAC,EAAE,MA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;IACjC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,uCAAuC;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,+CAA+C;IAC/C,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAMD;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"apiContext.d.ts","sourceRoot":"","sources":["../../src/utils/apiContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAIhD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAStF;AAKD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAEvE;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,CAOrG"}
1
+ {"version":3,"file":"apiContext.d.ts","sourceRoot":"","sources":["../../src/utils/apiContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAKhD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAStF;AAKD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAEvE;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,CAWrG"}
@@ -1,4 +1,5 @@
1
- const CONFIG_OVERRIDE_KEYS = ['apiKey', 'apiUrl', 'teamId', 'projectId'];
1
+ import { registerApiOrigin } from './apiOrigin.js';
2
+ const CONFIG_OVERRIDE_KEYS = ['apiKey', 'apiUrl', 'projectId'];
2
3
  /**
3
4
  * Collect config overrides passed as CLI options.
4
5
  *
@@ -30,6 +31,10 @@ export function buildAuthHeaders(apiKey) {
30
31
  }
31
32
  export function resolveApiContext(config) {
32
33
  const apiUrl = config.apiUrl.endsWith('/') ? config.apiUrl.slice(0, -1) : config.apiUrl;
34
+ // This is where the CLI settles on "the API" for this invocation — env, config file, or an
35
+ // --api-url override alike. The HTTP layer scopes session identity headers to what lands here,
36
+ // so a custom deployment keeps the tool axis without leaking it to presigned upload hosts.
37
+ registerApiOrigin(apiUrl);
33
38
  const headers = {
34
39
  ...buildAuthHeaders(config.apiKey),
35
40
  'Content-Type': 'application/json',
@@ -1 +1 @@
1
- {"version":3,"file":"apiContext.js","sourceRoot":"","sources":["../../src/utils/apiContext.ts"],"names":[],"mappings":"AAEA,MAAM,oBAAoB,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,CAAU,CAAC;AAElF;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAgC;IACnE,MAAM,SAAS,GAA2B,EAAE,CAAC;IAC7C,KAAK,MAAM,GAAG,IAAI,oBAAoB,EAAE,CAAC;QACvC,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAC3B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAClD,SAAS,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACzB,CAAC;IACH,CAAC;IACD,OAAO,SAAS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CAAC,GAAG,KAAK,CAAC;QACzB,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,gFAAgF;AAChF,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAEpC;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAc;IAC7C,OAAO,MAAM,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,UAAU,MAAM,EAAE,EAAE,CAAC;AACnH,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,MAAc;IAC9C,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;IACxF,2FAA2F;IAC3F,+FAA+F;IAC/F,2FAA2F;IAC3F,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC1B,MAAM,OAAO,GAAG;QACd,GAAG,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC;QAClC,cAAc,EAAE,kBAAkB;KACnC,CAAC;IACF,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AAC7B,CAAC"}
@@ -1,5 +1,4 @@
1
1
  export interface ApiKeyInputOptions {
2
- apiKey?: string;
3
2
  apiKeyFile?: string;
4
3
  }
5
4
  export interface ApiKeyInputDependencies {
@@ -9,8 +8,7 @@ export interface ApiKeyInputDependencies {
9
8
  }
10
9
  /**
11
10
  * Resolve explicit credential input without ever writing the credential to
12
- * output. The legacy argv path remains compatible, but every use explains the
13
- * safer environment, file and stdin alternatives on stderr.
11
+ * output.
14
12
  */
15
13
  export declare function resolveApiKeyInput(options: ApiKeyInputOptions, dependencies?: ApiKeyInputDependencies): string | undefined;
16
14
  //# sourceMappingURL=apiKeyInput.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"apiKeyInput.d.ts","sourceRoot":"","sources":["../../src/utils/apiKeyInput.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IACnC,SAAS,EAAE,MAAM,MAAM,CAAC;IACxB,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC;AAmBD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,kBAAkB,EAC3B,YAAY,GAAE,uBAA6C,GAC1D,MAAM,GAAG,SAAS,CA8BpB"}
1
+ {"version":3,"file":"apiKeyInput.d.ts","sourceRoot":"","sources":["../../src/utils/apiKeyInput.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,kBAAkB;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IACnC,SAAS,EAAE,MAAM,MAAM,CAAC;IACxB,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC;AAmBD;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,kBAAkB,EAC3B,YAAY,GAAE,uBAA6C,GAC1D,MAAM,GAAG,SAAS,CAmBpB"}
@@ -16,17 +16,9 @@ const normalizeApiKey = (value, source) => {
16
16
  };
17
17
  /**
18
18
  * Resolve explicit credential input without ever writing the credential to
19
- * output. The legacy argv path remains compatible, but every use explains the
20
- * safer environment, file and stdin alternatives on stderr.
19
+ * output.
21
20
  */
22
21
  export function resolveApiKeyInput(options, dependencies = defaultDependencies) {
23
- if (options.apiKey !== undefined && options.apiKeyFile !== undefined) {
24
- throw new Error('--api-key and --api-key-file cannot be used together.');
25
- }
26
- if (options.apiKey !== undefined) {
27
- dependencies.warn('[warn] --api-key exposes credentials in shell history and process listings. Prefer AGENTTEAMS_API_KEY, --api-key-file <path>, or --api-key-file - for stdin.\n');
28
- return normalizeApiKey(options.apiKey, '--api-key');
29
- }
30
22
  if (options.apiKeyFile === undefined) {
31
23
  return undefined;
32
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"apiKeyInput.js","sourceRoot":"","sources":["../../src/utils/apiKeyInput.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAavC,MAAM,mBAAmB,GAA4B;IACnD,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC;IAC/C,SAAS,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC,EAAE,OAAO,CAAC;IACzC,IAAI,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC;CACjD,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,KAAa,EAAE,MAAc,EAAU,EAAE;IAChE,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAChC,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,GAAG,MAAM,YAAY,CAAC,CAAC;IACzC,CAAC;IACD,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,GAAG,MAAM,uDAAuD,CAAC,CAAC;IACpF,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAChC,OAA2B,EAC3B,eAAwC,mBAAmB;IAE3D,IAAI,OAAO,CAAC,MAAM,KAA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AE,CAAC,CAAC,CAAC,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAChH,OAAO,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACxC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IACE,KAAK,YAAY,KAAK;YACtB,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC,EACtF,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;QACD,MAAM,MAAM,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACtE,MAAM,IAAI,KAAK,CAAC,kBAAkB,MAAM,KAAK,MAAM,EAAE,CAAC,CAAC;IACzD,CAAC;AACH,CAAC"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Which origins may receive AgentTeams session identity headers.
3
+ *
4
+ * The CLI talks to more than one host. Entity writes go to the AgentTeams API, but attachment
5
+ * uploads go straight to a presigned object-storage URL (`commands/attachment.ts`), and a global
6
+ * axios interceptor cannot tell the two apart on its own. Sending the session identity headers
7
+ * everywhere would hand a stable device UUID and a fingerprint of the user's working directory to
8
+ * a storage endpoint that has no use for them — it ignores unsigned headers, so the leak would
9
+ * never surface as a failure. `desktop/src/main/webview/client-header.ts` scopes the same class of
10
+ * header by origin for the same reason.
11
+ *
12
+ * This module must not import the config loader: `utils/httpClient.ts` consumes it, and the loader
13
+ * imports the token client, which imports the HTTP layer back (see `auth/activeCredential.ts`).
14
+ * So origins arrive two ways instead:
15
+ *
16
+ * - **Seeded** from the environment and the built-in default, covering paths that run before a
17
+ * project config is resolved (`init`, `auth login`).
18
+ * - **Registered** by `resolveApiContext()`, the single place every command and the MCP server
19
+ * resolve their API base URL — including a `--api-url` override that no seed could predict.
20
+ *
21
+ * Unknown origin means the headers are omitted. Fail-closed: a missed origin costs the tool axis
22
+ * on that request, while a wrong one leaks the identifiers for good.
23
+ */
24
+ /** Record an API base URL the CLI resolved for itself. Called from `resolveApiContext()`. */
25
+ export declare const registerApiOrigin: (rawUrl: string | null | undefined) => void;
26
+ /**
27
+ * Resolve the absolute origin an axios request will actually reach.
28
+ *
29
+ * `baseURL` is the base only when the url is relative; an absolute url wins, which is exactly the
30
+ * presigned-upload shape (`axios.put(uploadUrl, ...)` with no baseURL at all).
31
+ */
32
+ export declare const resolveRequestOrigin: (request: {
33
+ url?: string;
34
+ baseURL?: string;
35
+ }) => string | null;
36
+ /** True only for a request headed to an AgentTeams API origin this process resolved for itself. */
37
+ export declare const isApiOriginRequest: (request: {
38
+ url?: string;
39
+ baseURL?: string;
40
+ }) => boolean;
41
+ /** Test seam. The registry is process-wide and memoized by design. */
42
+ export declare const __resetApiOriginsForTest: () => void;
43
+ //# sourceMappingURL=apiOrigin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apiOrigin.d.ts","sourceRoot":"","sources":["../../src/utils/apiOrigin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAgBH,6FAA6F;AAC7F,eAAO,MAAM,iBAAiB,GAAI,QAAQ,MAAM,GAAG,IAAI,GAAG,SAAS,KAAG,IAGrE,CAAC;AAKF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAAI,SAAS;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,KAAG,MAAM,GAAG,IAa3F,CAAC;AAEF,mGAAmG;AACnG,eAAO,MAAM,kBAAkB,GAAI,SAAS;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,KAAG,OAGhF,CAAC;AAEF,sEAAsE;AACtE,eAAO,MAAM,wBAAwB,QAAO,IAI3C,CAAC"}