@getfrontline/cli 1.0.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 (270) hide show
  1. package/README.md +319 -0
  2. package/dist/assets/logo3.png +0 -0
  3. package/dist/commands/agents/analytics.d.ts +3 -0
  4. package/dist/commands/agents/analytics.d.ts.map +1 -0
  5. package/dist/commands/agents/analytics.js +67 -0
  6. package/dist/commands/agents/analytics.js.map +1 -0
  7. package/dist/commands/agents/flows.d.ts +3 -0
  8. package/dist/commands/agents/flows.d.ts.map +1 -0
  9. package/dist/commands/agents/flows.js +47 -0
  10. package/dist/commands/agents/flows.js.map +1 -0
  11. package/dist/commands/agents/list.d.ts +3 -0
  12. package/dist/commands/agents/list.d.ts.map +1 -0
  13. package/dist/commands/agents/list.js +46 -0
  14. package/dist/commands/agents/list.js.map +1 -0
  15. package/dist/commands/api/raw.d.ts +3 -0
  16. package/dist/commands/api/raw.d.ts.map +1 -0
  17. package/dist/commands/api/raw.js +54 -0
  18. package/dist/commands/api/raw.js.map +1 -0
  19. package/dist/commands/auth/login.d.ts +3 -0
  20. package/dist/commands/auth/login.d.ts.map +1 -0
  21. package/dist/commands/auth/login.js +39 -0
  22. package/dist/commands/auth/login.js.map +1 -0
  23. package/dist/commands/auth/logout.d.ts +3 -0
  24. package/dist/commands/auth/logout.d.ts.map +1 -0
  25. package/dist/commands/auth/logout.js +16 -0
  26. package/dist/commands/auth/logout.js.map +1 -0
  27. package/dist/commands/auth/profiles.d.ts +3 -0
  28. package/dist/commands/auth/profiles.d.ts.map +1 -0
  29. package/dist/commands/auth/profiles.js +72 -0
  30. package/dist/commands/auth/profiles.js.map +1 -0
  31. package/dist/commands/auth/whoami.d.ts +3 -0
  32. package/dist/commands/auth/whoami.d.ts.map +1 -0
  33. package/dist/commands/auth/whoami.js +46 -0
  34. package/dist/commands/auth/whoami.js.map +1 -0
  35. package/dist/commands/billing/get.d.ts +3 -0
  36. package/dist/commands/billing/get.d.ts.map +1 -0
  37. package/dist/commands/billing/get.js +42 -0
  38. package/dist/commands/billing/get.js.map +1 -0
  39. package/dist/commands/object/aggregation.d.ts +3 -0
  40. package/dist/commands/object/aggregation.d.ts.map +1 -0
  41. package/dist/commands/object/aggregation.js +78 -0
  42. package/dist/commands/object/aggregation.js.map +1 -0
  43. package/dist/commands/object/export.d.ts +3 -0
  44. package/dist/commands/object/export.d.ts.map +1 -0
  45. package/dist/commands/object/export.js +98 -0
  46. package/dist/commands/object/export.js.map +1 -0
  47. package/dist/commands/object/field.d.ts +3 -0
  48. package/dist/commands/object/field.d.ts.map +1 -0
  49. package/dist/commands/object/field.js +76 -0
  50. package/dist/commands/object/field.js.map +1 -0
  51. package/dist/commands/object/file.d.ts +3 -0
  52. package/dist/commands/object/file.d.ts.map +1 -0
  53. package/dist/commands/object/file.js +105 -0
  54. package/dist/commands/object/file.js.map +1 -0
  55. package/dist/commands/object/index.d.ts +3 -0
  56. package/dist/commands/object/index.d.ts.map +1 -0
  57. package/dist/commands/object/index.js +136 -0
  58. package/dist/commands/object/index.js.map +1 -0
  59. package/dist/commands/object/note.d.ts +3 -0
  60. package/dist/commands/object/note.d.ts.map +1 -0
  61. package/dist/commands/object/note.js +62 -0
  62. package/dist/commands/object/note.js.map +1 -0
  63. package/dist/commands/object/option.d.ts +3 -0
  64. package/dist/commands/object/option.d.ts.map +1 -0
  65. package/dist/commands/object/option.js +78 -0
  66. package/dist/commands/object/option.js.map +1 -0
  67. package/dist/commands/object/record-type.d.ts +3 -0
  68. package/dist/commands/object/record-type.d.ts.map +1 -0
  69. package/dist/commands/object/record-type.js +73 -0
  70. package/dist/commands/object/record-type.js.map +1 -0
  71. package/dist/commands/object/record.d.ts +3 -0
  72. package/dist/commands/object/record.d.ts.map +1 -0
  73. package/dist/commands/object/record.js +128 -0
  74. package/dist/commands/object/record.js.map +1 -0
  75. package/dist/commands/object/relation.d.ts +3 -0
  76. package/dist/commands/object/relation.d.ts.map +1 -0
  77. package/dist/commands/object/relation.js +73 -0
  78. package/dist/commands/object/relation.js.map +1 -0
  79. package/dist/commands/object/task.d.ts +3 -0
  80. package/dist/commands/object/task.d.ts.map +1 -0
  81. package/dist/commands/object/task.js +88 -0
  82. package/dist/commands/object/task.js.map +1 -0
  83. package/dist/commands/object/view.d.ts +3 -0
  84. package/dist/commands/object/view.d.ts.map +1 -0
  85. package/dist/commands/object/view.js +118 -0
  86. package/dist/commands/object/view.js.map +1 -0
  87. package/dist/commands/setup/claudeSkills.d.ts +3 -0
  88. package/dist/commands/setup/claudeSkills.d.ts.map +1 -0
  89. package/dist/commands/setup/claudeSkills.js +84 -0
  90. package/dist/commands/setup/claudeSkills.js.map +1 -0
  91. package/dist/commands/table/aggregation.d.ts +3 -0
  92. package/dist/commands/table/aggregation.d.ts.map +1 -0
  93. package/dist/commands/table/aggregation.js +78 -0
  94. package/dist/commands/table/aggregation.js.map +1 -0
  95. package/dist/commands/table/export.d.ts +3 -0
  96. package/dist/commands/table/export.d.ts.map +1 -0
  97. package/dist/commands/table/export.js +97 -0
  98. package/dist/commands/table/export.js.map +1 -0
  99. package/dist/commands/table/field.d.ts +3 -0
  100. package/dist/commands/table/field.d.ts.map +1 -0
  101. package/dist/commands/table/field.js +76 -0
  102. package/dist/commands/table/field.js.map +1 -0
  103. package/dist/commands/table/file.d.ts +3 -0
  104. package/dist/commands/table/file.d.ts.map +1 -0
  105. package/dist/commands/table/file.js +106 -0
  106. package/dist/commands/table/file.js.map +1 -0
  107. package/dist/commands/table/index.d.ts +3 -0
  108. package/dist/commands/table/index.d.ts.map +1 -0
  109. package/dist/commands/table/index.js +142 -0
  110. package/dist/commands/table/index.js.map +1 -0
  111. package/dist/commands/table/note.d.ts +3 -0
  112. package/dist/commands/table/note.d.ts.map +1 -0
  113. package/dist/commands/table/note.js +62 -0
  114. package/dist/commands/table/note.js.map +1 -0
  115. package/dist/commands/table/option.d.ts +3 -0
  116. package/dist/commands/table/option.d.ts.map +1 -0
  117. package/dist/commands/table/option.js +78 -0
  118. package/dist/commands/table/option.js.map +1 -0
  119. package/dist/commands/table/relation.d.ts +3 -0
  120. package/dist/commands/table/relation.d.ts.map +1 -0
  121. package/dist/commands/table/relation.js +74 -0
  122. package/dist/commands/table/relation.js.map +1 -0
  123. package/dist/commands/table/row.d.ts +3 -0
  124. package/dist/commands/table/row.d.ts.map +1 -0
  125. package/dist/commands/table/row.js +124 -0
  126. package/dist/commands/table/row.js.map +1 -0
  127. package/dist/commands/table/task.d.ts +3 -0
  128. package/dist/commands/table/task.d.ts.map +1 -0
  129. package/dist/commands/table/task.js +88 -0
  130. package/dist/commands/table/task.js.map +1 -0
  131. package/dist/commands/workflows/analytics.d.ts +3 -0
  132. package/dist/commands/workflows/analytics.d.ts.map +1 -0
  133. package/dist/commands/workflows/analytics.js +60 -0
  134. package/dist/commands/workflows/analytics.js.map +1 -0
  135. package/dist/commands/workflows/list.d.ts +3 -0
  136. package/dist/commands/workflows/list.d.ts.map +1 -0
  137. package/dist/commands/workflows/list.js +47 -0
  138. package/dist/commands/workflows/list.js.map +1 -0
  139. package/dist/index.d.ts +3 -0
  140. package/dist/index.d.ts.map +1 -0
  141. package/dist/index.js +73 -0
  142. package/dist/index.js.map +1 -0
  143. package/dist/lib/auth.d.ts +13 -0
  144. package/dist/lib/auth.d.ts.map +1 -0
  145. package/dist/lib/auth.js +40 -0
  146. package/dist/lib/auth.js.map +1 -0
  147. package/dist/lib/config.d.ts +28 -0
  148. package/dist/lib/config.d.ts.map +1 -0
  149. package/dist/lib/config.js +77 -0
  150. package/dist/lib/config.js.map +1 -0
  151. package/dist/lib/errors.d.ts +13 -0
  152. package/dist/lib/errors.d.ts.map +1 -0
  153. package/dist/lib/errors.js +31 -0
  154. package/dist/lib/errors.js.map +1 -0
  155. package/dist/lib/globalOpts.d.ts +23 -0
  156. package/dist/lib/globalOpts.d.ts.map +1 -0
  157. package/dist/lib/globalOpts.js +40 -0
  158. package/dist/lib/globalOpts.js.map +1 -0
  159. package/dist/lib/helpEpilog.d.ts +18 -0
  160. package/dist/lib/helpEpilog.d.ts.map +1 -0
  161. package/dist/lib/helpEpilog.js +56 -0
  162. package/dist/lib/helpEpilog.js.map +1 -0
  163. package/dist/lib/httpClient.d.ts +50 -0
  164. package/dist/lib/httpClient.d.ts.map +1 -0
  165. package/dist/lib/httpClient.js +196 -0
  166. package/dist/lib/httpClient.js.map +1 -0
  167. package/dist/lib/output.d.ts +38 -0
  168. package/dist/lib/output.d.ts.map +1 -0
  169. package/dist/lib/output.js +131 -0
  170. package/dist/lib/output.js.map +1 -0
  171. package/dist/max/browserLogin.d.ts +15 -0
  172. package/dist/max/browserLogin.d.ts.map +1 -0
  173. package/dist/max/browserLogin.js +164 -0
  174. package/dist/max/browserLogin.js.map +1 -0
  175. package/dist/max/commands/auth/login.d.ts +3 -0
  176. package/dist/max/commands/auth/login.d.ts.map +1 -0
  177. package/dist/max/commands/auth/login.js +58 -0
  178. package/dist/max/commands/auth/login.js.map +1 -0
  179. package/dist/max/commands/auth/logout.d.ts +3 -0
  180. package/dist/max/commands/auth/logout.d.ts.map +1 -0
  181. package/dist/max/commands/auth/logout.js +23 -0
  182. package/dist/max/commands/auth/logout.js.map +1 -0
  183. package/dist/max/commands/auth/whoami.d.ts +3 -0
  184. package/dist/max/commands/auth/whoami.d.ts.map +1 -0
  185. package/dist/max/commands/auth/whoami.js +46 -0
  186. package/dist/max/commands/auth/whoami.js.map +1 -0
  187. package/dist/max/commands/chat/repl.d.ts +3 -0
  188. package/dist/max/commands/chat/repl.d.ts.map +1 -0
  189. package/dist/max/commands/chat/repl.js +104 -0
  190. package/dist/max/commands/chat/repl.js.map +1 -0
  191. package/dist/max/commands/chat/send.d.ts +25 -0
  192. package/dist/max/commands/chat/send.d.ts.map +1 -0
  193. package/dist/max/commands/chat/send.js +163 -0
  194. package/dist/max/commands/chat/send.js.map +1 -0
  195. package/dist/max/commands/conversations/abort.d.ts +3 -0
  196. package/dist/max/commands/conversations/abort.d.ts.map +1 -0
  197. package/dist/max/commands/conversations/abort.js +55 -0
  198. package/dist/max/commands/conversations/abort.js.map +1 -0
  199. package/dist/max/commands/conversations/get.d.ts +3 -0
  200. package/dist/max/commands/conversations/get.d.ts.map +1 -0
  201. package/dist/max/commands/conversations/get.js +42 -0
  202. package/dist/max/commands/conversations/get.js.map +1 -0
  203. package/dist/max/commands/conversations/index.d.ts +3 -0
  204. package/dist/max/commands/conversations/index.d.ts.map +1 -0
  205. package/dist/max/commands/conversations/index.js +16 -0
  206. package/dist/max/commands/conversations/index.js.map +1 -0
  207. package/dist/max/commands/conversations/list.d.ts +3 -0
  208. package/dist/max/commands/conversations/list.d.ts.map +1 -0
  209. package/dist/max/commands/conversations/list.js +35 -0
  210. package/dist/max/commands/conversations/list.js.map +1 -0
  211. package/dist/max/commands/conversations/update.d.ts +3 -0
  212. package/dist/max/commands/conversations/update.d.ts.map +1 -0
  213. package/dist/max/commands/conversations/update.js +53 -0
  214. package/dist/max/commands/conversations/update.js.map +1 -0
  215. package/dist/max/jwtDecode.d.ts +5 -0
  216. package/dist/max/jwtDecode.d.ts.map +1 -0
  217. package/dist/max/jwtDecode.js +19 -0
  218. package/dist/max/jwtDecode.js.map +1 -0
  219. package/dist/max/lib/auth.d.ts +20 -0
  220. package/dist/max/lib/auth.d.ts.map +1 -0
  221. package/dist/max/lib/auth.js +53 -0
  222. package/dist/max/lib/auth.js.map +1 -0
  223. package/dist/max/lib/httpClient.d.ts +25 -0
  224. package/dist/max/lib/httpClient.d.ts.map +1 -0
  225. package/dist/max/lib/httpClient.js +138 -0
  226. package/dist/max/lib/httpClient.js.map +1 -0
  227. package/dist/max/lib/maxResponse.d.ts +30 -0
  228. package/dist/max/lib/maxResponse.d.ts.map +1 -0
  229. package/dist/max/lib/maxResponse.js +132 -0
  230. package/dist/max/lib/maxResponse.js.map +1 -0
  231. package/dist/max/lib/publicApiPaths.d.ts +12 -0
  232. package/dist/max/lib/publicApiPaths.d.ts.map +1 -0
  233. package/dist/max/lib/publicApiPaths.js +15 -0
  234. package/dist/max/lib/publicApiPaths.js.map +1 -0
  235. package/dist/max/maxConfig.d.ts +31 -0
  236. package/dist/max/maxConfig.d.ts.map +1 -0
  237. package/dist/max/maxConfig.js +50 -0
  238. package/dist/max/maxConfig.js.map +1 -0
  239. package/dist/max/ui/banner.d.ts +3 -0
  240. package/dist/max/ui/banner.d.ts.map +1 -0
  241. package/dist/max/ui/banner.js +96 -0
  242. package/dist/max/ui/banner.js.map +1 -0
  243. package/dist/max.d.ts +3 -0
  244. package/dist/max.d.ts.map +1 -0
  245. package/dist/max.js +94 -0
  246. package/dist/max.js.map +1 -0
  247. package/dist/scripts/postinstall.d.ts +8 -0
  248. package/dist/scripts/postinstall.d.ts.map +1 -0
  249. package/dist/scripts/postinstall.js +149 -0
  250. package/dist/scripts/postinstall.js.map +1 -0
  251. package/dist/skills/aggregations/SKILL.md +122 -0
  252. package/dist/skills/auth-and-profiles/SKILL.md +102 -0
  253. package/dist/skills/crm-setup/SKILL.md +385 -0
  254. package/dist/skills/crud-operations/SKILL.md +287 -0
  255. package/dist/skills/export-and-delete/SKILL.md +96 -0
  256. package/dist/skills/files/SKILL.md +70 -0
  257. package/dist/skills/filter-and-query/SKILL.md +199 -0
  258. package/dist/skills/frontline-agents/SKILL.md +99 -0
  259. package/dist/skills/frontline-api/SKILL.md +59 -0
  260. package/dist/skills/frontline-billing/SKILL.md +42 -0
  261. package/dist/skills/frontline-workflows/SKILL.md +72 -0
  262. package/dist/skills/max-auth/SKILL.md +76 -0
  263. package/dist/skills/max-chat/SKILL.md +111 -0
  264. package/dist/skills/notes-and-tasks/SKILL.md +128 -0
  265. package/dist/skills/pipeline-setup/SKILL.md +233 -0
  266. package/dist/skills/record-type-management/SKILL.md +104 -0
  267. package/dist/skills/relations/SKILL.md +153 -0
  268. package/dist/skills/resource-creation/SKILL.md +86 -0
  269. package/dist/skills/schema-design/SKILL.md +263 -0
  270. package/package.json +47 -0
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.workflowsListCommand = void 0;
4
+ const commander_1 = require("commander");
5
+ const httpClient_1 = require("../../lib/httpClient");
6
+ const output_1 = require("../../lib/output");
7
+ const helpEpilog_1 = require("../../lib/helpEpilog");
8
+ exports.workflowsListCommand = new commander_1.Command("list")
9
+ .description("List all workflows (JSON by default; use --pretty/--table for human-readable output)")
10
+ .option("--status <status>", "Filter by status (e.g. active, inactive, draft)")
11
+ .option("--pretty", "Pretty human-readable output")
12
+ .option("--table", "Render as table")
13
+ .option("--api-key <key>", helpEpilog_1.FRONTLINE_API_KEY_OPTION)
14
+ .option("--base-url <url>", helpEpilog_1.FRONTLINE_BASE_URL_OPTION)
15
+ .option("--profile <name>", helpEpilog_1.FRONTLINE_PROFILE_OPTION)
16
+ .option("--debug", "Show debug information (redacted token)")
17
+ .action(async (options) => {
18
+ let data;
19
+ try {
20
+ data = await (0, httpClient_1.apiGet)({
21
+ path: "/workflows",
22
+ query: { status: options.status },
23
+ apiKey: options.apiKey,
24
+ baseUrl: options.baseUrl,
25
+ profile: options.profile,
26
+ debug: options.debug,
27
+ });
28
+ }
29
+ catch (err) {
30
+ const message = err instanceof Error ? err.message : String(err);
31
+ const hint = err.hint;
32
+ (0, output_1.error)("api_error", message, output_1.EXIT_CODES.GENERAL_ERROR, { suggestion: hint });
33
+ }
34
+ if (options.pretty || options.table) {
35
+ (0, output_1.printTable)(data.results, [
36
+ "id",
37
+ "name",
38
+ "status",
39
+ "triggerType",
40
+ "runsCount",
41
+ "lastRunDate",
42
+ ]);
43
+ process.exit(0);
44
+ }
45
+ (0, output_1.success)(data);
46
+ });
47
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/workflows/list.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AACpC,qDAA8C;AAC9C,6CAA0E;AAC1E,qDAI8B;AA6BjB,QAAA,oBAAoB,GAAG,IAAI,mBA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I;YACJ,MAAM;YACN,QAAQ;YACR,aAAa;YACb,WAAW;YACX,aAAa;SAChB,CAAC,CAAC;QACH,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IAED,IAAA,gBAAO,EAAC,IAAK,CAAC,CAAC;AACnB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/dist/index.js ADDED
@@ -0,0 +1,73 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const commander_1 = require("commander");
5
+ const login_1 = require("./commands/auth/login");
6
+ const logout_1 = require("./commands/auth/logout");
7
+ const whoami_1 = require("./commands/auth/whoami");
8
+ const profiles_1 = require("./commands/auth/profiles");
9
+ const table_1 = require("./commands/table");
10
+ const object_1 = require("./commands/object");
11
+ const list_1 = require("./commands/agents/list");
12
+ const flows_1 = require("./commands/agents/flows");
13
+ const analytics_1 = require("./commands/agents/analytics");
14
+ const list_2 = require("./commands/workflows/list");
15
+ const analytics_2 = require("./commands/workflows/analytics");
16
+ const get_1 = require("./commands/billing/get");
17
+ const raw_1 = require("./commands/api/raw");
18
+ const claudeSkills_1 = require("./commands/setup/claudeSkills");
19
+ const output_1 = require("./lib/output");
20
+ const helpEpilog_1 = require("./lib/helpEpilog");
21
+ const pkg = require("../package.json");
22
+ const program = new commander_1.Command();
23
+ program
24
+ .name("frontline")
25
+ .description("Frontline CLI — Public API (per-account API key): auth, tables, objects, agents, workflows, billing, raw GET. Base URL is per profile; override with flags or env.")
26
+ .version(pkg.version ?? "0.0.0")
27
+ .addHelpText("after", `\n${helpEpilog_1.FRONTLINE_CLI_EPILOG}\n`);
28
+ // ── auth ──────────────────────────────────────────────
29
+ const authCmd = new commander_1.Command("auth").description("Manage Public API authentication (API key + saved base URL per profile)");
30
+ authCmd.addCommand(login_1.loginCommand);
31
+ authCmd.addCommand(logout_1.logoutCommand);
32
+ authCmd.addCommand(whoami_1.whoamiCommand);
33
+ authCmd.addCommand(profiles_1.profilesCommand);
34
+ program.addCommand(authCmd);
35
+ // ── resource groups ───────────────────────────────────
36
+ program.addCommand(table_1.tableCommand);
37
+ program.addCommand(object_1.objectCommand);
38
+ // ── agents / workflows / billing ──────────────────────
39
+ const agentsCmd = new commander_1.Command("agents").description("Manage agents");
40
+ agentsCmd.addCommand(list_1.agentsListCommand);
41
+ agentsCmd.addCommand(flows_1.agentsFlowsCommand);
42
+ agentsCmd.addCommand(analytics_1.agentsAnalyticsCommand);
43
+ program.addCommand(agentsCmd);
44
+ const workflowsCmd = new commander_1.Command("workflows").description("Manage workflows");
45
+ workflowsCmd.addCommand(list_2.workflowsListCommand);
46
+ workflowsCmd.addCommand(analytics_2.workflowsAnalyticsCommand);
47
+ program.addCommand(workflowsCmd);
48
+ const billingCmd = new commander_1.Command("billing").description("Billing information");
49
+ billingCmd.addCommand(get_1.billingGetCommand);
50
+ program.addCommand(billingCmd);
51
+ // ── api raw + setup ───────────────────────────────────
52
+ const apiCmd = new commander_1.Command("api").description("Escape hatch for ad-hoc authenticated Public API calls");
53
+ apiCmd.addCommand(raw_1.apiRawCommand);
54
+ program.addCommand(apiCmd);
55
+ program.addCommand(claudeSkills_1.setupCommand);
56
+ program.exitOverride();
57
+ async function main() {
58
+ try {
59
+ await program.parseAsync(process.argv);
60
+ }
61
+ catch (err) {
62
+ if (err instanceof Error && err.message !== "(outputHelp)") {
63
+ const code = err.code;
64
+ if (code === "commander.helpDisplayed" || code === "commander.version") {
65
+ return;
66
+ }
67
+ (0, output_1.printError)(err.message);
68
+ process.exitCode = 1;
69
+ }
70
+ }
71
+ }
72
+ main();
73
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts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,IAAA,mBAAU,EAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YACxB,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACzB,CAAC;IACL,CAAC;AACL,CAAC;AAED,IAAI,EAAE,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Returns the API key resolved from (in priority order): --api-key flag,
3
+ * FRONTLINE_API_KEY env var, then the named (or current) profile. Throws
4
+ * AuthError if nothing is set.
5
+ */
6
+ export declare function getToken(options?: {
7
+ apiKey?: string;
8
+ profile?: string;
9
+ }): string;
10
+ export declare function saveToken(apiKey: string, baseUrl?: string, profileName?: string): void;
11
+ export declare function clearToken(profileName?: string): void;
12
+ export declare function redactToken(token: string): string;
13
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/lib/auth.ts"],"names":[],"mappings":"AAUA;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,OAAO,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAMhF;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAOtF;AAED,wBAAgB,UAAU,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAGrD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIjD"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getToken = getToken;
4
+ exports.saveToken = saveToken;
5
+ exports.clearToken = clearToken;
6
+ exports.redactToken = redactToken;
7
+ const config_1 = require("./config");
8
+ const errors_1 = require("./errors");
9
+ /**
10
+ * Returns the API key resolved from (in priority order): --api-key flag,
11
+ * FRONTLINE_API_KEY env var, then the named (or current) profile. Throws
12
+ * AuthError if nothing is set.
13
+ */
14
+ function getToken(options) {
15
+ const token = (0, config_1.resolveApiKey)(options?.apiKey, options?.profile);
16
+ if (!token) {
17
+ throw new errors_1.AuthError("No API key found.");
18
+ }
19
+ return token;
20
+ }
21
+ function saveToken(apiKey, baseUrl, profileName) {
22
+ const name = profileName ?? (0, config_1.getCurrentProfile)();
23
+ const existing = (0, config_1.getProfile)(name);
24
+ (0, config_1.setProfile)(name, {
25
+ apiKey,
26
+ baseUrl: baseUrl ?? existing?.baseUrl ?? (0, config_1.getDefaultBaseUrl)(),
27
+ });
28
+ }
29
+ function clearToken(profileName) {
30
+ const name = profileName ?? (0, config_1.getCurrentProfile)();
31
+ (0, config_1.deleteProfile)(name);
32
+ }
33
+ function redactToken(token) {
34
+ if (!token)
35
+ return "(not set)";
36
+ if (token.length <= 8)
37
+ return "****";
38
+ return token.slice(0, 4) + "..." + token.slice(-4);
39
+ }
40
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/lib/auth.ts"],"names":[],"mappings":";;AAeA,4BAMC;AAED,8BAOC;AAED,gCAGC;AAED,kCAIC;AAzCD,qCAOkB;AAClB,qCAAqC;AAErC;;;;GAIG;AACH,SAAgB,QAAQ,CAAC,OAA+C;IACpE,MAAM,KAAK,GAAG,IAAA,sBAAa,EAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC/D,IAAI,CAAC,KAAK,EAAE,CAAC;QACT,MAAM,IAAI,kBAAS,CAAC,mBAAmB,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,SAAgB,SAAS,CAAC,MAAc,EAAE,OAAgB,EAAE,WAAoB;IAC5E,MAAM,IAAI,GAAG,WAAW,IAAI,IAAA,0BAAiB,GAAE,CAAC;IAChD,MAAM,QAAQ,GAAG,IAAA,mBAAU,EAAC,IAAI,CAAC,CAAC;IAClC,IAAA,mBAAU,EAAC,IAAI,EAAE;QACb,MAAM;QACN,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,OAAO,IAAI,IAAA,0BAAiB,GAAE;KAC/D,CAAC,CAAC;AACP,CAAC;AAED,SAAgB,UAAU,CAAC,WAAoB;IAC3C,MAAM,IAAI,GAAG,WAAW,IAAI,IAAA,0BAAiB,GAAE,CAAC;IAChD,IAAA,sBAAa,EAAC,IAAI,CAAC,CAAC;AACxB,CAAC;AAED,SAAgB,WAAW,CAAC,KAAa;IACrC,IAAI,CAAC,KAAK;QAAE,OAAO,WAAW,CAAC;IAC/B,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC;QAAE,OAAO,MAAM,CAAC;IACrC,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACvD,CAAC"}
@@ -0,0 +1,28 @@
1
+ export interface ProfileConfig {
2
+ apiKey: string;
3
+ baseUrl: string;
4
+ }
5
+ export declare function getCurrentProfile(): string;
6
+ export declare function setCurrentProfile(name: string): void;
7
+ export declare function getProfile(name?: string): ProfileConfig | undefined;
8
+ export declare function setProfile(name: string, config: ProfileConfig): void;
9
+ export declare function deleteProfile(name: string): void;
10
+ export declare function getAllProfiles(): Record<string, ProfileConfig>;
11
+ export declare function getDefaultBaseUrl(): string;
12
+ export declare function getConfigPath(): string;
13
+ /**
14
+ * Resolves the API key in priority order:
15
+ * 1. --api-key flag value (passed explicitly)
16
+ * 2. FRONTLINE_API_KEY environment variable
17
+ * 3. The selected profile's saved apiKey (current profile if name omitted)
18
+ */
19
+ export declare function resolveApiKey(flagValue?: string, profileName?: string): string | undefined;
20
+ /**
21
+ * Resolves the base URL in priority order:
22
+ * 1. --base-url flag
23
+ * 2. FRONTLINE_BASE_URL environment variable
24
+ * 3. Selected profile's saved baseUrl
25
+ * 4. Built-in default (DEFAULT_BASE_URL)
26
+ */
27
+ export declare function resolveBaseUrl(flagValue?: string, profileName?: string): string;
28
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACnB;AAiBD,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAEpD;AAED,wBAAgB,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAInE;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,IAAI,CAIpE;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAIhD;AAED,wBAAgB,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAE9D;AAED,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE1F;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAO/E"}
@@ -0,0 +1,77 @@
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.getCurrentProfile = getCurrentProfile;
7
+ exports.setCurrentProfile = setCurrentProfile;
8
+ exports.getProfile = getProfile;
9
+ exports.setProfile = setProfile;
10
+ exports.deleteProfile = deleteProfile;
11
+ exports.getAllProfiles = getAllProfiles;
12
+ exports.getDefaultBaseUrl = getDefaultBaseUrl;
13
+ exports.getConfigPath = getConfigPath;
14
+ exports.resolveApiKey = resolveApiKey;
15
+ exports.resolveBaseUrl = resolveBaseUrl;
16
+ const conf_1 = __importDefault(require("conf"));
17
+ const DEFAULT_BASE_URL = "https://w9l5drgs-7010.brs.devtunnels.ms/public/v1";
18
+ const store = new conf_1.default({
19
+ projectName: "frontline-cli",
20
+ defaults: {
21
+ currentProfile: "default",
22
+ profiles: {},
23
+ },
24
+ });
25
+ function getCurrentProfile() {
26
+ return store.get("currentProfile");
27
+ }
28
+ function setCurrentProfile(name) {
29
+ store.set("currentProfile", name);
30
+ }
31
+ function getProfile(name) {
32
+ const profileName = name ?? getCurrentProfile();
33
+ const profiles = store.get("profiles");
34
+ return profiles[profileName];
35
+ }
36
+ function setProfile(name, config) {
37
+ const profiles = store.get("profiles");
38
+ profiles[name] = config;
39
+ store.set("profiles", profiles);
40
+ }
41
+ function deleteProfile(name) {
42
+ const profiles = store.get("profiles");
43
+ delete profiles[name];
44
+ store.set("profiles", profiles);
45
+ }
46
+ function getAllProfiles() {
47
+ return store.get("profiles");
48
+ }
49
+ function getDefaultBaseUrl() {
50
+ return DEFAULT_BASE_URL;
51
+ }
52
+ function getConfigPath() {
53
+ return store.path;
54
+ }
55
+ /**
56
+ * Resolves the API key in priority order:
57
+ * 1. --api-key flag value (passed explicitly)
58
+ * 2. FRONTLINE_API_KEY environment variable
59
+ * 3. The selected profile's saved apiKey (current profile if name omitted)
60
+ */
61
+ function resolveApiKey(flagValue, profileName) {
62
+ return flagValue || process.env.FRONTLINE_API_KEY || getProfile(profileName)?.apiKey;
63
+ }
64
+ /**
65
+ * Resolves the base URL in priority order:
66
+ * 1. --base-url flag
67
+ * 2. FRONTLINE_BASE_URL environment variable
68
+ * 3. Selected profile's saved baseUrl
69
+ * 4. Built-in default (DEFAULT_BASE_URL)
70
+ */
71
+ function resolveBaseUrl(flagValue, profileName) {
72
+ return (flagValue ||
73
+ process.env.FRONTLINE_BASE_URL ||
74
+ getProfile(profileName)?.baseUrl ||
75
+ DEFAULT_BASE_URL);
76
+ }
77
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":";;;;;AAsBA,8CAEC;AAED,8CAEC;AAED,gCAIC;AAED,gCAIC;AAED,sCAIC;AAED,wCAEC;AAED,8CAEC;AAED,sCAEC;AAQD,sCAEC;AASD,wCAOC;AApFD,gDAAwB;AAYxB,MAAM,gBAAgB,GAAG,mDAAmD,CAAC;AAE7E,MAAM,KAAK,GAAG,IAAI,cAAI,CAAY;IAC9B,WAAW,EAAE,eAAe;IAC5B,QAAQ,EAAE;QACN,cAAc,EAAE,SAAS;QACzB,QAAQ,EAAE,EAAE;KACf;CACJ,CAAC,CAAC;AAEH,SAAgB,iBAAiB;IAC7B,OAAO,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;AACvC,CAAC;AAED,SAAgB,iBAAiB,CAAC,IAAY;IAC1C,KAAK,CAAC,GAAG,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;AACtC,CAAC;AAED,SAAgB,UAAU,CAAC,IAAa;IACpC,MAAM,WAAW,GAAG,IAAI,IAAI,iBAAiB,EAAE,CAAC;IAChD,MAAM,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACvC,OAAO,QAAQ,CAAC,WAAW,CAAC,CAAC;AACjC,CAAC;AAED,SAAgB,UAAU,CAAC,IAAY,EAAE,MAAqB;IAC1D,MAAM,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACvC,QAAQ,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;IACxB,KAAK,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;AACpC,CAAC;AAED,SAAgB,aAAa,CAAC,IAAY;IACtC,MAAM,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACvC,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC;IACtB,KAAK,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;AACpC,CAAC;AAED,SAAgB,cAAc;IAC1B,OAAO,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AACjC,CAAC;AAED,SAAgB,iBAAiB;IAC7B,OAAO,gBAAgB,CAAC;AAC5B,CAAC;AAED,SAAgB,aAAa;IACzB,OAAO,KAAK,CAAC,IAAI,CAAC;AACtB,CAAC;AAED;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,SAAkB,EAAE,WAAoB;IAClE,OAAO,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,UAAU,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;AACzF,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,cAAc,CAAC,SAAkB,EAAE,WAAoB;IACnE,OAAO,CACH,SAAS;QACT,OAAO,CAAC,GAAG,CAAC,kBAAkB;QAC9B,UAAU,CAAC,WAAW,CAAC,EAAE,OAAO;QAChC,gBAAgB,CACnB,CAAC;AACN,CAAC"}
@@ -0,0 +1,13 @@
1
+ export declare class CLIError extends Error {
2
+ readonly hint?: string | undefined;
3
+ constructor(message: string, hint?: string | undefined);
4
+ }
5
+ export declare class AuthError extends CLIError {
6
+ constructor(message: string);
7
+ }
8
+ export declare class APIError extends CLIError {
9
+ readonly statusCode: number;
10
+ readonly body?: unknown | undefined;
11
+ constructor(message: string, statusCode: number, body?: unknown | undefined);
12
+ }
13
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/lib/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,QAAS,SAAQ,KAAK;aAGX,IAAI,CAAC,EAAE,MAAM;gBAD7B,OAAO,EAAE,MAAM,EACC,IAAI,CAAC,EAAE,MAAM,YAAA;CAKpC;AAED,qBAAa,SAAU,SAAQ,QAAQ;gBACvB,OAAO,EAAE,MAAM;CAI9B;AAED,qBAAa,QAAS,SAAQ,QAAQ;aAGd,UAAU,EAAE,MAAM;aAClB,IAAI,CAAC,EAAE,OAAO;gBAF9B,OAAO,EAAE,MAAM,EACC,UAAU,EAAE,MAAM,EAClB,IAAI,CAAC,EAAE,OAAO,YAAA;CAKrC"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.APIError = exports.AuthError = exports.CLIError = void 0;
4
+ class CLIError extends Error {
5
+ hint;
6
+ constructor(message, hint) {
7
+ super(message);
8
+ this.hint = hint;
9
+ this.name = "CLIError";
10
+ }
11
+ }
12
+ exports.CLIError = CLIError;
13
+ class AuthError extends CLIError {
14
+ constructor(message) {
15
+ super(message, 'Run "frontline auth login" to authenticate.');
16
+ this.name = "AuthError";
17
+ }
18
+ }
19
+ exports.AuthError = AuthError;
20
+ class APIError extends CLIError {
21
+ statusCode;
22
+ body;
23
+ constructor(message, statusCode, body) {
24
+ super(message);
25
+ this.statusCode = statusCode;
26
+ this.body = body;
27
+ this.name = "APIError";
28
+ }
29
+ }
30
+ exports.APIError = APIError;
31
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/lib/errors.ts"],"names":[],"mappings":";;;AAAA,MAAa,QAAS,SAAQ,KAAK;IAGX;IAFpB,YACI,OAAe,EACC,IAAa;QAE7B,KAAK,CAAC,OAAO,CAAC,CAAC;QAFC,SAAI,GAAJ,IAAI,CAAS;QAG7B,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;IAC3B,CAAC;CACJ;AARD,4BAQC;AAED,MAAa,SAAU,SAAQ,QAAQ;IACnC,YAAY,OAAe;QACvB,KAAK,CAAC,OAAO,EAAE,6CAA6C,CAAC,CAAC;QAC9D,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;IAC5B,CAAC;CACJ;AALD,8BAKC;AAED,MAAa,QAAS,SAAQ,QAAQ;IAGd;IACA;IAHpB,YACI,OAAe,EACC,UAAkB,EAClB,IAAc;QAE9B,KAAK,CAAC,OAAO,CAAC,CAAC;QAHC,eAAU,GAAV,UAAU,CAAQ;QAClB,SAAI,GAAJ,IAAI,CAAU;QAG9B,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;IAC3B,CAAC;CACJ;AATD,4BASC"}
@@ -0,0 +1,23 @@
1
+ import { Command } from "commander";
2
+ import { FrontlineClient } from "./httpClient";
3
+ /** Options every resource-level command accepts. */
4
+ export interface CliOpts {
5
+ apiKey?: string;
6
+ baseUrl?: string;
7
+ profile?: string;
8
+ debug?: boolean;
9
+ pretty?: boolean;
10
+ table?: boolean;
11
+ }
12
+ /**
13
+ * Adds the common global options (`--api-key`, `--base-url`, `--profile`,
14
+ * `--debug`, `--pretty`, `--table`) to a Commander command. Returns the same
15
+ * command so it can be chained.
16
+ */
17
+ export declare function globalOpts(cmd: Command): Command;
18
+ /**
19
+ * Builds a FrontlineClient from the resolved auth context. Exits with a
20
+ * structured permission_denied error when no API key is available anywhere.
21
+ */
22
+ export declare function requireClient(opts: CliOpts): FrontlineClient;
23
+ //# sourceMappingURL=globalOpts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"globalOpts.d.ts","sourceRoot":"","sources":["../../src/lib/globalOpts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAS/C,oDAAoD;AACpD,MAAM,WAAW,OAAO;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAQhD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,eAAe,CAY5D"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.globalOpts = globalOpts;
4
+ exports.requireClient = requireClient;
5
+ const httpClient_1 = require("./httpClient");
6
+ const config_1 = require("./config");
7
+ const output_1 = require("./output");
8
+ const helpEpilog_1 = require("./helpEpilog");
9
+ /**
10
+ * Adds the common global options (`--api-key`, `--base-url`, `--profile`,
11
+ * `--debug`, `--pretty`, `--table`) to a Commander command. Returns the same
12
+ * command so it can be chained.
13
+ */
14
+ function globalOpts(cmd) {
15
+ return cmd
16
+ .option("--api-key <key>", helpEpilog_1.FRONTLINE_API_KEY_OPTION)
17
+ .option("--base-url <url>", helpEpilog_1.FRONTLINE_BASE_URL_OPTION)
18
+ .option("--profile <name>", helpEpilog_1.FRONTLINE_PROFILE_OPTION)
19
+ .option("--debug", "Show debug info on stderr (token is redacted)")
20
+ .option("--pretty", "Pretty-print human-readable output (instead of default JSON)")
21
+ .option("--table", "Render list results as a table (implies --pretty)");
22
+ }
23
+ /**
24
+ * Builds a FrontlineClient from the resolved auth context. Exits with a
25
+ * structured permission_denied error when no API key is available anywhere.
26
+ */
27
+ function requireClient(opts) {
28
+ const apiKey = (0, config_1.resolveApiKey)(opts.apiKey, opts.profile);
29
+ if (!apiKey) {
30
+ (0, output_1.error)("not_authenticated", "No API key configured", output_1.EXIT_CODES.PERMISSION_DENIED, {
31
+ suggestion: "Run 'frontline auth login <api-key>' to authenticate",
32
+ });
33
+ }
34
+ return new httpClient_1.FrontlineClient({
35
+ apiKey,
36
+ baseUrl: (0, config_1.resolveBaseUrl)(opts.baseUrl, opts.profile),
37
+ debug: Boolean(opts.debug),
38
+ });
39
+ }
40
+ //# sourceMappingURL=globalOpts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"globalOpts.js","sourceRoot":"","sources":["../../src/lib/globalOpts.ts"],"names":[],"mappings":";;AAyBA,gCAQC;AAMD,sCAYC;AAlDD,6CAA+C;AAC/C,qCAAyD;AACzD,qCAA6C;AAC7C,6CAIsB;AAYtB;;;;GAIG;AACH,SAAgB,UAAU,CAAC,GAAY;IACnC,OAAO,GAAG;SACL,MAAM,CAAC,iBAAiB,EAAE,qCAAwB,CAAC;SACnD,MAAM,CAAC,kBAAkB,EAAE,sCAAyB,CAAC;SACrD,MAAM,CAAC,kBAAkB,EAAE,qCAAwB,CAAC;SACpD,MAAM,CAAC,SAAS,EAAE,+CAA+C,CAAC;SAClE,MAAM,CAAC,UAAU,EAAE,8DAA8D,CAAC;SAClF,MAAM,CAAC,SAAS,EAAE,mDAAmD,CAAC,CAAC;AAChF,CAAC;AAED;;;GAGG;AACH,SAAgB,aAAa,CAAC,IAAa;IACvC,MAAM,MAAM,GAAG,IAAA,sBAAa,EAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACxD,IAAI,CAAC,MAAM,EAAE,CAAC;QACV,IAAA,cAAK,EAAC,mBAAmB,EAAE,uBAAuB,EAAE,mBAAU,CAAC,iBAAiB,EAAE;YAC9E,UAAU,EAAE,sDAAsD;SACrE,CAAC,CAAC;IACP,CAAC;IACD,OAAO,IAAI,4BAAe,CAAC;QACvB,MAAM;QACN,OAAO,EAAE,IAAA,uBAAc,EAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC;QACnD,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;KAC7B,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Long-form help snippets for Commander (--help). Kept in one place so URLs/env stay consistent with code.
3
+ */
4
+ export declare const FRONTLINE_PROFILE_OPTION = "Credentials profile: uses that profile's saved API key and Public API base URL (see `frontline auth profiles list`)";
5
+ export declare const FRONTLINE_API_KEY_OPTION = "Override API key for this run (else FRONTLINE_API_KEY env, else stored profile key)";
6
+ export declare const FRONTLINE_BASE_URL_OPTION = "Advanced: override Public API base URL for this run";
7
+ /** Shown after `frontline --help`. */
8
+ export declare const FRONTLINE_CLI_EPILOG: string;
9
+ /** Shown after `frontline auth login --help`. */
10
+ export declare const FRONTLINE_AUTH_LOGIN_EPILOG: string;
11
+ export declare const MAX_PROFILE_OPTION = "Max profile: uses the per-user API key and Public API base URL from the Frontline CLI profile of the same name (`max config-path` shows the Max-only store).";
12
+ /** Public API root for Max commands (same as `frontline --base-url`, typically …/public/v1). */
13
+ export declare const MAX_BASE_URL_OPTION = "Advanced: override Public API base URL for this run";
14
+ /** Shown after `max --help`. */
15
+ export declare const MAX_CLI_EPILOG: string;
16
+ /** Shown after `max auth login --help` (subcommand help does not include root epilog). */
17
+ export declare const MAX_AUTH_LOGIN_EPILOG: string;
18
+ //# sourceMappingURL=helpEpilog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpEpilog.d.ts","sourceRoot":"","sources":["../../src/lib/helpEpilog.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,wBAAwB,wHACoF,CAAC;AAE1H,eAAO,MAAM,wBAAwB,wFACoD,CAAC;AAE1F,eAAO,MAAM,yBAAyB,wDACmB,CAAC;AAE1D,sCAAsC;AACtC,eAAO,MAAM,oBAAoB,QAMzB,CAAC;AAET,iDAAiD;AACjD,eAAO,MAAM,2BAA2B,QAGhC,CAAC;AAET,eAAO,MAAM,kBAAkB,iKACmI,CAAC;AAEnK,gGAAgG;AAChG,eAAO,MAAM,mBAAmB,wDAA4B,CAAC;AAE7D,gCAAgC;AAChC,eAAO,MAAM,cAAc,QAkBnB,CAAC;AAET,0FAA0F;AAC1F,eAAO,MAAM,qBAAqB,QAQ1B,CAAC"}
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ /**
3
+ * Long-form help snippets for Commander (--help). Kept in one place so URLs/env stay consistent with code.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.MAX_AUTH_LOGIN_EPILOG = exports.MAX_CLI_EPILOG = exports.MAX_BASE_URL_OPTION = exports.MAX_PROFILE_OPTION = exports.FRONTLINE_AUTH_LOGIN_EPILOG = exports.FRONTLINE_CLI_EPILOG = exports.FRONTLINE_BASE_URL_OPTION = exports.FRONTLINE_API_KEY_OPTION = exports.FRONTLINE_PROFILE_OPTION = void 0;
7
+ exports.FRONTLINE_PROFILE_OPTION = "Credentials profile: uses that profile's saved API key and Public API base URL (see `frontline auth profiles list`)";
8
+ exports.FRONTLINE_API_KEY_OPTION = "Override API key for this run (else FRONTLINE_API_KEY env, else stored profile key)";
9
+ exports.FRONTLINE_BASE_URL_OPTION = "Advanced: override Public API base URL for this run";
10
+ /** Shown after `frontline --help`. */
11
+ exports.FRONTLINE_CLI_EPILOG = `
12
+ API key lookup order: --api-key flag > FRONTLINE_API_KEY env > stored profile key.
13
+
14
+ Output format:
15
+ Default: JSON on stdout (scripting-friendly). Errors go to stdout as JSON + a human line on stderr.
16
+ Opt-in: --pretty / --table on commands that support human-readable output.
17
+ `.trim();
18
+ /** Shown after `frontline auth login --help`. */
19
+ exports.FRONTLINE_AUTH_LOGIN_EPILOG = `
20
+ Examples:
21
+ $ frontline auth login flk_abc123
22
+ `.trim();
23
+ exports.MAX_PROFILE_OPTION = "Max profile: uses the per-user API key and Public API base URL from the Frontline CLI profile of the same name (`max config-path` shows the Max-only store).";
24
+ /** Public API root for Max commands (same as `frontline --base-url`, typically …/public/v1). */
25
+ exports.MAX_BASE_URL_OPTION = exports.FRONTLINE_BASE_URL_OPTION;
26
+ /** Shown after `max --help`. */
27
+ exports.MAX_CLI_EPILOG = `
28
+ Authentication:
29
+ Bearer = per-user API key (USER type; same as SoR / Public API). The same key
30
+ is saved to the Max store AND the Frontline CLI store under the same profile
31
+ name, so \`max\` and \`frontline\` commands share credentials.
32
+
33
+ Lookup order: --api-key flag > MAX_API_KEY env > FRONTLINE_API_KEY env >
34
+ Max profile apiKey > Frontline profile apiKey (same name).
35
+
36
+ Chat / send stdout:
37
+ Default: one-line JSON (last API body). \`--pretty\`: assistant text from \`data\`.
38
+ \`--json\`: POST response only, no polling. Interactive \`max chat\` REPL prints
39
+ plain assistant text when possible.
40
+
41
+ NOTE: The hosted browser login (Firebase id token) flow is currently disabled.
42
+ The code is preserved for when SSO is re-enabled.
43
+
44
+ Config file: max config-path
45
+ `.trim();
46
+ /** Shown after `max auth login --help` (subcommand help does not include root epilog). */
47
+ exports.MAX_AUTH_LOGIN_EPILOG = `
48
+ Per-user API key:
49
+ Create one in the Frontline web app (Settings -> API keys -> "Create key").
50
+ The CLI stores it in the Max store AND in the Frontline CLI store under the
51
+ same profile name, so \`frontline\` and \`max\` commands can reuse it.
52
+
53
+ Examples:
54
+ $ max auth login flk_abc123
55
+ `.trim();
56
+ //# sourceMappingURL=helpEpilog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpEpilog.js","sourceRoot":"","sources":["../../src/lib/helpEpilog.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEU,QAAA,wBAAwB,GACjC,qHAAqH,CAAC;AAE7G,QAAA,wBAAwB,GACjC,qFAAqF,CAAC;AAE7E,QAAA,yBAAyB,GAClC,qDAAqD,CAAC;AAE1D,sCAAsC;AACzB,QAAA,oBAAoB,GAAG;;;;;;CAMnC,CAAC,IAAI,EAAE,CAAC;AAET,iDAAiD;AACpC,QAAA,2BAA2B,GAAG;;;CAG1C,CAAC,IAAI,EAAE,CAAC;AAEI,QAAA,kBAAkB,GAC3B,8JAA8J,CAAC;AAEnK,gGAAgG;AACnF,QAAA,mBAAmB,GAAG,iCAAyB,CAAC;AAE7D,gCAAgC;AACnB,QAAA,cAAc,GAAG;;;;;;;;;;;;;;;;;;CAkB7B,CAAC,IAAI,EAAE,CAAC;AAET,0FAA0F;AAC7E,QAAA,qBAAqB,GAAG;;;;;;;;CAQpC,CAAC,IAAI,EAAE,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Unified HTTP client for the Frontline Public API.
3
+ *
4
+ * Supports every verb needed by the CLI surface (GET/POST/PATCH/DELETE + raw
5
+ * Response access for binary downloads + multipart uploads). Handles
6
+ * authentication, debug logging with token redaction, and structured error
7
+ * mapping to CLI exit codes.
8
+ */
9
+ export interface FrontlineClientOptions {
10
+ apiKey: string;
11
+ baseUrl: string;
12
+ debug?: boolean;
13
+ }
14
+ export declare class FrontlineClient {
15
+ private readonly apiKey;
16
+ private readonly baseUrl;
17
+ private readonly debug;
18
+ constructor(opts: FrontlineClientOptions);
19
+ private buildHeaders;
20
+ private buildUrl;
21
+ private logRequest;
22
+ private request;
23
+ get<T>(path: string, params?: Record<string, string | undefined>): Promise<T>;
24
+ post<T>(path: string, body?: unknown): Promise<T>;
25
+ patch<T>(path: string, body?: unknown): Promise<T>;
26
+ delete<T>(path: string): Promise<T>;
27
+ /** POST that returns the raw Response (for binary downloads, e.g. exports). */
28
+ postRaw(path: string, body?: unknown): Promise<Response>;
29
+ /** GET that returns the raw Response (for binary downloads, e.g. file downloads). */
30
+ getRaw(path: string): Promise<Response>;
31
+ /** POST a multipart/form-data body (for uploads). Content-Type is set by fetch. */
32
+ postMultipart<T>(path: string, formData: FormData): Promise<T>;
33
+ private throwFromResponse;
34
+ }
35
+ /**
36
+ * Thin helper used by agents/workflows/billing/api raw commands that only need
37
+ * a GET. Resolves key/base-url from flags/env/profile and throws APIError on
38
+ * failure (for those commands that want to catch and format their own error
39
+ * output instead of exiting immediately).
40
+ */
41
+ export interface ApiGetOptions {
42
+ path: string;
43
+ query?: Record<string, string | undefined>;
44
+ apiKey?: string;
45
+ profile?: string;
46
+ baseUrl?: string;
47
+ debug?: boolean;
48
+ }
49
+ export declare function apiGet<T = unknown>(options: ApiGetOptions): Promise<T>;
50
+ //# sourceMappingURL=httpClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"httpClient.d.ts","sourceRoot":"","sources":["../../src/lib/httpClient.ts"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,MAAM,WAAW,sBAAsB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,qBAAa,eAAe;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAU;gBAEpB,IAAI,EAAE,sBAAsB;IAMxC,OAAO,CAAC,YAAY;IASpB,OAAO,CAAC,QAAQ;IAWhB,OAAO,CAAC,UAAU;YAQJ,OAAO;IA0DrB,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAI7E,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;IAIjD,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;IAIlD,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IAInC,+EAA+E;IACzE,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC;IAa9D,qFAAqF;IAC/E,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAY7C,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