@aui.io/apollo 0.1.43 → 0.1.46

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 (88) hide show
  1. package/README.md +6 -14
  2. package/node_modules/@aui.io/apollo-cli/dist/src/commands/auth.js +5 -12
  3. package/node_modules/@aui.io/apollo-cli/dist/src/commands/auth.js.map +1 -1
  4. package/node_modules/@aui.io/apollo-cli/dist/src/commands/shell.d.ts +3 -3
  5. package/node_modules/@aui.io/apollo-cli/dist/src/commands/shell.js +3 -3
  6. package/node_modules/@aui.io/apollo-cli/dist/src/index.d.ts +5 -2
  7. package/node_modules/@aui.io/apollo-cli/dist/src/index.js +5 -7
  8. package/node_modules/@aui.io/apollo-cli/dist/src/index.js.map +1 -1
  9. package/node_modules/@aui.io/apollo-cli/package.json +9 -4
  10. package/node_modules/@aui.io/apollo-core/dist/src/api/capture.d.ts +14 -4
  11. package/node_modules/@aui.io/apollo-core/dist/src/api/capture.js +21 -10
  12. package/node_modules/@aui.io/apollo-core/dist/src/api/capture.js.map +1 -1
  13. package/node_modules/@aui.io/apollo-core/dist/src/api/lane.d.ts +19 -0
  14. package/node_modules/@aui.io/apollo-core/dist/src/api/lane.js +26 -0
  15. package/node_modules/@aui.io/apollo-core/dist/src/api/lane.js.map +1 -0
  16. package/node_modules/@aui.io/apollo-core/dist/src/api/runtime-api.d.ts +13 -19
  17. package/node_modules/@aui.io/apollo-core/dist/src/api/runtime-api.js +16 -31
  18. package/node_modules/@aui.io/apollo-core/dist/src/api/runtime-api.js.map +1 -1
  19. package/node_modules/@aui.io/apollo-core/dist/src/api/transport.d.ts +7 -1
  20. package/node_modules/@aui.io/apollo-core/dist/src/api/transport.js +10 -2
  21. package/node_modules/@aui.io/apollo-core/dist/src/api/transport.js.map +1 -1
  22. package/node_modules/@aui.io/apollo-core/dist/src/bundle/validate.d.ts +0 -2
  23. package/node_modules/@aui.io/apollo-core/dist/src/bundle/validate.js +1 -1
  24. package/node_modules/@aui.io/apollo-core/dist/src/bundle/validate.js.map +1 -1
  25. package/node_modules/@aui.io/apollo-core/dist/src/checkouts/registry.js +4 -5
  26. package/node_modules/@aui.io/apollo-core/dist/src/checkouts/registry.js.map +1 -1
  27. package/node_modules/@aui.io/apollo-core/dist/src/config/index.d.ts +10 -1
  28. package/node_modules/@aui.io/apollo-core/dist/src/config/index.js +51 -28
  29. package/node_modules/@aui.io/apollo-core/dist/src/config/index.js.map +1 -1
  30. package/node_modules/@aui.io/apollo-core/dist/src/config/types.d.ts +6 -2
  31. package/node_modules/@aui.io/apollo-core/dist/src/config/types.js +1 -1
  32. package/node_modules/@aui.io/apollo-core/dist/src/config/types.js.map +1 -1
  33. package/node_modules/@aui.io/apollo-core/dist/src/index.d.ts +4 -3
  34. package/node_modules/@aui.io/apollo-core/dist/src/index.js +3 -3
  35. package/node_modules/@aui.io/apollo-core/dist/src/index.js.map +1 -1
  36. package/node_modules/@aui.io/apollo-core/dist/src/services/clients.js +7 -3
  37. package/node_modules/@aui.io/apollo-core/dist/src/services/clients.js.map +1 -1
  38. package/node_modules/@aui.io/apollo-core/dist/src/services/env.service.d.ts +11 -1
  39. package/node_modules/@aui.io/apollo-core/dist/src/services/env.service.js +7 -11
  40. package/node_modules/@aui.io/apollo-core/dist/src/services/env.service.js.map +1 -1
  41. package/node_modules/@aui.io/apollo-core/dist/src/services/messaging.d.ts +0 -1
  42. package/node_modules/@aui.io/apollo-core/dist/src/services/messaging.js +0 -3
  43. package/node_modules/@aui.io/apollo-core/dist/src/services/messaging.js.map +1 -1
  44. package/node_modules/@aui.io/apollo-core/dist/src/skills/agents-page.d.ts +5 -7
  45. package/node_modules/@aui.io/apollo-core/dist/src/skills/agents-page.js +8 -9
  46. package/node_modules/@aui.io/apollo-core/dist/src/skills/agents-page.js.map +1 -1
  47. package/node_modules/@aui.io/apollo-core/package.json +1 -1
  48. package/node_modules/@aui.io/apollo-tui/dist/src/actions/registry.js +6 -10
  49. package/node_modules/@aui.io/apollo-tui/dist/src/actions/registry.js.map +1 -1
  50. package/node_modules/@aui.io/apollo-tui/dist/src/activity/ActivityDrawer.js +3 -3
  51. package/node_modules/@aui.io/apollo-tui/dist/src/activity/ActivityDrawer.js.map +1 -1
  52. package/node_modules/@aui.io/apollo-tui/dist/src/author/ValidationView.js +1 -1
  53. package/node_modules/@aui.io/apollo-tui/dist/src/author/ValidationView.js.map +1 -1
  54. package/node_modules/@aui.io/apollo-tui/dist/src/index.d.ts +1 -1
  55. package/node_modules/@aui.io/apollo-tui/dist/src/index.js +1 -1
  56. package/node_modules/@aui.io/apollo-tui/dist/src/index.js.map +1 -1
  57. package/node_modules/@aui.io/apollo-tui/dist/src/lib/actions.d.ts +2 -2
  58. package/node_modules/@aui.io/apollo-tui/dist/src/lib/actions.js +25 -46
  59. package/node_modules/@aui.io/apollo-tui/dist/src/lib/actions.js.map +1 -1
  60. package/node_modules/@aui.io/apollo-tui/dist/src/lib/commands.js +28 -23
  61. package/node_modules/@aui.io/apollo-tui/dist/src/lib/commands.js.map +1 -1
  62. package/node_modules/@aui.io/apollo-tui/dist/src/lib/diagnostics.js +1 -1
  63. package/node_modules/@aui.io/apollo-tui/dist/src/lib/diagnostics.js.map +1 -1
  64. package/node_modules/@aui.io/apollo-tui/dist/src/lib/keydiag.js +1 -3
  65. package/node_modules/@aui.io/apollo-tui/dist/src/lib/keydiag.js.map +1 -1
  66. package/node_modules/@aui.io/apollo-tui/dist/src/lib/keys.d.ts +0 -6
  67. package/node_modules/@aui.io/apollo-tui/dist/src/lib/keys.js +0 -8
  68. package/node_modules/@aui.io/apollo-tui/dist/src/lib/keys.js.map +1 -1
  69. package/node_modules/@aui.io/apollo-tui/dist/src/opentui-app.js +13 -19
  70. package/node_modules/@aui.io/apollo-tui/dist/src/opentui-app.js.map +1 -1
  71. package/node_modules/@aui.io/apollo-tui/dist/src/shell/FooterHints.js +1 -1
  72. package/node_modules/@aui.io/apollo-tui/dist/src/shell/FooterHints.js.map +1 -1
  73. package/node_modules/@aui.io/apollo-tui/dist/src/talk/InspectorPane.d.ts +2 -2
  74. package/node_modules/@aui.io/apollo-tui/dist/src/talk/InspectorPane.js +1 -1
  75. package/node_modules/@aui.io/apollo-tui/dist/src/talk/TalkView.d.ts +2 -2
  76. package/node_modules/@aui.io/apollo-tui/dist/src/talk/TalkView.js +2 -2
  77. package/node_modules/@aui.io/apollo-tui/dist/src/talk/TalkView.js.map +1 -1
  78. package/node_modules/@aui.io/apollo-tui/dist/src/talk/data.d.ts +2 -2
  79. package/node_modules/@aui.io/apollo-tui/dist/src/talk/data.js +0 -1
  80. package/node_modules/@aui.io/apollo-tui/dist/src/talk/data.js.map +1 -1
  81. package/node_modules/@aui.io/apollo-tui/package.json +2 -2
  82. package/package.json +4 -4
  83. package/node_modules/@aui.io/apollo-cli/dist/src/commands/curl.d.ts +0 -10
  84. package/node_modules/@aui.io/apollo-cli/dist/src/commands/curl.js +0 -63
  85. package/node_modules/@aui.io/apollo-cli/dist/src/commands/curl.js.map +0 -1
  86. package/node_modules/@aui.io/apollo-cli/dist/src/commands/env.d.ts +0 -3
  87. package/node_modules/@aui.io/apollo-cli/dist/src/commands/env.js +0 -34
  88. package/node_modules/@aui.io/apollo-cli/dist/src/commands/env.js.map +0 -1
package/README.md CHANGED
@@ -40,7 +40,7 @@ apollo upgrade --check # show the available version only
40
40
  ## Quick start
41
41
 
42
42
  ```bash
43
- apollo login # browser flow; picks environment (staging | production)
43
+ apollo login # browser flow
44
44
  apollo agent import <agent-id> # or: apollo agent create <name>
45
45
  cd <the printed checkout directory> # defaults to ~/apollo/<profile>/<env>/<name>-<id>
46
46
 
@@ -59,7 +59,6 @@ selects the agent you are working on. `apollo status` always tells you where you
59
59
  | Layer | What it is | Commands |
60
60
  |---|---|---|
61
61
  | **Profile** | Named credential slot (e.g. `default`, `work`) | `profile *` |
62
- | **Environment** | `staging` or `production` | `env *` |
63
62
  | **Checkout** | Local directory holding one agent (`.apollorc` + `bundle/src/`) | `agent use / import / create` |
64
63
  | **Organization** | Identity / billing org (on the access token) | `org *` |
65
64
  | **Project** | Container for agents | `project *` |
@@ -71,10 +70,8 @@ selects the agent you are working on. `apollo status` always tells you where you
71
70
  ```text
72
71
  status [--check] # active context (+ service connectivity)
73
72
  doctor [--offline] # diagnose setup; exit 2 on problems
74
- curl [--failed] [--last <n>] [--method <verb>] [--search <text>]
75
73
  upgrade [version] [--check] [--force]
76
74
  login | logout
77
- env current | list | use <name>
78
75
  profile current | list | use <name>
79
76
  org list | use <id>
80
77
  project list | use <id> | create <name>
@@ -118,7 +115,7 @@ resources, scenarios) and **Talk** (converse with the running agent).
118
115
  |---|---|
119
116
  | `Ctrl+1` / `Ctrl+2` (or `Tab`) | Author / Talk |
120
117
  | `Ctrl+K` | Action palette — every operation, with CLI equivalents |
121
- | `Ctrl+G` | Context switcher — env / profile / agent / project / org |
118
+ | `Ctrl+G` | Context switcher — profile / agent / project / org |
122
119
  | `Ctrl+J` | Activity drawer — operations, retry, output, live API-request tail |
123
120
  | `Esc` | Close overlay / cancel |
124
121
 
@@ -132,8 +129,6 @@ everything to the agent verbatim.
132
129
  ```bash
133
130
  apollo doctor # diagnose the setup end to end; exit 2 on problems
134
131
  apollo status --check # context + per-service reachability/auth
135
- apollo curl # recent API requests replayed as curl commands
136
- apollo curl --failed # only status ≥ 400 or no-response entries
137
132
  apollo --verbose <cmd> # stream each API call live to stderr
138
133
  ```
139
134
 
@@ -143,11 +138,9 @@ permissions, token expiry, the current checkout, and service reachability —
143
138
  read-only, with the fix attached to every finding. Share its output when
144
139
  reporting issues.
145
140
 
146
- Every command records its HTTP requests **redacted** (auth/token/key/secret values
147
- never reach disk) to `~/.apollo/last-requests.json`. `apollo curl` prints them back
148
- as runnable curl commands (metadata in `#` comments, so output is shell-paste-safe);
149
- redacted auth headers are emitted as `$APOLLO_TOKEN` placeholders. The TUI shows the
150
- same stream live in its activity drawer.
141
+ `--verbose` streams one **redacted** line per API request (auth/token/key/secret
142
+ values never appear) to stderr; the TUI shows the same stream live in its
143
+ activity drawer.
151
144
 
152
145
  ## Files and environment variables
153
146
 
@@ -157,13 +150,12 @@ same stream live in its activity drawer.
157
150
  credentials.json # tokens (mode 0600 — the only secret-bearing file)
158
151
  checkouts.json # known-checkouts registry
159
152
  baselines/… # sync hashes for diff/push
160
- last-requests.json # redacted recent HTTP captures
161
153
 
162
154
  <checkout>/.apollorc # org / project / agent / version_tag binding
163
155
  <checkout>/bundle/src/ # the editable program source
164
156
  ```
165
157
 
166
- `APOLLO_ENV`, `APOLLO_PROFILE`, `APOLLO_TOKEN` (CI auth), `APOLLO_ORG_ID`,
158
+ `APOLLO_PROFILE`, `APOLLO_TOKEN` (CI auth), `APOLLO_ORG_ID`,
167
159
  `APOLLO_PROJECT_ID`, `APOLLO_TIMEOUT_MS`, and per-service `APOLLO_*_URL` overrides are
168
160
  honored everywhere; see the User Guide for the full table.
169
161
 
@@ -1,10 +1,9 @@
1
1
  import { homedir } from "node:os";
2
- import { readCredentials, resolveContext, writeCredentials, } from "@aui.io/apollo-core/config/index.js";
2
+ import { environmentDefinition, readCredentials, writeCredentials, } from "@aui.io/apollo-core/config/index.js";
3
3
  import { ConfigError } from "@aui.io/apollo-core/errors/index.js";
4
4
  import { loginWithBrowser, loginWithOtp, loginWithToken, logout, requestOtp, } from "@aui.io/apollo-core/services/auth.js";
5
5
  import { createClients } from "@aui.io/apollo-core/services/clients.js";
6
6
  import { prompt } from "./prompts.js";
7
- const PLAYGROUND_URL = "https://apollo.aui.io";
8
7
  export function registerAuth(program, runtime) {
9
8
  program
10
9
  .command("login")
@@ -16,15 +15,9 @@ export function registerAuth(program, runtime) {
16
15
  .option("--url <url>", "override the playground login URL")
17
16
  .action(async (options) => {
18
17
  const current = runtime();
19
- // The public CLI signs in to production only no environment flag.
20
- const context = await resolveContext({
21
- flags: {
22
- env: "production",
23
- profile: current.context.profile,
24
- timeout: String(current.context.timeoutMs),
25
- },
26
- });
27
- const { output } = current;
18
+ // Login lands on the active environment which for this build can
19
+ // only be one the environment registry knows.
20
+ const { context, output } = current;
28
21
  const clients = createClients(context);
29
22
  let stored;
30
23
  if (options.token) {
@@ -47,7 +40,7 @@ export function registerAuth(program, runtime) {
47
40
  }
48
41
  else {
49
42
  output.progress("Opening browser login...");
50
- const result = await loginWithBrowser(context, options.url ?? PLAYGROUND_URL);
43
+ const result = await loginWithBrowser(context, options.url ?? environmentDefinition(context.environment).playgroundUrl);
51
44
  stored = result.credential;
52
45
  }
53
46
  output.result({
@@ -1 +1 @@
1
- {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/commands/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAIlC,OAAO,EACL,eAAe,EACf,cAAc,EACd,gBAAgB,GAEjB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,MAAM,EACN,UAAU,GACX,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAExE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,MAAM,cAAc,GAAG,uBAAuB,CAAC;AAU/C,MAAM,UAAU,YAAY,CAC1B,OAAgB,EAChB,OAA6B;IAE7B,OAAO;SACJ,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,0BAA0B,CAAC;SACvC,MAAM,CAAC,eAAe,EAAE,gCAAgC,CAAC;SACzD,MAAM,CAAC,iBAAiB,EAAE,mBAAmB,CAAC;SAC9C,MAAM,CAAC,cAAc,EAAE,yBAAyB,CAAC;SACjD,MAAM,CAAC,OAAO,EAAE,4BAA4B,CAAC;SAC7C,MAAM,CAAC,aAAa,EAAE,mCAAmC,CAAC;SAC1D,MAAM,CAAC,KAAK,EAAE,OAAqB,EAAE,EAAE;QACtC,MAAM,OAAO,GAAG,OAAO,EAA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AC;QACtB,MAAM,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;AACP,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,OAAuB,EACvB,KAAa,EACb,YAAqB;IAErB,MAAM,WAAW,GAAG,MAAM,eAAe,CAAC,OAAO,EAAE,CAAC,CAAC;IACrD,MAAM,OAAO,GACX,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IACtE,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IAC5C,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAE,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG;QACnE,YAAY,EAAE,KAAK;QACnB,GAAG,CAAC,YAAY;YACd,CAAC,CAAC,EAAE,aAAa,EAAE,YAAY,EAAE;YACjC,CAAC,CAAC,OAAO,EAAE,aAAa;gBACtB,CAAC,CAAC,EAAE,aAAa,EAAE,OAAO,CAAC,aAAa,EAAE;gBAC1C,CAAC,CAAC,EAAE,CAAC;QACT,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC1D,CAAC;IACF,MAAM,gBAAgB,CAAC,OAAO,EAAE,EAAE,WAAW,CAAC,CAAC;AACjD,CAAC"}
@@ -3,9 +3,9 @@ import type { Command } from "commander";
3
3
  * Shell wrapper sourced via `eval "$(apollo shell-init)"` (installed into the
4
4
  * user's rc file by the @aui.io/apollo postinstall). A child process cannot
5
5
  * change the parent shell's cwd, so auto-cd after `agent use/import/create`
6
- * has to live in the shell itself. Account commands (`env use`, `profile
7
- * use`) never cd — your position binds context, so moving is always an
8
- * explicit agent action. APOLLO_SHELL_WRAPPED lets the CLI drop the
6
+ * has to live in the shell itself. Account commands (`profile use`) never
7
+ * cd — your position binds context, so moving is always an explicit agent
8
+ * action. APOLLO_SHELL_WRAPPED lets the CLI drop the
9
9
  * "cd <path>" tip when the wrapper is about to do it anyway.
10
10
  */
11
11
  export declare const SHELL_INIT_SCRIPT = "# apollo shell integration (zsh/bash)\napollo() {\n APOLLO_SHELL_WRAPPED=1 command apollo \"$@\"\n local apollo_exit=$?\n if [ \"$apollo_exit\" -eq 0 ] && [ \"$1\" = \"agent\" ]; then\n case \"$2\" in\n use|import|create)\n # The command just touched the registry; resolve the checkout so\n # name arguments and the interactive picker land in the right place.\n local apollo_target\n apollo_target=\"$(APOLLO_SHELL_WRAPPED=1 command apollo agent path 2>/dev/null)\"\n if [ -n \"$apollo_target\" ] && [ -d \"$apollo_target\" ]; then\n cd \"$apollo_target\" || return\n fi\n ;;\n esac\n fi\n return \"$apollo_exit\"\n}\n";
@@ -5,9 +5,9 @@ import path from "node:path";
5
5
  * Shell wrapper sourced via `eval "$(apollo shell-init)"` (installed into the
6
6
  * user's rc file by the @aui.io/apollo postinstall). A child process cannot
7
7
  * change the parent shell's cwd, so auto-cd after `agent use/import/create`
8
- * has to live in the shell itself. Account commands (`env use`, `profile
9
- * use`) never cd — your position binds context, so moving is always an
10
- * explicit agent action. APOLLO_SHELL_WRAPPED lets the CLI drop the
8
+ * has to live in the shell itself. Account commands (`profile use`) never
9
+ * cd — your position binds context, so moving is always an explicit agent
10
+ * action. APOLLO_SHELL_WRAPPED lets the CLI drop the
11
11
  * "cd <path>" tip when the wrapper is about to do it anyway.
12
12
  */
13
13
  export const SHELL_INIT_SCRIPT = `# apollo shell integration (zsh/bash)
@@ -1,4 +1,5 @@
1
1
  import { Command } from "commander";
2
+ import type { CommandRuntime } from "./commands/runtime.js";
2
3
  import { type Context } from "@aui.io/apollo-core/config/index.js";
3
4
  import { Output } from "@aui.io/apollo-core/output/index.js";
4
5
  interface ProgramState {
@@ -6,6 +7,8 @@ interface ProgramState {
6
7
  output?: Output;
7
8
  captureUnsubscribe?: () => void;
8
9
  }
9
- export declare function createProgram(state?: ProgramState): Command;
10
- export declare function main(argv?: string[]): Promise<number>;
10
+ /** A distribution's extra command modules, registered after the stock set. */
11
+ export type CommandExtension = (program: Command, runtime: () => CommandRuntime) => void;
12
+ export declare function createProgram(state?: ProgramState, extensions?: readonly CommandExtension[]): Command;
13
+ export declare function main(argv?: string[], extensions?: readonly CommandExtension[]): Promise<number>;
11
14
  export {};
@@ -1,10 +1,8 @@
1
1
  import { Command, CommanderError, Option } from "commander";
2
2
  import { normalizeArgv } from "@aui.io/apollo-core/argv.js";
3
3
  import { captureLog } from "@aui.io/apollo-core/api/capture.js";
4
- import { registerEnv } from "./commands/env.js";
5
4
  import { registerAuth } from "./commands/auth.js";
6
5
  import { registerBundles } from "./commands/bundles.js";
7
- import { registerCurl } from "./commands/curl.js";
8
6
  import { registerDoctor } from "./commands/doctor.js";
9
7
  import { registerHierarchy } from "./commands/hierarchy.js";
10
8
  import { registerOperate } from "./commands/operate.js";
@@ -21,7 +19,7 @@ import { ConfigError, toCliError } from "@aui.io/apollo-core/errors/index.js";
21
19
  import { CLI_VERSION } from "./meta.js";
22
20
  import { Output } from "@aui.io/apollo-core/output/index.js";
23
21
  import { renderWelcome, welcomeData } from "./output/welcome.js";
24
- export function createProgram(state = {}) {
22
+ export function createProgram(state = {}, extensions = []) {
25
23
  const program = new Command()
26
24
  .name("apollo")
27
25
  .description("Manage and operate Apollo agents")
@@ -82,9 +80,7 @@ export function createProgram(state = {}) {
82
80
  };
83
81
  registerStatus(program, runtime);
84
82
  registerDoctor(program, runtime);
85
- registerCurl(program, runtime);
86
83
  registerUpgrade(program, runtime);
87
- registerEnv(program, runtime);
88
84
  registerProfile(program, runtime);
89
85
  registerAuth(program, runtime);
90
86
  registerHierarchy(program, runtime);
@@ -95,11 +91,13 @@ export function createProgram(state = {}) {
95
91
  registerVault(program, runtime);
96
92
  registerKb(program, runtime);
97
93
  registerShellInit(program);
94
+ for (const extension of extensions)
95
+ extension(program, runtime);
98
96
  return program;
99
97
  }
100
- export async function main(argv = process.argv) {
98
+ export async function main(argv = process.argv, extensions = []) {
101
99
  const state = {};
102
- const program = createProgram(state);
100
+ const program = createProgram(state, extensions);
103
101
  try {
104
102
  await program.parseAsync(normalizeArgv(argv));
105
103
  // Commands may set a non-zero exit code without aborting (doctor's
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAE5D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc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2
2
  "name": "@aui.io/apollo-cli",
3
- "version": "0.1.43",
3
+ "version": "0.1.46",
4
4
  "description": "Command-line client for the Apollo runtime",
5
5
  "type": "module",
6
6
  "engines": {
@@ -10,7 +10,12 @@
10
10
  "apollo": "./bin/apollo.js"
11
11
  },
12
12
  "exports": {
13
- "./bin/apollo.js": "./bin/apollo.js"
13
+ ".": {
14
+ "types": "./dist/src/index.d.ts",
15
+ "import": "./dist/src/index.js"
16
+ },
17
+ "./bin/apollo.js": "./bin/apollo.js",
18
+ "./dist/*": "./dist/*"
14
19
  },
15
20
  "files": [
16
21
  "bin",
@@ -28,12 +33,12 @@
28
33
  "test": "vitest run"
29
34
  },
30
35
  "dependencies": {
31
- "@aui.io/apollo-core": "0.1.43",
36
+ "@aui.io/apollo-core": "0.1.46",
32
37
  "commander": "^14.0.3",
33
38
  "picocolors": "^1.1.1"
34
39
  },
35
40
  "optionalDependencies": {
36
- "@aui.io/apollo-tui": "0.1.43"
41
+ "@aui.io/apollo-tui": "0.1.46"
37
42
  },
38
43
  "devDependencies": {
39
44
  "@eslint/js": "^9.39.5",
@@ -5,18 +5,28 @@ export interface CaptureSink {
5
5
  }
6
6
  export declare function defaultCapturePath(): string;
7
7
  export declare class CaptureLog implements CaptureSink {
8
- private readonly filePath?;
9
8
  private entries;
10
9
  private readonly listeners;
11
10
  /** Per-write suffix — see `persist`. */
12
11
  private writeSeq;
13
- /** No path = default file with the test-env guard; a string pins it. */
14
- constructor(filePath?: string | undefined);
12
+ /** Where flushes land unset means in-memory only (the default). */
13
+ private target?;
14
+ /** No path = in-memory only; a string turns persistence on from birth. */
15
+ constructor(filePath?: string);
16
+ /**
17
+ * Turn on file persistence — the replay lane. A distribution that wants
18
+ * requests to survive the process calls this once at startup; no
19
+ * argument means the default path.
20
+ */
21
+ persistTo(filePath?: string): void;
15
22
  /** Stable reference between mutations — safe for useSyncExternalStore. */
16
23
  snapshot: () => readonly RequestCapture[];
17
24
  subscribe: (listener: () => void) => (() => void);
18
25
  add(entry: RequestCapture): Promise<void>;
19
26
  private persist;
20
27
  }
21
- /** The one log — module-level so the CLI process and TUI session share it. */
28
+ /**
29
+ * The one log — module-level so the CLI process and TUI session share it.
30
+ * In-memory only until a distribution opts into persistence at startup.
31
+ */
22
32
  export declare const captureLog: CaptureLog;
@@ -11,10 +11,10 @@
11
11
  * - the TUI activity drawer subscribes for its live "api requests" tail
12
12
  *
13
13
  * Entries arrive already redacted (transport.ts) — nothing here may ever
14
- * see a raw secret. Persistence mirrors the old per-transport behavior:
15
- * atomic tmp+rename, dir 0700 / file 0600, best-effort (a failed write can
16
- * never fail an API request), and disabled under NODE_ENV=test unless a
17
- * path is pinned explicitly.
14
+ * see a raw secret. The log is in-memory by default; file persistence is
15
+ * opt-in (`persistTo`), so the stock build leaves nothing in `~/.apollo`.
16
+ * When enabled, writes are atomic tmp+rename, dir 0700 / file 0600, and
17
+ * best-effort (a failed write can never fail an API request).
18
18
  */
19
19
  import { mkdir, rename, writeFile } from "node:fs/promises";
20
20
  import { homedir } from "node:os";
@@ -25,14 +25,23 @@ export function defaultCapturePath() {
25
25
  return path.join(homedir(), ".apollo", "last-requests.json");
26
26
  }
27
27
  export class CaptureLog {
28
- filePath;
29
28
  entries = [];
30
29
  listeners = new Set();
31
30
  /** Per-write suffix — see `persist`. */
32
31
  writeSeq = 0;
33
- /** No path = default file with the test-env guard; a string pins it. */
32
+ /** Where flushes land unset means in-memory only (the default). */
33
+ target;
34
+ /** No path = in-memory only; a string turns persistence on from birth. */
34
35
  constructor(filePath) {
35
- this.filePath = filePath;
36
+ this.target = filePath;
37
+ }
38
+ /**
39
+ * Turn on file persistence — the replay lane. A distribution that wants
40
+ * requests to survive the process calls this once at startup; no
41
+ * argument means the default path.
42
+ */
43
+ persistTo(filePath = defaultCapturePath()) {
44
+ this.target = filePath;
36
45
  }
37
46
  /** Stable reference between mutations — safe for useSyncExternalStore. */
38
47
  snapshot = () => this.entries;
@@ -47,8 +56,7 @@ export class CaptureLog {
47
56
  await this.persist();
48
57
  }
49
58
  async persist() {
50
- const target = this.filePath ??
51
- (process.env.NODE_ENV === "test" ? undefined : defaultCapturePath());
59
+ const target = this.target;
52
60
  if (target === undefined)
53
61
  return;
54
62
  try {
@@ -70,6 +78,9 @@ export class CaptureLog {
70
78
  }
71
79
  }
72
80
  }
73
- /** The one log — module-level so the CLI process and TUI session share it. */
81
+ /**
82
+ * The one log — module-level so the CLI process and TUI session share it.
83
+ * In-memory only until a distribution opts into persistence at startup.
84
+ */
74
85
  export const captureLog = new CaptureLog();
75
86
  //# sourceMappingURL=capture.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"capture.js","sourceRoot":"","sources":["../../../src/api/capture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAI7B,+EAA+E;AAC/E,MAAM,WAAW,GAAG,GAAG,CAAC;AAOxB,MAAM,UAAU,kBAAkB;IAChC,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,oBAAoB,CAAC,CAAC;AAC/D,CAAC;AAED,MAAM,OAAO,UAAU;IAOQ;IANrB,OAAO,GAA8B,EAAE,CAAC;IAC/B,SAAS,GAAG,IAAI,GAAG,EAAc,CAAC;IACnD,wCAAwC;IAChC,QAAQ,GAAG,CAAC,CAAC;IAErB,wEAAwE;IACxE,YAA6B,QAAiB;QAAjB,aAAQ,GAAR,QAAQ,CAAS;IAAG,CAAC;IAElD,0EAA0E;IAC1E,QAAQ,GAAG,GAA8B,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC;IAEzD,SAAS,GAAG,CAAC,QAAoB,EAAgB,EAAE;QACjD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC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F,KAAK,CAAC,GAAG,CAAC,KAAqB;QAC7B,IAAI,CAAC,OAAO,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,CAAC;QAC5D,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,SAAS;YAAE,QAAQ,EAAE,CAAC;QAClD,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;IACvB,CAAC;IAEO,KAAK,CAAC,OAAO;QACnB,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,IAAI,MAAM,KAAK,SAAS;YAAE,OAAO;QACjC,IAAI,CAAC;YACH,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;YACpE,oEAAoE;YACpE,oEAAoE;YACpE,qEAAqE;YACrE,sEAAsE;YACtE,iEAAiE;YACjE,MAAM,SAAS,GAAG,GAAG,MAAM,IAAI,OAAO,CAAC,GAAG,IAAI,EAAE,IAAI,CAAC,QAAQ,MAAM,CAAC;YACpE,MAAM,SAAS,CAAC,SAAS,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE;gBACvE,QAAQ,EAAE,MAAM;gBAChB,IAAI,EAAE,KAAK;aACZ,CAAC,CAAC;YACH,MAAM,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAClC,CAAC;QAAC,MAAM,CAAC;YACP,iEAAiE;QACnE,CAAC;IACH,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The engine-page lane — which flavor of the runtime's authoring surface
3
+ * (the AGENTS page and the skills index) this process asks for.
4
+ *
5
+ * The stock build sends no query parameters at all and relies on the
6
+ * server's defaults; the only client-side rule is the echo check — a page
7
+ * whose echoed audience is not one this build accepts is refused rather
8
+ * than written into a checkout (that is how an older engine that defaults
9
+ * to a different page gets caught). A distribution can pin its own lane at
10
+ * startup, before the first pull, and every fetch after that carries it.
11
+ */
12
+ export interface PageLane {
13
+ /** Extra query parameters for `/agents-md` and `/skills` reads. */
14
+ query: Readonly<Record<string, string>>;
15
+ /** The audience echoes this build accepts on the AGENTS page. */
16
+ acceptedEchoes: readonly string[];
17
+ }
18
+ export declare function setPageLane(next: PageLane): void;
19
+ export declare function pageLane(): PageLane;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The engine-page lane — which flavor of the runtime's authoring surface
3
+ * (the AGENTS page and the skills index) this process asks for.
4
+ *
5
+ * The stock build sends no query parameters at all and relies on the
6
+ * server's defaults; the only client-side rule is the echo check — a page
7
+ * whose echoed audience is not one this build accepts is refused rather
8
+ * than written into a checkout (that is how an older engine that defaults
9
+ * to a different page gets caught). A distribution can pin its own lane at
10
+ * startup, before the first pull, and every fetch after that carries it.
11
+ */
12
+ let lane = {
13
+ query: {},
14
+ // `headless` is the pre-rename spelling of the same page on older engines.
15
+ acceptedEchoes: ["public", "headless"],
16
+ };
17
+ export function setPageLane(next) {
18
+ lane = {
19
+ query: Object.freeze({ ...next.query }),
20
+ acceptedEchoes: [...next.acceptedEchoes],
21
+ };
22
+ }
23
+ export function pageLane() {
24
+ return lane;
25
+ }
26
+ //# sourceMappingURL=lane.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lane.js","sourceRoot":"","sources":["../../../src/api/lane.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AASH,IAAI,IAAI,GAAa;IACnB,KAAK,EAAE,EAAE;IACT,2EAA2E;IAC3E,cAAc,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC;CACvC,CAAC;AAEF,MAAM,UAAU,WAAW,CAAC,IAAc;IACxC,IAAI,GAAG;QACL,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;QACvC,cAAc,EAAE,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC;KACzC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,QAAQ;IACtB,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -62,11 +62,10 @@ export interface SkillFile {
62
62
  export interface AgentsMd {
63
63
  content: string;
64
64
  /**
65
- * Which page this is — echoed by engines that ship per-audience pages, in
66
- * the spelling the caller asked with (`public`, or `headless` on engines
67
- * that predate the rename). Absent on older engines, which ignore the
68
- * query and always serve the internal page; a public caller MUST check
69
- * this before trusting the content.
65
+ * Which page this is — echoed by engines that ship per-audience pages
66
+ * (`public`, or `headless` on engines that predate the rename). Absent on
67
+ * older engines that serve a single page; a caller MUST check this
68
+ * against the lane's accepted echoes before trusting the content.
70
69
  */
71
70
  audience?: string;
72
71
  }
@@ -116,25 +115,20 @@ export declare class RuntimeApiClient {
116
115
  listMessages(threadId: string): Promise<Message[]>;
117
116
  threadTrace(threadId: string): Promise<RuntimeTrace[]>;
118
117
  interactionTrace(interactionId: string): Promise<RuntimeTrace>;
119
- interactionDebug(interactionId: string): Promise<Record<string, unknown>>;
120
118
  listSkills(): Promise<SkillIndexItem[]>;
121
119
  getSkill(skillId: string, file?: string): Promise<SkillFile>;
122
120
  /**
123
- * The checkout's standing brief the self-contained public page, which is
124
- * the only page this wire serves (the public floor,
125
- * docs/authoring-modes-design.md §3.3; the internal page ships inside the
126
- * runtime package and never rides this endpoint). Not a skill: it belongs
127
- * at the checkout root, so it has its own endpoint rather than a slot in
128
- * the skills index.
121
+ * The checkout's standing brief. Not a skill: it belongs at the checkout
122
+ * root, so it has its own endpoint rather than a slot in the skills index.
129
123
  *
130
- * Compatibility, oldest engine first: engines older than the endpoint
131
- * answer 404; engines older than the public page ignore the query and
132
- * serve their internal page see `AgentsMd.audience`, the echo that
133
- * unmasks them; engines older than the RENAME validate the audience
134
- * against the legacy spellings and refuse `public` with a 422 those get
135
- * one retry as `headless`, the same page under its pre-rename name.
124
+ * The stock build sends no query and takes the server's default page;
125
+ * which pages this build accepts is the lane's echo check, applied by the
126
+ * caller (skills/agents-page.ts) a page whose echoed audience is not
127
+ * accepted is refused rather than written into a checkout, which is how
128
+ * an engine that defaults to a different page gets caught. Engines older
129
+ * than the endpoint answer 404.
136
130
  */
137
- getAgentsMd(audience?: "public"): Promise<AgentsMd>;
131
+ getAgentsMd(): Promise<AgentsMd>;
138
132
  getProgramSchemas(file?: string): Promise<Record<string, unknown>>;
139
133
  validateProgram(bundle: Record<string, unknown>): Promise<{
140
134
  valid: boolean;
@@ -1,4 +1,4 @@
1
- import { ApiError } from "../errors/index.js";
1
+ import { pageLane } from "./lane.js";
2
2
  /**
3
3
  * A send is synchronous on the wire — the response IS the agent's turn, and
4
4
  * normal turn latency can exceed the 60s transport default (REPORTS-27).
@@ -81,11 +81,10 @@ export class RuntimeApiClient {
81
81
  interactionTrace(interactionId) {
82
82
  return this.http.request(`/messaging/v1/interactions/${interactionId}/trace`);
83
83
  }
84
- interactionDebug(interactionId) {
85
- return this.http.request(`/api/v1/interactions/${interactionId}/debug`);
86
- }
87
84
  listSkills() {
88
- return this.http.request("/api/v1/skills");
85
+ return this.http.request("/api/v1/skills", {
86
+ query: { ...pageLane().query },
87
+ });
89
88
  }
90
89
  getSkill(skillId, file) {
91
90
  return this.http.request(`/api/v1/skills/${encodeURIComponent(skillId)}`, {
@@ -93,34 +92,20 @@ export class RuntimeApiClient {
93
92
  });
94
93
  }
95
94
  /**
96
- * The checkout's standing brief the self-contained public page, which is
97
- * the only page this wire serves (the public floor,
98
- * docs/authoring-modes-design.md §3.3; the internal page ships inside the
99
- * runtime package and never rides this endpoint). Not a skill: it belongs
100
- * at the checkout root, so it has its own endpoint rather than a slot in
101
- * the skills index.
95
+ * The checkout's standing brief. Not a skill: it belongs at the checkout
96
+ * root, so it has its own endpoint rather than a slot in the skills index.
102
97
  *
103
- * Compatibility, oldest engine first: engines older than the endpoint
104
- * answer 404; engines older than the public page ignore the query and
105
- * serve their internal page see `AgentsMd.audience`, the echo that
106
- * unmasks them; engines older than the RENAME validate the audience
107
- * against the legacy spellings and refuse `public` with a 422 those get
108
- * one retry as `headless`, the same page under its pre-rename name.
98
+ * The stock build sends no query and takes the server's default page;
99
+ * which pages this build accepts is the lane's echo check, applied by the
100
+ * caller (skills/agents-page.ts) a page whose echoed audience is not
101
+ * accepted is refused rather than written into a checkout, which is how
102
+ * an engine that defaults to a different page gets caught. Engines older
103
+ * than the endpoint answer 404.
109
104
  */
110
- async getAgentsMd(audience) {
111
- try {
112
- return await this.http.request("/api/v1/agents-md", {
113
- query: { audience },
114
- });
115
- }
116
- catch (error) {
117
- if (audience && error instanceof ApiError && error.status === 422) {
118
- return this.http.request("/api/v1/agents-md", {
119
- query: { audience: "headless" },
120
- });
121
- }
122
- throw error;
123
- }
105
+ getAgentsMd() {
106
+ return this.http.request("/api/v1/agents-md", {
107
+ query: { ...pageLane().query },
108
+ });
124
109
  }
125
110
  getProgramSchemas(file) {
126
111
  return this.http.request("/api/v1/programs/schema", {
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-api.js","sourceRoot":"","sources":["../../../src/api/runtime-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAuF9C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,OAAO,CAAC;AAEvC,MAAM,OAAO,gBAAgB;IACS;IAApC,YAAoC,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAEjD,MAAM;QACX,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACtC,CAAC;IAEM,WAAW,CAChB,OAA2B,EAC3B,KAAyB;QAEzB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,wBAAwB,EAAE;YACjD,MAAM,EAAE,MAAM;YACd,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,KAAK,EAAE;SAC/B,CAAC,CAAC;IACL,CAAC;IAEM,iBAAiB,CAAC,IAAa;QACpC,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,yBAAyB,EAAE;YAClD,KAAK,EAAE,EAAE,IAAI,EAAE;SAChB,CAAC,CAAC;IACL,CAAC;IAEM,eAAe,CAAC,MAA+B;QAQpD,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,2BAA2B,EAAE;YACpD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,EAAE,MAAM,EAAE;SACjB,CAAC,CAAC;IACL,CAAC;IAED;iFAC6E;IACtE,cAAc,CACnB,MAA+B,EAC/B,SAAqB;QAUrB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,0BAA0B,EAAE;YACnD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE;SACpE,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -22,6 +22,10 @@ export interface TransportOptions {
22
22
  */
23
23
  timeoutExplicit?: boolean;
24
24
  token?: string;
25
+ /** Shared so a refresh on one client is visible to the others. */
26
+ tokenHolder?: {
27
+ current?: string;
28
+ };
25
29
  orgId?: string;
26
30
  userId?: string;
27
31
  orgHeader?: string;
@@ -70,9 +74,11 @@ export interface RequestOptions {
70
74
  export declare class Transport {
71
75
  private readonly options;
72
76
  readonly captures: RequestCapture[];
73
- private token?;
77
+ private readonly tokenHolder;
74
78
  private readonly fetchImpl;
75
79
  constructor(options: TransportOptions);
80
+ private get token();
81
+ private set token(value);
76
82
  request<T>(path: string, requestOptions?: RequestOptions): Promise<T>;
77
83
  private perform;
78
84
  private apiError;