@aui.io/apollo 0.1.4

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 (194) hide show
  1. package/bin/apollo.js +13 -0
  2. package/node_modules/@aui.io/apollo-cli/bin/apollo.js +79 -0
  3. package/node_modules/@aui.io/apollo-cli/dist/src/commands/auth.d.ts +4 -0
  4. package/node_modules/@aui.io/apollo-cli/dist/src/commands/auth.js +99 -0
  5. package/node_modules/@aui.io/apollo-cli/dist/src/commands/auth.js.map +1 -0
  6. package/node_modules/@aui.io/apollo-cli/dist/src/commands/bundles.d.ts +3 -0
  7. package/node_modules/@aui.io/apollo-cli/dist/src/commands/bundles.js +234 -0
  8. package/node_modules/@aui.io/apollo-cli/dist/src/commands/bundles.js.map +1 -0
  9. package/node_modules/@aui.io/apollo-cli/dist/src/commands/env.d.ts +3 -0
  10. package/node_modules/@aui.io/apollo-cli/dist/src/commands/env.js +34 -0
  11. package/node_modules/@aui.io/apollo-cli/dist/src/commands/env.js.map +1 -0
  12. package/node_modules/@aui.io/apollo-cli/dist/src/commands/hierarchy.d.ts +3 -0
  13. package/node_modules/@aui.io/apollo-cli/dist/src/commands/hierarchy.js +175 -0
  14. package/node_modules/@aui.io/apollo-cli/dist/src/commands/hierarchy.js.map +1 -0
  15. package/node_modules/@aui.io/apollo-cli/dist/src/commands/mockdb.d.ts +3 -0
  16. package/node_modules/@aui.io/apollo-cli/dist/src/commands/mockdb.js +251 -0
  17. package/node_modules/@aui.io/apollo-cli/dist/src/commands/mockdb.js.map +1 -0
  18. package/node_modules/@aui.io/apollo-cli/dist/src/commands/operate.d.ts +3 -0
  19. package/node_modules/@aui.io/apollo-cli/dist/src/commands/operate.js +138 -0
  20. package/node_modules/@aui.io/apollo-cli/dist/src/commands/operate.js.map +1 -0
  21. package/node_modules/@aui.io/apollo-cli/dist/src/commands/profile.d.ts +3 -0
  22. package/node_modules/@aui.io/apollo-cli/dist/src/commands/profile.js +51 -0
  23. package/node_modules/@aui.io/apollo-cli/dist/src/commands/profile.js.map +1 -0
  24. package/node_modules/@aui.io/apollo-cli/dist/src/commands/prompts.d.ts +6 -0
  25. package/node_modules/@aui.io/apollo-cli/dist/src/commands/prompts.js +20 -0
  26. package/node_modules/@aui.io/apollo-cli/dist/src/commands/prompts.js.map +1 -0
  27. package/node_modules/@aui.io/apollo-cli/dist/src/commands/runtime.d.ts +6 -0
  28. package/node_modules/@aui.io/apollo-cli/dist/src/commands/runtime.js +2 -0
  29. package/node_modules/@aui.io/apollo-cli/dist/src/commands/runtime.js.map +1 -0
  30. package/node_modules/@aui.io/apollo-cli/dist/src/commands/shell.d.ts +10 -0
  31. package/node_modules/@aui.io/apollo-cli/dist/src/commands/shell.js +36 -0
  32. package/node_modules/@aui.io/apollo-cli/dist/src/commands/shell.js.map +1 -0
  33. package/node_modules/@aui.io/apollo-cli/dist/src/commands/status.d.ts +3 -0
  34. package/node_modules/@aui.io/apollo-cli/dist/src/commands/status.js +57 -0
  35. package/node_modules/@aui.io/apollo-cli/dist/src/commands/status.js.map +1 -0
  36. package/node_modules/@aui.io/apollo-cli/dist/src/commands/upgrade.d.ts +3 -0
  37. package/node_modules/@aui.io/apollo-cli/dist/src/commands/upgrade.js +35 -0
  38. package/node_modules/@aui.io/apollo-cli/dist/src/commands/upgrade.js.map +1 -0
  39. package/node_modules/@aui.io/apollo-cli/dist/src/commands/workspace.d.ts +3 -0
  40. package/node_modules/@aui.io/apollo-cli/dist/src/commands/workspace.js +170 -0
  41. package/node_modules/@aui.io/apollo-cli/dist/src/commands/workspace.js.map +1 -0
  42. package/node_modules/@aui.io/apollo-cli/dist/src/index.d.ts +10 -0
  43. package/node_modules/@aui.io/apollo-cli/dist/src/index.js +107 -0
  44. package/node_modules/@aui.io/apollo-cli/dist/src/index.js.map +1 -0
  45. package/node_modules/@aui.io/apollo-cli/dist/src/meta.d.ts +4 -0
  46. package/node_modules/@aui.io/apollo-cli/dist/src/meta.js +65 -0
  47. package/node_modules/@aui.io/apollo-cli/dist/src/meta.js.map +1 -0
  48. package/node_modules/@aui.io/apollo-cli/dist/src/output/welcome.d.ts +13 -0
  49. package/node_modules/@aui.io/apollo-cli/dist/src/output/welcome.js +53 -0
  50. package/node_modules/@aui.io/apollo-cli/dist/src/output/welcome.js.map +1 -0
  51. package/node_modules/@aui.io/apollo-cli/package.json +47 -0
  52. package/node_modules/@aui.io/apollo-core/dist/src/api/agent-settings.d.ts +6 -0
  53. package/node_modules/@aui.io/apollo-core/dist/src/api/agent-settings.js +23 -0
  54. package/node_modules/@aui.io/apollo-core/dist/src/api/agent-settings.js.map +1 -0
  55. package/node_modules/@aui.io/apollo-core/dist/src/api/client-types.d.ts +23 -0
  56. package/node_modules/@aui.io/apollo-core/dist/src/api/client-types.js +2 -0
  57. package/node_modules/@aui.io/apollo-core/dist/src/api/client-types.js.map +1 -0
  58. package/node_modules/@aui.io/apollo-core/dist/src/api/identity.d.ts +48 -0
  59. package/node_modules/@aui.io/apollo-core/dist/src/api/identity.js +131 -0
  60. package/node_modules/@aui.io/apollo-core/dist/src/api/identity.js.map +1 -0
  61. package/node_modules/@aui.io/apollo-core/dist/src/api/management.d.ts +92 -0
  62. package/node_modules/@aui.io/apollo-core/dist/src/api/management.js +126 -0
  63. package/node_modules/@aui.io/apollo-core/dist/src/api/management.js.map +1 -0
  64. package/node_modules/@aui.io/apollo-core/dist/src/api/mock-db.d.ts +65 -0
  65. package/node_modules/@aui.io/apollo-core/dist/src/api/mock-db.js +183 -0
  66. package/node_modules/@aui.io/apollo-core/dist/src/api/mock-db.js.map +1 -0
  67. package/node_modules/@aui.io/apollo-core/dist/src/api/runtime-api.d.ts +98 -0
  68. package/node_modules/@aui.io/apollo-core/dist/src/api/runtime-api.js +70 -0
  69. package/node_modules/@aui.io/apollo-core/dist/src/api/runtime-api.js.map +1 -0
  70. package/node_modules/@aui.io/apollo-core/dist/src/api/transport.d.ts +40 -0
  71. package/node_modules/@aui.io/apollo-core/dist/src/api/transport.js +205 -0
  72. package/node_modules/@aui.io/apollo-core/dist/src/api/transport.js.map +1 -0
  73. package/node_modules/@aui.io/apollo-core/dist/src/argv.d.ts +5 -0
  74. package/node_modules/@aui.io/apollo-core/dist/src/argv.js +43 -0
  75. package/node_modules/@aui.io/apollo-core/dist/src/argv.js.map +1 -0
  76. package/node_modules/@aui.io/apollo-core/dist/src/bundle/baseline.d.ts +17 -0
  77. package/node_modules/@aui.io/apollo-core/dist/src/bundle/baseline.js +48 -0
  78. package/node_modules/@aui.io/apollo-core/dist/src/bundle/baseline.js.map +1 -0
  79. package/node_modules/@aui.io/apollo-core/dist/src/bundle/files.d.ts +7 -0
  80. package/node_modules/@aui.io/apollo-core/dist/src/bundle/files.js +69 -0
  81. package/node_modules/@aui.io/apollo-core/dist/src/bundle/files.js.map +1 -0
  82. package/node_modules/@aui.io/apollo-core/dist/src/bundle/materialize.d.ts +14 -0
  83. package/node_modules/@aui.io/apollo-core/dist/src/bundle/materialize.js +196 -0
  84. package/node_modules/@aui.io/apollo-core/dist/src/bundle/materialize.js.map +1 -0
  85. package/node_modules/@aui.io/apollo-core/dist/src/bundle/validate.d.ts +30 -0
  86. package/node_modules/@aui.io/apollo-core/dist/src/bundle/validate.js +36 -0
  87. package/node_modules/@aui.io/apollo-core/dist/src/bundle/validate.js.map +1 -0
  88. package/node_modules/@aui.io/apollo-core/dist/src/config/index.d.ts +11 -0
  89. package/node_modules/@aui.io/apollo-core/dist/src/config/index.js +193 -0
  90. package/node_modules/@aui.io/apollo-core/dist/src/config/index.js.map +1 -0
  91. package/node_modules/@aui.io/apollo-core/dist/src/config/mockdb-keys.d.ts +14 -0
  92. package/node_modules/@aui.io/apollo-core/dist/src/config/mockdb-keys.js +54 -0
  93. package/node_modules/@aui.io/apollo-core/dist/src/config/mockdb-keys.js.map +1 -0
  94. package/node_modules/@aui.io/apollo-core/dist/src/config/store.d.ts +18 -0
  95. package/node_modules/@aui.io/apollo-core/dist/src/config/store.js +99 -0
  96. package/node_modules/@aui.io/apollo-core/dist/src/config/store.js.map +1 -0
  97. package/node_modules/@aui.io/apollo-core/dist/src/config/types.d.ts +62 -0
  98. package/node_modules/@aui.io/apollo-core/dist/src/config/types.js +2 -0
  99. package/node_modules/@aui.io/apollo-core/dist/src/config/types.js.map +1 -0
  100. package/node_modules/@aui.io/apollo-core/dist/src/errors/index.d.ts +42 -0
  101. package/node_modules/@aui.io/apollo-core/dist/src/errors/index.js +74 -0
  102. package/node_modules/@aui.io/apollo-core/dist/src/errors/index.js.map +1 -0
  103. package/node_modules/@aui.io/apollo-core/dist/src/index.d.ts +32 -0
  104. package/node_modules/@aui.io/apollo-core/dist/src/index.js +32 -0
  105. package/node_modules/@aui.io/apollo-core/dist/src/index.js.map +1 -0
  106. package/node_modules/@aui.io/apollo-core/dist/src/output/index.d.ts +29 -0
  107. package/node_modules/@aui.io/apollo-core/dist/src/output/index.js +49 -0
  108. package/node_modules/@aui.io/apollo-core/dist/src/output/index.js.map +1 -0
  109. package/node_modules/@aui.io/apollo-core/dist/src/services/auth.d.ts +10 -0
  110. package/node_modules/@aui.io/apollo-core/dist/src/services/auth.js +83 -0
  111. package/node_modules/@aui.io/apollo-core/dist/src/services/auth.js.map +1 -0
  112. package/node_modules/@aui.io/apollo-core/dist/src/services/bundles.d.ts +37 -0
  113. package/node_modules/@aui.io/apollo-core/dist/src/services/bundles.js +161 -0
  114. package/node_modules/@aui.io/apollo-core/dist/src/services/bundles.js.map +1 -0
  115. package/node_modules/@aui.io/apollo-core/dist/src/services/clients.d.ts +15 -0
  116. package/node_modules/@aui.io/apollo-core/dist/src/services/clients.js +95 -0
  117. package/node_modules/@aui.io/apollo-core/dist/src/services/clients.js.map +1 -0
  118. package/node_modules/@aui.io/apollo-core/dist/src/services/env.service.d.ts +11 -0
  119. package/node_modules/@aui.io/apollo-core/dist/src/services/env.service.js +19 -0
  120. package/node_modules/@aui.io/apollo-core/dist/src/services/env.service.js.map +1 -0
  121. package/node_modules/@aui.io/apollo-core/dist/src/services/hierarchy.d.ts +29 -0
  122. package/node_modules/@aui.io/apollo-core/dist/src/services/hierarchy.js +117 -0
  123. package/node_modules/@aui.io/apollo-core/dist/src/services/hierarchy.js.map +1 -0
  124. package/node_modules/@aui.io/apollo-core/dist/src/services/messaging.d.ts +17 -0
  125. package/node_modules/@aui.io/apollo-core/dist/src/services/messaging.js +99 -0
  126. package/node_modules/@aui.io/apollo-core/dist/src/services/messaging.js.map +1 -0
  127. package/node_modules/@aui.io/apollo-core/dist/src/services/mockdb.d.ts +71 -0
  128. package/node_modules/@aui.io/apollo-core/dist/src/services/mockdb.js +274 -0
  129. package/node_modules/@aui.io/apollo-core/dist/src/services/mockdb.js.map +1 -0
  130. package/node_modules/@aui.io/apollo-core/dist/src/services/profile.service.d.ts +16 -0
  131. package/node_modules/@aui.io/apollo-core/dist/src/services/profile.service.js +29 -0
  132. package/node_modules/@aui.io/apollo-core/dist/src/services/profile.service.js.map +1 -0
  133. package/node_modules/@aui.io/apollo-core/dist/src/services/status.service.d.ts +26 -0
  134. package/node_modules/@aui.io/apollo-core/dist/src/services/status.service.js +109 -0
  135. package/node_modules/@aui.io/apollo-core/dist/src/services/status.service.js.map +1 -0
  136. package/node_modules/@aui.io/apollo-core/dist/src/services/upgrade.d.ts +23 -0
  137. package/node_modules/@aui.io/apollo-core/dist/src/services/upgrade.js +74 -0
  138. package/node_modules/@aui.io/apollo-core/dist/src/services/upgrade.js.map +1 -0
  139. package/node_modules/@aui.io/apollo-core/dist/src/services/workspace.service.d.ts +44 -0
  140. package/node_modules/@aui.io/apollo-core/dist/src/services/workspace.service.js +148 -0
  141. package/node_modules/@aui.io/apollo-core/dist/src/services/workspace.service.js.map +1 -0
  142. package/node_modules/@aui.io/apollo-core/dist/src/skills/install.d.ts +6 -0
  143. package/node_modules/@aui.io/apollo-core/dist/src/skills/install.js +48 -0
  144. package/node_modules/@aui.io/apollo-core/dist/src/skills/install.js.map +1 -0
  145. package/node_modules/@aui.io/apollo-core/dist/src/workspace/store.d.ts +33 -0
  146. package/node_modules/@aui.io/apollo-core/dist/src/workspace/store.js +246 -0
  147. package/node_modules/@aui.io/apollo-core/dist/src/workspace/store.js.map +1 -0
  148. package/node_modules/@aui.io/apollo-core/package.json +48 -0
  149. package/node_modules/@aui.io/apollo-tui/bin/apollo-tui.js +5 -0
  150. package/node_modules/@aui.io/apollo-tui/dist/src/components/glyph.d.ts +19 -0
  151. package/node_modules/@aui.io/apollo-tui/dist/src/components/glyph.js +41 -0
  152. package/node_modules/@aui.io/apollo-tui/dist/src/components/glyph.js.map +1 -0
  153. package/node_modules/@aui.io/apollo-tui/dist/src/index.d.ts +5 -0
  154. package/node_modules/@aui.io/apollo-tui/dist/src/index.js +46 -0
  155. package/node_modules/@aui.io/apollo-tui/dist/src/index.js.map +1 -0
  156. package/node_modules/@aui.io/apollo-tui/dist/src/lib/attractor.d.ts +82 -0
  157. package/node_modules/@aui.io/apollo-tui/dist/src/lib/attractor.js +231 -0
  158. package/node_modules/@aui.io/apollo-tui/dist/src/lib/attractor.js.map +1 -0
  159. package/node_modules/@aui.io/apollo-tui/dist/src/lib/commands.d.ts +34 -0
  160. package/node_modules/@aui.io/apollo-tui/dist/src/lib/commands.js +100 -0
  161. package/node_modules/@aui.io/apollo-tui/dist/src/lib/commands.js.map +1 -0
  162. package/node_modules/@aui.io/apollo-tui/dist/src/lib/scope.d.ts +14 -0
  163. package/node_modules/@aui.io/apollo-tui/dist/src/lib/scope.js +25 -0
  164. package/node_modules/@aui.io/apollo-tui/dist/src/lib/scope.js.map +1 -0
  165. package/node_modules/@aui.io/apollo-tui/dist/src/lib/sheet.d.ts +25 -0
  166. package/node_modules/@aui.io/apollo-tui/dist/src/lib/sheet.js +99 -0
  167. package/node_modules/@aui.io/apollo-tui/dist/src/lib/sheet.js.map +1 -0
  168. package/node_modules/@aui.io/apollo-tui/dist/src/lib/tabs.d.ts +10 -0
  169. package/node_modules/@aui.io/apollo-tui/dist/src/lib/tabs.js +19 -0
  170. package/node_modules/@aui.io/apollo-tui/dist/src/lib/tabs.js.map +1 -0
  171. package/node_modules/@aui.io/apollo-tui/dist/src/opentui-app.d.ts +1 -0
  172. package/node_modules/@aui.io/apollo-tui/dist/src/opentui-app.js +449 -0
  173. package/node_modules/@aui.io/apollo-tui/dist/src/opentui-app.js.map +1 -0
  174. package/node_modules/@aui.io/apollo-tui/dist/src/tabs/bundle.d.ts +1 -0
  175. package/node_modules/@aui.io/apollo-tui/dist/src/tabs/bundle.js +4 -0
  176. package/node_modules/@aui.io/apollo-tui/dist/src/tabs/bundle.js.map +1 -0
  177. package/node_modules/@aui.io/apollo-tui/dist/src/tabs/chat.d.ts +1 -0
  178. package/node_modules/@aui.io/apollo-tui/dist/src/tabs/chat.js +4 -0
  179. package/node_modules/@aui.io/apollo-tui/dist/src/tabs/chat.js.map +1 -0
  180. package/node_modules/@aui.io/apollo-tui/dist/src/tabs/index.d.ts +5 -0
  181. package/node_modules/@aui.io/apollo-tui/dist/src/tabs/index.js +6 -0
  182. package/node_modules/@aui.io/apollo-tui/dist/src/tabs/index.js.map +1 -0
  183. package/node_modules/@aui.io/apollo-tui/dist/src/tabs/mockdb.d.ts +1 -0
  184. package/node_modules/@aui.io/apollo-tui/dist/src/tabs/mockdb.js +4 -0
  185. package/node_modules/@aui.io/apollo-tui/dist/src/tabs/mockdb.js.map +1 -0
  186. package/node_modules/@aui.io/apollo-tui/dist/src/tabs/overview.d.ts +1 -0
  187. package/node_modules/@aui.io/apollo-tui/dist/src/tabs/overview.js +4 -0
  188. package/node_modules/@aui.io/apollo-tui/dist/src/tabs/overview.js.map +1 -0
  189. package/node_modules/@aui.io/apollo-tui/dist/src/tabs/scope.d.ts +1 -0
  190. package/node_modules/@aui.io/apollo-tui/dist/src/tabs/scope.js +4 -0
  191. package/node_modules/@aui.io/apollo-tui/dist/src/tabs/scope.js.map +1 -0
  192. package/node_modules/@aui.io/apollo-tui/package.json +53 -0
  193. package/package.json +42 -0
  194. package/scripts/setup-shell.mjs +68 -0
@@ -0,0 +1,74 @@
1
+ export const ExitCode = {
2
+ success: 0,
3
+ runtime: 1,
4
+ validation: 2,
5
+ configuration: 3,
6
+ };
7
+ export class CliError extends Error {
8
+ code;
9
+ exitCode;
10
+ suggestion;
11
+ constructor(message, options = {}) {
12
+ super(message, { cause: options.cause });
13
+ this.name = "CliError";
14
+ this.code = options.code ?? "CLI_ERROR";
15
+ this.exitCode = options.exitCode ?? ExitCode.runtime;
16
+ this.suggestion = options.suggestion;
17
+ }
18
+ }
19
+ export class AuthError extends CliError {
20
+ constructor(message, suggestion = "Run `apollo login` and try again.") {
21
+ super(message, {
22
+ code: "AUTH_ERROR",
23
+ exitCode: ExitCode.configuration,
24
+ suggestion,
25
+ });
26
+ this.name = "AuthError";
27
+ }
28
+ }
29
+ export class ConfigError extends CliError {
30
+ constructor(message, suggestion) {
31
+ super(message, {
32
+ code: "CONFIG_ERROR",
33
+ exitCode: ExitCode.configuration,
34
+ suggestion,
35
+ });
36
+ this.name = "ConfigError";
37
+ }
38
+ }
39
+ export class ValidationError extends CliError {
40
+ constructor(message, suggestion) {
41
+ super(message, {
42
+ code: "VALIDATION_ERROR",
43
+ exitCode: ExitCode.validation,
44
+ suggestion,
45
+ });
46
+ this.name = "ValidationError";
47
+ }
48
+ }
49
+ export class ApiError extends CliError {
50
+ service;
51
+ status;
52
+ path;
53
+ detail;
54
+ constructor(options) {
55
+ super(options.message, {
56
+ code: `API_${options.status}`,
57
+ suggestion: options.suggestion,
58
+ });
59
+ this.name = "ApiError";
60
+ this.service = options.service;
61
+ this.status = options.status;
62
+ this.path = options.path;
63
+ this.detail = options.detail;
64
+ }
65
+ }
66
+ export function toCliError(error) {
67
+ if (error instanceof CliError)
68
+ return error;
69
+ if (error instanceof Error) {
70
+ return new CliError(error.message, { cause: error });
71
+ }
72
+ return new CliError("An unexpected error occurred.");
73
+ }
74
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/errors/index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C,OAAO,EAAE;YACb,IAAI,EAAE,kBAAkB;YACxB,QAAQ,EAAE,QAAQ,CAAC,UAAU;YAC7B,UAAU;SACX,CAAC,CAAC;QACH,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,CAAC;CACF;AAED,MAAM,OAAO,QAAS,SAAQ,QAAQ;IAC3B,OAAO,CAAS;IAChB,MAAM,CAAS;IACf,IAAI,CAAS;IACb,MAAM,CAAW;IAE1B,YAAY,OAOX;QACC,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE;YACrB,IAAI,EAAE,OAAO,OAAO,CAAC,MAAM,EAAE;YAC7B,UAAU,EAAE,OAAO,CAAC,UAAU;SAC/B,CAAC,CAAC;QACH,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAC/B,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAC/B,CAAC;CACF;AAED,MAAM,UAAU,UAAU,CAAC,KAAc;IACvC,IAAI,KAAK,YAAY,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,OAAO,IAAI,QAAQ,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IACvD,CAAC;IACD,OAAO,IAAI,QAAQ,CAAC,+BAA+B,CAAC,CAAC;AACvD,CAAC"}
@@ -0,0 +1,32 @@
1
+ /** Shared Apollo console core — no Commander, no TUI. */
2
+ export { normalizeArgv } from "./argv.js";
3
+ export { AgentSettingsClient } from "./api/agent-settings.js";
4
+ export type { HttpClient, Page, RequestOptions as HttpRequestOptions } from "./api/client-types.js";
5
+ export { IdentityClient, browserLogin, type LoginResult, type Organization, } from "./api/identity.js";
6
+ export { ManagementClient, parseVersionTag, type Agent, type AgentVersion, type Project, type VersionPull, type VersionPush, type VersionSource, type VersionStatus, } from "./api/management.js";
7
+ export { MockDbClient, type MockDbAuth, type MockDbClientOptions, type MockDbMgmtAuth, type MockDbProvisionResponse, type MockDbRuntimeAuth, type MockDbTokenAuth, } from "./api/mock-db.js";
8
+ export { RuntimeApiClient, type AgentOverride, type Message, type RuntimeTrace, type SendMessageRequest, type SendMessageResponse, type SkillFile, type SkillIndexItem, type Thread, } from "./api/runtime-api.js";
9
+ export { Transport, type RequestCapture, type TransportOptions } from "./api/transport.js";
10
+ export { diffHashes, isClean, readBaseline, writeBaseline, type Baseline, type FileDiff, } from "./bundle/baseline.js";
11
+ export { contentDigest, hashFiles, readProgramFiles, type ProgramFiles, } from "./bundle/files.js";
12
+ export { assembleBundle, bundleFileLayout, bundleFiles, writeBundleFiles, type BundleDocument, } from "./bundle/materialize.js";
13
+ export { assertValidProgram, mapRuntimeValidation, type RuntimeValidateResponse, type RuntimeValidationFinding, type ValidationFinding, type ValidationResult, } from "./bundle/validate.js";
14
+ export { parseEnvironment, resolveContext, type ResolveConfigOptions, } from "./config/index.js";
15
+ export { clearMockDbKeys, keyPrefixes, loadMockDbKeys, saveMockDbKeys, type MockDbKeys, } from "./config/mockdb-keys.js";
16
+ export { apolloDir, findBinding, readBinding, readCredentials, readUserConfig, updateEnvironment, updateProfile, writeBinding, writeCredentials, writeUserConfig, type ConfigPaths, } from "./config/store.js";
17
+ export { environments, type BaseUrls, type ConfigFlags, type Context, type Credential, type CredentialsFile, type Environment, type ProjectBinding, type UserConfig, type WorkspacePreferences, } from "./config/types.js";
18
+ export { ApiError, AuthError, CliError, ConfigError, ExitCode, ValidationError, toCliError, type ExitCodeValue, } from "./errors/index.js";
19
+ export { Output, errorEnvelope, successEnvelope, type ErrorEnvelope, type OutputOptions, } from "./output/index.js";
20
+ export { loginWithBrowser, loginWithOtp, loginWithToken, logout, requestOtp, } from "./services/auth.js";
21
+ export { importBundle, listVersions, localDiff, pullBundle, pushBundle, remoteDiff, validateLocalBundle, validateProgramBundle, } from "./services/bundles.js";
22
+ export { createClients, type Clients } from "./services/clients.js";
23
+ export { listEnvironments, setEnvironment, type EnvironmentResult, type EnvironmentSummary, } from "./services/env.service.js";
24
+ export { bindAgent, createAgent, createProject, listAgents, listOrganizations, listProjects, unlinkAgent, useAgent, useOrganization, useProject, } from "./services/hierarchy.js";
25
+ export { createThread, debugInteraction, getThread, listMessages, listThreads, parseVariables, sendMessage, trace, } from "./services/messaging.js";
26
+ export { createCollection, createEndpoint, deleteEndpoint, deleteMockDb, describeMockDb, executeEndpoint, exportMockDb, getEndpoint, inspectSession, listCollections, listEndpoints, normalizeSchema, parseJsonFlag, provisionMockDb, resetSession, resolveMockDb, rotateMgmtKey, rotateRuntimeKey, seedRows, statusMockDb, storedKeys, updateCollection, updateEndpoint, wireMockDbConnection, type MockDbResolved, type MockDbServiceOptions, type WireResult, } from "./services/mockdb.js";
27
+ export { currentProfile, listProfiles, useProfile, type CurrentProfile, type ProfileSummary, } from "./services/profile.service.js";
28
+ export { getStatus, type ServiceCheck, type StatusResult, } from "./services/status.service.js";
29
+ export { resolvePublishedVersion, upgradeCli, type NpmRunner, type UpgradeOptions, type UpgradeResult, } from "./services/upgrade.js";
30
+ export { currentWorkspace, listWorkspaces, onboardWorkspace, selectWorkspace, workspacePreferences, type WorkspaceSummary, } from "./services/workspace.service.js";
31
+ export { installSkills, type SkillTarget } from "./skills/install.js";
32
+ export { WORKSPACE_FILE, allocateAgentDirectory, clearActiveAgent, createWorkspace, readWorkspace, registerAgent, resolveAgentPath, selectAgent, setActiveProject, writeWorkspace, type WorkspaceAgent, type WorkspaceManifest, } from "./workspace/store.js";
@@ -0,0 +1,32 @@
1
+ /** Shared Apollo console core — no Commander, no TUI. */
2
+ export { normalizeArgv } from "./argv.js";
3
+ export { AgentSettingsClient } from "./api/agent-settings.js";
4
+ export { IdentityClient, browserLogin, } from "./api/identity.js";
5
+ export { ManagementClient, parseVersionTag, } from "./api/management.js";
6
+ export { MockDbClient, } from "./api/mock-db.js";
7
+ export { RuntimeApiClient, } from "./api/runtime-api.js";
8
+ export { Transport } from "./api/transport.js";
9
+ export { diffHashes, isClean, readBaseline, writeBaseline, } from "./bundle/baseline.js";
10
+ export { contentDigest, hashFiles, readProgramFiles, } from "./bundle/files.js";
11
+ export { assembleBundle, bundleFileLayout, bundleFiles, writeBundleFiles, } from "./bundle/materialize.js";
12
+ export { assertValidProgram, mapRuntimeValidation, } from "./bundle/validate.js";
13
+ export { parseEnvironment, resolveContext, } from "./config/index.js";
14
+ export { clearMockDbKeys, keyPrefixes, loadMockDbKeys, saveMockDbKeys, } from "./config/mockdb-keys.js";
15
+ export { apolloDir, findBinding, readBinding, readCredentials, readUserConfig, updateEnvironment, updateProfile, writeBinding, writeCredentials, writeUserConfig, } from "./config/store.js";
16
+ export { environments, } from "./config/types.js";
17
+ export { ApiError, AuthError, CliError, ConfigError, ExitCode, ValidationError, toCliError, } from "./errors/index.js";
18
+ export { Output, errorEnvelope, successEnvelope, } from "./output/index.js";
19
+ export { loginWithBrowser, loginWithOtp, loginWithToken, logout, requestOtp, } from "./services/auth.js";
20
+ export { importBundle, listVersions, localDiff, pullBundle, pushBundle, remoteDiff, validateLocalBundle, validateProgramBundle, } from "./services/bundles.js";
21
+ export { createClients } from "./services/clients.js";
22
+ export { listEnvironments, setEnvironment, } from "./services/env.service.js";
23
+ export { bindAgent, createAgent, createProject, listAgents, listOrganizations, listProjects, unlinkAgent, useAgent, useOrganization, useProject, } from "./services/hierarchy.js";
24
+ export { createThread, debugInteraction, getThread, listMessages, listThreads, parseVariables, sendMessage, trace, } from "./services/messaging.js";
25
+ export { createCollection, createEndpoint, deleteEndpoint, deleteMockDb, describeMockDb, executeEndpoint, exportMockDb, getEndpoint, inspectSession, listCollections, listEndpoints, normalizeSchema, parseJsonFlag, provisionMockDb, resetSession, resolveMockDb, rotateMgmtKey, rotateRuntimeKey, seedRows, statusMockDb, storedKeys, updateCollection, updateEndpoint, wireMockDbConnection, } from "./services/mockdb.js";
26
+ export { currentProfile, listProfiles, useProfile, } from "./services/profile.service.js";
27
+ export { getStatus, } from "./services/status.service.js";
28
+ export { resolvePublishedVersion, upgradeCli, } from "./services/upgrade.js";
29
+ export { currentWorkspace, listWorkspaces, onboardWorkspace, selectWorkspace, workspacePreferences, } from "./services/workspace.service.js";
30
+ export { installSkills } from "./skills/install.js";
31
+ export { WORKSPACE_FILE, allocateAgentDirectory, clearActiveAgent, createWorkspace, readWorkspace, registerAgent, resolveAgentPath, selectAgent, setActiveProject, writeWorkspace, } from "./workspace/store.js";
32
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,yDAAyD;AAEzD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EACL,cAAc,EACd,YAAY,GAGb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,gBAAgB,EAChB,eAAe,GAQhB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,YAAY,GAOb,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,gBAAgB,GASjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,SAAS,EAA8C,MAAM,oBAAoB,CAAC;AAE3F,OAAO,EACL,UAAU,EACV,OAAO,EACP,YAAY,EACZ,aAAa,GAGd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,aAAa,EACb,SAAS,EACT,gBAAgB,GAEjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,gBAAgB,GAEjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,kBAAkB,EAClB,oBAAoB,GAKrB,MAAM,sBAAs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c,EACd,YAAY,EACZ,cAAc,EACd,eAAe,EACf,YAAY,EACZ,WAAW,EACX,cAAc,EACd,eAAe,EACf,aAAa,EACb,eAAe,EACf,aAAa,EACb,eAAe,EACf,YAAY,EACZ,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,oBAAoB,GAIrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,cAAc,EACd,YAAY,EACZ,UAAU,GAGX,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,SAAS,GAGV,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,uBAAuB,EACvB,UAAU,GAIX,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,oBAAoB,GAErB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,aAAa,EAAoB,MAAM,qBAAqB,CAAC;AAEtE,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,cAAc,GAGf,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,29 @@
1
+ import type { CliError } from "../errors/index.js";
2
+ export interface OutputOptions {
3
+ json: boolean;
4
+ quiet: boolean;
5
+ verbose: boolean;
6
+ }
7
+ export interface ErrorEnvelope {
8
+ success: false;
9
+ error: {
10
+ code: string;
11
+ message: string;
12
+ suggestion?: string;
13
+ };
14
+ }
15
+ export declare function successEnvelope(data: unknown): {
16
+ success: true;
17
+ data: unknown;
18
+ };
19
+ export declare function errorEnvelope(error: CliError): ErrorEnvelope;
20
+ export declare class Output {
21
+ readonly options: OutputOptions;
22
+ private readonly stdout;
23
+ private readonly stderr;
24
+ constructor(options: OutputOptions, stdout?: NodeJS.WritableStream, stderr?: NodeJS.WritableStream);
25
+ result(data: unknown, renderHuman: (value: unknown) => string): void;
26
+ error(error: CliError): void;
27
+ progress(message: string): void;
28
+ debug(message: string): void;
29
+ }
@@ -0,0 +1,49 @@
1
+ import pc from "picocolors";
2
+ export function successEnvelope(data) {
3
+ return { success: true, data };
4
+ }
5
+ export function errorEnvelope(error) {
6
+ return {
7
+ success: false,
8
+ error: {
9
+ code: error.code,
10
+ message: error.message,
11
+ ...(error.suggestion === undefined ? {} : { suggestion: error.suggestion }),
12
+ },
13
+ };
14
+ }
15
+ export class Output {
16
+ options;
17
+ stdout;
18
+ stderr;
19
+ constructor(options, stdout = process.stdout, stderr = process.stderr) {
20
+ this.options = options;
21
+ this.stdout = stdout;
22
+ this.stderr = stderr;
23
+ }
24
+ result(data, renderHuman) {
25
+ const value = this.options.json
26
+ ? JSON.stringify(successEnvelope(data))
27
+ : renderHuman(data);
28
+ this.stdout.write(`${value}\n`);
29
+ }
30
+ error(error) {
31
+ const value = this.options.json
32
+ ? JSON.stringify(errorEnvelope(error))
33
+ : `${pc.red("Error:")} ${error.message}${error.suggestion === undefined ? "" : `\n${pc.dim(error.suggestion)}`}`;
34
+ const target = this.options.json ? this.stdout : this.stderr;
35
+ target.write(`${value}\n`);
36
+ }
37
+ progress(message) {
38
+ const isTTY = "isTTY" in this.stderr && this.stderr.isTTY === true;
39
+ if (!this.options.quiet && !this.options.json && isTTY) {
40
+ this.stderr.write(`${message}\n`);
41
+ }
42
+ }
43
+ debug(message) {
44
+ if (this.options.verbose && !this.options.quiet) {
45
+ this.stderr.write(`${pc.dim(message)}\n`);
46
+ }
47
+ }
48
+ }
49
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/output/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAmB5B,MAAM,UAAU,eAAe,CAAC,IAAa;IAC3C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AACjC,CA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,EAAE,CAAC;QACP,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;QAC7D,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED,QAAQ,CAAC,OAAe;QACtB,MAAM,KAAK,GAAG,OAAO,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,KAAK,IAAI,CAAC;QACnE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,KAAK,EAAE,CAAC;YACvD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,IAAI,CAAC,CAAC;QACpC,CAAC;IACH,CAAC;IAED,KAAK,CAAC,OAAe;QACnB,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;YAChD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC5C,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,10 @@
1
+ import { type IdentityClient } from "../api/identity.js";
2
+ import { type Context, type Credential } from "../config/index.js";
3
+ export declare function loginWithToken(context: Context, token: string, homeDir?: string): Promise<Credential>;
4
+ export declare function loginWithOtp(context: Context, identity: IdentityClient, email: string, otp: string, homeDir?: string): Promise<Credential>;
5
+ export declare function requestOtp(identity: IdentityClient, email: string): Promise<void>;
6
+ export declare function loginWithBrowser(context: Context, playgroundUrl: string, homeDir?: string): Promise<{
7
+ credential: Credential;
8
+ loginUrl: string;
9
+ }>;
10
+ export declare function logout(context: Context, homeDir?: string): Promise<void>;
@@ -0,0 +1,83 @@
1
+ import { homedir } from "node:os";
2
+ import { browserLogin } from "../api/identity.js";
3
+ import { readCredentials, readUserConfig, writeCredentials, writeUserConfig, } from "../config/index.js";
4
+ import { AuthError } from "../errors/index.js";
5
+ function claims(token) {
6
+ try {
7
+ const payload = token.split(".")[1];
8
+ return payload
9
+ ? JSON.parse(Buffer.from(payload, "base64url").toString("utf8"))
10
+ : {};
11
+ }
12
+ catch {
13
+ return {};
14
+ }
15
+ }
16
+ function credential(accessToken, refreshToken, userId) {
17
+ const tokenClaims = claims(accessToken);
18
+ return {
19
+ access_token: accessToken,
20
+ ...(refreshToken ? { refresh_token: refreshToken } : {}),
21
+ ...(userId ?? tokenClaims.userId ?? tokenClaims.sub
22
+ ? { user_id: userId ?? tokenClaims.userId ?? tokenClaims.sub }
23
+ : {}),
24
+ ...(tokenClaims.exp
25
+ ? { expires_at: new Date(tokenClaims.exp * 1_000).toISOString() }
26
+ : {}),
27
+ };
28
+ }
29
+ async function persist(context, value, homeDir = homedir()) {
30
+ const all = await readCredentials(homeDir);
31
+ const config = await readUserConfig(homeDir);
32
+ all[context.profile] ??= {};
33
+ all[context.profile][context.environment] = value;
34
+ await Promise.all([
35
+ writeCredentials(homeDir, all),
36
+ // Login must not clobber the saved default profile when `--profile` overrides
37
+ // this command. Use `apollo profile use` to change the default.
38
+ writeUserConfig(homeDir, {
39
+ ...config,
40
+ ...(config.profile === undefined ? { profile: context.profile } : {}),
41
+ environment: context.environment,
42
+ }),
43
+ ]);
44
+ }
45
+ export async function loginWithToken(context, token, homeDir) {
46
+ if (token.split(".").length !== 3) {
47
+ throw new AuthError("The pasted token is not a JWT.");
48
+ }
49
+ const tokenClaims = claims(token);
50
+ if (tokenClaims.exp && tokenClaims.exp * 1_000 <= Date.now()) {
51
+ throw new AuthError("The pasted token has expired.");
52
+ }
53
+ const value = credential(token);
54
+ await persist(context, value, homeDir);
55
+ return value;
56
+ }
57
+ export async function loginWithOtp(context, identity, email, otp, homeDir) {
58
+ const result = await identity.loginWithOtp(email, otp);
59
+ const value = credential(result.token, result.refreshToken, result.user._id ?? result.user.id);
60
+ await persist(context, value, homeDir);
61
+ return value;
62
+ }
63
+ export async function requestOtp(identity, email) {
64
+ await identity.sendOtp(email);
65
+ }
66
+ export async function loginWithBrowser(context, playgroundUrl, homeDir) {
67
+ const pending = await browserLogin(playgroundUrl);
68
+ const result = await pending.result;
69
+ const value = credential(result.token, result.refreshToken);
70
+ await persist(context, value, homeDir);
71
+ return { credential: value, loginUrl: pending.loginUrl };
72
+ }
73
+ export async function logout(context, homeDir = homedir()) {
74
+ const all = await readCredentials(homeDir);
75
+ const profile = all[context.profile];
76
+ if (profile) {
77
+ delete profile[context.environment];
78
+ if (Object.keys(profile).length === 0)
79
+ delete all[context.profile];
80
+ }
81
+ await writeCredentials(homeDir, all);
82
+ }
83
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/services/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,OAAO,EAAE,YAAY,EAAyC,MAAM,oBAAoB,CAAC;AACzF,OAAO,EACL,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,eAAe,GAGhB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAU/C,SAAS,MAAM,CAAC,KAAa;IAC3B,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACpC,OAAO,OAAO;YACZ,CAAC,CAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAe;YAC/E,CAAC,CAAC,EAAE,CAAC;IACT,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED,SAAS,UAAU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a;IACtE,MAAM,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAChC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,OAAgB,EAChB,aAAqB,EACrB,OAAgB;IAEhB,MAAM,OAAO,GAAG,MAAM,YAAY,CAAC,aAAa,CAAC,CAAC;IAClD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC;IACpC,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;IAC5D,MAAM,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IACvC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC;AAC3D,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,MAAM,CAC1B,OAAgB,EAChB,OAAO,GAAG,OAAO,EAAE;IAEnB,MAAM,GAAG,GAAG,MAAM,eAAe,CAAC,OAAO,CAAC,CAAC;IAC3C,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACrC,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QACpC,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACrE,CAAC;IACD,MAAM,gBAAgB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;AACvC,CAAC"}
@@ -0,0 +1,37 @@
1
+ import type { AgentVersion, ManagementClient, VersionPull, VersionPush } from "../api/management.js";
2
+ import type { RuntimeApiClient } from "../api/runtime-api.js";
3
+ import { type FileDiff } from "../bundle/baseline.js";
4
+ import { type ValidationResult } from "../bundle/validate.js";
5
+ import { type Context, type ProjectBinding } from "../config/index.js";
6
+ export declare function pullBundle(context: Context, management: ManagementClient, options?: {
7
+ tag?: string;
8
+ destination?: string;
9
+ homeDir?: string;
10
+ force?: boolean;
11
+ }): Promise<{
12
+ pull: VersionPull;
13
+ files: Record<string, string>;
14
+ removed: string[];
15
+ }>;
16
+ export declare function importBundle(context: Context, management: ManagementClient, agentId: string, destination: string, tag?: string, homeDir?: string): Promise<{
17
+ pull: VersionPull;
18
+ files: Record<string, string>;
19
+ binding: ProjectBinding;
20
+ }>;
21
+ export declare function localDiff(context: Context, root?: string, homeDir?: string): Promise<FileDiff>;
22
+ export declare function remoteDiff(context: Context, management: ManagementClient, root?: string): Promise<FileDiff>;
23
+ export declare function pushBundle(context: Context, management: ManagementClient, runtime: RuntimeApiClient, options?: {
24
+ root?: string;
25
+ commitMessage?: string;
26
+ homeDir?: string;
27
+ dryRun?: boolean;
28
+ }): Promise<{
29
+ diff: FileDiff;
30
+ push?: VersionPush;
31
+ validation?: ValidationResult;
32
+ }>;
33
+ export declare function validateProgramBundle(runtime: RuntimeApiClient, files: Record<string, string>): Promise<ValidationResult>;
34
+ export declare function validateLocalBundle(context: Context, runtime: RuntimeApiClient, root?: string): Promise<ValidationResult>;
35
+ export declare function listVersions(context: Context, management: ManagementClient): Promise<{
36
+ results: AgentVersion[];
37
+ }>;
@@ -0,0 +1,161 @@
1
+ import { homedir } from "node:os";
2
+ import path from "node:path";
3
+ import { diffHashes, isClean, readBaseline, writeBaseline } from "../bundle/baseline.js";
4
+ import { hashFiles, readProgramFiles } from "../bundle/files.js";
5
+ import { assembleBundle, bundleFileLayout, bundleFiles, writeBundleFiles, } from "../bundle/materialize.js";
6
+ import { assertValidProgram, mapRuntimeValidation, } from "../bundle/validate.js";
7
+ import { writeBinding } from "../config/index.js";
8
+ import { ConfigError } from "../errors/index.js";
9
+ function requireAgent(context) {
10
+ if (!context.agentId)
11
+ throw new ConfigError("Select or import an agent first.");
12
+ return context.agentId;
13
+ }
14
+ function requireTag(context, override) {
15
+ const tag = override ?? context.versionTag;
16
+ if (!tag)
17
+ throw new ConfigError("Select a version tag first.");
18
+ return tag;
19
+ }
20
+ function agentRoot(context) {
21
+ return context.agentRoot ??
22
+ (context.bindingPath ? path.dirname(context.bindingPath) : process.cwd());
23
+ }
24
+ function bundleSourceRoot(context, root = agentRoot(context)) {
25
+ return path.join(root, "bundle", "src");
26
+ }
27
+ async function updateTag(context, versionTag) {
28
+ if (!context.bindingPath) {
29
+ throw new ConfigError("No .apollorc is bound to this working directory.");
30
+ }
31
+ const binding = {
32
+ config_version: 1,
33
+ ...(context.orgId ? { org_id: context.orgId } : {}),
34
+ ...(context.projectId ? { project_id: context.projectId } : {}),
35
+ ...(context.agentId ? { agent_id: context.agentId } : {}),
36
+ version_tag: versionTag,
37
+ };
38
+ await writeBinding(context.bindingPath, binding);
39
+ }
40
+ function formatFileDiff(diff) {
41
+ return [
42
+ ...diff.added.map((file) => `A ${file}`),
43
+ ...diff.changed.map((file) => `M ${file}`),
44
+ ...diff.removed.map((file) => `D ${file}`),
45
+ ].join("\n");
46
+ }
47
+ async function assertCleanPullDestination(context, root, homeDir) {
48
+ const agentId = requireAgent(context);
49
+ const baseline = await readBaseline(homeDir, agentId);
50
+ let currentFiles = {};
51
+ try {
52
+ currentFiles = (await readProgramFiles(root)).files;
53
+ }
54
+ catch (error) {
55
+ if (error.code !== "ENOENT")
56
+ throw error;
57
+ }
58
+ if (!baseline) {
59
+ if (Object.keys(currentFiles).length === 0)
60
+ return;
61
+ throw new ConfigError("Local bundle files exist but no baseline is recorded.", "Pass --force to replace the local bundle with the remote version.");
62
+ }
63
+ const pending = diffHashes(baseline.files, currentFiles);
64
+ if (!isClean(pending)) {
65
+ throw new ConfigError(`Local bundle files have changed:\n${formatFileDiff(pending)}`, "Push your changes or pass --force to replace the local bundle.");
66
+ }
67
+ }
68
+ export async function pullBundle(context, management, options = {}) {
69
+ const agentId = requireAgent(context);
70
+ const tag = requireTag(context, options.tag);
71
+ const homeDir = options.homeDir ?? homedir();
72
+ const destination = bundleSourceRoot(context, options.destination ?? agentRoot(context));
73
+ if (!options.force) {
74
+ await assertCleanPullDestination(context, destination, homeDir);
75
+ }
76
+ const version = await management.resolveVersion(agentId, tag);
77
+ const pull = await management.pullVersion(agentId, version.id, tag);
78
+ const files = bundleFiles(pull.bundle);
79
+ const written = await writeBundleFiles(destination, files);
80
+ await updateTag(context, pull.version_tag);
81
+ await writeBaseline(homeDir, agentId, pull.version_tag, files, bundleFileLayout(pull.bundle));
82
+ return { pull, files, removed: written.removed };
83
+ }
84
+ export async function importBundle(context, management, agentId, destination, tag, homeDir = homedir()) {
85
+ const agent = await management.getAgent(agentId);
86
+ let selectedTag = tag;
87
+ if (!selectedTag && agent.live_version_id) {
88
+ const versions = await management.listVersions(agentId);
89
+ selectedTag = versions.results.find((version) => version.id === agent.live_version_id)?.version_tag;
90
+ }
91
+ if (!selectedTag)
92
+ throw new ConfigError("The agent has no live version; pass --tag.");
93
+ const version = await management.resolveVersion(agentId, selectedTag);
94
+ const pull = await management.pullVersion(agentId, version.id, selectedTag);
95
+ const files = bundleFiles(pull.bundle);
96
+ await writeBundleFiles(bundleSourceRoot(context, destination), files);
97
+ const binding = {
98
+ config_version: 1,
99
+ ...(context.orgId ? { org_id: context.orgId } : {}),
100
+ project_id: agent.project_id,
101
+ agent_id: agent.id,
102
+ version_tag: pull.version_tag,
103
+ };
104
+ await writeBinding(path.join(destination, ".apollorc"), binding);
105
+ await writeBaseline(homeDir, agent.id, pull.version_tag, files, bundleFileLayout(pull.bundle));
106
+ return { pull, files, binding };
107
+ }
108
+ export async function localDiff(context, root = bundleSourceRoot(context), homeDir = homedir()) {
109
+ const agentId = requireAgent(context);
110
+ const baseline = await readBaseline(homeDir, agentId);
111
+ if (!baseline)
112
+ throw new ConfigError("No import/pull/push baseline exists yet.");
113
+ const current = await readProgramFiles(root);
114
+ return diffHashes(baseline.files, current.files);
115
+ }
116
+ export async function remoteDiff(context, management, root = bundleSourceRoot(context)) {
117
+ const agentId = requireAgent(context);
118
+ const tag = requireTag(context);
119
+ const version = await management.resolveVersion(agentId, tag);
120
+ const pull = await management.pullVersion(agentId, version.id);
121
+ const remote = bundleFiles(pull.bundle);
122
+ const current = await readProgramFiles(root);
123
+ return diffHashes(hashFiles(remote), current.files);
124
+ }
125
+ export async function pushBundle(context, management, runtime, options = {}) {
126
+ const agentId = requireAgent(context);
127
+ const root = options.root ?? bundleSourceRoot(context);
128
+ const program = await readProgramFiles(root);
129
+ const validation = await validateProgramBundle(runtime, program.files);
130
+ assertValidProgram(validation);
131
+ const baseline = await readBaseline(options.homeDir ?? homedir(), agentId);
132
+ const diff = diffHashes(baseline?.files ?? {}, program.files);
133
+ if (options.dryRun || isClean(diff))
134
+ return { diff, validation };
135
+ const baseTag = requireTag(context);
136
+ const base = await management.resolveVersion(agentId, baseTag);
137
+ const draft = base.status === "draft"
138
+ ? base
139
+ : await management.createVersion(agentId, {
140
+ source: "version",
141
+ fromVersion: base.id,
142
+ label: `Draft from ${base.version_tag}`,
143
+ });
144
+ const bundle = assembleBundle(program.files, baseline?.fileLayout);
145
+ const push = await management.pushVersion(agentId, draft.id, bundle, options.commitMessage);
146
+ await updateTag(context, push.new_version_tag);
147
+ await writeBaseline(options.homeDir ?? homedir(), agentId, push.new_version_tag, program.files, bundleFileLayout(bundle));
148
+ return { diff, push, validation };
149
+ }
150
+ export async function validateProgramBundle(runtime, files) {
151
+ const response = await runtime.validateProgram({ files });
152
+ return mapRuntimeValidation(response);
153
+ }
154
+ export async function validateLocalBundle(context, runtime, root = bundleSourceRoot(context)) {
155
+ const program = await readProgramFiles(root);
156
+ return validateProgramBundle(runtime, program.files);
157
+ }
158
+ export async function listVersions(context, management) {
159
+ return management.listVersions(requireAgent(context));
160
+ }
161
+ //# sourceMappingURL=bundles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundles.js","sourceRoot":"","sources":["../../../src/services/bundles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,C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,CAAC,MAAM,CAAC,CACzB,CAAC;IACF,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;AACpC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,OAAyB,EACzB,KAA6B;IAE7B,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,eAAe,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IAC1D,OAAO,oBAAoB,CAAC,QAAQ,CAAC,CAAC;AACxC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,OAAgB,EAChB,OAAyB,EACzB,IAAI,GAAG,gBAAgB,CAAC,OAAO,CAAC;IAEhC,MAAM,OAAO,GAAG,MAAM,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC7C,OAAO,qBAAqB,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;AACvD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,OAAgB,EAChB,UAA4B;IAE5B,OAAO,UAAU,CAAC,YAAY,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;AACxD,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { IdentityClient } from "../api/identity.js";
2
+ import { AgentSettingsClient } from "../api/agent-settings.js";
3
+ import { ManagementClient } from "../api/management.js";
4
+ import { RuntimeApiClient } from "../api/runtime-api.js";
5
+ import { type Context } from "../config/index.js";
6
+ export interface Clients {
7
+ identity: IdentityClient;
8
+ management: ManagementClient;
9
+ runtime: RuntimeApiClient;
10
+ agentSettings: AgentSettingsClient;
11
+ }
12
+ export declare function createClients(context: Context, options?: {
13
+ homeDir?: string;
14
+ fetch?: typeof globalThis.fetch;
15
+ }): Clients;