@aui.io/apollo 0.1.34 → 0.1.37
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/hierarchy.js +15 -8
- package/node_modules/@aui.io/apollo-cli/dist/src/commands/hierarchy.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 +12 -68
- package/node_modules/@aui.io/apollo-core/dist/src/api/agent-settings.js +1 -61
- 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/management.d.ts +16 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/management.js +25 -0
- 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/runtime-api.d.ts +5 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/runtime-api.js +4 -0
- package/node_modules/@aui.io/apollo-core/dist/src/api/runtime-api.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/api/transport.js +14 -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/api/vault.d.ts +49 -27
- package/node_modules/@aui.io/apollo-core/dist/src/api/vault.js +35 -15
- package/node_modules/@aui.io/apollo-core/dist/src/api/vault.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/config/index.js +0 -6
- 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/types.d.ts +2 -5
- package/node_modules/@aui.io/apollo-core/dist/src/index.d.ts +3 -4
- package/node_modules/@aui.io/apollo-core/dist/src/index.js +1 -2
- package/node_modules/@aui.io/apollo-core/dist/src/index.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/services/clients.d.ts +1 -4
- package/node_modules/@aui.io/apollo-core/dist/src/services/clients.js +4 -23
- 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.js +0 -1
- package/node_modules/@aui.io/apollo-core/dist/src/services/doctor.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/services/hierarchy.d.ts +20 -39
- package/node_modules/@aui.io/apollo-core/dist/src/services/hierarchy.js +20 -126
- 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/messaging.js +9 -0
- package/node_modules/@aui.io/apollo-core/dist/src/services/messaging.js.map +1 -1
- package/node_modules/@aui.io/apollo-core/dist/src/services/vault.d.ts +7 -6
- package/node_modules/@aui.io/apollo-core/dist/src/services/vault.js +17 -7
- package/node_modules/@aui.io/apollo-core/dist/src/services/vault.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 +15 -8
- 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.js +1 -1
- package/node_modules/@aui.io/apollo-tui/dist/src/lib/commands.js.map +1 -1
- package/node_modules/@aui.io/apollo-tui/package.json +2 -2
- package/package.json +4 -4
- package/node_modules/@aui.io/apollo-core/dist/src/api/network.d.ts +0 -19
- package/node_modules/@aui.io/apollo-core/dist/src/api/network.js +0 -53
- package/node_modules/@aui.io/apollo-core/dist/src/api/network.js.map +0 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { AgentSettingsClient } from "../api/agent-settings.js";
|
|
2
2
|
import type { IdentityClient, Organization } from "../api/identity.js";
|
|
3
3
|
import { type Agent, type AgentVersion, type ManagementClient, type Project } from "../api/management.js";
|
|
4
|
-
import type { NetworkClient } from "../api/network.js";
|
|
5
4
|
import { type Context, type ProjectBinding } from "../config/index.js";
|
|
6
5
|
export declare function listOrganizations(identity: IdentityClient): Promise<Organization[]>;
|
|
7
6
|
export declare function useOrganization(context: Context, identity: IdentityClient, organizationId: string): Promise<{
|
|
@@ -23,48 +22,30 @@ export declare function listAgents(context: Context, management: ManagementClien
|
|
|
23
22
|
results: Agent[];
|
|
24
23
|
}>;
|
|
25
24
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*/
|
|
32
|
-
export declare const TEMPLATE_AGENT_ID = "6a63896e1bd618f292ba6684";
|
|
33
|
-
/** The two services `createAgent` drives, in the order it touches them. */
|
|
34
|
-
export interface AgentCreateClients {
|
|
35
|
-
agentSettings: AgentSettingsClient;
|
|
36
|
-
network: NetworkClient;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Create an agent by running the clone-from-template sequence the console
|
|
40
|
-
* needs, against agent-settings and the network service directly. It is
|
|
41
|
-
* step-for-step what apollo-api's create endpoint does internally — the only
|
|
42
|
-
* difference is that the template is named here rather than resolved from a
|
|
43
|
-
* category:
|
|
25
|
+
* Create an agent through apollo's management surface — one POST; apollo owns
|
|
26
|
+
* the whole server-side sequence (scoping, seeding, publish/activate when a
|
|
27
|
+
* template is involved) and enforces real permissions on the way in, which is
|
|
28
|
+
* why the console no longer runs the clone sequence against the v1 services
|
|
29
|
+
* itself.
|
|
44
30
|
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
* the bundle, the build bundle and the evaluation scores into the agent;
|
|
52
|
-
* 5. publish that draft and activate it, so the agent answers immediately;
|
|
53
|
-
* 6. draft again off the published version — the mutable copy authoring
|
|
54
|
-
* edits, and the tag a fresh checkout binds.
|
|
31
|
+
* `options.runtimeVersion` picks the engine and is required: the console
|
|
32
|
+
* always resolves the newest published runtime first, so the create lands on
|
|
33
|
+
* apollo's runtime-v2 path — an agent anchored directly on its project (none
|
|
34
|
+
* of the v1 scoping tiers), seeded with one empty editable draft (the tag the
|
|
35
|
+
* fresh checkout binds). The agent has no live version until the first
|
|
36
|
+
* push + publish.
|
|
55
37
|
*
|
|
56
|
-
* `options.
|
|
57
|
-
*
|
|
58
|
-
* it the clone inherits the template's own runtime — whatever build that
|
|
59
|
-
* template was last pushed against, which is how a new agent ends up
|
|
60
|
-
* recorded on an engine the catalog no longer offers.
|
|
38
|
+
* `options.fromTemplate` names an explicit clone source instead of the empty
|
|
39
|
+
* draft; the agent then goes live on the template's content immediately.
|
|
61
40
|
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
* because a blind re-run would allocate a second network and a second agent.
|
|
41
|
+
* A seed failure past the create is annotated by the server — the agent id
|
|
42
|
+
* is in the message — and surfaces verbatim, so it is never retried blindly.
|
|
65
43
|
*/
|
|
66
|
-
export declare function createAgent(context: Context, clients:
|
|
67
|
-
|
|
44
|
+
export declare function createAgent(context: Context, clients: {
|
|
45
|
+
management: ManagementClient;
|
|
46
|
+
}, name: string, options: {
|
|
47
|
+
fromTemplate?: string;
|
|
48
|
+
runtimeVersion: string;
|
|
68
49
|
}): Promise<Agent>;
|
|
69
50
|
export declare function bindAgent(context: Context, agent: Agent, cwd: string, options?: {
|
|
70
51
|
versionTag?: string;
|
|
@@ -2,7 +2,7 @@ import { homedir } from "node:os";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { findLiveVersion, } from "../api/management.js";
|
|
4
4
|
import { patchBinding, setDefaultProject, writeBinding, } from "../config/index.js";
|
|
5
|
-
import {
|
|
5
|
+
import { ConfigError } from "../errors/index.js";
|
|
6
6
|
import { resolveRuntimeVersion } from "../runtime-version/index.js";
|
|
7
7
|
/**
|
|
8
8
|
* Patch the checkout's existing `.apollorc`. Bindings are never invented in
|
|
@@ -80,140 +80,34 @@ export async function listAgents(context, management, name) {
|
|
|
80
80
|
return management.listAgents(context.projectId, name);
|
|
81
81
|
}
|
|
82
82
|
/**
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*/
|
|
89
|
-
export const TEMPLATE_AGENT_ID = "6a63896e1bd618f292ba6684";
|
|
90
|
-
/**
|
|
91
|
-
* Project an agent-settings record onto the published agent shape, the same
|
|
92
|
-
* way apollo-api does: the id is the record's own, `project_id` is the scope's
|
|
93
|
-
* account and `live_version_id` carries the active *tag* (REPORTS-26).
|
|
94
|
-
*/
|
|
95
|
-
function agentFromRecord(record, projectId) {
|
|
96
|
-
return {
|
|
97
|
-
id: record.id,
|
|
98
|
-
project_id: record.scope.account_id ?? projectId,
|
|
99
|
-
name: record.name,
|
|
100
|
-
...(record.active_version_tag === undefined
|
|
101
|
-
? {}
|
|
102
|
-
: { live_version_id: record.active_version_tag }),
|
|
103
|
-
created_at: record.created_at,
|
|
104
|
-
updated_at: record.updated_at,
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Create an agent by running the clone-from-template sequence the console
|
|
109
|
-
* needs, against agent-settings and the network service directly. It is
|
|
110
|
-
* step-for-step what apollo-api's create endpoint does internally — the only
|
|
111
|
-
* difference is that the template is named here rather than resolved from a
|
|
112
|
-
* category:
|
|
83
|
+
* Create an agent through apollo's management surface — one POST; apollo owns
|
|
84
|
+
* the whole server-side sequence (scoping, seeding, publish/activate when a
|
|
85
|
+
* template is involved) and enforces real permissions on the way in, which is
|
|
86
|
+
* why the console no longer runs the clone sequence against the v1 services
|
|
87
|
+
* itself.
|
|
113
88
|
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
* the bundle, the build bundle and the evaluation scores into the agent;
|
|
121
|
-
* 5. publish that draft and activate it, so the agent answers immediately;
|
|
122
|
-
* 6. draft again off the published version — the mutable copy authoring
|
|
123
|
-
* edits, and the tag a fresh checkout binds.
|
|
89
|
+
* `options.runtimeVersion` picks the engine and is required: the console
|
|
90
|
+
* always resolves the newest published runtime first, so the create lands on
|
|
91
|
+
* apollo's runtime-v2 path — an agent anchored directly on its project (none
|
|
92
|
+
* of the v1 scoping tiers), seeded with one empty editable draft (the tag the
|
|
93
|
+
* fresh checkout binds). The agent has no live version until the first
|
|
94
|
+
* push + publish.
|
|
124
95
|
*
|
|
125
|
-
* `options.
|
|
126
|
-
*
|
|
127
|
-
* it the clone inherits the template's own runtime — whatever build that
|
|
128
|
-
* template was last pushed against, which is how a new agent ends up
|
|
129
|
-
* recorded on an engine the catalog no longer offers.
|
|
96
|
+
* `options.fromTemplate` names an explicit clone source instead of the empty
|
|
97
|
+
* draft; the agent then goes live on the template's content immediately.
|
|
130
98
|
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
* because a blind re-run would allocate a second network and a second agent.
|
|
99
|
+
* A seed failure past the create is annotated by the server — the agent id
|
|
100
|
+
* is in the message — and surfaces verbatim, so it is never retried blindly.
|
|
134
101
|
*/
|
|
135
|
-
export async function createAgent(context, clients, name,
|
|
102
|
+
export async function createAgent(context, clients, name, options) {
|
|
136
103
|
const projectId = context.projectId;
|
|
137
104
|
if (!projectId)
|
|
138
105
|
throw new ConfigError("Select a project first.");
|
|
139
|
-
|
|
140
|
-
if (!organizationId) {
|
|
141
|
-
throw new ConfigError("Select an organization first.", "Run `apollo org use` and try again.");
|
|
142
|
-
}
|
|
143
|
-
// Stamped as created_by/published_by on every record the sequence writes.
|
|
144
|
-
const userId = context.userId;
|
|
145
|
-
if (!userId) {
|
|
146
|
-
throw new AuthError("The stored credential has no user id.", "Run `apollo login` again to refresh it.");
|
|
147
|
-
}
|
|
148
|
-
// Everything below is checked here rather than left to the server: past the
|
|
149
|
-
// network call these would each fail with an agent already created.
|
|
150
|
-
const template = await clients.agentSettings.getAgent(templateAgentId);
|
|
151
|
-
if (template.kind !== "template") {
|
|
152
|
-
throw new ConfigError(`Agent ${templateAgentId} is not a template (kind=${template.kind}).`, "Pass a template agent's id with --template.");
|
|
153
|
-
}
|
|
154
|
-
const categoryId = template.scope.network_category_id;
|
|
155
|
-
if (!categoryId) {
|
|
156
|
-
throw new ConfigError(`Template ${template.name} has no category scope to create the agent in.`, "Pass a different template agent's id with --template.");
|
|
157
|
-
}
|
|
158
|
-
// The clone reads the template's *active* version, not its latest.
|
|
159
|
-
if (!template.active_version_id) {
|
|
160
|
-
throw new ConfigError(`Template ${template.name} has no active version to clone.`, "Publish and activate a version on the template, or pass --template <id>.");
|
|
161
|
-
}
|
|
162
|
-
const network = await clients.network.create({
|
|
163
|
-
name,
|
|
164
|
-
organizationId,
|
|
165
|
-
accountId: projectId,
|
|
166
|
-
categoryId,
|
|
167
|
-
});
|
|
168
|
-
const created = await clients.agentSettings.createAgent({
|
|
106
|
+
return clients.management.createAgent(projectId, {
|
|
169
107
|
name,
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
network_id: network.id,
|
|
173
|
-
account_id: projectId,
|
|
174
|
-
organization_id: organizationId,
|
|
175
|
-
network_category_id: categoryId,
|
|
176
|
-
},
|
|
177
|
-
kind: "regular",
|
|
178
|
-
bundleMode: true,
|
|
179
|
-
createdBy: userId,
|
|
180
|
-
agentMetadata: template.agent_metadata ?? {},
|
|
108
|
+
...(options.fromTemplate ? { fromTemplate: options.fromTemplate } : {}),
|
|
109
|
+
runtimeVersion: options.runtimeVersion,
|
|
181
110
|
});
|
|
182
|
-
try {
|
|
183
|
-
const imported = await clients.agentSettings.createDraft(created.id, {
|
|
184
|
-
source: "template",
|
|
185
|
-
fromTemplate: template.id,
|
|
186
|
-
label: "Template Import",
|
|
187
|
-
notes: `Imported from template ${template.name}`,
|
|
188
|
-
createdBy: userId,
|
|
189
|
-
...(options.runtimeVersion
|
|
190
|
-
? { runtimeVersion: options.runtimeVersion }
|
|
191
|
-
: {}),
|
|
192
|
-
});
|
|
193
|
-
await clients.agentSettings.publishVersion(created.id, imported.id, userId);
|
|
194
|
-
const live = await clients.agentSettings.activateVersion(created.id, imported.id);
|
|
195
|
-
// The seeded draft clones the version above, so it inherits the runtime
|
|
196
|
-
// already stamped there — passed again so the two never disagree if that
|
|
197
|
-
// clone ever stops carrying it.
|
|
198
|
-
await clients.agentSettings.createDraft(created.id, {
|
|
199
|
-
source: "version",
|
|
200
|
-
fromVersion: imported.id,
|
|
201
|
-
label: "Initial Version",
|
|
202
|
-
notes: "Initial Version",
|
|
203
|
-
createdBy: userId,
|
|
204
|
-
...(options.runtimeVersion
|
|
205
|
-
? { runtimeVersion: options.runtimeVersion }
|
|
206
|
-
: {}),
|
|
207
|
-
});
|
|
208
|
-
return agentFromRecord(live, projectId);
|
|
209
|
-
}
|
|
210
|
-
catch (error) {
|
|
211
|
-
throw new CliError(`Agent ${created.name} (${created.id}) was created, but seeding its first version from ${template.name} failed: ${error instanceof Error ? error.message : String(error)}`, {
|
|
212
|
-
code: "AGENT_SEED_FAILED",
|
|
213
|
-
cause: error,
|
|
214
|
-
suggestion: `Do not re-run create — it would allocate a second agent. Recover with \`apollo agent import ${created.id}\` or seed a version with \`apollo version create --template ${template.id}\`.`,
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
111
|
}
|
|
218
112
|
export async function bindAgent(context, agent, cwd, options = {}) {
|
|
219
113
|
const binding = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hierarchy.js","sourceRoot":"","sources":["../../../src/services/hierarchy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAI7B,OAAO,EACL,eAAe,GAKhB,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"hierarchy.js","sourceRoot":"","sources":["../../../src/services/hierarchy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAI7B,OAAO,EACL,eAAe,GAK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C5D,CAAC;IACD,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC,cAAc,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IACtE,MAAM,OAAO,GAAG,MAAM,aAAa,CAAC,OAAO,EAAE;QAC3C,WAAW,EAAE,OAAO,CAAC,WAAW;KACjC,CAAC,CAAC;IACH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AAC9B,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,OAAgB;IAChD,OAAO,aAAa,CAAC,OAAO,EAAE;QAC5B,QAAQ,EAAE,SAAS;QACnB,WAAW,EAAE,SAAS;KACvB,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -81,6 +81,13 @@ export async function sendMessage(context, runtime, input) {
|
|
|
81
81
|
text: input.text,
|
|
82
82
|
user_id: requireUserId(context),
|
|
83
83
|
...(input.threadId ? { thread_id: input.threadId } : {}),
|
|
84
|
+
...(!input.threadId && context.orgId && context.projectId
|
|
85
|
+
? {
|
|
86
|
+
origin_type: "cli",
|
|
87
|
+
organization_id: context.orgId,
|
|
88
|
+
project_id: context.projectId,
|
|
89
|
+
}
|
|
90
|
+
: {}),
|
|
84
91
|
agent_variables: parseVariables(input.variables),
|
|
85
92
|
...(agentId
|
|
86
93
|
? {
|
|
@@ -102,6 +109,8 @@ export function createThread(context, runtime, versionId) {
|
|
|
102
109
|
...(context.versionTag ? { versionTag: context.versionTag } : {}),
|
|
103
110
|
userId: requireUserId(context),
|
|
104
111
|
environment: context.environment,
|
|
112
|
+
...(context.orgId ? { organizationId: context.orgId } : {}),
|
|
113
|
+
...(context.projectId ? { projectId: context.projectId } : {}),
|
|
105
114
|
});
|
|
106
115
|
}
|
|
107
116
|
export function getThread(runtime, threadId) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messaging.js","sourceRoot":"","sources":["../../../src/services/messaging.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,C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,EAAE;IAEhE,OAAO,OAAO,CAAC,gBAAgB,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE;QACrD,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC;QAC9B,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,YAAY,CAC1B,OAAyB,EACzB,QAAgB;IAEhB,OAAO,OAAO,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,KAAK,CACnB,OAAyB,EACzB,QAAgB,EAChB,aAAsB;IAEtB,OAAO,aAAa;QAClB,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,aAAa,CAAC;QACzC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,OAAyB,EACzB,aAAqB;IAErB,OAAO,OAAO,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Vault secrets service — name + scope based management of user-owned
|
|
3
|
-
* secrets.
|
|
4
|
-
* agent-settings own storage
|
|
5
|
-
* there, so name-based
|
|
3
|
+
* secrets. Apollo-api's internal management proxy
|
|
4
|
+
* (`/internal/management/v1/vault/secrets`) and agent-settings own storage
|
|
5
|
+
* and encryption; get/delete/rotate are id-based there, so name-based
|
|
6
|
+
* operations resolve through the list first.
|
|
6
7
|
*
|
|
7
|
-
* Values only ever travel in the create body. Every read is
|
|
8
|
-
* a masked `preview`, so no output here needs masking.
|
|
8
|
+
* Values only ever travel in the create or rotate body. Every read is
|
|
9
|
+
* metadata plus a masked `preview`, so no output here needs masking.
|
|
9
10
|
*
|
|
10
11
|
* Scope levels: `agent` > `project` > `org` — resolution at runtime picks
|
|
11
12
|
* the most specific name. Wire vocabulary stays inside `api/vault.ts`.
|
|
@@ -30,7 +31,7 @@ export interface SetSecretParams {
|
|
|
30
31
|
level: VaultScopeLevel;
|
|
31
32
|
description?: string;
|
|
32
33
|
}
|
|
33
|
-
/** Create or rotate (
|
|
34
|
+
/** Create (POST) or rotate (PATCH by id) a secret at this name + scope. */
|
|
34
35
|
export declare function setSecret(context: Context, params: SetSecretParams, options?: VaultServiceOptions): Promise<VaultSecret>;
|
|
35
36
|
/** Secrets visible from the current scope chain, masked, sorted by name. */
|
|
36
37
|
export declare function listSecrets(context: Context, options?: VaultServiceOptions): Promise<VaultSecret[]>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Vault secrets service — name + scope based management of user-owned
|
|
3
|
-
* secrets.
|
|
4
|
-
* agent-settings own storage
|
|
5
|
-
* there, so name-based
|
|
3
|
+
* secrets. Apollo-api's internal management proxy
|
|
4
|
+
* (`/internal/management/v1/vault/secrets`) and agent-settings own storage
|
|
5
|
+
* and encryption; get/delete/rotate are id-based there, so name-based
|
|
6
|
+
* operations resolve through the list first.
|
|
6
7
|
*
|
|
7
|
-
* Values only ever travel in the create body. Every read is
|
|
8
|
-
* a masked `preview`, so no output here needs masking.
|
|
8
|
+
* Values only ever travel in the create or rotate body. Every read is
|
|
9
|
+
* metadata plus a masked `preview`, so no output here needs masking.
|
|
9
10
|
*
|
|
10
11
|
* Scope levels: `agent` > `project` > `org` — resolution at runtime picks
|
|
11
12
|
* the most specific name. Wire vocabulary stays inside `api/vault.ts`.
|
|
@@ -54,7 +55,7 @@ export function buildVaultScope(level, context) {
|
|
|
54
55
|
}
|
|
55
56
|
return vaultScopeFor(level, scopeIds(context));
|
|
56
57
|
}
|
|
57
|
-
/** Create or rotate (
|
|
58
|
+
/** Create (POST) or rotate (PATCH by id) a secret at this name + scope. */
|
|
58
59
|
export async function setSecret(context, params, options = {}) {
|
|
59
60
|
validateSecretName(params.name);
|
|
60
61
|
if (!params.value) {
|
|
@@ -66,6 +67,15 @@ export async function setSecret(context, params, options = {}) {
|
|
|
66
67
|
// buildVaultScope validates the level's id is present; agent-level writes
|
|
67
68
|
// carry the agent id itself instead of a scope object.
|
|
68
69
|
const scope = buildVaultScope(params.level, context);
|
|
70
|
+
const vault = clientsFor(context, options).vault;
|
|
71
|
+
const existing = (await vault.listSecrets(scopeIds(context))).find((secret) => secret.name === params.name && vaultScopeLevelOf(secret.scope) === params.level);
|
|
72
|
+
if (existing) {
|
|
73
|
+
return vault.updateSecret(existing.id, {
|
|
74
|
+
updated_by: context.userId,
|
|
75
|
+
value: params.value,
|
|
76
|
+
...(params.description ? { description: params.description } : {}),
|
|
77
|
+
});
|
|
78
|
+
}
|
|
69
79
|
const body = {
|
|
70
80
|
name: params.name,
|
|
71
81
|
value: params.value,
|
|
@@ -74,7 +84,7 @@ export async function setSecret(context, params, options = {}) {
|
|
|
74
84
|
created_by: context.userId,
|
|
75
85
|
updated_by: context.userId,
|
|
76
86
|
};
|
|
77
|
-
return
|
|
87
|
+
return vault.createSecret(body);
|
|
78
88
|
}
|
|
79
89
|
/** Secrets visible from the current scope chain, masked, sorted by name. */
|
|
80
90
|
export async function listSecrets(context, options = {}) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vault.js","sourceRoot":"","sources":["../../../src/services/vault.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"vault.js","sourceRoot":"","sources":["../../../src/services/vault.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,gBAAgB,GAMjB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAgB,MAAM,cAAc,CAAC;AAE3D,OAAO,EAAE,gBAAgB,EAAwB,CAAC;AAElD,+EAA+E;AAC/E,MAAM,mBAAmB,GAAG,mBAAmB,CAAC;AAOhD,SAAS,UAAU,CAAC,OAAgB,EAAE,OAA4B;IAChE,OA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AED,6EAA6E;AAC7E,MAAM,UAAU,eAAe,CAAC,KAAoC;IAClE,OAAO,iBAAiB,CAAC,KAAK,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -15,7 +15,7 @@ import { captureLog } from "@aui.io/apollo-core/api/capture.js";
|
|
|
15
15
|
import { createClients } from "@aui.io/apollo-core/services/clients.js";
|
|
16
16
|
import { runDoctor } from "@aui.io/apollo-core/services/doctor.js";
|
|
17
17
|
import { setEnvironment } from "@aui.io/apollo-core/services/env.service.js";
|
|
18
|
-
import { agentRuntimeVersion, bindAgent, createAgent, createProject, initialVersionTag, latestPublishedRuntimeVersion, listAgents, listOrganizations, listProjects,
|
|
18
|
+
import { agentRuntimeVersion, bindAgent, createAgent, createProject, initialVersionTag, latestPublishedRuntimeVersion, listAgents, listOrganizations, listProjects, unlinkAgent, useOrganization, useProject, useVersion, } from "@aui.io/apollo-core/services/hierarchy.js";
|
|
19
19
|
import { createThread, debugInteraction, listAgentThreads, listMessages, listThreads, resolveSendVersion, trace as fetchTrace, } from "@aui.io/apollo-core/services/messaging.js";
|
|
20
20
|
import { createCollection, createEndpoint, deleteEndpoint, deleteMockDb, describeMockDb, executeEndpoint, exportMockDb, getEndpoint, inspectSession, listCollections, listEndpoints, normalizeSchema, parseJsonFlag, provisionMockDb, resetSession, rotateMgmtKey, rotateRuntimeKey, seedRows, statusMockDb, storedKeys, updateCollection, updateEndpoint, wireMockDbConnection, } from "@aui.io/apollo-core/services/mockdb.js";
|
|
21
21
|
import { listSecrets, parseVaultScopeLevel, removeSecretByName, scopeLevelLabel, setSecret, } from "@aui.io/apollo-core/services/vault.js";
|
|
@@ -1084,7 +1084,18 @@ export async function runSheetAction(commandName, values, context) {
|
|
|
1084
1084
|
};
|
|
1085
1085
|
}
|
|
1086
1086
|
case "agent-create": {
|
|
1087
|
-
|
|
1087
|
+
// Resolved before the agent exists: the runtime version picks apollo's
|
|
1088
|
+
// create flow (a v2 value creates a project-anchored agent, no network
|
|
1089
|
+
// tier) and is stamped on the drafts it seeds. Required — the server
|
|
1090
|
+
// default would silently create a legacy v1 agent.
|
|
1091
|
+
const runtimeVersion = await latestPublishedRuntimeVersion(clients);
|
|
1092
|
+
if (!runtimeVersion) {
|
|
1093
|
+
throw new ConfigError("No published runtime version is available to create the agent on.", "Check /runtime and try again.");
|
|
1094
|
+
}
|
|
1095
|
+
const created = await createAgent(context, clients, text("name"), {
|
|
1096
|
+
runtimeVersion,
|
|
1097
|
+
...(text("template") ? { fromTemplate: text("template") } : {}),
|
|
1098
|
+
});
|
|
1088
1099
|
const directory = text("dir")
|
|
1089
1100
|
? path.resolve(text("dir"))
|
|
1090
1101
|
: await defaultCheckoutDir(homedir(), context.profile, context.environment, created.name, created.id);
|
|
@@ -1094,12 +1105,8 @@ export async function runSheetAction(commandName, values, context) {
|
|
|
1094
1105
|
// (REPORTS-26); best-effort — unbound stays recoverable via
|
|
1095
1106
|
// /version-use.
|
|
1096
1107
|
const seededTag = await initialVersionTag(clients.management, created);
|
|
1097
|
-
//
|
|
1098
|
-
|
|
1099
|
-
const runtimeVersion = await latestPublishedRuntimeVersion(clients);
|
|
1100
|
-
const pinnedClients = runtimeVersion
|
|
1101
|
-
? createClients({ ...context, runtimeVersion })
|
|
1102
|
-
: clients;
|
|
1108
|
+
// Skills/schemas below are served from that same engine.
|
|
1109
|
+
const pinnedClients = createClients({ ...context, runtimeVersion });
|
|
1103
1110
|
await bindAgent(context, created, directory, {
|
|
1104
1111
|
...(seededTag ? { versionTag: seededTag } : {}),
|
|
1105
1112
|
...(runtimeVersion ? { runtimeVersion } : {}),
|