@ekanos/cli 0.11.0 → 0.13.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.
- package/dist/apps-api.d.ts +3 -2
- package/dist/apps-api.js +1 -5
- package/dist/apps-api.js.map +1 -1
- package/dist/commands/agents-edit.js +1 -1
- package/dist/commands/agents-edit.js.map +1 -1
- package/dist/commands/apps.d.ts +19 -6
- package/dist/commands/apps.js +366 -43
- package/dist/commands/apps.js.map +1 -1
- package/dist/commands/knowledge.d.ts +37 -0
- package/dist/commands/knowledge.js +364 -0
- package/dist/commands/knowledge.js.map +1 -0
- package/dist/commands/routes.d.ts +23 -0
- package/dist/commands/routes.js +277 -0
- package/dist/commands/routes.js.map +1 -0
- package/dist/commands/sources.d.ts +4 -0
- package/dist/commands/sources.js +115 -1
- package/dist/commands/sources.js.map +1 -1
- package/dist/commands/team-agents-triggers.js +2 -1
- package/dist/commands/team-agents-triggers.js.map +1 -1
- package/dist/commands/teams-connect.d.ts +25 -0
- package/dist/commands/teams-connect.js +242 -0
- package/dist/commands/teams-connect.js.map +1 -0
- package/dist/commands/teams-onboard.d.ts +5 -2
- package/dist/commands/teams-onboard.js +12 -40
- package/dist/commands/teams-onboard.js.map +1 -1
- package/dist/commands/teams.d.ts +60 -5
- package/dist/commands/teams.js +141 -46
- package/dist/commands/teams.js.map +1 -1
- package/dist/connections-api.d.ts +125 -0
- package/dist/connections-api.js +156 -0
- package/dist/connections-api.js.map +1 -0
- package/dist/index.js +90 -6
- package/dist/index.js.map +1 -1
- package/dist/knowledge-api.d.ts +129 -0
- package/dist/knowledge-api.js +138 -0
- package/dist/knowledge-api.js.map +1 -0
- package/dist/routes-api.d.ts +105 -0
- package/dist/routes-api.js +147 -0
- package/dist/routes-api.js.map +1 -0
- package/dist/source-products-api.d.ts +59 -0
- package/dist/source-products-api.js +113 -0
- package/dist/source-products-api.js.map +1 -0
- package/dist/team-connect-api.d.ts +244 -0
- package/dist/team-connect-api.js +95 -0
- package/dist/team-connect-api.js.map +1 -0
- package/dist/teams-api.d.ts +1 -0
- package/dist/teams-api.js +1 -1
- package/dist/teams-api.js.map +1 -1
- package/package.json +2 -2
- package/templates/package.json.tmpl +4 -4
- package/templates/skills/build-agent/SKILL.md +18 -3
- package/templates/skills/build-agent/references/agent-json.md +29 -8
- package/templates/skills/build-agent/references/app-setup.md +2 -1
- package/templates/skills/build-agent/references/set-up-an-integration.md +76 -10
- package/templates/skills/build-agent/references/skills.md +7 -4
- package/templates/skills/build-agent/references/triggers.md +44 -15
- package/templates/skills/ekanos-platform/SKILL.md +40 -8
package/dist/index.js
CHANGED
|
@@ -4,10 +4,12 @@ import { runApps } from './commands/apps.js';
|
|
|
4
4
|
import { runCatalog } from './commands/catalog.js';
|
|
5
5
|
import { runDev } from './commands/dev.js';
|
|
6
6
|
import { runInit } from './commands/init.js';
|
|
7
|
+
import { runKnowledge } from './commands/knowledge.js';
|
|
7
8
|
import { runLogin } from './commands/login.js';
|
|
8
9
|
import { runLogout } from './commands/logout.js';
|
|
9
10
|
import { runPublish } from './commands/publish.js';
|
|
10
11
|
import { runReviewers } from './commands/reviewers.js';
|
|
12
|
+
import { runRoutes } from './commands/routes.js';
|
|
11
13
|
import { runApprovals, runRuns } from './commands/runs.js';
|
|
12
14
|
import { runSkills } from './commands/skills.js';
|
|
13
15
|
import { runSources } from './commands/sources.js';
|
|
@@ -80,6 +82,9 @@ const COMMAND_SPECS = {
|
|
|
80
82
|
sources: {
|
|
81
83
|
host: { type: 'string' },
|
|
82
84
|
dir: { type: 'string' },
|
|
85
|
+
// `sources products [enable|disable <product>]`.
|
|
86
|
+
source: { type: 'string' },
|
|
87
|
+
yes: { type: 'boolean' },
|
|
83
88
|
},
|
|
84
89
|
catalog: {
|
|
85
90
|
host: { type: 'string' },
|
|
@@ -90,12 +95,17 @@ const COMMAND_SPECS = {
|
|
|
90
95
|
host: { type: 'string' },
|
|
91
96
|
source: { type: 'string' },
|
|
92
97
|
dir: { type: 'string' },
|
|
98
|
+
'no-wait': { type: 'boolean' },
|
|
93
99
|
},
|
|
94
100
|
teams: {
|
|
95
101
|
host: { type: 'string' },
|
|
96
102
|
source: { type: 'string' },
|
|
97
103
|
dir: { type: 'string' },
|
|
98
104
|
connection: { type: 'string' },
|
|
105
|
+
// `teams app set`: which fields to enter, non-secret values, removals.
|
|
106
|
+
field: { type: 'string', repeatable: true },
|
|
107
|
+
set: { type: 'string', repeatable: true },
|
|
108
|
+
clear: { type: 'string', repeatable: true },
|
|
99
109
|
slug: { type: 'string' },
|
|
100
110
|
owner: { type: 'string' },
|
|
101
111
|
role: { type: 'string' },
|
|
@@ -114,6 +124,11 @@ const COMMAND_SPECS = {
|
|
|
114
124
|
timezone: { type: 'string' },
|
|
115
125
|
prompt: { type: 'string' },
|
|
116
126
|
filter: { type: 'string' },
|
|
127
|
+
// `teams connect`: `--no-wait`, `--no-open` (the negation of `open`),
|
|
128
|
+
// `--link-only`.
|
|
129
|
+
'no-wait': { type: 'boolean' },
|
|
130
|
+
open: { type: 'boolean' },
|
|
131
|
+
'link-only': { type: 'boolean' },
|
|
117
132
|
},
|
|
118
133
|
reviewers: {
|
|
119
134
|
host: { type: 'string' },
|
|
@@ -122,6 +137,13 @@ const COMMAND_SPECS = {
|
|
|
122
137
|
reach: { type: 'string' },
|
|
123
138
|
team: { type: 'string' },
|
|
124
139
|
},
|
|
140
|
+
routes: {
|
|
141
|
+
host: { type: 'string' },
|
|
142
|
+
source: { type: 'string' },
|
|
143
|
+
dir: { type: 'string' },
|
|
144
|
+
label: { type: 'string' },
|
|
145
|
+
webhook: { type: 'string' },
|
|
146
|
+
},
|
|
125
147
|
agents: {
|
|
126
148
|
host: { type: 'string' },
|
|
127
149
|
source: { type: 'string' },
|
|
@@ -160,6 +182,13 @@ const COMMAND_SPECS = {
|
|
|
160
182
|
team: { type: 'string' },
|
|
161
183
|
out: { type: 'string' },
|
|
162
184
|
},
|
|
185
|
+
knowledge: {
|
|
186
|
+
host: { type: 'string' },
|
|
187
|
+
source: { type: 'string' },
|
|
188
|
+
dir: { type: 'string' },
|
|
189
|
+
team: { type: 'string' },
|
|
190
|
+
out: { type: 'string' },
|
|
191
|
+
},
|
|
163
192
|
runs: {
|
|
164
193
|
host: { type: 'string' },
|
|
165
194
|
source: { type: 'string' },
|
|
@@ -201,6 +230,7 @@ const COMMAND_SPECS = {
|
|
|
201
230
|
/** Commands that take positional arguments, and what each means, in order. Every other command is positional-free. */
|
|
202
231
|
const POSITIONAL_COMMANDS = {
|
|
203
232
|
use: ['source-slug'],
|
|
233
|
+
sources: ['subcommand', 'verb', 'product-slug'],
|
|
204
234
|
catalog: ['product-slug'],
|
|
205
235
|
apps: ['subcommand', 'product-slug'],
|
|
206
236
|
// `teams agents policy <team> <key> set <tool> auto` is the longest form.
|
|
@@ -214,7 +244,9 @@ const POSITIONAL_COMMANDS = {
|
|
|
214
244
|
'arg-7',
|
|
215
245
|
],
|
|
216
246
|
reviewers: ['subcommand', 'email'],
|
|
247
|
+
routes: ['subcommand', 'product-or-event-id', 'value', 'team-slug'],
|
|
217
248
|
skills: ['subcommand', 'slug-or-path'],
|
|
249
|
+
knowledge: ['subcommand', 'path-or-query'],
|
|
218
250
|
runs: ['subcommand', 'agent-key-or-run-id'],
|
|
219
251
|
approvals: ['subcommand', 'approval-id'],
|
|
220
252
|
// `triggers <key> add event <trigger-key>` is the longest form: five tokens.
|
|
@@ -241,12 +273,20 @@ const USAGE = [
|
|
|
241
273
|
' (--findings for full gate findings, --all to expand other',
|
|
242
274
|
' integrations in the source, --watch to block until this',
|
|
243
275
|
" project's current version reaches a gate verdict)",
|
|
244
|
-
' sources List every source you hold a developer/source-admin seat on',
|
|
276
|
+
' sources List every source you hold a developer/source-admin seat on |',
|
|
277
|
+
' products [--source <slug>] (each product, Experience or',
|
|
278
|
+
' Integration, and whether it is enabled for the Source) |',
|
|
279
|
+
' products enable <product> | products disable <product> --yes',
|
|
280
|
+
' (a super-admin grant: an "ekanos login" session is refused',
|
|
281
|
+
' and pointed at /admin)',
|
|
245
282
|
' catalog What a source can already use, and how to set it up',
|
|
246
283
|
' ("ekanos catalog [<product-slug>] --source <slug>", --json)',
|
|
247
284
|
" apps The Source's app for an integration teams sign in through:",
|
|
248
285
|
' show <product> | set <product> (Source admin; takes the secret',
|
|
249
|
-
' at your terminal)',
|
|
286
|
+
' at your terminal, Enter keeps a saved value) | connect',
|
|
287
|
+
' <product> [--no-wait] (one',
|
|
288
|
+
" connection for the whole Source, used by the Source's provided",
|
|
289
|
+
' agents in every team) | disconnect <product> | list',
|
|
250
290
|
" teams A Source's teams, for the Source admin:",
|
|
251
291
|
' create <name> [--slug <slug>] [--owner <email>] (you own it',
|
|
252
292
|
' unless --owner, who is invited as owner) |',
|
|
@@ -254,11 +294,15 @@ const USAGE = [
|
|
|
254
294
|
' <role>] (default member; sends the invitation email) |',
|
|
255
295
|
' members role <team> <email> <role> | members remove <team>',
|
|
256
296
|
" <email> --yes | roles list <team> (each role's permissions) |",
|
|
257
|
-
' connect <team> <product>
|
|
258
|
-
|
|
297
|
+
' connect <team> <product> [--as <member-email>] [--no-wait]',
|
|
298
|
+
" [--no-open] [--link-only] (connects it: asks the form's fields",
|
|
299
|
+
' at your terminal, or opens the sign-in for you or the member',
|
|
300
|
+
" --as names and waits; --link-only prints the team's page) |",
|
|
259
301
|
' list | show <team> <product> (a checklist: fields, callback',
|
|
260
302
|
' URLs, webhooks, connect link) | app set <team> <product>',
|
|
261
|
-
' [--connection <id>]
|
|
303
|
+
' [--connection <id>] [--field <name>]… [--set <name>=<value>]…',
|
|
304
|
+
' [--clear <name>]… (any one field at a time; a field you skip',
|
|
305
|
+
' keeps its saved value; secrets only at your terminal) |',
|
|
262
306
|
' webhook <team> <product> [<webhook-id>] [--yes] (URL shown once)',
|
|
263
307
|
" A team's agents, for the Source admin (teams <area> <verb> <team> …):",
|
|
264
308
|
' agents list <team> | agents enable <team> <key> [--as <member-email>]',
|
|
@@ -272,6 +316,11 @@ const USAGE = [
|
|
|
272
316
|
' reviewers Who decides agent reply drafts, for the Source admin:',
|
|
273
317
|
' list | add <email> --reach source|team [--team <slug>] |',
|
|
274
318
|
' remove <email> [--team <slug>]',
|
|
319
|
+
" routes Route a Source connection's events to teams, for the Source admin:",
|
|
320
|
+
' list [<product>] | options <product> | set <product> <value> <team>',
|
|
321
|
+
' [--label <name>] | remove <product> <value> | webhook <product>',
|
|
322
|
+
' [--webhook <id>] (URL shown once) | unrouted [<product>] |',
|
|
323
|
+
' replay <event-id>',
|
|
275
324
|
" agents The source's agent templates, held by Ekanos:",
|
|
276
325
|
' init [<dir>] [--claude|--no-claude] (skills + docs MCP for designing',
|
|
277
326
|
' agents with Claude; offers to add the docs to Claude Code)',
|
|
@@ -301,6 +350,13 @@ const USAGE = [
|
|
|
301
350
|
' push <dir> [--team <t>] (a new version, live at once; created',
|
|
302
351
|
' on first push, "unchanged" when identical; --team: that team\'s',
|
|
303
352
|
' own skill, no other team sees it) | pull <slug> [--out <dir>]',
|
|
353
|
+
" knowledge The Source's Knowledge base (markdown articles), for the Source admin:",
|
|
354
|
+
' list [--team <t>] | push <dir> [--team <t>] (each .md file an',
|
|
355
|
+
' article: title from frontmatter or the first heading, tags from',
|
|
356
|
+
' frontmatter; upserts by path, "unchanged" when identical) |',
|
|
357
|
+
" search <query> --team <t> (as that team's agents search: its",
|
|
358
|
+
' articles plus General) | pull [--team <t>] [--out <dir>]',
|
|
359
|
+
' Without --team: the General collection every team reads.',
|
|
304
360
|
" runs Run and inspect a team's agents, as the Source admin:",
|
|
305
361
|
' start <agent-key> --team <slug> (--prompt "…" | --input',
|
|
306
362
|
' <file.json>) [--follow] | list --team <slug> [--agent <key>] |',
|
|
@@ -323,7 +379,7 @@ const USAGE = [
|
|
|
323
379
|
' bare "ekanos upgrade" MUTATES the project (installs the target versions,',
|
|
324
380
|
' verifies with validate + the test script, rolls back on any failure).',
|
|
325
381
|
'',
|
|
326
|
-
'Host resolution (logout, whoami, status, sources, catalog, apps, teams, reviewers, agents, skills, runs, approvals, use, publish, upgrade):',
|
|
382
|
+
'Host resolution (logout, whoami, status, sources, catalog, apps, teams, reviewers, routes, agents, skills, knowledge, runs, approvals, use, publish, upgrade):',
|
|
327
383
|
' --host, else EKANOS_HOST, else the "host" field in ekanos.json, else the',
|
|
328
384
|
' sole stored login. "ekanos publish" saves host and source to ekanos.json.',
|
|
329
385
|
' "ekanos login" never reads ekanos.json for a host (--host, else',
|
|
@@ -471,6 +527,9 @@ export async function run(argv, options = {}) {
|
|
|
471
527
|
case 'sources':
|
|
472
528
|
return await runSources(ctx, {
|
|
473
529
|
host: parsed.flags.host,
|
|
530
|
+
positionals: parsed.positionals,
|
|
531
|
+
source: parsed.flags.source,
|
|
532
|
+
yes: parsed.flags.yes === true,
|
|
474
533
|
dir,
|
|
475
534
|
env,
|
|
476
535
|
});
|
|
@@ -494,6 +553,7 @@ export async function run(argv, options = {}) {
|
|
|
494
553
|
ask: options.ask,
|
|
495
554
|
askSecret: options.askSecret,
|
|
496
555
|
confirm: options.confirm,
|
|
556
|
+
noWait: parsed.flags['no-wait'] === true,
|
|
497
557
|
});
|
|
498
558
|
case 'teams':
|
|
499
559
|
return await runTeams(ctx, {
|
|
@@ -505,6 +565,9 @@ export async function run(argv, options = {}) {
|
|
|
505
565
|
owner: parsed.flags.owner,
|
|
506
566
|
role: parsed.flags.role,
|
|
507
567
|
yes: parsed.flags.yes === true,
|
|
568
|
+
noWait: parsed.flags['no-wait'] === true,
|
|
569
|
+
noOpen: parsed.flags.open === false,
|
|
570
|
+
linkOnly: parsed.flags['link-only'] === true,
|
|
508
571
|
flags: parsed.flags,
|
|
509
572
|
dir,
|
|
510
573
|
env,
|
|
@@ -522,6 +585,16 @@ export async function run(argv, options = {}) {
|
|
|
522
585
|
dir,
|
|
523
586
|
env,
|
|
524
587
|
});
|
|
588
|
+
case 'routes':
|
|
589
|
+
return await runRoutes(ctx, {
|
|
590
|
+
host: parsed.flags.host,
|
|
591
|
+
source: parsed.flags.source,
|
|
592
|
+
positionals: parsed.positionals,
|
|
593
|
+
label: parsed.flags.label,
|
|
594
|
+
webhook: parsed.flags.webhook,
|
|
595
|
+
dir,
|
|
596
|
+
env,
|
|
597
|
+
});
|
|
525
598
|
case 'agents':
|
|
526
599
|
return await runAgents(ctx, {
|
|
527
600
|
host: parsed.flags.host,
|
|
@@ -584,6 +657,17 @@ export async function run(argv, options = {}) {
|
|
|
584
657
|
dir,
|
|
585
658
|
env,
|
|
586
659
|
});
|
|
660
|
+
case 'knowledge':
|
|
661
|
+
return await runKnowledge(ctx, {
|
|
662
|
+
host: parsed.flags.host,
|
|
663
|
+
source: parsed.flags.source,
|
|
664
|
+
subcommand: parsed.positionals[0],
|
|
665
|
+
target: parsed.positionals[1],
|
|
666
|
+
team: parsed.flags.team,
|
|
667
|
+
out: parsed.flags.out,
|
|
668
|
+
dir,
|
|
669
|
+
env,
|
|
670
|
+
});
|
|
587
671
|
case 'use':
|
|
588
672
|
return await runUse(ctx, {
|
|
589
673
|
host: parsed.flags.host,
|
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,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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,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;IAC/D,GAAG,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 { runLogin } from './commands/login';\nimport { runLogout } from './commands/logout';\nimport { runPublish } from './commands/publish';\nimport { runReviewers } from './commands/reviewers';\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 },\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 },\n teams: {\n host: { type: 'string' },\n source: { type: 'string' },\n dir: { type: 'string' },\n connection: { type: 'string' },\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 },\n reviewers: {\n host: { type: 'string' },\n source: { type: 'string' },\n dir: { type: 'string' },\n reach: { type: 'string' },\n team: { 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 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 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 skills: ['subcommand', 'slug-or-path'],\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 ' 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)',\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> (the link a member opens to sign in',\n ' an integration, and whether it is connected) |',\n ' list | show <team> <product> (a checklist: fields, callback',\n ' URLs, webhooks, connect link) | app set <team> <product>',\n ' [--connection <id>] (takes the secrets 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 \" 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 \" 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, agents, skills, 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 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 });\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 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 '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 '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,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,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,GAAG,CAAC;IAC/D,GAAG,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"]}
|