@evalops/maestro 0.10.23 → 0.10.24

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 (376) hide show
  1. package/README.md +4 -4
  2. package/dist/agent/agent.d.ts +2 -2
  3. package/dist/agent/agent.d.ts.map +1 -1
  4. package/dist/agent/agent.js +1 -1
  5. package/dist/agent/agent.js.map +1 -1
  6. package/dist/agent/keys.d.ts +2 -5
  7. package/dist/agent/keys.d.ts.map +1 -1
  8. package/dist/agent/keys.js +4 -5
  9. package/dist/agent/keys.js.map +1 -1
  10. package/dist/agent/modes.d.ts +2 -2
  11. package/dist/agent/modes.d.ts.map +1 -1
  12. package/dist/agent/modes.js +6 -7
  13. package/dist/agent/modes.js.map +1 -1
  14. package/dist/agent/providers/anthropic.d.ts.map +1 -1
  15. package/dist/agent/providers/anthropic.js +4 -4
  16. package/dist/agent/providers/anthropic.js.map +1 -1
  17. package/dist/agent/providers/google.js +1 -1
  18. package/dist/agent/swarm/executor.d.ts +2 -0
  19. package/dist/agent/swarm/executor.d.ts.map +1 -1
  20. package/dist/agent/swarm/executor.js +208 -35
  21. package/dist/agent/swarm/executor.js.map +1 -1
  22. package/dist/agent/swarm/types.d.ts +2 -0
  23. package/dist/agent/swarm/types.d.ts.map +1 -1
  24. package/dist/agent/swarm/types.js.map +1 -1
  25. package/dist/agent/tool-capability-types.d.ts +36 -0
  26. package/dist/agent/tool-capability-types.d.ts.map +1 -0
  27. package/dist/agent/tool-capability-types.js +2 -0
  28. package/dist/agent/tool-capability-types.js.map +1 -0
  29. package/dist/agent/transport/tool-execution-bridge.d.ts +13 -0
  30. package/dist/agent/transport/tool-execution-bridge.d.ts.map +1 -1
  31. package/dist/agent/transport/tool-execution-bridge.js +28 -15
  32. package/dist/agent/transport/tool-execution-bridge.js.map +1 -1
  33. package/dist/agent/transport/transport-utils.d.ts.map +1 -1
  34. package/dist/agent/transport/transport-utils.js +2 -3
  35. package/dist/agent/transport/transport-utils.js.map +1 -1
  36. package/dist/agent/transport.js +1 -1
  37. package/dist/agent/transport.js.map +1 -1
  38. package/dist/agent/type-guards.d.ts +1 -1
  39. package/dist/agent/type-guards.js +1 -1
  40. package/dist/agent/type-guards.js.map +1 -1
  41. package/dist/agent/types.d.ts +5 -3
  42. package/dist/agent/types.d.ts.map +1 -1
  43. package/dist/agent/types.js +2 -2
  44. package/dist/agent/types.js.map +1 -1
  45. package/dist/app-server/daemon-lifecycle-api.d.ts +31 -0
  46. package/dist/app-server/daemon-lifecycle-api.d.ts.map +1 -0
  47. package/dist/app-server/daemon-lifecycle-api.js +259 -0
  48. package/dist/app-server/daemon-lifecycle-api.js.map +1 -0
  49. package/dist/app-server/external-agent-import-api.d.ts +30 -0
  50. package/dist/app-server/external-agent-import-api.d.ts.map +1 -0
  51. package/dist/app-server/external-agent-import-api.js +553 -0
  52. package/dist/app-server/external-agent-import-api.js.map +1 -0
  53. package/dist/app-server/host-control-api.d.ts +30 -0
  54. package/dist/app-server/host-control-api.d.ts.map +1 -0
  55. package/dist/app-server/host-control-api.js +343 -0
  56. package/dist/app-server/host-control-api.js.map +1 -0
  57. package/dist/app-server/in-process-client.d.ts +2 -2
  58. package/dist/app-server/in-process-client.d.ts.map +1 -1
  59. package/dist/app-server/in-process-client.js.map +1 -1
  60. package/dist/app-server/network-governance-api.d.ts +26 -0
  61. package/dist/app-server/network-governance-api.d.ts.map +1 -0
  62. package/dist/app-server/network-governance-api.js +476 -0
  63. package/dist/app-server/network-governance-api.js.map +1 -0
  64. package/dist/app-server/plugin-bundle-api.d.ts +17 -0
  65. package/dist/app-server/plugin-bundle-api.d.ts.map +1 -0
  66. package/dist/app-server/plugin-bundle-api.js +219 -0
  67. package/dist/app-server/plugin-bundle-api.js.map +1 -0
  68. package/dist/app-server/policy-control-api.d.ts +14 -0
  69. package/dist/app-server/policy-control-api.d.ts.map +1 -0
  70. package/dist/app-server/policy-control-api.js +200 -0
  71. package/dist/app-server/policy-control-api.js.map +1 -0
  72. package/dist/app-server/protocol-modes-api.d.ts +22 -0
  73. package/dist/app-server/protocol-modes-api.d.ts.map +1 -0
  74. package/dist/app-server/protocol-modes-api.js +124 -0
  75. package/dist/app-server/protocol-modes-api.js.map +1 -0
  76. package/dist/app-server/sandbox-proof-api.d.ts +21 -0
  77. package/dist/app-server/sandbox-proof-api.d.ts.map +1 -0
  78. package/dist/app-server/sandbox-proof-api.js +127 -0
  79. package/dist/app-server/sandbox-proof-api.js.map +1 -0
  80. package/dist/app-server/session-api.d.ts +93 -3
  81. package/dist/app-server/session-api.d.ts.map +1 -1
  82. package/dist/app-server/session-api.js +706 -18
  83. package/dist/app-server/session-api.js.map +1 -1
  84. package/dist/audit/logger.d.ts +1 -1
  85. package/dist/bootstrap/auth-setup.d.ts.map +1 -1
  86. package/dist/bootstrap/auth-setup.js +17 -2
  87. package/dist/bootstrap/auth-setup.js.map +1 -1
  88. package/dist/bootstrap/model-resolution-setup.d.ts.map +1 -1
  89. package/dist/bootstrap/model-resolution-setup.js +19 -4
  90. package/dist/bootstrap/model-resolution-setup.js.map +1 -1
  91. package/dist/cli/args.d.ts +2 -2
  92. package/dist/cli/args.d.ts.map +1 -1
  93. package/dist/cli/args.js +2 -2
  94. package/dist/cli/args.js.map +1 -1
  95. package/dist/cli/commands/a2a.d.ts.map +1 -1
  96. package/dist/cli/commands/a2a.js +226 -14
  97. package/dist/cli/commands/a2a.js.map +1 -1
  98. package/dist/cli/commands/anthropic.d.ts +1 -1
  99. package/dist/cli/commands/anthropic.d.ts.map +1 -1
  100. package/dist/cli/commands/anthropic.js +3 -68
  101. package/dist/cli/commands/anthropic.js.map +1 -1
  102. package/dist/cli/commands/modes.js +1 -1
  103. package/dist/cli/commands/modes.js.map +1 -1
  104. package/dist/cli/help.d.ts.map +1 -1
  105. package/dist/cli/help.js +5 -7
  106. package/dist/cli/help.js.map +1 -1
  107. package/dist/cli/rpc-mode.d.ts +1 -1
  108. package/dist/cli/rpc-mode.js +1 -1
  109. package/dist/cli/rpc-mode.js.map +1 -1
  110. package/dist/cli/session.js +1 -1
  111. package/dist/cli/session.js.map +1 -1
  112. package/dist/cli-tui/commands/command-catalog.d.ts.map +1 -1
  113. package/dist/cli-tui/commands/command-catalog.js +7 -12
  114. package/dist/cli-tui/commands/command-catalog.js.map +1 -1
  115. package/dist/cli-tui/commands/subcommands/auth-commands.d.ts +1 -1
  116. package/dist/cli-tui/commands/subcommands/auth-commands.d.ts.map +1 -1
  117. package/dist/cli-tui/commands/subcommands/auth-commands.js +4 -12
  118. package/dist/cli-tui/commands/subcommands/auth-commands.js.map +1 -1
  119. package/dist/cli-tui/custom-editor.d.ts +1 -1
  120. package/dist/cli-tui/custom-editor.js +2 -2
  121. package/dist/cli-tui/custom-editor.js.map +1 -1
  122. package/dist/cli-tui/oauth/oauth-flow-controller.d.ts.map +1 -1
  123. package/dist/cli-tui/oauth/oauth-flow-controller.js +19 -23
  124. package/dist/cli-tui/oauth/oauth-flow-controller.js.map +1 -1
  125. package/dist/cli-tui/selectors/model-selector.d.ts.map +1 -1
  126. package/dist/cli-tui/selectors/model-selector.js +0 -1
  127. package/dist/cli-tui/selectors/model-selector.js.map +1 -1
  128. package/dist/cli-tui/selectors/oauth-selector-view.d.ts +2 -2
  129. package/dist/cli-tui/selectors/oauth-selector-view.d.ts.map +1 -1
  130. package/dist/cli-tui/selectors/oauth-selector-view.js.map +1 -1
  131. package/dist/cli-tui/selectors/oauth-selector.d.ts +2 -2
  132. package/dist/cli-tui/selectors/oauth-selector.d.ts.map +1 -1
  133. package/dist/cli-tui/selectors/oauth-selector.js +3 -4
  134. package/dist/cli-tui/selectors/oauth-selector.js.map +1 -1
  135. package/dist/cli-tui/tui-renderer/mcp-events-setup.js +1 -1
  136. package/dist/cli-tui/tui-renderer/mcp-events-setup.js.map +1 -1
  137. package/dist/cli-tui/tui-renderer.js +2 -2
  138. package/dist/cli-tui/tui-renderer.js.map +1 -1
  139. package/dist/cli-tui/utils/footer-utils.d.ts +1 -1
  140. package/dist/cli-tui/utils/footer-utils.js +1 -1
  141. package/dist/cli-tui/utils/footer-utils.js.map +1 -1
  142. package/dist/cli.js +15156 -14232
  143. package/dist/commands/prompts.d.ts +1 -1
  144. package/dist/commands/prompts.js +1 -1
  145. package/dist/commands/prompts.js.map +1 -1
  146. package/dist/config/constants.d.ts +2 -2
  147. package/dist/config/constants.d.ts.map +1 -1
  148. package/dist/config/constants.js +2 -2
  149. package/dist/config/constants.js.map +1 -1
  150. package/dist/config/index.d.ts +1 -1
  151. package/dist/config/index.js +1 -1
  152. package/dist/config/index.js.map +1 -1
  153. package/dist/config/toml-config.js +3 -3
  154. package/dist/config/toml-config.js.map +1 -1
  155. package/dist/db/client.d.ts +2 -2
  156. package/dist/db/client.js +2 -2
  157. package/dist/db/client.js.map +1 -1
  158. package/dist/db/migrate.d.ts +1 -1
  159. package/dist/db/migrate.js +1 -1
  160. package/dist/db/migrate.js.map +1 -1
  161. package/dist/db/schema.d.ts +2 -2
  162. package/dist/db/schema.js +1 -1
  163. package/dist/db/schema.js.map +1 -1
  164. package/dist/errors/index.d.ts +2 -2
  165. package/dist/errors/index.js +2 -2
  166. package/dist/errors/index.js.map +1 -1
  167. package/dist/main.d.ts +4 -5
  168. package/dist/main.d.ts.map +1 -1
  169. package/dist/main.js +17 -14
  170. package/dist/main.js.map +1 -1
  171. package/dist/mcp/config.d.ts +15 -2
  172. package/dist/mcp/config.d.ts.map +1 -1
  173. package/dist/mcp/config.js +50 -26
  174. package/dist/mcp/config.js.map +1 -1
  175. package/dist/mcp/fathom-cua.d.ts.map +1 -1
  176. package/dist/mcp/fathom-cua.js +10 -0
  177. package/dist/mcp/fathom-cua.js.map +1 -1
  178. package/dist/mcp/manager.d.ts.map +1 -1
  179. package/dist/mcp/manager.js +32 -1
  180. package/dist/mcp/manager.js.map +1 -1
  181. package/dist/mcp/tool-bridge.d.ts.map +1 -1
  182. package/dist/mcp/tool-bridge.js +12 -3
  183. package/dist/mcp/tool-bridge.js.map +1 -1
  184. package/dist/mcp/tool-capabilities.d.ts +5 -0
  185. package/dist/mcp/tool-capabilities.d.ts.map +1 -0
  186. package/dist/mcp/tool-capabilities.js +271 -0
  187. package/dist/mcp/tool-capabilities.js.map +1 -0
  188. package/dist/mcp/types.d.ts +6 -1
  189. package/dist/mcp/types.d.ts.map +1 -1
  190. package/dist/mcp/types.js.map +1 -1
  191. package/dist/models/config-loader.d.ts +1 -1
  192. package/dist/models/factory-integration.d.ts +1 -1
  193. package/dist/models/factory-integration.js +1 -1
  194. package/dist/models/factory-integration.js.map +1 -1
  195. package/dist/node_modules/@evalops/contracts/dist/index.d.ts +3 -3
  196. package/dist/node_modules/@evalops/contracts/dist/index.js +2 -2
  197. package/dist/node_modules/@evalops/contracts/dist/index.js.map +1 -1
  198. package/dist/node_modules/@evalops/contracts/dist/maestro-app-server.d.ts +1182 -14
  199. package/dist/node_modules/@evalops/contracts/dist/maestro-app-server.d.ts.map +1 -1
  200. package/dist/node_modules/@evalops/contracts/dist/maestro-app-server.js +450 -1
  201. package/dist/node_modules/@evalops/contracts/dist/maestro-app-server.js.map +1 -1
  202. package/dist/node_modules/@evalops/contracts/package.json +1 -1
  203. package/dist/node_modules/@evalops/tui/package.json +1 -1
  204. package/dist/oauth/connectors.d.ts +2 -2
  205. package/dist/oauth/connectors.d.ts.map +1 -1
  206. package/dist/oauth/connectors.js +3 -5
  207. package/dist/oauth/connectors.js.map +1 -1
  208. package/dist/oauth/github-copilot.d.ts +1 -1
  209. package/dist/oauth/github-copilot.js +1 -1
  210. package/dist/oauth/github-copilot.js.map +1 -1
  211. package/dist/oauth/index.d.ts +10 -8
  212. package/dist/oauth/index.d.ts.map +1 -1
  213. package/dist/oauth/index.js +54 -31
  214. package/dist/oauth/index.js.map +1 -1
  215. package/dist/oauth/openai.d.ts +1 -1
  216. package/dist/oauth/openai.js +2 -2
  217. package/dist/oauth/openai.js.map +1 -1
  218. package/dist/platform/a2a-completion-audit.d.ts +41 -0
  219. package/dist/platform/a2a-completion-audit.d.ts.map +1 -0
  220. package/dist/platform/a2a-completion-audit.js +177 -0
  221. package/dist/platform/a2a-completion-audit.js.map +1 -0
  222. package/dist/platform/a2a-task-ledger.d.ts.map +1 -1
  223. package/dist/platform/a2a-task-ledger.js +17 -0
  224. package/dist/platform/a2a-task-ledger.js.map +1 -1
  225. package/dist/platform/a2a-telemetry-inspect.d.ts +58 -0
  226. package/dist/platform/a2a-telemetry-inspect.d.ts.map +1 -0
  227. package/dist/platform/a2a-telemetry-inspect.js +224 -0
  228. package/dist/platform/a2a-telemetry-inspect.js.map +1 -0
  229. package/dist/platform/agent-registry-client.d.ts +8 -0
  230. package/dist/platform/agent-registry-client.d.ts.map +1 -1
  231. package/dist/platform/agent-registry-client.js +9 -1
  232. package/dist/platform/agent-registry-client.js.map +1 -1
  233. package/dist/providers/api-keys.d.ts +2 -2
  234. package/dist/providers/api-keys.js +2 -2
  235. package/dist/providers/api-keys.js.map +1 -1
  236. package/dist/providers/auth.d.ts +3 -6
  237. package/dist/providers/auth.d.ts.map +1 -1
  238. package/dist/providers/auth.js +1 -40
  239. package/dist/providers/auth.js.map +1 -1
  240. package/dist/rpc/index.d.ts +2 -2
  241. package/dist/rpc/index.js +2 -2
  242. package/dist/rpc/index.js.map +1 -1
  243. package/dist/rpc/rpc-types.d.ts +1 -1
  244. package/dist/rpc/rpc-types.js +1 -1
  245. package/dist/rpc/rpc-types.js.map +1 -1
  246. package/dist/safety/nested-agent-guard.js +1 -1
  247. package/dist/safety/nested-agent-guard.js.map +1 -1
  248. package/dist/safety/policy.d.ts +2 -2
  249. package/dist/safety/policy.js +2 -2
  250. package/dist/safety/policy.js.map +1 -1
  251. package/dist/safety/validators/network-policy-validator.d.ts +8 -0
  252. package/dist/safety/validators/network-policy-validator.d.ts.map +1 -1
  253. package/dist/safety/validators/network-policy-validator.js +29 -4
  254. package/dist/safety/validators/network-policy-validator.js.map +1 -1
  255. package/dist/sandbox/local-sandbox.d.ts +1 -1
  256. package/dist/sandbox/local-sandbox.js +1 -1
  257. package/dist/sandbox/local-sandbox.js.map +1 -1
  258. package/dist/server/app-context.d.ts +2 -0
  259. package/dist/server/app-context.d.ts.map +1 -1
  260. package/dist/server/app-context.js.map +1 -1
  261. package/dist/server/handlers/attachments.d.ts.map +1 -1
  262. package/dist/server/handlers/attachments.js +1 -0
  263. package/dist/server/handlers/attachments.js.map +1 -1
  264. package/dist/server/handlers/models.d.ts.map +1 -1
  265. package/dist/server/handlers/models.js +3 -1
  266. package/dist/server/handlers/models.js.map +1 -1
  267. package/dist/server/handlers/session-attachments.d.ts.map +1 -1
  268. package/dist/server/handlers/session-attachments.js +2 -0
  269. package/dist/server/handlers/session-attachments.js.map +1 -1
  270. package/dist/server/handlers/sessions.js +1 -1
  271. package/dist/server/handlers/sessions.js.map +1 -1
  272. package/dist/server/handlers/status.d.ts +2 -0
  273. package/dist/server/handlers/status.d.ts.map +1 -1
  274. package/dist/server/handlers/status.js +3 -2
  275. package/dist/server/handlers/status.js.map +1 -1
  276. package/dist/server/headless-runtime-service.d.ts.map +1 -1
  277. package/dist/server/headless-runtime-service.js +32 -3
  278. package/dist/server/headless-runtime-service.js.map +1 -1
  279. package/dist/server/hosted-session-manager.d.ts +2 -0
  280. package/dist/server/hosted-session-manager.d.ts.map +1 -1
  281. package/dist/server/hosted-session-manager.js +9 -0
  282. package/dist/server/hosted-session-manager.js.map +1 -1
  283. package/dist/server/model-selection.d.ts.map +1 -1
  284. package/dist/server/model-selection.js +9 -1
  285. package/dist/server/model-selection.js.map +1 -1
  286. package/dist/server/rate-limiter.d.ts +1 -1
  287. package/dist/server/rate-limiter.js +1 -1
  288. package/dist/server/rate-limiter.js.map +1 -1
  289. package/dist/server/router.d.ts +2 -2
  290. package/dist/server/router.js.map +1 -1
  291. package/dist/server/session-serialization.d.ts +9 -9
  292. package/dist/server/session-serialization.js +15 -15
  293. package/dist/server/session-serialization.js.map +1 -1
  294. package/dist/session/manager.d.ts +5 -0
  295. package/dist/session/manager.d.ts.map +1 -1
  296. package/dist/session/manager.js +56 -8
  297. package/dist/session/manager.js.map +1 -1
  298. package/dist/session/session-catalog.d.ts +2 -0
  299. package/dist/session/session-catalog.d.ts.map +1 -1
  300. package/dist/session/session-catalog.js +6 -0
  301. package/dist/session/session-catalog.js.map +1 -1
  302. package/dist/session/session-context.d.ts +2 -0
  303. package/dist/session/session-context.d.ts.map +1 -1
  304. package/dist/session/session-context.js +15 -0
  305. package/dist/session/session-context.js.map +1 -1
  306. package/dist/session/types.d.ts +7 -0
  307. package/dist/session/types.d.ts.map +1 -1
  308. package/dist/session/types.js.map +1 -1
  309. package/dist/session/wire-format.generated.d.ts +1 -0
  310. package/dist/session/wire-format.generated.d.ts.map +1 -1
  311. package/dist/session/wire-format.generated.js +1 -0
  312. package/dist/session/wire-format.generated.js.map +1 -1
  313. package/dist/shared-memory/contract.d.ts +4 -4
  314. package/dist/shared-memory/contract.js +2 -2
  315. package/dist/shared-memory/contract.js.map +1 -1
  316. package/dist/telemetry/index.d.ts +2 -2
  317. package/dist/telemetry/index.d.ts.map +1 -1
  318. package/dist/telemetry/index.js +2 -2
  319. package/dist/telemetry/index.js.map +1 -1
  320. package/dist/telemetry/maestro-event-bus.d.ts +57 -0
  321. package/dist/telemetry/maestro-event-bus.d.ts.map +1 -1
  322. package/dist/telemetry/maestro-event-bus.js +59 -1
  323. package/dist/telemetry/maestro-event-bus.js.map +1 -1
  324. package/dist/telemetry/maestro-event-catalog.d.ts +17 -1
  325. package/dist/telemetry/maestro-event-catalog.d.ts.map +1 -1
  326. package/dist/telemetry/maestro-event-catalog.js +24 -0
  327. package/dist/telemetry/maestro-event-catalog.js.map +1 -1
  328. package/dist/telemetry/mcp-beacon.d.ts +2 -0
  329. package/dist/telemetry/mcp-beacon.d.ts.map +1 -1
  330. package/dist/telemetry/mcp-beacon.js +15 -0
  331. package/dist/telemetry/mcp-beacon.js.map +1 -1
  332. package/dist/telemetry/metrics.d.ts +62 -0
  333. package/dist/telemetry/metrics.d.ts.map +1 -1
  334. package/dist/telemetry/metrics.js +84 -0
  335. package/dist/telemetry/metrics.js.map +1 -1
  336. package/dist/telemetry.d.ts +44 -0
  337. package/dist/telemetry.d.ts.map +1 -1
  338. package/dist/telemetry.js +84 -2
  339. package/dist/telemetry.js.map +1 -1
  340. package/dist/theme/theme-loader.js +2 -2
  341. package/dist/theme/theme-loader.js.map +1 -1
  342. package/dist/theme/theme-schema.json +2 -2
  343. package/dist/theme/theme.d.ts +1 -1
  344. package/dist/theme/theme.js.map +1 -1
  345. package/dist/tools/background/task-types.d.ts +1 -1
  346. package/dist/tools/extract-document.d.ts +1 -0
  347. package/dist/tools/extract-document.d.ts.map +1 -1
  348. package/dist/tools/extract-document.js +2 -1
  349. package/dist/tools/extract-document.js.map +1 -1
  350. package/dist/tools/index.d.ts +55 -55
  351. package/dist/tools/index.js +1 -1
  352. package/dist/tools/index.js.map +1 -1
  353. package/dist/tools/tool-dsl.d.ts +1 -1
  354. package/dist/tools/tool-dsl.js +1 -1
  355. package/dist/tools/tool-dsl.js.map +1 -1
  356. package/dist/utils/document-extractor.d.ts +1 -0
  357. package/dist/utils/document-extractor.d.ts.map +1 -1
  358. package/dist/utils/document-extractor.js +320 -40
  359. package/dist/utils/document-extractor.js.map +1 -1
  360. package/dist/utils/logger.d.ts +1 -1
  361. package/dist/utils/logger.js +1 -1
  362. package/dist/utils/logger.js.map +1 -1
  363. package/dist/version.json +2 -2
  364. package/dist/web-server.d.ts +1 -1
  365. package/dist/web-server.d.ts.map +1 -1
  366. package/dist/web-server.js +12 -8
  367. package/dist/web-server.js.map +1 -1
  368. package/package.json +4 -2
  369. package/dist/oauth/anthropic.d.ts +0 -17
  370. package/dist/oauth/anthropic.d.ts.map +0 -1
  371. package/dist/oauth/anthropic.js +0 -81
  372. package/dist/oauth/anthropic.js.map +0 -1
  373. package/dist/providers/anthropic-auth.d.ts +0 -75
  374. package/dist/providers/anthropic-auth.d.ts.map +0 -1
  375. package/dist/providers/anthropic-auth.js +0 -221
  376. package/dist/providers/anthropic-auth.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"maestro-app-server.js","sourceRoot":"","sources":["../src/maestro-app-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,CAAC,MAAM,+BAA+B,GAAG,uBAAgC,CAAC;AAEhF,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC5C,YAAY;IACZ,YAAY;IACZ,iCAAiC;IACjC,aAAa;IACb,aAAa;IACb,wBAAwB;IACxB,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;IACjB,mBAAmB;IACnB,mBAAmB;CACV,CAAC;AAIX,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC7C,WAAW;IACX,QAAQ;IACR,SAAS;IACT,aAAa;IACb,WAAW;CACF,CAAC;AAIX,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC3C,WAAW;IACX,SAAS;IACT,aAAa;IACb,QAAQ;CACC,CAAC;AAIX,MAAM,CAAC,MAAM,+BAA+B,GAAG,IAAI,CAAC,KAAK,CAAC;IACzD,IAAI,CAAC,MAAM,EAAE;IACb,IAAI,CAAC,MAAM,EAAE;CACb,CAAC,CAAC;AACH,MAAM,uCAAuC,GAAG,IAAI,CAAC,KAAK,CAAC;IAC1D,+BAA+B;IAC/B,IAAI,CAAC,IAAI,EAAE;CACX,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mCAAmC,GAAG,IAAI,CAAC,MAAM,CAAC;IAC9D,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;IAC5B,EAAE,EAAE,+BAA+B;IACnC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;IACrB,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,OAAO,EA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AChE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,2BAA2B,CAAC;CAC/C,CAAC,CAAC;AAKH,MAAM,CAAC,MAAM,+CAA+C,GAAG,IAAI,CAAC,MAAM,CAAC;IAC1E,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE;IACjB,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;IACnB,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IAC/B,UAAU,EAAE,IAAI,CAAC,MAAM,EAAE;IACzB,YAAY,EAAE,uCAAuC;CACrD,CAAC,CAAC;AAKH,MAAM,CAAC,MAAM,yDAAyD,GACrE,IAAI,CAAC,MAAM,CAAC;IACX,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,+CAA+C,CAAC;CACtE,CAAC,CAAC;AAKJ,MAAM,CAAC,MAAM,8BAA8B,GAAG,IAAI,CAAC,MAAM,CAAC;IACzD,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;IAC5B,EAAE,EAAE,uCAAuC;IAC3C,MAAM,EAAE,IAAI,CAAC,QAAQ,CACpB,IAAI,CAAC,KAAK,CAAC;QACV,sCAAsC;QACtC,qCAAqC;QACrC,yDAAyD;QACzD,sCAAsC;QACtC,sCAAsC;QACtC,gDAAgD;QAChD,sCAAsC;QACtC,qCAAqC;KACrC,CAAC,CACF;IACD,KAAK,EAAE,IAAI,CAAC,QAAQ,CACnB,IAAI,CAAC,MAAM,CAAC;QACX,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;QACnB,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE;KACtB,CAAC,CACF;CACD,CAAC,CAAC","sourcesContent":["import { type Static, Type } from \"@sinclair/typebox\";\nimport { stringLiteralUnion } from \"./typebox-utils.js\";\n\nexport const maestroAppServerProtocolVersion = \"maestro-app-server.v1\" as const;\n\nexport const maestroAppServerClientMethods = [\n\t\"initialize\",\n\t\"model/list\",\n\t\"modelProvider/capabilities/read\",\n\t\"thread/list\",\n\t\"thread/read\",\n\t\"thread/metadata/update\",\n\t\"thread/name/set\",\n\t\"thread/goal/get\",\n\t\"thread/goal/set\",\n\t\"thread/goal/clear\",\n\t\"thread/turns/list\",\n] as const;\nexport type MaestroAppServerClientMethod =\n\t(typeof maestroAppServerClientMethods)[number];\n\nexport const maestroAppServerThreadStatuses = [\n\t\"notLoaded\",\n\t\"loaded\",\n\t\"running\",\n\t\"interrupted\",\n\t\"completed\",\n] as const;\nexport type MaestroAppServerThreadStatus =\n\t(typeof maestroAppServerThreadStatuses)[number];\n\nexport const maestroAppServerTurnStatuses = [\n\t\"completed\",\n\t\"running\",\n\t\"interrupted\",\n\t\"failed\",\n] as const;\nexport type MaestroAppServerTurnStatus =\n\t(typeof maestroAppServerTurnStatuses)[number];\n\nexport const MaestroAppServerJsonRpcIdSchema = Type.Union([\n\tType.String(),\n\tType.Number(),\n]);\nconst MaestroAppServerJsonRpcResponseIdSchema = Type.Union([\n\tMaestroAppServerJsonRpcIdSchema,\n\tType.Null(),\n]);\n\nexport const MaestroAppServerClientRequestSchema = Type.Object({\n\tjsonrpc: Type.Literal(\"2.0\"),\n\tid: MaestroAppServerJsonRpcIdSchema,\n\tmethod: Type.String(),\n\tparams: Type.Optional(Type.Record(Type.String(), Type.Unknown())),\n});\nexport type MaestroAppServerClientRequest = Static<\n\ttypeof MaestroAppServerClientRequestSchema\n>;\n\nexport const MaestroAppServerCapabilitiesSchema = Type.Object({\n\tsessions: Type.Boolean(),\n\tmodelList: Type.Boolean(),\n\tmodelProviderCapabilities: Type.Boolean(),\n\tthreadList: Type.Boolean(),\n\tthreadRead: Type.Boolean(),\n\tthreadMetadataUpdate: Type.Boolean(),\n\tthreadNameSet: Type.Boolean(),\n\tthreadGoals: Type.Boolean(),\n\tturnsList: Type.Boolean(),\n});\nexport type MaestroAppServerCapabilities = Static<\n\ttypeof MaestroAppServerCapabilitiesSchema\n>;\n\nexport const MaestroAppServerInitializeResultSchema = Type.Object({\n\tprotocolVersion: Type.Literal(maestroAppServerProtocolVersion),\n\tserverInfo: Type.Object({\n\t\tname: Type.String(),\n\t\tversion: Type.Optional(Type.String()),\n\t}),\n\tcapabilities: MaestroAppServerCapabilitiesSchema,\n});\nexport type MaestroAppServerInitializeResult = Static<\n\ttypeof MaestroAppServerInitializeResultSchema\n>;\n\nexport const MaestroAppServerThreadStatusSchema = stringLiteralUnion(\n\tmaestroAppServerThreadStatuses,\n);\nexport const MaestroAppServerTurnStatusSchema = stringLiteralUnion(\n\tmaestroAppServerTurnStatuses,\n);\n\nexport const MaestroAppServerThreadSummarySchema = Type.Object({\n\tid: Type.String(),\n\tsource: Type.Literal(\"session\"),\n\tstatus: MaestroAppServerThreadStatusSchema,\n\ttitle: Type.Optional(Type.String()),\n\tsummary: Type.Optional(Type.String()),\n\tresumeSummary: Type.Optional(Type.String()),\n\tmemoryExtractionHash: Type.Optional(Type.String()),\n\tsubject: Type.Optional(Type.String()),\n\tpath: Type.Optional(Type.String()),\n\tcreatedAt: Type.String(),\n\tupdatedAt: Type.String(),\n\tmessageCount: Type.Number(),\n\tfavorite: Type.Boolean(),\n\ttags: Type.Optional(Type.Array(Type.String())),\n});\nexport type MaestroAppServerThreadSummary = Static<\n\ttypeof MaestroAppServerThreadSummarySchema\n>;\n\nexport const MaestroAppServerThreadGoalStatuses = [\n\t\"active\",\n\t\"complete\",\n\t\"cancelled\",\n] as const;\nexport const MaestroAppServerThreadGoalStatusSchema = stringLiteralUnion(\n\tMaestroAppServerThreadGoalStatuses,\n);\nexport const MaestroAppServerThreadGoalSchema = Type.Object({\n\tobjective: Type.String(),\n\tstatus: MaestroAppServerThreadGoalStatusSchema,\n\ttokenBudget: Type.Optional(Type.Number()),\n\tcreatedAt: Type.String(),\n\tupdatedAt: Type.String(),\n});\nexport type MaestroAppServerThreadGoal = Static<\n\ttypeof MaestroAppServerThreadGoalSchema\n>;\n\nexport const MaestroAppServerThreadItemSchema = Type.Object({\n\tid: Type.String(),\n\ttype: Type.String(),\n\ttimestamp: Type.Optional(Type.String()),\n\tparentId: Type.Optional(Type.Union([Type.String(), Type.Null()])),\n\trole: Type.Optional(Type.String()),\n\tcontent: Type.Optional(Type.Unknown()),\n\tdata: Type.Optional(Type.Unknown()),\n});\nexport type MaestroAppServerThreadItem = Static<\n\ttypeof MaestroAppServerThreadItemSchema\n>;\n\nexport const MaestroAppServerCompactionSpanSchema = Type.Object({\n\tid: Type.String(),\n\tfirstKeptEntryId: Type.String(),\n\tsummary: Type.String(),\n\ttokensBefore: Type.Number(),\n\tsourceEntryIds: Type.Array(Type.String()),\n});\nexport type MaestroAppServerCompactionSpan = Static<\n\ttypeof MaestroAppServerCompactionSpanSchema\n>;\n\nexport const MaestroAppServerThreadGraphSchema = Type.Object({\n\tbranchId: Type.String(),\n\tleafEntryId: Type.Optional(Type.String()),\n\tactiveEntryIds: Type.Array(Type.String()),\n\tcompactionSpans: Type.Array(MaestroAppServerCompactionSpanSchema),\n});\nexport type MaestroAppServerThreadGraph = Static<\n\ttypeof MaestroAppServerThreadGraphSchema\n>;\n\nexport const MaestroAppServerTurnSchema = Type.Object({\n\tid: Type.String(),\n\tparentTurnId: Type.Optional(Type.String()),\n\tstatus: MaestroAppServerTurnStatusSchema,\n\tstartedAt: Type.Optional(Type.String()),\n\tcompletedAt: Type.Optional(Type.String()),\n\tsourceEntryIds: Type.Optional(Type.Array(Type.String())),\n\ttoolCallIds: Type.Optional(Type.Array(Type.String())),\n\titems: Type.Array(MaestroAppServerThreadItemSchema),\n});\nexport type MaestroAppServerTurn = Static<typeof MaestroAppServerTurnSchema>;\n\nexport const MaestroAppServerThreadSchema = Type.Intersect([\n\tMaestroAppServerThreadSummarySchema,\n\tType.Object({\n\t\tmessagesView: Type.Union([\n\t\t\tType.Literal(\"full\"),\n\t\t\tType.Literal(\"summary\"),\n\t\t\tType.Literal(\"notLoaded\"),\n\t\t]),\n\t\tturns: Type.Optional(Type.Array(MaestroAppServerTurnSchema)),\n\t\tgraph: Type.Optional(MaestroAppServerThreadGraphSchema),\n\t}),\n]);\nexport type MaestroAppServerThread = Static<\n\ttypeof MaestroAppServerThreadSchema\n>;\n\nexport const MaestroAppServerThreadListResultSchema = Type.Object({\n\tthreads: Type.Array(MaestroAppServerThreadSummarySchema),\n\tnextCursor: Type.Union([Type.String(), Type.Null()]),\n});\nexport type MaestroAppServerThreadListResult = Static<\n\ttypeof MaestroAppServerThreadListResultSchema\n>;\n\nexport const MaestroAppServerThreadReadResultSchema = Type.Object({\n\tthread: MaestroAppServerThreadSchema,\n});\nexport type MaestroAppServerThreadReadResult = Static<\n\ttypeof MaestroAppServerThreadReadResultSchema\n>;\n\nexport const MaestroAppServerThreadMetadataUpdateResultSchema = Type.Object({\n\tthread: MaestroAppServerThreadSummarySchema,\n});\nexport type MaestroAppServerThreadMetadataUpdateResult = Static<\n\ttypeof MaestroAppServerThreadMetadataUpdateResultSchema\n>;\n\nexport const MaestroAppServerThreadGoalResultSchema = Type.Object({\n\tthreadId: Type.String(),\n\tgoal: Type.Union([MaestroAppServerThreadGoalSchema, Type.Null()]),\n});\nexport type MaestroAppServerThreadGoalResult = Static<\n\ttypeof MaestroAppServerThreadGoalResultSchema\n>;\n\nexport const MaestroAppServerTurnsListResultSchema = Type.Object({\n\tthreadId: Type.String(),\n\tturns: Type.Array(MaestroAppServerTurnSchema),\n\tnextCursor: Type.Union([Type.String(), Type.Null()]),\n\tgraph: Type.Optional(MaestroAppServerThreadGraphSchema),\n});\nexport type MaestroAppServerTurnsListResult = Static<\n\ttypeof MaestroAppServerTurnsListResultSchema\n>;\n\nexport const MaestroAppServerModelCapabilitiesSchema = Type.Object({\n\tstreaming: Type.Boolean(),\n\ttools: Type.Boolean(),\n\tvision: Type.Boolean(),\n\treasoning: Type.Boolean(),\n\tresponsesApi: Type.Boolean(),\n\tcodexBackend: Type.Boolean(),\n\tlocal: Type.Boolean(),\n});\nexport const MaestroAppServerReasoningEffortSchema = Type.Union([\n\tType.Literal(\"minimal\"),\n\tType.Literal(\"low\"),\n\tType.Literal(\"medium\"),\n\tType.Literal(\"high\"),\n\tType.Literal(\"ultra\"),\n]);\nexport const MaestroAppServerModelSchema = Type.Object({\n\tid: Type.String(),\n\tprovider: Type.String(),\n\tname: Type.String(),\n\tapi: Type.String(),\n\tcontextWindow: Type.Optional(Type.Number()),\n\tmaxTokens: Type.Optional(Type.Number()),\n\tcost: Type.Optional(Type.Record(Type.String(), Type.Number())),\n\tsource: Type.Optional(\n\t\tType.Union([Type.Literal(\"builtin\"), Type.Literal(\"custom\")]),\n\t),\n\tsupportedReasoningEfforts: Type.Optional(\n\t\tType.Array(MaestroAppServerReasoningEffortSchema),\n\t),\n\tdefaultReasoningEffort: Type.Optional(MaestroAppServerReasoningEffortSchema),\n\tcapabilities: MaestroAppServerModelCapabilitiesSchema,\n});\nexport type MaestroAppServerModel = Static<typeof MaestroAppServerModelSchema>;\n\nexport const MaestroAppServerModelListResultSchema = Type.Object({\n\tmodels: Type.Array(MaestroAppServerModelSchema),\n});\nexport type MaestroAppServerModelListResult = Static<\n\ttypeof MaestroAppServerModelListResultSchema\n>;\n\nexport const MaestroAppServerModelProviderCapabilitiesSchema = Type.Object({\n\tid: Type.String(),\n\tname: Type.String(),\n\tapis: Type.Array(Type.String()),\n\tmodelCount: Type.Number(),\n\tcapabilities: MaestroAppServerModelCapabilitiesSchema,\n});\nexport type MaestroAppServerModelProviderCapabilities = Static<\n\ttypeof MaestroAppServerModelProviderCapabilitiesSchema\n>;\n\nexport const MaestroAppServerModelProviderCapabilitiesReadResultSchema =\n\tType.Object({\n\t\tproviders: Type.Array(MaestroAppServerModelProviderCapabilitiesSchema),\n\t});\nexport type MaestroAppServerModelProviderCapabilitiesReadResult = Static<\n\ttypeof MaestroAppServerModelProviderCapabilitiesReadResultSchema\n>;\n\nexport const MaestroAppServerResponseSchema = Type.Object({\n\tjsonrpc: Type.Literal(\"2.0\"),\n\tid: MaestroAppServerJsonRpcResponseIdSchema,\n\tresult: Type.Optional(\n\t\tType.Union([\n\t\t\tMaestroAppServerInitializeResultSchema,\n\t\t\tMaestroAppServerModelListResultSchema,\n\t\t\tMaestroAppServerModelProviderCapabilitiesReadResultSchema,\n\t\t\tMaestroAppServerThreadListResultSchema,\n\t\t\tMaestroAppServerThreadReadResultSchema,\n\t\t\tMaestroAppServerThreadMetadataUpdateResultSchema,\n\t\t\tMaestroAppServerThreadGoalResultSchema,\n\t\t\tMaestroAppServerTurnsListResultSchema,\n\t\t]),\n\t),\n\terror: Type.Optional(\n\t\tType.Object({\n\t\t\tcode: Type.Number(),\n\t\t\tmessage: Type.String(),\n\t\t}),\n\t),\n});\nexport type MaestroAppServerResponse = Static<\n\ttypeof MaestroAppServerResponseSchema\n>;\n"]}
1
+ {"version":3,"file":"maestro-app-server.js","sourceRoot":"","sources":["../src/maestro-app-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,CAAC,MAAM,+BAA+B,GAAG,uBAAgC,CAAC;AAChF,MAAM,CAAC,MAAM,yCAAyC,GAAG;IACxD,uBAAuB;IACvB,+BAA+B;CACtB,CAAC;AAEX,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC5C,YAAY;IACZ,oBAAoB;IACpB,mBAAmB;IACnB,YAAY;IACZ,iCAAiC;IACjC,aAAa;IACb,cAAc;IACd,mBAAmB;IACnB,eAAe;IACf,oBAAoB;IACpB,eAAe;IACf,mBAAmB;IACnB,sBAAsB;IACtB,mBAAmB;IACnB,sBAAsB;IACtB,qBAAqB;IACrB,eAAe;IACf,sBAAsB;IACtB,0BAA0B;IAC1B,+BAA+B;IAC/B,qBAAqB;IACrB,cAAc;IACd,oBAAoB;IACpB,wBAAwB;IACxB,aAAa;IACb,cAAc;IACd,kBAAkB;IAClB,gBAAgB;IAChB,oBAAoB;IACpB,WAAW;IACX,SAAS;IACT,UAAU;IACV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M,EAAE,IAAI,CAAC,QAAQ,CAAC,iDAAiD,CAAC;CACxE,CAAC,CAAC","sourcesContent":["import { type Static, Type } from \"@sinclair/typebox\";\nimport { stringLiteralUnion } from \"./typebox-utils.js\";\n\nexport const maestroAppServerProtocolVersion = \"maestro-app-server.v2\" as const;\nexport const maestroAppServerSupportedProtocolVersions = [\n\t\"maestro-app-server.v1\",\n\tmaestroAppServerProtocolVersion,\n] as const;\n\nexport const maestroAppServerClientMethods = [\n\t\"initialize\",\n\t\"protocol/mode/list\",\n\t\"protocol/mode/set\",\n\t\"model/list\",\n\t\"modelProvider/capabilities/read\",\n\t\"policy/read\",\n\t\"policy/check\",\n\t\"requirements/list\",\n\t\"network/fetch\",\n\t\"network/audit/list\",\n\t\"sandbox/probe\",\n\t\"sandbox/proof/run\",\n\t\"externalAgent/import\",\n\t\"pluginBundle/list\",\n\t\"pluginBundle/install\",\n\t\"pluginBundle/remove\",\n\t\"daemon/status\",\n\t\"remoteControl/status\",\n\t\"remoteControl/lease/read\",\n\t\"remoteControl/lease/heartbeat\",\n\t\"remoteControl/drain\",\n\t\"command/exec\",\n\t\"command/exec/write\",\n\t\"command/exec/terminate\",\n\t\"fs/readFile\",\n\t\"fs/writeFile\",\n\t\"fs/readDirectory\",\n\t\"fs/getMetadata\",\n\t\"fs/createDirectory\",\n\t\"fs/remove\",\n\t\"fs/copy\",\n\t\"fs/watch\",\n\t\"fs/unwatch\",\n\t\"thread/list\",\n\t\"thread/read\",\n\t\"thread/metadata/update\",\n\t\"thread/name/set\",\n\t\"thread/goal/get\",\n\t\"thread/goal/set\",\n\t\"thread/goal/clear\",\n\t\"thread/start\",\n\t\"thread/fork\",\n\t\"thread/archive\",\n\t\"thread/unarchive\",\n\t\"thread/delete\",\n\t\"thread/turns/list\",\n] as const;\nexport type MaestroAppServerClientMethod =\n\t(typeof maestroAppServerClientMethods)[number];\n\nexport const maestroAppServerServerMethods = [\"fs/changed\"] as const;\nexport type MaestroAppServerServerMethod =\n\t(typeof maestroAppServerServerMethods)[number];\n\nexport const maestroAppServerThreadStatuses = [\n\t\"notLoaded\",\n\t\"loaded\",\n\t\"running\",\n\t\"interrupted\",\n\t\"completed\",\n\t\"archived\",\n] as const;\nexport type MaestroAppServerThreadStatus =\n\t(typeof maestroAppServerThreadStatuses)[number];\n\nexport const maestroAppServerTurnStatuses = [\n\t\"completed\",\n\t\"running\",\n\t\"interrupted\",\n\t\"failed\",\n] as const;\nexport type MaestroAppServerTurnStatus =\n\t(typeof maestroAppServerTurnStatuses)[number];\n\nexport const MaestroAppServerJsonRpcIdSchema = Type.Union([\n\tType.String(),\n\tType.Number(),\n]);\nconst MaestroAppServerJsonRpcResponseIdSchema = Type.Union([\n\tMaestroAppServerJsonRpcIdSchema,\n\tType.Null(),\n]);\n\nexport const MaestroAppServerClientRequestSchema = Type.Object({\n\tjsonrpc: Type.Literal(\"2.0\"),\n\tid: MaestroAppServerJsonRpcIdSchema,\n\tmethod: Type.String(),\n\tparams: Type.Optional(Type.Record(Type.String(), Type.Unknown())),\n});\nexport type MaestroAppServerClientRequest = Static<\n\ttypeof MaestroAppServerClientRequestSchema\n>;\n\nexport const MaestroAppServerCapabilitiesSchema = Type.Object({\n\tsessions: Type.Boolean(),\n\tprotocolModes: Type.Boolean(),\n\tmodelList: Type.Boolean(),\n\tmodelProviderCapabilities: Type.Boolean(),\n\tmanagedPolicy: Type.Boolean(),\n\trequirements: Type.Boolean(),\n\tnetworkProxy: Type.Boolean(),\n\tnetworkAudit: Type.Boolean(),\n\tsandboxProbe: Type.Boolean(),\n\tsandboxProof: Type.Boolean(),\n\texternalAgentImport: Type.Boolean(),\n\tpluginBundles: Type.Boolean(),\n\tdaemonStatus: Type.Boolean(),\n\tremoteControlStatus: Type.Boolean(),\n\tremoteControlLease: Type.Boolean(),\n\tremoteControlDrain: Type.Boolean(),\n\tcommandExec: Type.Boolean(),\n\tcommandProcessControl: Type.Boolean(),\n\tfilesystem: Type.Boolean(),\n\tfilesystemWatch: Type.Boolean(),\n\tthreadList: Type.Boolean(),\n\tthreadRead: Type.Boolean(),\n\tthreadMetadataUpdate: Type.Boolean(),\n\tthreadNameSet: Type.Boolean(),\n\tthreadGoals: Type.Boolean(),\n\tthreadStart: Type.Boolean(),\n\tthreadFork: Type.Boolean(),\n\tthreadArchive: Type.Boolean(),\n\tthreadDelete: Type.Boolean(),\n\tturnsList: Type.Boolean(),\n});\nexport type MaestroAppServerCapabilities = Static<\n\ttypeof MaestroAppServerCapabilitiesSchema\n>;\n\nexport const MaestroAppServerInitializeResultSchema = Type.Object({\n\tprotocolVersion: Type.Literal(maestroAppServerProtocolVersion),\n\tsupportedProtocolVersions: Type.Optional(\n\t\tType.Array(stringLiteralUnion(maestroAppServerSupportedProtocolVersions)),\n\t),\n\tserverInfo: Type.Object({\n\t\tname: Type.String(),\n\t\tversion: Type.Optional(Type.String()),\n\t}),\n\tcapabilities: MaestroAppServerCapabilitiesSchema,\n});\nexport type MaestroAppServerInitializeResult = Static<\n\ttypeof MaestroAppServerInitializeResultSchema\n>;\n\nexport const MaestroAppServerThreadStatusSchema = stringLiteralUnion(\n\tmaestroAppServerThreadStatuses,\n);\nexport const MaestroAppServerTurnStatusSchema = stringLiteralUnion(\n\tmaestroAppServerTurnStatuses,\n);\n\nexport const MaestroAppServerThreadSummarySchema = Type.Object({\n\tid: Type.String(),\n\tsource: Type.Literal(\"session\"),\n\tstatus: MaestroAppServerThreadStatusSchema,\n\ttitle: Type.Optional(Type.String()),\n\tsummary: Type.Optional(Type.String()),\n\tresumeSummary: Type.Optional(Type.String()),\n\tmemoryExtractionHash: Type.Optional(Type.String()),\n\tsubject: Type.Optional(Type.String()),\n\tpath: Type.Optional(Type.String()),\n\tcreatedAt: Type.String(),\n\tupdatedAt: Type.String(),\n\tmessageCount: Type.Number(),\n\tfavorite: Type.Boolean(),\n\ttags: Type.Optional(Type.Array(Type.String())),\n\tarchived: Type.Optional(Type.Boolean()),\n\tarchivedAt: Type.Optional(Type.String()),\n});\nexport type MaestroAppServerThreadSummary = Static<\n\ttypeof MaestroAppServerThreadSummarySchema\n>;\n\nexport const MaestroAppServerThreadGoalStatuses = [\n\t\"active\",\n\t\"complete\",\n\t\"cancelled\",\n] as const;\nexport const MaestroAppServerThreadGoalStatusSchema = stringLiteralUnion(\n\tMaestroAppServerThreadGoalStatuses,\n);\nexport const MaestroAppServerThreadGoalSchema = Type.Object({\n\tobjective: Type.String(),\n\tstatus: MaestroAppServerThreadGoalStatusSchema,\n\ttokenBudget: Type.Optional(Type.Number()),\n\tcreatedAt: Type.String(),\n\tupdatedAt: Type.String(),\n});\nexport type MaestroAppServerThreadGoal = Static<\n\ttypeof MaestroAppServerThreadGoalSchema\n>;\n\nexport const MaestroAppServerThreadItemSchema = Type.Object({\n\tid: Type.String(),\n\ttype: Type.String(),\n\ttimestamp: Type.Optional(Type.String()),\n\tparentId: Type.Optional(Type.Union([Type.String(), Type.Null()])),\n\trole: Type.Optional(Type.String()),\n\tcontent: Type.Optional(Type.Unknown()),\n\tdata: Type.Optional(Type.Unknown()),\n});\nexport type MaestroAppServerThreadItem = Static<\n\ttypeof MaestroAppServerThreadItemSchema\n>;\n\nexport const MaestroAppServerCompactionSpanSchema = Type.Object({\n\tid: Type.String(),\n\tfirstKeptEntryId: Type.String(),\n\tsummary: Type.String(),\n\ttokensBefore: Type.Number(),\n\tsourceEntryIds: Type.Array(Type.String()),\n});\nexport type MaestroAppServerCompactionSpan = Static<\n\ttypeof MaestroAppServerCompactionSpanSchema\n>;\n\nexport const MaestroAppServerThreadGraphSchema = Type.Object({\n\tbranchId: Type.String(),\n\tleafEntryId: Type.Optional(Type.String()),\n\tactiveEntryIds: Type.Array(Type.String()),\n\tcompactionSpans: Type.Array(MaestroAppServerCompactionSpanSchema),\n});\nexport type MaestroAppServerThreadGraph = Static<\n\ttypeof MaestroAppServerThreadGraphSchema\n>;\n\nexport const MaestroAppServerTurnSchema = Type.Object({\n\tid: Type.String(),\n\tparentTurnId: Type.Optional(Type.String()),\n\tstatus: MaestroAppServerTurnStatusSchema,\n\tstartedAt: Type.Optional(Type.String()),\n\tcompletedAt: Type.Optional(Type.String()),\n\tsourceEntryIds: Type.Optional(Type.Array(Type.String())),\n\ttoolCallIds: Type.Optional(Type.Array(Type.String())),\n\titems: Type.Array(MaestroAppServerThreadItemSchema),\n});\nexport type MaestroAppServerTurn = Static<typeof MaestroAppServerTurnSchema>;\n\nexport const MaestroAppServerThreadSchema = Type.Intersect([\n\tMaestroAppServerThreadSummarySchema,\n\tType.Object({\n\t\tmessagesView: Type.Union([\n\t\t\tType.Literal(\"full\"),\n\t\t\tType.Literal(\"summary\"),\n\t\t\tType.Literal(\"notLoaded\"),\n\t\t]),\n\t\tturns: Type.Optional(Type.Array(MaestroAppServerTurnSchema)),\n\t\tgraph: Type.Optional(MaestroAppServerThreadGraphSchema),\n\t}),\n]);\nexport type MaestroAppServerThread = Static<\n\ttypeof MaestroAppServerThreadSchema\n>;\n\nexport const MaestroAppServerThreadListResultSchema = Type.Object({\n\tthreads: Type.Array(MaestroAppServerThreadSummarySchema),\n\tnextCursor: Type.Union([Type.String(), Type.Null()]),\n});\nexport type MaestroAppServerThreadListResult = Static<\n\ttypeof MaestroAppServerThreadListResultSchema\n>;\n\nexport const MaestroAppServerThreadReadResultSchema = Type.Object({\n\tthread: MaestroAppServerThreadSchema,\n});\nexport type MaestroAppServerThreadReadResult = Static<\n\ttypeof MaestroAppServerThreadReadResultSchema\n>;\n\nexport const MaestroAppServerThreadMetadataUpdateResultSchema = Type.Object({\n\tthread: MaestroAppServerThreadSummarySchema,\n});\nexport type MaestroAppServerThreadMetadataUpdateResult = Static<\n\ttypeof MaestroAppServerThreadMetadataUpdateResultSchema\n>;\n\nexport const MaestroAppServerThreadGoalResultSchema = Type.Object({\n\tthreadId: Type.String(),\n\tgoal: Type.Union([MaestroAppServerThreadGoalSchema, Type.Null()]),\n});\nexport type MaestroAppServerThreadGoalResult = Static<\n\ttypeof MaestroAppServerThreadGoalResultSchema\n>;\n\nexport const MaestroAppServerTurnsListResultSchema = Type.Object({\n\tthreadId: Type.String(),\n\tturns: Type.Array(MaestroAppServerTurnSchema),\n\tnextCursor: Type.Union([Type.String(), Type.Null()]),\n\tgraph: Type.Optional(MaestroAppServerThreadGraphSchema),\n});\nexport type MaestroAppServerTurnsListResult = Static<\n\ttypeof MaestroAppServerTurnsListResultSchema\n>;\n\nexport const MaestroAppServerAllowedBlockedPolicySchema = Type.Object({\n\tallowed: Type.Optional(Type.Array(Type.String())),\n\tblocked: Type.Optional(Type.Array(Type.String())),\n});\nexport type MaestroAppServerAllowedBlockedPolicy = Static<\n\ttypeof MaestroAppServerAllowedBlockedPolicySchema\n>;\n\nexport const MaestroAppServerPolicySkillsSchema = Type.Object({\n\trequired: Type.Optional(Type.Array(Type.String())),\n});\nexport type MaestroAppServerPolicySkills = Static<\n\ttypeof MaestroAppServerPolicySkillsSchema\n>;\n\nexport const MaestroAppServerPolicyNetworkSchema = Type.Object({\n\tallowedHosts: Type.Optional(Type.Array(Type.String())),\n\tblockedHosts: Type.Optional(Type.Array(Type.String())),\n\tblockLocalhost: Type.Optional(Type.Boolean()),\n\tblockPrivateIPs: Type.Optional(Type.Boolean()),\n});\nexport type MaestroAppServerPolicyNetwork = Static<\n\ttypeof MaestroAppServerPolicyNetworkSchema\n>;\n\nexport const MaestroAppServerPolicyLimitsSchema = Type.Object({\n\tmaxTokensPerSession: Type.Optional(Type.Number()),\n\tmaxSessionDurationMinutes: Type.Optional(Type.Number()),\n\tmaxConcurrentSessions: Type.Optional(Type.Number()),\n});\nexport type MaestroAppServerPolicyLimits = Static<\n\ttypeof MaestroAppServerPolicyLimitsSchema\n>;\n\nexport const MaestroAppServerPolicySchema = Type.Object({\n\torgId: Type.Optional(Type.String()),\n\ttools: Type.Optional(MaestroAppServerAllowedBlockedPolicySchema),\n\tdependencies: Type.Optional(MaestroAppServerAllowedBlockedPolicySchema),\n\tmodels: Type.Optional(MaestroAppServerAllowedBlockedPolicySchema),\n\tskills: Type.Optional(MaestroAppServerPolicySkillsSchema),\n\tpaths: Type.Optional(MaestroAppServerAllowedBlockedPolicySchema),\n\tnetwork: Type.Optional(MaestroAppServerPolicyNetworkSchema),\n\tlimits: Type.Optional(MaestroAppServerPolicyLimitsSchema),\n});\nexport type MaestroAppServerPolicy = Static<\n\ttypeof MaestroAppServerPolicySchema\n>;\n\nexport const MaestroAppServerPolicyReadResultSchema = Type.Object({\n\tloaded: Type.Boolean(),\n\tpolicy: Type.Union([MaestroAppServerPolicySchema, Type.Null()]),\n});\nexport type MaestroAppServerPolicyReadResult = Static<\n\ttypeof MaestroAppServerPolicyReadResultSchema\n>;\n\nexport const maestroAppServerPolicyCheckKinds = [\n\t\"action\",\n\t\"model\",\n\t\"session\",\n] as const;\nexport const MaestroAppServerPolicyCheckKindSchema = stringLiteralUnion(\n\tmaestroAppServerPolicyCheckKinds,\n);\nexport type MaestroAppServerPolicyCheckKind =\n\t(typeof maestroAppServerPolicyCheckKinds)[number];\n\nexport const MaestroAppServerPolicyCheckItemSchema = Type.Object({\n\tkind: MaestroAppServerPolicyCheckKindSchema,\n\tallowed: Type.Boolean(),\n\treason: Type.Optional(Type.String()),\n});\nexport type MaestroAppServerPolicyCheckItem = Static<\n\ttypeof MaestroAppServerPolicyCheckItemSchema\n>;\n\nexport const MaestroAppServerPolicyCheckResultSchema = Type.Object({\n\tallowed: Type.Boolean(),\n\treason: Type.Optional(Type.String()),\n\tchecks: Type.Array(MaestroAppServerPolicyCheckItemSchema),\n});\nexport type MaestroAppServerPolicyCheckResult = Static<\n\ttypeof MaestroAppServerPolicyCheckResultSchema\n>;\n\nexport const MaestroAppServerRequirementSchema = Type.Object({\n\tkind: Type.Literal(\"skill\"),\n\tid: Type.String(),\n\trequired: Type.Boolean(),\n});\nexport type MaestroAppServerRequirement = Static<\n\ttypeof MaestroAppServerRequirementSchema\n>;\n\nexport const MaestroAppServerRequirementsListResultSchema = Type.Object({\n\trequirements: Type.Array(MaestroAppServerRequirementSchema),\n\trequiredSkills: Type.Array(Type.String()),\n});\nexport type MaestroAppServerRequirementsListResult = Static<\n\ttypeof MaestroAppServerRequirementsListResultSchema\n>;\n\nexport const maestroAppServerNetworkGovernanceStatuses = [\n\t\"allowed\",\n\t\"blocked\",\n\t\"failed\",\n] as const;\nexport const MaestroAppServerNetworkGovernanceStatusSchema = stringLiteralUnion(\n\tmaestroAppServerNetworkGovernanceStatuses,\n);\nexport type MaestroAppServerNetworkGovernanceStatus =\n\t(typeof maestroAppServerNetworkGovernanceStatuses)[number];\n\nexport const MaestroAppServerNetworkAuditRecordSchema = Type.Object({\n\tid: Type.String(),\n\tmethod: Type.String(),\n\turl: Type.String(),\n\thost: Type.String(),\n\tallowed: Type.Boolean(),\n\tstatus: MaestroAppServerNetworkGovernanceStatusSchema,\n\treason: Type.Optional(Type.String()),\n\tstatusCode: Type.Optional(Type.Number()),\n\tstartedAt: Type.String(),\n\tcompletedAt: Type.String(),\n});\nexport type MaestroAppServerNetworkAuditRecord = Static<\n\ttypeof MaestroAppServerNetworkAuditRecordSchema\n>;\n\nexport const MaestroAppServerNetworkFetchResultSchema = Type.Object({\n\tallowed: Type.Boolean(),\n\tstatus: MaestroAppServerNetworkGovernanceStatusSchema,\n\treason: Type.Optional(Type.String()),\n\tstatusCode: Type.Optional(Type.Number()),\n\theaders: Type.Optional(Type.Record(Type.String(), Type.String())),\n\tbodyBase64: Type.Optional(Type.String()),\n\taudit: MaestroAppServerNetworkAuditRecordSchema,\n});\nexport type MaestroAppServerNetworkFetchResult = Static<\n\ttypeof MaestroAppServerNetworkFetchResultSchema\n>;\n\nexport const MaestroAppServerNetworkAuditListResultSchema = Type.Object({\n\taudit: Type.Array(MaestroAppServerNetworkAuditRecordSchema),\n\tnextCursor: Type.Union([Type.String(), Type.Null()]),\n});\nexport type MaestroAppServerNetworkAuditListResult = Static<\n\ttypeof MaestroAppServerNetworkAuditListResultSchema\n>;\n\nexport const maestroAppServerSandboxTypes = [\n\t\"seatbelt\",\n\t\"landlock\",\n\t\"none\",\n] as const;\nexport const MaestroAppServerSandboxTypeSchema = stringLiteralUnion(\n\tmaestroAppServerSandboxTypes,\n);\nexport type MaestroAppServerSandboxType =\n\t(typeof maestroAppServerSandboxTypes)[number];\n\nexport const maestroAppServerSandboxProofModes = [\n\t\"read-only\",\n\t\"workspace-write\",\n] as const;\nexport const MaestroAppServerSandboxProofModeSchema = stringLiteralUnion(\n\tmaestroAppServerSandboxProofModes,\n);\nexport type MaestroAppServerSandboxProofMode =\n\t(typeof maestroAppServerSandboxProofModes)[number];\n\nexport const MaestroAppServerSandboxProbeResultSchema = Type.Object({\n\tavailable: Type.Boolean(),\n\ttype: MaestroAppServerSandboxTypeSchema,\n\tplatform: Type.String(),\n\tsupportedModes: Type.Array(MaestroAppServerSandboxProofModeSchema),\n\tproofAvailable: Type.Boolean(),\n});\nexport type MaestroAppServerSandboxProbeResult = Static<\n\ttypeof MaestroAppServerSandboxProbeResultSchema\n>;\n\nexport const MaestroAppServerSandboxProofCheckSchema = Type.Object({\n\tname: Type.String(),\n\tpassed: Type.Boolean(),\n\tdetail: Type.String(),\n});\nexport type MaestroAppServerSandboxProofCheck = Static<\n\ttypeof MaestroAppServerSandboxProofCheckSchema\n>;\n\nexport const MaestroAppServerSandboxProofResultSchema = Type.Object({\n\tmode: MaestroAppServerSandboxProofModeSchema,\n\tavailable: Type.Boolean(),\n\ttype: MaestroAppServerSandboxTypeSchema,\n\tpassed: Type.Boolean(),\n\tskippedReason: Type.Optional(Type.String()),\n\tchecks: Type.Array(MaestroAppServerSandboxProofCheckSchema),\n});\nexport type MaestroAppServerSandboxProofResult = Static<\n\ttypeof MaestroAppServerSandboxProofResultSchema\n>;\n\nexport const maestroAppServerExternalAgentArtifactKinds = [\n\t\"session\",\n\t\"config\",\n\t\"hooks\",\n\t\"mcp\",\n\t\"skill\",\n] as const;\nexport const MaestroAppServerExternalAgentArtifactKindSchema =\n\tstringLiteralUnion(maestroAppServerExternalAgentArtifactKinds);\nexport type MaestroAppServerExternalAgentArtifactKind =\n\t(typeof maestroAppServerExternalAgentArtifactKinds)[number];\n\nexport const maestroAppServerExternalAgentImportStatuses = [\n\t\"planned\",\n\t\"imported\",\n\t\"skipped\",\n] as const;\nexport const MaestroAppServerExternalAgentImportStatusSchema =\n\tstringLiteralUnion(maestroAppServerExternalAgentImportStatuses);\nexport type MaestroAppServerExternalAgentImportStatus =\n\t(typeof maestroAppServerExternalAgentImportStatuses)[number];\n\nexport const maestroAppServerExternalAgentImportScopes = [\n\t\"project\",\n\t\"local\",\n\t\"user\",\n] as const;\nexport const MaestroAppServerExternalAgentImportScopeSchema =\n\tstringLiteralUnion(maestroAppServerExternalAgentImportScopes);\nexport type MaestroAppServerExternalAgentImportScope =\n\t(typeof maestroAppServerExternalAgentImportScopes)[number];\n\nexport const MaestroAppServerExternalAgentImportedArtifactSchema = Type.Object({\n\tkind: MaestroAppServerExternalAgentArtifactKindSchema,\n\tstatus: MaestroAppServerExternalAgentImportStatusSchema,\n\tscope: Type.Optional(MaestroAppServerExternalAgentImportScopeSchema),\n\tid: Type.Optional(Type.String()),\n\tpath: Type.Optional(Type.String()),\n\tmessage: Type.Optional(Type.String()),\n});\nexport type MaestroAppServerExternalAgentImportedArtifact = Static<\n\ttypeof MaestroAppServerExternalAgentImportedArtifactSchema\n>;\n\nexport const MaestroAppServerExternalAgentImportResultSchema = Type.Object({\n\tsource: Type.Object({\n\t\tname: Type.String(),\n\t\ttype: Type.Optional(Type.String()),\n\t}),\n\tdryRun: Type.Boolean(),\n\timported: Type.Array(MaestroAppServerExternalAgentImportedArtifactSchema),\n\twarnings: Type.Array(Type.String()),\n});\nexport type MaestroAppServerExternalAgentImportResult = Static<\n\ttypeof MaestroAppServerExternalAgentImportResultSchema\n>;\n\nexport const maestroAppServerPluginBundleScopes = [\n\t\"project\",\n\t\"local\",\n\t\"user\",\n] as const;\nexport const MaestroAppServerPluginBundleScopeSchema = stringLiteralUnion(\n\tmaestroAppServerPluginBundleScopes,\n);\nexport type MaestroAppServerPluginBundleScope =\n\t(typeof maestroAppServerPluginBundleScopes)[number];\n\nexport const MaestroAppServerPluginBundleSchema = Type.Object({\n\tsource: Type.String(),\n\tscope: MaestroAppServerPluginBundleScopeSchema,\n\tconfigPath: Type.String(),\n});\nexport type MaestroAppServerPluginBundle = Static<\n\ttypeof MaestroAppServerPluginBundleSchema\n>;\n\nexport const MaestroAppServerPluginBundleResourcesSchema = Type.Object({\n\textensions: Type.Object({\n\t\tuser: Type.Array(Type.String()),\n\t\tproject: Type.Array(Type.String()),\n\t}),\n\tskills: Type.Object({\n\t\tuser: Type.Array(Type.String()),\n\t\tproject: Type.Array(Type.String()),\n\t}),\n\tprompts: Type.Object({\n\t\tuser: Type.Array(Type.String()),\n\t\tproject: Type.Array(Type.String()),\n\t}),\n\tthemes: Type.Object({\n\t\tuser: Type.Array(Type.String()),\n\t\tproject: Type.Array(Type.String()),\n\t}),\n});\nexport type MaestroAppServerPluginBundleResources = Static<\n\ttypeof MaestroAppServerPluginBundleResourcesSchema\n>;\n\nexport const MaestroAppServerPluginBundleListResultSchema = Type.Object({\n\tbundles: Type.Array(MaestroAppServerPluginBundleSchema),\n\tresources: MaestroAppServerPluginBundleResourcesSchema,\n\terrors: Type.Array(Type.String()),\n});\nexport type MaestroAppServerPluginBundleListResult = Static<\n\ttypeof MaestroAppServerPluginBundleListResultSchema\n>;\n\nexport const MaestroAppServerPluginBundleMutationResultSchema = Type.Object({\n\tsource: Type.String(),\n\tscope: MaestroAppServerPluginBundleScopeSchema,\n\tconfigPath: Type.String(),\n\tchanged: Type.Boolean(),\n\tmessage: Type.String(),\n});\nexport type MaestroAppServerPluginBundleMutationResult = Static<\n\ttypeof MaestroAppServerPluginBundleMutationResultSchema\n>;\n\nexport const maestroAppServerProtocolModeIds = [\n\t\"standard\",\n\t\"review\",\n\t\"realtime\",\n] as const;\nexport const MaestroAppServerProtocolModeIdSchema = stringLiteralUnion(\n\tmaestroAppServerProtocolModeIds,\n);\nexport type MaestroAppServerProtocolModeId =\n\t(typeof maestroAppServerProtocolModeIds)[number];\n\nexport const MaestroAppServerProtocolModeSchema = Type.Object({\n\tid: MaestroAppServerProtocolModeIdSchema,\n\tlabel: Type.String(),\n\treadOnly: Type.Boolean(),\n\trealtime: Type.Boolean(),\n\tallowedMethods: Type.Array(Type.String()),\n\tblockedMethods: Type.Array(Type.String()),\n\tserverNotifications: Type.Array(Type.String()),\n});\nexport type MaestroAppServerProtocolMode = Static<\n\ttypeof MaestroAppServerProtocolModeSchema\n>;\n\nexport const MaestroAppServerProtocolModeListResultSchema = Type.Object({\n\tactiveMode: MaestroAppServerProtocolModeIdSchema,\n\tdefaultMode: MaestroAppServerProtocolModeIdSchema,\n\tmodes: Type.Array(MaestroAppServerProtocolModeSchema),\n});\nexport type MaestroAppServerProtocolModeListResult = Static<\n\ttypeof MaestroAppServerProtocolModeListResultSchema\n>;\n\nexport const MaestroAppServerProtocolModeSetResultSchema = Type.Object({\n\tactiveMode: MaestroAppServerProtocolModeIdSchema,\n\tmode: MaestroAppServerProtocolModeSchema,\n});\nexport type MaestroAppServerProtocolModeSetResult = Static<\n\ttypeof MaestroAppServerProtocolModeSetResultSchema\n>;\n\nexport const maestroAppServerRemoteControlStatuses = [\n\t\"unavailable\",\n\t\"ready\",\n\t\"draining\",\n] as const;\nexport const MaestroAppServerRemoteControlStatusSchema = stringLiteralUnion(\n\tmaestroAppServerRemoteControlStatuses,\n);\nexport type MaestroAppServerRemoteControlStatus =\n\t(typeof maestroAppServerRemoteControlStatuses)[number];\n\nexport const maestroAppServerRemoteControlLeaseStates = [\n\t\"unbound\",\n\t\"bound\",\n\t\"draining\",\n] as const;\nexport const MaestroAppServerRemoteControlLeaseStateSchema = stringLiteralUnion(\n\tmaestroAppServerRemoteControlLeaseStates,\n);\nexport type MaestroAppServerRemoteControlLeaseState =\n\t(typeof maestroAppServerRemoteControlLeaseStates)[number];\n\nexport const MaestroAppServerRemoteControlLeaseSchema = Type.Object({\n\tprotocolVersion: Type.String(),\n\trunnerSessionId: Type.String(),\n\townerInstanceId: Type.Optional(Type.String()),\n\tworkspaceId: Type.Optional(Type.String()),\n\tagentId: Type.Optional(Type.String()),\n\tagentRunId: Type.Optional(Type.String()),\n\tmaestroSessionId: Type.Optional(Type.String()),\n\tconfiguredMaestroSessionId: Type.Optional(Type.String()),\n\tstate: MaestroAppServerRemoteControlLeaseStateSchema,\n\tgeneration: Type.Number(),\n\theartbeatAt: Type.String(),\n\tupdatedAt: Type.String(),\n\tleaseTokenPresent: Type.Boolean(),\n});\nexport type MaestroAppServerRemoteControlLease = Static<\n\ttypeof MaestroAppServerRemoteControlLeaseSchema\n>;\n\nexport const MaestroAppServerRemoteControlLastDrainSchema = Type.Object({\n\tstatus: Type.String(),\n\tmanifestPath: Type.String(),\n\tdrainedAt: Type.String(),\n\treason: Type.Optional(Type.String()),\n\trequestedBy: Type.Optional(Type.String()),\n});\nexport type MaestroAppServerRemoteControlLastDrain = Static<\n\ttypeof MaestroAppServerRemoteControlLastDrainSchema\n>;\n\nexport const MaestroAppServerRemoteControlStatusResultSchema = Type.Object({\n\tavailable: Type.Boolean(),\n\tstatus: MaestroAppServerRemoteControlStatusSchema,\n\trunnerSessionId: Type.Optional(Type.String()),\n\townerInstanceId: Type.Optional(Type.String()),\n\tworkspaceRoot: Type.Optional(Type.String()),\n\tsnapshotRoot: Type.Optional(Type.String()),\n\tworkspaceId: Type.Optional(Type.String()),\n\tagentId: Type.Optional(Type.String()),\n\tagentRunId: Type.Optional(Type.String()),\n\ta2aMessageId: Type.Optional(Type.String()),\n\ta2aTaskId: Type.Optional(Type.String()),\n\tagentRuntimeWorkerQueue: Type.Optional(Type.String()),\n\tagentRuntimeCorrelationPath: Type.Optional(Type.String()),\n\tmaestroSessionId: Type.Optional(Type.String()),\n\tlastDrain: Type.Optional(MaestroAppServerRemoteControlLastDrainSchema),\n\tlease: Type.Union([MaestroAppServerRemoteControlLeaseSchema, Type.Null()]),\n\terror: Type.Optional(Type.String()),\n});\nexport type MaestroAppServerRemoteControlStatusResult = Static<\n\ttypeof MaestroAppServerRemoteControlStatusResultSchema\n>;\n\nexport const MaestroAppServerDaemonProcessSchema = Type.Object({\n\tpid: Type.Number(),\n\tppid: Type.Number(),\n\tplatform: Type.String(),\n\tarch: Type.String(),\n\tnodeVersion: Type.String(),\n\tcwd: Type.String(),\n\tuptimeMs: Type.Number(),\n});\nexport type MaestroAppServerDaemonProcess = Static<\n\ttypeof MaestroAppServerDaemonProcessSchema\n>;\n\nexport const MaestroAppServerDaemonStatusResultSchema = Type.Object({\n\tdaemon: MaestroAppServerDaemonProcessSchema,\n\tremoteControl: MaestroAppServerRemoteControlStatusResultSchema,\n});\nexport type MaestroAppServerDaemonStatusResult = Static<\n\ttypeof MaestroAppServerDaemonStatusResultSchema\n>;\n\nexport const MaestroAppServerRemoteControlLeaseResultSchema = Type.Object({\n\tavailable: Type.Boolean(),\n\tlease: Type.Union([MaestroAppServerRemoteControlLeaseSchema, Type.Null()]),\n});\nexport type MaestroAppServerRemoteControlLeaseResult = Static<\n\ttypeof MaestroAppServerRemoteControlLeaseResultSchema\n>;\n\nexport const MaestroAppServerRemoteControlDrainResultSchema = Type.Object({\n\tdrained: Type.Boolean(),\n\tstatus: Type.String(),\n\trunnerSessionId: Type.String(),\n\treason: Type.Optional(Type.String()),\n\trequestedBy: Type.Optional(Type.String()),\n\tmanifestPath: Type.String(),\n\tmanifest: Type.Unknown(),\n\tremoteControl: MaestroAppServerRemoteControlStatusResultSchema,\n});\nexport type MaestroAppServerRemoteControlDrainResult = Static<\n\ttypeof MaestroAppServerRemoteControlDrainResultSchema\n>;\n\nexport const MaestroAppServerEmptyResultSchema = Type.Object(\n\t{},\n\t{ additionalProperties: false },\n);\nexport type MaestroAppServerEmptyResult = Static<\n\ttypeof MaestroAppServerEmptyResultSchema\n>;\n\nexport const MaestroAppServerCommandExecResultSchema = Type.Object({\n\tstdout: Type.String(),\n\tstderr: Type.String(),\n\texitCode: Type.Number(),\n});\nexport type MaestroAppServerCommandExecResult = Static<\n\ttypeof MaestroAppServerCommandExecResultSchema\n>;\n\nexport const MaestroAppServerCommandProcessResultSchema = Type.Object({\n\tprocessId: Type.String(),\n});\nexport type MaestroAppServerCommandProcessResult = Static<\n\ttypeof MaestroAppServerCommandProcessResultSchema\n>;\n\nexport const MaestroAppServerFsReadFileResultSchema = Type.Object({\n\tdataBase64: Type.String(),\n});\nexport type MaestroAppServerFsReadFileResult = Static<\n\ttypeof MaestroAppServerFsReadFileResultSchema\n>;\n\nexport const MaestroAppServerFsReadDirectoryEntrySchema = Type.Object({\n\tfileName: Type.String(),\n\tisDirectory: Type.Boolean(),\n\tisFile: Type.Boolean(),\n});\nexport type MaestroAppServerFsReadDirectoryEntry = Static<\n\ttypeof MaestroAppServerFsReadDirectoryEntrySchema\n>;\n\nexport const MaestroAppServerFsReadDirectoryResultSchema = Type.Object({\n\tentries: Type.Array(MaestroAppServerFsReadDirectoryEntrySchema),\n});\nexport type MaestroAppServerFsReadDirectoryResult = Static<\n\ttypeof MaestroAppServerFsReadDirectoryResultSchema\n>;\n\nexport const MaestroAppServerFsMetadataResultSchema = Type.Object({\n\tcreatedAtMs: Type.Number(),\n\tmodifiedAtMs: Type.Number(),\n\tisDirectory: Type.Boolean(),\n\tisFile: Type.Boolean(),\n\tisSymlink: Type.Boolean(),\n});\nexport type MaestroAppServerFsMetadataResult = Static<\n\ttypeof MaestroAppServerFsMetadataResultSchema\n>;\n\nexport const MaestroAppServerFsWatchResultSchema = Type.Object({\n\twatchId: Type.String(),\n\tpath: Type.String(),\n});\nexport type MaestroAppServerFsWatchResult = Static<\n\ttypeof MaestroAppServerFsWatchResultSchema\n>;\n\nexport const MaestroAppServerFsChangedNotificationParamsSchema = Type.Object({\n\twatchId: Type.String(),\n\tchangedPaths: Type.Array(Type.String()),\n});\nexport type MaestroAppServerFsChangedNotificationParams = Static<\n\ttypeof MaestroAppServerFsChangedNotificationParamsSchema\n>;\n\nexport const MaestroAppServerThreadStartResultSchema = Type.Object({\n\tthread: MaestroAppServerThreadSummarySchema,\n});\nexport type MaestroAppServerThreadStartResult = Static<\n\ttypeof MaestroAppServerThreadStartResultSchema\n>;\n\nexport const MaestroAppServerThreadForkResultSchema = Type.Object({\n\tthread: MaestroAppServerThreadSummarySchema,\n\tparentThreadId: Type.String(),\n\tforkedFromEntryId: Type.String(),\n});\nexport type MaestroAppServerThreadForkResult = Static<\n\ttypeof MaestroAppServerThreadForkResultSchema\n>;\n\nexport const MaestroAppServerThreadArchiveResultSchema = Type.Object({\n\tthread: MaestroAppServerThreadSummarySchema,\n\tarchived: Type.Boolean(),\n});\nexport type MaestroAppServerThreadArchiveResult = Static<\n\ttypeof MaestroAppServerThreadArchiveResultSchema\n>;\n\nexport const MaestroAppServerThreadDeleteResultSchema = Type.Object({\n\tthreadId: Type.String(),\n\tdeleted: Type.Boolean(),\n});\nexport type MaestroAppServerThreadDeleteResult = Static<\n\ttypeof MaestroAppServerThreadDeleteResultSchema\n>;\n\nexport const MaestroAppServerModelCapabilitiesSchema = Type.Object({\n\tstreaming: Type.Boolean(),\n\ttools: Type.Boolean(),\n\tvision: Type.Boolean(),\n\treasoning: Type.Boolean(),\n\tresponsesApi: Type.Boolean(),\n\tcodexBackend: Type.Boolean(),\n\tlocal: Type.Boolean(),\n});\nexport const MaestroAppServerReasoningEffortSchema = Type.Union([\n\tType.Literal(\"minimal\"),\n\tType.Literal(\"low\"),\n\tType.Literal(\"medium\"),\n\tType.Literal(\"high\"),\n\tType.Literal(\"ultra\"),\n]);\nexport const MaestroAppServerModelSchema = Type.Object({\n\tid: Type.String(),\n\tprovider: Type.String(),\n\tname: Type.String(),\n\tapi: Type.String(),\n\tcontextWindow: Type.Optional(Type.Number()),\n\tmaxTokens: Type.Optional(Type.Number()),\n\tcost: Type.Optional(Type.Record(Type.String(), Type.Number())),\n\tsource: Type.Optional(\n\t\tType.Union([Type.Literal(\"builtin\"), Type.Literal(\"custom\")]),\n\t),\n\tsupportedReasoningEfforts: Type.Optional(\n\t\tType.Array(MaestroAppServerReasoningEffortSchema),\n\t),\n\tdefaultReasoningEffort: Type.Optional(MaestroAppServerReasoningEffortSchema),\n\tcapabilities: MaestroAppServerModelCapabilitiesSchema,\n});\nexport type MaestroAppServerModel = Static<typeof MaestroAppServerModelSchema>;\n\nexport const MaestroAppServerModelListResultSchema = Type.Object({\n\tmodels: Type.Array(MaestroAppServerModelSchema),\n});\nexport type MaestroAppServerModelListResult = Static<\n\ttypeof MaestroAppServerModelListResultSchema\n>;\n\nexport const MaestroAppServerModelProviderCapabilitiesSchema = Type.Object({\n\tid: Type.String(),\n\tname: Type.String(),\n\tapis: Type.Array(Type.String()),\n\tmodelCount: Type.Number(),\n\tcapabilities: MaestroAppServerModelCapabilitiesSchema,\n});\nexport type MaestroAppServerModelProviderCapabilities = Static<\n\ttypeof MaestroAppServerModelProviderCapabilitiesSchema\n>;\n\nexport const MaestroAppServerModelProviderCapabilitiesReadResultSchema =\n\tType.Object({\n\t\tproviders: Type.Array(MaestroAppServerModelProviderCapabilitiesSchema),\n\t});\nexport type MaestroAppServerModelProviderCapabilitiesReadResult = Static<\n\ttypeof MaestroAppServerModelProviderCapabilitiesReadResultSchema\n>;\n\nexport const MaestroAppServerResponseSchema = Type.Object({\n\tjsonrpc: Type.Literal(\"2.0\"),\n\tid: MaestroAppServerJsonRpcResponseIdSchema,\n\tresult: Type.Optional(\n\t\tType.Union([\n\t\t\tMaestroAppServerInitializeResultSchema,\n\t\t\tMaestroAppServerModelListResultSchema,\n\t\t\tMaestroAppServerModelProviderCapabilitiesReadResultSchema,\n\t\t\tMaestroAppServerPolicyReadResultSchema,\n\t\t\tMaestroAppServerPolicyCheckResultSchema,\n\t\t\tMaestroAppServerRequirementsListResultSchema,\n\t\t\tMaestroAppServerNetworkFetchResultSchema,\n\t\t\tMaestroAppServerNetworkAuditListResultSchema,\n\t\t\tMaestroAppServerSandboxProbeResultSchema,\n\t\t\tMaestroAppServerSandboxProofResultSchema,\n\t\t\tMaestroAppServerExternalAgentImportResultSchema,\n\t\t\tMaestroAppServerPluginBundleListResultSchema,\n\t\t\tMaestroAppServerPluginBundleMutationResultSchema,\n\t\t\tMaestroAppServerProtocolModeListResultSchema,\n\t\t\tMaestroAppServerProtocolModeSetResultSchema,\n\t\t\tMaestroAppServerDaemonStatusResultSchema,\n\t\t\tMaestroAppServerRemoteControlStatusResultSchema,\n\t\t\tMaestroAppServerRemoteControlLeaseResultSchema,\n\t\t\tMaestroAppServerRemoteControlDrainResultSchema,\n\t\t\tMaestroAppServerCommandExecResultSchema,\n\t\t\tMaestroAppServerCommandProcessResultSchema,\n\t\t\tMaestroAppServerFsReadFileResultSchema,\n\t\t\tMaestroAppServerFsReadDirectoryResultSchema,\n\t\t\tMaestroAppServerFsMetadataResultSchema,\n\t\t\tMaestroAppServerFsWatchResultSchema,\n\t\t\tMaestroAppServerEmptyResultSchema,\n\t\t\tMaestroAppServerThreadListResultSchema,\n\t\t\tMaestroAppServerThreadReadResultSchema,\n\t\t\tMaestroAppServerThreadMetadataUpdateResultSchema,\n\t\t\tMaestroAppServerThreadGoalResultSchema,\n\t\t\tMaestroAppServerTurnsListResultSchema,\n\t\t\tMaestroAppServerThreadStartResultSchema,\n\t\t\tMaestroAppServerThreadForkResultSchema,\n\t\t\tMaestroAppServerThreadArchiveResultSchema,\n\t\t\tMaestroAppServerThreadDeleteResultSchema,\n\t\t]),\n\t),\n\terror: Type.Optional(\n\t\tType.Object({\n\t\t\tcode: Type.Number(),\n\t\t\tmessage: Type.String(),\n\t\t}),\n\t),\n});\nexport type MaestroAppServerResponse = Static<\n\ttypeof MaestroAppServerResponseSchema\n>;\n\nexport const MaestroAppServerServerNotificationSchema = Type.Object({\n\tjsonrpc: Type.Literal(\"2.0\"),\n\tmethod: stringLiteralUnion(maestroAppServerServerMethods),\n\tparams: Type.Optional(MaestroAppServerFsChangedNotificationParamsSchema),\n});\nexport type MaestroAppServerServerNotification = Static<\n\ttypeof MaestroAppServerServerNotificationSchema\n>;\n"]}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evalops/contracts",
3
- "version": "0.10.23",
3
+ "version": "0.10.24",
4
4
  "description": "Shared Maestro contracts for frontend/backend integration",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evalops/tui",
3
- "version": "0.10.23",
3
+ "version": "0.10.24",
4
4
  "description": "Terminal UI library with differential rendering for Maestro",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,4 +1,4 @@
1
- import type { SupportedOAuthProvider } from "./index.js";
1
+ import type { OAuthLogoutProvider, SupportedOAuthProvider } from "./index.js";
2
2
  import { type OAuthCredentials } from "./storage.js";
3
3
  type ConnectorOAuthProvider = Exclude<SupportedOAuthProvider, "evalops">;
4
4
  export declare const CONNECTOR_SOURCE_OF_TRUTH_AREAS: readonly ["analytics", "billing", "crm", "hris", "support"];
@@ -20,6 +20,6 @@ export declare function syncOAuthProviderConnection(provider: SupportedOAuthProv
20
20
  export declare function syncStoredOAuthProviderConnection(provider: SupportedOAuthProvider): Promise<void>;
21
21
  export declare function configureOAuthProviderSourceOfTruthPolicy(provider: string, input: ConfigureOAuthProviderSourceOfTruthPolicyInput): Promise<ConfiguredOAuthProviderSourceOfTruthPolicy>;
22
22
  export declare function clearOAuthProviderSourceOfTruthPolicy(provider: string): boolean;
23
- export declare function revokeOAuthProviderConnection(provider: SupportedOAuthProvider, credentials: OAuthCredentials | null): Promise<void>;
23
+ export declare function revokeOAuthProviderConnection(provider: OAuthLogoutProvider, credentials: OAuthCredentials | null): Promise<void>;
24
24
  export {};
25
25
  //# sourceMappingURL=connectors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"connectors.d.ts","sourceRoot":"","sources":["../../src/oauth/connectors.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EACN,KAAK,gBAAgB,EAGrB,MAA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gB,GAAG,IAAI,GAClC,OAAO,CAAC,IAAI,CAAC,CAYf"}
@@ -1,7 +1,6 @@
1
1
  import { refreshRemoteConnection, registerRemoteConnection, revokeRemoteConnection, setRemoteSourceOfTruthPolicy, } from "../connectors/service-client.js";
2
2
  import { loadOAuthCredentials, saveOAuthCredentials, } from "./storage.js";
3
3
  const CONNECTOR_PROVIDER_BY_OAUTH_PROVIDER = {
4
- anthropic: "x-evalops:anthropic",
5
4
  "github-copilot": "github",
6
5
  "google-antigravity": "google",
7
6
  "google-gemini-cli": "google",
@@ -9,7 +8,6 @@ const CONNECTOR_PROVIDER_BY_OAUTH_PROVIDER = {
9
8
  "openai-codex": "x-evalops:openai",
10
9
  };
11
10
  const DISPLAY_NAME_BY_OAUTH_PROVIDER = {
12
- anthropic: "Anthropic OAuth",
13
11
  "github-copilot": "GitHub Copilot OAuth",
14
12
  "google-antigravity": "Google Antigravity OAuth",
15
13
  "google-gemini-cli": "Google Gemini CLI OAuth",
@@ -241,13 +239,13 @@ export function clearOAuthProviderSourceOfTruthPolicy(provider) {
241
239
  return hadPolicyMetadata;
242
240
  }
243
241
  export async function revokeOAuthProviderConnection(provider, credentials) {
244
- if (!isConnectorOAuthProvider(provider)) {
245
- return;
246
- }
247
242
  const connectionId = getMetadataString(credentials?.metadata, "connectorConnectionId");
248
243
  if (!connectionId) {
249
244
  return;
250
245
  }
246
+ if (!isConnectorOAuthProvider(provider) && provider !== "anthropic") {
247
+ return;
248
+ }
251
249
  await revokeRemoteConnection(connectionId);
252
250
  }
253
251
  //# sourceMappingURL=connectors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"connectors.js","sourceRoot":"","sources":["../../src/oauth/connectors.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,uBAAuB,EACvB,wBAAwB,EACxB,sBAAsB,EACtB,4BAA4B,GAC5B,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAEN,oBAAoB,EACpB,oBAAoB,GACpB,MAAM,cAAc,CAAC;AAItB,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C,EAAE,CAAC;QACzC,MAAM,IAAI,KAAK,CACd,yCAAyC,QAAQ,0BAA0B,gCAAgC,EAAE,EAAE,CAC/G,CAAC;IACH,CAAC;IACD,MAAM,WAAW,GAAG,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IACnD,IAAI,CAAC,WAAW,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,kCAAkC,QAAQ,EAAE,CAAC,CAAC;IAC/D,CAAC;IAED,MAAM,QAAQ,GAA4B,EAAE,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC;IACtE,MAAM,iBAAiB,GAAG,6BAA6B,CAAC,IAAI,CAC3D,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,IAAI,QAAQ,CACxB,CAAC;IACF,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACxB,OAAO,KAAK,CAAC;IACd,CAAC;IACD,KAAK,MAAM,GAAG,IAAI,6BAA6B,EAAE,CAAC;QACjD,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;IACtB,CAAC;IACD,oBAAoB,CAAC,QAAQ,EAAE,EAAE,GAAG,WAAW,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC7D,OAAO,iBAAiB,CAAC;AAC1B,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,6BAA6B,CAClD,QAAgC,EAChC,WAAoC;IAEpC,IAAI,CAAC,wBAAwB,CAAC,QAAQ,CAAC,EAAE,CAAC;QACzC,OAAO;IACR,CAAC;IACD,MAAM,YAAY,GAAG,iBAAiB,CACrC,WAAW,EAAE,QAAQ,EACrB,uBAAuB,CACvB,CAAC;IACF,IAAI,CAAC,YAAY,EAAE,CAAC;QACnB,OAAO;IACR,CAAC;IACD,MAAM,sBAAsB,CAAC,YAAY,CAAC,CAAC;AAC5C,CAAC","sourcesContent":["import {\n\ttype RemoteConnectorConnection,\n\ttype RemoteSourceOfTruthPolicy,\n\trefreshRemoteConnection,\n\tregisterRemoteConnection,\n\trevokeRemoteConnection,\n\tsetRemoteSourceOfTruthPolicy,\n} from \"../connectors/service-client.js\";\nimport type { SupportedOAuthProvider } from \"./index.js\";\nimport {\n\ttype OAuthCredentials,\n\tloadOAuthCredentials,\n\tsaveOAuthCredentials,\n} from \"./storage.js\";\n\ntype ConnectorOAuthProvider = Exclude<SupportedOAuthProvider, \"evalops\">;\n\nconst CONNECTOR_PROVIDER_BY_OAUTH_PROVIDER: Record<\n\tConnectorOAuthProvider,\n\tstring\n> = {\n\tanthropic: \"x-evalops:anthropic\",\n\t\"github-copilot\": \"github\",\n\t\"google-antigravity\": \"google\",\n\t\"google-gemini-cli\": \"google\",\n\topenai: \"x-evalops:openai\",\n\t\"openai-codex\": \"x-evalops:openai\",\n};\n\nconst DISPLAY_NAME_BY_OAUTH_PROVIDER: Record<ConnectorOAuthProvider, string> = {\n\tanthropic: \"Anthropic OAuth\",\n\t\"github-copilot\": \"GitHub Copilot OAuth\",\n\t\"google-antigravity\": \"Google Antigravity OAuth\",\n\t\"google-gemini-cli\": \"Google Gemini CLI OAuth\",\n\topenai: \"OpenAI OAuth\",\n\t\"openai-codex\": \"OpenAI Codex OAuth\",\n};\n\nexport const CONNECTOR_SOURCE_OF_TRUTH_AREAS = [\n\t\"analytics\",\n\t\"billing\",\n\t\"crm\",\n\t\"hris\",\n\t\"support\",\n] as const;\n\nexport type ConnectorSourceOfTruthArea =\n\t(typeof CONNECTOR_SOURCE_OF_TRUTH_AREAS)[number];\n\nexport interface ConfigureOAuthProviderSourceOfTruthPolicyInput {\n\tarea: string;\n\tfallbackConnectionId?: string;\n}\n\nexport interface ConfiguredOAuthProviderSourceOfTruthPolicy {\n\tprovider: ConnectorOAuthProvider;\n\tarea: ConnectorSourceOfTruthArea;\n\tfallbackConnectionId?: string;\n\tconnectorConnectionId?: string;\n\tprimaryConnectionId?: string;\n\tworkspaceId?: string;\n}\n\nconst SOURCE_OF_TRUTH_METADATA_KEYS = [\n\t\"connectorSourceOfTruthArea\",\n\t\"connectorSourceOfTruthFallbackConnectionId\",\n\t\"connectorSourceOfTruthPrimaryConnectionId\",\n\t\"connectorSourceOfTruthWorkspaceId\",\n\t\"sourceOfTruthArea\",\n\t\"sourceOfTruthFallbackConnectionId\",\n] as const;\n\nfunction isConnectorOAuthProvider(\n\tprovider: string,\n): provider is ConnectorOAuthProvider {\n\treturn Object.prototype.hasOwnProperty.call(\n\t\tCONNECTOR_PROVIDER_BY_OAUTH_PROVIDER,\n\t\tprovider,\n\t);\n}\n\nfunction supportedConnectorOAuthProviders(): string {\n\treturn Object.keys(CONNECTOR_PROVIDER_BY_OAUTH_PROVIDER).sort().join(\", \");\n}\n\nfunction trimString(value: string | undefined): string | undefined {\n\tconst trimmed = value?.trim();\n\treturn trimmed ? trimmed : undefined;\n}\n\nexport function normalizeConnectorSourceOfTruthArea(\n\tarea: string,\n): ConnectorSourceOfTruthArea | null {\n\tconst normalized = area\n\t\t.trim()\n\t\t.toLowerCase()\n\t\t.replace(/^source_of_truth_area_/u, \"\")\n\t\t.replace(/^source-of-truth-area-/u, \"\")\n\t\t.replaceAll(\"_\", \"-\");\n\tfor (const candidate of CONNECTOR_SOURCE_OF_TRUTH_AREAS) {\n\t\tif (\n\t\t\tcandidate === normalized ||\n\t\t\tcandidate.replaceAll(\"_\", \"-\") === normalized\n\t\t) {\n\t\t\treturn candidate;\n\t\t}\n\t}\n\treturn null;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction getMetadataString(\n\tmetadata: Record<string, unknown> | undefined,\n\tkey: string,\n): string | undefined {\n\tconst value = metadata?.[key];\n\treturn typeof value === \"string\" && value.trim().length > 0\n\t\t? value.trim()\n\t\t: undefined;\n}\n\nfunction getMetadataStringArray(\n\tmetadata: Record<string, unknown> | undefined,\n\tkey: string,\n): string[] | undefined {\n\tconst value = metadata?.[key];\n\tif (!Array.isArray(value)) {\n\t\treturn undefined;\n\t}\n\tconst entries = value\n\t\t.filter((entry): entry is string => typeof entry === \"string\")\n\t\t.map((entry) => entry.trim())\n\t\t.filter((entry) => entry.length > 0);\n\treturn entries.length > 0 ? entries : undefined;\n}\n\nfunction getMetadataStringMap(\n\tmetadata: Record<string, unknown> | undefined,\n\tkey: string,\n): Record<string, string> | undefined {\n\tconst value = metadata?.[key];\n\tif (!isRecord(value)) {\n\t\treturn undefined;\n\t}\n\tconst entries = Object.entries(value)\n\t\t.map(\n\t\t\t([entryKey, entryValue]) =>\n\t\t\t\t[\n\t\t\t\t\tentryKey.trim(),\n\t\t\t\t\ttypeof entryValue === \"string\" ? entryValue.trim() : \"\",\n\t\t\t\t] as const,\n\t\t)\n\t\t.filter(([entryKey, entryValue]) => entryKey && entryValue);\n\treturn entries.length > 0 ? Object.fromEntries(entries) : undefined;\n}\n\nfunction mergeConnectionMetadata(\n\tcredentials: OAuthCredentials,\n\tconnection: RemoteConnectorConnection | null,\n\tproviderId: string,\n): OAuthCredentials {\n\tif (!connection) {\n\t\treturn credentials;\n\t}\n\treturn {\n\t\t...credentials,\n\t\tmetadata: {\n\t\t\t...credentials.metadata,\n\t\t\tconnectorConnectionId: connection.id,\n\t\t\tconnectorHealthStatus: connection.healthStatus,\n\t\t\tconnectorProviderId: connection.providerId || providerId,\n\t\t\tconnectorUpdatedAt: connection.updatedAt,\n\t\t\tconnectorWorkspaceId: connection.workspaceId,\n\t\t},\n\t};\n}\n\nfunction getSourceOfTruthArea(\n\tmetadata: Record<string, unknown> | undefined,\n): string | undefined {\n\treturn (\n\t\tgetMetadataString(metadata, \"connectorSourceOfTruthArea\") ??\n\t\tgetMetadataString(metadata, \"sourceOfTruthArea\")\n\t);\n}\n\nfunction getSourceOfTruthFallbackConnectionId(\n\tmetadata: Record<string, unknown> | undefined,\n): string | undefined {\n\treturn (\n\t\tgetMetadataString(metadata, \"connectorSourceOfTruthFallbackConnectionId\") ??\n\t\tgetMetadataString(metadata, \"sourceOfTruthFallbackConnectionId\")\n\t);\n}\n\nfunction mergeSourceOfTruthPolicyMetadata(\n\tcredentials: OAuthCredentials,\n\tpolicy: RemoteSourceOfTruthPolicy | null,\n): OAuthCredentials {\n\tif (!policy) {\n\t\treturn credentials;\n\t}\n\treturn {\n\t\t...credentials,\n\t\tmetadata: {\n\t\t\t...credentials.metadata,\n\t\t\tconnectorSourceOfTruthArea: policy.area,\n\t\t\tconnectorSourceOfTruthPrimaryConnectionId: policy.primaryConnectionId,\n\t\t\tconnectorSourceOfTruthWorkspaceId: policy.workspaceId,\n\t\t\t...(policy.fallbackConnectionId\n\t\t\t\t? {\n\t\t\t\t\t\tconnectorSourceOfTruthFallbackConnectionId:\n\t\t\t\t\t\t\tpolicy.fallbackConnectionId,\n\t\t\t\t\t}\n\t\t\t\t: {}),\n\t\t},\n\t};\n}\n\nasync function syncSourceOfTruthPolicy(\n\tcredentials: OAuthCredentials,\n\tconnection: RemoteConnectorConnection | null,\n): Promise<OAuthCredentials> {\n\tif (!connection) {\n\t\treturn credentials;\n\t}\n\tconst area = getSourceOfTruthArea(credentials.metadata);\n\tif (!area) {\n\t\treturn credentials;\n\t}\n\n\tconst policy = await setRemoteSourceOfTruthPolicy({\n\t\tworkspaceId: connection.workspaceId,\n\t\tarea,\n\t\tprimaryConnectionId: connection.id,\n\t\tfallbackConnectionId: getSourceOfTruthFallbackConnectionId(\n\t\t\tcredentials.metadata,\n\t\t),\n\t});\n\treturn mergeSourceOfTruthPolicyMetadata(credentials, policy);\n}\n\nexport async function syncOAuthProviderConnection(\n\tprovider: SupportedOAuthProvider,\n\tcredentials: OAuthCredentials,\n): Promise<OAuthCredentials> {\n\tif (!isConnectorOAuthProvider(provider)) {\n\t\treturn credentials;\n\t}\n\n\tconst providerId = CONNECTOR_PROVIDER_BY_OAUTH_PROVIDER[provider];\n\tconst connectionId = getMetadataString(\n\t\tcredentials.metadata,\n\t\t\"connectorConnectionId\",\n\t);\n\tif (connectionId) {\n\t\tconst connection = await refreshRemoteConnection(connectionId);\n\t\treturn syncSourceOfTruthPolicy(\n\t\t\tmergeConnectionMetadata(credentials, connection, providerId),\n\t\t\tconnection,\n\t\t);\n\t}\n\n\tconst connection = await registerRemoteConnection({\n\t\tproviderId,\n\t\tdisplayName: DISPLAY_NAME_BY_OAUTH_PROVIDER[provider],\n\t\tauthType: \"AUTH_TYPE_OAUTH2\",\n\t\tscopes: getMetadataStringArray(credentials.metadata, \"scopes\"),\n\t\tcredentials: getMetadataStringMap(\n\t\t\tcredentials.metadata,\n\t\t\t\"connectorCredentialRefs\",\n\t\t),\n\t});\n\treturn syncSourceOfTruthPolicy(\n\t\tmergeConnectionMetadata(credentials, connection, providerId),\n\t\tconnection,\n\t);\n}\n\nexport async function syncStoredOAuthProviderConnection(\n\tprovider: SupportedOAuthProvider,\n): Promise<void> {\n\tif (!isConnectorOAuthProvider(provider)) {\n\t\treturn;\n\t}\n\tconst credentials = loadOAuthCredentials(provider);\n\tif (!credentials) {\n\t\treturn;\n\t}\n\tconst synced = await syncOAuthProviderConnection(provider, credentials);\n\tif (synced !== credentials) {\n\t\tsaveOAuthCredentials(provider, synced);\n\t}\n}\n\nexport async function configureOAuthProviderSourceOfTruthPolicy(\n\tprovider: string,\n\tinput: ConfigureOAuthProviderSourceOfTruthPolicyInput,\n): Promise<ConfiguredOAuthProviderSourceOfTruthPolicy> {\n\tif (!isConnectorOAuthProvider(provider)) {\n\t\tthrow new Error(\n\t\t\t`Unsupported OAuth connector provider: ${provider}. Supported providers: ${supportedConnectorOAuthProviders()}`,\n\t\t);\n\t}\n\tconst credentials = loadOAuthCredentials(provider);\n\tif (!credentials) {\n\t\tthrow new Error(`No OAuth credentials found for ${provider}`);\n\t}\n\tconst area = normalizeConnectorSourceOfTruthArea(input.area);\n\tif (!area) {\n\t\tthrow new Error(\n\t\t\t`Unsupported source-of-truth area: ${input.area}. Valid areas: ${CONNECTOR_SOURCE_OF_TRUTH_AREAS.join(\", \")}`,\n\t\t);\n\t}\n\n\tconst metadata: Record<string, unknown> = { ...credentials.metadata };\n\tmetadata.connectorSourceOfTruthArea = area;\n\tdelete metadata.sourceOfTruthArea;\n\tdelete metadata.sourceOfTruthFallbackConnectionId;\n\tdelete metadata.connectorSourceOfTruthPrimaryConnectionId;\n\tdelete metadata.connectorSourceOfTruthWorkspaceId;\n\n\tconst fallbackConnectionId = trimString(input.fallbackConnectionId);\n\tif (fallbackConnectionId) {\n\t\tmetadata.connectorSourceOfTruthFallbackConnectionId = fallbackConnectionId;\n\t} else {\n\t\tdelete metadata.connectorSourceOfTruthFallbackConnectionId;\n\t}\n\n\tsaveOAuthCredentials(provider, { ...credentials, metadata });\n\tawait syncStoredOAuthProviderConnection(provider);\n\n\tconst synced = loadOAuthCredentials(provider) ?? { ...credentials, metadata };\n\tconst syncedMetadata = synced.metadata ?? {};\n\tconst connectorConnectionId = getMetadataString(\n\t\tsyncedMetadata,\n\t\t\"connectorConnectionId\",\n\t);\n\tconst primaryConnectionId = getMetadataString(\n\t\tsyncedMetadata,\n\t\t\"connectorSourceOfTruthPrimaryConnectionId\",\n\t);\n\tconst workspaceId = getMetadataString(\n\t\tsyncedMetadata,\n\t\t\"connectorSourceOfTruthWorkspaceId\",\n\t);\n\treturn {\n\t\tprovider,\n\t\tarea,\n\t\t...(fallbackConnectionId ? { fallbackConnectionId } : {}),\n\t\t...(connectorConnectionId ? { connectorConnectionId } : {}),\n\t\t...(primaryConnectionId ? { primaryConnectionId } : {}),\n\t\t...(workspaceId ? { workspaceId } : {}),\n\t};\n}\n\nexport function clearOAuthProviderSourceOfTruthPolicy(\n\tprovider: string,\n): boolean {\n\tif (!isConnectorOAuthProvider(provider)) {\n\t\tthrow new Error(\n\t\t\t`Unsupported OAuth connector provider: ${provider}. Supported providers: ${supportedConnectorOAuthProviders()}`,\n\t\t);\n\t}\n\tconst credentials = loadOAuthCredentials(provider);\n\tif (!credentials) {\n\t\tthrow new Error(`No OAuth credentials found for ${provider}`);\n\t}\n\n\tconst metadata: Record<string, unknown> = { ...credentials.metadata };\n\tconst hadPolicyMetadata = SOURCE_OF_TRUTH_METADATA_KEYS.some(\n\t\t(key) => key in metadata,\n\t);\n\tif (!hadPolicyMetadata) {\n\t\treturn false;\n\t}\n\tfor (const key of SOURCE_OF_TRUTH_METADATA_KEYS) {\n\t\tdelete metadata[key];\n\t}\n\tsaveOAuthCredentials(provider, { ...credentials, metadata });\n\treturn hadPolicyMetadata;\n}\n\nexport async function revokeOAuthProviderConnection(\n\tprovider: SupportedOAuthProvider,\n\tcredentials: OAuthCredentials | null,\n): Promise<void> {\n\tif (!isConnectorOAuthProvider(provider)) {\n\t\treturn;\n\t}\n\tconst connectionId = getMetadataString(\n\t\tcredentials?.metadata,\n\t\t\"connectorConnectionId\",\n\t);\n\tif (!connectionId) {\n\t\treturn;\n\t}\n\tawait revokeRemoteConnection(connectionId);\n}\n"]}
1
+ {"version":3,"file":"connectors.js","sourceRoot":"","sources":["../../src/oauth/connectors.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,uBAAuB,EACvB,wBAAwB,EACxB,sBAAsB,EACtB,4BAA4B,GAC5B,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAEN,oBAAoB,EACpB,oBAAoB,GACpB,MAAM,cAAc,CAAC;AAItB,MAAM,oCAAoC,GAGtC;IACH,gBAAgB,EAAE,QAAQ;IAC1B,oBAAoB,EAAE,QAAQ;IAC9B,mBAAmB,EAAE,QAAQ;IAC7B,MAAM,EAAE,kBAAkB;IAC1B,cAAc,EAAE,kBAAkB;CAClC,CAAC;AAEF,MAAM,8BAA8B,GAA2C;IAC9E,gBAAgB,EAAE,sBAAsB;IACxC,oBAAoB,EAAE,0BAA0B;IAChD,mBAAmB,EAAE,yBAAyB;IAC9C,MAAM,EAAE,cAAc;IACtB,cAAc,EAAE,oBAAoB;CACpC,CAAC;AAEF,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC9C,WAAW;IACX,SAAS;IACT,KAAK;IACL,MAAM;IACN,SAAS;CACA,CAAC;AAmBX,MAAM,6BAA6B,GAAG;IACrC,4BAA4B;IAC5B,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AAI,6BAA6B,EAAE,CAAC;QACjD,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;IACtB,CAAC;IACD,oBAAoB,CAAC,QAAQ,EAAE,EAAE,GAAG,WAAW,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC7D,OAAO,iBAAiB,CAAC;AAC1B,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,6BAA6B,CAClD,QAA6B,EAC7B,WAAoC;IAEpC,MAAM,YAAY,GAAG,iBAAiB,CACrC,WAAW,EAAE,QAAQ,EACrB,uBAAuB,CACvB,CAAC;IACF,IAAI,CAAC,YAAY,EAAE,CAAC;QACnB,OAAO;IACR,CAAC;IACD,IAAI,CAAC,wBAAwB,CAAC,QAAQ,CAAC,IAAI,QAAQ,KAAK,WAAW,EAAE,CAAC;QACrE,OAAO;IACR,CAAC;IACD,MAAM,sBAAsB,CAAC,YAAY,CAAC,CAAC;AAC5C,CAAC","sourcesContent":["import {\n\ttype RemoteConnectorConnection,\n\ttype RemoteSourceOfTruthPolicy,\n\trefreshRemoteConnection,\n\tregisterRemoteConnection,\n\trevokeRemoteConnection,\n\tsetRemoteSourceOfTruthPolicy,\n} from \"../connectors/service-client.js\";\nimport type { OAuthLogoutProvider, SupportedOAuthProvider } from \"./index.js\";\nimport {\n\ttype OAuthCredentials,\n\tloadOAuthCredentials,\n\tsaveOAuthCredentials,\n} from \"./storage.js\";\n\ntype ConnectorOAuthProvider = Exclude<SupportedOAuthProvider, \"evalops\">;\n\nconst CONNECTOR_PROVIDER_BY_OAUTH_PROVIDER: Record<\n\tConnectorOAuthProvider,\n\tstring\n> = {\n\t\"github-copilot\": \"github\",\n\t\"google-antigravity\": \"google\",\n\t\"google-gemini-cli\": \"google\",\n\topenai: \"x-evalops:openai\",\n\t\"openai-codex\": \"x-evalops:openai\",\n};\n\nconst DISPLAY_NAME_BY_OAUTH_PROVIDER: Record<ConnectorOAuthProvider, string> = {\n\t\"github-copilot\": \"GitHub Copilot OAuth\",\n\t\"google-antigravity\": \"Google Antigravity OAuth\",\n\t\"google-gemini-cli\": \"Google Gemini CLI OAuth\",\n\topenai: \"OpenAI OAuth\",\n\t\"openai-codex\": \"OpenAI Codex OAuth\",\n};\n\nexport const CONNECTOR_SOURCE_OF_TRUTH_AREAS = [\n\t\"analytics\",\n\t\"billing\",\n\t\"crm\",\n\t\"hris\",\n\t\"support\",\n] as const;\n\nexport type ConnectorSourceOfTruthArea =\n\t(typeof CONNECTOR_SOURCE_OF_TRUTH_AREAS)[number];\n\nexport interface ConfigureOAuthProviderSourceOfTruthPolicyInput {\n\tarea: string;\n\tfallbackConnectionId?: string;\n}\n\nexport interface ConfiguredOAuthProviderSourceOfTruthPolicy {\n\tprovider: ConnectorOAuthProvider;\n\tarea: ConnectorSourceOfTruthArea;\n\tfallbackConnectionId?: string;\n\tconnectorConnectionId?: string;\n\tprimaryConnectionId?: string;\n\tworkspaceId?: string;\n}\n\nconst SOURCE_OF_TRUTH_METADATA_KEYS = [\n\t\"connectorSourceOfTruthArea\",\n\t\"connectorSourceOfTruthFallbackConnectionId\",\n\t\"connectorSourceOfTruthPrimaryConnectionId\",\n\t\"connectorSourceOfTruthWorkspaceId\",\n\t\"sourceOfTruthArea\",\n\t\"sourceOfTruthFallbackConnectionId\",\n] as const;\n\nfunction isConnectorOAuthProvider(\n\tprovider: string,\n): provider is ConnectorOAuthProvider {\n\treturn Object.prototype.hasOwnProperty.call(\n\t\tCONNECTOR_PROVIDER_BY_OAUTH_PROVIDER,\n\t\tprovider,\n\t);\n}\n\nfunction supportedConnectorOAuthProviders(): string {\n\treturn Object.keys(CONNECTOR_PROVIDER_BY_OAUTH_PROVIDER).sort().join(\", \");\n}\n\nfunction trimString(value: string | undefined): string | undefined {\n\tconst trimmed = value?.trim();\n\treturn trimmed ? trimmed : undefined;\n}\n\nexport function normalizeConnectorSourceOfTruthArea(\n\tarea: string,\n): ConnectorSourceOfTruthArea | null {\n\tconst normalized = area\n\t\t.trim()\n\t\t.toLowerCase()\n\t\t.replace(/^source_of_truth_area_/u, \"\")\n\t\t.replace(/^source-of-truth-area-/u, \"\")\n\t\t.replaceAll(\"_\", \"-\");\n\tfor (const candidate of CONNECTOR_SOURCE_OF_TRUTH_AREAS) {\n\t\tif (\n\t\t\tcandidate === normalized ||\n\t\t\tcandidate.replaceAll(\"_\", \"-\") === normalized\n\t\t) {\n\t\t\treturn candidate;\n\t\t}\n\t}\n\treturn null;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction getMetadataString(\n\tmetadata: Record<string, unknown> | undefined,\n\tkey: string,\n): string | undefined {\n\tconst value = metadata?.[key];\n\treturn typeof value === \"string\" && value.trim().length > 0\n\t\t? value.trim()\n\t\t: undefined;\n}\n\nfunction getMetadataStringArray(\n\tmetadata: Record<string, unknown> | undefined,\n\tkey: string,\n): string[] | undefined {\n\tconst value = metadata?.[key];\n\tif (!Array.isArray(value)) {\n\t\treturn undefined;\n\t}\n\tconst entries = value\n\t\t.filter((entry): entry is string => typeof entry === \"string\")\n\t\t.map((entry) => entry.trim())\n\t\t.filter((entry) => entry.length > 0);\n\treturn entries.length > 0 ? entries : undefined;\n}\n\nfunction getMetadataStringMap(\n\tmetadata: Record<string, unknown> | undefined,\n\tkey: string,\n): Record<string, string> | undefined {\n\tconst value = metadata?.[key];\n\tif (!isRecord(value)) {\n\t\treturn undefined;\n\t}\n\tconst entries = Object.entries(value)\n\t\t.map(\n\t\t\t([entryKey, entryValue]) =>\n\t\t\t\t[\n\t\t\t\t\tentryKey.trim(),\n\t\t\t\t\ttypeof entryValue === \"string\" ? entryValue.trim() : \"\",\n\t\t\t\t] as const,\n\t\t)\n\t\t.filter(([entryKey, entryValue]) => entryKey && entryValue);\n\treturn entries.length > 0 ? Object.fromEntries(entries) : undefined;\n}\n\nfunction mergeConnectionMetadata(\n\tcredentials: OAuthCredentials,\n\tconnection: RemoteConnectorConnection | null,\n\tproviderId: string,\n): OAuthCredentials {\n\tif (!connection) {\n\t\treturn credentials;\n\t}\n\treturn {\n\t\t...credentials,\n\t\tmetadata: {\n\t\t\t...credentials.metadata,\n\t\t\tconnectorConnectionId: connection.id,\n\t\t\tconnectorHealthStatus: connection.healthStatus,\n\t\t\tconnectorProviderId: connection.providerId || providerId,\n\t\t\tconnectorUpdatedAt: connection.updatedAt,\n\t\t\tconnectorWorkspaceId: connection.workspaceId,\n\t\t},\n\t};\n}\n\nfunction getSourceOfTruthArea(\n\tmetadata: Record<string, unknown> | undefined,\n): string | undefined {\n\treturn (\n\t\tgetMetadataString(metadata, \"connectorSourceOfTruthArea\") ??\n\t\tgetMetadataString(metadata, \"sourceOfTruthArea\")\n\t);\n}\n\nfunction getSourceOfTruthFallbackConnectionId(\n\tmetadata: Record<string, unknown> | undefined,\n): string | undefined {\n\treturn (\n\t\tgetMetadataString(metadata, \"connectorSourceOfTruthFallbackConnectionId\") ??\n\t\tgetMetadataString(metadata, \"sourceOfTruthFallbackConnectionId\")\n\t);\n}\n\nfunction mergeSourceOfTruthPolicyMetadata(\n\tcredentials: OAuthCredentials,\n\tpolicy: RemoteSourceOfTruthPolicy | null,\n): OAuthCredentials {\n\tif (!policy) {\n\t\treturn credentials;\n\t}\n\treturn {\n\t\t...credentials,\n\t\tmetadata: {\n\t\t\t...credentials.metadata,\n\t\t\tconnectorSourceOfTruthArea: policy.area,\n\t\t\tconnectorSourceOfTruthPrimaryConnectionId: policy.primaryConnectionId,\n\t\t\tconnectorSourceOfTruthWorkspaceId: policy.workspaceId,\n\t\t\t...(policy.fallbackConnectionId\n\t\t\t\t? {\n\t\t\t\t\t\tconnectorSourceOfTruthFallbackConnectionId:\n\t\t\t\t\t\t\tpolicy.fallbackConnectionId,\n\t\t\t\t\t}\n\t\t\t\t: {}),\n\t\t},\n\t};\n}\n\nasync function syncSourceOfTruthPolicy(\n\tcredentials: OAuthCredentials,\n\tconnection: RemoteConnectorConnection | null,\n): Promise<OAuthCredentials> {\n\tif (!connection) {\n\t\treturn credentials;\n\t}\n\tconst area = getSourceOfTruthArea(credentials.metadata);\n\tif (!area) {\n\t\treturn credentials;\n\t}\n\n\tconst policy = await setRemoteSourceOfTruthPolicy({\n\t\tworkspaceId: connection.workspaceId,\n\t\tarea,\n\t\tprimaryConnectionId: connection.id,\n\t\tfallbackConnectionId: getSourceOfTruthFallbackConnectionId(\n\t\t\tcredentials.metadata,\n\t\t),\n\t});\n\treturn mergeSourceOfTruthPolicyMetadata(credentials, policy);\n}\n\nexport async function syncOAuthProviderConnection(\n\tprovider: SupportedOAuthProvider,\n\tcredentials: OAuthCredentials,\n): Promise<OAuthCredentials> {\n\tif (!isConnectorOAuthProvider(provider)) {\n\t\treturn credentials;\n\t}\n\n\tconst providerId = CONNECTOR_PROVIDER_BY_OAUTH_PROVIDER[provider];\n\tconst connectionId = getMetadataString(\n\t\tcredentials.metadata,\n\t\t\"connectorConnectionId\",\n\t);\n\tif (connectionId) {\n\t\tconst connection = await refreshRemoteConnection(connectionId);\n\t\treturn syncSourceOfTruthPolicy(\n\t\t\tmergeConnectionMetadata(credentials, connection, providerId),\n\t\t\tconnection,\n\t\t);\n\t}\n\n\tconst connection = await registerRemoteConnection({\n\t\tproviderId,\n\t\tdisplayName: DISPLAY_NAME_BY_OAUTH_PROVIDER[provider],\n\t\tauthType: \"AUTH_TYPE_OAUTH2\",\n\t\tscopes: getMetadataStringArray(credentials.metadata, \"scopes\"),\n\t\tcredentials: getMetadataStringMap(\n\t\t\tcredentials.metadata,\n\t\t\t\"connectorCredentialRefs\",\n\t\t),\n\t});\n\treturn syncSourceOfTruthPolicy(\n\t\tmergeConnectionMetadata(credentials, connection, providerId),\n\t\tconnection,\n\t);\n}\n\nexport async function syncStoredOAuthProviderConnection(\n\tprovider: SupportedOAuthProvider,\n): Promise<void> {\n\tif (!isConnectorOAuthProvider(provider)) {\n\t\treturn;\n\t}\n\tconst credentials = loadOAuthCredentials(provider);\n\tif (!credentials) {\n\t\treturn;\n\t}\n\tconst synced = await syncOAuthProviderConnection(provider, credentials);\n\tif (synced !== credentials) {\n\t\tsaveOAuthCredentials(provider, synced);\n\t}\n}\n\nexport async function configureOAuthProviderSourceOfTruthPolicy(\n\tprovider: string,\n\tinput: ConfigureOAuthProviderSourceOfTruthPolicyInput,\n): Promise<ConfiguredOAuthProviderSourceOfTruthPolicy> {\n\tif (!isConnectorOAuthProvider(provider)) {\n\t\tthrow new Error(\n\t\t\t`Unsupported OAuth connector provider: ${provider}. Supported providers: ${supportedConnectorOAuthProviders()}`,\n\t\t);\n\t}\n\tconst credentials = loadOAuthCredentials(provider);\n\tif (!credentials) {\n\t\tthrow new Error(`No OAuth credentials found for ${provider}`);\n\t}\n\tconst area = normalizeConnectorSourceOfTruthArea(input.area);\n\tif (!area) {\n\t\tthrow new Error(\n\t\t\t`Unsupported source-of-truth area: ${input.area}. Valid areas: ${CONNECTOR_SOURCE_OF_TRUTH_AREAS.join(\", \")}`,\n\t\t);\n\t}\n\n\tconst metadata: Record<string, unknown> = { ...credentials.metadata };\n\tmetadata.connectorSourceOfTruthArea = area;\n\tdelete metadata.sourceOfTruthArea;\n\tdelete metadata.sourceOfTruthFallbackConnectionId;\n\tdelete metadata.connectorSourceOfTruthPrimaryConnectionId;\n\tdelete metadata.connectorSourceOfTruthWorkspaceId;\n\n\tconst fallbackConnectionId = trimString(input.fallbackConnectionId);\n\tif (fallbackConnectionId) {\n\t\tmetadata.connectorSourceOfTruthFallbackConnectionId = fallbackConnectionId;\n\t} else {\n\t\tdelete metadata.connectorSourceOfTruthFallbackConnectionId;\n\t}\n\n\tsaveOAuthCredentials(provider, { ...credentials, metadata });\n\tawait syncStoredOAuthProviderConnection(provider);\n\n\tconst synced = loadOAuthCredentials(provider) ?? { ...credentials, metadata };\n\tconst syncedMetadata = synced.metadata ?? {};\n\tconst connectorConnectionId = getMetadataString(\n\t\tsyncedMetadata,\n\t\t\"connectorConnectionId\",\n\t);\n\tconst primaryConnectionId = getMetadataString(\n\t\tsyncedMetadata,\n\t\t\"connectorSourceOfTruthPrimaryConnectionId\",\n\t);\n\tconst workspaceId = getMetadataString(\n\t\tsyncedMetadata,\n\t\t\"connectorSourceOfTruthWorkspaceId\",\n\t);\n\treturn {\n\t\tprovider,\n\t\tarea,\n\t\t...(fallbackConnectionId ? { fallbackConnectionId } : {}),\n\t\t...(connectorConnectionId ? { connectorConnectionId } : {}),\n\t\t...(primaryConnectionId ? { primaryConnectionId } : {}),\n\t\t...(workspaceId ? { workspaceId } : {}),\n\t};\n}\n\nexport function clearOAuthProviderSourceOfTruthPolicy(\n\tprovider: string,\n): boolean {\n\tif (!isConnectorOAuthProvider(provider)) {\n\t\tthrow new Error(\n\t\t\t`Unsupported OAuth connector provider: ${provider}. Supported providers: ${supportedConnectorOAuthProviders()}`,\n\t\t);\n\t}\n\tconst credentials = loadOAuthCredentials(provider);\n\tif (!credentials) {\n\t\tthrow new Error(`No OAuth credentials found for ${provider}`);\n\t}\n\n\tconst metadata: Record<string, unknown> = { ...credentials.metadata };\n\tconst hadPolicyMetadata = SOURCE_OF_TRUTH_METADATA_KEYS.some(\n\t\t(key) => key in metadata,\n\t);\n\tif (!hadPolicyMetadata) {\n\t\treturn false;\n\t}\n\tfor (const key of SOURCE_OF_TRUTH_METADATA_KEYS) {\n\t\tdelete metadata[key];\n\t}\n\tsaveOAuthCredentials(provider, { ...credentials, metadata });\n\treturn hadPolicyMetadata;\n}\n\nexport async function revokeOAuthProviderConnection(\n\tprovider: OAuthLogoutProvider,\n\tcredentials: OAuthCredentials | null,\n): Promise<void> {\n\tconst connectionId = getMetadataString(\n\t\tcredentials?.metadata,\n\t\t\"connectorConnectionId\",\n\t);\n\tif (!connectionId) {\n\t\treturn;\n\t}\n\tif (!isConnectorOAuthProvider(provider) && provider !== \"anthropic\") {\n\t\treturn;\n\t}\n\tawait revokeRemoteConnection(connectionId);\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * GitHub Copilot OAuth integration for Composer.
2
+ * GitHub Copilot OAuth integration for Maestro.
3
3
  *
4
4
  * Uses GitHub's OAuth Device Flow for authentication, which is suitable
5
5
  * for CLI applications where users authenticate in a browser.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * GitHub Copilot OAuth integration for Composer.
2
+ * GitHub Copilot OAuth integration for Maestro.
3
3
  *
4
4
  * Uses GitHub's OAuth Device Flow for authentication, which is suitable
5
5
  * for CLI applications where users authenticate in a browser.
@@ -1 +1 @@
1
- {"version":3,"file":"github-copilot.js","sourceRoot":"","sources":["../../src/oauth/github-copilot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAEN,oBAAoB,EACpB,oBAAoB,GACpB,MAAM,cAAc,CAAC;AAEtB,MAAM,MAAM,GAAG,YAAY,CAAC,sBAAsB,CAAC,CAAC;AAEpD,0DAA0D;AAC1D,MAAM,gBAAgB,GAAG,sBAAsB,CAAC;AAEhD,mDAAmD;AACnD,MAAM,iBAAiB,GAAG,sBAAsB,CAAC;AAEjD,yBAAyB;AACzB,MAAM,eAAe,GAAG,sCAAsC,CAAC;AAC/D,MAAM,gBAAgB,GAAG,6CAA6C,CAAC;AACvE,MAAM,iBAAiB,GAAG,kDAAkD,CAAC;AAE7E,oCAAoC;AACpC,MAAM,aAAa,GAAG,SAAS,CAAC;AA8BhC;;GAEG;AACH,SAAS,oBAAoB,CAAC,IAA6B;IAC1D,OAAO;QACN,IAAI,EAAE,OAAO;QACb,MAAM,EAAE,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,WAAW;QAC7C,OAAO,EAAE,IAAI,CAAC,WAAW,EAAE,wCAAwC;QACnE,OAAO,EAAE,IAAI,CAAC,mBAAmB,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,kBAAkB;QACxF,QAAQ,EAAE;YACT,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB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ACX;KACD,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,2BAA2B;IAC1C,OAAO,oBAAoB,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;AACxD,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,+BAA+B;IACpD,mEAAmE;IACnE,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;IAE1E,IAAI,QAAQ,IAAI,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,EAAE,CAAC;QACzD,gDAAgD;QAChD,MAAM,YAAY,GAAG,MAAM,eAAe,CAAC,QAAQ,CAAC,CAAC;QAErD,IAAI,YAAY,EAAE,CAAC;YAClB,MAAM,UAAU,GAA4B;gBAC3C,WAAW,EAAE,QAAQ;gBACrB,YAAY,EAAE,YAAY,CAAC,KAAK;gBAChC,mBAAmB,EAAE,YAAY,CAAC,UAAU,GAAG,IAAI;gBACnD,KAAK,EAAE,aAAa;aACpB,CAAC;YAEF,oBAAoB,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,UAAU,CAAC,CAAC,CAAC;YACzE,MAAM,CAAC,IAAI,CACV,6DAA6D,CAC7D,CAAC;YACF,OAAO,IAAI,CAAC;QACb,CAAC;IACF,CAAC;IAED,OAAO,KAAK,CAAC;AACd,CAAC","sourcesContent":["/**\n * GitHub Copilot OAuth integration for Composer.\n *\n * Uses GitHub's OAuth Device Flow for authentication, which is suitable\n * for CLI applications where users authenticate in a browser.\n *\n * Flow:\n * 1. Request device code from GitHub\n * 2. Display user code and URL to user\n * 3. Poll for access token while user authorizes\n * 4. Exchange for Copilot API token\n */\n\nimport { createLogger } from \"../utils/logger.js\";\nimport {\n\ttype OAuthCredentials,\n\tloadOAuthCredentials,\n\tsaveOAuthCredentials,\n} from \"./storage.js\";\n\nconst logger = createLogger(\"oauth:github-copilot\");\n\n// GitHub CLI OAuth App client ID (public, used by gh CLI)\nconst GITHUB_CLIENT_ID = \"Iv1.b507a08c87ecfe98\";\n\n// Copilot-specific client ID (used by Copilot CLI)\nconst COPILOT_CLIENT_ID = \"Iv1.b507a08c87ecfe98\";\n\n// GitHub OAuth endpoints\nconst DEVICE_CODE_URL = \"https://github.com/login/device/code\";\nconst ACCESS_TOKEN_URL = \"https://github.com/login/oauth/access_token\";\nconst COPILOT_TOKEN_URL = \"https://api.github.com/copilot_internal/v2/token\";\n\n// Required scope for Copilot access\nconst COPILOT_SCOPE = \"copilot\";\n\ninterface DeviceCodeResponse {\n\tdevice_code: string;\n\tuser_code: string;\n\tverification_uri: string;\n\texpires_in: number;\n\tinterval: number;\n}\n\ninterface AccessTokenResponse {\n\taccess_token?: string;\n\ttoken_type?: string;\n\tscope?: string;\n\terror?: string;\n\terror_description?: string;\n}\n\ninterface CopilotTokenResponse {\n\ttoken: string;\n\texpires_at: number;\n}\n\nexport interface GitHubCopilotCredential {\n\taccessToken: string;\n\tcopilotToken?: string;\n\tcopilotTokenExpires?: number;\n\tscope: string;\n}\n\n/**\n * Convert GitHub Copilot credentials to generic OAuth credentials.\n */\nfunction toGenericCredentials(cred: GitHubCopilotCredential): OAuthCredentials {\n\treturn {\n\t\ttype: \"oauth\",\n\t\taccess: cred.copilotToken ?? cred.accessToken,\n\t\trefresh: cred.accessToken, // Use GitHub token as refresh mechanism\n\t\texpires: cred.copilotTokenExpires ?? Date.now() + 8 * 60 * 60 * 1000, // 8 hours default\n\t\tmetadata: {\n\t\t\tscope: cred.scope,\n\t\t\tgithubToken: cred.accessToken,\n\t\t},\n\t};\n}\n\n/**\n * Request a device code from GitHub.\n */\nasync function requestDeviceCode(): Promise<DeviceCodeResponse> {\n\tconst response = await fetch(DEVICE_CODE_URL, {\n\t\tmethod: \"POST\",\n\t\theaders: {\n\t\t\tAccept: \"application/json\",\n\t\t\t\"Content-Type\": \"application/x-www-form-urlencoded\",\n\t\t},\n\t\tbody: new URLSearchParams({\n\t\t\tclient_id: COPILOT_CLIENT_ID,\n\t\t\tscope: COPILOT_SCOPE,\n\t\t}).toString(),\n\t});\n\n\tif (!response.ok) {\n\t\tthrow new Error(`Failed to request device code: ${response.status}`);\n\t}\n\n\tconst data = (await response.json()) as DeviceCodeResponse;\n\n\tif (!data.device_code || !data.user_code) {\n\t\tthrow new Error(\"Invalid device code response\");\n\t}\n\n\treturn data;\n}\n\n/**\n * Poll for access token after user authorization.\n */\nasync function pollForAccessToken(\n\tdeviceCode: string,\n\tinterval: number,\n\texpiresIn: number,\n): Promise<string> {\n\tconst startTime = Date.now();\n\tconst expiresAt = startTime + expiresIn * 1000;\n\tlet currentInterval = interval * 1000;\n\n\twhile (Date.now() < expiresAt) {\n\t\tawait new Promise((resolve) => setTimeout(resolve, currentInterval));\n\n\t\tconst response = await fetch(ACCESS_TOKEN_URL, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: {\n\t\t\t\tAccept: \"application/json\",\n\t\t\t\t\"Content-Type\": \"application/x-www-form-urlencoded\",\n\t\t\t},\n\t\t\tbody: new URLSearchParams({\n\t\t\t\tclient_id: COPILOT_CLIENT_ID,\n\t\t\t\tdevice_code: deviceCode,\n\t\t\t\tgrant_type: \"urn:ietf:params:oauth:grant-type:device_code\",\n\t\t\t}).toString(),\n\t\t});\n\n\t\tif (!response.ok) {\n\t\t\tthrow new Error(`Token request failed: ${response.status}`);\n\t\t}\n\n\t\tconst data = (await response.json()) as AccessTokenResponse;\n\n\t\tif (data.access_token) {\n\t\t\treturn data.access_token;\n\t\t}\n\n\t\tif (data.error === \"authorization_pending\") {\n\t\t\t// User hasn't authorized yet, keep polling\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (data.error === \"slow_down\") {\n\t\t\t// Increase polling interval\n\t\t\tcurrentInterval += 5000;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (data.error === \"expired_token\") {\n\t\t\tthrow new Error(\"Device code expired. Please try again.\");\n\t\t}\n\n\t\tif (data.error === \"access_denied\") {\n\t\t\tthrow new Error(\"Authorization denied by user.\");\n\t\t}\n\n\t\tif (data.error) {\n\t\t\tthrow new Error(\n\t\t\t\t`OAuth error: ${data.error} - ${data.error_description ?? \"\"}`,\n\t\t\t);\n\t\t}\n\t}\n\n\tthrow new Error(\"Device code expired. Please try again.\");\n}\n\n/**\n * Exchange GitHub token for Copilot API token.\n */\nasync function getCopilotToken(\n\tgithubToken: string,\n): Promise<CopilotTokenResponse | null> {\n\ttry {\n\t\tconst response = await fetch(COPILOT_TOKEN_URL, {\n\t\t\tmethod: \"GET\",\n\t\t\theaders: {\n\t\t\t\tAuthorization: `token ${githubToken}`,\n\t\t\t\tAccept: \"application/json\",\n\t\t\t\t\"Editor-Version\": \"Maestro/1.0.0\",\n\t\t\t\t\"Editor-Plugin-Version\": \"copilot/1.0.0\",\n\t\t\t},\n\t\t});\n\n\t\tif (!response.ok) {\n\t\t\tlogger.warn(\"Failed to get Copilot token\", {\n\t\t\t\tstatus: response.status,\n\t\t\t});\n\t\t\treturn null;\n\t\t}\n\n\t\tconst data = (await response.json()) as CopilotTokenResponse;\n\t\treturn data;\n\t} catch (error) {\n\t\tlogger.warn(\"Error getting Copilot token\", {\n\t\t\terror: error instanceof Error ? error.message : String(error),\n\t\t});\n\t\treturn null;\n\t}\n}\n\n/**\n * Start the OAuth login flow for GitHub Copilot.\n *\n * Uses the device flow: displays a code for the user to enter\n * at github.com/login/device, then polls for the access token.\n */\nexport async function loginGitHubCopilot(\n\tonDeviceCode: (code: string, verificationUri: string) => void,\n\tonStatus?: (status: string) => void,\n): Promise<void> {\n\tonStatus?.(\"Requesting device code...\");\n\n\t// Request device code\n\tconst deviceCode = await requestDeviceCode();\n\n\t// Display code to user\n\tonDeviceCode(deviceCode.user_code, deviceCode.verification_uri);\n\n\tonStatus?.(\"Waiting for authorization...\");\n\n\t// Poll for access token\n\tconst accessToken = await pollForAccessToken(\n\t\tdeviceCode.device_code,\n\t\tdeviceCode.interval,\n\t\tdeviceCode.expires_in,\n\t);\n\n\tonStatus?.(\"Getting Copilot token...\");\n\n\t// Try to get Copilot-specific token\n\tconst copilotToken = await getCopilotToken(accessToken);\n\n\tconst credential: GitHubCopilotCredential = {\n\t\taccessToken,\n\t\tcopilotToken: copilotToken?.token,\n\t\tcopilotTokenExpires: copilotToken?.expires_at\n\t\t\t? copilotToken.expires_at * 1000\n\t\t\t: undefined,\n\t\tscope: COPILOT_SCOPE,\n\t};\n\n\t// Save credentials\n\tconst genericCreds = toGenericCredentials(credential);\n\tsaveOAuthCredentials(\"github-copilot\", genericCreds);\n\n\tlogger.info(\"GitHub Copilot OAuth login successful\");\n}\n\n/**\n * Refresh GitHub Copilot token.\n *\n * The GitHub token itself doesn't expire, but the Copilot token does.\n * We use the stored GitHub token to get a fresh Copilot token.\n */\nexport async function refreshGitHubCopilotToken(\n\t_refreshToken: string,\n\tmetadata?: Record<string, unknown>,\n): Promise<OAuthCredentials> {\n\tconst githubToken = (metadata?.githubToken as string) ?? _refreshToken;\n\n\t// Get fresh Copilot token\n\tconst copilotToken = await getCopilotToken(githubToken);\n\n\tif (!copilotToken) {\n\t\tthrow new Error(\n\t\t\t\"Failed to refresh Copilot token. Please login again with /login github-copilot\",\n\t\t);\n\t}\n\n\treturn {\n\t\ttype: \"oauth\",\n\t\taccess: copilotToken.token,\n\t\trefresh: githubToken,\n\t\texpires: copilotToken.expires_at * 1000,\n\t\tmetadata: {\n\t\t\t...(metadata ?? {}),\n\t\t\tscope: COPILOT_SCOPE,\n\t\t\tgithubToken,\n\t\t},\n\t};\n}\n\n/**\n * Check if user has valid GitHub Copilot credentials.\n */\nexport function hasGitHubCopilotCredentials(): boolean {\n\treturn loadOAuthCredentials(\"github-copilot\") !== null;\n}\n\n/**\n * Migrate old GitHub Copilot credentials (if any).\n * Currently no migration needed as this is a new feature.\n */\nexport async function migrateGitHubCopilotCredentials(): Promise<boolean> {\n\t// Check for COPILOT_GITHUB_TOKEN or GH_TOKEN environment variables\n\tconst envToken = process.env.COPILOT_GITHUB_TOKEN ?? process.env.GH_TOKEN;\n\n\tif (envToken && !loadOAuthCredentials(\"github-copilot\")) {\n\t\t// Try to convert env token to stored credential\n\t\tconst copilotToken = await getCopilotToken(envToken);\n\n\t\tif (copilotToken) {\n\t\t\tconst credential: GitHubCopilotCredential = {\n\t\t\t\taccessToken: envToken,\n\t\t\t\tcopilotToken: copilotToken.token,\n\t\t\t\tcopilotTokenExpires: copilotToken.expires_at * 1000,\n\t\t\t\tscope: COPILOT_SCOPE,\n\t\t\t};\n\n\t\t\tsaveOAuthCredentials(\"github-copilot\", toGenericCredentials(credential));\n\t\t\tlogger.info(\n\t\t\t\t\"Migrated GitHub token from environment to OAuth credentials\",\n\t\t\t);\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n"]}
1
+ {"version":3,"file":"github-copilot.js","sourceRoot":"","sources":["../../src/oauth/github-copilot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAEN,oBAAoB,EACpB,oBAAoB,GACpB,MAAM,cAAc,CAAC;AAEtB,MAAM,MAAM,GAAG,YAAY,CAAC,sBAAsB,CAAC,CAAC;AAEpD,0DAA0D;AAC1D,MAAM,gBAAgB,GAAG,sBAAsB,CAAC;AAEhD,mDAAmD;AACnD,MAAM,iBAAiB,GAAG,sBAAsB,CAAC;AAEjD,yBAAyB;AACzB,MAAM,eAAe,GAAG,sCAAsC,CAAC;AAC/D,MAAM,gBAAgB,GAAG,6CAA6C,CAAC;AACvE,MAAM,iBAAiB,GAAG,kDAAkD,CAAC;AAE7E,oCAAoC;AACpC,MAAM,aAAa,GAAG,SAAS,CAAC;AA8BhC;;GAEG;AACH,SAAS,oBAAoB,CAAC,IAA6B;IAC1D,OAAO;QACN,IAAI,EAAE,OAAO;QACb,MAAM,EAAE,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,WAAW;QAC7C,OAAO,EAAE,IAAI,CAAC,WAAW,E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,MAAM,EAAE,YAAY,CAAC,KAAK;QAC1B,OAAO,EAAE,WAAW;QACpB,OAAO,EAAE,YAAY,CAAC,UAAU,GAAG,IAAI;QACvC,QAAQ,EAAE;YACT,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC;YACnB,KAAK,EAAE,aAAa;YACpB,WAAW;SACX;KACD,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,2BAA2B;IAC1C,OAAO,oBAAoB,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;AACxD,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,+BAA+B;IACpD,mEAAmE;IACnE,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;IAE1E,IAAI,QAAQ,IAAI,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,EAAE,CAAC;QACzD,gDAAgD;QAChD,MAAM,YAAY,GAAG,MAAM,eAAe,CAAC,QAAQ,CAAC,CAAC;QAErD,IAAI,YAAY,EAAE,CAAC;YAClB,MAAM,UAAU,GAA4B;gBAC3C,WAAW,EAAE,QAAQ;gBACrB,YAAY,EAAE,YAAY,CAAC,KAAK;gBAChC,mBAAmB,EAAE,YAAY,CAAC,UAAU,GAAG,IAAI;gBACnD,KAAK,EAAE,aAAa;aACpB,CAAC;YAEF,oBAAoB,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,UAAU,CAAC,CAAC,CAAC;YACzE,MAAM,CAAC,IAAI,CACV,6DAA6D,CAC7D,CAAC;YACF,OAAO,IAAI,CAAC;QACb,CAAC;IACF,CAAC;IAED,OAAO,KAAK,CAAC;AACd,CAAC","sourcesContent":["/**\n * GitHub Copilot OAuth integration for Maestro.\n *\n * Uses GitHub's OAuth Device Flow for authentication, which is suitable\n * for CLI applications where users authenticate in a browser.\n *\n * Flow:\n * 1. Request device code from GitHub\n * 2. Display user code and URL to user\n * 3. Poll for access token while user authorizes\n * 4. Exchange for Copilot API token\n */\n\nimport { createLogger } from \"../utils/logger.js\";\nimport {\n\ttype OAuthCredentials,\n\tloadOAuthCredentials,\n\tsaveOAuthCredentials,\n} from \"./storage.js\";\n\nconst logger = createLogger(\"oauth:github-copilot\");\n\n// GitHub CLI OAuth App client ID (public, used by gh CLI)\nconst GITHUB_CLIENT_ID = \"Iv1.b507a08c87ecfe98\";\n\n// Copilot-specific client ID (used by Copilot CLI)\nconst COPILOT_CLIENT_ID = \"Iv1.b507a08c87ecfe98\";\n\n// GitHub OAuth endpoints\nconst DEVICE_CODE_URL = \"https://github.com/login/device/code\";\nconst ACCESS_TOKEN_URL = \"https://github.com/login/oauth/access_token\";\nconst COPILOT_TOKEN_URL = \"https://api.github.com/copilot_internal/v2/token\";\n\n// Required scope for Copilot access\nconst COPILOT_SCOPE = \"copilot\";\n\ninterface DeviceCodeResponse {\n\tdevice_code: string;\n\tuser_code: string;\n\tverification_uri: string;\n\texpires_in: number;\n\tinterval: number;\n}\n\ninterface AccessTokenResponse {\n\taccess_token?: string;\n\ttoken_type?: string;\n\tscope?: string;\n\terror?: string;\n\terror_description?: string;\n}\n\ninterface CopilotTokenResponse {\n\ttoken: string;\n\texpires_at: number;\n}\n\nexport interface GitHubCopilotCredential {\n\taccessToken: string;\n\tcopilotToken?: string;\n\tcopilotTokenExpires?: number;\n\tscope: string;\n}\n\n/**\n * Convert GitHub Copilot credentials to generic OAuth credentials.\n */\nfunction toGenericCredentials(cred: GitHubCopilotCredential): OAuthCredentials {\n\treturn {\n\t\ttype: \"oauth\",\n\t\taccess: cred.copilotToken ?? cred.accessToken,\n\t\trefresh: cred.accessToken, // Use GitHub token as refresh mechanism\n\t\texpires: cred.copilotTokenExpires ?? Date.now() + 8 * 60 * 60 * 1000, // 8 hours default\n\t\tmetadata: {\n\t\t\tscope: cred.scope,\n\t\t\tgithubToken: cred.accessToken,\n\t\t},\n\t};\n}\n\n/**\n * Request a device code from GitHub.\n */\nasync function requestDeviceCode(): Promise<DeviceCodeResponse> {\n\tconst response = await fetch(DEVICE_CODE_URL, {\n\t\tmethod: \"POST\",\n\t\theaders: {\n\t\t\tAccept: \"application/json\",\n\t\t\t\"Content-Type\": \"application/x-www-form-urlencoded\",\n\t\t},\n\t\tbody: new URLSearchParams({\n\t\t\tclient_id: COPILOT_CLIENT_ID,\n\t\t\tscope: COPILOT_SCOPE,\n\t\t}).toString(),\n\t});\n\n\tif (!response.ok) {\n\t\tthrow new Error(`Failed to request device code: ${response.status}`);\n\t}\n\n\tconst data = (await response.json()) as DeviceCodeResponse;\n\n\tif (!data.device_code || !data.user_code) {\n\t\tthrow new Error(\"Invalid device code response\");\n\t}\n\n\treturn data;\n}\n\n/**\n * Poll for access token after user authorization.\n */\nasync function pollForAccessToken(\n\tdeviceCode: string,\n\tinterval: number,\n\texpiresIn: number,\n): Promise<string> {\n\tconst startTime = Date.now();\n\tconst expiresAt = startTime + expiresIn * 1000;\n\tlet currentInterval = interval * 1000;\n\n\twhile (Date.now() < expiresAt) {\n\t\tawait new Promise((resolve) => setTimeout(resolve, currentInterval));\n\n\t\tconst response = await fetch(ACCESS_TOKEN_URL, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: {\n\t\t\t\tAccept: \"application/json\",\n\t\t\t\t\"Content-Type\": \"application/x-www-form-urlencoded\",\n\t\t\t},\n\t\t\tbody: new URLSearchParams({\n\t\t\t\tclient_id: COPILOT_CLIENT_ID,\n\t\t\t\tdevice_code: deviceCode,\n\t\t\t\tgrant_type: \"urn:ietf:params:oauth:grant-type:device_code\",\n\t\t\t}).toString(),\n\t\t});\n\n\t\tif (!response.ok) {\n\t\t\tthrow new Error(`Token request failed: ${response.status}`);\n\t\t}\n\n\t\tconst data = (await response.json()) as AccessTokenResponse;\n\n\t\tif (data.access_token) {\n\t\t\treturn data.access_token;\n\t\t}\n\n\t\tif (data.error === \"authorization_pending\") {\n\t\t\t// User hasn't authorized yet, keep polling\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (data.error === \"slow_down\") {\n\t\t\t// Increase polling interval\n\t\t\tcurrentInterval += 5000;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (data.error === \"expired_token\") {\n\t\t\tthrow new Error(\"Device code expired. Please try again.\");\n\t\t}\n\n\t\tif (data.error === \"access_denied\") {\n\t\t\tthrow new Error(\"Authorization denied by user.\");\n\t\t}\n\n\t\tif (data.error) {\n\t\t\tthrow new Error(\n\t\t\t\t`OAuth error: ${data.error} - ${data.error_description ?? \"\"}`,\n\t\t\t);\n\t\t}\n\t}\n\n\tthrow new Error(\"Device code expired. Please try again.\");\n}\n\n/**\n * Exchange GitHub token for Copilot API token.\n */\nasync function getCopilotToken(\n\tgithubToken: string,\n): Promise<CopilotTokenResponse | null> {\n\ttry {\n\t\tconst response = await fetch(COPILOT_TOKEN_URL, {\n\t\t\tmethod: \"GET\",\n\t\t\theaders: {\n\t\t\t\tAuthorization: `token ${githubToken}`,\n\t\t\t\tAccept: \"application/json\",\n\t\t\t\t\"Editor-Version\": \"Maestro/1.0.0\",\n\t\t\t\t\"Editor-Plugin-Version\": \"copilot/1.0.0\",\n\t\t\t},\n\t\t});\n\n\t\tif (!response.ok) {\n\t\t\tlogger.warn(\"Failed to get Copilot token\", {\n\t\t\t\tstatus: response.status,\n\t\t\t});\n\t\t\treturn null;\n\t\t}\n\n\t\tconst data = (await response.json()) as CopilotTokenResponse;\n\t\treturn data;\n\t} catch (error) {\n\t\tlogger.warn(\"Error getting Copilot token\", {\n\t\t\terror: error instanceof Error ? error.message : String(error),\n\t\t});\n\t\treturn null;\n\t}\n}\n\n/**\n * Start the OAuth login flow for GitHub Copilot.\n *\n * Uses the device flow: displays a code for the user to enter\n * at github.com/login/device, then polls for the access token.\n */\nexport async function loginGitHubCopilot(\n\tonDeviceCode: (code: string, verificationUri: string) => void,\n\tonStatus?: (status: string) => void,\n): Promise<void> {\n\tonStatus?.(\"Requesting device code...\");\n\n\t// Request device code\n\tconst deviceCode = await requestDeviceCode();\n\n\t// Display code to user\n\tonDeviceCode(deviceCode.user_code, deviceCode.verification_uri);\n\n\tonStatus?.(\"Waiting for authorization...\");\n\n\t// Poll for access token\n\tconst accessToken = await pollForAccessToken(\n\t\tdeviceCode.device_code,\n\t\tdeviceCode.interval,\n\t\tdeviceCode.expires_in,\n\t);\n\n\tonStatus?.(\"Getting Copilot token...\");\n\n\t// Try to get Copilot-specific token\n\tconst copilotToken = await getCopilotToken(accessToken);\n\n\tconst credential: GitHubCopilotCredential = {\n\t\taccessToken,\n\t\tcopilotToken: copilotToken?.token,\n\t\tcopilotTokenExpires: copilotToken?.expires_at\n\t\t\t? copilotToken.expires_at * 1000\n\t\t\t: undefined,\n\t\tscope: COPILOT_SCOPE,\n\t};\n\n\t// Save credentials\n\tconst genericCreds = toGenericCredentials(credential);\n\tsaveOAuthCredentials(\"github-copilot\", genericCreds);\n\n\tlogger.info(\"GitHub Copilot OAuth login successful\");\n}\n\n/**\n * Refresh GitHub Copilot token.\n *\n * The GitHub token itself doesn't expire, but the Copilot token does.\n * We use the stored GitHub token to get a fresh Copilot token.\n */\nexport async function refreshGitHubCopilotToken(\n\t_refreshToken: string,\n\tmetadata?: Record<string, unknown>,\n): Promise<OAuthCredentials> {\n\tconst githubToken = (metadata?.githubToken as string) ?? _refreshToken;\n\n\t// Get fresh Copilot token\n\tconst copilotToken = await getCopilotToken(githubToken);\n\n\tif (!copilotToken) {\n\t\tthrow new Error(\n\t\t\t\"Failed to refresh Copilot token. Please login again with /login github-copilot\",\n\t\t);\n\t}\n\n\treturn {\n\t\ttype: \"oauth\",\n\t\taccess: copilotToken.token,\n\t\trefresh: githubToken,\n\t\texpires: copilotToken.expires_at * 1000,\n\t\tmetadata: {\n\t\t\t...(metadata ?? {}),\n\t\t\tscope: COPILOT_SCOPE,\n\t\t\tgithubToken,\n\t\t},\n\t};\n}\n\n/**\n * Check if user has valid GitHub Copilot credentials.\n */\nexport function hasGitHubCopilotCredentials(): boolean {\n\treturn loadOAuthCredentials(\"github-copilot\") !== null;\n}\n\n/**\n * Migrate old GitHub Copilot credentials (if any).\n * Currently no migration needed as this is a new feature.\n */\nexport async function migrateGitHubCopilotCredentials(): Promise<boolean> {\n\t// Check for COPILOT_GITHUB_TOKEN or GH_TOKEN environment variables\n\tconst envToken = process.env.COPILOT_GITHUB_TOKEN ?? process.env.GH_TOKEN;\n\n\tif (envToken && !loadOAuthCredentials(\"github-copilot\")) {\n\t\t// Try to convert env token to stored credential\n\t\tconst copilotToken = await getCopilotToken(envToken);\n\n\t\tif (copilotToken) {\n\t\t\tconst credential: GitHubCopilotCredential = {\n\t\t\t\taccessToken: envToken,\n\t\t\t\tcopilotToken: copilotToken.token,\n\t\t\t\tcopilotTokenExpires: copilotToken.expires_at * 1000,\n\t\t\t\tscope: COPILOT_SCOPE,\n\t\t\t};\n\n\t\t\tsaveOAuthCredentials(\"github-copilot\", toGenericCredentials(credential));\n\t\t\tlogger.info(\n\t\t\t\t\"Migrated GitHub token from environment to OAuth credentials\",\n\t\t\t);\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n"]}
@@ -1,12 +1,11 @@
1
- import type { AnthropicLoginMode } from "../providers/anthropic-auth.js";
2
1
  import { buildEvalOpsDelegationEnvironment, issueEvalOpsDelegationToken } from "./evalops.js";
3
- import { listOAuthProviders as listOAuthProvidersFromStorage } from "./storage.js";
4
- export { listOAuthProvidersFromStorage as listOAuthProviders };
5
2
  export type { OAuthCredentials } from "./storage.js";
6
3
  export { buildEvalOpsDelegationEnvironment, issueEvalOpsDelegationToken };
7
- export type SupportedOAuthProvider = "anthropic" | "evalops" | "openai" | "openai-codex" | "github-copilot" | "google-gemini-cli" | "google-antigravity";
8
- export interface OAuthProviderInfo {
9
- id: SupportedOAuthProvider;
4
+ export type SupportedOAuthProvider = "evalops" | "openai" | "openai-codex" | "github-copilot" | "google-gemini-cli" | "google-antigravity";
5
+ export type LegacyLogoutOnlyOAuthProvider = "anthropic";
6
+ export type OAuthLogoutProvider = SupportedOAuthProvider | LegacyLogoutOnlyOAuthProvider;
7
+ export interface OAuthProviderInfo<TProvider extends string = SupportedOAuthProvider> {
8
+ id: TProvider;
10
9
  name: string;
11
10
  description: string;
12
11
  available: boolean;
@@ -15,6 +14,9 @@ export interface OAuthProviderInfo {
15
14
  * Get list of OAuth providers
16
15
  */
17
16
  export declare function getOAuthProviders(): OAuthProviderInfo[];
17
+ export declare function listOAuthProviders(): SupportedOAuthProvider[];
18
+ export declare function listOAuthLogoutProviders(): OAuthLogoutProvider[];
19
+ export declare function getOAuthLogoutProviders(): OAuthProviderInfo<OAuthLogoutProvider>[];
18
20
  /**
19
21
  * Check if a provider has OAuth credentials stored
20
22
  */
@@ -23,7 +25,7 @@ export declare function hasOAuthCredentials(provider: SupportedOAuthProvider): b
23
25
  * Login with OAuth provider
24
26
  */
25
27
  export declare function login(provider: SupportedOAuthProvider, options: {
26
- mode?: AnthropicLoginMode;
28
+ mode?: string;
27
29
  onAuthUrl: (url: string) => void;
28
30
  onPromptCode?: () => Promise<string>;
29
31
  onStatus?: (status: string) => void;
@@ -32,7 +34,7 @@ export declare function login(provider: SupportedOAuthProvider, options: {
32
34
  /**
33
35
  * Logout from OAuth provider
34
36
  */
35
- export declare function logout(provider: SupportedOAuthProvider): Promise<void>;
37
+ export declare function logout(provider: OAuthLogoutProvider): Promise<void>;
36
38
  /**
37
39
  * Refresh OAuth token for provider
38
40
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/oauth/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAgBzE,OAAO,EACN,iCAAiC,EACjC,2BAA2B,EAI3B,MAAM,cAAc,CAAC;AAoBtB,OAAO,EAEN,kBAAkB,IAAI,6BAA6B,EAInD,MAAM,cAAc,CAAC;AAKtB,OAAO,EAAE,6BAA6B,IAAI,kBAAkB,EAAE,CAAC;AAC/D,YAAY,EAAE,gBAAgB,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