@aui.io/apollo 0.1.66 → 0.1.67
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/node_modules/@aui.io/apollo-cli/dist/src/commands/bundles.js +37 -19
- 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/runtime-version.js +12 -1
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/runtime-version.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/clone.d.ts +100 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/clone.js +30 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/clone.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/retry.js +6 -3
- package/node_modules/@aui.io/apollo-core/dist/src/api/retry.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/api/transport.d.ts +15 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/transport.js +12 -4
- package/node_modules/@aui.io/apollo-core/dist/src/api/transport.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/index.d.ts +4 -2
- package/node_modules/@aui.io/apollo-core/dist/src/index.js +3 -1
- 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 +28 -1
- package/node_modules/@aui.io/apollo-core/dist/src/runtime-version/index.js +86 -7
- package/node_modules/@aui.io/apollo-core/dist/src/runtime-version/index.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/services/clients.d.ts +3 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/clients.js +19 -12
- 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/clone.d.ts +80 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/clone.js +129 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/clone.js.map +1 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/status.service.js +13 -7
- 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/lib/actions.js +25 -15
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/actions.js.map +1 -1
- package/node_modules/@aui.io/apollo-tui/package.json +2 -2
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.js","sourceRoot":"","sources":["../../../src/api/transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAoB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"transport.js","sourceRoot":"","sources":["../../../src/api/transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAoB,MAAM,cAAc,CAAC;AA4F5D,MAAM,OAAO,SAAS;IAKS;IAJpB,QAAQ,GAAqB,EAAE,CAAC;IACxB,WAAW,CAAuB;IAClC,SAAS,CAA0B;IAEpD,YAA6B,OAAyB;QAAzB,YAAO,GAAP,OAAO,CAAkB;QACpD,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC;QACrE,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,KAAK,IAAI,UAAU,CAAC,KAAK,CAAC;IACrD,CAAC;IAED,IAAY,KAAK;QACf,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC;IAClC,CAAC;IAED,IAAY,KAAK,CAAC,KAAyB;QACzC,IAAI,CAAC,WAAW,CAA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AAC,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"}
|
|
@@ -4,11 +4,12 @@ export type { HttpClient, Page, RequestOptions as HttpRequestOptions } from "./a
|
|
|
4
4
|
export { IdentityClient, browserLogin, type LoginResult, type Organization, } from "./api/identity.js";
|
|
5
5
|
export { findLiveVersion, ManagementClient, parseVersionTag, type Agent, type AgentVersion, type Project, type VersionPull, type VersionPush, type VersionSource, type VersionStatus, } from "./api/management.js";
|
|
6
6
|
export { MOCKDB_SERVICE_NAME, MockDbClient, mockDbErrorCode, type MockDbAuth, type MockDbClientOptions, type MockDbCloneResponse, type MockDbIdentitiesResponse, type MockDbIdentitiesUpsertResponse, type MockDbMgmtAuth, type MockDbProvisionResponse, type MockDbRuntimeAuth, type MockDbSampleData, type MockDbStatusResponse, type MockDbTokenAuth, } from "./api/mock-db.js";
|
|
7
|
+
export { CloneClient, type AgentCloneDryRun, type AgentCloneError, type AgentCloneReport, type AgentCloneRequest, type AgentCloneResult, type AgentCloneState, type AgentCloneStatus, type CloneEnvironment, } from "./api/clone.js";
|
|
7
8
|
export { VaultClient, type VaultScope, type VaultScopeType, type VaultSecret, type VaultSecretCreate, type VaultSecretUpdate, } from "./api/vault.js";
|
|
8
9
|
export { KbmClient, type BulkFilesResponse, type BulkResourceResult, type BulkWebsitesResponse, type IndexingJob, type KnowledgeBase, type UploadFilePart, } from "./api/kbm.js";
|
|
9
10
|
export { RuntimeApiClient, type AgentOverride, type Message, type RuntimeTrace, type SendMessageRequest, type SendMessageResponse, type SkillFile, type SkillIndexItem, type Thread, } from "./api/runtime-api.js";
|
|
10
11
|
export { BuilderApiClient, type AdvisorAsk, type AdvisorStarted, type AdvisorView, type BuilderFinding, type BuilderTree, type BuilderValidation, type BuildRequest, type BuildStarted, type BuildView, type EraCensus, type OrphanCensus, type ScenarioFailure, } from "./api/builder-api.js";
|
|
11
|
-
export { Transport, type FormBody, type FormFilePart, type RequestCapture, type TransportOptions, } from "./api/transport.js";
|
|
12
|
+
export { Transport, type FormBody, type FormFilePart, type RequestCapture, type TransportOptions, type TransportRoute, } from "./api/transport.js";
|
|
12
13
|
export { CaptureLog, captureLog, defaultCapturePath, type CaptureSink, } from "./api/capture.js";
|
|
13
14
|
export { pageLane, setPageLane, type PageLane } from "./api/lane.js";
|
|
14
15
|
export { AgentSettingsClient, type AgentBlobStats, type AgentRecord, type AgentRecordKind, type AgentRecordScope, type RuntimeVersionRecord, type BuildBundle, type BuildBundleFile, type BuildBundlePullResponse, type BuildBundlePushResponse, type BundleUploadFile, } from "./api/agent-settings.js";
|
|
@@ -30,9 +31,10 @@ export { createClients, type Clients } from "./services/clients.js";
|
|
|
30
31
|
export { listEnvironments, setEnvironment, type EnvironmentResult, type EnvironmentSummary, } from "./services/env.service.js";
|
|
31
32
|
export { agentRuntimeVersion, bindAgent, createAgent, createProject, initialVersionTag, latestPublishedRuntimeVersion, listAgents, listOrganizations, listProjects, unlinkAgent, useOrganization, useProject, useVersion, } from "./services/hierarchy.js";
|
|
32
33
|
export { AVAILABILITY_CACHE_FILE, AVAILABILITY_CACHE_TTL_MS, assertRuntimeAvailable, availabilityCachePath, checkRuntimeAvailability, familyOf, probeRuntimeAvailability, verdictFromHealth, type AvailabilityOptions, type RuntimeAvailability, type RuntimeHealth, type RuntimePinCheck, } from "./runtime-version/availability.js";
|
|
33
|
-
export { isLegacyRuntime, latestRuntimeVersion, matchRuntimeVersion, resolveRuntimeVersion, runtimeVersionLabel, runtimeVersionOptions, RUNTIME_VERSION_HEADER, type ResolvedRuntimeVersion, type RuntimeVersionOption, } from "./runtime-version/index.js";
|
|
34
|
+
export { isLegacyRuntime, isRoutableRuntimeBuild, latestRuntimeVersion, matchRuntimeVersion, resolveRuntimeVersion, runtimeRouteResolver, runtimeVersionLabel, runtimeVersionOptions, RUNTIME_VERSION_HEADER, type ResolvedRuntimeVersion, type RuntimeVersionOption, } from "./runtime-version/index.js";
|
|
34
35
|
export { createThread, getThread, listMessages, listThreads, parseVariables, sendMessage, trace, } from "./services/messaging.js";
|
|
35
36
|
export { cloneMockDb, createCollection, createEndpoint, DEFAULT_MOCKDB_TOKEN_ENV, deleteEndpoint, deleteMockDb, describeMockDb, executeEndpoint, exportMockDb, getEndpoint, getIdentities, inspectSession, listCollections, listEndpoints, MOCKDB_GUIDE, normalizeAddColumns, normalizeSampleData, normalizeSchema, parseJsonFlag, provisionMockDb, readSampleDataInput, resetSession, resolveMockDb, rotateMgmtKey, rotateRuntimeKey, seedRows, setIdentities, statusMockDb, storedKeys, updateCollection, updateEndpoint, wireMockDbConnection, writeMockDbGuide, type CloneMockDbOptions, type MockDbProvisionResult, type MockDbResolved, type MockDbServiceOptions, type MockDbStatusReport, type MockDbStatusVerdict, type RuntimeKeyResync, type RuntimeKeySource, type WireResult, } from "./services/mockdb.js";
|
|
37
|
+
export { CLONE_POLL_INTERVAL_MS, CLONE_WAIT_TIMEOUT_MS, buildCloneRequest, cloneEnvironment, cloneStatus, dryRunClone, isTerminalCloneState, resolveCloneTarget, startClone, waitForClone, type CloneAgentParams, type CloneDryRunResult, type CloneServiceOptions, type CloneStarted, type CloneTarget, type WaitForCloneOptions, } from "./services/clone.js";
|
|
36
38
|
export { buildVaultScope, getSecretByName, listSecrets, parseVaultScopeLevel, removeSecretByName, scopeLevelLabel, setSecret, validateSecretName, vaultScopeLevels, type SetSecretParams, type VaultScopeLevel, type VaultServiceOptions, } from "./services/vault.js";
|
|
37
39
|
export { addFiles, addUrls, createHub, deleteHub, getHubByName, hubRefCheck, hubStatus, listHubs, programHubRefs, type HubStatus, type HubUploadResult, type KnowledgeServiceOptions, } from "./services/knowledge.js";
|
|
38
40
|
export { currentProfile, listProfiles, useProfile, type CurrentProfile, type ProfileSummary, } from "./services/profile.service.js";
|
|
@@ -3,6 +3,7 @@ export { normalizeArgv } from "./argv.js";
|
|
|
3
3
|
export { IdentityClient, browserLogin, } from "./api/identity.js";
|
|
4
4
|
export { findLiveVersion, ManagementClient, parseVersionTag, } from "./api/management.js";
|
|
5
5
|
export { MOCKDB_SERVICE_NAME, MockDbClient, mockDbErrorCode, } from "./api/mock-db.js";
|
|
6
|
+
export { CloneClient, } from "./api/clone.js";
|
|
6
7
|
export { VaultClient, } from "./api/vault.js";
|
|
7
8
|
export { KbmClient, } from "./api/kbm.js";
|
|
8
9
|
export { RuntimeApiClient, } from "./api/runtime-api.js";
|
|
@@ -28,9 +29,10 @@ export { createClients } from "./services/clients.js";
|
|
|
28
29
|
export { listEnvironments, setEnvironment, } from "./services/env.service.js";
|
|
29
30
|
export { agentRuntimeVersion, bindAgent, createAgent, createProject, initialVersionTag, latestPublishedRuntimeVersion, listAgents, listOrganizations, listProjects, unlinkAgent, useOrganization, useProject, useVersion, } from "./services/hierarchy.js";
|
|
30
31
|
export { AVAILABILITY_CACHE_FILE, AVAILABILITY_CACHE_TTL_MS, assertRuntimeAvailable, availabilityCachePath, checkRuntimeAvailability, familyOf, probeRuntimeAvailability, verdictFromHealth, } from "./runtime-version/availability.js";
|
|
31
|
-
export { isLegacyRuntime, latestRuntimeVersion, matchRuntimeVersion, resolveRuntimeVersion, runtimeVersionLabel, runtimeVersionOptions, RUNTIME_VERSION_HEADER, } from "./runtime-version/index.js";
|
|
32
|
+
export { isLegacyRuntime, isRoutableRuntimeBuild, latestRuntimeVersion, matchRuntimeVersion, resolveRuntimeVersion, runtimeRouteResolver, runtimeVersionLabel, runtimeVersionOptions, RUNTIME_VERSION_HEADER, } from "./runtime-version/index.js";
|
|
32
33
|
export { createThread, getThread, listMessages, listThreads, parseVariables, sendMessage, trace, } from "./services/messaging.js";
|
|
33
34
|
export { cloneMockDb, createCollection, createEndpoint, DEFAULT_MOCKDB_TOKEN_ENV, deleteEndpoint, deleteMockDb, describeMockDb, executeEndpoint, exportMockDb, getEndpoint, getIdentities, inspectSession, listCollections, listEndpoints, MOCKDB_GUIDE, normalizeAddColumns, normalizeSampleData, normalizeSchema, parseJsonFlag, provisionMockDb, readSampleDataInput, resetSession, resolveMockDb, rotateMgmtKey, rotateRuntimeKey, seedRows, setIdentities, statusMockDb, storedKeys, updateCollection, updateEndpoint, wireMockDbConnection, writeMockDbGuide, } from "./services/mockdb.js";
|
|
35
|
+
export { CLONE_POLL_INTERVAL_MS, CLONE_WAIT_TIMEOUT_MS, buildCloneRequest, cloneEnvironment, cloneStatus, dryRunClone, isTerminalCloneState, resolveCloneTarget, startClone, waitForClone, } from "./services/clone.js";
|
|
34
36
|
export { buildVaultScope, getSecretByName, listSecrets, parseVaultScopeLevel, removeSecretByName, scopeLevelLabel, setSecret, validateSecretName, vaultScopeLevels, } from "./services/vault.js";
|
|
35
37
|
export { addFiles, addUrls, createHub, deleteHub, getHubByName, hubRefCheck, hubStatus, listHubs, programHubRefs, } from "./services/knowledge.js";
|
|
36
38
|
export { currentProfile, listProfiles, useProfile, } from "./services/profile.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,mBA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iCAAiC,CAAC;AAEzC,OAAO,EACL,aAAa,EACb,mBAAmB,GAEpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,iBAAiB,GAElB,MAAM,yBAAyB,CAAC;AAEjC,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"}
|
|
@@ -17,9 +17,10 @@
|
|
|
17
17
|
* pinning existed: the gateway serves its own default route.
|
|
18
18
|
*/
|
|
19
19
|
import type { AgentSettingsClient, RuntimeVersionRecord } from "../api/agent-settings.js";
|
|
20
|
+
import type { TransportRoute } from "../api/transport.js";
|
|
20
21
|
/** The HTTP header the gateway routes on. runtime-api itself never reads it. */
|
|
21
22
|
export declare const RUNTIME_VERSION_HEADER = "runtime-version";
|
|
22
|
-
/** A catalog record trimmed to what selection
|
|
23
|
+
/** A catalog record trimmed to what selection and routing need. */
|
|
23
24
|
export interface RuntimeVersionOption {
|
|
24
25
|
runtime_version: string;
|
|
25
26
|
latest_version: string;
|
|
@@ -39,6 +40,13 @@ export declare function familyOf(value: string): string | undefined;
|
|
|
39
40
|
* runtime-v2 checkout must never resolve "latest" to it.
|
|
40
41
|
*/
|
|
41
42
|
export declare function isLegacyRuntime(option: RuntimeVersionOption): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* True for a full build ("0.8.5") — the only shape the gateway's
|
|
45
|
+
* per-version routes match (`MAJOR.MINOR.` then anything). A bare family
|
|
46
|
+
* ("0.8"), a label ("v0.8") or a custom deployment name is not routable as
|
|
47
|
+
* a header and has to resolve through the catalog first.
|
|
48
|
+
*/
|
|
49
|
+
export declare function isRoutableRuntimeBuild(value: string): boolean;
|
|
42
50
|
/** Trim catalog records to selectable options; hidden records drop out. */
|
|
43
51
|
export declare function runtimeVersionOptions(records: RuntimeVersionRecord[]): RuntimeVersionOption[];
|
|
44
52
|
/**
|
|
@@ -77,3 +85,22 @@ export interface ResolvedRuntimeVersion {
|
|
|
77
85
|
* unreachable. An error is reported, never thrown.
|
|
78
86
|
*/
|
|
79
87
|
export declare function resolveRuntimeVersion(client: Pick<AgentSettingsClient, "listRuntimeVersions">): Promise<ResolvedRuntimeVersion>;
|
|
88
|
+
/**
|
|
89
|
+
* Where runtime-api calls for a pin go.
|
|
90
|
+
*
|
|
91
|
+
* A full build ("0.8.5") rides the gateway as-is: its per-version routes
|
|
92
|
+
* match exactly that shape. Anything else — a bare family, a label another
|
|
93
|
+
* tool wrote, a custom deployment name — used to ride the header too, match
|
|
94
|
+
* nothing, and land on the default engine unnoticed. So such a pin is
|
|
95
|
+
* looked up in the catalog once per client set and resolved the way
|
|
96
|
+
* `runtime use` resolves it at write time: a published family routes to
|
|
97
|
+
* the gateway with its current build in the header; a custom record routes
|
|
98
|
+
* straight at its link, the rule the admin applies. Hidden records still
|
|
99
|
+
* resolve — a pin written while the record was selectable keeps routing
|
|
100
|
+
* after it is retired from the pickers.
|
|
101
|
+
*
|
|
102
|
+
* Fails closed. An unknown name, a custom record without a usable link, or
|
|
103
|
+
* an unreadable catalog is an error, never a silent fallback to latest —
|
|
104
|
+
* that fallback is the defect this exists to remove.
|
|
105
|
+
*/
|
|
106
|
+
export declare function runtimeRouteResolver(pin: string, gatewayUrl: string, catalog: Pick<AgentSettingsClient, "listRuntimeVersions">): () => Promise<TransportRoute>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AuthError, ConfigError } from "../errors/index.js";
|
|
1
2
|
/** The HTTP header the gateway routes on. runtime-api itself never reads it. */
|
|
2
3
|
export const RUNTIME_VERSION_HEADER = "runtime-version";
|
|
3
4
|
/**
|
|
@@ -19,17 +20,35 @@ export function isLegacyRuntime(option) {
|
|
|
19
20
|
return family.split(".")[0] === "1";
|
|
20
21
|
return option.display_name.trim().toLowerCase() === "v1.0";
|
|
21
22
|
}
|
|
22
|
-
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
/**
|
|
24
|
+
* True for a full build ("0.8.5") — the only shape the gateway's
|
|
25
|
+
* per-version routes match (`MAJOR.MINOR.` then anything). A bare family
|
|
26
|
+
* ("0.8"), a label ("v0.8") or a custom deployment name is not routable as
|
|
27
|
+
* a header and has to resolve through the catalog first.
|
|
28
|
+
*/
|
|
29
|
+
export function isRoutableRuntimeBuild(value) {
|
|
30
|
+
return /^\d+\.\d+\.\S+$/.test(value.trim());
|
|
31
|
+
}
|
|
32
|
+
/** A custom deployment's link must be an absolute http(s) URL — anything
|
|
33
|
+
* else is treated as no link, so the record is named in the error rather
|
|
34
|
+
* than sending a session token somewhere unparseable. */
|
|
35
|
+
function customLink(record) {
|
|
36
|
+
const link = record.custom_link?.trim().replace(/\/+$/, "");
|
|
37
|
+
return link && /^https?:\/\/\S+$/i.test(link) ? link : undefined;
|
|
38
|
+
}
|
|
39
|
+
function runtimeVersionOption(record) {
|
|
40
|
+
const link = customLink(record);
|
|
41
|
+
return {
|
|
27
42
|
runtime_version: record.runtime_version,
|
|
28
43
|
latest_version: record.latest_version,
|
|
29
44
|
display_name: record.display_name,
|
|
30
45
|
type: record.type,
|
|
31
|
-
...(
|
|
32
|
-
}
|
|
46
|
+
...(link ? { custom_link: link } : {}),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/** Trim catalog records to selectable options; hidden records drop out. */
|
|
50
|
+
export function runtimeVersionOptions(records) {
|
|
51
|
+
return records.filter((record) => record.is_visible).map(runtimeVersionOption);
|
|
33
52
|
}
|
|
34
53
|
/**
|
|
35
54
|
* The catalog entry a stored value belongs to. Exact hits on `latest_version`
|
|
@@ -112,4 +131,64 @@ export async function resolveRuntimeVersion(client) {
|
|
|
112
131
|
options: catalog,
|
|
113
132
|
};
|
|
114
133
|
}
|
|
134
|
+
/**
|
|
135
|
+
* Where runtime-api calls for a pin go.
|
|
136
|
+
*
|
|
137
|
+
* A full build ("0.8.5") rides the gateway as-is: its per-version routes
|
|
138
|
+
* match exactly that shape. Anything else — a bare family, a label another
|
|
139
|
+
* tool wrote, a custom deployment name — used to ride the header too, match
|
|
140
|
+
* nothing, and land on the default engine unnoticed. So such a pin is
|
|
141
|
+
* looked up in the catalog once per client set and resolved the way
|
|
142
|
+
* `runtime use` resolves it at write time: a published family routes to
|
|
143
|
+
* the gateway with its current build in the header; a custom record routes
|
|
144
|
+
* straight at its link, the rule the admin applies. Hidden records still
|
|
145
|
+
* resolve — a pin written while the record was selectable keeps routing
|
|
146
|
+
* after it is retired from the pickers.
|
|
147
|
+
*
|
|
148
|
+
* Fails closed. An unknown name, a custom record without a usable link, or
|
|
149
|
+
* an unreadable catalog is an error, never a silent fallback to latest —
|
|
150
|
+
* that fallback is the defect this exists to remove.
|
|
151
|
+
*/
|
|
152
|
+
export function runtimeRouteResolver(pin, gatewayUrl, catalog) {
|
|
153
|
+
if (isRoutableRuntimeBuild(pin)) {
|
|
154
|
+
return () => Promise.resolve({ baseUrl: gatewayUrl });
|
|
155
|
+
}
|
|
156
|
+
let resolved;
|
|
157
|
+
return () => {
|
|
158
|
+
if (resolved === undefined) {
|
|
159
|
+
const attempt = resolveRuntimeRoute(pin, gatewayUrl, catalog);
|
|
160
|
+
resolved = attempt;
|
|
161
|
+
attempt.catch(() => {
|
|
162
|
+
if (resolved === attempt)
|
|
163
|
+
resolved = undefined;
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
return resolved;
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
async function resolveRuntimeRoute(pin, gatewayUrl, catalog) {
|
|
170
|
+
let records;
|
|
171
|
+
try {
|
|
172
|
+
records = await catalog.listRuntimeVersions();
|
|
173
|
+
}
|
|
174
|
+
catch (error) {
|
|
175
|
+
if (error instanceof AuthError)
|
|
176
|
+
throw error;
|
|
177
|
+
throw new ConfigError(`Could not read the runtime catalog to locate runtime "${pin}": ${error instanceof Error ? error.message : String(error)}`, "A runtime pinned by name is served where its catalog record says. Retry, or pin a published build with `apollo runtime use`.");
|
|
178
|
+
}
|
|
179
|
+
const match = matchRuntimeVersion(records.map(runtimeVersionOption), pin);
|
|
180
|
+
if (!match) {
|
|
181
|
+
throw new ConfigError(`Runtime "${pin}" is not in the catalog.`, "Check `apollo runtime list`, or pin another with `apollo runtime use`.");
|
|
182
|
+
}
|
|
183
|
+
if (match.type !== "custom") {
|
|
184
|
+
return {
|
|
185
|
+
baseUrl: gatewayUrl,
|
|
186
|
+
headers: { [RUNTIME_VERSION_HEADER]: match.latest_version },
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
if (!match.custom_link) {
|
|
190
|
+
throw new ConfigError(`Custom runtime "${pin}" has no usable deployment link in the catalog, so nothing can route to it.`, "The gateway only routes published runtimes. Register the deployment's http(s) link on the catalog record, or pin a published build with `apollo runtime use`.");
|
|
191
|
+
}
|
|
192
|
+
return { baseUrl: match.custom_link };
|
|
193
|
+
}
|
|
115
194
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/runtime-version/index.ts"],"names":[],"mappings":"AAuBA,gFAAgF;AAChF,MAAM,CAAC,MAAM,sBAAsB,GAAG,iBAAiB,CAAC;AAYxD;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAa;IACpC,MAAM,KAAK,GAAG,0BAA0B,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;IAC5D,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AACvD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,MAA4B;IAC1D,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,eAAe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E,GAAG,CAAC,CAAC;IAC1E,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,WAAW,CACnB,YAAY,GAAG,0BAA0B,EACzC,wEAAwE,CACzE,CAAC;IACJ,CAAC;IACD,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO;YACL,OAAO,EAAE,UAAU;YACnB,OAAO,EAAE,EAAE,CAAC,sBAAsB,CAAC,EAAE,KAAK,CAAC,cAAc,EAAE;SAC5D,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;QACvB,MAAM,IAAI,WAAW,CACnB,mBAAmB,GAAG,6EAA6E,EACnG,+JAA+J,CAChK,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,WAAW,EAAE,CAAC;AACxC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AgentSettingsClient } from "../api/agent-settings.js";
|
|
2
2
|
import { BuilderApiClient } from "../api/builder-api.js";
|
|
3
|
+
import { CloneClient } from "../api/clone.js";
|
|
3
4
|
import { IdentityClient } from "../api/identity.js";
|
|
4
5
|
import { KbmClient } from "../api/kbm.js";
|
|
5
6
|
import { ManagementClient } from "../api/management.js";
|
|
@@ -11,6 +12,8 @@ export interface Clients {
|
|
|
11
12
|
management: ManagementClient;
|
|
12
13
|
runtime: RuntimeApiClient;
|
|
13
14
|
vault: VaultClient;
|
|
15
|
+
/** apollo-api's internal clone manager — agent clones as background jobs. */
|
|
16
|
+
clone: CloneClient;
|
|
14
17
|
kbm: KbmClient;
|
|
15
18
|
/** v1 agent-settings — scenarios, runtime catalog + agent runtime reads. */
|
|
16
19
|
agentSettings: AgentSettingsClient;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { homedir } from "node:os";
|
|
2
2
|
import { AgentSettingsClient } from "../api/agent-settings.js";
|
|
3
3
|
import { BuilderApiClient } from "../api/builder-api.js";
|
|
4
|
+
import { CloneClient } from "../api/clone.js";
|
|
4
5
|
import { IdentityClient } from "../api/identity.js";
|
|
5
6
|
import { KbmClient } from "../api/kbm.js";
|
|
6
7
|
import { ManagementClient } from "../api/management.js";
|
|
@@ -9,7 +10,7 @@ import { Transport } from "../api/transport.js";
|
|
|
9
10
|
import { VaultClient } from "../api/vault.js";
|
|
10
11
|
import { readCredentials, writeCredentials, } from "../config/index.js";
|
|
11
12
|
import { AuthError } from "../errors/index.js";
|
|
12
|
-
import { RUNTIME_VERSION_HEADER } from "../runtime-version/index.js";
|
|
13
|
+
import { RUNTIME_VERSION_HEADER, runtimeRouteResolver, } from "../runtime-version/index.js";
|
|
13
14
|
function expiry(token) {
|
|
14
15
|
try {
|
|
15
16
|
const payload = token.split(".")[1];
|
|
@@ -84,14 +85,27 @@ export function createClients(context, options = {}) {
|
|
|
84
85
|
orgHeader: "x-aui-organization-id",
|
|
85
86
|
...common,
|
|
86
87
|
});
|
|
88
|
+
// Scenarios (v1 agent-settings): session bearer + org header.
|
|
89
|
+
const agentSettingsTransport = new Transport({
|
|
90
|
+
service: "agent-settings",
|
|
91
|
+
baseUrl: context.baseUrls.agentSettings,
|
|
92
|
+
orgId: context.orgId,
|
|
93
|
+
orgHeader: "X-Organization-ID",
|
|
94
|
+
...common,
|
|
95
|
+
});
|
|
96
|
+
const agentSettings = new AgentSettingsClient(agentSettingsTransport);
|
|
87
97
|
// Everything the runtime serves is version-dependent — the program schemas,
|
|
88
98
|
// the authoring skills, what `validate` enforces and which engine runs a
|
|
89
|
-
// turn — so the pin rides every call to it, not just the sends.
|
|
99
|
+
// turn — so the pin rides every call to it, not just the sends. A pin the
|
|
100
|
+
// gateway cannot route (a custom deployment) also moves WHERE the calls go.
|
|
90
101
|
const runtimeTransport = new Transport({
|
|
91
102
|
service: "runtime-api",
|
|
92
103
|
baseUrl: context.baseUrls.runtime,
|
|
93
104
|
...(context.runtimeVersion
|
|
94
|
-
? {
|
|
105
|
+
? {
|
|
106
|
+
headers: { [RUNTIME_VERSION_HEADER]: context.runtimeVersion },
|
|
107
|
+
resolveRoute: runtimeRouteResolver(context.runtimeVersion, context.baseUrls.runtime, agentSettings),
|
|
108
|
+
}
|
|
95
109
|
: {}),
|
|
96
110
|
...common,
|
|
97
111
|
});
|
|
@@ -102,14 +116,6 @@ export function createClients(context, options = {}) {
|
|
|
102
116
|
orgHeader: "X-Organization-ID",
|
|
103
117
|
...common,
|
|
104
118
|
});
|
|
105
|
-
// Scenarios (v1 agent-settings): session bearer + org header.
|
|
106
|
-
const agentSettingsTransport = new Transport({
|
|
107
|
-
service: "agent-settings",
|
|
108
|
-
baseUrl: context.baseUrls.agentSettings,
|
|
109
|
-
orgId: context.orgId,
|
|
110
|
-
orgHeader: "X-Organization-ID",
|
|
111
|
-
...common,
|
|
112
|
-
});
|
|
113
119
|
// builder-api validates the session bearer itself (identity mode). No
|
|
114
120
|
// runtime pin rides here: the gates run on the builder's OWN engine, which
|
|
115
121
|
// is the point — they are the builder's opinion of the tree.
|
|
@@ -123,8 +129,9 @@ export function createClients(context, options = {}) {
|
|
|
123
129
|
management: new ManagementClient(managementTransport),
|
|
124
130
|
runtime: new RuntimeApiClient(runtimeTransport),
|
|
125
131
|
vault: new VaultClient(managementTransport),
|
|
132
|
+
clone: new CloneClient(managementTransport),
|
|
126
133
|
kbm: new KbmClient(kbmTransport),
|
|
127
|
-
agentSettings
|
|
134
|
+
agentSettings,
|
|
128
135
|
builder: new BuilderApiClient(builderTransport),
|
|
129
136
|
};
|
|
130
137
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clients.js","sourceRoot":"","sources":["../../../src/services/clients.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,cAAc,EAA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AC,QAAQ,CAAC,OAAO;QACjC,GAAG,CAAC,OAAO,CAAC,cAAc;YACxB,CAAC,CAAC;gBACE,OAAO,EAAE,EAAE,CAAC,sBAAsB,CAAC,EAAE,OAAO,CAAC,cAAc,EAAE;gBAC7D,YAAY,EAAE,oBAAoB,CAChC,OAAO,CAAC,cAAc,EACtB,OAAO,CAAC,QAAQ,CAAC,OAAO,EACxB,aAAa,CACd;aACF;YACH,CAAC,CAAC,EAAE,CAAC;QACP,GAAG,MAAM;KACV,CAAC,CAAC;IACH,MAAM,YAAY,GAAG,IAAI,SAAS,CAAC;QACjC,OAAO,EAAE,KAAK;QACd,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG;QAC7B,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,SAAS,EAAE,mBAAmB;QAC9B,GAAG,MAAM;KACV,CAAC,CAAC;IACH,sEAAsE;IACtE,2EAA2E;IAC3E,6DAA6D;IAC7D,MAAM,gBAAgB,GAAG,IAAI,SAAS,CAAC;QACrC,OAAO,EAAE,aAAa;QACtB,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,OAAO;QACjC,GAAG,MAAM;KACV,CAAC,CAAC;IAEH,OAAO;QACL,QAAQ;QACR,UAAU,EAAE,IAAI,gBAAgB,CAAC,mBAAmB,CAAC;QACrD,OAAO,EAAE,IAAI,gBAAgB,CAAC,gBAAgB,CAAC;QAC/C,KAAK,EAAE,IAAI,WAAW,CAAC,mBAAmB,CAAC;QAC3C,KAAK,EAAE,IAAI,WAAW,CAAC,mBAAmB,CAAC;QAC3C,GAAG,EAAE,IAAI,SAAS,CAAC,YAAY,CAAC;QAChC,aAAa;QACb,OAAO,EAAE,IAAI,gBAAgB,CAAC,gBAAgB,CAAC;KAChD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent clone service — copy the checkout's agent into another project or
|
|
3
|
+
* environment through apollo-api's clone manager (`api/clone.ts`).
|
|
4
|
+
*
|
|
5
|
+
* The clone runs against the checkout's HOME environment: apollo only reads
|
|
6
|
+
* a source from the environment it is deployed in and writes the target
|
|
7
|
+
* itself, so the console never needs a session in the target environment.
|
|
8
|
+
* Target ids are therefore explicit — an organization and a project are
|
|
9
|
+
* different records in every environment, and only a same-environment clone
|
|
10
|
+
* can default the organization to the checkout's own.
|
|
11
|
+
*/
|
|
12
|
+
import type { AgentCloneDryRun, AgentCloneRequest, AgentCloneStatus, CloneEnvironment } from "../api/clone.js";
|
|
13
|
+
import { type Context, type Environment } from "../config/index.js";
|
|
14
|
+
import { type Clients } from "./clients.js";
|
|
15
|
+
export declare const CLONE_POLL_INTERVAL_MS = 3000;
|
|
16
|
+
export declare const CLONE_WAIT_TIMEOUT_MS: number;
|
|
17
|
+
export interface CloneServiceOptions {
|
|
18
|
+
clients?: Clients;
|
|
19
|
+
fetch?: typeof globalThis.fetch;
|
|
20
|
+
}
|
|
21
|
+
export interface CloneAgentParams {
|
|
22
|
+
/** Target environment; defaults to the checkout's own. */
|
|
23
|
+
toEnv?: string;
|
|
24
|
+
/** Target organization id; defaults to the checkout's org for a
|
|
25
|
+
* same-environment clone, and is required otherwise. */
|
|
26
|
+
toOrg?: string;
|
|
27
|
+
/** Target project id — always required. */
|
|
28
|
+
toProject?: string;
|
|
29
|
+
/** Clone this version tag instead of the agent's active version. */
|
|
30
|
+
tag?: string;
|
|
31
|
+
/** Replace the target's existing mock database. */
|
|
32
|
+
overwriteMockDb?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface CloneTarget {
|
|
35
|
+
environment: Environment;
|
|
36
|
+
organizationId: string;
|
|
37
|
+
projectId: string;
|
|
38
|
+
}
|
|
39
|
+
export interface CloneDryRunResult {
|
|
40
|
+
request: AgentCloneRequest;
|
|
41
|
+
target: CloneTarget;
|
|
42
|
+
report: AgentCloneDryRun;
|
|
43
|
+
}
|
|
44
|
+
export interface CloneStarted {
|
|
45
|
+
task_id: string;
|
|
46
|
+
request: AgentCloneRequest;
|
|
47
|
+
target: CloneTarget;
|
|
48
|
+
}
|
|
49
|
+
/** apollo's name for a console environment. */
|
|
50
|
+
export declare function cloneEnvironment(environment: Environment): CloneEnvironment;
|
|
51
|
+
/**
|
|
52
|
+
* Where the clone lands. The environment must be one this build knows —
|
|
53
|
+
* the target's records are addressed by id, so nothing here can guess
|
|
54
|
+
* them across environments.
|
|
55
|
+
*/
|
|
56
|
+
export declare function resolveCloneTarget(context: Context, params: CloneAgentParams): CloneTarget;
|
|
57
|
+
/** The wire body for this checkout and target; `--tag` resolves through
|
|
58
|
+
* the same tag rules as pull/push. */
|
|
59
|
+
export declare function buildCloneRequest(context: Context, clients: Pick<Clients, "management">, params: CloneAgentParams): Promise<{
|
|
60
|
+
request: AgentCloneRequest;
|
|
61
|
+
target: CloneTarget;
|
|
62
|
+
}>;
|
|
63
|
+
/** Every check the clone would run, nothing written. */
|
|
64
|
+
export declare function dryRunClone(context: Context, params: CloneAgentParams, options?: CloneServiceOptions): Promise<CloneDryRunResult>;
|
|
65
|
+
/** Validate and enqueue the clone; the write phase runs in the background. */
|
|
66
|
+
export declare function startClone(context: Context, params: CloneAgentParams, options?: CloneServiceOptions): Promise<CloneStarted>;
|
|
67
|
+
export declare function cloneStatus(context: Context, taskId: string, options?: CloneServiceOptions): Promise<AgentCloneStatus>;
|
|
68
|
+
export declare function isTerminalCloneState(status: AgentCloneStatus): boolean;
|
|
69
|
+
export interface WaitForCloneOptions extends CloneServiceOptions {
|
|
70
|
+
intervalMs?: number;
|
|
71
|
+
timeoutMs?: number;
|
|
72
|
+
/** Called after every non-terminal poll. */
|
|
73
|
+
onPoll?: (status: AgentCloneStatus) => void;
|
|
74
|
+
sleep?: (ms: number) => Promise<void>;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Poll until the task is terminal. A clone that outlives the wait is not a
|
|
78
|
+
* failure — the job keeps running — so the timeout names the task to poll.
|
|
79
|
+
*/
|
|
80
|
+
export declare function waitForClone(context: Context, taskId: string, options?: WaitForCloneOptions): Promise<AgentCloneStatus>;
|