@nylorun/runtime 0.32.0-beta → 0.34.0-beta
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/CHANGELOG.md +36 -0
- package/dist/api/ag-ui/routes.js +4 -2
- package/dist/api/ag-ui/translate.js +3 -1
- package/dist/api/components.d.ts +35 -0
- package/dist/api/components.js +3 -1
- package/dist/api/http/routes/sessions.js +63 -2
- package/dist/api/openapi.js +3 -0
- package/dist/gates/credential-provider.d.ts +42 -0
- package/dist/gates/credential-provider.js +140 -0
- package/dist/gates/egress-credentials.d.ts +12 -0
- package/dist/gates/egress-credentials.js +60 -6
- package/dist/gates/egress.d.ts +14 -1
- package/dist/gates/egress.js +67 -19
- package/dist/gates/handler.js +2 -2
- package/dist/gates/in-process.d.ts +4 -3
- package/dist/gates/in-process.js +11 -5
- package/dist/gates/tenant-vaults.d.ts +4 -3
- package/dist/gates/tenant-vaults.js +2 -2
- package/dist/harness-api/start.js +30 -3
- package/dist/host/gates.d.ts +8 -1
- package/dist/host/gates.js +6 -1
- package/dist/host/main.js +17 -1
- package/dist/host/stack-config.d.ts +17 -1
- package/dist/host/stack-config.js +47 -1
- package/dist/management-openapi.json +61 -5
- package/dist/model/descriptor.d.ts +5 -4
- package/dist/model/descriptor.js +4 -3
- package/dist/model/pi-model.js +17 -1
- package/dist/openapi.json +516 -2
- package/dist/tenant/context.d.ts +12 -1
- package/dist/tenant/runtime.d.ts +6 -0
- package/dist/tenant/runtime.js +1 -0
- package/dist/tenant/session-model.d.ts +16 -0
- package/dist/tenant/session-model.js +46 -0
- package/dist/tuning.d.ts +6 -0
- package/dist/tuning.js +14 -0
- package/dist/vault/host-identity.d.ts +24 -0
- package/dist/vault/host-identity.js +35 -0
- package/dist/vault/host-model.d.ts +9 -5
- package/dist/vault/host-model.js +30 -19
- package/dist/vault/service.d.ts +18 -2
- package/dist/vault/service.js +52 -9
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +6 -6
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"openapi": "3.2.0",
|
|
3
3
|
"info": {
|
|
4
4
|
"title": "Nylorun Management API",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.34.0-beta",
|
|
6
6
|
"x-nylorun-protocol": {
|
|
7
7
|
"min": 16,
|
|
8
8
|
"max": 18,
|
|
@@ -34,7 +34,10 @@
|
|
|
34
34
|
"traces",
|
|
35
35
|
"artifact-reads",
|
|
36
36
|
"gateway-credentials",
|
|
37
|
-
"agent-folders"
|
|
37
|
+
"agent-folders",
|
|
38
|
+
"session-model",
|
|
39
|
+
"model-host-identity",
|
|
40
|
+
"credential-provider"
|
|
38
41
|
]
|
|
39
42
|
},
|
|
40
43
|
"description": "For operators: the Tenant's models, vaults, signing keys, settings and application keys, at `/v1/tenant/*` on the Tenant's URL, through `@nylorun/admin`. Every operation takes a management key, acting as itself: never for a subject and never from a browser. Management keys are issued only on the Tenant's machine (`nylorun tenant keys put <id> --management`) or from `NYLORUN_MANAGEMENT_KEY_FILE`."
|
|
@@ -427,7 +430,8 @@
|
|
|
427
430
|
"enum": [
|
|
428
431
|
"api_key",
|
|
429
432
|
"oauth",
|
|
430
|
-
"workload"
|
|
433
|
+
"workload",
|
|
434
|
+
"host_identity"
|
|
431
435
|
]
|
|
432
436
|
},
|
|
433
437
|
"baseUrl": {
|
|
@@ -1137,6 +1141,31 @@
|
|
|
1137
1141
|
"type"
|
|
1138
1142
|
],
|
|
1139
1143
|
"additionalProperties": false
|
|
1144
|
+
},
|
|
1145
|
+
{
|
|
1146
|
+
"type": "object",
|
|
1147
|
+
"properties": {
|
|
1148
|
+
"type": {
|
|
1149
|
+
"type": "string",
|
|
1150
|
+
"enum": [
|
|
1151
|
+
"host_identity"
|
|
1152
|
+
]
|
|
1153
|
+
},
|
|
1154
|
+
"project": {
|
|
1155
|
+
"type": "string",
|
|
1156
|
+
"pattern": "^[a-z][a-z0-9-]{4,28}[a-z0-9]$"
|
|
1157
|
+
},
|
|
1158
|
+
"location": {
|
|
1159
|
+
"type": "string",
|
|
1160
|
+
"pattern": "^[a-z][a-z0-9-]*$"
|
|
1161
|
+
}
|
|
1162
|
+
},
|
|
1163
|
+
"required": [
|
|
1164
|
+
"type",
|
|
1165
|
+
"project",
|
|
1166
|
+
"location"
|
|
1167
|
+
],
|
|
1168
|
+
"additionalProperties": false
|
|
1140
1169
|
}
|
|
1141
1170
|
]
|
|
1142
1171
|
}
|
|
@@ -2680,7 +2709,8 @@
|
|
|
2680
2709
|
"enum": [
|
|
2681
2710
|
"api_key",
|
|
2682
2711
|
"oauth",
|
|
2683
|
-
"workload"
|
|
2712
|
+
"workload",
|
|
2713
|
+
"host_identity"
|
|
2684
2714
|
]
|
|
2685
2715
|
},
|
|
2686
2716
|
"baseUrl": {
|
|
@@ -2860,7 +2890,8 @@
|
|
|
2860
2890
|
"enum": [
|
|
2861
2891
|
"api_key",
|
|
2862
2892
|
"oauth",
|
|
2863
|
-
"workload"
|
|
2893
|
+
"workload",
|
|
2894
|
+
"host_identity"
|
|
2864
2895
|
]
|
|
2865
2896
|
},
|
|
2866
2897
|
"baseUrl": {
|
|
@@ -3170,6 +3201,31 @@
|
|
|
3170
3201
|
"type"
|
|
3171
3202
|
],
|
|
3172
3203
|
"additionalProperties": false
|
|
3204
|
+
},
|
|
3205
|
+
{
|
|
3206
|
+
"type": "object",
|
|
3207
|
+
"properties": {
|
|
3208
|
+
"type": {
|
|
3209
|
+
"type": "string",
|
|
3210
|
+
"enum": [
|
|
3211
|
+
"host_identity"
|
|
3212
|
+
]
|
|
3213
|
+
},
|
|
3214
|
+
"project": {
|
|
3215
|
+
"type": "string",
|
|
3216
|
+
"pattern": "^[a-z][a-z0-9-]{4,28}[a-z0-9]$"
|
|
3217
|
+
},
|
|
3218
|
+
"location": {
|
|
3219
|
+
"type": "string",
|
|
3220
|
+
"pattern": "^[a-z][a-z0-9-]*$"
|
|
3221
|
+
}
|
|
3222
|
+
},
|
|
3223
|
+
"required": [
|
|
3224
|
+
"type",
|
|
3225
|
+
"project",
|
|
3226
|
+
"location"
|
|
3227
|
+
],
|
|
3228
|
+
"additionalProperties": false
|
|
3173
3229
|
}
|
|
3174
3230
|
]
|
|
3175
3231
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* gate takes cannot disagree.
|
|
8
8
|
*/
|
|
9
9
|
import type { Api, Model } from "@earendil-works/pi-ai";
|
|
10
|
-
import { type CustomModelSettings, type HostModelView, type ModelInput } from "@nylorun/core/contracts";
|
|
10
|
+
import { type CustomModelSettings, type HostModelView, type ModelInput, type SessionModelChoice } from "@nylorun/core/contracts";
|
|
11
11
|
import type { ModelDescriptor } from "@nylorun/core/harness-api";
|
|
12
12
|
import type { SessionStore } from "../store/types.js";
|
|
13
13
|
import { type Selection } from "./models.js";
|
|
@@ -36,14 +36,15 @@ export declare const FIXTURE_DESCRIPTOR: ModelDescriptor;
|
|
|
36
36
|
export declare function hostModelDescriptor(binding: ModelBindingView, added?: Readonly<Record<string, readonly ModelInput[]>>): ModelDescriptor | undefined;
|
|
37
37
|
/**
|
|
38
38
|
* The model the Tenant's turns use now: the fixture model's descriptor when the Tenant uses it,
|
|
39
|
-
* else
|
|
39
|
+
* else a session's own model's (`choice`, while its provider is connected), else its active
|
|
40
|
+
* model's; undefined when none is configured (a test's scripted provider, say).
|
|
40
41
|
*/
|
|
41
42
|
export declare function currentModelDescriptor(ctx: {
|
|
42
43
|
readonly store: SessionStore;
|
|
43
44
|
readonly vault: {
|
|
44
|
-
getHostModel(): Promise<HostModelView>;
|
|
45
|
+
getHostModel(choice?: SessionModelChoice): Promise<HostModelView>;
|
|
45
46
|
};
|
|
46
|
-
}): Promise<ModelDescriptor | undefined>;
|
|
47
|
+
}, choice?: SessionModelChoice): Promise<ModelDescriptor | undefined>;
|
|
47
48
|
/**
|
|
48
49
|
* The context window, in tokens, of the Tenant's model now; without one, or one the catalog does
|
|
49
50
|
* not know, it is assumed small (`CUSTOM_MODEL_SETTING_DEFAULTS`), as for a custom endpoint.
|
package/dist/model/descriptor.js
CHANGED
|
@@ -62,16 +62,17 @@ export function hostModelDescriptor(binding, added = {}) {
|
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
64
64
|
* The model the Tenant's turns use now: the fixture model's descriptor when the Tenant uses it,
|
|
65
|
-
* else
|
|
65
|
+
* else a session's own model's (`choice`, while its provider is connected), else its active
|
|
66
|
+
* model's; undefined when none is configured (a test's scripted provider, say).
|
|
66
67
|
*/
|
|
67
|
-
export async function currentModelDescriptor(ctx) {
|
|
68
|
+
export async function currentModelDescriptor(ctx, choice) {
|
|
68
69
|
const { fixture, added } = await ctx.store.tx(async (t) => ({
|
|
69
70
|
fixture: await usesFixtureModel(t),
|
|
70
71
|
added: await readAddedInputs(t),
|
|
71
72
|
}));
|
|
72
73
|
if (fixture)
|
|
73
74
|
return FIXTURE_DESCRIPTOR;
|
|
74
|
-
const view = await ctx.vault.getHostModel();
|
|
75
|
+
const view = await ctx.vault.getHostModel(choice);
|
|
75
76
|
return view.configured ? hostModelDescriptor(view, added) : undefined;
|
|
76
77
|
}
|
|
77
78
|
/**
|
package/dist/model/pi-model.js
CHANGED
|
@@ -8,6 +8,7 @@ import { classifyAssistantError, failure } from "./classify.js";
|
|
|
8
8
|
import { addedInputsOf, describeModel, selectionOf } from "./descriptor.js";
|
|
9
9
|
import { modelsFor } from "./models.js";
|
|
10
10
|
import { callHeaders } from "./call-headers.js";
|
|
11
|
+
import { hostIdentityRefused, VERTEX_ADC_MARKER } from "../vault/host-identity.js";
|
|
11
12
|
import { workloadToken, WorkloadTokenUnavailable } from "../vault/workload-token.js";
|
|
12
13
|
import { NativeBlocks, nativeKindsOf } from "./native-blocks.js";
|
|
13
14
|
import { projectSecrets } from "./settings.js";
|
|
@@ -67,6 +68,12 @@ export function piModel(options = {}) {
|
|
|
67
68
|
throw error;
|
|
68
69
|
}
|
|
69
70
|
}
|
|
71
|
+
// The Host's identity (ADR-71): only while its operator still lends it.
|
|
72
|
+
if (stored.authType === "host_identity") {
|
|
73
|
+
const refused = hostIdentityRefused(stored.provider);
|
|
74
|
+
if (refused)
|
|
75
|
+
return failure("auth", refused, false);
|
|
76
|
+
}
|
|
70
77
|
const secrets = [
|
|
71
78
|
...projectSecrets(root),
|
|
72
79
|
...credentialSecrets(stored.credential),
|
|
@@ -119,6 +126,8 @@ export function piModel(options = {}) {
|
|
|
119
126
|
sessionId: call.executionId,
|
|
120
127
|
cacheRetention: "short",
|
|
121
128
|
...(Object.keys(perCall).length > 0 ? { headers: perCall } : {}),
|
|
129
|
+
// With the Host's identity: where Agent Platform runs the call (ADR-71).
|
|
130
|
+
...(stored.authType === "host_identity" && stored.credential.env ? { env: stored.credential.env } : {}),
|
|
122
131
|
timeoutMs: settings.requestTimeoutMs,
|
|
123
132
|
maxRetries: settings.providerRetries,
|
|
124
133
|
maxRetryDelayMs: settings.maxRetryDelayMs,
|
|
@@ -504,7 +513,11 @@ function idleTimeout(selected, idleTimeoutMs) {
|
|
|
504
513
|
};
|
|
505
514
|
}
|
|
506
515
|
function hostCredentialStore(stored, write) {
|
|
507
|
-
|
|
516
|
+
// The Host's identity (ADR-71): pi-ai's Vertex AI client uses Application Default Credentials
|
|
517
|
+
// for this marker in place of a key.
|
|
518
|
+
let current = stored.authType === "host_identity"
|
|
519
|
+
? { type: "api_key", key: VERTEX_ADC_MARKER }
|
|
520
|
+
: stored.credential;
|
|
508
521
|
// A workload model stores no credential: pi-ai then asks the provider's `resolve` (`modelsFor`).
|
|
509
522
|
const stores = stored.authType !== "workload";
|
|
510
523
|
return {
|
|
@@ -532,6 +545,9 @@ function hostCredentialStore(stored, write) {
|
|
|
532
545
|
};
|
|
533
546
|
}
|
|
534
547
|
function credentialSecrets(credential) {
|
|
548
|
+
// The Host's identity keeps no secret: its project and location stay readable in messages.
|
|
549
|
+
if (credential.type === "host_identity")
|
|
550
|
+
return [];
|
|
535
551
|
const values = [credential.key, credential.access, credential.refresh];
|
|
536
552
|
if (credential.env)
|
|
537
553
|
values.push(...Object.values(credential.env));
|