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
package/dist/index.js CHANGED
@@ -1,97 +1,129 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
3
  Object.defineProperty(exports, "__esModule", { value: true });
7
4
  exports.build_program = void 0;
8
- const fs_1 = __importDefault(require("fs"));
9
- const path_1 = __importDefault(require("path"));
10
5
  const commander_1 = require("commander");
11
- const client_1 = require("./utils/client");
6
+ const config_1 = require("./config");
12
7
  const auth_1 = require("./commands/auth");
13
- const contacts_1 = require("./commands/contacts");
14
- const lists_1 = require("./commands/lists");
15
- const sequences_1 = require("./commands/sequences");
16
- const sequences_stats_1 = require("./commands/sequences-stats");
17
- const sequence_contacts_1 = require("./commands/sequence-contacts");
18
- const inbox_1 = require("./commands/inbox");
19
- const reports_1 = require("./commands/reports");
20
- const email_accounts_1 = require("./commands/email-accounts");
21
- const schedules_1 = require("./commands/schedules");
22
- const read_version = () => {
23
- try {
24
- const pkg = JSON.parse(fs_1.default.readFileSync(path_1.default.join(__dirname, '../package.json'), 'utf-8'));
25
- return pkg.version || '0.0.0';
26
- }
27
- catch {
28
- return '0.0.0';
8
+ const profile_1 = require("./commands/profile");
9
+ const team_1 = require("./commands/team");
10
+ const api_1 = require("./commands/api");
11
+ const skills_1 = require("./commands/skills");
12
+ const errors_1 = require("./utils/errors");
13
+ const output_1 = require("./utils/output");
14
+ // Route every command through commander's throwing mode so usage errors reach
15
+ // our handler and map to exit code 2 (vs 1 for runtime/API failures).
16
+ const set_exit_override = (cmd) => {
17
+ cmd.exitOverride();
18
+ for (const sub of cmd.commands) {
19
+ set_exit_override(sub);
29
20
  }
30
21
  };
31
22
  const build_program = () => {
32
23
  const program = new commander_1.Command();
24
+ const PREFIX = config_1.PROGRAM_NAME.toUpperCase();
33
25
  program
34
- .name('reply')
35
- .description('Command-line interface for the Reply.io v3 API. Manage contacts,\n'
36
- + 'lists, sequences, inbox, and reports from your terminal.')
37
- .version(read_version(), '-v, --version')
38
- .option('-k, --api-key <key>', 'Reply.io API key (overrides env/config)')
39
- .option('--timing', 'Show request timing')
40
- .option('--json', 'Output as compact JSON')
41
- .option('--pretty', 'Output as formatted JSON');
42
- // stats and contacts are subcommands of sequences
43
- sequences_1.sequences_command.addCommand(sequences_stats_1.sequences_stats_command);
44
- sequences_1.sequences_command.addCommand(sequence_contacts_1.sequence_contacts_command);
26
+ .name(config_1.PROGRAM_NAME)
27
+ .description('Command-line interface for Reply.io — authentication and identity (v1).')
28
+ .version((0, config_1.cli_version)(), '-v, --version')
29
+ .option('-k, --api-key <key>', 'API key (overrides env var and stored credential)')
30
+ .option('-p, --profile <name>', 'Named backend profile (default: prod)')
31
+ .option('--team-id <id>', `Team/workspace to act in (X-TEAM-ID); else ${PREFIX}_TEAM_ID or the profile`)
32
+ .option('--user-id <id>', 'Act as this user id — organization API keys only (X-USER-ID)')
33
+ .option('--user-email <email>', 'Act as this user email — organization API keys only (needs a team id)')
34
+ .option('--json', 'Output compact JSON to stdout')
35
+ .option('--pretty', 'Output indented JSON to stdout')
36
+ .option('--verbose', 'Print the full request/response to stderr, credentials redacted (api)')
37
+ .option('-q, --quiet', 'Suppress progress messages on stderr (warnings and errors still shown)')
38
+ .showHelpAfterError();
39
+ // Apply --quiet before any command action runs, so progress output is
40
+ // silenced for the whole invocation.
41
+ program.hook('preAction', () => { (0, output_1.set_quiet)(program.opts().quiet === true); });
45
42
  program.addCommand(auth_1.auth_command);
46
- program.addCommand(contacts_1.contacts_command);
47
- program.addCommand(lists_1.lists_command);
48
- program.addCommand(sequences_1.sequences_command);
49
- program.addCommand(inbox_1.inbox_command);
50
- program.addCommand(reports_1.reports_command);
51
- program.addCommand(email_accounts_1.email_accounts_command);
52
- program.addCommand(schedules_1.schedules_command);
43
+ program.addCommand(profile_1.profile_command);
44
+ program.addCommand(team_1.team_command);
45
+ program.addCommand(api_1.api_command);
46
+ program.addCommand(skills_1.skills_command);
53
47
  program.addHelpText('after', `
54
- Command Groups:
55
- auth Verify authentication (whoami)
56
- contacts Manage contacts (list, get, create, update, delete, search, statuses, import)
57
- lists Manage contact lists (list, get, create, add-contacts)
58
- sequences Manage sequences (list, get, create, update, start, pause, archive)
59
- sequences stats Sequence performance (single or all sequences, --top)
60
- sequences contacts Contacts within a sequence (list, add, remove)
61
- inbox Threads and replies (threads list/get, reply, categories)
62
- reports Account-level reports (emails, sequences)
63
- email-accounts Connected sending accounts (list, check)
64
- schedules Sending schedules (list, get)
48
+ Credential precedence:
49
+ 1. --api-key <key> 2. ${PREFIX}_API_KEY env 3. stored credential
50
+
51
+ Profiles (which backend to talk to):
52
+ Precedence: --profile <name> > ${PREFIX}_PROFILE > current profile > default (prod).
53
+ Define your own profiles under "profiles" in the config file, e.g.:
54
+ { "profiles": { "dev": { "authority": "https://…", "api_base": "https://…" } } }
55
+ Then set one as current so you don't repeat --profile:
56
+ ${config_1.PROGRAM_NAME} profile use dev # used until you change it
57
+ ${config_1.PROGRAM_NAME} profile list # see all, * marks current
58
+ ${config_1.PROGRAM_NAME} profile current
59
+ ${config_1.PROGRAM_NAME} profile show [name] # backend, team, auth (no secrets)
60
+ ${config_1.PROGRAM_NAME} profile rename <old> <new>
61
+ ${config_1.PROGRAM_NAME} profile delete <name> # also removes its stored credential
62
+ ${config_1.PROGRAM_NAME} profile unset <name> <field> # clear authority|api_base|team-id
65
63
 
66
- Authentication:
67
- Set REPLY_API_KEY in your .env file, environment, or pass --api-key.
68
- Same API key as the Reply.io web app (Settings → API Keys). Verify: reply auth whoami
64
+ Team & acting user (headers):
65
+ --team-id <id> Team/workspace to act in. Precedence: --team-id > ${PREFIX}_TEAM_ID > profile team_id.
66
+ Pin one on a profile: ${config_1.PROGRAM_NAME} profile set <name> --team-id <id>
67
+ --user-id <id> / --user-email <email> Identify the acting user for an ORGANIZATION API key.
68
+ Flag-only (never env, never stored); pass exactly one; --user-email also needs a team id.
69
+ Team commands (see & set the current profile's team):
70
+ ${config_1.PROGRAM_NAME} team list # teams you can act in (* marks the profile's)
71
+ ${config_1.PROGRAM_NAME} team current # pinned + effective team
72
+ ${config_1.PROGRAM_NAME} team use <id> # pin a team on the current profile
73
+ ${config_1.PROGRAM_NAME} team clear # remove the pin
69
74
 
70
- Output & safety:
71
- --json for machine-readable output. Write commands prompt for confirmation;
72
- pass --yes in scripts. Bulk commands support --dry-run.
75
+ Raw API (agent/CI escape hatch) — docs: https://docs.reply.io/api-reference/introduction
76
+ Use the path as in the docs (starts with /v3); the query string goes in the path.
77
+ ${config_1.PROGRAM_NAME} api /v3/whoami # GET your identity + team
78
+ ${config_1.PROGRAM_NAME} api /v3/sequences # GET list of sequences
79
+ ${config_1.PROGRAM_NAME} api /v3/contacts --body @c.json # POST (a body switches method; schema per docs)
80
+ ${config_1.PROGRAM_NAME} api /v3/whoami --verbose # full req/resp to stderr (creds redacted)
81
+ Prints {code, data}; exits non-zero on HTTP >= 400.
73
82
 
74
- Coming soon (not yet in the API): prospect search, contact enrichment.
83
+ Configuration (env vars):
84
+ ${PREFIX}_API_KEY API key used as the bearer credential
85
+ ${PREFIX}_PROFILE Profile to use (same as --profile)
86
+ ${PREFIX}_TEAM_ID Team/workspace id (same as --team-id)
87
+ ${PREFIX}_CONFIG_DIR Override the per-user config directory
75
88
 
76
89
  Examples:
77
- reply auth whoami
78
- reply contacts import prospects.csv --dry-run
79
- reply sequences list --status active --json
80
- reply sequences contacts add 12345 --contacts john@co.com --dry-run
81
- reply inbox threads list --unread
90
+ ${config_1.PROGRAM_NAME} auth login
91
+ echo <key> | ${config_1.PROGRAM_NAME} auth login --with-token
92
+ ${config_1.PROGRAM_NAME} --profile dev auth whoami --json
93
+ ${config_1.PROGRAM_NAME} auth status
94
+ ${config_1.PROGRAM_NAME} team list
95
+ ${config_1.PROGRAM_NAME} api /v3/sequences
96
+ ${config_1.PROGRAM_NAME} skills install
97
+ ${config_1.PROGRAM_NAME} skills list --json
82
98
  `);
83
99
  return program;
84
100
  };
85
101
  exports.build_program = build_program;
86
102
  const wants_json = () => process.argv.includes('--json') || process.argv.includes('--pretty');
87
103
  const main = async () => {
88
- await build_program().parseAsync(process.argv);
104
+ const program = build_program();
105
+ set_exit_override(program);
106
+ await program.parseAsync(process.argv);
89
107
  };
90
- void main().catch(error => {
91
- if (error instanceof client_1.Api_error && wants_json())
92
- console.error(JSON.stringify(error.to_json()));
93
- else
94
- console.error(error instanceof Error ? error.message : error);
108
+ void main().catch((error) => {
109
+ if (error instanceof commander_1.CommanderError) {
110
+ // commander has already written help/usage text; help & version exit 0,
111
+ // any other usage problem exits 2.
112
+ const ok = error.code === 'commander.helpDisplayed'
113
+ || error.code === 'commander.version'
114
+ || error.code === 'commander.help';
115
+ process.exit(ok ? 0 : 2);
116
+ }
117
+ if (error instanceof errors_1.CliError) {
118
+ if (wants_json()) {
119
+ console.error(JSON.stringify(error.to_json()));
120
+ }
121
+ else {
122
+ console.error(error.message);
123
+ }
124
+ process.exit(error.exit_code);
125
+ }
126
+ console.error(error instanceof Error ? error.message : String(error));
95
127
  process.exit(1);
96
128
  });
97
129
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;AACA,4CAAoB;AACpB,gDAAwB;AACxB,yCAAkC;AAClC,2CAAyC;AACzC,0CAA6C;AAC7C,kDAAqD;AACrD,4CAA+C;AAC/C,oDAAuD;AACvD,gEAAmE;AACnE,oEAAuE;AACvE,4CAA+C;AAC/C,gDAAmD;AACnD,8DAAiE;AACjE,oDAAuD;AAEvD,MA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AAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC;IACD,IAAI,KAAK,YAAY,iBAAQ,EAC7B,CAAC;QACG,IAAI,UAAU,EAAE,EAChB,CAAC;YACG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QACnD,CAAC;aAED,CAAC;YACG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACjC,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,CAAC,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACtE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,51 @@
1
+ import { type Env } from './config';
2
+ type Profile = {
3
+ name: string;
4
+ authority: string;
5
+ api_base: string;
6
+ team_id?: number;
7
+ };
8
+ declare const EMBEDDED: {
9
+ authority: string;
10
+ api_base: string;
11
+ };
12
+ declare const PROD: {
13
+ authority: string;
14
+ api_base: string;
15
+ };
16
+ declare const resolve_profile: (flag?: string, env?: Env) => Profile;
17
+ declare const current_profile_name: (env?: Env) => string;
18
+ type Profile_description = {
19
+ name: string;
20
+ authority: string;
21
+ api_base: string;
22
+ team_id?: number;
23
+ is_current: boolean;
24
+ inherited: {
25
+ authority: boolean;
26
+ api_base: boolean;
27
+ };
28
+ };
29
+ declare const describe_profile: (name: string, env?: Env) => Profile_description;
30
+ declare const list_profiles: (env?: Env) => {
31
+ current: string;
32
+ available: string[];
33
+ };
34
+ type Profile_fields = {
35
+ authority?: string;
36
+ api_base?: string;
37
+ team_id?: number;
38
+ };
39
+ type Clearable_field = 'authority' | 'api_base' | 'team_id';
40
+ declare const add_profile: (name: string, fields: Profile_fields, env?: Env) => void;
41
+ declare const set_profile: (name: string, fields: Profile_fields, env?: Env) => void;
42
+ declare const rename_profile_def: (old_name: string, new_name: string, env?: Env) => void;
43
+ declare const delete_profile_def: (name: string, env?: Env) => {
44
+ was_current: boolean;
45
+ };
46
+ declare const unset_profile_field: (name: string, field: Clearable_field, env?: Env) => {
47
+ changed: boolean;
48
+ };
49
+ declare const set_current_profile: (name: string, env?: Env) => void;
50
+ export { resolve_profile, current_profile_name, list_profiles, set_current_profile, add_profile, set_profile, rename_profile_def, delete_profile_def, unset_profile_field, describe_profile, EMBEDDED, PROD };
51
+ export type { Profile, Profile_fields, Clearable_field, Profile_description };
@@ -0,0 +1,295 @@
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.PROD = exports.EMBEDDED = exports.describe_profile = exports.unset_profile_field = exports.delete_profile_def = exports.rename_profile_def = exports.set_profile = exports.add_profile = exports.set_current_profile = exports.list_profiles = exports.current_profile_name = exports.resolve_profile = void 0;
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const path_1 = __importDefault(require("path"));
9
+ const config_1 = require("./config");
10
+ const errors_1 = require("./utils/errors");
11
+ const DEFAULT_NAME = 'default';
12
+ // The embedded default profile: prod. Everything inherits from this. The
13
+ // api_base is the HOST only — the /v3 version prefix lives in the request path
14
+ // (so a raw `api` call's URL matches the docs), not in the profile.
15
+ const EMBEDDED = {
16
+ authority: 'https://oauth.reply.io',
17
+ api_base: 'https://api.reply.io',
18
+ };
19
+ exports.EMBEDDED = EMBEDDED;
20
+ // Back-compat alias for callers/tests referencing the prod target.
21
+ const PROD = EMBEDDED;
22
+ exports.PROD = PROD;
23
+ const strip_trailing_slash = (url) => url.replace(/\/+$/, '');
24
+ // team_id is account-specific and NOT inherited from the embedded default.
25
+ // Accept a number, or a numeric string from hand-edited config.
26
+ const read_team_id = (v) => {
27
+ if (typeof v === 'number' && Number.isInteger(v)) {
28
+ return v;
29
+ }
30
+ if (typeof v === 'string' && /^\d+$/.test(v.trim())) {
31
+ return parseInt(v.trim(), 10);
32
+ }
33
+ return undefined;
34
+ };
35
+ const read_config = (env) => {
36
+ const file = (0, config_1.config_file)(env);
37
+ let raw;
38
+ try {
39
+ raw = fs_1.default.readFileSync(file, 'utf8');
40
+ }
41
+ catch (e) {
42
+ if (e.code === 'ENOENT') {
43
+ return {};
44
+ }
45
+ throw new errors_1.RuntimeError('Could not read the config file.', {
46
+ code: 'config.read', detail: file, hint: e.message,
47
+ });
48
+ }
49
+ if (!raw.trim()) {
50
+ return {};
51
+ }
52
+ let parsed;
53
+ try {
54
+ parsed = JSON.parse(raw);
55
+ }
56
+ catch {
57
+ throw new errors_1.RuntimeError('Config file is corrupt (invalid JSON).', {
58
+ code: 'config.corrupt', detail: file, hint: 'Fix or delete the file.',
59
+ });
60
+ }
61
+ if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {
62
+ throw new errors_1.RuntimeError('Config file is corrupt (unexpected shape).', {
63
+ code: 'config.corrupt', detail: file, hint: 'Fix or delete the file.',
64
+ });
65
+ }
66
+ return parsed;
67
+ };
68
+ const get_profiles = (cfg, env) => {
69
+ const { profiles } = cfg;
70
+ if (profiles === undefined || profiles === null) {
71
+ return {};
72
+ }
73
+ if (typeof profiles !== 'object' || Array.isArray(profiles)) {
74
+ throw new errors_1.RuntimeError('Config "profiles" must be an object.', {
75
+ code: 'config.corrupt', detail: (0, config_1.config_file)(env), hint: 'Fix or delete the file.',
76
+ });
77
+ }
78
+ return profiles;
79
+ };
80
+ const persisted_current = (cfg) => typeof cfg.current_profile === 'string' && cfg.current_profile.trim()
81
+ ? cfg.current_profile
82
+ : undefined;
83
+ const inherit = (value, fallback) => typeof value === 'string' && value.trim() ? value : fallback;
84
+ // Selection precedence: --profile flag -> REPLY_PROFILE env -> persisted
85
+ // current_profile -> built-in default. Each field inherits from the embedded
86
+ // default unless the named profile overrides it. An unknown name is a usage
87
+ // error (typo-safe) — create profiles with `profile add`.
88
+ const resolve_profile = (flag, env = process.env) => {
89
+ const cfg = read_config(env);
90
+ const profiles = get_profiles(cfg, env);
91
+ const name = flag || (0, config_1.get_env)('PROFILE', env) || persisted_current(cfg) || DEFAULT_NAME;
92
+ const declared = profiles[name];
93
+ if (!declared && name !== DEFAULT_NAME) {
94
+ throw new errors_1.UsageError(`Unknown profile '${name}'.`, {
95
+ code: 'usage.profile',
96
+ hint: `Create it with \`profile add ${name}\`, or omit --profile for the default.`,
97
+ });
98
+ }
99
+ const over = declared ?? {};
100
+ const team_id = read_team_id(over.team_id);
101
+ return {
102
+ name,
103
+ authority: strip_trailing_slash(inherit(over.authority, EMBEDDED.authority)),
104
+ api_base: strip_trailing_slash(inherit(over.api_base, EMBEDDED.api_base)),
105
+ ...(team_id !== undefined ? { team_id } : {}),
106
+ };
107
+ };
108
+ exports.resolve_profile = resolve_profile;
109
+ const current_profile_name = (env = process.env) => persisted_current(read_config(env)) || DEFAULT_NAME;
110
+ exports.current_profile_name = current_profile_name;
111
+ // Resolved view of a profile for `profile show`: resolved values plus flags for
112
+ // which URLs are inherited (not explicitly set) and whether it's current. No
113
+ // credentials/secrets — the command layer adds a redacted credential summary.
114
+ const describe_profile = (name, env = process.env) => {
115
+ const resolved = resolve_profile(name, env); // throws UsageError if unknown
116
+ const cfg = read_config(env);
117
+ const raw = get_profiles(cfg, env)[name] ?? {};
118
+ const explicit = (v) => typeof v === 'string' && v.trim().length > 0;
119
+ return {
120
+ name: resolved.name,
121
+ authority: resolved.authority,
122
+ api_base: resolved.api_base,
123
+ ...(resolved.team_id !== undefined ? { team_id: resolved.team_id } : {}),
124
+ is_current: (persisted_current(cfg) || DEFAULT_NAME) === name,
125
+ inherited: { authority: !explicit(raw.authority), api_base: !explicit(raw.api_base) },
126
+ };
127
+ };
128
+ exports.describe_profile = describe_profile;
129
+ const list_profiles = (env = process.env) => {
130
+ const cfg = read_config(env);
131
+ const names = new Set([DEFAULT_NAME, ...Object.keys(get_profiles(cfg, env))]);
132
+ return { current: persisted_current(cfg) || DEFAULT_NAME, available: [...names] };
133
+ };
134
+ exports.list_profiles = list_profiles;
135
+ const write_config = (cfg, env) => {
136
+ const file = (0, config_1.config_file)(env);
137
+ fs_1.default.mkdirSync(path_1.default.dirname(file), { recursive: true });
138
+ fs_1.default.writeFileSync(file, JSON.stringify(cfg, null, 2) + '\n', 'utf8');
139
+ };
140
+ const CLEARABLE_FIELDS = ['authority', 'api_base', 'team_id'];
141
+ // Apply the given fields onto a profile def, in place (only fields actually
142
+ // provided are written, so merges are non-destructive).
143
+ const apply_fields = (def, fields) => {
144
+ if (fields.authority && fields.authority.trim()) {
145
+ def.authority = fields.authority;
146
+ }
147
+ if (fields.api_base && fields.api_base.trim()) {
148
+ def.api_base = fields.api_base;
149
+ }
150
+ if (fields.team_id !== undefined) {
151
+ def.team_id = fields.team_id;
152
+ }
153
+ };
154
+ // Create a profile. URLs are optional — anything omitted is inherited from the
155
+ // embedded default (prod). team_id is optional and account-specific.
156
+ const add_profile = (name, fields, env = process.env) => {
157
+ if (!name.trim()) {
158
+ throw new errors_1.UsageError('A profile name is required.', { code: 'usage.profile' });
159
+ }
160
+ if (name === DEFAULT_NAME) {
161
+ throw new errors_1.UsageError('`default` is the built-in profile and cannot be added.', {
162
+ code: 'usage.profile',
163
+ hint: 'Pick another name, e.g. your account email.',
164
+ });
165
+ }
166
+ const cfg = read_config(env);
167
+ const profiles = get_profiles(cfg, env);
168
+ const def = {};
169
+ apply_fields(def, fields);
170
+ profiles[name] = def;
171
+ cfg.profiles = profiles;
172
+ write_config(cfg, env);
173
+ };
174
+ exports.add_profile = add_profile;
175
+ // Edit an existing profile in place (merge-safe). Unlike add, `default` is
176
+ // allowed — it's the natural way for a no-profile user to pin a team without
177
+ // creating a named profile. A named profile must already exist.
178
+ const set_profile = (name, fields, env = process.env) => {
179
+ if (!name.trim()) {
180
+ throw new errors_1.UsageError('A profile name is required.', { code: 'usage.profile' });
181
+ }
182
+ const cfg = read_config(env);
183
+ const profiles = get_profiles(cfg, env);
184
+ if (name !== DEFAULT_NAME && !profiles[name]) {
185
+ throw new errors_1.UsageError(`Unknown profile '${name}'.`, {
186
+ code: 'usage.profile',
187
+ hint: `Create it first with \`profile add ${name}\`.`,
188
+ });
189
+ }
190
+ const def = { ...(profiles[name] ?? {}) };
191
+ apply_fields(def, fields);
192
+ profiles[name] = def;
193
+ cfg.profiles = profiles;
194
+ write_config(cfg, env);
195
+ };
196
+ exports.set_profile = set_profile;
197
+ // Rename a profile's config entry. Config-only — the credential move is done by
198
+ // the command layer (see commands/profile.ts handle_rename), which also guards
199
+ // against clobbering a login. `default` is the built-in slot: neither source nor
200
+ // target. Validation order matches the spec.
201
+ const rename_profile_def = (old_name, new_name, env = process.env) => {
202
+ if (old_name === DEFAULT_NAME) {
203
+ throw new errors_1.UsageError('The built-in default profile can\'t be renamed.', { code: 'usage.profile' });
204
+ }
205
+ const cfg = read_config(env);
206
+ const profiles = get_profiles(cfg, env);
207
+ if (!profiles[old_name]) {
208
+ throw new errors_1.UsageError(`Unknown profile '${old_name}'.`, {
209
+ code: 'usage.profile', hint: 'List profiles with `profile list`.',
210
+ });
211
+ }
212
+ if (!new_name.trim()) {
213
+ throw new errors_1.UsageError('A profile name is required.', { code: 'usage.profile' });
214
+ }
215
+ if (new_name === DEFAULT_NAME) {
216
+ throw new errors_1.UsageError('Can\'t rename to the built-in default.', { code: 'usage.profile' });
217
+ }
218
+ if (new_name === old_name) {
219
+ throw new errors_1.UsageError('New name is the same as the old name.', { code: 'usage.profile' });
220
+ }
221
+ if (profiles[new_name]) {
222
+ throw new errors_1.UsageError(`Profile '${new_name}' already exists.`, {
223
+ code: 'usage.profile', hint: 'Delete or rename it first, or pick another name.',
224
+ });
225
+ }
226
+ profiles[new_name] = profiles[old_name];
227
+ delete profiles[old_name];
228
+ cfg.profiles = profiles;
229
+ if (persisted_current(cfg) === old_name) {
230
+ cfg.current_profile = new_name;
231
+ }
232
+ write_config(cfg, env);
233
+ };
234
+ exports.rename_profile_def = rename_profile_def;
235
+ // Remove a profile's config entry. Config-only — the credential removal is done
236
+ // by the command layer (handle_delete). Returns whether the deleted profile was
237
+ // current so the caller can report the reset to default.
238
+ const delete_profile_def = (name, env = process.env) => {
239
+ if (name === DEFAULT_NAME) {
240
+ throw new errors_1.UsageError('The built-in default profile can\'t be deleted.', { code: 'usage.profile' });
241
+ }
242
+ const cfg = read_config(env);
243
+ const profiles = get_profiles(cfg, env);
244
+ if (!profiles[name]) {
245
+ throw new errors_1.UsageError(`Unknown profile '${name}'.`, {
246
+ code: 'usage.profile', hint: 'List profiles with `profile list`.',
247
+ });
248
+ }
249
+ delete profiles[name];
250
+ cfg.profiles = profiles;
251
+ const was_current = persisted_current(cfg) === name;
252
+ if (was_current) {
253
+ delete cfg.current_profile; // revert to the built-in default
254
+ }
255
+ write_config(cfg, env);
256
+ return { was_current };
257
+ };
258
+ exports.delete_profile_def = delete_profile_def;
259
+ // Clear one config field on a profile, reverting it to inherited (URLs) or unset
260
+ // (team_id). `default` is allowed (to clear an override / team pin). Never touches
261
+ // the profile name or credentials. Idempotent — a no-op returns {changed:false}.
262
+ const unset_profile_field = (name, field, env = process.env) => {
263
+ if (!CLEARABLE_FIELDS.includes(field)) {
264
+ throw new errors_1.UsageError(`Can't clear '${field}'.`, {
265
+ code: 'usage.profile', hint: `Clearable fields: ${CLEARABLE_FIELDS.join(', ')}.`,
266
+ });
267
+ }
268
+ const cfg = read_config(env);
269
+ const profiles = get_profiles(cfg, env);
270
+ if (name !== DEFAULT_NAME && !profiles[name]) {
271
+ throw new errors_1.UsageError(`Unknown profile '${name}'.`, {
272
+ code: 'usage.profile', hint: 'List profiles with `profile list`.',
273
+ });
274
+ }
275
+ const def = { ...(profiles[name] ?? {}) };
276
+ if (!(field in def)) {
277
+ return { changed: false };
278
+ }
279
+ delete def[field];
280
+ profiles[name] = def;
281
+ cfg.profiles = profiles;
282
+ write_config(cfg, env);
283
+ return { changed: true };
284
+ };
285
+ exports.unset_profile_field = unset_profile_field;
286
+ // Persist the current profile. Validates the name resolves first (so you can't
287
+ // set current to an unknown profile), then writes current_profile.
288
+ const set_current_profile = (name, env = process.env) => {
289
+ resolve_profile(name, env); // throws UsageError if the name is not valid
290
+ const cfg = read_config(env);
291
+ cfg.current_profile = name;
292
+ write_config(cfg, env);
293
+ };
294
+ exports.set_current_profile = set_current_profile;
295
+ //# sourceMappingURL=profile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile.js","sourceRoot":"","sources":["../src/profile.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AACxB,qCAAwD;AACxD,2CAAwD;AAcxD,MAAM,YAAY,GAAG,SAAS,CAAC;AAE/B,yEAAyE;AACzE,+EAA+E;AAC/E,oEAAoE;AACpE,MAAM,QAAQ,GAAG;IACb,SAAS,EAAE,wBAAwB;IACnC,QAAQ,EAAE,sBAAsB;CACnC,CAAC;AA0V0L,4BAAQ;AAzVpM,mEAAmE;AACnE,MAAM,IAAI,GAAG,QAAQ,CAAC;AAwVgL,oBAAI;AAnV1M,MAAM,oBAAoB,GAAG,CAAC,GAAW,EAAS,EAAE,CAAA,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAE5E,2EAA2E;AAC3E,gEAAgE;AAChE,MAAM,YAAY,GAAG,CAAC,CAAU,EAAqB,EAAE;IACnD,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAChD,CAAC;QACG,OAAO,CAAC,CAAC;IACb,CAAC;IACD,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,EACnD,CAAC;QACG,OAAO,QAAQ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D,MAAM,GAAG,GAAgB,EAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EAAC,CAAC;IACrD,IAAI,CAAC,CAAC,KAAK,IAAI,GAAG,CAAC,EACnB,CAAC;QACG,OAAO,EAAC,OAAO,EAAE,KAAK,EAAC,CAAC;IAC5B,CAAC;IACD,OAAQ,GAA+B,CAAC,KAAK,CAAC,CAAC;IAC/C,QAAQ,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC;IACrB,GAAG,CAAC,QAAQ,GAAG,QAAQ,CAAC;IACxB,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACvB,OAAO,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;AAC3B,CAAC,CAAC;AAWmJ,kDAAmB;AATxK,+EAA+E;AAC/E,mEAAmE;AACnE,MAAM,mBAAmB,GAAG,CAAC,IAAY,EAAE,MAAW,OAAO,CAAC,GAAG,EAAO,EAAE;IACtE,eAAe,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAG,6CAA6C;IAC3E,MAAM,GAAG,GAAG,WAAW,CAAC,GAAG,CAA4B,CAAC;IACxD,GAAG,CAAC,eAAe,GAAG,IAAI,CAAC;IAC3B,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAC3B,CAAC,CAAC;AAE4D,kDAAmB"}
@@ -0,0 +1,32 @@
1
+ import type { Env } from '../config';
2
+ import type { Detected_host } from './detect';
3
+ import type { Host_def, Host_outcome, Operation, Pack, Runner, Scope } from './types';
4
+ type Clone_result = {
5
+ dir: string;
6
+ commit: string;
7
+ };
8
+ type Clone_fn = (opts: {
9
+ ref: string;
10
+ run: Runner;
11
+ tmp_root: string;
12
+ }) => Promise<Clone_result>;
13
+ declare const clone_repo: Clone_fn;
14
+ declare const skills_target: (def: Host_def, scope: Scope, home: string, cwd: string) => string | undefined;
15
+ declare const copy_dir: (from: string, to: string, written: string[]) => void;
16
+ type Flat_opts = {
17
+ operation: Operation;
18
+ host: Detected_host;
19
+ packs: Pack[];
20
+ scope: Scope;
21
+ ref?: string;
22
+ run?: Runner;
23
+ home?: string;
24
+ cwd?: string;
25
+ tmp_root?: string;
26
+ env?: Env;
27
+ dry_run?: boolean;
28
+ clone?: Clone_fn;
29
+ };
30
+ declare const run_flat: (opts: Flat_opts) => Promise<Host_outcome>;
31
+ export { clone_repo, copy_dir, skills_target, run_flat };
32
+ export type { Clone_fn, Clone_result, Flat_opts };