reply-cli 0.2.0 → 0.4.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 (139) hide show
  1. package/README.md +157 -135
  2. package/dist/api/headers.d.ts +4 -0
  3. package/dist/api/headers.js +13 -0
  4. package/dist/api/headers.js.map +1 -0
  5. package/dist/auth/oauth-flow.d.ts +38 -0
  6. package/dist/auth/oauth-flow.js +193 -0
  7. package/dist/auth/oauth-flow.js.map +1 -0
  8. package/dist/auth/pkce.d.ts +9 -0
  9. package/dist/auth/pkce.js +19 -0
  10. package/dist/auth/pkce.js.map +1 -0
  11. package/dist/auth/request-identity.d.ts +16 -0
  12. package/dist/auth/request-identity.js +67 -0
  13. package/dist/auth/request-identity.js.map +1 -0
  14. package/dist/auth/resolve.d.ts +23 -0
  15. package/dist/auth/resolve.js +55 -0
  16. package/dist/auth/resolve.js.map +1 -0
  17. package/dist/auth/status.d.ts +19 -0
  18. package/dist/auth/status.js +27 -0
  19. package/dist/auth/status.js.map +1 -0
  20. package/dist/auth/token.d.ts +29 -0
  21. package/dist/auth/token.js +39 -0
  22. package/dist/auth/token.js.map +1 -0
  23. package/dist/commands/api.d.ts +19 -0
  24. package/dist/commands/api.js +137 -0
  25. package/dist/commands/api.js.map +1 -0
  26. package/dist/commands/auth.d.ts +19 -3
  27. package/dist/commands/auth.js +251 -16
  28. package/dist/commands/auth.js.map +1 -1
  29. package/dist/commands/authed.d.ts +13 -0
  30. package/dist/commands/authed.js +20 -0
  31. package/dist/commands/authed.js.map +1 -0
  32. package/dist/commands/profile.d.ts +31 -0
  33. package/dist/commands/profile.js +348 -0
  34. package/dist/commands/profile.js.map +1 -0
  35. package/dist/commands/skills.d.ts +12 -0
  36. package/dist/commands/skills.js +138 -0
  37. package/dist/commands/skills.js.map +1 -0
  38. package/dist/commands/team.d.ts +17 -0
  39. package/dist/commands/team.js +146 -0
  40. package/dist/commands/team.js.map +1 -0
  41. package/dist/config.d.ts +15 -0
  42. package/dist/config.js +83 -0
  43. package/dist/config.js.map +1 -0
  44. package/dist/context.d.ts +15 -0
  45. package/dist/context.js +17 -0
  46. package/dist/context.js.map +1 -0
  47. package/dist/credentials/file-store.d.ts +13 -0
  48. package/dist/credentials/file-store.js +88 -0
  49. package/dist/credentials/file-store.js.map +1 -0
  50. package/dist/credentials/types.d.ts +25 -0
  51. package/dist/credentials/types.js +3 -0
  52. package/dist/credentials/types.js.map +1 -0
  53. package/dist/index.js +101 -69
  54. package/dist/index.js.map +1 -1
  55. package/dist/profile.d.ts +51 -0
  56. package/dist/profile.js +295 -0
  57. package/dist/profile.js.map +1 -0
  58. package/dist/skills/adapter-flat.d.ts +32 -0
  59. package/dist/skills/adapter-flat.js +480 -0
  60. package/dist/skills/adapter-flat.js.map +1 -0
  61. package/dist/skills/adapter-native.d.ts +22 -0
  62. package/dist/skills/adapter-native.js +335 -0
  63. package/dist/skills/adapter-native.js.map +1 -0
  64. package/dist/skills/detect.d.ts +21 -0
  65. package/dist/skills/detect.js +102 -0
  66. package/dist/skills/detect.js.map +1 -0
  67. package/dist/skills/hosts.d.ts +5 -0
  68. package/dist/skills/hosts.js +118 -0
  69. package/dist/skills/hosts.js.map +1 -0
  70. package/dist/skills/journal.d.ts +23 -0
  71. package/dist/skills/journal.js +91 -0
  72. package/dist/skills/journal.js.map +1 -0
  73. package/dist/skills/orchestrate.d.ts +27 -0
  74. package/dist/skills/orchestrate.js +124 -0
  75. package/dist/skills/orchestrate.js.map +1 -0
  76. package/dist/skills/packs.d.ts +16 -0
  77. package/dist/skills/packs.js +153 -0
  78. package/dist/skills/packs.js.map +1 -0
  79. package/dist/skills/report.d.ts +7 -0
  80. package/dist/skills/report.js +105 -0
  81. package/dist/skills/report.js.map +1 -0
  82. package/dist/skills/types.d.ts +80 -0
  83. package/dist/skills/types.js +5 -0
  84. package/dist/skills/types.js.map +1 -0
  85. package/dist/teams.d.ts +14 -0
  86. package/dist/teams.js +103 -0
  87. package/dist/teams.js.map +1 -0
  88. package/dist/utils/client.d.ts +19 -34
  89. package/dist/utils/client.js +123 -94
  90. package/dist/utils/client.js.map +1 -1
  91. package/dist/utils/errors.d.ts +47 -0
  92. package/dist/utils/errors.js +86 -0
  93. package/dist/utils/errors.js.map +1 -0
  94. package/dist/utils/output.d.ts +7 -19
  95. package/dist/utils/output.js +39 -81
  96. package/dist/utils/output.js.map +1 -1
  97. package/package.json +11 -25
  98. package/dist/commands/contacts.d.ts +0 -35
  99. package/dist/commands/contacts.js +0 -412
  100. package/dist/commands/contacts.js.map +0 -1
  101. package/dist/commands/email-accounts.d.ts +0 -11
  102. package/dist/commands/email-accounts.js +0 -97
  103. package/dist/commands/email-accounts.js.map +0 -1
  104. package/dist/commands/inbox.d.ts +0 -30
  105. package/dist/commands/inbox.js +0 -225
  106. package/dist/commands/inbox.js.map +0 -1
  107. package/dist/commands/lists.d.ts +0 -20
  108. package/dist/commands/lists.js +0 -137
  109. package/dist/commands/lists.js.map +0 -1
  110. package/dist/commands/reports.d.ts +0 -10
  111. package/dist/commands/reports.js +0 -70
  112. package/dist/commands/reports.js.map +0 -1
  113. package/dist/commands/schedules.d.ts +0 -6
  114. package/dist/commands/schedules.js +0 -59
  115. package/dist/commands/schedules.js.map +0 -1
  116. package/dist/commands/sequence-contacts.d.ts +0 -19
  117. package/dist/commands/sequence-contacts.js +0 -129
  118. package/dist/commands/sequence-contacts.js.map +0 -1
  119. package/dist/commands/sequences-stats.d.ts +0 -42
  120. package/dist/commands/sequences-stats.js +0 -99
  121. package/dist/commands/sequences-stats.js.map +0 -1
  122. package/dist/commands/sequences.d.ts +0 -22
  123. package/dist/commands/sequences.js +0 -211
  124. package/dist/commands/sequences.js.map +0 -1
  125. package/dist/utils/auth.d.ts +0 -2
  126. package/dist/utils/auth.js +0 -33
  127. package/dist/utils/auth.js.map +0 -1
  128. package/dist/utils/command.d.ts +0 -18
  129. package/dist/utils/command.js +0 -51
  130. package/dist/utils/command.js.map +0 -1
  131. package/dist/utils/csv.d.ts +0 -19
  132. package/dist/utils/csv.js +0 -118
  133. package/dist/utils/csv.js.map +0 -1
  134. package/dist/utils/pagination.d.ts +0 -22
  135. package/dist/utils/pagination.js +0 -37
  136. package/dist/utils/pagination.js.map +0 -1
  137. package/dist/utils/resolve.d.ts +0 -4
  138. package/dist/utils/resolve.js +0 -34
  139. package/dist/utils/resolve.js.map +0 -1
@@ -0,0 +1,348 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.parse_url = exports.handle_show = exports.handle_delete = exports.handle_rename = exports.profile_command = void 0;
7
+ const readline_1 = __importDefault(require("readline"));
8
+ const commander_1 = require("commander");
9
+ const profile_1 = require("../profile");
10
+ const file_store_1 = require("../credentials/file-store");
11
+ const status_1 = require("../auth/status");
12
+ const auth_1 = require("./auth");
13
+ const errors_1 = require("../utils/errors");
14
+ const config_1 = require("../config");
15
+ const output_1 = require("../utils/output");
16
+ const read_globals = (cmd) => {
17
+ const o = cmd.optsWithGlobals();
18
+ return { json: o.json, pretty: o.pretty, apiKey: o.apiKey };
19
+ };
20
+ const wants_json = (g) => Boolean(g.json || g.pretty);
21
+ const print_opts = (g) => ({ json: g.json, pretty: g.pretty });
22
+ const parse_team_id = (v) => {
23
+ if (v === undefined) {
24
+ return undefined;
25
+ }
26
+ if (!/^\d+$/.test(v.trim())) {
27
+ throw new errors_1.UsageError('--team-id must be a positive integer.', { code: 'usage.profile', hint: `Got: ${v}` });
28
+ }
29
+ return parseInt(v.trim(), 10);
30
+ };
31
+ const parse_url = (v) => {
32
+ if (v === undefined) {
33
+ return undefined;
34
+ }
35
+ const s = v.trim();
36
+ let parsed;
37
+ try {
38
+ parsed = new URL(s);
39
+ }
40
+ catch {
41
+ throw new errors_1.UsageError('--authority/--api-base must be an http(s) URL.', {
42
+ code: 'usage.profile', hint: `Got: ${v}`,
43
+ });
44
+ }
45
+ if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:') {
46
+ throw new errors_1.UsageError('--authority/--api-base must be an http(s) URL.', {
47
+ code: 'usage.profile', hint: `Got: ${v}`,
48
+ });
49
+ }
50
+ return s;
51
+ };
52
+ exports.parse_url = parse_url;
53
+ // User-facing field names for `unset` (hyphenated) mapped to config keys.
54
+ const CLEARABLE_INPUT = {
55
+ 'authority': 'authority',
56
+ 'api_base': 'api_base',
57
+ 'api-base': 'api_base',
58
+ 'team_id': 'team_id',
59
+ 'team-id': 'team_id',
60
+ };
61
+ const map_clearable = (field) => {
62
+ const mapped = CLEARABLE_INPUT[field.trim().toLowerCase()];
63
+ if (!mapped) {
64
+ throw new errors_1.UsageError(`Can't clear '${field}'.`, {
65
+ code: 'usage.profile', hint: 'Clearable fields: authority, api_base, team-id.',
66
+ });
67
+ }
68
+ return mapped;
69
+ };
70
+ // Interactive y/N prompt on stderr (so JSON stdout stays clean). Injected in
71
+ // tests. Anything not starting with y/yes is treated as "no".
72
+ const confirm = (question) => {
73
+ const rl = readline_1.default.createInterface({ input: process.stdin, output: process.stderr });
74
+ return new Promise(resolve => {
75
+ rl.question(`${question} [y/N] `, answer => {
76
+ rl.close();
77
+ resolve(/^y(es)?$/i.test(answer.trim()));
78
+ });
79
+ });
80
+ };
81
+ // Rename orchestration. Ordering (two files, no cross-file transaction — never
82
+ // lose or clobber a login): (1) refuse if a credential already lives under the
83
+ // target key; (2) read the old credential; (3) rename the config def; (4) move
84
+ // the credential. A partial failure orphans the old credential (recoverable by
85
+ // re-login), never destroys it.
86
+ const handle_rename = async (old_name, new_name, g, deps) => {
87
+ const env = deps.env ?? process.env;
88
+ if (await deps.store.get(new_name)) {
89
+ throw new errors_1.UsageError(`A credential already exists for '${new_name}'.`, {
90
+ code: 'usage.profile', hint: `Log out of '${new_name}' or pick another name.`,
91
+ });
92
+ }
93
+ const cred = await deps.store.get(old_name);
94
+ (0, profile_1.rename_profile_def)(old_name, new_name, env);
95
+ let credential_moved = false;
96
+ if (cred) {
97
+ await deps.store.set(new_name, cred);
98
+ await deps.store.remove(old_name);
99
+ credential_moved = true;
100
+ }
101
+ const current_updated = (0, profile_1.current_profile_name)(env) === new_name;
102
+ if (wants_json(g)) {
103
+ (0, output_1.print)({ renamed: { from: old_name, to: new_name }, current_updated, credential_moved }, print_opts(g));
104
+ return;
105
+ }
106
+ (0, output_1.success)(`Renamed profile '${old_name}' → '${new_name}'.`);
107
+ if (current_updated) {
108
+ (0, output_1.info)(' (was the current profile)');
109
+ }
110
+ };
111
+ exports.handle_rename = handle_rename;
112
+ // Delete a profile and its stored credential. Validated before prompting so a
113
+ // bad name fails fast. Confirm-by-default: interactive y/N on a TTY, `--yes`
114
+ // skips it, and a non-interactive shell without `--yes` is refused.
115
+ const handle_delete = async (name, opts, g, deps) => {
116
+ const env = deps.env ?? process.env;
117
+ if (name === 'default') {
118
+ throw new errors_1.UsageError('The built-in default profile can\'t be deleted.', { code: 'usage.profile' });
119
+ }
120
+ if (!(0, profile_1.list_profiles)(env).available.includes(name)) {
121
+ throw new errors_1.UsageError(`Unknown profile '${name}'.`, {
122
+ code: 'usage.profile', hint: 'List profiles with `profile list`.',
123
+ });
124
+ }
125
+ if (!opts.yes) {
126
+ const is_tty = deps.is_tty ?? Boolean(process.stdin.isTTY);
127
+ if (!is_tty) {
128
+ throw new errors_1.UsageError('Refusing to delete without confirmation.', {
129
+ code: 'usage.profile', hint: 'Pass --yes to confirm in a non-interactive shell.',
130
+ });
131
+ }
132
+ const ask = deps.confirm ?? confirm;
133
+ if (!await ask(`Delete profile '${name}' and its stored credential?`)) {
134
+ (0, output_1.info)('Aborted.');
135
+ return;
136
+ }
137
+ }
138
+ const { was_current } = (0, profile_1.delete_profile_def)(name, env);
139
+ const credential_removed = await deps.store.remove(name);
140
+ if (wants_json(g)) {
141
+ (0, output_1.print)({ deleted: name, credential_removed, current_reset: was_current }, print_opts(g));
142
+ return;
143
+ }
144
+ (0, output_1.success)(`Deleted profile '${name}'.`);
145
+ if (credential_removed) {
146
+ (0, output_1.info)(' Removed its stored credential.');
147
+ }
148
+ if (was_current) {
149
+ (0, output_1.info)(' Current profile reset to default.');
150
+ }
151
+ };
152
+ exports.handle_delete = handle_delete;
153
+ // Redacted, one-line summary of the stored credential — never a raw secret.
154
+ const stored_summary = (status, record) => {
155
+ if (!record) {
156
+ return 'none — run `reply auth login`';
157
+ }
158
+ const who = record.user ? (0, auth_1.principal_label)(record.user) : 'unknown';
159
+ if (status.method === 'oauth') {
160
+ return `oauth · ${who} · expires ${status.expires_at}${status.expired ? output_1.pc.red(' (expired)') : ''}`;
161
+ }
162
+ return `api_key · ${who}`;
163
+ };
164
+ const show_json = (d, status, has_flag, has_env, record) => ({
165
+ name: d.name,
166
+ current: d.is_current,
167
+ backend: { authority: d.authority, api_base: d.api_base, inherited: d.inherited },
168
+ team_id: d.team_id ?? null,
169
+ authorization: {
170
+ flag: has_flag,
171
+ env: has_env,
172
+ stored: record
173
+ ? {
174
+ present: true,
175
+ method: status.method,
176
+ ...(status.user ? { user: status.user } : {}),
177
+ ...(status.expires_at ? { expires_at: status.expires_at, expired: status.expired } : {}),
178
+ }
179
+ : null,
180
+ effective_source: status.authenticated ? status.source : null,
181
+ },
182
+ });
183
+ // Show a profile's backend, team, and authorization. Reads the stored credential
184
+ // raw (no refresh, no write) and reuses describe_status for a secret-free summary.
185
+ const handle_show = async (name, g, deps) => {
186
+ const env = deps.env ?? process.env;
187
+ const target = name ?? (0, profile_1.current_profile_name)(env);
188
+ const d = (0, profile_1.describe_profile)(target, env);
189
+ const api_key_env = (0, config_1.get_env)('API_KEY', env);
190
+ const record = await deps.store.get(target);
191
+ const status = (0, status_1.describe_status)({
192
+ profile: target, api_key_flag: deps.api_key_flag, api_key_env, record, now: Date.now(),
193
+ });
194
+ if (wants_json(g)) {
195
+ (0, output_1.print)(show_json(d, status, Boolean(deps.api_key_flag), Boolean(api_key_env), record), print_opts(g));
196
+ return;
197
+ }
198
+ const inh = (on) => on ? ' (inherited)' : '';
199
+ const lines = [
200
+ `Profile: ${d.name}${d.is_current ? ' (current)' : ''}`,
201
+ ' Backend:',
202
+ ` authority : ${d.authority}${inh(d.inherited.authority)}`,
203
+ ` api_base : ${d.api_base}${inh(d.inherited.api_base)}`,
204
+ ' Team:',
205
+ ` team_id : ${d.team_id ?? '—'}`,
206
+ ' Authorization (first available is used):',
207
+ ` 1. --api-key flag : ${deps.api_key_flag ? 'provided' : 'not provided'}`,
208
+ ` 2. ${(0, config_1.env_var)('API_KEY')} env : ${api_key_env ? 'set' : 'not set'}`,
209
+ ` 3. stored credential : ${stored_summary(status, record)}`,
210
+ ];
211
+ console.log(lines.join('\n'));
212
+ };
213
+ exports.handle_show = handle_show;
214
+ const profile_command = new commander_1.Command('profile')
215
+ .description('Manage profiles — optional; most users never need one (default = prod)');
216
+ exports.profile_command = profile_command;
217
+ profile_command
218
+ .command('add')
219
+ .argument('<name>', 'Profile name (e.g. your account email)')
220
+ .option('--team-id <id>', 'Pin a team/workspace for this profile (sent as X-TEAM-ID)')
221
+ .option('--authority <url>', 'Override the OAuth authority (advanced; defaults to prod)')
222
+ .option('--api-base <url>', 'Override the API base (advanced; defaults to prod)')
223
+ .description('Create a profile (URLs optional — omitted fields inherit the default/prod)')
224
+ .addHelpText('after', `\nExamples:\n ${config_1.PROGRAM_NAME} profile add alice@reply.io`
225
+ + `\n ${config_1.PROGRAM_NAME} profile add dev --api-base https://api.dev.reply.io --team-id 1045`)
226
+ .action(function (name) {
227
+ const g = read_globals(this);
228
+ const opts = this.optsWithGlobals();
229
+ (0, profile_1.add_profile)(name, {
230
+ authority: parse_url(opts.authority), api_base: parse_url(opts.apiBase), team_id: parse_team_id(opts.teamId),
231
+ });
232
+ if (wants_json(g)) {
233
+ (0, output_1.print)({ added: name }, print_opts(g));
234
+ return;
235
+ }
236
+ (0, output_1.success)(`Profile '${name}' created. Make it current with: profile use ${name}`);
237
+ });
238
+ profile_command
239
+ .command('set')
240
+ .argument('<name>', 'Profile to edit (a user profile, or "default" to pin a team globally)')
241
+ .option('--team-id <id>', 'Pin a team/workspace (sent as X-TEAM-ID)')
242
+ .option('--authority <url>', 'Override the OAuth authority (advanced)')
243
+ .option('--api-base <url>', 'Override the API base (advanced)')
244
+ .description('Edit an existing profile in place — only the fields you pass change')
245
+ .addHelpText('after', `\nExamples:\n ${config_1.PROGRAM_NAME} profile set alice@reply.io --team-id 1045`
246
+ + `\n ${config_1.PROGRAM_NAME} profile set default --team-id 1045 # pin a team globally`)
247
+ .action(function (name) {
248
+ const g = read_globals(this);
249
+ const opts = this.optsWithGlobals();
250
+ (0, profile_1.set_profile)(name, {
251
+ authority: parse_url(opts.authority), api_base: parse_url(opts.apiBase), team_id: parse_team_id(opts.teamId),
252
+ });
253
+ if (wants_json(g)) {
254
+ (0, output_1.print)({ updated: name }, print_opts(g));
255
+ return;
256
+ }
257
+ (0, output_1.success)(`Profile '${name}' updated.`);
258
+ });
259
+ profile_command
260
+ .command('rename')
261
+ .argument('<old>', 'Existing profile to rename')
262
+ .argument('<new>', 'New name')
263
+ .description('Rename a profile (also moves its stored credential)')
264
+ .addHelpText('after', `\nExamples:\n ${config_1.PROGRAM_NAME} profile rename alice@reply.io ally`)
265
+ .action(async function (old_name, new_name) {
266
+ const g = read_globals(this);
267
+ await handle_rename(old_name, new_name, g, { store: (0, file_store_1.default_credential_store)() });
268
+ });
269
+ profile_command
270
+ .command('delete')
271
+ .alias('rm')
272
+ .argument('<name>', 'Profile to delete')
273
+ .option('-y, --yes', 'Skip the confirmation prompt')
274
+ .description('Delete a profile and its stored credential')
275
+ .addHelpText('after', `\nExamples:\n ${config_1.PROGRAM_NAME} profile delete ally # confirm y/N (interactive)`
276
+ + `\n ${config_1.PROGRAM_NAME} profile delete ally --yes # skip the prompt (required in scripts)`)
277
+ .action(async function (name) {
278
+ const g = read_globals(this);
279
+ await handle_delete(name, { yes: Boolean(this.opts().yes) }, g, { store: (0, file_store_1.default_credential_store)() });
280
+ });
281
+ profile_command
282
+ .command('use')
283
+ .argument('<name>', 'Profile to make current (a user-defined profile, or "default" for prod)')
284
+ .description('Set the current profile, used until changed')
285
+ .addHelpText('after', `\nExamples:\n ${config_1.PROGRAM_NAME} profile use dev\n ${config_1.PROGRAM_NAME} profile use default`)
286
+ .action(function (name) {
287
+ const g = read_globals(this);
288
+ (0, profile_1.set_current_profile)(name);
289
+ if (wants_json(g)) {
290
+ (0, output_1.print)({ current: name }, print_opts(g));
291
+ return;
292
+ }
293
+ (0, output_1.success)(`Current profile set to ${name}.`);
294
+ });
295
+ profile_command
296
+ .command('unset')
297
+ .argument('<name>', 'Profile to edit (or "default")')
298
+ .argument('<field>', 'Field to clear: authority | api_base | team-id')
299
+ .description('Clear a config field on a profile (reverts to inherited/unset)')
300
+ .addHelpText('after', `\nExamples:\n ${config_1.PROGRAM_NAME} profile unset dev team-id`)
301
+ .action(function (name, field) {
302
+ const g = read_globals(this);
303
+ const mapped = map_clearable(field);
304
+ const { changed } = (0, profile_1.unset_profile_field)(name, mapped, process.env);
305
+ if (wants_json(g)) {
306
+ (0, output_1.print)({ unset: mapped, profile: name, changed }, print_opts(g));
307
+ return;
308
+ }
309
+ if (changed) {
310
+ (0, output_1.success)(`Cleared ${mapped} on profile '${name}'.`);
311
+ return;
312
+ }
313
+ (0, output_1.info)(`${mapped} was already not set on '${name}'.`);
314
+ });
315
+ profile_command
316
+ .command('list')
317
+ .description('List available profiles and show which is current')
318
+ .action(function () {
319
+ const g = read_globals(this);
320
+ const { current, available } = (0, profile_1.list_profiles)();
321
+ if (wants_json(g)) {
322
+ (0, output_1.print)({ current, available }, print_opts(g));
323
+ return;
324
+ }
325
+ for (const name of available) {
326
+ const marker = name === current ? output_1.pc.green('*') : ' ';
327
+ console.log(`${marker} ${name}`);
328
+ }
329
+ });
330
+ profile_command
331
+ .command('current')
332
+ .description('Print the current profile name')
333
+ .action(function () {
334
+ const g = read_globals(this);
335
+ const current = (0, profile_1.current_profile_name)();
336
+ (0, output_1.print)(wants_json(g) ? { current } : current, print_opts(g));
337
+ });
338
+ profile_command
339
+ .command('show')
340
+ .argument('[name]', 'Profile to show (default: current)')
341
+ .description('Show a profile\'s backend, team, and authorization (no secrets)')
342
+ .addHelpText('after', `\nExamples:\n ${config_1.PROGRAM_NAME} profile show # the current profile`
343
+ + `\n ${config_1.PROGRAM_NAME} profile show dev --json`)
344
+ .action(async function (name) {
345
+ const g = read_globals(this);
346
+ await handle_show(name, g, { store: (0, file_store_1.default_credential_store)(), api_key_flag: g.apiKey });
347
+ });
348
+ //# sourceMappingURL=profile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile.js","sourceRoot":"","sources":["../../src/commands/profile.ts"],"names":[],"mappings":";;;;;;AAAA,wDAAgC;AAChC,yCAAkC;AAClC,wCAIoB;AACpB,0DAAmE;AACnE,2CAAiE;AACjE,iCAAuC;AACvC,4CAA2C;AAC3C,sCAAmE;AACnE,4CAA0E;AAK1E,MAAM,YAAY,GAAG,CAAC,GAAY,EAAc,EAAE;IAC9C,MAAM,CAAC,GAAG,GAAG,CAAC,eAAe,EAAE,CAAC;IAChC,OAAO,EAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAC,CAAC;AAC9D,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,CAAc,EAAU,EAAE,CAAA,OAAO,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC;AAC1E,MAAM,UAAU,GAAG,CAAC,CAAc,EAAa,EAAE,CAAA,CAAC,EAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAC,CAAC,CAAC;AAEpF,MAAM,aAAa,GAAG,CAAC,CAAU,EAAqB,EAAE;IACpD,IAAI,CAAC,KAAK,SAAS,EACnB,CAAC;QACG,OAAO,SAAS,CAAC;IACrB,C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ation } from '../skills/types';
3
+ type Skills_cli_opts = {
4
+ agent?: string[];
5
+ project?: boolean;
6
+ dryRun?: boolean;
7
+ json?: boolean;
8
+ pretty?: boolean;
9
+ };
10
+ declare const handle_skills: (operation: Operation, packs: string[], opts: Skills_cli_opts) => Promise<void>;
11
+ declare const skills_command: Command;
12
+ export { skills_command, handle_skills };
@@ -0,0 +1,138 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.handle_skills = exports.skills_command = void 0;
4
+ const commander_1 = require("commander");
5
+ const config_1 = require("../config");
6
+ const orchestrate_1 = require("../skills/orchestrate");
7
+ const report_1 = require("../skills/report");
8
+ const errors_1 = require("../utils/errors");
9
+ const output_1 = require("../utils/output");
10
+ const read_globals = (cmd) => {
11
+ const o = cmd.optsWithGlobals();
12
+ return { agent: o.agent, project: o.project, dryRun: o.dryRun, json: o.json, pretty: o.pretty };
13
+ };
14
+ const wants_json = (o) => Boolean(o.json || o.pretty);
15
+ const print_opts = (o) => ({ json: o.json, pretty: o.pretty });
16
+ // What exiting 1 means, per operation. `exit_code_for` already branches on the
17
+ // action; telling a failed `remove` that "no assistant received the skills"
18
+ // and pointing it at `install --dry-run` misdirects the one user who most
19
+ // needs the right command. `list` never exits 1 (it is a query), but the map
20
+ // stays total so a new operation cannot silently inherit the wrong wording.
21
+ const NOTHING_HAPPENED = {
22
+ install: {
23
+ title: 'No assistant received the skills.',
24
+ code: 'skills.nothing_installed',
25
+ probe: 'install --dry-run',
26
+ },
27
+ update: {
28
+ title: 'No assistant was updated.',
29
+ code: 'skills.nothing_updated',
30
+ probe: 'update --dry-run',
31
+ },
32
+ remove: {
33
+ title: 'No assistant had the skills removed.',
34
+ code: 'skills.nothing_removed',
35
+ probe: 'remove --dry-run',
36
+ },
37
+ list: {
38
+ title: 'No assistant could be queried.',
39
+ code: 'skills.nothing_listed',
40
+ probe: 'list --json',
41
+ },
42
+ };
43
+ // One handler for all four operations: they differ only in the operation name,
44
+ // so the reporting and exit-code contract stays in exactly one place.
45
+ const handle_skills = async (operation, packs, opts) => {
46
+ const report = await (0, orchestrate_1.run_skills)({
47
+ operation,
48
+ requested: packs,
49
+ agents: opts.agent,
50
+ project: opts.project === true,
51
+ dry_run: opts.dryRun === true,
52
+ });
53
+ if (wants_json(opts)) {
54
+ (0, output_1.print)(report, print_opts(opts));
55
+ }
56
+ else {
57
+ // `list` is a data command, so its table is what the user redirects —
58
+ // it goes to stdout. Every other operation prints progress, which is
59
+ // status and belongs on stderr (see utils/output.ts).
60
+ const write = report.action === 'list' ? console.log : console.error;
61
+ for (const line of (0, report_1.human_lines)(report)) {
62
+ write(line);
63
+ }
64
+ }
65
+ // The report is printed either way: exiting non-zero without it would hide
66
+ // why each host failed.
67
+ if ((0, report_1.exit_code_for)(report) !== 0) {
68
+ const failure = NOTHING_HAPPENED[operation];
69
+ throw new errors_1.RuntimeError(failure.title, {
70
+ code: failure.code,
71
+ hint: `run \`${config_1.PROGRAM_NAME} skills ${failure.probe}\` to see what was attempted`,
72
+ });
73
+ }
74
+ };
75
+ exports.handle_skills = handle_skills;
76
+ const skills_command = new commander_1.Command('skills')
77
+ .description('Install and manage Reply skill packs in your AI assistants');
78
+ exports.skills_command = skills_command;
79
+ const with_flags = (cmd) => cmd
80
+ .option('-a, --agent <id...>', 'Target these assistants instead of auto-detecting')
81
+ .option('--project', 'Install into the current repository instead of your user directory')
82
+ .option('--dry-run', 'Show what would happen and change nothing');
83
+ const packs_help = `
84
+ Packs: ai-sdr-core (alias core) · reply-adapter (adapter) · agentic-runtime (runtime).
85
+ No pack means all three; dependencies are resolved for you.`;
86
+ with_flags(skills_command
87
+ .command('install')
88
+ .argument('[packs...]', 'Packs to install (default: all three)')
89
+ .description('Install Reply skill packs into every detected assistant'))
90
+ .addHelpText('after', `${packs_help}
91
+
92
+ Examples:
93
+ ${config_1.PROGRAM_NAME} skills install
94
+ ${config_1.PROGRAM_NAME} skills install core
95
+ ${config_1.PROGRAM_NAME} skills install adapter runtime
96
+ ${config_1.PROGRAM_NAME} skills install --agent codex --json`)
97
+ .action(async function (packs) {
98
+ await handle_skills('install', packs, read_globals(this));
99
+ });
100
+ with_flags(skills_command
101
+ .command('list')
102
+ .argument('[packs...]', 'Limit the listing to these packs')
103
+ .description('Show which packs are installed in which assistant'))
104
+ .addHelpText('after', `${packs_help}
105
+
106
+ Examples:
107
+ ${config_1.PROGRAM_NAME} skills list
108
+ ${config_1.PROGRAM_NAME} skills list --json`)
109
+ .action(async function (packs) {
110
+ await handle_skills('list', packs, read_globals(this));
111
+ });
112
+ with_flags(skills_command
113
+ .command('update')
114
+ .argument('[packs...]', 'Packs to update (default: all installed)')
115
+ .description('Update installed packs to the latest published version'))
116
+ .addHelpText('after', `${packs_help}
117
+
118
+ Examples:
119
+ ${config_1.PROGRAM_NAME} skills update
120
+ ${config_1.PROGRAM_NAME} skills update --dry-run`)
121
+ .action(async function (packs) {
122
+ await handle_skills('update', packs, read_globals(this));
123
+ });
124
+ with_flags(skills_command
125
+ .command('remove')
126
+ .argument('[packs...]', 'Packs to remove (default: all of them)')
127
+ .description('Remove Reply skill packs from your assistants'))
128
+ .addHelpText('after', `${packs_help}
129
+ Removing a pack that another installed pack depends on is refused — remove both,
130
+ or run \`${config_1.PROGRAM_NAME} skills remove\` with no pack to remove everything.
131
+
132
+ Examples:
133
+ ${config_1.PROGRAM_NAME} skills remove
134
+ ${config_1.PROGRAM_NAME} skills remove runtime`)
135
+ .action(async function (packs) {
136
+ await handle_skills('remove', packs, read_globals(this));
137
+ });
138
+ //# sourceMappingURL=skills.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skills.js","sourceRoot":"","sources":["../../src/commands/skills.ts"],"names":[],"mappings":";;;AAAA,yCAAkC;AAClC,sCAAuC;AACvC,uDAAiD;AACjD,6CAA4D;AAC5D,4CAA6C;AAC7C,4CAAuD;AAWvD,MAAM,YAAY,GAAG,CAAC,GAAY,EAAkB,EAAE;IAClD,MAAM,CAAC,GAAG,GAAG,C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C7D,CAAC,CAAC,CAAC;AAEP,UAAU,CAAC,cAAc;KACpB,OAAO,CAAC,QAAQ,CAAC;KACjB,QAAQ,CAAC,YAAY,EAAE,wCAAwC,CAAC;KAChE,WAAW,CAAC,+CAA+C,CAAC,CAAC;KAC7D,WAAW,CAAC,OAAO,EAAE,GAAG,UAAU;;WAE5B,qBAAY;;;IAGnB,qBAAY;IACZ,qBAAY,wBAAwB,CAAC;KACpC,MAAM,CAAC,KAAK,WAAyB,KAAe;IACjD,MAAM,aAAa,CAAC,QAAQ,EAAE,KAAK,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;AAC7D,CAAC,CAAC,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { Command } from 'commander';
2
+ import { type Cli_context } from '../context';
3
+ type Global_opts = {
4
+ apiKey?: string;
5
+ profile?: string;
6
+ teamId?: string;
7
+ userId?: string;
8
+ userEmail?: string;
9
+ json?: boolean;
10
+ pretty?: boolean;
11
+ };
12
+ declare const handle_team_list: (ctx: Cli_context, g: Global_opts) => Promise<void>;
13
+ declare const handle_team_current: (ctx: Cli_context, g: Global_opts) => Promise<void>;
14
+ declare const handle_team_use: (id_arg: string, ctx: Cli_context, g: Global_opts) => Promise<void>;
15
+ declare const handle_team_clear: (ctx: Cli_context, g: Global_opts) => void;
16
+ declare const team_command: Command;
17
+ export { team_command, handle_team_list, handle_team_current, handle_team_use, handle_team_clear };