@aui.io/apollo 0.1.21 → 0.1.25
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.
- package/README.md +183 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/bundles.js +34 -9
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/bundles.js.map +1 -1
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/curl.d.ts +10 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/curl.js +63 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/curl.js.map +1 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/doctor.d.ts +13 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/doctor.js +89 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/doctor.js.map +1 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/hierarchy.js +24 -7
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/hierarchy.js.map +1 -1
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/runtime-version.d.ts +10 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/runtime-version.js +116 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/runtime-version.js.map +1 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/scenarios.js +3 -3
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/scenarios.js.map +1 -1
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/status.js +1 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/status.js.map +1 -1
- package/node_modules/@aui.io/apollo-cli/dist/src/index.d.ts +1 -0
- package/node_modules/@aui.io/apollo-cli/dist/src/index.js +26 -1
- package/node_modules/@aui.io/apollo-cli/dist/src/index.js.map +1 -1
- package/node_modules/@aui.io/apollo-cli/package.json +3 -3
- package/node_modules/@aui.io/apollo-core/dist/src/api/agent-settings.d.ts +166 -26
- package/node_modules/@aui.io/apollo-core/dist/src/api/agent-settings.js +106 -20
- package/node_modules/@aui.io/apollo-core/dist/src/api/agent-settings.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/api/capture.d.ts +22 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/capture.js +75 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/capture.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/management.d.ts +0 -1
- package/node_modules/@aui.io/apollo-core/dist/src/api/management.js +0 -6
- package/node_modules/@aui.io/apollo-core/dist/src/api/management.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/api/network.d.ts +19 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/network.js +53 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/network.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/transport.d.ts +14 -2
- package/node_modules/@aui.io/apollo-core/dist/src/api/transport.js +15 -28
- package/node_modules/@aui.io/apollo-core/dist/src/api/transport.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/config/index.d.ts +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/config/index.js +16 -1
- package/node_modules/@aui.io/apollo-core/dist/src/config/index.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/config/store.d.ts +10 -0
- package/node_modules/@aui.io/apollo-core/dist/src/config/store.js +24 -0
- package/node_modules/@aui.io/apollo-core/dist/src/config/store.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/config/types.d.ts +18 -1
- package/node_modules/@aui.io/apollo-core/dist/src/index.d.ts +10 -5
- package/node_modules/@aui.io/apollo-core/dist/src/index.js +9 -4
- package/node_modules/@aui.io/apollo-core/dist/src/index.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/runtime-version/index.d.ts +72 -0
- package/node_modules/@aui.io/apollo-core/dist/src/runtime-version/index.js +114 -0
- package/node_modules/@aui.io/apollo-core/dist/src/runtime-version/index.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/bundles.d.ts +47 -1
- package/node_modules/@aui.io/apollo-core/dist/src/services/bundles.js +60 -6
- package/node_modules/@aui.io/apollo-core/dist/src/services/bundles.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/services/clients.d.ts +4 -1
- package/node_modules/@aui.io/apollo-core/dist/src/services/clients.js +19 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/clients.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/services/doctor.d.ts +39 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/doctor.js +586 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/doctor.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/hierarchy.d.ts +78 -2
- package/node_modules/@aui.io/apollo-core/dist/src/services/hierarchy.js +177 -17
- package/node_modules/@aui.io/apollo-core/dist/src/services/hierarchy.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/services/requests.d.ts +22 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/requests.js +73 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/requests.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/scenarios.d.ts +15 -8
- package/node_modules/@aui.io/apollo-core/dist/src/services/scenarios.js +80 -58
- package/node_modules/@aui.io/apollo-core/dist/src/services/scenarios.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/services/status.service.d.ts +2 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/status.service.js +10 -2
- package/node_modules/@aui.io/apollo-core/dist/src/services/status.service.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/package.json +1 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/actions/registry.js +16 -2
- package/node_modules/@aui.io/apollo-tui/dist/src/actions/registry.js.map +1 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/activity/ActivityDrawer.js +31 -16
- package/node_modules/@aui.io/apollo-tui/dist/src/activity/ActivityDrawer.js.map +1 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/activity/requests.d.ts +19 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/activity/requests.js +29 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/activity/requests.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/author/AuthorHome.d.ts +3 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/author/AuthorHome.js +6 -18
- package/node_modules/@aui.io/apollo-tui/dist/src/author/AuthorHome.js.map +1 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/author/ResourcesView.js +26 -4
- package/node_modules/@aui.io/apollo-tui/dist/src/author/ResourcesView.js.map +1 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/context/ContextSwitcher.js +6 -2
- package/node_modules/@aui.io/apollo-tui/dist/src/context/ContextSwitcher.js.map +1 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/actions.js +95 -16
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/actions.js.map +1 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/commands.d.ts +1 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/commands.js +20 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/commands.js.map +1 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/diagnostics.d.ts +8 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/diagnostics.js +109 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/diagnostics.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/scope.d.ts +2 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/scope.js +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/scope.js.map +1 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/opentui-app.js +2 -2
- package/node_modules/@aui.io/apollo-tui/dist/src/opentui-app.js.map +1 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/shell/Breadcrumb.d.ts +4 -2
- package/node_modules/@aui.io/apollo-tui/dist/src/shell/Breadcrumb.js +5 -3
- package/node_modules/@aui.io/apollo-tui/dist/src/shell/Breadcrumb.js.map +1 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/ui/SplashCard.d.ts +5 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/ui/SplashCard.js +56 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/ui/SplashCard.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/ui/wordmark.d.ts +73 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/ui/wordmark.js +488 -0
- package/node_modules/@aui.io/apollo-tui/dist/src/ui/wordmark.js.map +1 -0
- package/node_modules/@aui.io/apollo-tui/package.json +2 -2
- package/package.json +4 -4
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
import { type CaptureSink } from "./capture.js";
|
|
1
2
|
export interface RequestCapture {
|
|
3
|
+
/** Optional on the type so entries from older capture files still parse. */
|
|
4
|
+
service?: string;
|
|
5
|
+
/** ISO timestamp taken when the request started. */
|
|
6
|
+
at?: string;
|
|
2
7
|
method: string;
|
|
3
8
|
url: string;
|
|
4
9
|
headers: Record<string, string>;
|
|
@@ -20,9 +25,17 @@ export interface TransportOptions {
|
|
|
20
25
|
orgId?: string;
|
|
21
26
|
userId?: string;
|
|
22
27
|
orgHeader?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Headers sent on every request to this service (a per-request header of
|
|
30
|
+
* the same name still wins). Carries the runtime pin — `runtime-version`
|
|
31
|
+
* is a GATEWAY ROUTING header, so it has to ride every call rather than
|
|
32
|
+
* being set by the handful of endpoints that happen to care.
|
|
33
|
+
*/
|
|
34
|
+
headers?: Record<string, string>;
|
|
23
35
|
fetch?: typeof globalThis.fetch;
|
|
24
36
|
refresh?: () => Promise<string>;
|
|
25
|
-
|
|
37
|
+
/** Capture destination — defaults to the shared log; `false` opts out. */
|
|
38
|
+
captureSink?: CaptureSink | false;
|
|
26
39
|
authHeader?: string;
|
|
27
40
|
}
|
|
28
41
|
/** One file part of a multipart request. */
|
|
@@ -62,6 +75,5 @@ export declare class Transport {
|
|
|
62
75
|
constructor(options: TransportOptions);
|
|
63
76
|
request<T>(path: string, requestOptions?: RequestOptions): Promise<T>;
|
|
64
77
|
private perform;
|
|
65
|
-
private persistCaptures;
|
|
66
78
|
private apiError;
|
|
67
79
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { mkdir, rename, writeFile } from "node:fs/promises";
|
|
2
|
-
import { homedir } from "node:os";
|
|
3
|
-
import path from "node:path";
|
|
4
1
|
import { ApiError, AuthError, CliError } from "../errors/index.js";
|
|
2
|
+
import { captureLog } from "./capture.js";
|
|
5
3
|
export class Transport {
|
|
6
4
|
options;
|
|
7
5
|
captures = [];
|
|
@@ -56,7 +54,10 @@ export class Transport {
|
|
|
56
54
|
if (value !== undefined)
|
|
57
55
|
url.searchParams.append(key, String(value));
|
|
58
56
|
}
|
|
59
|
-
const headers = new Headers(
|
|
57
|
+
const headers = new Headers(this.options.headers);
|
|
58
|
+
for (const [key, value] of Object.entries(requestOptions.headers ?? {})) {
|
|
59
|
+
headers.set(key, value);
|
|
60
|
+
}
|
|
60
61
|
headers.set("accept", "application/json");
|
|
61
62
|
if (authenticated && this.token !== undefined) {
|
|
62
63
|
const authHeader = this.options.authHeader ?? "authorization";
|
|
@@ -100,6 +101,8 @@ export class Transport {
|
|
|
100
101
|
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
101
102
|
const started = performance.now();
|
|
102
103
|
const capture = {
|
|
104
|
+
service: this.options.service,
|
|
105
|
+
at: new Date().toISOString(),
|
|
103
106
|
method,
|
|
104
107
|
url: url.toString(),
|
|
105
108
|
headers: redactHeaders(headers),
|
|
@@ -142,27 +145,9 @@ export class Transport {
|
|
|
142
145
|
this.captures.push(capture);
|
|
143
146
|
if (this.captures.length > 50)
|
|
144
147
|
this.captures.shift();
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
async persistCaptures() {
|
|
149
|
-
const configured = this.options.capturePath;
|
|
150
|
-
const target = configured === false || (configured === undefined && process.env.NODE_ENV === "test")
|
|
151
|
-
? undefined
|
|
152
|
-
: configured ?? path.join(homedir(), ".apollo", "last-requests.json");
|
|
153
|
-
if (!target)
|
|
154
|
-
return;
|
|
155
|
-
try {
|
|
156
|
-
await mkdir(path.dirname(target), { recursive: true, mode: 0o700 });
|
|
157
|
-
const temporary = `${target}.${process.pid}.tmp`;
|
|
158
|
-
await writeFile(temporary, `${JSON.stringify(this.captures, null, 2)}\n`, {
|
|
159
|
-
encoding: "utf8",
|
|
160
|
-
mode: 0o600,
|
|
161
|
-
});
|
|
162
|
-
await rename(temporary, target);
|
|
163
|
-
}
|
|
164
|
-
catch {
|
|
165
|
-
// Request capture must never make a successful API request fail.
|
|
148
|
+
const sink = this.options.captureSink;
|
|
149
|
+
if (sink !== false)
|
|
150
|
+
await (sink ?? captureLog).add(capture);
|
|
166
151
|
}
|
|
167
152
|
}
|
|
168
153
|
async apiError(path, response) {
|
|
@@ -230,8 +215,10 @@ function redact(value, key = "") {
|
|
|
230
215
|
return value;
|
|
231
216
|
}
|
|
232
217
|
function isSensitive(key) {
|
|
233
|
-
// `value` covers vault secret bodies
|
|
234
|
-
//
|
|
235
|
-
|
|
218
|
+
// `value` covers vault secret bodies and `password` the login OTP (the
|
|
219
|
+
// identity API names the code `password`) — neither may land in the
|
|
220
|
+
// on-disk request capture (`~/.apollo/last-requests.json`), which
|
|
221
|
+
// `apollo curl` prints back verbatim.
|
|
222
|
+
return /authorization|token|key|secret|password|^value$/i.test(key);
|
|
236
223
|
}
|
|
237
224
|
//# sourceMappingURL=transport.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.js","sourceRoot":"","sources":["../../../src/api/transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"transport.js","sourceRoot":"","sources":["../../../src/api/transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,Q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Aa,CAAC,OAAgB;IACrC,OAAO,MAAM,CAAC,WAAW,CACvB,CAAC,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;QAC3C,GAAG;QACH,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK;KACjC,CAAC,CACH,CAAC;AACJ,CAAC;AAED,SAAS,MAAM,CAAC,KAAc,EAAE,GAAG,GAAG,EAAE;IACtC,IAAI,WAAW,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IACnC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IACnE,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAChD,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,UAAU,CAAC,EAAE,EAAE,CAAC;YACpD,QAAQ;YACR,MAAM,CAAC,UAAU,EAAE,QAAQ,CAAC;SAC7B,CAAC,CACH,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,WAAW,CAAC,GAAW;IAC9B,uEAAuE;IACvE,oEAAoE;IACpE,kEAAkE;IAClE,sCAAsC;IACtC,OAAO,kDAAkD,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACtE,CAAC"}
|
|
@@ -8,4 +8,4 @@ export interface ResolveConfigOptions {
|
|
|
8
8
|
export declare function parseEnvironment(value: string): Environment;
|
|
9
9
|
export declare function resolveContext(options?: ResolveConfigOptions): Promise<Context>;
|
|
10
10
|
export type { BaseUrls, ConfigFlags, Context, Credential, CredentialsFile, Environment, ProjectBinding, UserConfig, WorkspacePreferences, } from "./types.js";
|
|
11
|
-
export { apolloDir, defaultProject, findBinding, readBinding, readCredentials, readUserConfig, setDefaultProject, updateEnvironment, updateProfile, writeCredentials, writeBinding, writeUserConfig, } from "./store.js";
|
|
11
|
+
export { apolloDir, defaultProject, findBinding, patchBinding, readBinding, readCredentials, readUserConfig, setDefaultProject, updateEnvironment, updateProfile, writeCredentials, writeBinding, writeUserConfig, } from "./store.js";
|
|
@@ -13,6 +13,7 @@ const environmentUrls = {
|
|
|
13
13
|
vault: "https://api-staging-v3.internal-aui.io/apollo-api-legacy",
|
|
14
14
|
kbm: "https://api-staging-v3.internal-aui.io/knowledge-base-manager",
|
|
15
15
|
agentSettings: "https://api-staging-v3.internal-aui.io/agent-settings",
|
|
16
|
+
network: "https://api-staging-v3.internal-aui.io/api/network",
|
|
16
17
|
},
|
|
17
18
|
production: {
|
|
18
19
|
identity: "https://api-v3.aui.io/api",
|
|
@@ -22,6 +23,7 @@ const environmentUrls = {
|
|
|
22
23
|
vault: "https://api-v3.aui.io/apollo-api-legacy",
|
|
23
24
|
kbm: "https://api-v3.aui.io/knowledge-base-manager",
|
|
24
25
|
agentSettings: "https://api-v3.aui.io/agent-settings",
|
|
26
|
+
network: "https://api-v3.aui.io/api/network",
|
|
25
27
|
},
|
|
26
28
|
eu: {
|
|
27
29
|
identity: "https://api-eu-v3.aui.io/api",
|
|
@@ -31,6 +33,7 @@ const environmentUrls = {
|
|
|
31
33
|
vault: "https://api-eu-v3.aui.io/apollo-api-legacy",
|
|
32
34
|
kbm: "https://api-eu-v3.aui.io/knowledge-base-manager",
|
|
33
35
|
agentSettings: "https://api-eu-v3.aui.io/agent-settings",
|
|
36
|
+
network: "https://api-eu-v3.aui.io/api/network",
|
|
34
37
|
},
|
|
35
38
|
};
|
|
36
39
|
export function parseEnvironment(value) {
|
|
@@ -68,6 +71,9 @@ export async function resolveContext(options = {}) {
|
|
|
68
71
|
const claims = decodeJwtClaims(token);
|
|
69
72
|
const timeoutRaw = flags.timeout ?? env.APOLLO_TIMEOUT_MS;
|
|
70
73
|
const timeoutMs = parseTimeout(timeoutRaw);
|
|
74
|
+
const runtimeVersion = trimmed(flags.runtimeVersion ??
|
|
75
|
+
env.APOLLO_RUNTIME_VERSION ??
|
|
76
|
+
binding?.runtime_version);
|
|
71
77
|
const defaults = environmentUrls[environment];
|
|
72
78
|
return Object.freeze({
|
|
73
79
|
environment,
|
|
@@ -80,6 +86,7 @@ export async function resolveContext(options = {}) {
|
|
|
80
86
|
vault: stripSlash(env.APOLLO_VAULT_URL ?? defaults.vault),
|
|
81
87
|
kbm: stripSlash(env.APOLLO_KBM_URL ?? defaults.kbm),
|
|
82
88
|
agentSettings: stripSlash(env.APOLLO_AGENT_SETTINGS_URL ?? defaults.agentSettings),
|
|
89
|
+
network: stripSlash(env.APOLLO_NETWORK_URL ?? defaults.network),
|
|
83
90
|
}),
|
|
84
91
|
...(flags.org ?? env.APOLLO_ORG_ID ?? binding?.org_id ?? claims.organizationId
|
|
85
92
|
? {
|
|
@@ -104,6 +111,9 @@ export async function resolveContext(options = {}) {
|
|
|
104
111
|
...(binding?.version_tag === undefined
|
|
105
112
|
? {}
|
|
106
113
|
: { versionTag: binding.version_tag }),
|
|
114
|
+
// The pin is per checkout; the flag and env var override it for one
|
|
115
|
+
// command without ever being written back to `.apollorc`.
|
|
116
|
+
...(runtimeVersion === undefined ? {} : { runtimeVersion }),
|
|
107
117
|
...(token === undefined ? {} : { token }),
|
|
108
118
|
...(credential?.user_id ?? claims.userId
|
|
109
119
|
? { userId: credential?.user_id ?? claims.userId }
|
|
@@ -129,6 +139,11 @@ function parseTimeout(value) {
|
|
|
129
139
|
function stripSlash(value) {
|
|
130
140
|
return value.replace(/\/+$/, "");
|
|
131
141
|
}
|
|
142
|
+
/** Blank env vars and blank `.apollorc` fields mean "unset", not "empty". */
|
|
143
|
+
function trimmed(value) {
|
|
144
|
+
const text = value?.trim();
|
|
145
|
+
return text ? text : undefined;
|
|
146
|
+
}
|
|
132
147
|
function decodeJwtClaims(token) {
|
|
133
148
|
if (token === undefined)
|
|
134
149
|
return {};
|
|
@@ -150,5 +165,5 @@ function decodeJwtClaims(token) {
|
|
|
150
165
|
return {};
|
|
151
166
|
}
|
|
152
167
|
}
|
|
153
|
-
export { apolloDir, defaultProject, findBinding, readBinding, readCredentials, readUserConfig, setDefaultProject, updateEnvironment, updateProfile, writeCredentials, writeBinding, writeUserConfig, } from "./store.js";
|
|
168
|
+
export { apolloDir, defaultProject, findBinding, patchBinding, readBinding, readCredentials, readUserConfig, setDefaultProject, updateEnvironment, updateProfile, writeCredentials, writeBinding, writeUserConfig, } from "./store.js";
|
|
154
169
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EACL,cAAc,EACd,WAAW,EACX,eAAe,EACf,cAAc,GACf,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,YAAY,GAKb,MAAM,YAAY,CAAC;AAEpB,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAElC,MAAM,eAAe,GAAkC;IACrD,OAAO,EAAE;QACP,QAAQ,EAAE,4CAA4C;QACtD,UAAU,EAAE,mDAAmD;QAC/D,OAAO,EAAE,gDAAgD;QACzD,MAAM,EAAE,oDAAoD;QAC5D,KAAK,EAAE,0DAA0D;QACjE,GAAG,EAAE,+DAA+D;QACpE,aAAa,EAAE,uDAAuD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,IA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;IACnC,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACpC,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,EAAE,CAAC;IACrC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CACvB,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CACxB,CAAC;QAC7B,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,GAAG,CAAC;QAC3C,MAAM,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;QAC7C,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,UAAU,CAAC;QACxD,OAAO;YACL,GAAG,CAAC,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACjD,GAAG,CAAC,OAAO,cAAc,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACjE,GAAG,CAAC,OAAO,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACxD,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAaD,OAAO,EACL,SAAS,EACT,cAAc,EACd,WAAW,EACX,YAAY,EACZ,WAAW,EACX,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,eAAe,GAChB,MAAM,YAAY,CAAC"}
|
|
@@ -10,6 +10,16 @@ export declare function readBinding(cwd: string): Promise<{
|
|
|
10
10
|
path?: string;
|
|
11
11
|
}>;
|
|
12
12
|
export declare function writeBinding(path: string, binding: ProjectBinding): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Merge a patch into an existing `.apollorc`, preserving every field the
|
|
15
|
+
* caller did not mention. Rewriting the whole binding from the command's
|
|
16
|
+
* context instead would silently drop anything that context does not carry
|
|
17
|
+
* — a `pull` would erase the checkout's runtime pin.
|
|
18
|
+
*
|
|
19
|
+
* A key present in the patch with value `undefined` DELETES it (that is how
|
|
20
|
+
* `agent unlink` clears the agent and tag); a key simply absent is kept.
|
|
21
|
+
*/
|
|
22
|
+
export declare function patchBinding(path: string, patch: Partial<ProjectBinding>): Promise<ProjectBinding>;
|
|
13
23
|
export declare function readUserConfig(homeDir: string): Promise<UserConfig>;
|
|
14
24
|
export declare function writeUserConfig(homeDir: string, config: UserConfig): Promise<void>;
|
|
15
25
|
export declare function readCredentials(homeDir: string): Promise<CredentialsFile>;
|
|
@@ -56,6 +56,30 @@ export async function readBinding(cwd) {
|
|
|
56
56
|
export async function writeBinding(path, binding) {
|
|
57
57
|
await writeJsonAtomic(path, binding, 0o600);
|
|
58
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Merge a patch into an existing `.apollorc`, preserving every field the
|
|
61
|
+
* caller did not mention. Rewriting the whole binding from the command's
|
|
62
|
+
* context instead would silently drop anything that context does not carry
|
|
63
|
+
* — a `pull` would erase the checkout's runtime pin.
|
|
64
|
+
*
|
|
65
|
+
* A key present in the patch with value `undefined` DELETES it (that is how
|
|
66
|
+
* `agent unlink` clears the agent and tag); a key simply absent is kept.
|
|
67
|
+
*/
|
|
68
|
+
export async function patchBinding(path, patch) {
|
|
69
|
+
const existing = (await readJson(path)) ?? {};
|
|
70
|
+
const merged = {
|
|
71
|
+
...existing,
|
|
72
|
+
...patch,
|
|
73
|
+
config_version: 1,
|
|
74
|
+
};
|
|
75
|
+
for (const key of Object.keys(patch)) {
|
|
76
|
+
if (patch[key] === undefined)
|
|
77
|
+
delete merged[key];
|
|
78
|
+
}
|
|
79
|
+
const binding = merged;
|
|
80
|
+
await writeBinding(path, binding);
|
|
81
|
+
return binding;
|
|
82
|
+
}
|
|
59
83
|
export async function readUserConfig(homeDir) {
|
|
60
84
|
return (await readJson(join(apolloDir(homeDir), "config.json"))) ?? {};
|
|
61
85
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../../src/config/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC3F,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAajD,KAAK,UAAU,QAAQ,CAAI,IAAY;IACrC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAM,CAAC;IACvD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,SAAS,CAAC,KAAK,CAAC;YAAE,OAAO,SAAS,CAAC;QACvC,IAAI,KAAK,YAAY,WAAW,EAAE,CAAC;YACjC,MAAM,IAAI,WAAW,CAAC,mBAAmB,IAAI,GAAG,CAAC,CAAC;QACpD,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED,SAAS,SAAS,CAAC,KAAc;IAC/B,OAAO,CACL,KAAK,YAAY,KAAK;QACtB,MAAM,IAAI,KAAK;QACd,KAA+B,CAAC,IAAI,KAAK,QAAQ,CACnD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,OAAe;IACvC,OAAO,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,KAAa;IA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
|
|
11
11
|
kbm: string;
|
|
12
|
-
/** agent-settings — scenarios
|
|
12
|
+
/** agent-settings — scenarios (build bundles, evaluation scores) + `agent create`. */
|
|
13
13
|
agentSettings: string;
|
|
14
|
+
/** network service — the network a new agent is scoped to (`agent create`). */
|
|
15
|
+
network: string;
|
|
14
16
|
}
|
|
15
17
|
export interface ProjectBinding {
|
|
16
18
|
config_version: 1;
|
|
@@ -18,6 +20,13 @@ export interface ProjectBinding {
|
|
|
18
20
|
project_id?: string;
|
|
19
21
|
agent_id?: string;
|
|
20
22
|
version_tag?: string;
|
|
23
|
+
/**
|
|
24
|
+
* The engine build this checkout runs against — the `runtime-version`
|
|
25
|
+
* header value (e.g. "0.2.4"), stamped at create/import and moved only by
|
|
26
|
+
* `apollo runtime use`. Absent means "whatever the gateway defaults to",
|
|
27
|
+
* which is how every checkout behaved before pinning existed.
|
|
28
|
+
*/
|
|
29
|
+
runtime_version?: string;
|
|
21
30
|
}
|
|
22
31
|
export interface UserConfig {
|
|
23
32
|
profile?: string;
|
|
@@ -54,6 +63,13 @@ export interface Context {
|
|
|
54
63
|
readonly projectId?: string;
|
|
55
64
|
readonly agentId?: string;
|
|
56
65
|
readonly versionTag?: string;
|
|
66
|
+
/**
|
|
67
|
+
* The effective runtime pin for this command — `--runtime-version`, else
|
|
68
|
+
* `APOLLO_RUNTIME_VERSION`, else the checkout's `.apollorc`. Sent as the
|
|
69
|
+
* `runtime-version` header on every runtime-api call; undefined lets the
|
|
70
|
+
* gateway pick.
|
|
71
|
+
*/
|
|
72
|
+
readonly runtimeVersion?: string;
|
|
57
73
|
readonly token?: string;
|
|
58
74
|
readonly userId?: string;
|
|
59
75
|
readonly timeoutMs: number;
|
|
@@ -72,4 +88,5 @@ export interface ConfigFlags {
|
|
|
72
88
|
org?: string;
|
|
73
89
|
project?: string;
|
|
74
90
|
timeout?: string;
|
|
91
|
+
runtimeVersion?: string;
|
|
75
92
|
}
|
|
@@ -8,28 +8,33 @@ export { VaultClient, type VaultScope, type VaultSecret, type VaultSecretCreate,
|
|
|
8
8
|
export { KbmClient, type BulkFilesResponse, type BulkResourceResult, type BulkWebsitesResponse, type IndexingJob, type KnowledgeBase, type UploadFilePart, } from "./api/kbm.js";
|
|
9
9
|
export { RuntimeApiClient, type AgentOverride, type Message, type RuntimeTrace, type SendMessageRequest, type SendMessageResponse, type SkillFile, type SkillIndexItem, type Thread, } from "./api/runtime-api.js";
|
|
10
10
|
export { Transport, type FormBody, type FormFilePart, type RequestCapture, type TransportOptions, } from "./api/transport.js";
|
|
11
|
-
export {
|
|
11
|
+
export { CaptureLog, captureLog, defaultCapturePath, type CaptureSink, } from "./api/capture.js";
|
|
12
|
+
export { AgentSettingsClient, type AgentBlobStats, type AgentRecord, type AgentRecordKind, type AgentRecordScope, type AgentVersionRecord, type RuntimeVersionRecord, type BuildBundle, type BuildBundleFile, type BuildBundlePullResponse, type BuildBundlePushResponse, type BundleUploadFile, type EvaluationScorePush, type EvaluationScoreRead, type Scenario, type ScenarioResult, type ScenarioResultStatus, type ScoreReportBlocks, } from "./api/agent-settings.js";
|
|
13
|
+
export { NetworkClient, type Network } from "./api/network.js";
|
|
12
14
|
export { diffHashes, isClean, readBaseline, writeBaseline, type Baseline, type FileDiff, } from "./bundle/baseline.js";
|
|
13
15
|
export { contentDigest, hashFiles, readProgramFiles, type ProgramFiles, } from "./bundle/files.js";
|
|
14
16
|
export { assembleBundle, bundleFileLayout, bundleFiles, writeBundleFiles, type BundleDocument, } from "./bundle/materialize.js";
|
|
15
17
|
export { assertValidProgram, mapRuntimeValidation, type RuntimeValidateResponse, type RuntimeValidationFinding, type ValidationFinding, type ValidationResult, } from "./bundle/validate.js";
|
|
16
18
|
export { parseEnvironment, resolveContext, type ResolveConfigOptions, } from "./config/index.js";
|
|
17
19
|
export { clearMockDbKeys, keyPrefixes, loadMockDbKeys, saveMockDbKeys, type MockDbKeys, } from "./config/mockdb-keys.js";
|
|
18
|
-
export { apolloDir, findBinding, readBinding, readCredentials, readUserConfig, updateEnvironment, updateProfile, writeBinding, writeCredentials, writeUserConfig, type ConfigPaths, } from "./config/store.js";
|
|
20
|
+
export { apolloDir, findBinding, patchBinding, readBinding, readCredentials, readUserConfig, updateEnvironment, updateProfile, writeBinding, writeCredentials, writeUserConfig, type ConfigPaths, } from "./config/store.js";
|
|
19
21
|
export { environments, type BaseUrls, type ConfigFlags, type Context, type Credential, type CredentialsFile, type Environment, type ProjectBinding, type UserConfig, type WorkspacePreferences, } from "./config/types.js";
|
|
20
22
|
export { ApiError, AuthError, CliError, ConfigError, ExitCode, ValidationError, toCliError, type ExitCodeValue, } from "./errors/index.js";
|
|
21
23
|
export { Output, errorEnvelope, successEnvelope, type ErrorEnvelope, type OutputOptions, } from "./output/index.js";
|
|
22
24
|
export { loginWithBrowser, loginWithOtp, loginWithToken, logout, requestOtp, } from "./services/auth.js";
|
|
23
|
-
export { importBundle, listVersions, localDiff, pullBundle, pushBundle, remoteDiff, validateLocalBundle, validateProgramBundle, } from "./services/bundles.js";
|
|
25
|
+
export { DEFAULT_SKILL_TARGETS, importBundle, listVersions, localDiff, pullBundle, pullCheckout, pushBundle, remoteDiff, validateLocalBundle, validateProgramBundle, type PullCheckoutOptions, type PullCheckoutResult, } from "./services/bundles.js";
|
|
24
26
|
export { createClients, type Clients } from "./services/clients.js";
|
|
25
27
|
export { listEnvironments, setEnvironment, type EnvironmentResult, type EnvironmentSummary, } from "./services/env.service.js";
|
|
26
|
-
export { bindAgent, createAgent, createProject, initialVersionTag, listAgents, listOrganizations, listProjects, unlinkAgent, useOrganization, useProject, useVersion, } from "./services/hierarchy.js";
|
|
28
|
+
export { agentRuntimeVersion, bindAgent, createAgent, createProject, initialVersionTag, latestPublishedRuntimeVersion, listAgents, listOrganizations, listProjects, TEMPLATE_AGENT_ID, unlinkAgent, useOrganization, useProject, useVersion, type AgentCreateClients, } from "./services/hierarchy.js";
|
|
29
|
+
export { isLegacyRuntime, latestRuntimeVersion, matchRuntimeVersion, resolveRuntimeVersion, runtimeVersionLabel, runtimeVersionOptions, RUNTIME_VERSION_HEADER, type ResolvedRuntimeVersion, type RuntimeVersionOption, } from "./runtime-version/index.js";
|
|
27
30
|
export { createThread, debugInteraction, getThread, listMessages, listThreads, parseVariables, sendMessage, trace, } from "./services/messaging.js";
|
|
28
31
|
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";
|
|
29
32
|
export { buildVaultScope, getSecretByName, listSecrets, parseVaultScopeLevel, removeSecretByName, scopeLevelLabel, setSecret, validateSecretName, vaultScopeLevels, type SetSecretParams, type VaultScopeLevel, type VaultServiceOptions, } from "./services/vault.js";
|
|
30
33
|
export { addFiles, addUrls, createHub, deleteHub, getHubByName, hubRefCheck, hubStatus, listHubs, programHubRefs, type HubStatus, type HubUploadResult, type KnowledgeServiceOptions, } from "./services/knowledge.js";
|
|
31
|
-
export { INTENT_DIR, REPORT_BLOCK_KEYS, SCENARIOS_DIR, SCENARIOS_FILE, SCORES_FILE, assembleBundleUpload, listIntentFiles, pullScenarios, pullScores, pushScenarioBundle, pushScores, readLocalScenarios, readLocalScores, scaffoldScenarios, scenariosPaths, scoresToPushBody, syncScenarios, validateScenariosFile, writeLocalScenarios, writeLocalScores, type AssembledBundle, type LocalScenario, type LocalScores, type PullScenariosResult, type PullScoresResult, type PushBundleResult, type PushScoresResult, type ScaffoldResult, type ScenariosFile, type ScenariosServiceOptions, type SyncScenariosResult, } from "./services/scenarios.js";
|
|
34
|
+
export { INTENT_DIR, REPORT_BLOCK_KEYS, SCENARIOS_DIR, SCENARIOS_FILE, SCORES_FILE, assembleBundleUpload, listBundleFiles, listIntentFiles, pullScenarios, pullScores, pushScenarioBundle, pushScores, readLocalScenarios, readLocalScores, scaffoldScenarios, scenariosPaths, scoresToPushBody, syncScenarios, validateScenariosFile, writeLocalScenarios, writeLocalScores, type AssembledBundle, type LocalScenario, type LocalScores, type PullScenariosResult, type PullScoresResult, type PushBundleResult, type PushScoresResult, type ScaffoldResult, type ScenariosFile, type ScenariosServiceOptions, type SyncScenariosResult, } from "./services/scenarios.js";
|
|
32
35
|
export { currentProfile, listProfiles, useProfile, type CurrentProfile, type ProfileSummary, } from "./services/profile.service.js";
|
|
36
|
+
export { captureFailed, filterCaptures, formatCurl, readCapturedRequests, type CaptureFilters, } from "./services/requests.js";
|
|
37
|
+
export { runDoctor, type DoctorCheck, type DoctorOptions, type DoctorReport, type DoctorSection, type DoctorStatus, } from "./services/doctor.js";
|
|
33
38
|
export { getStatus, type ServiceCheck, type StatusResult, } from "./services/status.service.js";
|
|
34
39
|
export { resolvePublishedVersion, upgradeCli, type NpmRunner, type UpgradeOptions, type UpgradeResult, } from "./services/upgrade.js";
|
|
35
40
|
export { enterCheckout, enterKnownCheckout, listKnownCheckouts, type EnteredCheckout, } from "./services/checkouts.service.js";
|
|
@@ -7,28 +7,33 @@ export { VaultClient, } from "./api/vault.js";
|
|
|
7
7
|
export { KbmClient, } from "./api/kbm.js";
|
|
8
8
|
export { RuntimeApiClient, } from "./api/runtime-api.js";
|
|
9
9
|
export { Transport, } from "./api/transport.js";
|
|
10
|
+
export { CaptureLog, captureLog, defaultCapturePath, } from "./api/capture.js";
|
|
10
11
|
export { AgentSettingsClient, } from "./api/agent-settings.js";
|
|
12
|
+
export { NetworkClient } from "./api/network.js";
|
|
11
13
|
export { diffHashes, isClean, readBaseline, writeBaseline, } from "./bundle/baseline.js";
|
|
12
14
|
export { contentDigest, hashFiles, readProgramFiles, } from "./bundle/files.js";
|
|
13
15
|
export { assembleBundle, bundleFileLayout, bundleFiles, writeBundleFiles, } from "./bundle/materialize.js";
|
|
14
16
|
export { assertValidProgram, mapRuntimeValidation, } from "./bundle/validate.js";
|
|
15
17
|
export { parseEnvironment, resolveContext, } from "./config/index.js";
|
|
16
18
|
export { clearMockDbKeys, keyPrefixes, loadMockDbKeys, saveMockDbKeys, } from "./config/mockdb-keys.js";
|
|
17
|
-
export { apolloDir, findBinding, readBinding, readCredentials, readUserConfig, updateEnvironment, updateProfile, writeBinding, writeCredentials, writeUserConfig, } from "./config/store.js";
|
|
19
|
+
export { apolloDir, findBinding, patchBinding, readBinding, readCredentials, readUserConfig, updateEnvironment, updateProfile, writeBinding, writeCredentials, writeUserConfig, } from "./config/store.js";
|
|
18
20
|
export { environments, } from "./config/types.js";
|
|
19
21
|
export { ApiError, AuthError, CliError, ConfigError, ExitCode, ValidationError, toCliError, } from "./errors/index.js";
|
|
20
22
|
export { Output, errorEnvelope, successEnvelope, } from "./output/index.js";
|
|
21
23
|
export { loginWithBrowser, loginWithOtp, loginWithToken, logout, requestOtp, } from "./services/auth.js";
|
|
22
|
-
export { importBundle, listVersions, localDiff, pullBundle, pushBundle, remoteDiff, validateLocalBundle, validateProgramBundle, } from "./services/bundles.js";
|
|
24
|
+
export { DEFAULT_SKILL_TARGETS, importBundle, listVersions, localDiff, pullBundle, pullCheckout, pushBundle, remoteDiff, validateLocalBundle, validateProgramBundle, } from "./services/bundles.js";
|
|
23
25
|
export { createClients } from "./services/clients.js";
|
|
24
26
|
export { listEnvironments, setEnvironment, } from "./services/env.service.js";
|
|
25
|
-
export { bindAgent, createAgent, createProject, initialVersionTag, listAgents, listOrganizations, listProjects, unlinkAgent, useOrganization, useProject, useVersion, } from "./services/hierarchy.js";
|
|
27
|
+
export { agentRuntimeVersion, bindAgent, createAgent, createProject, initialVersionTag, latestPublishedRuntimeVersion, listAgents, listOrganizations, listProjects, TEMPLATE_AGENT_ID, unlinkAgent, useOrganization, useProject, useVersion, } from "./services/hierarchy.js";
|
|
28
|
+
export { isLegacyRuntime, latestRuntimeVersion, matchRuntimeVersion, resolveRuntimeVersion, runtimeVersionLabel, runtimeVersionOptions, RUNTIME_VERSION_HEADER, } from "./runtime-version/index.js";
|
|
26
29
|
export { createThread, debugInteraction, getThread, listMessages, listThreads, parseVariables, sendMessage, trace, } from "./services/messaging.js";
|
|
27
30
|
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";
|
|
28
31
|
export { buildVaultScope, getSecretByName, listSecrets, parseVaultScopeLevel, removeSecretByName, scopeLevelLabel, setSecret, validateSecretName, vaultScopeLevels, } from "./services/vault.js";
|
|
29
32
|
export { addFiles, addUrls, createHub, deleteHub, getHubByName, hubRefCheck, hubStatus, listHubs, programHubRefs, } from "./services/knowledge.js";
|
|
30
|
-
export { INTENT_DIR, REPORT_BLOCK_KEYS, SCENARIOS_DIR, SCENARIOS_FILE, SCORES_FILE, assembleBundleUpload, listIntentFiles, pullScenarios, pullScores, pushScenarioBundle, pushScores, readLocalScenarios, readLocalScores, scaffoldScenarios, scenariosPaths, scoresToPushBody, syncScenarios, validateScenariosFile, writeLocalScenarios, writeLocalScores, } from "./services/scenarios.js";
|
|
33
|
+
export { INTENT_DIR, REPORT_BLOCK_KEYS, SCENARIOS_DIR, SCENARIOS_FILE, SCORES_FILE, assembleBundleUpload, listBundleFiles, listIntentFiles, pullScenarios, pullScores, pushScenarioBundle, pushScores, readLocalScenarios, readLocalScores, scaffoldScenarios, scenariosPaths, scoresToPushBody, syncScenarios, validateScenariosFile, writeLocalScenarios, writeLocalScores, } from "./services/scenarios.js";
|
|
31
34
|
export { currentProfile, listProfiles, useProfile, } from "./services/profile.service.js";
|
|
35
|
+
export { captureFailed, filterCaptures, formatCurl, readCapturedRequests, } from "./services/requests.js";
|
|
36
|
+
export { runDoctor, } from "./services/doctor.js";
|
|
32
37
|
export { getStatus, } from "./services/status.service.js";
|
|
33
38
|
export { resolvePublishedVersion, upgradeCli, } from "./services/upgrade.js";
|
|
34
39
|
export { enterCheckout, enterKnownCheckout, listKnownCheckouts, } from "./services/checkouts.service.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,yDAAyD;AAEzD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAG1C,OAAO,EACL,cAAc,EACd,YAAY,GAGb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,eAAe,GAQhB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,YAAY,GAOb,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,WAAW,GAIZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,SAAS,GAOV,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,gBAAgB,GASjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,SAAS,GAKV,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,mBAAmB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,yDAAyD;AAEzD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAG1C,OAAO,EACL,cAAc,EACd,YAAY,GAGb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,eAAe,GAQhB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,YAAY,GAOb,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,WAAW,GAIZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,SAAS,GAOV,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,gBAAgB,GASjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,SAAS,G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S,EACT,YAAY,EACZ,WAAW,EACX,SAAS,EACT,QAAQ,EACR,cAAc,GAIf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,WAAW,EACX,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,aAAa,EACb,UAAU,EACV,kBAAkB,EAClB,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,GAYjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,cAAc,EACd,YAAY,EACZ,UAAU,GAGX,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,aAAa,EACb,cAAc,EACd,UAAU,EACV,oBAAoB,GAErB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,SAAS,GAMV,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,SAAS,GAGV,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,uBAAuB,EACvB,UAAU,GAIX,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,kBAAkB,GAEnB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,aAAa,EAAoB,MAAM,qBAAqB,CAAC;AAEtE,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE1E,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,oBAAoB,EACpB,gBAAgB,EAChB,YAAY,EACZ,aAAa,GAEd,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which RUNTIME (engine build) a checkout is pinned to.
|
|
3
|
+
*
|
|
4
|
+
* The catalog lives in agent-settings (`GET /v1/runtime-versions`). Each
|
|
5
|
+
* record names a runtime FAMILY — `runtime_version` is the immutable family
|
|
6
|
+
* id ("0.2.0", "0.2.1" and "0.2.5" are all the 0.2 family) and
|
|
7
|
+
* `latest_version` is the exact build the gateway currently routes that
|
|
8
|
+
* family to. The build is what travels as the `runtime-version` header on
|
|
9
|
+
* every runtime-api call, and it is what `.apollorc` pins.
|
|
10
|
+
*
|
|
11
|
+
* Pinning a family therefore keeps following its patches: a checkout on 0.2
|
|
12
|
+
* re-resolves to whatever 0.2 build is current, and only a deliberate
|
|
13
|
+
* `apollo runtime use` moves it to a different family.
|
|
14
|
+
*
|
|
15
|
+
* Nothing here ever fails a command. An unreachable catalog leaves the pin
|
|
16
|
+
* unset, and an unpinned checkout behaves exactly as it did before runtime
|
|
17
|
+
* pinning existed: the gateway serves its own default route.
|
|
18
|
+
*/
|
|
19
|
+
import type { AgentSettingsClient, RuntimeVersionRecord } from "../api/agent-settings.js";
|
|
20
|
+
/** The HTTP header the gateway routes on. runtime-api itself never reads it. */
|
|
21
|
+
export declare const RUNTIME_VERSION_HEADER = "runtime-version";
|
|
22
|
+
/** A catalog record trimmed to what selection needs. */
|
|
23
|
+
export interface RuntimeVersionOption {
|
|
24
|
+
runtime_version: string;
|
|
25
|
+
latest_version: string;
|
|
26
|
+
display_name: string;
|
|
27
|
+
type: "published" | "custom";
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* True when the record names the LEGACY (schema-1) engine — the 1.x family,
|
|
31
|
+
* labelled "v1.0". It only ever serves schema-1 agent versions, so a
|
|
32
|
+
* runtime-v2 checkout must never resolve "latest" to it.
|
|
33
|
+
*/
|
|
34
|
+
export declare function isLegacyRuntime(option: RuntimeVersionOption): boolean;
|
|
35
|
+
/** Trim catalog records to selectable options; hidden records drop out. */
|
|
36
|
+
export declare function runtimeVersionOptions(records: RuntimeVersionRecord[]): RuntimeVersionOption[];
|
|
37
|
+
/**
|
|
38
|
+
* The catalog entry a stored value belongs to. Exact hits on `latest_version`
|
|
39
|
+
* (the current build) or `runtime_version` (the family id) win, then the
|
|
40
|
+
* display name — a pin written by another tool may carry the label ("v0.2"),
|
|
41
|
+
* whose family shares nothing with the record's id. Last, the PATCH NUMBER IS
|
|
42
|
+
* IGNORED: 0.2.0, 0.2.1 and 0.2.5 all resolve to the record naming the 0.2
|
|
43
|
+
* family. Custom runtimes have arbitrary names, so they only match exactly.
|
|
44
|
+
*/
|
|
45
|
+
export declare function matchRuntimeVersion(options: RuntimeVersionOption[], value: string | undefined): RuntimeVersionOption | undefined;
|
|
46
|
+
/** The display label for a raw build ("0.2.4" → "v0.2"); unknown shows as-is. */
|
|
47
|
+
export declare function runtimeVersionLabel(options: RuntimeVersionOption[], value: string): string;
|
|
48
|
+
/**
|
|
49
|
+
* The newest runtime a checkout should land on by default: the highest
|
|
50
|
+
* published family, legacy excluded. Custom entries are bespoke deployments
|
|
51
|
+
* and are never "the latest" — they are only ever pinned by name.
|
|
52
|
+
*/
|
|
53
|
+
export declare function latestRuntimeVersion(options: RuntimeVersionOption[]): RuntimeVersionOption | undefined;
|
|
54
|
+
export interface ResolvedRuntimeVersion {
|
|
55
|
+
/** The build to pin and send as the header. Undefined = no catalog answer. */
|
|
56
|
+
version?: string;
|
|
57
|
+
/** The catalog entry it resolved to, when there was one. */
|
|
58
|
+
option?: RuntimeVersionOption;
|
|
59
|
+
/** The catalog as fetched; empty when it could not be read. */
|
|
60
|
+
options: RuntimeVersionOption[];
|
|
61
|
+
/** Why the catalog was unusable, for a note rather than a failure. */
|
|
62
|
+
error?: string;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Read the catalog and name the runtime a NEW checkout should start on — the
|
|
66
|
+
* newest published family (see `latestRuntimeVersion`).
|
|
67
|
+
*
|
|
68
|
+
* Best-effort by design: this decorates create, import and the runtime
|
|
69
|
+
* commands, and none of those should fail because the catalog was
|
|
70
|
+
* unreachable. An error is reported, never thrown.
|
|
71
|
+
*/
|
|
72
|
+
export declare function resolveRuntimeVersion(client: Pick<AgentSettingsClient, "listRuntimeVersions">): Promise<ResolvedRuntimeVersion>;
|