@ekanos/cli 0.13.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/README.md +25 -8
  2. package/dist/agents-api.d.ts +11 -2
  3. package/dist/agents-api.js +39 -3
  4. package/dist/agents-api.js.map +1 -1
  5. package/dist/apps-api.js +2 -2
  6. package/dist/apps-api.js.map +1 -1
  7. package/dist/auth/ekanos-api.d.ts +16 -2
  8. package/dist/auth/ekanos-api.js +101 -15
  9. package/dist/auth/ekanos-api.js.map +1 -1
  10. package/dist/auth/host-trust.d.ts +46 -0
  11. package/dist/auth/host-trust.js +79 -0
  12. package/dist/auth/host-trust.js.map +1 -0
  13. package/dist/auth/session.d.ts +10 -1
  14. package/dist/auth/session.js +28 -28
  15. package/dist/auth/session.js.map +1 -1
  16. package/dist/commands/agents-edit.d.ts +6 -2
  17. package/dist/commands/agents-edit.js +57 -26
  18. package/dist/commands/agents-edit.js.map +1 -1
  19. package/dist/commands/agents.d.ts +13 -2
  20. package/dist/commands/agents.js +140 -35
  21. package/dist/commands/agents.js.map +1 -1
  22. package/dist/commands/apps.d.ts +2 -0
  23. package/dist/commands/apps.js +16 -12
  24. package/dist/commands/apps.js.map +1 -1
  25. package/dist/commands/catalog.js +7 -6
  26. package/dist/commands/catalog.js.map +1 -1
  27. package/dist/commands/knowledge.d.ts +19 -0
  28. package/dist/commands/knowledge.js +119 -27
  29. package/dist/commands/knowledge.js.map +1 -1
  30. package/dist/commands/login.d.ts +4 -0
  31. package/dist/commands/login.js +30 -2
  32. package/dist/commands/login.js.map +1 -1
  33. package/dist/commands/logout.d.ts +9 -1
  34. package/dist/commands/logout.js +56 -7
  35. package/dist/commands/logout.js.map +1 -1
  36. package/dist/commands/publish.js +3 -3
  37. package/dist/commands/publish.js.map +1 -1
  38. package/dist/commands/reviewers.d.ts +2 -0
  39. package/dist/commands/reviewers.js +7 -3
  40. package/dist/commands/reviewers.js.map +1 -1
  41. package/dist/commands/routes.d.ts +2 -0
  42. package/dist/commands/routes.js +42 -9
  43. package/dist/commands/routes.js.map +1 -1
  44. package/dist/commands/runs.d.ts +13 -2
  45. package/dist/commands/runs.js +99 -16
  46. package/dist/commands/runs.js.map +1 -1
  47. package/dist/commands/scope-notice.d.ts +21 -0
  48. package/dist/commands/scope-notice.js +35 -0
  49. package/dist/commands/scope-notice.js.map +1 -0
  50. package/dist/commands/skills.d.ts +7 -1
  51. package/dist/commands/skills.js +80 -24
  52. package/dist/commands/skills.js.map +1 -1
  53. package/dist/commands/sources.d.ts +1 -1
  54. package/dist/commands/sources.js +126 -12
  55. package/dist/commands/sources.js.map +1 -1
  56. package/dist/commands/status.js +5 -4
  57. package/dist/commands/status.js.map +1 -1
  58. package/dist/commands/team-agent-readiness.d.ts +49 -0
  59. package/dist/commands/team-agent-readiness.js +308 -0
  60. package/dist/commands/team-agent-readiness.js.map +1 -0
  61. package/dist/commands/team-agents-agents.d.ts +24 -3
  62. package/dist/commands/team-agents-agents.js +314 -35
  63. package/dist/commands/team-agents-agents.js.map +1 -1
  64. package/dist/commands/team-agents-mcp.js +32 -3
  65. package/dist/commands/team-agents-mcp.js.map +1 -1
  66. package/dist/commands/team-agents-triggers.js +230 -55
  67. package/dist/commands/team-agents-triggers.js.map +1 -1
  68. package/dist/commands/team-agents.d.ts +3 -1
  69. package/dist/commands/team-agents.js +27 -7
  70. package/dist/commands/team-agents.js.map +1 -1
  71. package/dist/commands/teams-channel-install.d.ts +24 -0
  72. package/dist/commands/teams-channel-install.js +94 -0
  73. package/dist/commands/teams-channel-install.js.map +1 -0
  74. package/dist/commands/teams-connect.d.ts +41 -0
  75. package/dist/commands/teams-connect.js +212 -57
  76. package/dist/commands/teams-connect.js.map +1 -1
  77. package/dist/commands/teams-events.d.ts +12 -0
  78. package/dist/commands/teams-events.js +138 -0
  79. package/dist/commands/teams-events.js.map +1 -0
  80. package/dist/commands/teams-onboard.d.ts +11 -3
  81. package/dist/commands/teams-onboard.js +60 -7
  82. package/dist/commands/teams-onboard.js.map +1 -1
  83. package/dist/commands/teams-overview.d.ts +11 -0
  84. package/dist/commands/teams-overview.js +160 -0
  85. package/dist/commands/teams-overview.js.map +1 -0
  86. package/dist/commands/teams-scope.d.ts +10 -0
  87. package/dist/commands/teams-scope.js +109 -0
  88. package/dist/commands/teams-scope.js.map +1 -0
  89. package/dist/commands/teams.d.ts +4 -2
  90. package/dist/commands/teams.js +113 -14
  91. package/dist/commands/teams.js.map +1 -1
  92. package/dist/commands/upgrade.js +12 -2
  93. package/dist/commands/upgrade.js.map +1 -1
  94. package/dist/commands/use.js +2 -2
  95. package/dist/commands/use.js.map +1 -1
  96. package/dist/commands/whoami.js +1 -1
  97. package/dist/commands/whoami.js.map +1 -1
  98. package/dist/connections-api.js +1 -1
  99. package/dist/connections-api.js.map +1 -1
  100. package/dist/delegate.js +11 -4
  101. package/dist/delegate.js.map +1 -1
  102. package/dist/harness-scaffold.js +12 -0
  103. package/dist/harness-scaffold.js.map +1 -1
  104. package/dist/index.d.ts +6 -0
  105. package/dist/index.js +682 -167
  106. package/dist/index.js.map +1 -1
  107. package/dist/knowledge-api.d.ts +46 -0
  108. package/dist/knowledge-api.js +32 -1
  109. package/dist/knowledge-api.js.map +1 -1
  110. package/dist/open-url.d.ts +16 -0
  111. package/dist/open-url.js +73 -0
  112. package/dist/open-url.js.map +1 -0
  113. package/dist/parse-argv.d.ts +2 -0
  114. package/dist/parse-argv.js.map +1 -1
  115. package/dist/publish-api.d.ts +2 -1
  116. package/dist/publish-api.js +4 -3
  117. package/dist/publish-api.js.map +1 -1
  118. package/dist/pull-write.d.ts +27 -0
  119. package/dist/pull-write.js +60 -0
  120. package/dist/pull-write.js.map +1 -0
  121. package/dist/routes-api.d.ts +3 -0
  122. package/dist/routes-api.js +9 -4
  123. package/dist/routes-api.js.map +1 -1
  124. package/dist/runs-api.d.ts +7 -1
  125. package/dist/runs-api.js +21 -6
  126. package/dist/runs-api.js.map +1 -1
  127. package/dist/safe-fs.d.ts +2 -0
  128. package/dist/safe-fs.js +12 -6
  129. package/dist/safe-fs.js.map +1 -1
  130. package/dist/secret-file.d.ts +17 -0
  131. package/dist/secret-file.js +69 -0
  132. package/dist/secret-file.js.map +1 -0
  133. package/dist/skills-api.d.ts +10 -2
  134. package/dist/skills-api.js +37 -2
  135. package/dist/skills-api.js.map +1 -1
  136. package/dist/source-products-api.d.ts +4 -0
  137. package/dist/source-products-api.js +14 -4
  138. package/dist/source-products-api.js.map +1 -1
  139. package/dist/source-target.js +2 -1
  140. package/dist/source-target.js.map +1 -1
  141. package/dist/sources-api.d.ts +2 -1
  142. package/dist/sources-api.js +3 -2
  143. package/dist/sources-api.js.map +1 -1
  144. package/dist/team-connect-api.d.ts +44 -2
  145. package/dist/team-connect-api.js +19 -7
  146. package/dist/team-connect-api.js.map +1 -1
  147. package/dist/teams-api.d.ts +41 -1
  148. package/dist/teams-api.js +95 -19
  149. package/dist/teams-api.js.map +1 -1
  150. package/dist/toolchain-api.d.ts +9 -0
  151. package/dist/toolchain-api.js +17 -2
  152. package/dist/toolchain-api.js.map +1 -1
  153. package/dist/toolchain-resolve.d.ts +3 -0
  154. package/dist/toolchain-resolve.js +15 -1
  155. package/dist/toolchain-resolve.js.map +1 -1
  156. package/dist/toolchain.d.ts +6 -0
  157. package/dist/toolchain.js +19 -0
  158. package/dist/toolchain.js.map +1 -1
  159. package/dist/update-notice.js +2 -1
  160. package/dist/update-notice.js.map +1 -1
  161. package/package.json +2 -2
  162. package/templates/AGENTS.md.tmpl +6 -1
  163. package/templates/claude-skill.md.tmpl +5 -0
  164. package/templates/package.json.tmpl +4 -4
  165. package/templates/skills/build-agent/SKILL.md +104 -17
  166. package/templates/skills/build-agent/references/agent-json.md +4 -2
  167. package/templates/skills/build-agent/references/rollout.md +23 -4
  168. package/templates/skills/build-agent/references/set-up-an-integration.md +55 -7
  169. package/templates/skills/build-agent/references/skills.md +20 -1
  170. package/templates/skills/build-agent/references/triggers.md +47 -11
  171. package/templates/skills/build-integration/references/widget-design.md +3 -3
  172. package/templates/skills/ekanos-platform/SKILL.md +45 -16
  173. package/templates/skills/polish-widgets/references/patterns.md +2 -2
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,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CAAC,kBAAkB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;IAC3D,OAAO,GAAG,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["import * as fs from 'node:fs';\n\nimport { runAgents } from './commands/agents';\nimport { runApps } from './commands/apps';\nimport { runCatalog } from './commands/catalog';\nimport { runDev } from './commands/dev';\nimport { runInit } from './commands/init';\nimport { runKnowledge } from './commands/knowledge';\nimport { runLogin } from './commands/login';\nimport { runLogout } from './commands/logout';\nimport { runPublish } from './commands/publish';\nimport { runReviewers } from './commands/reviewers';\nimport { runRoutes } from './commands/routes';\nimport { runApprovals, runRuns } from './commands/runs';\nimport { runSkills } from './commands/skills';\nimport { runSources } from './commands/sources';\nimport { runStatus } from './commands/status';\nimport { runTeams } from './commands/teams';\nimport { runTest } from './commands/test';\nimport { runUpgrade } from './commands/upgrade';\nimport { runUse } from './commands/use';\nimport { runValidate } from './commands/validate';\nimport { runWhoami } from './commands/whoami';\nimport { CliContext, type WriteStream } from './context';\nimport { SDK_DOCS_URL, docsPage } from './docs-links';\nimport { toCliError, usageError } from './errors';\nimport { EXIT_CODES } from './exit-codes';\nimport { type FlagSpecs, parseArgv } from './parse-argv';\n\nexport { CliContext } from './context';\nexport { EXIT_CODES, ERROR_CODES } from './exit-codes';\nexport type { ExitCode, ErrorCode } from './exit-codes';\n\nconst GLOBAL_SPECS: FlagSpecs = {\n json: { type: 'boolean' },\n help: { type: 'boolean' },\n version: { type: 'boolean' },\n};\n\nconst COMMAND_SPECS: Record<string, FlagSpecs> = {\n init: {\n slug: { type: 'string' },\n dir: { type: 'string' },\n force: { type: 'boolean' },\n yes: { type: 'boolean' },\n // Repeatable: each occurrence appends one docs entry (URL or relative\n // path) to the scaffolded ekanos.json.\n docs: { type: 'string', repeatable: true },\n },\n validate: {\n dir: { type: 'string' },\n },\n dev: {\n dir: { type: 'string' },\n port: { type: 'string' },\n host: { type: 'string' },\n force: { type: 'boolean' },\n start: { type: 'boolean' },\n },\n test: {\n dir: { type: 'string' },\n // Skips the vitest JSON-reporter injection and the curated failures\n // appendix, reproducing the pre-appendix raw-passthrough behavior —\n // also the escape hatch if the vitest-detection heuristic ever guesses\n // wrong for a project. See `test-report.ts`.\n raw: { type: 'boolean' },\n },\n login: {\n host: { type: 'string' },\n force: { type: 'boolean' },\n claude: { type: 'boolean' },\n },\n logout: {\n host: { type: 'string' },\n all: { type: 'boolean' },\n },\n whoami: {\n host: { type: 'string' },\n },\n status: {\n host: { type: 'string' },\n dir: { type: 'string' },\n findings: { type: 'boolean' },\n all: { type: 'boolean' },\n watch: { type: 'boolean' },\n },\n sources: {\n host: { type: 'string' },\n dir: { type: 'string' },\n // `sources products [enable|disable <product>]`.\n source: { type: 'string' },\n yes: { type: 'boolean' },\n },\n catalog: {\n host: { type: 'string' },\n source: { type: 'string' },\n dir: { type: 'string' },\n },\n apps: {\n host: { type: 'string' },\n source: { type: 'string' },\n dir: { type: 'string' },\n 'no-wait': { type: 'boolean' },\n },\n teams: {\n host: { type: 'string' },\n source: { type: 'string' },\n dir: { type: 'string' },\n connection: { type: 'string' },\n // `teams app set`: which fields to enter, non-secret values, removals.\n field: { type: 'string', repeatable: true },\n set: { type: 'string', repeatable: true },\n clear: { type: 'string', repeatable: true },\n slug: { type: 'string' },\n owner: { type: 'string' },\n role: { type: 'string' },\n yes: { type: 'boolean' },\n // `teams agents|triggers|links|mcp` (team-agents.ts).\n as: { type: 'string' },\n reads: { type: 'string' },\n writes: { type: 'string' },\n effect: { type: 'string' },\n kind: { type: 'string' },\n mode: { type: 'string' },\n url: { type: 'string' },\n auth: { type: 'string' },\n name: { type: 'string' },\n cron: { type: 'string' },\n timezone: { type: 'string' },\n prompt: { type: 'string' },\n filter: { type: 'string' },\n // `teams connect`: `--no-wait`, `--no-open` (the negation of `open`),\n // `--link-only`.\n 'no-wait': { type: 'boolean' },\n open: { type: 'boolean' },\n 'link-only': { type: 'boolean' },\n },\n reviewers: {\n host: { type: 'string' },\n source: { type: 'string' },\n dir: { type: 'string' },\n reach: { type: 'string' },\n team: { type: 'string' },\n },\n routes: {\n host: { type: 'string' },\n source: { type: 'string' },\n dir: { type: 'string' },\n label: { type: 'string' },\n webhook: { type: 'string' },\n },\n agents: {\n host: { type: 'string' },\n source: { type: 'string' },\n dir: { type: 'string' },\n // Not `--version`: that is global, and prints the CLI's own version.\n to: { type: 'string' },\n 'base-version': { type: 'string' },\n overwrite: { type: 'boolean' },\n out: { type: 'string' },\n yes: { type: 'boolean' },\n force: { type: 'boolean' },\n claude: { type: 'boolean' },\n // `agents test <key> --team <slug> --prompt|--input [--follow]`.\n team: { type: 'string' },\n prompt: { type: 'string' },\n input: { type: 'string' },\n follow: { type: 'boolean' },\n // `apply`: `--no-skills` skips pushing the skill folders beside the agent.\n skills: { type: 'boolean' },\n // policy | triggers | links | overrides\n event: { type: 'string' },\n filter: { type: 'string', repeatable: true },\n disabled: { type: 'boolean' },\n cron: { type: 'string' },\n timezone: { type: 'string' },\n kind: { type: 'string' },\n mode: { type: 'string' },\n reads: { type: 'string' },\n writes: { type: 'string' },\n publish: { type: 'boolean' },\n },\n skills: {\n host: { type: 'string' },\n source: { type: 'string' },\n dir: { type: 'string' },\n team: { type: 'string' },\n out: { type: 'string' },\n },\n knowledge: {\n host: { type: 'string' },\n source: { type: 'string' },\n dir: { type: 'string' },\n team: { type: 'string' },\n out: { type: 'string' },\n },\n runs: {\n host: { type: 'string' },\n source: { type: 'string' },\n dir: { type: 'string' },\n team: { type: 'string' },\n agent: { type: 'string' },\n prompt: { type: 'string' },\n input: { type: 'string' },\n follow: { type: 'boolean' },\n },\n approvals: {\n host: { type: 'string' },\n source: { type: 'string' },\n dir: { type: 'string' },\n team: { type: 'string' },\n reason: { type: 'string' },\n body: { type: 'string' },\n },\n use: {\n host: { type: 'string' },\n dir: { type: 'string' },\n },\n publish: {\n host: { type: 'string' },\n source: { type: 'string' },\n dir: { type: 'string' },\n yes: { type: 'boolean' },\n },\n upgrade: {\n dir: { type: 'string' },\n host: { type: 'string' },\n check: { type: 'boolean' },\n yes: { type: 'boolean' },\n // `--no-verify` is the negation of this — parse-argv's `--no-<bool>`\n // convention (same as `--no-json`/`--no-start`), not a flag of its own.\n verify: { type: 'boolean' },\n },\n};\n\n/** Commands that take positional arguments, and what each means, in order. Every other command is positional-free. */\nconst POSITIONAL_COMMANDS: Record<string, readonly string[]> = {\n use: ['source-slug'],\n sources: ['subcommand', 'verb', 'product-slug'],\n catalog: ['product-slug'],\n apps: ['subcommand', 'product-slug'],\n // `teams agents policy <team> <key> set <tool> auto` is the longest form.\n teams: [\n 'subcommand',\n 'team-slug',\n 'product-slug',\n 'webhook-id',\n 'role',\n 'arg-6',\n 'arg-7',\n ],\n reviewers: ['subcommand', 'email'],\n routes: ['subcommand', 'product-or-event-id', 'value', 'team-slug'],\n skills: ['subcommand', 'slug-or-path'],\n knowledge: ['subcommand', 'path-or-query'],\n runs: ['subcommand', 'agent-key-or-run-id'],\n approvals: ['subcommand', 'approval-id'],\n // `triggers <key> add event <trigger-key>` is the longest form: five tokens.\n agents: ['subcommand', 'key-or-path', 'action', 'arg', 'value'],\n};\n\nconst COMMANDS = Object.keys(COMMAND_SPECS);\n\nconst USAGE = [\n 'Usage: ekanos <command> [options]',\n '',\n 'Commands:',\n ' init Scaffold a new integration project into ./<slug> (--slug <slug> --yes)',\n ' validate Validate ekanos.json + the integration definition (--json)',\n ' dev Scaffold .ekanos/harness and run it with your own Next',\n ' test Run the project test script via its package manager (--json).',\n ' For a vitest test script, also renders a curated failures',\n ' appendix from a JSON reporter report; --raw skips that and',\n ' the reporter injection entirely.',\n ' login Authenticate against an Ekanos host in a browser (--host <url>;',\n ' offers to add the Ekanos docs to Claude Code: --claude|--no-claude)',\n ' logout Revoke and delete the stored session (--host <url> | --all)',\n ' whoami Print the identity the stored session authenticates as, plus',\n ' a compact list of the sources you hold a seat on',\n \" status Show login state and this project's submissions on the host\",\n ' (--findings for full gate findings, --all to expand other',\n ' integrations in the source, --watch to block until this',\n \" project's current version reaches a gate verdict)\",\n ' sources List every source you hold a developer/source-admin seat on |',\n ' products [--source <slug>] (each product, Experience or',\n ' Integration, and whether it is enabled for the Source) |',\n ' products enable <product> | products disable <product> --yes',\n ' (a super-admin grant: an \"ekanos login\" session is refused',\n ' and pointed at /admin)',\n ' catalog What a source can already use, and how to set it up',\n ' (\"ekanos catalog [<product-slug>] --source <slug>\", --json)',\n \" apps The Source's app for an integration teams sign in through:\",\n ' show <product> | set <product> (Source admin; takes the secret',\n ' at your terminal, Enter keeps a saved value) | connect',\n ' <product> [--no-wait] (one',\n \" connection for the whole Source, used by the Source's provided\",\n ' agents in every team) | disconnect <product> | list',\n \" teams A Source's teams, for the Source admin:\",\n ' create <name> [--slug <slug>] [--owner <email>] (you own it',\n ' unless --owner, who is invited as owner) |',\n ' members list <team> | members invite <team> <email> [--role',\n ' <role>] (default member; sends the invitation email) |',\n ' members role <team> <email> <role> | members remove <team>',\n \" <email> --yes | roles list <team> (each role's permissions) |\",\n ' connect <team> <product> [--as <member-email>] [--no-wait]',\n \" [--no-open] [--link-only] (connects it: asks the form's fields\",\n ' at your terminal, or opens the sign-in for you or the member',\n \" --as names and waits; --link-only prints the team's page) |\",\n ' list | show <team> <product> (a checklist: fields, callback',\n ' URLs, webhooks, connect link) | app set <team> <product>',\n ' [--connection <id>] [--field <name>]… [--set <name>=<value>]…',\n ' [--clear <name>]… (any one field at a time; a field you skip',\n ' keeps its saved value; secrets only at your terminal) |',\n ' webhook <team> <product> [<webhook-id>] [--yes] (URL shown once)',\n \" A team's agents, for the Source admin (teams <area> <verb> <team> …):\",\n ' agents list <team> | agents enable <team> <key> [--as <member-email>]',\n ' | agents disable|unpin <team> <key> | agents pin <team> <key> <version>',\n ' | agents policy <team> <key> [set <tool> auto|approve | unset <tool>]',\n ' [--reads auto|approve] [--writes auto|approve]',\n ' triggers list|add|remove <team> <key> … | links list|add|remove',\n ' <team> <from-key> [<to-key> --kind talk|delegate --mode await|handoff]',\n ' | mcp list|add|status|token|effect <team> [<server-key> …]',\n ' (see \"ekanos teams --help\")',\n ' reviewers Who decides agent reply drafts, for the Source admin:',\n ' list | add <email> --reach source|team [--team <slug>] |',\n ' remove <email> [--team <slug>]',\n \" routes Route a Source connection's events to teams, for the Source admin:\",\n ' list [<product>] | options <product> | set <product> <value> <team>',\n ' [--label <name>] | remove <product> <value> | webhook <product>',\n ' [--webhook <id>] (URL shown once) | unrouted [<product>] |',\n ' replay <event-id>',\n \" agents The source's agent templates, held by Ekanos:\",\n ' init [<dir>] [--claude|--no-claude] (skills + docs MCP for designing',\n ' agents with Claude; offers to add the docs to Claude Code)',\n ' list | show <key> | pull <key> [--out <dir>]',\n ' apply <dir|file> [--base-version <n>] [--overwrite]',\n ' publish <key> [--to <n>] --yes | rollback <key> --to <n> --yes',\n ' test <key> --team <slug> (--prompt \"…\" | --input <file.json>)',\n ' [--follow] (runs the latest, unpublished version on one team;',\n ' same grant, policy, approvals and audit; marked as a test)',\n ' apply also pushes <dir>/skills/<slug>/ folders first and names',\n ' them in the agent (--no-skills skips that)',\n ' Edit one template in place (stores a draft version; --publish',\n ' also rolls it out, with --yes):',\n ' policy <key> [set <tool> auto|approve | unset <tool>]',\n ' [--reads auto|approve] [--writes auto|approve]',\n ' triggers <key> [list | add event <k> --event <slug.event>',\n ' [--filter field=a,b]... | add schedule <k> --cron \"<expr>\"',\n ' [--timezone <tz>] --prompt <text> | add webhook <k> --prompt',\n ' <text> | remove <k>] [--prompt <text>] [--disabled]',\n ' links <key> [list | add <to-key> --kind talk|delegate',\n ' [--mode await|handoff] | remove <to-key> [--kind <kind>]]',\n ' overrides <key> [enable|disable policy|triggers|links]',\n ' (off: teams follow the template exactly; on: teams keep',\n ' their own differences)',\n \" skills The source's skills (SKILL.md folders), held by Ekanos:\",\n ' list [--team <t>] | show <slug> [--team <t>] |',\n ' push <dir> [--team <t>] (a new version, live at once; created',\n ' on first push, \"unchanged\" when identical; --team: that team\\'s',\n ' own skill, no other team sees it) | pull <slug> [--out <dir>]',\n \" knowledge The Source's Knowledge base (markdown articles), for the Source admin:\",\n ' list [--team <t>] | push <dir> [--team <t>] (each .md file an',\n ' article: title from frontmatter or the first heading, tags from',\n ' frontmatter; upserts by path, \"unchanged\" when identical) |',\n \" search <query> --team <t> (as that team's agents search: its\",\n ' articles plus General) | pull [--team <t>] [--out <dir>]',\n ' Without --team: the General collection every team reads.',\n \" runs Run and inspect a team's agents, as the Source admin:\",\n ' start <agent-key> --team <slug> (--prompt \"…\" | --input',\n ' <file.json>) [--follow] | list --team <slug> [--agent <key>] |',\n ' show <run-id> --team <slug> (--json: transcript, tool calls,',\n ' how each was authorized, approvals)',\n \" approvals What a team's agent runs wait on: list --team <slug> |\",\n ' approve|reject <id> --team <slug> [--reason \"…\"] |',\n ' edit <id> --team <slug> --body <file> (edit & send a reply draft)',\n ' use Set this project\\'s publish target (\"ekanos use <source-slug>\")',\n ' publish Validate, pack and submit the integration to an Ekanos host',\n ' upgrade Move this toolchain to a coherent target version, with',\n ' verify-and-rollback (--check --yes --no-verify --host <url>)',\n '',\n 'Keeping the toolchain current:',\n ' validate, dev and publish all check for a newer @ekanos/cli in the',\n ' background (never blocking, silenced by EKANOS_NO_UPDATE_CHECK) and warn',\n ' on stderr when one exists. Run \"ekanos upgrade --check\" any time a',\n ' validate finding smells like version skew (an unrecognized-key error you',\n ' are confident is correct) — it is read-only and safe to run freely. A',\n ' bare \"ekanos upgrade\" MUTATES the project (installs the target versions,',\n ' verifies with validate + the test script, rolls back on any failure).',\n '',\n 'Host resolution (logout, whoami, status, sources, catalog, apps, teams, reviewers, routes, agents, skills, knowledge, runs, approvals, use, publish, upgrade):',\n ' --host, else EKANOS_HOST, else the \"host\" field in ekanos.json, else the',\n ' sole stored login. \"ekanos publish\" saves host and source to ekanos.json.',\n ' \"ekanos login\" never reads ekanos.json for a host (--host, else',\n ' EKANOS_HOST, else the sole stored login) — it is the verb that creates',\n ' credentials, so a committed file must never choose where they go.',\n '',\n 'Publish targeting (see \"ekanos sources\" / \"ekanos use\"):',\n ' publish refuses (FORBIDDEN) a source you hold no seat on. With multiple',\n ' seats and an implicit (ekanos.json) source, a human run asks to confirm',\n ' the target; a scripted/JSON run needs --source or --yes to proceed —',\n ' it never prompts and never guesses.',\n '',\n 'Global options:',\n ' --json Emit a single JSON envelope on stdout (auto-on when piped);',\n ' --no-json forces the human-readable form',\n ' --version Print the CLI version',\n ' --help Show this help',\n].join('\\n');\n\nexport interface RunOptions {\n stdout?: WriteStream;\n stderr?: WriteStream;\n env?: Record<string, string | undefined>;\n cwd?: string;\n /**\n * Test-only override for `publish`'s interactive-confirm gate and `init`\n * / `login`'s clack wizard gate (`canWizard` in `wizard.ts`) — see\n * `PublishArgs` in `commands/publish.ts`. Never set this from real CLI\n * wiring; it exists so a test can exercise the human y/N confirm branch or\n * the wizard flow without a real terminal.\n */\n stdinIsTTY?: boolean;\n confirm?: (question: string) => Promise<boolean>;\n /** Test-only answers for `apps set` / `teams app set` questions — never set from real CLI wiring. */\n ask?: (question: string) => Promise<string>;\n askSecret?: (question: string) => Promise<string>;\n /**\n * Test-only override for `status --watch`'s poll delay — see `StatusArgs`\n * in `commands/status.ts`. Never set this from real CLI wiring; it exists\n * so a test can exercise the poll loop without waiting 30s per iteration.\n */\n sleep?: (ms: number) => Promise<void>;\n /**\n * Test-only override for `status`'s AGE column (\"now\") — see `StatusArgs`\n * in `commands/status.ts`. Never set this from real CLI wiring; it exists\n * so a test can assert an exact `relativeTime` string deterministically.\n */\n now?: Date;\n}\n\n/**\n * The single entry point. Resolves the agent-native envelope once, dispatches\n * to a verb, and guarantees exactly one terminal emission (success or error).\n * Returns the process exit code — `bin.ts` is the only place that calls\n * `process.exit`, so this stays fully testable.\n */\nexport async function run(\n argv: readonly string[],\n options: RunOptions = {},\n): Promise<number> {\n const jsonFlag = scanJsonFlag(argv);\n const ctx = new CliContext({\n jsonFlag,\n stdout: options.stdout,\n stderr: options.stderr,\n env: options.env,\n });\n const cwd = options.cwd ?? process.cwd();\n const env = options.env ?? process.env;\n\n try {\n // `--version` is global and verb-independent, so it is answered before the\n // command is even resolved: `ekanos --version` and `ekanos validate\n // --version` both report the tool's version and exit 0.\n if (scanFlagPresence(argv, 'version')) {\n return emitVersion(ctx);\n }\n\n const { command, rest } = splitCommand(argv);\n\n // Top-level help / no command.\n if (!command) {\n if (scanFlagPresence(rest, 'help') || argv.length === 0) {\n return emitHelp(ctx);\n }\n // A leading token that is not a command (e.g. `--nonsense`).\n ctx.emitClaudeCodeHint({\n tool: 'ekanos',\n error: 'unknown-command',\n commands: COMMANDS,\n usage: USAGE,\n });\n throw usageError(\n `Unknown command or flag \"${argv[0]}\".`,\n `Run one of: ${COMMANDS.join(', ')}. See \"ekanos --help\".`,\n );\n }\n\n if (!COMMANDS.includes(command)) {\n ctx.emitClaudeCodeHint({\n tool: 'ekanos',\n error: 'unknown-command',\n given: command,\n commands: COMMANDS,\n usage: USAGE,\n });\n throw usageError(\n `Unknown command \"${command}\".`,\n `Run one of: ${COMMANDS.join(', ')}. See \"ekanos --help\".`,\n );\n }\n\n const specs: FlagSpecs = { ...GLOBAL_SPECS, ...COMMAND_SPECS[command] };\n const parsed = parseArgv(rest, specs);\n\n if (parsed.flags.help === true) {\n return emitCommandHelp(ctx, command);\n }\n\n const positionalNames = POSITIONAL_COMMANDS[command] ?? [];\n\n if (positionalNames.length === 0 && parsed.positionals.length > 0) {\n throw usageError(\n `\"${command}\" takes no positional arguments (got \"${parsed.positionals[0]}\").`,\n `Pass options as flags, e.g. \"--dir <path>\". See \"ekanos ${command} --help\".`,\n );\n }\n\n if (parsed.positionals.length > positionalNames.length) {\n const usage = positionalNames.map((name) => `<${name}>`).join(' ');\n throw usageError(\n `\"${command}\" takes at most ${positionalNames.length} positional ` +\n `argument${positionalNames.length === 1 ? '' : 's'} (${usage}), ` +\n `got ${parsed.positionals.length}.`,\n `e.g. \"ekanos ${command} ${usage}\". See \"ekanos ${command} --help\".`,\n );\n }\n\n const dir = (parsed.flags.dir as string | undefined) ?? cwd;\n\n switch (command) {\n case 'init':\n return await runInit(ctx, {\n slug: parsed.flags.slug as string | undefined,\n dir: parsed.flags.dir as string | undefined,\n cwd,\n force: parsed.flags.force === true,\n yes: parsed.flags.yes === true,\n docs: parsed.flags.docs as string[] | undefined,\n stdinIsTTY: options.stdinIsTTY,\n });\n case 'validate':\n return await runValidate(ctx, { dir, env });\n case 'dev':\n return await runDev(ctx, {\n dir,\n port: parsed.flags.port as string | undefined,\n host: parsed.flags.host as string | undefined,\n force: parsed.flags.force === true,\n start: parsed.flags.start as boolean | undefined,\n env,\n });\n case 'test':\n return await runTest(ctx, {\n dir,\n passthrough: parsed.passthrough,\n raw: parsed.flags.raw === true,\n });\n case 'login':\n return await runLogin(ctx, {\n host: parsed.flags.host as string | undefined,\n force: parsed.flags.force === true,\n claude: parsed.flags.claude as boolean | undefined,\n cwd,\n env,\n stdinIsTTY: options.stdinIsTTY,\n });\n case 'logout':\n return await runLogout(ctx, {\n host: parsed.flags.host as string | undefined,\n all: parsed.flags.all === true,\n cwd,\n env,\n });\n case 'whoami':\n return await runWhoami(ctx, {\n host: parsed.flags.host as string | undefined,\n cwd,\n env,\n });\n case 'status':\n return await runStatus(ctx, {\n host: parsed.flags.host as string | undefined,\n dir,\n env,\n findings: parsed.flags.findings === true,\n all: parsed.flags.all === true,\n watch: parsed.flags.watch === true,\n sleep: options.sleep,\n now: options.now,\n });\n case 'sources':\n return await runSources(ctx, {\n host: parsed.flags.host as string | undefined,\n positionals: parsed.positionals,\n source: parsed.flags.source as string | undefined,\n yes: parsed.flags.yes === true,\n dir,\n env,\n });\n case 'catalog':\n return await runCatalog(ctx, {\n host: parsed.flags.host as string | undefined,\n source: parsed.flags.source as string | undefined,\n product: parsed.positionals[0],\n dir,\n env,\n });\n case 'apps':\n return await runApps(ctx, {\n host: parsed.flags.host as string | undefined,\n source: parsed.flags.source as string | undefined,\n subcommand: parsed.positionals[0],\n product: parsed.positionals[1],\n dir,\n env,\n stdinIsTTY: options.stdinIsTTY,\n ask: options.ask,\n askSecret: options.askSecret,\n confirm: options.confirm,\n noWait: parsed.flags['no-wait'] === true,\n });\n case 'teams':\n return await runTeams(ctx, {\n host: parsed.flags.host as string | undefined,\n source: parsed.flags.source as string | undefined,\n positionals: parsed.positionals,\n connection: parsed.flags.connection as string | undefined,\n slug: parsed.flags.slug as string | undefined,\n owner: parsed.flags.owner as string | undefined,\n role: parsed.flags.role as string | undefined,\n yes: parsed.flags.yes === true,\n noWait: parsed.flags['no-wait'] === true,\n noOpen: parsed.flags.open === false,\n linkOnly: parsed.flags['link-only'] === true,\n flags: parsed.flags,\n dir,\n env,\n stdinIsTTY: options.stdinIsTTY,\n ask: options.ask,\n askSecret: options.askSecret,\n });\n case 'reviewers':\n return await runReviewers(ctx, {\n host: parsed.flags.host as string | undefined,\n source: parsed.flags.source as string | undefined,\n positionals: parsed.positionals,\n reach: parsed.flags.reach as string | undefined,\n team: parsed.flags.team as string | undefined,\n dir,\n env,\n });\n case 'routes':\n return await runRoutes(ctx, {\n host: parsed.flags.host as string | undefined,\n source: parsed.flags.source as string | undefined,\n positionals: parsed.positionals,\n label: parsed.flags.label as string | undefined,\n webhook: parsed.flags.webhook as string | undefined,\n dir,\n env,\n });\n case 'agents':\n return await runAgents(ctx, {\n host: parsed.flags.host as string | undefined,\n source: parsed.flags.source as string | undefined,\n subcommand: parsed.positionals[0],\n target: parsed.positionals[1],\n to: parsed.flags.to as string | undefined,\n baseVersion: parsed.flags['base-version'] as string | undefined,\n overwrite: parsed.flags.overwrite === true,\n out: parsed.flags.out as string | undefined,\n yes: parsed.flags.yes === true,\n force: parsed.flags.force === true,\n claude: parsed.flags.claude as boolean | undefined,\n skills: parsed.flags.skills as boolean | undefined,\n rest: parsed.positionals.slice(2),\n event: parsed.flags.event as string | undefined,\n filter: parsed.flags.filter as string[] | undefined,\n disabled: parsed.flags.disabled === true,\n cron: parsed.flags.cron as string | undefined,\n timezone: parsed.flags.timezone as string | undefined,\n kind: parsed.flags.kind as string | undefined,\n mode: parsed.flags.mode as string | undefined,\n reads: parsed.flags.reads as string | undefined,\n writes: parsed.flags.writes as string | undefined,\n publish: parsed.flags.publish === true,\n dir,\n env,\n stdinIsTTY: options.stdinIsTTY,\n confirm: options.confirm,\n team: parsed.flags.team as string | undefined,\n prompt: parsed.flags.prompt as string | undefined,\n input: parsed.flags.input as string | undefined,\n follow: parsed.flags.follow === true,\n });\n case 'runs':\n case 'approvals':\n return await (command === 'runs' ? runRuns : runApprovals)(ctx, {\n host: parsed.flags.host as string | undefined,\n source: parsed.flags.source as string | undefined,\n positionals: parsed.positionals,\n team: parsed.flags.team as string | undefined,\n agent: parsed.flags.agent as string | undefined,\n prompt: parsed.flags.prompt as string | undefined,\n input: parsed.flags.input as string | undefined,\n follow: parsed.flags.follow === true,\n reason: parsed.flags.reason as string | undefined,\n body: parsed.flags.body as string | undefined,\n dir,\n env,\n sleep: options.sleep,\n });\n case 'skills':\n return await runSkills(ctx, {\n host: parsed.flags.host as string | undefined,\n source: parsed.flags.source as string | undefined,\n subcommand: parsed.positionals[0],\n target: parsed.positionals[1],\n team: parsed.flags.team as string | undefined,\n out: parsed.flags.out as string | undefined,\n dir,\n env,\n });\n case 'knowledge':\n return await runKnowledge(ctx, {\n host: parsed.flags.host as string | undefined,\n source: parsed.flags.source as string | undefined,\n subcommand: parsed.positionals[0],\n target: parsed.positionals[1],\n team: parsed.flags.team as string | undefined,\n out: parsed.flags.out as string | undefined,\n dir,\n env,\n });\n case 'use':\n return await runUse(ctx, {\n host: parsed.flags.host as string | undefined,\n dir,\n slug: parsed.positionals[0],\n env,\n });\n case 'publish':\n return await runPublish(ctx, {\n host: parsed.flags.host as string | undefined,\n source: parsed.flags.source as string | undefined,\n dir,\n yes: parsed.flags.yes === true,\n env,\n stdinIsTTY: options.stdinIsTTY,\n confirm: options.confirm,\n });\n case 'upgrade':\n return await runUpgrade(ctx, {\n dir,\n host: parsed.flags.host as string | undefined,\n env,\n check: parsed.flags.check === true,\n yes: parsed.flags.yes === true,\n noVerify: parsed.flags.verify === false,\n stdinIsTTY: options.stdinIsTTY,\n confirm: options.confirm,\n });\n default:\n // Unreachable — COMMANDS gate above — but keeps the switch total.\n throw usageError(\n `Unknown command \"${command}\".`,\n `Run one of: ${COMMANDS.join(', ')}.`,\n );\n }\n } catch (error) {\n return ctx.fail(toCliError(error));\n }\n}\n\n/**\n * Presence of `--json` (or `--no-json`) BEFORE the first `--` passthrough.\n *\n * Tri-state on purpose. `undefined` means \"the user expressed no preference\",\n * which is what lets the context fall back to inferring the mode from a\n * non-TTY stdout or CLAUDECODE. Collapsing `--no-json` to `false` here would\n * make it indistinguishable from absence, and the flag could then never turn\n * JSON mode OFF in exactly the cases it exists for.\n */\nfunction scanJsonFlag(argv: readonly string[]): boolean | undefined {\n for (const token of argv) {\n if (token === '--') break;\n if (token === '--json') return true;\n if (token === '--no-json') return false;\n }\n return undefined;\n}\n\nfunction scanFlagPresence(argv: readonly string[], name: string): boolean {\n for (const token of argv) {\n if (token === '--') break;\n if (token === `--${name}`) return true;\n }\n return false;\n}\n\n/**\n * Split argv into the command (first bare token before `--`) and the rest\n * (everything else, order preserved, including global flags and the `--`\n * passthrough). Global flags are all booleans, so any bare token is the\n * command — no value-consumption ambiguity.\n */\nfunction splitCommand(argv: readonly string[]): {\n command: string | null;\n rest: string[];\n} {\n for (let i = 0; i < argv.length; i++) {\n const token = argv[i]!;\n if (token === '--') break;\n if (!token.startsWith('-')) {\n return {\n command: token,\n rest: [...argv.slice(0, i), ...argv.slice(i + 1)],\n };\n }\n }\n return { command: null, rest: [...argv] };\n}\n\n/**\n * The CLI's own version, read from the package manifest at runtime rather than\n * baked in by the build — one source of truth, so a release bump cannot leave\n * `--version` reporting a stale number. The path resolves identically from\n * `src/index.ts` and from the emitted `dist/index.js`, both of which sit one\n * directory below the package root.\n */\nfunction readVersion(): string {\n const manifest = new URL('../package.json', import.meta.url);\n const parsed: unknown = JSON.parse(fs.readFileSync(manifest, 'utf8'));\n\n return typeof parsed === 'object' &&\n parsed !== null &&\n 'version' in parsed &&\n typeof parsed.version === 'string'\n ? parsed.version\n : '0.0.0';\n}\n\nfunction emitVersion(ctx: CliContext): number {\n const version = readVersion();\n\n return ctx.succeed({ name: 'ekanos', version }, version);\n}\n\nconst DOCS_FOOTER = `\\nDocs: ${SDK_DOCS_URL} (commands: ${docsPage('cli/commands')})`;\n\nfunction emitHelp(ctx: CliContext): number {\n ctx.emitClaudeCodeHint({\n tool: 'ekanos',\n commands: COMMANDS,\n usage: USAGE,\n exitCodes: EXIT_CODES,\n });\n return ctx.succeed(\n { usage: USAGE, commands: COMMANDS, docs: SDK_DOCS_URL },\n `${USAGE}${DOCS_FOOTER}`,\n );\n}\n\nfunction emitCommandHelp(ctx: CliContext, command: string): number {\n const specs = COMMAND_SPECS[command] ?? {};\n const flags = Object.keys(specs).map((name) => `--${name}`);\n const help = `Usage: ekanos ${command} [${flags.join('] [')}]`;\n ctx.emitClaudeCodeHint({ tool: 'ekanos', command, flags });\n return ctx.succeed({ command, flags }, help);\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,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,UAAU,QAAQ,EAAE;QACpB,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7B,GAAG,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/C,EAAE;QACF,UAAU;QACV,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CACxB,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK;YACzB,CAAC,CAAC,KAAK,MAAM,CAAC,KAAK,OAAO,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,MAAM,CAAC,WAAW,EAAE;YACpE,CAAC,CAAC,KAAK,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,MAAM,CAAC,WAAW,EAAE,CAC7D;QACD,EAAE;QACF,SAAS,IAAI,EAAE;KAChB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACb,GAAG,CAAC,kBAAkB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IAClE,OAAO,GAAG,CAAC,OAAO,CAChB;QACE,OAAO;QACP,KAAK;QACL,KAAK;QACL,OAAO;QACP,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,EAA4B,EAAE,EAAE;gBAAhC,EAAE,KAAK,EAAE,MAAM,OAAa,EAAR,MAAM,cAA1B,SAA4B,CAAF;YAAO,OAAA,MAAM,CAAA;QAAA,CAAC,AAAD,CAAC;QAC9D,IAAI;KACL,EACD,KAAK,CACN,CAAC;AACJ,CAAC","sourcesContent":["import * as fs from 'node:fs';\n\nimport { runAgents } from './commands/agents';\nimport { TEMPLATE_EDIT_HELP } from './commands/agents-edit';\nimport { runApps } from './commands/apps';\nimport { runCatalog } from './commands/catalog';\nimport { runDev } from './commands/dev';\nimport { runInit } from './commands/init';\nimport { runKnowledge } from './commands/knowledge';\nimport { runLogin } from './commands/login';\nimport { runLogout } from './commands/logout';\nimport { runPublish } from './commands/publish';\nimport { runReviewers } from './commands/reviewers';\nimport { runRoutes } from './commands/routes';\nimport { runApprovals, runRuns } from './commands/runs';\nimport { runSkills } from './commands/skills';\nimport { runSources } from './commands/sources';\nimport { runStatus } from './commands/status';\nimport { TEAM_AGENT_AREAS, usageFor } from './commands/team-agents';\nimport { runTeams } from './commands/teams';\nimport { runTest } from './commands/test';\nimport { runUpgrade } from './commands/upgrade';\nimport { runUse } from './commands/use';\nimport { runValidate } from './commands/validate';\nimport { runWhoami } from './commands/whoami';\nimport { CliContext, type WriteStream } from './context';\nimport { SDK_DOCS_URL, docsPage } from './docs-links';\nimport { toCliError, usageError } from './errors';\nimport { EXIT_CODES } from './exit-codes';\nimport { type FlagSpec, type FlagSpecs, parseArgv } from './parse-argv';\n\nexport { CliContext } from './context';\nexport { EXIT_CODES, ERROR_CODES } from './exit-codes';\nexport type { ExitCode, ErrorCode } from './exit-codes';\n\nconst GLOBAL_SPECS: FlagSpecs = {\n json: {\n type: 'boolean',\n description:\n 'One JSON envelope on stdout (on by default when piped or under Claude Code; --no-json forces text)',\n },\n help: { type: 'boolean', description: 'Show help for the command' },\n version: { type: 'boolean', description: 'Print the CLI version' },\n};\n\n/** The flags most commands share, described once. */\nconst HOST: FlagSpec = {\n type: 'string',\n description:\n 'Ekanos host URL (else EKANOS_HOST, the \"host\" in ekanos.json, or the only stored login)',\n};\nconst SOURCE: FlagSpec = {\n type: 'string',\n description:\n 'The Source to act on (else the \"source\" in ekanos.json, or your only seat)',\n};\nconst DIR: FlagSpec = {\n type: 'string',\n description:\n 'Project directory, where ekanos.json and relative paths are read (default: the current one)',\n};\n\nconst COMMAND_SPECS: Record<string, FlagSpecs> = {\n init: {\n slug: {\n type: 'string',\n description: 'Kebab-case id of the integration, e.g. acme-crm',\n },\n dir: {\n type: 'string',\n description:\n 'Target directory (default ./<slug>; --dir . scaffolds in place)',\n },\n force: {\n type: 'boolean',\n description: 'Overwrite files that already exist',\n },\n yes: {\n type: 'boolean',\n description: 'Accepted for scripts; init never prompts',\n },\n // Repeatable: each occurrence appends one docs entry (URL or relative\n // path) to the scaffolded ekanos.json.\n docs: {\n type: 'string',\n repeatable: true,\n description:\n \"An http(s) URL or project-relative path to the API's docs, written to ekanos.json\",\n },\n },\n validate: {\n dir: DIR,\n },\n dev: {\n dir: DIR,\n port: { type: 'string', description: 'Dev server port (default 3100)' },\n host: {\n type: 'string',\n description:\n 'Interface to bind (default 127.0.0.1; anything else is exposed, with a warning)',\n },\n force: {\n type: 'boolean',\n description: 'Rewrite every generated file even when unchanged',\n },\n start: {\n type: 'boolean',\n description:\n 'Start the server even in JSON mode; --no-start only scaffolds',\n },\n },\n test: {\n dir: DIR,\n // Skips the vitest JSON-reporter injection and the curated failures\n // appendix, reproducing the pre-appendix raw-passthrough behavior —\n // also the escape hatch if the vitest-detection heuristic ever guesses\n // wrong for a project. See `test-report.ts`.\n raw: {\n type: 'boolean',\n description:\n 'Run the test script as is, without the failures appendix and its reporter',\n },\n },\n login: {\n host: {\n type: 'string',\n description:\n 'Ekanos host URL (else EKANOS_HOST, or the only stored login; never ekanos.json)',\n },\n force: {\n type: 'boolean',\n description: 'Sign in again even when the stored session is valid',\n },\n 'trust-host': {\n type: 'boolean',\n description:\n 'Sign in to a host you have never logged in to without being asked',\n },\n claude: {\n type: 'boolean',\n description:\n 'Add the Ekanos docs to Claude Code without asking; --no-claude skips it',\n },\n },\n logout: {\n host: HOST,\n all: { type: 'boolean', description: 'Log out of every stored host' },\n },\n whoami: {\n host: HOST,\n },\n status: {\n host: HOST,\n dir: DIR,\n findings: {\n type: 'boolean',\n description: 'Every finding of each version, not just the counts',\n },\n all: {\n type: 'boolean',\n description:\n \"Expand the Source's other integrations into full version tables\",\n },\n watch: {\n type: 'boolean',\n description:\n \"Wait until this project's current version reaches a gate verdict\",\n },\n },\n sources: {\n host: HOST,\n dir: DIR,\n // `sources products [enable|disable <product>]`.\n source: SOURCE,\n yes: {\n type: 'boolean',\n description: 'Confirm products disable, scopes remove',\n },\n },\n catalog: {\n host: HOST,\n source: SOURCE,\n dir: DIR,\n },\n apps: {\n host: HOST,\n source: SOURCE,\n dir: DIR,\n 'no-wait': {\n type: 'boolean',\n description: 'connect: print the links and return without waiting',\n },\n yes: {\n type: 'boolean',\n description:\n 'disconnect: confirm without the question (needed in a script or agent run)',\n },\n },\n teams: {\n host: HOST,\n source: SOURCE,\n dir: DIR,\n connection: {\n type: 'string',\n description:\n 'connect, app set: which of the integration\\'s connections (e.g. \"agent\" for Linear\\'s agent)',\n },\n // `teams app set`: which fields to enter, non-secret values, removals.\n field: {\n type: 'string',\n repeatable: true,\n description: 'app set: enter just this field at your terminal',\n },\n set: {\n type: 'string',\n repeatable: true,\n description: 'app set: <name>=<value> for a non-secret field',\n },\n clear: {\n type: 'string',\n repeatable: true,\n description: \"app set: remove this field's saved value\",\n },\n slug: {\n type: 'string',\n description: \"create: the team's slug (default: from its name)\",\n },\n owner: {\n type: 'string',\n description: 'create: invite this email as the owner instead of you',\n },\n role: {\n type: 'string',\n description: 'members invite: the role to invite as (default member)',\n },\n yes: {\n type: 'boolean',\n description:\n 'Confirm a change that removes, pauses, revokes or opens something up (members remove, webhook, disconnect, agents disable, triggers add slack, triggers remove|rotate, links remove, mcp remove, scope set that drops a scope)',\n },\n // `teams agents|triggers|links|mcp` (team-agents.ts).\n as: {\n type: 'string',\n description:\n 'connect: the member who signs in; agents enable: the member the agent runs as',\n },\n // `teams agents enable|pin … --draft`: test the unpublished draft there.\n draft: {\n type: 'boolean',\n description:\n \"agents enable|pin: put this team alone on the template's unpublished draft\",\n },\n // `teams agents enable|policy`: also confirm, as yourself, what the\n // agent may use (whoever sets it up confirms it, plan 247.2).\n 'confirm-access': {\n type: 'boolean',\n description:\n 'agents enable|policy: also confirm, as yourself, what it may use',\n },\n reads: {\n type: 'string',\n description: 'agents policy: auto|approve for every read tool',\n },\n writes: {\n type: 'string',\n description: 'agents policy: auto|approve for every write tool',\n },\n effect: {\n type: 'string',\n description:\n 'Not read: \"teams mcp effect\" takes the effect as an argument',\n },\n kind: { type: 'string', description: 'links add: talk|delegate' },\n mode: {\n type: 'string',\n description: 'links add: await|handoff, for a delegate link',\n },\n url: { type: 'string', description: \"mcp add: the server's URL\" },\n auth: {\n type: 'string',\n description: 'mcp add: none|token|oauth (default oauth)',\n },\n name: { type: 'string', description: \"mcp add: the server's display name\" },\n cron: {\n type: 'string',\n description: 'triggers add schedule: a cron expression',\n },\n timezone: {\n type: 'string',\n description: 'triggers add schedule: an IANA time zone (default UTC)',\n },\n prompt: {\n type: 'string',\n description: 'triggers add: what the agent is told when it fires',\n },\n // Repeatable `field=value`, or one JSON object — as at the template level.\n filter: {\n type: 'string',\n repeatable: true,\n description:\n 'triggers add event: field=a,b (repeatable) or one JSON object',\n },\n // `teams <area> … --team <slug>`: the team, in place of the positional.\n team: {\n type: 'string',\n description:\n 'The team, in place of the <team> argument (teams <area> … --team <slug>)',\n },\n // `teams triggers add … slack|linear`: where it answers. `--no-mention`\n // is the negation of `mention`.\n channel: {\n type: 'string',\n repeatable: true,\n description: 'triggers add slack: a channel it answers in (#name or id)',\n },\n dms: {\n type: 'boolean',\n description: 'triggers add slack: also answer direct messages',\n },\n label: {\n type: 'string',\n repeatable: true,\n description: 'triggers add linear: a label that hands an issue to it',\n },\n mention: {\n type: 'boolean',\n description: 'triggers add linear: --no-mention ignores @mentions',\n },\n // `teams connect`: `--no-wait`, `--no-open` (the negation of `open`),\n // `--link-only`.\n 'no-wait': {\n type: 'boolean',\n description: 'connect: print the sign-in link and return at once',\n },\n open: {\n type: 'boolean',\n description:\n 'connect: --no-open prints the link without opening a browser',\n },\n 'link-only': {\n type: 'boolean',\n description: \"connect: print the team's page instead of connecting\",\n },\n // `teams events <team> [--product] [--since] [--limit]`.\n product: {\n type: 'string',\n description: 'events: only this product (or name it after the team)',\n },\n since: {\n type: 'string',\n description: 'events: since 30m, 24h, 7d or a date',\n },\n limit: { type: 'string', description: 'events: how many, 1 to 100' },\n // `teams connect --reconnect`.\n reconnect: {\n type: 'boolean',\n description:\n 'connect: connect again though it reads as connected (revoked or expired)',\n },\n },\n reviewers: {\n host: HOST,\n source: SOURCE,\n dir: DIR,\n reach: {\n type: 'string',\n description: \"add: source (every team's drafts) or team (one team's)\",\n },\n team: {\n type: 'string',\n description: \"add --reach team, remove: the team's slug\",\n },\n yes: { type: 'boolean', description: 'remove: confirm' },\n },\n routes: {\n host: HOST,\n source: SOURCE,\n dir: DIR,\n label: { type: 'string', description: 'set: a name for the value' },\n webhook: {\n type: 'string',\n description: 'webhook: which webhook, when the integration has several',\n },\n yes: {\n type: 'boolean',\n description:\n 'remove: confirm; webhook: replace the live URL, revoking it',\n },\n },\n agents: {\n host: HOST,\n source: SOURCE,\n dir: DIR,\n // Not `--version`: that is global, and prints the CLI's own version.\n to: {\n type: 'string',\n description: 'publish, rollback: the version teams run',\n },\n 'base-version': {\n type: 'string',\n description:\n 'apply: the version your edit starts from (refused when the host has moved on)',\n },\n overwrite: {\n type: 'boolean',\n description: 'apply: replace a newer version on the host anyway',\n },\n out: {\n type: 'string',\n description: 'pull: where to write the template (default agents/<key>)',\n },\n yes: {\n type: 'boolean',\n description:\n 'publish, rollback, archive, --publish: confirm (needed in a script or agent run)',\n },\n all: {\n type: 'boolean',\n description: 'list: include archived agents',\n },\n force: {\n type: 'boolean',\n description:\n 'init: replace the skills and CLAUDE.md that exist; pull: overwrite local files that differ',\n },\n claude: {\n type: 'boolean',\n description:\n 'init: add the docs to Claude Code without asking; --no-claude skips it',\n },\n // `agents test <key> --team <slug> --prompt|--input [--follow]`.\n team: { type: 'string', description: 'test: the team to run the draft on' },\n prompt: {\n type: 'string',\n description: 'test: the message; triggers add: what the agent is told',\n },\n input: { type: 'string', description: 'test: a JSON file to run with' },\n follow: {\n type: 'boolean',\n description: 'test: wait for the run and print its result',\n },\n // `apply`: `--no-skills` skips pushing the skill folders beside the agent.\n skills: {\n type: 'boolean',\n description: 'apply: --no-skills skips pushing <dir>/skills/<slug>/',\n },\n // policy | triggers | links | overrides\n event: {\n type: 'string',\n description: 'triggers add event: <product>.<event>',\n },\n filter: {\n type: 'string',\n repeatable: true,\n description: 'triggers add event: field=a,b (repeat for more fields)',\n },\n disabled: {\n type: 'boolean',\n description: 'triggers add: store the trigger turned off',\n },\n cron: {\n type: 'string',\n description: 'triggers add schedule: a cron expression',\n },\n timezone: {\n type: 'string',\n description: 'triggers add schedule: an IANA time zone',\n },\n kind: { type: 'string', description: 'links: talk|delegate' },\n mode: {\n type: 'string',\n description: 'links add: await|handoff, for a delegate link',\n },\n reads: {\n type: 'string',\n description: 'policy: auto|approve for every read tool',\n },\n writes: {\n type: 'string',\n description: 'policy: auto|approve for every write tool',\n },\n publish: {\n type: 'boolean',\n description:\n 'policy, triggers, links, overrides: publish the new version too (with --yes)',\n },\n // `publish | rollback` (and `--publish`): also confirm, as yourself, on\n // every team running the version with no confirmation.\n 'confirm-access': {\n type: 'boolean',\n description:\n 'publish, rollback, --publish: also confirm, as yourself, on every team on that version not yet confirmed',\n },\n },\n skills: {\n host: HOST,\n source: SOURCE,\n dir: DIR,\n team: {\n type: 'string',\n description: \"That team's own skills instead of the Source's\",\n },\n out: {\n type: 'string',\n description: 'pull: where to write the skill folder',\n },\n force: {\n type: 'boolean',\n description: 'pull: overwrite local files that differ from the host',\n },\n yes: {\n type: 'boolean',\n description: 'archive: confirm (needed in a script or agent run)',\n },\n },\n knowledge: {\n host: HOST,\n source: SOURCE,\n dir: DIR,\n team: {\n type: 'string',\n description: \"That team's collection instead of General\",\n },\n out: { type: 'string', description: 'pull: where to write the articles' },\n force: {\n type: 'boolean',\n description: 'pull: overwrite local files that differ from the host',\n },\n prune: {\n type: 'boolean',\n description:\n 'push: also delete the articles an earlier push of this folder made whose files are gone (never ones written or edited in the app)',\n },\n yes: {\n type: 'boolean',\n description:\n 'push --prune: delete without asking (needed in a script or agent run)',\n },\n },\n runs: {\n host: HOST,\n source: SOURCE,\n dir: DIR,\n team: { type: 'string', description: 'The team whose runs these are' },\n agent: { type: 'string', description: \"list: only this agent's runs\" },\n status: {\n type: 'string',\n description:\n 'list: only runs in this status (running, awaiting_approval, completed, failed, cancelled)',\n },\n since: {\n type: 'string',\n description: 'list: only runs started since 30m, 24h, 7d or a date',\n },\n prompt: { type: 'string', description: 'start: the message' },\n input: { type: 'string', description: 'start: a JSON file to run with' },\n follow: {\n type: 'boolean',\n description: 'start: wait for the run and print its result',\n },\n // `runs cancel <run-id> --yes`.\n yes: { type: 'boolean', description: 'cancel: confirm' },\n },\n approvals: {\n host: HOST,\n source: SOURCE,\n dir: DIR,\n team: { type: 'string', description: 'The team whose runs wait on these' },\n reason: { type: 'string', description: 'approve, reject: why' },\n body: {\n type: 'string',\n description: 'edit: a file with the reply to send instead',\n },\n },\n use: {\n host: HOST,\n dir: DIR,\n },\n publish: {\n host: HOST,\n source: SOURCE,\n dir: DIR,\n yes: {\n type: 'boolean',\n description:\n 'Publish to the ekanos.json source without asking (needed in a script with several seats)',\n },\n },\n upgrade: {\n dir: DIR,\n host: HOST,\n check: {\n type: 'boolean',\n description: 'Report current and target versions; change nothing',\n },\n yes: {\n type: 'boolean',\n description: 'Upgrade without asking (needed outside a terminal)',\n },\n // `--no-verify` is the negation of this — parse-argv's `--no-<bool>`\n // convention (same as `--no-json`/`--no-start`), not a flag of its own.\n verify: {\n type: 'boolean',\n description:\n '--no-verify skips the validate and test run after installing',\n },\n },\n};\n\n/** Commands that take positional arguments, and what each means, in order. Every other command is positional-free. */\nconst POSITIONAL_COMMANDS: Record<string, readonly string[]> = {\n use: ['source-slug'],\n // `sources scopes add <scope> <product>` is the longest form.\n sources: ['subcommand', 'verb', 'product-or-scope', 'product-slug'],\n catalog: ['product-slug'],\n apps: ['subcommand', 'product-slug'],\n // `teams agents policy <team> <key> set <tool> auto` is the longest form.\n teams: [\n 'subcommand',\n 'team-slug',\n 'product-slug',\n 'webhook-id',\n 'role',\n 'arg-6',\n 'arg-7',\n ],\n reviewers: ['subcommand', 'email'],\n routes: ['subcommand', 'product-or-event-id', 'value', 'team-slug'],\n skills: ['subcommand', 'slug-or-path'],\n knowledge: ['subcommand', 'path-or-query'],\n runs: ['subcommand', 'agent-key-or-run-id'],\n approvals: ['subcommand', 'approval-id'],\n // `triggers <key> add event <trigger-key>` is the longest form: five tokens.\n agents: ['subcommand', 'key-or-path', 'action', 'arg', 'value'],\n};\n\nconst COMMANDS = Object.keys(COMMAND_SPECS);\n\nconst USAGE = [\n 'Usage: ekanos <command> [options]',\n '',\n 'Commands:',\n ' init Scaffold a new integration project into ./<slug> (--slug <slug> --yes)',\n ' validate Validate ekanos.json + the integration definition (--json)',\n ' dev Scaffold .ekanos/harness and run it with your own Next',\n ' test Run the project test script via its package manager (--json).',\n ' For a vitest test script, also renders a curated failures',\n ' appendix from a JSON reporter report; --raw skips that and',\n ' the reporter injection entirely.',\n ' login Authenticate against an Ekanos host in a browser (--host <url>;',\n ' offers to add the Ekanos docs to Claude Code: --claude|--no-claude;',\n ' a host you have never used asks first, or needs --trust-host)',\n ' logout Revoke and delete the stored session (--host <url> | --all)',\n ' whoami Print the identity the stored session authenticates as, plus',\n ' a compact list of the sources you hold a seat on',\n \" status Show login state and this project's submissions on the host\",\n ' (--findings for full gate findings, --all to expand other',\n ' integrations in the source, --watch to block until this',\n \" project's current version reaches a gate verdict)\",\n ' sources List every source you hold a developer/source-admin seat on |',\n ' products [--source <slug>] (each product, Experience or',\n ' Integration, and whether it is enabled for the Source) |',\n ' products enable <product> | products disable <product> --yes',\n ' (a super-admin grant: an \"ekanos login\" session is refused',\n ' and pointed at /admin) | scopes (each product scope: its',\n ' products and how many teams hold it; a team sees in the app',\n \" only its scopes' products) | scopes add <scope> <product> |\",\n ' scopes remove <scope> <product> --yes',\n ' catalog What a source can already use, and how to set it up',\n ' (\"ekanos catalog [<product-slug>] --source <slug>\", --json)',\n \" apps The Source's app for an integration teams sign in through:\",\n ' show <product> | set <product> (Source admin; takes the secret',\n ' at your terminal, Enter keeps a saved value) | connect',\n ' <product> [--no-wait] (one',\n \" connection for the whole Source, used by the Source's provided\",\n ' agents in every team) | disconnect <product> [--yes] (a',\n ' script or agent run needs --yes) | list',\n \" teams A Source's teams, for the Source admin:\",\n ' create <name> [--slug <slug>] [--owner <email>] (you own it',\n ' unless --owner, who is invited as owner) |',\n ' rename <team> <name> (the slug follows the name, as in the app) |',\n ' members list <team> | members invite <team> <email> [--role',\n ' <role>] (default member; sends the invitation email) |',\n ' members role <team> <email> <role> | members remove <team>',\n \" <email> --yes | roles list <team> (each role's permissions) |\",\n ' connect <team> <product> [--connection <id>] [--as',\n ' <member-email>] [--no-wait] [--no-open] [--link-only]',\n ' [--reconnect] (connects',\n \" it: asks the form's fields at your terminal, or opens the\",\n ' sign-in for you or the member --as names and waits;',\n \" --connection agent installs the team's Linear agent (its own\",\n ' Linear app, as a member), which @mention and assign triggers',\n \" need; --link-only prints the team's page; --reconnect connects\",\n ' it again when it reads as connected but is broken: a revoked or',\n ' expired sign-in) |',\n ' connect <team> slack|linear-app [--as <member-email>] (installs',\n ' Slack, or the Ekanos Agents app for Linear, which slack and',\n ' linear triggers answer through; same link-and-wait) |',\n \" disconnect <team> <product> --yes (takes the team's connection\",\n \" and its tokens down; its own app's saved fields stay) |\",\n ' list | show <team> (one screen: members, each integration and',\n ' whose connection it is, each agent live or the next step) |',\n ' show <team> <product> (a checklist: fields, callback',\n ' URLs, webhooks, connect link) | app set <team> <product>',\n ' [--connection <id>] [--field <name>]… [--set <name>=<value>]…',\n ' [--clear <name>]… (any one field at a time; a field you skip',\n ' keeps its saved value; secrets only at your terminal) |',\n ' webhook <team> <product> [<webhook-id>] [--yes] (URL saved to a 0600 file under ~/.ekanos/secrets, never printed) |',\n ' events <team> [<product>] [--product <slug>] [--since 24h|7d|<date>]',\n ' [--limit <n>] (the integration events recorded for the team, each',\n ' with its status, last error and the runs it started, or why none did)',\n ' | scope show <team> (the product scopes it holds and the products',\n ' it sees in the app) | scope set <team> <scope> [<scope>…] [--yes]',\n ' (replaces them; dropping one needs --yes)',\n \" A team's agents, for the Source admin (teams <area> <verb> <team> …):\",\n ' agents list <team> | agents show <team> <key> (is it live, and if',\n ' not, why: each connection and whose it is, each trigger and how its',\n ' events arrive, last event and run, one Next command)',\n ' | agents enable <team> <key> [--as <member-email>]',\n ' [--draft] [--confirm-access] (--confirm-access: you also confirm',\n ' what it may use) | agents confirm <team> <key> (you confirm what',\n ' it may use, as yourself: whoever sets an agent up confirms it, never',\n ' a team member) | agents disable <team> <key> --yes | agents',\n ' unpin <team> <key> | agents pin <team> <key> <version> | agents pin',\n ' <team> <key> --draft (this team only runs the unpublished draft, by',\n ' hand, every write waiting; the next publish puts it back to',\n ' following)',\n ' | agents policy <team> <key> [set <tool> auto|approve | unset <tool>]',\n ' [--reads auto|approve] [--writes auto|approve] [--confirm-access]',\n ' | agents skills <team> <key> [add|remove <skill>] (where the',\n ' template allows team skills; its own skills stay)',\n ' triggers list|add|remove <team> <key> … (add … event <id>',\n \" [--filter field=a,b]… or --filter '<json>'; remove <trigger-id|key> --yes;\",\n ' add … slack --channel',\n ' <#name|id>… [--dms] --yes | add … linear [--label <name>]…',\n ' [--no-mention], once installed with teams connect) | triggers',\n \" rotate <team> <key> <trigger-key|id> [--yes] (a webhook trigger's\",\n ' new token, the old one revoked; saved to a 0600 file, never printed) | links list|add|remove',\n ' <team> <from-key> [<to-key> --kind talk|delegate --mode await|handoff]',\n ' (remove <link-id|to-key> [--kind <kind>] --yes)',\n ' | mcp list|add|status|token|effect|remove <team> [<server-key> …]',\n ' (remove needs --yes)',\n ' Every area also takes the team as --team <slug>.',\n ' (\"ekanos teams --help\" spells out each area)',\n ' reviewers Who decides agent reply drafts, for the Source admin:',\n ' list | add <email> --reach source|team [--team <slug>] |',\n ' remove <email> [--team <slug>] --yes',\n \" routes Route a Source connection's events to teams, for the Source admin:\",\n ' list [<product>] | options <product> | set <product> <value> <team>',\n ' [--label <name>] | remove <product> <value> --yes | webhook',\n ' <product> [--webhook <id>] [--yes] (URL saved to a 0600 file, never printed; --yes',\n ' replaces a live one, revoking it) | unrouted [<product>] |',\n ' replay <event-id>',\n \" agents The source's agent templates, held by Ekanos:\",\n ' init [<dir>] [--claude|--no-claude] (skills + docs MCP for designing',\n ' agents with Claude; offers to add the docs to Claude Code)',\n ' list [--all] (--all: archived agents too) | show <key> |',\n ' pull <key> [--out <dir>] [--force] (--force: overwrite local',\n ' files that differ; without it the pull refuses and writes nothing)',\n ' apply <dir|file> [--base-version <n>] [--overwrite]',\n ' archive <key> --yes (refused while any team has it on; lists',\n ' each team and the command to turn it off) | unarchive <key>',\n ' publish <key> [--to <n>] [--confirm-access] --yes | rollback <key>',\n ' --to <n> [--confirm-access] --yes (every following team moves; one',\n ' that had confirmed stays confirmed, in your name: your publish is the',\n ' confirmation; --confirm-access: you also confirm every team on that',\n ' version not yet confirmed; the output lists teams pinned elsewhere)',\n ' test <key> --team <slug> (--prompt \"…\" | --input <file.json>)',\n ' [--follow] (runs the latest, unpublished version on one team;',\n ' same grant, policy, approvals and audit; marked as a test; to',\n ' test a tool the draft adds, first \"teams agents pin <team> <key>',\n ' --draft\", which also works before anything is published)',\n ' apply also pushes <dir>/skills/<slug>/ folders first and names',\n ' them in the agent (--no-skills skips that)',\n ' Edit one template in place (stores a draft version; --publish',\n ' also rolls it out, with --yes):',\n ' policy <key> [set <tool> auto|approve | unset <tool>]',\n ' [--reads auto|approve] [--writes auto|approve]',\n ' triggers <key> [list | add event <k> --event <slug.event>',\n \" [--filter field=a,b]... (or one --filter '<json>') | add\",\n ' schedule <k> --cron \"<expr>\"',\n ' [--timezone <tz>] --prompt <text> | add webhook <k> --prompt',\n ' <text> | remove <k>] [--prompt <text>] [--disabled]',\n ' links <key> [list | add <to-key> --kind talk|delegate',\n ' [--mode await|handoff] | remove <to-key> [--kind <kind>]]',\n ' overrides <key> [enable|disable policy|triggers|links]',\n ' (off: teams follow the template exactly; on: teams keep',\n ' their own differences)',\n \" skills The source's skills (SKILL.md folders), held by Ekanos:\",\n ' list [--team <t>] | show <slug> [--team <t>] |',\n ' push <dir> [--team <t>] (a new version, live at once; created',\n ' on first push, \"unchanged\" when identical; --team: that team\\'s',\n ' own skill, no other team sees it) | pull <slug> [--out <dir>]',\n ' [--force] (refuses to overwrite a local file that differs)',\n ' | archive <slug> [--team <t>] --yes (refused while an agent',\n ' names it or a team agent has it attached; lists each and the',\n ' command that stops it) | unarchive <slug> [--team <t>]',\n \" knowledge The Source's Knowledge base (markdown articles), for the Source admin:\",\n ' list [--team <t>] | push <dir> [--team <t>] (each .md file an',\n ' article: title from frontmatter or the first heading, tags from',\n ' frontmatter; upserts by path, \"unchanged\" when identical;',\n ' --prune [--yes] also deletes the articles an earlier push of',\n ' this folder made whose files are gone, never ones written or',\n ' edited in the app) |',\n \" search <query> --team <t> (as that team's agents search: its\",\n ' articles plus General) | pull [--team <t>] [--out <dir>]',\n ' [--force] (refuses to overwrite a local file that differs)',\n \" Without --team: General, which every team's agents granted\",\n ' search_knowledge read.',\n \" runs Run and inspect a team's agents, as the Source admin:\",\n ' start <agent-key> --team <slug> (--prompt \"…\" | --input',\n ' <file.json>) [--follow] | list --team <slug> [--agent <key>]',\n ' [--status <status>] [--since 24h|7d|<date>] |',\n ' show <run-id> --team <slug> (--json: transcript, tool calls,',\n ' how each was authorized, approvals) | cancel <run-id> --team',\n ' <slug> [--yes] (stops a live run; asks first, --yes in a script)',\n \" approvals What a team's agent runs wait on: list --team <slug> |\",\n ' approve|reject <id> --team <slug> [--reason \"…\"] |',\n ' edit <id> --team <slug> --body <file> (edit & send a reply draft)',\n ' use Set this project\\'s publish target (\"ekanos use <source-slug>\")',\n ' publish Validate, pack and submit the integration to an Ekanos host',\n ' upgrade Move this toolchain to a coherent target version, with',\n ' verify-and-rollback (--check --yes --no-verify --host <url>)',\n '',\n 'Keeping the toolchain current:',\n ' validate, dev and publish all check for a newer @ekanos/cli in the',\n ' background (never blocking, silenced by EKANOS_NO_UPDATE_CHECK) and warn',\n ' on stderr when one exists. Run \"ekanos upgrade --check\" any time a',\n ' validate finding smells like version skew (an unrecognized-key error you',\n ' are confident is correct) — it is read-only and safe to run freely. A',\n ' bare \"ekanos upgrade\" MUTATES the project (installs the target versions,',\n ' verifies with validate + the test script, rolls back on any failure).',\n '',\n 'Host resolution (logout, whoami, status, sources, catalog, apps, teams, reviewers, routes, agents, skills, knowledge, runs, approvals, use, publish, upgrade):',\n ' --host, else EKANOS_HOST, else the \"host\" field in ekanos.json, else the',\n ' sole stored login. \"ekanos publish\" saves host and source to ekanos.json.',\n ' \"ekanos login\" never reads ekanos.json for a host (--host, else',\n ' EKANOS_HOST, else the sole stored login) — it is the verb that creates',\n ' credentials, so a committed file must never choose where they go. A',\n ' host you have never logged in to is shown with its sign-in domain and',\n ' asked about first (--trust-host when nobody can be asked). A remote',\n ' http:// host is refused by every verb that sends credentials.',\n '',\n 'Publish targeting (see \"ekanos sources\" / \"ekanos use\"):',\n ' publish refuses (FORBIDDEN) a source you hold no seat on. With multiple',\n ' seats and an implicit (ekanos.json) source, a human run asks to confirm',\n ' the target; a scripted/JSON run needs --source or --yes to proceed —',\n ' it never prompts and never guesses.',\n '',\n 'Global options:',\n ' --json Emit a single JSON envelope on stdout (auto-on when piped);',\n ' --no-json forces the human-readable form',\n ' --version Print the CLI version',\n ' --help Show this help',\n].join('\\n');\n\nexport interface RunOptions {\n stdout?: WriteStream;\n stderr?: WriteStream;\n env?: Record<string, string | undefined>;\n cwd?: string;\n /**\n * Test-only override for `publish`'s interactive-confirm gate and `init`\n * / `login`'s clack wizard gate (`canWizard` in `wizard.ts`) — see\n * `PublishArgs` in `commands/publish.ts`. Never set this from real CLI\n * wiring; it exists so a test can exercise the human y/N confirm branch or\n * the wizard flow without a real terminal.\n */\n stdinIsTTY?: boolean;\n confirm?: (question: string) => Promise<boolean>;\n /** Test-only answers for `apps set` / `teams app set` questions — never set from real CLI wiring. */\n ask?: (question: string) => Promise<string>;\n askSecret?: (question: string) => Promise<string>;\n /**\n * Test-only seams for `teams connect`: the browser opener and the wait\n * between its polls. Never set from real CLI wiring.\n */\n openUrl?: (url: string) => void;\n pollDelayMs?: number;\n /**\n * Test-only override for `status --watch`'s poll delay — see `StatusArgs`\n * in `commands/status.ts`. Never set this from real CLI wiring; it exists\n * so a test can exercise the poll loop without waiting 30s per iteration.\n */\n sleep?: (ms: number) => Promise<void>;\n /**\n * Test-only override for `status`'s AGE column (\"now\") — see `StatusArgs`\n * in `commands/status.ts`. Never set this from real CLI wiring; it exists\n * so a test can assert an exact `relativeTime` string deterministically.\n */\n now?: Date;\n}\n\n/**\n * The single entry point. Resolves the agent-native envelope once, dispatches\n * to a verb, and guarantees exactly one terminal emission (success or error).\n * Returns the process exit code — `bin.ts` is the only place that calls\n * `process.exit`, so this stays fully testable.\n */\nexport async function run(\n argv: readonly string[],\n options: RunOptions = {},\n): Promise<number> {\n const jsonFlag = scanJsonFlag(argv);\n const ctx = new CliContext({\n jsonFlag,\n stdout: options.stdout,\n stderr: options.stderr,\n env: options.env,\n });\n const cwd = options.cwd ?? process.cwd();\n const env = options.env ?? process.env;\n\n try {\n // `--version` is global and verb-independent, so it is answered before the\n // command is even resolved: `ekanos --version` and `ekanos validate\n // --version` both report the tool's version and exit 0.\n if (scanFlagPresence(argv, 'version')) {\n return emitVersion(ctx);\n }\n\n const { command, rest } = splitCommand(argv);\n\n // Top-level help / no command.\n if (!command) {\n if (scanFlagPresence(rest, 'help') || argv.length === 0) {\n return emitHelp(ctx);\n }\n // A leading token that is not a command (e.g. `--nonsense`).\n ctx.emitClaudeCodeHint({\n tool: 'ekanos',\n error: 'unknown-command',\n commands: COMMANDS,\n usage: USAGE,\n });\n throw usageError(\n `Unknown command or flag \"${argv[0]}\".`,\n `Run one of: ${COMMANDS.join(', ')}. See \"ekanos --help\".`,\n );\n }\n\n if (!COMMANDS.includes(command)) {\n ctx.emitClaudeCodeHint({\n tool: 'ekanos',\n error: 'unknown-command',\n given: command,\n commands: COMMANDS,\n usage: USAGE,\n });\n throw usageError(\n `Unknown command \"${command}\".`,\n `Run one of: ${COMMANDS.join(', ')}. See \"ekanos --help\".`,\n );\n }\n\n const specs: FlagSpecs = { ...GLOBAL_SPECS, ...COMMAND_SPECS[command] };\n const parsed = parseArgv(rest, specs);\n\n if (parsed.flags.help === true) {\n return emitCommandHelp(ctx, command);\n }\n\n const positionalNames = POSITIONAL_COMMANDS[command] ?? [];\n\n if (positionalNames.length === 0 && parsed.positionals.length > 0) {\n throw usageError(\n `\"${command}\" takes no positional arguments (got \"${parsed.positionals[0]}\").`,\n `Pass options as flags, e.g. \"--dir <path>\". See \"ekanos ${command} --help\".`,\n );\n }\n\n if (parsed.positionals.length > positionalNames.length) {\n const usage = positionalNames.map((name) => `<${name}>`).join(' ');\n throw usageError(\n `\"${command}\" takes at most ${positionalNames.length} positional ` +\n `argument${positionalNames.length === 1 ? '' : 's'} (${usage}), ` +\n `got ${parsed.positionals.length}.`,\n `e.g. \"ekanos ${command} ${usage}\". See \"ekanos ${command} --help\".`,\n );\n }\n\n const dir = (parsed.flags.dir as string | undefined) ?? cwd;\n\n switch (command) {\n case 'init':\n return await runInit(ctx, {\n slug: parsed.flags.slug as string | undefined,\n dir: parsed.flags.dir as string | undefined,\n cwd,\n force: parsed.flags.force === true,\n yes: parsed.flags.yes === true,\n docs: parsed.flags.docs as string[] | undefined,\n stdinIsTTY: options.stdinIsTTY,\n });\n case 'validate':\n return await runValidate(ctx, { dir, env });\n case 'dev':\n return await runDev(ctx, {\n dir,\n port: parsed.flags.port as string | undefined,\n host: parsed.flags.host as string | undefined,\n force: parsed.flags.force === true,\n start: parsed.flags.start as boolean | undefined,\n env,\n });\n case 'test':\n return await runTest(ctx, {\n dir,\n passthrough: parsed.passthrough,\n raw: parsed.flags.raw === true,\n });\n case 'login':\n return await runLogin(ctx, {\n host: parsed.flags.host as string | undefined,\n force: parsed.flags.force === true,\n claude: parsed.flags.claude as boolean | undefined,\n trustHost: parsed.flags['trust-host'] === true,\n confirmHost: options.confirm,\n cwd,\n env,\n stdinIsTTY: options.stdinIsTTY,\n });\n case 'logout':\n return await runLogout(ctx, {\n host: parsed.flags.host as string | undefined,\n all: parsed.flags.all === true,\n cwd,\n env,\n });\n case 'whoami':\n return await runWhoami(ctx, {\n host: parsed.flags.host as string | undefined,\n cwd,\n env,\n });\n case 'status':\n return await runStatus(ctx, {\n host: parsed.flags.host as string | undefined,\n dir,\n env,\n findings: parsed.flags.findings === true,\n all: parsed.flags.all === true,\n watch: parsed.flags.watch === true,\n sleep: options.sleep,\n now: options.now,\n });\n case 'sources':\n return await runSources(ctx, {\n host: parsed.flags.host as string | undefined,\n positionals: parsed.positionals,\n source: parsed.flags.source as string | undefined,\n yes: parsed.flags.yes === true,\n dir,\n env,\n });\n case 'catalog':\n return await runCatalog(ctx, {\n host: parsed.flags.host as string | undefined,\n source: parsed.flags.source as string | undefined,\n product: parsed.positionals[0],\n dir,\n env,\n });\n case 'apps':\n return await runApps(ctx, {\n host: parsed.flags.host as string | undefined,\n source: parsed.flags.source as string | undefined,\n subcommand: parsed.positionals[0],\n product: parsed.positionals[1],\n dir,\n env,\n stdinIsTTY: options.stdinIsTTY,\n ask: options.ask,\n askSecret: options.askSecret,\n confirm: options.confirm,\n noWait: parsed.flags['no-wait'] === true,\n yes: parsed.flags.yes === true,\n });\n case 'teams':\n return await runTeams(ctx, {\n host: parsed.flags.host as string | undefined,\n source: parsed.flags.source as string | undefined,\n positionals: parsed.positionals,\n connection: parsed.flags.connection as string | undefined,\n slug: parsed.flags.slug as string | undefined,\n owner: parsed.flags.owner as string | undefined,\n role: parsed.flags.role as string | undefined,\n yes: parsed.flags.yes === true,\n noWait: parsed.flags['no-wait'] === true,\n noOpen: parsed.flags.open === false,\n linkOnly: parsed.flags['link-only'] === true,\n reconnect: parsed.flags.reconnect === true,\n flags: parsed.flags,\n dir,\n env,\n stdinIsTTY: options.stdinIsTTY,\n ask: options.ask,\n askSecret: options.askSecret,\n openUrl: options.openUrl,\n pollDelayMs: options.pollDelayMs,\n });\n case 'reviewers':\n return await runReviewers(ctx, {\n host: parsed.flags.host as string | undefined,\n source: parsed.flags.source as string | undefined,\n positionals: parsed.positionals,\n reach: parsed.flags.reach as string | undefined,\n team: parsed.flags.team as string | undefined,\n yes: parsed.flags.yes === true,\n dir,\n env,\n });\n case 'routes':\n return await runRoutes(ctx, {\n host: parsed.flags.host as string | undefined,\n source: parsed.flags.source as string | undefined,\n positionals: parsed.positionals,\n label: parsed.flags.label as string | undefined,\n webhook: parsed.flags.webhook as string | undefined,\n yes: parsed.flags.yes === true,\n dir,\n env,\n });\n case 'agents':\n return await runAgents(ctx, {\n host: parsed.flags.host as string | undefined,\n source: parsed.flags.source as string | undefined,\n subcommand: parsed.positionals[0],\n target: parsed.positionals[1],\n to: parsed.flags.to as string | undefined,\n baseVersion: parsed.flags['base-version'] as string | undefined,\n overwrite: parsed.flags.overwrite === true,\n out: parsed.flags.out as string | undefined,\n yes: parsed.flags.yes === true,\n all: parsed.flags.all === true,\n force: parsed.flags.force === true,\n claude: parsed.flags.claude as boolean | undefined,\n skills: parsed.flags.skills as boolean | undefined,\n rest: parsed.positionals.slice(2),\n event: parsed.flags.event as string | undefined,\n filter: parsed.flags.filter as string[] | undefined,\n disabled: parsed.flags.disabled === true,\n cron: parsed.flags.cron as string | undefined,\n timezone: parsed.flags.timezone as string | undefined,\n kind: parsed.flags.kind as string | undefined,\n mode: parsed.flags.mode as string | undefined,\n reads: parsed.flags.reads as string | undefined,\n writes: parsed.flags.writes as string | undefined,\n publish: parsed.flags.publish === true,\n confirmAccess: parsed.flags['confirm-access'] === true,\n dir,\n env,\n stdinIsTTY: options.stdinIsTTY,\n confirm: options.confirm,\n team: parsed.flags.team as string | undefined,\n prompt: parsed.flags.prompt as string | undefined,\n input: parsed.flags.input as string | undefined,\n follow: parsed.flags.follow === true,\n });\n case 'runs':\n case 'approvals':\n return await (command === 'runs' ? runRuns : runApprovals)(ctx, {\n host: parsed.flags.host as string | undefined,\n source: parsed.flags.source as string | undefined,\n positionals: parsed.positionals,\n team: parsed.flags.team as string | undefined,\n agent: parsed.flags.agent as string | undefined,\n status: parsed.flags.status as string | undefined,\n since: parsed.flags.since as string | undefined,\n prompt: parsed.flags.prompt as string | undefined,\n input: parsed.flags.input as string | undefined,\n follow: parsed.flags.follow === true,\n reason: parsed.flags.reason as string | undefined,\n body: parsed.flags.body as string | undefined,\n yes: parsed.flags.yes === true,\n dir,\n env,\n sleep: options.sleep,\n stdinIsTTY: options.stdinIsTTY,\n confirm: options.confirm,\n });\n case 'skills':\n return await runSkills(ctx, {\n host: parsed.flags.host as string | undefined,\n source: parsed.flags.source as string | undefined,\n subcommand: parsed.positionals[0],\n target: parsed.positionals[1],\n team: parsed.flags.team as string | undefined,\n out: parsed.flags.out as string | undefined,\n force: parsed.flags.force === true,\n yes: parsed.flags.yes === true,\n dir,\n env,\n stdinIsTTY: options.stdinIsTTY,\n confirm: options.confirm,\n });\n case 'knowledge':\n return await runKnowledge(ctx, {\n host: parsed.flags.host as string | undefined,\n source: parsed.flags.source as string | undefined,\n subcommand: parsed.positionals[0],\n target: parsed.positionals[1],\n team: parsed.flags.team as string | undefined,\n out: parsed.flags.out as string | undefined,\n force: parsed.flags.force === true,\n prune: parsed.flags.prune === true,\n yes: parsed.flags.yes === true,\n dir,\n env,\n stdinIsTTY: options.stdinIsTTY,\n confirm: options.confirm,\n });\n case 'use':\n return await runUse(ctx, {\n host: parsed.flags.host as string | undefined,\n dir,\n slug: parsed.positionals[0],\n env,\n });\n case 'publish':\n return await runPublish(ctx, {\n host: parsed.flags.host as string | undefined,\n source: parsed.flags.source as string | undefined,\n dir,\n yes: parsed.flags.yes === true,\n env,\n stdinIsTTY: options.stdinIsTTY,\n confirm: options.confirm,\n });\n case 'upgrade':\n return await runUpgrade(ctx, {\n dir,\n host: parsed.flags.host as string | undefined,\n env,\n check: parsed.flags.check === true,\n yes: parsed.flags.yes === true,\n noVerify: parsed.flags.verify === false,\n stdinIsTTY: options.stdinIsTTY,\n confirm: options.confirm,\n });\n default:\n // Unreachable — COMMANDS gate above — but keeps the switch total.\n throw usageError(\n `Unknown command \"${command}\".`,\n `Run one of: ${COMMANDS.join(', ')}.`,\n );\n }\n } catch (error) {\n return ctx.fail(toCliError(error));\n }\n}\n\n/**\n * Presence of `--json` (or `--no-json`) BEFORE the first `--` passthrough.\n *\n * Tri-state on purpose. `undefined` means \"the user expressed no preference\",\n * which is what lets the context fall back to inferring the mode from a\n * non-TTY stdout or CLAUDECODE. Collapsing `--no-json` to `false` here would\n * make it indistinguishable from absence, and the flag could then never turn\n * JSON mode OFF in exactly the cases it exists for.\n */\nfunction scanJsonFlag(argv: readonly string[]): boolean | undefined {\n for (const token of argv) {\n if (token === '--') break;\n if (token === '--json') return true;\n if (token === '--no-json') return false;\n }\n return undefined;\n}\n\nfunction scanFlagPresence(argv: readonly string[], name: string): boolean {\n for (const token of argv) {\n if (token === '--') break;\n if (token === `--${name}`) return true;\n }\n return false;\n}\n\n/**\n * Split argv into the command (first bare token before `--`) and the rest\n * (everything else, order preserved, including global flags and the `--`\n * passthrough). Global flags are all booleans, so any bare token is the\n * command — no value-consumption ambiguity.\n */\nfunction splitCommand(argv: readonly string[]): {\n command: string | null;\n rest: string[];\n} {\n for (let i = 0; i < argv.length; i++) {\n const token = argv[i]!;\n if (token === '--') break;\n if (!token.startsWith('-')) {\n return {\n command: token,\n rest: [...argv.slice(0, i), ...argv.slice(i + 1)],\n };\n }\n }\n return { command: null, rest: [...argv] };\n}\n\n/**\n * The CLI's own version, read from the package manifest at runtime rather than\n * baked in by the build — one source of truth, so a release bump cannot leave\n * `--version` reporting a stale number. The path resolves identically from\n * `src/index.ts` and from the emitted `dist/index.js`, both of which sit one\n * directory below the package root.\n */\nfunction readVersion(): string {\n const manifest = new URL('../package.json', import.meta.url);\n const parsed: unknown = JSON.parse(fs.readFileSync(manifest, 'utf8'));\n\n return typeof parsed === 'object' &&\n parsed !== null &&\n 'version' in parsed &&\n typeof parsed.version === 'string'\n ? parsed.version\n : '0.0.0';\n}\n\nfunction emitVersion(ctx: CliContext): number {\n const version = readVersion();\n\n return ctx.succeed({ name: 'ekanos', version }, version);\n}\n\nconst DOCS_FOOTER = `\\nDocs: ${SDK_DOCS_URL} (commands: ${docsPage('cli/commands')})`;\n\nfunction emitHelp(ctx: CliContext): number {\n ctx.emitClaudeCodeHint({\n tool: 'ekanos',\n commands: COMMANDS,\n usage: USAGE,\n exitCodes: EXIT_CODES,\n });\n return ctx.succeed(\n { usage: USAGE, commands: COMMANDS, docs: SDK_DOCS_URL },\n `${USAGE}${DOCS_FOOTER}`,\n );\n}\n\n/** The per-area usage a command's own parser already gives, shown in its help too. */\nconst COMMAND_DETAILS: Record<string, () => string[]> = {\n teams: () => TEAM_AGENT_AREAS.map(usageFor),\n agents: () =>\n Object.entries(TEMPLATE_EDIT_HELP).map(\n ([area, examples]) => `${area}: ${examples}`,\n ),\n};\n\n/** A command's block of the top-level usage: its line and the indented ones under it. */\nfunction commandUsage(command: string): string {\n const lines = USAGE.split('\\n');\n const start = lines.findIndex((line) => line.startsWith(` ${command} `));\n if (start === -1) return '';\n const end = lines.findIndex(\n (line, index) => index > start && !line.startsWith(' '),\n );\n return lines.slice(start, end === -1 ? undefined : end).join('\\n');\n}\n\nfunction optionLabel(name: string, spec: FlagSpec): string {\n if (spec.type === 'boolean') return `--${name}`;\n return `--${name} <value>${spec.repeatable ? '…' : ''}`;\n}\n\n/**\n * `ekanos <command> --help`: the command's block of the usage (its\n * subcommands, each described), the per-area usage its parser gives, and\n * every flag with its description. The JSON envelope carries the same, so an\n * agent reading it is not left with flag names only.\n */\nfunction emitCommandHelp(ctx: CliContext, command: string): number {\n const specs = COMMAND_SPECS[command] ?? {};\n const flags = Object.keys(specs).map((name) => `--${name}`);\n const usage = commandUsage(command);\n const details = COMMAND_DETAILS[command]?.() ?? [];\n const options = [\n ...Object.entries(specs),\n ...Object.entries(GLOBAL_SPECS),\n ].map(([name, spec]) => ({\n flag: `--${name}`,\n label: optionLabel(name, spec),\n takesValue: spec.type === 'string',\n repeatable: spec.repeatable === true,\n description: spec.description ?? '',\n }));\n const positionals = POSITIONAL_COMMANDS[command] ?? [];\n const synopsis = [\n `ekanos ${command}`,\n positionals.length === 0\n ? ''\n : positionals.length === 1\n ? ` <${positionals[0]}>`\n : ` <${positionals[0]}> …`,\n ' [options]',\n ].join('');\n const docs = docsPage('cli/commands', command);\n const width = Math.min(\n 26,\n Math.max(...options.map((option) => option.label.length)),\n );\n const human = [\n `Usage: ${synopsis}`,\n ...(usage ? ['', usage] : []),\n ...(details.length > 0 ? ['', ...details] : []),\n '',\n 'Options:',\n ...options.map((option) =>\n option.label.length > width\n ? ` ${option.label}\\n ${' '.repeat(width)} ${option.description}`\n : ` ${option.label.padEnd(width)} ${option.description}`,\n ),\n '',\n `Docs: ${docs}`,\n ].join('\\n');\n ctx.emitClaudeCodeHint({ tool: 'ekanos', command, flags, usage });\n return ctx.succeed(\n {\n command,\n flags,\n usage,\n details,\n options: options.map(({ label: _label, ...option }) => option),\n docs,\n },\n human,\n );\n}\n"]}
@@ -1,4 +1,11 @@
1
1
  import { z } from 'zod';
2
+ /**
3
+ * A slug `knowledge pull` may turn into `<slug>.md` under its folder: the
4
+ * host's `knowledge_articles.slug` shape (`[a-z0-9][a-z0-9._/-]*`, at most
5
+ * 200), with no empty, `.`-led (so no `.` or `..`) folder. The DB CHECK alone
6
+ * admits `a/../b`; a slug is host-supplied, so the CLI holds the line itself.
7
+ */
8
+ export declare function isSafeKnowledgeSlug(slug: string): boolean;
2
9
  declare const ArticleSchema: z.ZodObject<{
3
10
  id: z.ZodString;
4
11
  slug: z.ZodString;
@@ -106,6 +113,45 @@ export declare const KnowledgeSearchSchema: z.ZodObject<{
106
113
  updatedAt: z.ZodString;
107
114
  }, z.core.$strip>>;
108
115
  }, z.core.$strip>;
116
+ declare const PruneArticleSchema: z.ZodObject<{
117
+ slug: z.ZodString;
118
+ title: z.ZodString;
119
+ version: z.ZodNumber;
120
+ }, z.core.$strip>;
121
+ export type KnowledgePruneArticle = z.infer<typeof PruneArticleSchema>;
122
+ /**
123
+ * `push --prune`: `candidates` are the articles an earlier push of `origin`
124
+ * made whose files are gone and that nobody edited since; `edited` the ones
125
+ * kept because someone did; `deleted` what this call removed (none for a
126
+ * preview, which sends no `delete`).
127
+ */
128
+ export declare const KnowledgePruneSchema: z.ZodObject<{
129
+ source: z.ZodObject<{
130
+ id: z.ZodString;
131
+ slug: z.ZodString;
132
+ name: z.ZodNullable<z.ZodString>;
133
+ }, z.core.$strip>;
134
+ team: z.ZodNullable<z.ZodObject<{
135
+ slug: z.ZodString;
136
+ name: z.ZodString;
137
+ }, z.core.$strip>>;
138
+ origin: z.ZodString;
139
+ candidates: z.ZodArray<z.ZodObject<{
140
+ slug: z.ZodString;
141
+ title: z.ZodString;
142
+ version: z.ZodNumber;
143
+ }, z.core.$strip>>;
144
+ edited: z.ZodArray<z.ZodObject<{
145
+ slug: z.ZodString;
146
+ title: z.ZodString;
147
+ version: z.ZodNumber;
148
+ }, z.core.$strip>>;
149
+ deleted: z.ZodArray<z.ZodObject<{
150
+ slug: z.ZodString;
151
+ title: z.ZodString;
152
+ version: z.ZodNumber;
153
+ }, z.core.$strip>>;
154
+ }, z.core.$strip>;
109
155
  export interface KnowledgePushArticle {
110
156
  slug: string;
111
157
  title: string;
@@ -6,7 +6,8 @@ import { authRequiredError, forbiddenError, networkError, notFoundError, usageEr
6
6
  * collection every team reads, and each team's own.
7
7
  *
8
8
  * GET /api/partner/knowledge?source=<slug>[&team=<slug>][&body=1]
9
- * POST /api/partner/knowledge { source, team?, articles: [...] }
9
+ * POST /api/partner/knowledge { source, team?, origin?, articles: [...] }
10
+ * POST /api/partner/knowledge/prune { source, team?, origin, keep, delete? }
10
11
  * GET /api/partner/knowledge/search?source=<slug>&team=<slug>&q=<query>[&limit=<n>]
11
12
  *
12
13
  * → 401 / 3xx refresh once and retry
@@ -25,6 +26,17 @@ const SourceRefSchema = z.object({
25
26
  const TeamRefSchema = z
26
27
  .object({ slug: z.string(), name: z.string() })
27
28
  .nullable();
29
+ /**
30
+ * A slug `knowledge pull` may turn into `<slug>.md` under its folder: the
31
+ * host's `knowledge_articles.slug` shape (`[a-z0-9][a-z0-9._/-]*`, at most
32
+ * 200), with no empty, `.`-led (so no `.` or `..`) folder. The DB CHECK alone
33
+ * admits `a/../b`; a slug is host-supplied, so the CLI holds the line itself.
34
+ */
35
+ export function isSafeKnowledgeSlug(slug) {
36
+ if (!/^[a-z0-9][a-z0-9._/-]{0,199}$/.test(slug))
37
+ return false;
38
+ return slug.split('/').every((part) => part !== '' && !part.startsWith('.'));
39
+ }
28
40
  const ArticleSchema = z.object({
29
41
  id: z.string(),
30
42
  slug: z.string(),
@@ -67,6 +79,25 @@ export const KnowledgeSearchSchema = z.object({
67
79
  query: z.string(),
68
80
  results: z.array(HitSchema),
69
81
  });
82
+ const PruneArticleSchema = z.object({
83
+ slug: z.string(),
84
+ title: z.string(),
85
+ version: z.number(),
86
+ });
87
+ /**
88
+ * `push --prune`: `candidates` are the articles an earlier push of `origin`
89
+ * made whose files are gone and that nobody edited since; `edited` the ones
90
+ * kept because someone did; `deleted` what this call removed (none for a
91
+ * preview, which sends no `delete`).
92
+ */
93
+ export const KnowledgePruneSchema = z.object({
94
+ source: SourceRefSchema,
95
+ team: TeamRefSchema,
96
+ origin: z.string(),
97
+ candidates: z.array(PruneArticleSchema),
98
+ edited: z.array(PruneArticleSchema),
99
+ deleted: z.array(PruneArticleSchema),
100
+ });
70
101
  /** Articles per POST; the host refuses more. */
71
102
  export const KNOWLEDGE_PUSH_BATCH = 50;
72
103
  const BASE = '/api/partner/knowledge';
@@ -1 +1 @@
1
- {"version":3,"file":"knowledge-api.js","sourceRoot":"","sources":["../src/knowledge-api.ts"],"names":[],"mappings":"AAAA,OAA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["import { z } from 'zod';\n\nimport { request } from './auth/ekanos-api';\nimport {\n authRequiredError,\n forbiddenError,\n networkError,\n notFoundError,\n usageError,\n} from './errors';\n\n/**\n * The CLI's client for a Source's Knowledge (plan 244): the General\n * collection every team reads, and each team's own.\n *\n * GET /api/partner/knowledge?source=<slug>[&team=<slug>][&body=1]\n * POST /api/partner/knowledge { source, team?, articles: [...] }\n * GET /api/partner/knowledge/search?source=<slug>&team=<slug>&q=<query>[&limit=<n>]\n *\n * → 401 / 3xx refresh once and retry\n * → 403 { code: \"SOURCE_ADMIN_REQUIRED\" | \"MFA_REQUIRED\" | \"FORBIDDEN\" }\n * → 404 { code: \"TEAM_NOT_FOUND\" | \"SOURCE_NOT_FOUND\" }\n * → 400 { code: \"INVALID_KNOWLEDGE\" | \"TEAM_REQUIRED\" | \"QUERY_REQUIRED\" }\n *\n * The contract's shapes live here rather than in `@ekanos/integration-schema`,\n * so the knowledge commands ship with the CLI alone.\n */\n\nconst SourceRefSchema = z.object({\n id: z.string(),\n slug: z.string(),\n name: z.string().nullable(),\n});\n\nconst TeamRefSchema = z\n .object({ slug: z.string(), name: z.string() })\n .nullable();\n\nconst ArticleSchema = z.object({\n id: z.string(),\n slug: z.string(),\n title: z.string(),\n tags: z.array(z.string()),\n version: z.number(),\n updatedAt: z.string(),\n body: z.string().optional(),\n});\nexport type KnowledgeArticle = z.infer<typeof ArticleSchema>;\n\nexport const KnowledgeListSchema = z.object({\n source: SourceRefSchema,\n team: TeamRefSchema,\n articles: z.array(ArticleSchema),\n});\nexport type KnowledgeList = z.infer<typeof KnowledgeListSchema>;\n\nconst PushResultSchema = z.object({\n slug: z.string(),\n id: z.string().optional(),\n status: z.enum(['created', 'updated', 'unchanged', 'refused']),\n version: z.number().optional(),\n message: z.string().optional(),\n});\nexport type KnowledgePushResult = z.infer<typeof PushResultSchema>;\n\nexport const KnowledgePushSchema = z.object({\n source: SourceRefSchema,\n team: TeamRefSchema,\n results: z.array(PushResultSchema),\n});\nexport type KnowledgePush = z.infer<typeof KnowledgePushSchema>;\n\nconst HitSchema = z.object({\n id: z.string(),\n slug: z.string(),\n title: z.string(),\n tags: z.array(z.string()),\n collection: z.enum(['team', 'general']),\n snippet: z.string(),\n rank: z.number(),\n updatedAt: z.string(),\n});\nexport type KnowledgeHit = z.infer<typeof HitSchema>;\n\nexport const KnowledgeSearchSchema = z.object({\n source: SourceRefSchema,\n team: TeamRefSchema,\n query: z.string(),\n results: z.array(HitSchema),\n});\n\nexport interface KnowledgePushArticle {\n slug: string;\n title: string;\n body: string;\n tags?: string[];\n}\n\n/** Articles per POST; the host refuses more. */\nexport const KNOWLEDGE_PUSH_BATCH = 50;\n\nexport type KnowledgeApiResult<T> =\n | { status: 'ok'; data: T }\n | { status: 'unauthorized' };\n\nconst BASE = '/api/partner/knowledge';\n\nexport async function knowledgeCall<T>(\n host: string,\n accessToken: string,\n schema: z.ZodType<T>,\n init: {\n method: 'GET' | 'POST';\n path?: string;\n query: Record<string, string | undefined>;\n body?: unknown;\n },\n): Promise<KnowledgeApiResult<T>> {\n const query = Object.fromEntries(\n Object.entries(init.query).filter(\n (entry): entry is [string, string] => entry[1] !== undefined,\n ),\n );\n const url = `${host}${BASE}${init.path ?? ''}?${new URLSearchParams(query)}`;\n const response = await request(url, {\n method: init.method,\n headers: {\n accept: 'application/json',\n authorization: `Bearer ${accessToken}`,\n ...(init.body === undefined\n ? {}\n : { 'content-type': 'application/json' }),\n },\n body: init.body === undefined ? undefined : JSON.stringify(init.body),\n });\n\n if (\n response.status === 401 ||\n (response.status >= 300 && response.status < 400)\n ) {\n return { status: 'unauthorized' };\n }\n\n const body = await readOptionalJson(response);\n const code = typeof body.code === 'string' ? body.code : null;\n const message =\n typeof body.error === 'string' && body.error ? body.error : null;\n\n if (response.status === 403 && code === 'MFA_REQUIRED') {\n throw authRequiredError(\n message ?? `${host} requires multi-factor authentication.`,\n 'Complete MFA in the browser, then run \"ekanos login\" again.',\n );\n }\n if (response.status === 403) {\n throw forbiddenError(\n message ?? 'Not permitted on this Source.',\n code === 'SOURCE_ADMIN_REQUIRED'\n ? 'Only a Source admin manages Knowledge from the CLI. Ask one to run it.'\n : 'Run \"ekanos sources\" to list the sources you hold a seat on.',\n );\n }\n if (response.status === 404) {\n throw notFoundError(\n message ?? 'Not found.',\n code === 'TEAM_NOT_FOUND'\n ? 'Run \"ekanos teams list\" to see the teams on this Source.'\n : 'Run \"ekanos sources\" to list the sources you hold a seat on.',\n );\n }\n if (response.status === 400) {\n const issues = Array.isArray(body.issues)\n ? (body.issues as { path?: unknown; message?: unknown }[])\n .map((issue) => `${String(issue.path)}: ${String(issue.message)}`)\n .join('; ')\n : null;\n throw usageError(\n [message ?? 'The host refused the request.', issues]\n .filter(Boolean)\n .join(' — '),\n code === 'TEAM_REQUIRED'\n ? 'Pass --team <slug>: search runs as that team sees it.'\n : 'See \"ekanos knowledge --help\".',\n );\n }\n if (!response.ok) {\n throw networkError(\n `${host}${BASE} responded ${response.status}.`,\n response.status >= 500\n ? 'The Ekanos deployment returned a server error. Retry shortly.'\n : 'Confirm the host runs a build that includes the knowledge route.',\n );\n }\n\n const parsed = schema.safeParse(body.data);\n if (!parsed.success) {\n throw networkError(\n `${host}${BASE} answered in a shape this CLI does not read.`,\n 'Run \"ekanos upgrade\" — the CLI and the host disagree on the knowledge contract.',\n );\n }\n return { status: 'ok', data: parsed.data };\n}\n\nasync function readOptionalJson(\n response: Response,\n): Promise<Record<string, unknown>> {\n try {\n const parsed: unknown = await response.json();\n return typeof parsed === 'object' && parsed !== null\n ? (parsed as Record<string, unknown>)\n : {};\n } catch {\n return {};\n }\n}\n"]}
1
+ {"version":3,"file":"knowledge-api.js","sourceRoot":"","sources":["../src/knowledge-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,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,CAAC,MAAM,IAAI,GAAG;YACpB,CAAC,CAAC,+DAA+D;YACjE,CAAC,CAAC,kEAAkE,CACvE,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3C,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,YAAY,CAChB,GAAG,IAAI,GAAG,IAAI,8CAA8C,EAC5D,iFAAiF,CAClF,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;AAC7C,CAAC;AAED,KAAK,UAAU,gBAAgB,CAC7B,QAAkB;IAElB,IAAI,CAAC;QACH,MAAM,MAAM,GAAY,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QAC9C,OAAO,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI;YAClD,CAAC,CAAE,MAAkC;YACrC,CAAC,CAAC,EAAE,CAAC;IACT,CAAC;eAAO,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC","sourcesContent":["import { z } from 'zod';\n\nimport { request } from './auth/ekanos-api';\nimport {\n authRequiredError,\n forbiddenError,\n networkError,\n notFoundError,\n usageError,\n} from './errors';\n\n/**\n * The CLI's client for a Source's Knowledge (plan 244): the General\n * collection every team reads, and each team's own.\n *\n * GET /api/partner/knowledge?source=<slug>[&team=<slug>][&body=1]\n * POST /api/partner/knowledge { source, team?, origin?, articles: [...] }\n * POST /api/partner/knowledge/prune { source, team?, origin, keep, delete? }\n * GET /api/partner/knowledge/search?source=<slug>&team=<slug>&q=<query>[&limit=<n>]\n *\n * → 401 / 3xx refresh once and retry\n * → 403 { code: \"SOURCE_ADMIN_REQUIRED\" | \"MFA_REQUIRED\" | \"FORBIDDEN\" }\n * → 404 { code: \"TEAM_NOT_FOUND\" | \"SOURCE_NOT_FOUND\" }\n * → 400 { code: \"INVALID_KNOWLEDGE\" | \"TEAM_REQUIRED\" | \"QUERY_REQUIRED\" }\n *\n * The contract's shapes live here rather than in `@ekanos/integration-schema`,\n * so the knowledge commands ship with the CLI alone.\n */\n\nconst SourceRefSchema = z.object({\n id: z.string(),\n slug: z.string(),\n name: z.string().nullable(),\n});\n\nconst TeamRefSchema = z\n .object({ slug: z.string(), name: z.string() })\n .nullable();\n\n/**\n * A slug `knowledge pull` may turn into `<slug>.md` under its folder: the\n * host's `knowledge_articles.slug` shape (`[a-z0-9][a-z0-9._/-]*`, at most\n * 200), with no empty, `.`-led (so no `.` or `..`) folder. The DB CHECK alone\n * admits `a/../b`; a slug is host-supplied, so the CLI holds the line itself.\n */\nexport function isSafeKnowledgeSlug(slug: string): boolean {\n if (!/^[a-z0-9][a-z0-9._/-]{0,199}$/.test(slug)) return false;\n return slug.split('/').every((part) => part !== '' && !part.startsWith('.'));\n}\n\nconst ArticleSchema = z.object({\n id: z.string(),\n slug: z.string(),\n title: z.string(),\n tags: z.array(z.string()),\n version: z.number(),\n updatedAt: z.string(),\n body: z.string().optional(),\n});\nexport type KnowledgeArticle = z.infer<typeof ArticleSchema>;\n\nexport const KnowledgeListSchema = z.object({\n source: SourceRefSchema,\n team: TeamRefSchema,\n articles: z.array(ArticleSchema),\n});\nexport type KnowledgeList = z.infer<typeof KnowledgeListSchema>;\n\nconst PushResultSchema = z.object({\n slug: z.string(),\n id: z.string().optional(),\n status: z.enum(['created', 'updated', 'unchanged', 'refused']),\n version: z.number().optional(),\n message: z.string().optional(),\n});\nexport type KnowledgePushResult = z.infer<typeof PushResultSchema>;\n\nexport const KnowledgePushSchema = z.object({\n source: SourceRefSchema,\n team: TeamRefSchema,\n results: z.array(PushResultSchema),\n});\nexport type KnowledgePush = z.infer<typeof KnowledgePushSchema>;\n\nconst HitSchema = z.object({\n id: z.string(),\n slug: z.string(),\n title: z.string(),\n tags: z.array(z.string()),\n collection: z.enum(['team', 'general']),\n snippet: z.string(),\n rank: z.number(),\n updatedAt: z.string(),\n});\nexport type KnowledgeHit = z.infer<typeof HitSchema>;\n\nexport const KnowledgeSearchSchema = z.object({\n source: SourceRefSchema,\n team: TeamRefSchema,\n query: z.string(),\n results: z.array(HitSchema),\n});\n\nconst PruneArticleSchema = z.object({\n slug: z.string(),\n title: z.string(),\n version: z.number(),\n});\nexport type KnowledgePruneArticle = z.infer<typeof PruneArticleSchema>;\n\n/**\n * `push --prune`: `candidates` are the articles an earlier push of `origin`\n * made whose files are gone and that nobody edited since; `edited` the ones\n * kept because someone did; `deleted` what this call removed (none for a\n * preview, which sends no `delete`).\n */\nexport const KnowledgePruneSchema = z.object({\n source: SourceRefSchema,\n team: TeamRefSchema,\n origin: z.string(),\n candidates: z.array(PruneArticleSchema),\n edited: z.array(PruneArticleSchema),\n deleted: z.array(PruneArticleSchema),\n});\n\nexport interface KnowledgePushArticle {\n slug: string;\n title: string;\n body: string;\n tags?: string[];\n}\n\n/** Articles per POST; the host refuses more. */\nexport const KNOWLEDGE_PUSH_BATCH = 50;\n\nexport type KnowledgeApiResult<T> =\n | { status: 'ok'; data: T }\n | { status: 'unauthorized' };\n\nconst BASE = '/api/partner/knowledge';\n\nexport async function knowledgeCall<T>(\n host: string,\n accessToken: string,\n schema: z.ZodType<T>,\n init: {\n method: 'GET' | 'POST';\n path?: string;\n query: Record<string, string | undefined>;\n body?: unknown;\n },\n): Promise<KnowledgeApiResult<T>> {\n const query = Object.fromEntries(\n Object.entries(init.query).filter(\n (entry): entry is [string, string] => entry[1] !== undefined,\n ),\n );\n const url = `${host}${BASE}${init.path ?? ''}?${new URLSearchParams(query)}`;\n const response = await request(url, {\n method: init.method,\n headers: {\n accept: 'application/json',\n authorization: `Bearer ${accessToken}`,\n ...(init.body === undefined\n ? {}\n : { 'content-type': 'application/json' }),\n },\n body: init.body === undefined ? undefined : JSON.stringify(init.body),\n });\n\n if (\n response.status === 401 ||\n (response.status >= 300 && response.status < 400)\n ) {\n return { status: 'unauthorized' };\n }\n\n const body = await readOptionalJson(response);\n const code = typeof body.code === 'string' ? body.code : null;\n const message =\n typeof body.error === 'string' && body.error ? body.error : null;\n\n if (response.status === 403 && code === 'MFA_REQUIRED') {\n throw authRequiredError(\n message ?? `${host} requires multi-factor authentication.`,\n 'Complete MFA in the browser, then run \"ekanos login\" again.',\n );\n }\n if (response.status === 403) {\n throw forbiddenError(\n message ?? 'Not permitted on this Source.',\n code === 'SOURCE_ADMIN_REQUIRED'\n ? 'Only a Source admin manages Knowledge from the CLI. Ask one to run it.'\n : 'Run \"ekanos sources\" to list the sources you hold a seat on.',\n );\n }\n if (response.status === 404) {\n throw notFoundError(\n message ?? 'Not found.',\n code === 'TEAM_NOT_FOUND'\n ? 'Run \"ekanos teams list\" to see the teams on this Source.'\n : 'Run \"ekanos sources\" to list the sources you hold a seat on.',\n );\n }\n if (response.status === 400) {\n const issues = Array.isArray(body.issues)\n ? (body.issues as { path?: unknown; message?: unknown }[])\n .map((issue) => `${String(issue.path)}: ${String(issue.message)}`)\n .join('; ')\n : null;\n throw usageError(\n [message ?? 'The host refused the request.', issues]\n .filter(Boolean)\n .join(' — '),\n code === 'TEAM_REQUIRED'\n ? 'Pass --team <slug>: search runs as that team sees it.'\n : 'See \"ekanos knowledge --help\".',\n );\n }\n if (!response.ok) {\n throw networkError(\n `${host}${BASE} responded ${response.status}.`,\n response.status >= 500\n ? 'The Ekanos deployment returned a server error. Retry shortly.'\n : 'Confirm the host runs a build that includes the knowledge route.',\n );\n }\n\n const parsed = schema.safeParse(body.data);\n if (!parsed.success) {\n throw networkError(\n `${host}${BASE} answered in a shape this CLI does not read.`,\n 'Run \"ekanos upgrade\" — the CLI and the host disagree on the knowledge contract.',\n );\n }\n return { status: 'ok', data: parsed.data };\n}\n\nasync function readOptionalJson(\n response: Response,\n): Promise<Record<string, unknown>> {\n try {\n const parsed: unknown = await response.json();\n return typeof parsed === 'object' && parsed !== null\n ? (parsed as Record<string, unknown>)\n : {};\n } catch {\n return {};\n }\n}\n"]}
@@ -0,0 +1,16 @@
1
+ /** True when `url` is a link the CLI is willing to open in a browser. */
2
+ export declare function isBrowserSafeUrl(url: string): boolean;
3
+ /**
4
+ * Refuse a host-supplied link the CLI would not open. Called before the link
5
+ * is printed or opened, so a hostile host cannot hand the person a `file:`
6
+ * link either way.
7
+ */
8
+ export declare function assertBrowserSafeUrl(url: string, what: string): void;
9
+ /** The command and argv that open `url` on `platform` — never a shell. */
10
+ export declare function openerFor(url: string, platform?: NodeJS.Platform): [string, string[]];
11
+ /**
12
+ * Best effort: callers always print the link, so a failed open costs nothing.
13
+ * An unsafe URL is never handed to the OS, even if a caller skipped
14
+ * `assertBrowserSafeUrl`.
15
+ */
16
+ export declare function openInBrowser(url: string): void;