@xemahq/agent-session-runtime 0.6.7 → 0.8.0
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 +6 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/agent-resolution.d.ts.map +1 -1
- package/dist/lib/agent-resolution.js.map +1 -1
- package/dist/lib/dispatch-contract.d.ts +2 -1
- package/dist/lib/dispatch-contract.d.ts.map +1 -1
- package/dist/lib/launch-identity/canonical-contract.d.ts +22 -0
- package/dist/lib/launch-identity/canonical-contract.d.ts.map +1 -0
- package/dist/lib/launch-identity/canonical-contract.js +229 -0
- package/dist/lib/launch-identity/canonical-contract.js.map +1 -0
- package/dist/lib/launch-identity/compiled-session-launch-plan-store.d.ts +44 -0
- package/dist/lib/launch-identity/compiled-session-launch-plan-store.d.ts.map +1 -0
- package/dist/lib/launch-identity/compiled-session-launch-plan-store.js +116 -0
- package/dist/lib/launch-identity/compiled-session-launch-plan-store.js.map +1 -0
- package/dist/lib/launch-identity/compiled-session-launch-plan.d.ts +84 -0
- package/dist/lib/launch-identity/compiled-session-launch-plan.d.ts.map +1 -0
- package/dist/lib/launch-identity/compiled-session-launch-plan.js +382 -0
- package/dist/lib/launch-identity/compiled-session-launch-plan.js.map +1 -0
- package/dist/lib/launch-identity/index.d.ts +7 -0
- package/dist/lib/launch-identity/index.d.ts.map +1 -0
- package/dist/lib/launch-identity/index.js +23 -0
- package/dist/lib/launch-identity/index.js.map +1 -0
- package/dist/lib/launch-identity/runtime-template-key.d.ts +30 -0
- package/dist/lib/launch-identity/runtime-template-key.d.ts.map +1 -0
- package/dist/lib/launch-identity/runtime-template-key.js +69 -0
- package/dist/lib/launch-identity/runtime-template-key.js.map +1 -0
- package/dist/lib/launch-identity/session-binding.d.ts +24 -0
- package/dist/lib/launch-identity/session-binding.d.ts.map +1 -0
- package/dist/lib/launch-identity/session-binding.js +62 -0
- package/dist/lib/launch-identity/session-binding.js.map +1 -0
- package/dist/lib/launch-identity/thread-reuse-key.d.ts +19 -0
- package/dist/lib/launch-identity/thread-reuse-key.d.ts.map +1 -0
- package/dist/lib/launch-identity/thread-reuse-key.js +46 -0
- package/dist/lib/launch-identity/thread-reuse-key.js.map +1 -0
- package/package.json +7 -5
- package/src/index.ts +1 -0
- package/src/lib/agent-resolution.ts +15 -4
- package/src/lib/dispatch-contract.ts +4 -9
- package/src/lib/launch-identity/canonical-contract.ts +352 -0
- package/src/lib/launch-identity/compiled-session-launch-plan-store.ts +178 -0
- package/src/lib/launch-identity/compiled-session-launch-plan.ts +681 -0
- package/src/lib/launch-identity/index.ts +6 -0
- package/src/lib/launch-identity/runtime-template-key.ts +143 -0
- package/src/lib/launch-identity/session-binding.ts +152 -0
- package/src/lib/launch-identity/thread-reuse-key.ts +93 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { type CanonicalJsonValue } from './canonical-contract';
|
|
2
|
+
import { type RuntimeTemplateKey, RuntimeTemplateTenantDependency, RuntimeTemplateTrustPolicy } from './runtime-template-key';
|
|
3
|
+
export declare enum LaunchPlanBindingSlotKind {
|
|
4
|
+
OrganizationId = "organization-id",
|
|
5
|
+
ProjectId = "project-id",
|
|
6
|
+
UserId = "user-id",
|
|
7
|
+
SessionId = "session-id",
|
|
8
|
+
ThreadId = "thread-id",
|
|
9
|
+
InvocationId = "invocation-id",
|
|
10
|
+
DomainRef = "domain-ref",
|
|
11
|
+
Input = "input",
|
|
12
|
+
DynamicContext = "dynamic-context",
|
|
13
|
+
StorageAllocationRef = "storage-allocation-ref",
|
|
14
|
+
WorkingFileSourceRef = "working-file-source-ref",
|
|
15
|
+
OutputRouteRef = "output-route-ref",
|
|
16
|
+
ActorTokenRef = "actor-token-ref",
|
|
17
|
+
ServiceTokenRef = "service-token-ref",
|
|
18
|
+
ProviderTokenRef = "provider-token-ref",
|
|
19
|
+
CredentialGrantRef = "credential-grant-ref",
|
|
20
|
+
DatabaseGrantRef = "database-grant-ref",
|
|
21
|
+
SecretRef = "secret-ref"
|
|
22
|
+
}
|
|
23
|
+
export declare enum LaunchPlanBindingSlotCardinality {
|
|
24
|
+
One = "one",
|
|
25
|
+
Many = "many"
|
|
26
|
+
}
|
|
27
|
+
export interface LaunchPlanBindingSlot {
|
|
28
|
+
readonly name: string;
|
|
29
|
+
readonly kind: LaunchPlanBindingSlotKind;
|
|
30
|
+
readonly cardinality: LaunchPlanBindingSlotCardinality;
|
|
31
|
+
readonly required: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface PinnedLaunchResource {
|
|
34
|
+
readonly kind: string;
|
|
35
|
+
readonly ref: string;
|
|
36
|
+
readonly revisionRef: string;
|
|
37
|
+
readonly contentHash: string;
|
|
38
|
+
}
|
|
39
|
+
export interface CompiledWorkspaceLaunchPlan {
|
|
40
|
+
readonly manifestRef: string;
|
|
41
|
+
readonly manifestHash: string;
|
|
42
|
+
readonly structure: Readonly<Record<string, CanonicalJsonValue>>;
|
|
43
|
+
readonly layout: Readonly<Record<string, CanonicalJsonValue>>;
|
|
44
|
+
}
|
|
45
|
+
export interface CompiledRuntimeRequirements {
|
|
46
|
+
readonly runtimeRef: string;
|
|
47
|
+
readonly runtimeRevision: string;
|
|
48
|
+
readonly imageDigest: string;
|
|
49
|
+
readonly requirementsHash: string;
|
|
50
|
+
readonly requirements: Readonly<Record<string, CanonicalJsonValue>>;
|
|
51
|
+
}
|
|
52
|
+
export interface LaunchPolicyCompatibility {
|
|
53
|
+
readonly tenantDependency: RuntimeTemplateTenantDependency;
|
|
54
|
+
readonly trustPolicy: RuntimeTemplateTrustPolicy;
|
|
55
|
+
readonly compatibleSurfaces: readonly string[];
|
|
56
|
+
readonly policies: readonly PinnedLaunchResource[];
|
|
57
|
+
}
|
|
58
|
+
export interface CompiledOutputSurfaceSchema {
|
|
59
|
+
readonly kind: string;
|
|
60
|
+
readonly schemaRef: string;
|
|
61
|
+
readonly schemaHash: string;
|
|
62
|
+
readonly schema: Readonly<Record<string, CanonicalJsonValue>>;
|
|
63
|
+
}
|
|
64
|
+
export interface CompiledSessionLaunchPlan {
|
|
65
|
+
readonly schemaVersion: 1;
|
|
66
|
+
readonly runtimeTemplateKey: RuntimeTemplateKey;
|
|
67
|
+
readonly agent: PinnedLaunchResource;
|
|
68
|
+
readonly subagents: readonly PinnedLaunchResource[];
|
|
69
|
+
readonly skills: readonly PinnedLaunchResource[];
|
|
70
|
+
readonly tools: readonly PinnedLaunchResource[];
|
|
71
|
+
readonly mcpDescriptors: readonly PinnedLaunchResource[];
|
|
72
|
+
readonly capabilityDescriptors: readonly PinnedLaunchResource[];
|
|
73
|
+
readonly workspace: CompiledWorkspaceLaunchPlan;
|
|
74
|
+
readonly runtimeRequirements: CompiledRuntimeRequirements;
|
|
75
|
+
readonly policyCompatibility: LaunchPolicyCompatibility;
|
|
76
|
+
readonly outputSurface: CompiledOutputSurfaceSchema;
|
|
77
|
+
readonly bindingSlots: readonly LaunchPlanBindingSlot[];
|
|
78
|
+
}
|
|
79
|
+
export declare function createCompiledSessionLaunchPlan(input: unknown): CompiledSessionLaunchPlan;
|
|
80
|
+
export declare function encodeCompiledSessionLaunchPlan(input: CompiledSessionLaunchPlan): string;
|
|
81
|
+
export declare function decodeCompiledSessionLaunchPlan(encoded: string): CompiledSessionLaunchPlan;
|
|
82
|
+
export declare function hashCompiledSessionLaunchPlan(input: CompiledSessionLaunchPlan): string;
|
|
83
|
+
export declare function hashCompiledWorkspaceLaunchPlan(input: CompiledWorkspaceLaunchPlan): string;
|
|
84
|
+
//# sourceMappingURL=compiled-session-launch-plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compiled-session-launch-plan.d.ts","sourceRoot":"","sources":["../../../src/lib/launch-identity/compiled-session-launch-plan.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,kBAAkB,EAUxB,MAAM,sBAAsB,CAAC;AAC9B,OAAO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EAAE,CAAC;IACzD,QAAQ,CAAC,qBAAqB,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAChE,QAAQ,CAAC,SAAS,EAAE,2BAA2B,CAAC;IAChD,QAAQ,CAAC,mBAAmB,EAAE,2BAA2B,CAAC;IAC1D,QAAQ,CAAC,mBAAmB,EAAE,yBAAyB,CAAC;IACxD,QAAQ,CAAC,aAAa,EAAE,2BAA2B,CAAC;IACpD,QAAQ,CAAC,YAAY,EAAE,SAAS,qBAAqB,EAAE,CAAC;CACzD;AA8FD,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,OAAO,GACb,yBAAyB,CA+E3B;AAED,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,yBAAyB,GAC/B,MAAM,CAER;AAED,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,MAAM,GACd,yBAAyB,CAU3B;AAED,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,yBAAyB,GAC/B,MAAM,CAER;AAED,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,2BAA2B,GACjC,MAAM,CAER"}
|
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LaunchPlanBindingSlotCardinality = exports.LaunchPlanBindingSlotKind = void 0;
|
|
4
|
+
exports.createCompiledSessionLaunchPlan = createCompiledSessionLaunchPlan;
|
|
5
|
+
exports.encodeCompiledSessionLaunchPlan = encodeCompiledSessionLaunchPlan;
|
|
6
|
+
exports.decodeCompiledSessionLaunchPlan = decodeCompiledSessionLaunchPlan;
|
|
7
|
+
exports.hashCompiledSessionLaunchPlan = hashCompiledSessionLaunchPlan;
|
|
8
|
+
exports.hashCompiledWorkspaceLaunchPlan = hashCompiledWorkspaceLaunchPlan;
|
|
9
|
+
const canonical_contract_1 = require("./canonical-contract");
|
|
10
|
+
const runtime_template_key_1 = require("./runtime-template-key");
|
|
11
|
+
var LaunchPlanBindingSlotKind;
|
|
12
|
+
(function (LaunchPlanBindingSlotKind) {
|
|
13
|
+
LaunchPlanBindingSlotKind["OrganizationId"] = "organization-id";
|
|
14
|
+
LaunchPlanBindingSlotKind["ProjectId"] = "project-id";
|
|
15
|
+
LaunchPlanBindingSlotKind["UserId"] = "user-id";
|
|
16
|
+
LaunchPlanBindingSlotKind["SessionId"] = "session-id";
|
|
17
|
+
LaunchPlanBindingSlotKind["ThreadId"] = "thread-id";
|
|
18
|
+
LaunchPlanBindingSlotKind["InvocationId"] = "invocation-id";
|
|
19
|
+
LaunchPlanBindingSlotKind["DomainRef"] = "domain-ref";
|
|
20
|
+
LaunchPlanBindingSlotKind["Input"] = "input";
|
|
21
|
+
LaunchPlanBindingSlotKind["DynamicContext"] = "dynamic-context";
|
|
22
|
+
LaunchPlanBindingSlotKind["StorageAllocationRef"] = "storage-allocation-ref";
|
|
23
|
+
LaunchPlanBindingSlotKind["WorkingFileSourceRef"] = "working-file-source-ref";
|
|
24
|
+
LaunchPlanBindingSlotKind["OutputRouteRef"] = "output-route-ref";
|
|
25
|
+
LaunchPlanBindingSlotKind["ActorTokenRef"] = "actor-token-ref";
|
|
26
|
+
LaunchPlanBindingSlotKind["ServiceTokenRef"] = "service-token-ref";
|
|
27
|
+
LaunchPlanBindingSlotKind["ProviderTokenRef"] = "provider-token-ref";
|
|
28
|
+
LaunchPlanBindingSlotKind["CredentialGrantRef"] = "credential-grant-ref";
|
|
29
|
+
LaunchPlanBindingSlotKind["DatabaseGrantRef"] = "database-grant-ref";
|
|
30
|
+
LaunchPlanBindingSlotKind["SecretRef"] = "secret-ref";
|
|
31
|
+
})(LaunchPlanBindingSlotKind || (exports.LaunchPlanBindingSlotKind = LaunchPlanBindingSlotKind = {}));
|
|
32
|
+
var LaunchPlanBindingSlotCardinality;
|
|
33
|
+
(function (LaunchPlanBindingSlotCardinality) {
|
|
34
|
+
LaunchPlanBindingSlotCardinality["One"] = "one";
|
|
35
|
+
LaunchPlanBindingSlotCardinality["Many"] = "many";
|
|
36
|
+
})(LaunchPlanBindingSlotCardinality || (exports.LaunchPlanBindingSlotCardinality = LaunchPlanBindingSlotCardinality = {}));
|
|
37
|
+
const PLAN_KEYS = [
|
|
38
|
+
'schemaVersion',
|
|
39
|
+
'runtimeTemplateKey',
|
|
40
|
+
'agent',
|
|
41
|
+
'subagents',
|
|
42
|
+
'skills',
|
|
43
|
+
'tools',
|
|
44
|
+
'mcpDescriptors',
|
|
45
|
+
'capabilityDescriptors',
|
|
46
|
+
'workspace',
|
|
47
|
+
'runtimeRequirements',
|
|
48
|
+
'policyCompatibility',
|
|
49
|
+
'outputSurface',
|
|
50
|
+
'bindingSlots',
|
|
51
|
+
];
|
|
52
|
+
const RESOURCE_KEYS = ['kind', 'ref', 'revisionRef', 'contentHash'];
|
|
53
|
+
const WORKSPACE_KEYS = [
|
|
54
|
+
'manifestRef',
|
|
55
|
+
'manifestHash',
|
|
56
|
+
'structure',
|
|
57
|
+
'layout',
|
|
58
|
+
];
|
|
59
|
+
const RUNTIME_REQUIREMENT_KEYS = [
|
|
60
|
+
'runtimeRef',
|
|
61
|
+
'runtimeRevision',
|
|
62
|
+
'imageDigest',
|
|
63
|
+
'requirementsHash',
|
|
64
|
+
'requirements',
|
|
65
|
+
];
|
|
66
|
+
const POLICY_KEYS = [
|
|
67
|
+
'tenantDependency',
|
|
68
|
+
'trustPolicy',
|
|
69
|
+
'compatibleSurfaces',
|
|
70
|
+
'policies',
|
|
71
|
+
];
|
|
72
|
+
const OUTPUT_SURFACE_KEYS = [
|
|
73
|
+
'kind',
|
|
74
|
+
'schemaRef',
|
|
75
|
+
'schemaHash',
|
|
76
|
+
'schema',
|
|
77
|
+
];
|
|
78
|
+
const BINDING_SLOT_KEYS = ['name', 'kind', 'cardinality', 'required'];
|
|
79
|
+
const BINDING_SLOT_KINDS = Object.values(LaunchPlanBindingSlotKind);
|
|
80
|
+
const BINDING_SLOT_CARDINALITIES = Object.values(LaunchPlanBindingSlotCardinality);
|
|
81
|
+
const TENANT_DEPENDENCIES = Object.values(runtime_template_key_1.RuntimeTemplateTenantDependency);
|
|
82
|
+
const TRUST_POLICIES = Object.values(runtime_template_key_1.RuntimeTemplateTrustPolicy);
|
|
83
|
+
const BINDING_SLOT_NAME_PATTERN = /^[a-z][a-z0-9]*(?:[.-][a-z][a-z0-9]*)*$/u;
|
|
84
|
+
const DYNAMIC_LITERAL_PATTERN = /\$\{\s*(?:input|tenant|org|organization|project|user|session|thread|domain|token|secret|credential)(?:[.:[\]}]|$)/iu;
|
|
85
|
+
const SECRET_REFERENCE_PATTERN = /^(?:secret|vault|credential|token)(?:-ref)?:\/\//iu;
|
|
86
|
+
const DYNAMIC_FIELD_NAMES = new Set([
|
|
87
|
+
'apikey',
|
|
88
|
+
'authorization',
|
|
89
|
+
'cookie',
|
|
90
|
+
'credential',
|
|
91
|
+
'credentialgrantref',
|
|
92
|
+
'credentialref',
|
|
93
|
+
'databasegrantref',
|
|
94
|
+
'domain',
|
|
95
|
+
'domainid',
|
|
96
|
+
'domainref',
|
|
97
|
+
'input',
|
|
98
|
+
'invocationid',
|
|
99
|
+
'organization',
|
|
100
|
+
'organizationid',
|
|
101
|
+
'org',
|
|
102
|
+
'orgid',
|
|
103
|
+
'password',
|
|
104
|
+
'privatekey',
|
|
105
|
+
'project',
|
|
106
|
+
'projectid',
|
|
107
|
+
'secret',
|
|
108
|
+
'secretref',
|
|
109
|
+
'session',
|
|
110
|
+
'sessionid',
|
|
111
|
+
'storageref',
|
|
112
|
+
'tenant',
|
|
113
|
+
'tenantid',
|
|
114
|
+
'thread',
|
|
115
|
+
'threadid',
|
|
116
|
+
'token',
|
|
117
|
+
'tokenref',
|
|
118
|
+
'user',
|
|
119
|
+
'userid',
|
|
120
|
+
'value',
|
|
121
|
+
]);
|
|
122
|
+
const SECRET_OR_CREDENTIAL_FIELD_PATTERN = /(?:apikey|authorization|cookie|credential|password|privatekey|secret|token)(?:ref)?$/u;
|
|
123
|
+
function createCompiledSessionLaunchPlan(input) {
|
|
124
|
+
const object = (0, canonical_contract_1.requireExactObject)(input, 'CompiledSessionLaunchPlan', PLAN_KEYS);
|
|
125
|
+
if (object.schemaVersion !== 1) {
|
|
126
|
+
throw new TypeError('CompiledSessionLaunchPlan.schemaVersion must be 1.');
|
|
127
|
+
}
|
|
128
|
+
const runtimeTemplateKey = (0, runtime_template_key_1.createRuntimeTemplateKey)(object.runtimeTemplateKey);
|
|
129
|
+
const agent = requirePinnedResource(object.agent, 'CompiledSessionLaunchPlan.agent');
|
|
130
|
+
const subagents = requirePinnedResources(object.subagents, 'CompiledSessionLaunchPlan.subagents');
|
|
131
|
+
const skills = requirePinnedResources(object.skills, 'CompiledSessionLaunchPlan.skills');
|
|
132
|
+
const tools = requirePinnedResources(object.tools, 'CompiledSessionLaunchPlan.tools');
|
|
133
|
+
const mcpDescriptors = requirePinnedResources(object.mcpDescriptors, 'CompiledSessionLaunchPlan.mcpDescriptors');
|
|
134
|
+
const capabilityDescriptors = requirePinnedResources(object.capabilityDescriptors, 'CompiledSessionLaunchPlan.capabilityDescriptors');
|
|
135
|
+
const workspace = requireWorkspace(object.workspace);
|
|
136
|
+
const runtimeRequirements = requireRuntimeRequirements(object.runtimeRequirements);
|
|
137
|
+
const policyCompatibility = requirePolicyCompatibility(object.policyCompatibility);
|
|
138
|
+
const outputSurface = requireOutputSurface(object.outputSurface);
|
|
139
|
+
const bindingSlots = requireBindingSlots(object.bindingSlots);
|
|
140
|
+
assertTemplateConsistency({
|
|
141
|
+
runtimeTemplateKey,
|
|
142
|
+
agent,
|
|
143
|
+
subagents,
|
|
144
|
+
skills,
|
|
145
|
+
tools,
|
|
146
|
+
mcpDescriptors,
|
|
147
|
+
capabilityDescriptors,
|
|
148
|
+
workspace,
|
|
149
|
+
runtimeRequirements,
|
|
150
|
+
policyCompatibility,
|
|
151
|
+
});
|
|
152
|
+
assertDeclaredBindingSlotReferences([workspace.structure, workspace.layout, runtimeRequirements.requirements], bindingSlots);
|
|
153
|
+
return Object.freeze({
|
|
154
|
+
schemaVersion: 1,
|
|
155
|
+
runtimeTemplateKey,
|
|
156
|
+
agent,
|
|
157
|
+
subagents,
|
|
158
|
+
skills,
|
|
159
|
+
tools,
|
|
160
|
+
mcpDescriptors,
|
|
161
|
+
capabilityDescriptors,
|
|
162
|
+
workspace,
|
|
163
|
+
runtimeRequirements,
|
|
164
|
+
policyCompatibility,
|
|
165
|
+
outputSurface,
|
|
166
|
+
bindingSlots,
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
function encodeCompiledSessionLaunchPlan(input) {
|
|
170
|
+
return (0, canonical_contract_1.canonicalContractJson)(createCompiledSessionLaunchPlan(input));
|
|
171
|
+
}
|
|
172
|
+
function decodeCompiledSessionLaunchPlan(encoded) {
|
|
173
|
+
let parsed;
|
|
174
|
+
try {
|
|
175
|
+
parsed = JSON.parse(encoded);
|
|
176
|
+
}
|
|
177
|
+
catch (error) {
|
|
178
|
+
throw new TypeError(`CompiledSessionLaunchPlan is not valid JSON: ${error instanceof Error ? error.message : String(error)}`);
|
|
179
|
+
}
|
|
180
|
+
return createCompiledSessionLaunchPlan(parsed);
|
|
181
|
+
}
|
|
182
|
+
function hashCompiledSessionLaunchPlan(input) {
|
|
183
|
+
return (0, canonical_contract_1.hashCanonicalContract)(createCompiledSessionLaunchPlan(input));
|
|
184
|
+
}
|
|
185
|
+
function hashCompiledWorkspaceLaunchPlan(input) {
|
|
186
|
+
return (0, canonical_contract_1.hashCanonicalContract)(input);
|
|
187
|
+
}
|
|
188
|
+
function requirePinnedResource(value, path) {
|
|
189
|
+
const object = (0, canonical_contract_1.requireExactObject)(value, path, RESOURCE_KEYS);
|
|
190
|
+
return Object.freeze({
|
|
191
|
+
kind: (0, canonical_contract_1.requireNonEmptyString)(object.kind, `${path}.kind`),
|
|
192
|
+
ref: (0, canonical_contract_1.requireNonEmptyString)(object.ref, `${path}.ref`),
|
|
193
|
+
revisionRef: (0, canonical_contract_1.requireNonEmptyString)(object.revisionRef, `${path}.revisionRef`),
|
|
194
|
+
contentHash: (0, canonical_contract_1.requireSha256)(object.contentHash, `${path}.contentHash`),
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
function requirePinnedResources(value, path) {
|
|
198
|
+
if (!Array.isArray(value)) {
|
|
199
|
+
throw new TypeError(`${path} must be an array.`);
|
|
200
|
+
}
|
|
201
|
+
const resources = value.map((entry, index) => requirePinnedResource(entry, `${path}[${index}]`));
|
|
202
|
+
const identities = new Set();
|
|
203
|
+
for (const resource of resources) {
|
|
204
|
+
const identity = `${resource.kind}\u0000${resource.ref}`;
|
|
205
|
+
if (identities.has(identity)) {
|
|
206
|
+
throw new TypeError(`${path} contains duplicate resource '${resource.kind}:${resource.ref}'.`);
|
|
207
|
+
}
|
|
208
|
+
identities.add(identity);
|
|
209
|
+
}
|
|
210
|
+
return Object.freeze(resources.toSorted((left, right) => (0, canonical_contract_1.canonicalContractJson)(left).localeCompare((0, canonical_contract_1.canonicalContractJson)(right))));
|
|
211
|
+
}
|
|
212
|
+
function requireWorkspace(value) {
|
|
213
|
+
const path = 'CompiledSessionLaunchPlan.workspace';
|
|
214
|
+
const object = (0, canonical_contract_1.requireExactObject)(value, path, WORKSPACE_KEYS);
|
|
215
|
+
return Object.freeze({
|
|
216
|
+
manifestRef: (0, canonical_contract_1.requireNonEmptyString)(object.manifestRef, `${path}.manifestRef`),
|
|
217
|
+
manifestHash: (0, canonical_contract_1.requireSha256)(object.manifestHash, `${path}.manifestHash`),
|
|
218
|
+
structure: requireStaticPayload(object.structure, `${path}.structure`),
|
|
219
|
+
layout: requireStaticPayload(object.layout, `${path}.layout`),
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
function requireRuntimeRequirements(value) {
|
|
223
|
+
const path = 'CompiledSessionLaunchPlan.runtimeRequirements';
|
|
224
|
+
const object = (0, canonical_contract_1.requireExactObject)(value, path, RUNTIME_REQUIREMENT_KEYS);
|
|
225
|
+
const imageDigest = (0, canonical_contract_1.requireImageDigest)(object.imageDigest, `${path}.imageDigest`);
|
|
226
|
+
const requirements = requireStaticPayload(object.requirements, `${path}.requirements`);
|
|
227
|
+
const requirementsHash = (0, canonical_contract_1.requireSha256)(object.requirementsHash, `${path}.requirementsHash`);
|
|
228
|
+
assertContentHash(requirementsHash, requirements, `${path}.requirementsHash`);
|
|
229
|
+
return Object.freeze({
|
|
230
|
+
runtimeRef: (0, canonical_contract_1.requireNonEmptyString)(object.runtimeRef, `${path}.runtimeRef`),
|
|
231
|
+
runtimeRevision: (0, canonical_contract_1.requireNonEmptyString)(object.runtimeRevision, `${path}.runtimeRevision`),
|
|
232
|
+
imageDigest,
|
|
233
|
+
requirementsHash,
|
|
234
|
+
requirements,
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
function requirePolicyCompatibility(value) {
|
|
238
|
+
const path = 'CompiledSessionLaunchPlan.policyCompatibility';
|
|
239
|
+
const object = (0, canonical_contract_1.requireExactObject)(value, path, POLICY_KEYS);
|
|
240
|
+
return Object.freeze({
|
|
241
|
+
tenantDependency: (0, canonical_contract_1.requireEnumValue)(object.tenantDependency, `${path}.tenantDependency`, TENANT_DEPENDENCIES),
|
|
242
|
+
trustPolicy: (0, canonical_contract_1.requireEnumValue)(object.trustPolicy, `${path}.trustPolicy`, TRUST_POLICIES),
|
|
243
|
+
compatibleSurfaces: (0, canonical_contract_1.requireStringRefs)(object.compatibleSurfaces, `${path}.compatibleSurfaces`),
|
|
244
|
+
policies: requirePinnedResources(object.policies, `${path}.policies`),
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
function requireOutputSurface(value) {
|
|
248
|
+
const path = 'CompiledSessionLaunchPlan.outputSurface';
|
|
249
|
+
const object = (0, canonical_contract_1.requireExactObject)(value, path, OUTPUT_SURFACE_KEYS);
|
|
250
|
+
const schema = (0, canonical_contract_1.requireCanonicalJsonObject)(object.schema, `${path}.schema`);
|
|
251
|
+
const schemaHash = (0, canonical_contract_1.requireSha256)(object.schemaHash, `${path}.schemaHash`);
|
|
252
|
+
assertContentHash(schemaHash, schema, `${path}.schemaHash`);
|
|
253
|
+
return Object.freeze({
|
|
254
|
+
kind: (0, canonical_contract_1.requireNonEmptyString)(object.kind, `${path}.kind`),
|
|
255
|
+
schemaRef: (0, canonical_contract_1.requireNonEmptyString)(object.schemaRef, `${path}.schemaRef`),
|
|
256
|
+
schemaHash,
|
|
257
|
+
schema,
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
function requireBindingSlots(value) {
|
|
261
|
+
const path = 'CompiledSessionLaunchPlan.bindingSlots';
|
|
262
|
+
if (!Array.isArray(value)) {
|
|
263
|
+
throw new TypeError(`${path} must be an array.`);
|
|
264
|
+
}
|
|
265
|
+
const slots = value.map((entry, index) => {
|
|
266
|
+
const slotPath = `${path}[${index}]`;
|
|
267
|
+
const object = (0, canonical_contract_1.requireExactObject)(entry, slotPath, BINDING_SLOT_KEYS);
|
|
268
|
+
const name = (0, canonical_contract_1.requireNonEmptyString)(object.name, `${slotPath}.name`);
|
|
269
|
+
if (!BINDING_SLOT_NAME_PATTERN.test(name)) {
|
|
270
|
+
throw new TypeError(`${slotPath}.name must be a lowercase dotted or hyphenated identifier.`);
|
|
271
|
+
}
|
|
272
|
+
return Object.freeze({
|
|
273
|
+
name,
|
|
274
|
+
kind: (0, canonical_contract_1.requireEnumValue)(object.kind, `${slotPath}.kind`, BINDING_SLOT_KINDS),
|
|
275
|
+
cardinality: (0, canonical_contract_1.requireEnumValue)(object.cardinality, `${slotPath}.cardinality`, BINDING_SLOT_CARDINALITIES),
|
|
276
|
+
required: (0, canonical_contract_1.requireBoolean)(object.required, `${slotPath}.required`),
|
|
277
|
+
});
|
|
278
|
+
});
|
|
279
|
+
const names = new Set();
|
|
280
|
+
for (const slot of slots) {
|
|
281
|
+
if (names.has(slot.name)) {
|
|
282
|
+
throw new TypeError(`${path} contains duplicate slot '${slot.name}'.`);
|
|
283
|
+
}
|
|
284
|
+
names.add(slot.name);
|
|
285
|
+
}
|
|
286
|
+
return Object.freeze(slots.toSorted((left, right) => left.name.localeCompare(right.name)));
|
|
287
|
+
}
|
|
288
|
+
function requireStaticPayload(value, path) {
|
|
289
|
+
const normalized = (0, canonical_contract_1.requireCanonicalJsonObject)(value, path);
|
|
290
|
+
assertStaticPayloadNode(normalized, path);
|
|
291
|
+
return normalized;
|
|
292
|
+
}
|
|
293
|
+
function assertStaticPayloadNode(value, path) {
|
|
294
|
+
if (typeof value === 'string') {
|
|
295
|
+
if (DYNAMIC_LITERAL_PATTERN.test(value) ||
|
|
296
|
+
SECRET_REFERENCE_PATTERN.test(value)) {
|
|
297
|
+
throw new TypeError(`${path} embeds dynamic or secret data; use a typed $bindingSlot reference.`);
|
|
298
|
+
}
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
if (value === null || typeof value !== 'object') {
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
if (Array.isArray(value)) {
|
|
305
|
+
value.forEach((entry, index) => assertStaticPayloadNode(entry, `${path}[${index}]`));
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
if (Object.hasOwn(value, '$bindingSlot')) {
|
|
309
|
+
const marker = (0, canonical_contract_1.requireExactObject)(value, path, ['$bindingSlot']);
|
|
310
|
+
(0, canonical_contract_1.requireNonEmptyString)(marker.$bindingSlot, `${path}.$bindingSlot`);
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
314
|
+
const normalizedKey = key.replaceAll(/[^a-z0-9]/giu, '').toLowerCase();
|
|
315
|
+
if (DYNAMIC_FIELD_NAMES.has(normalizedKey) ||
|
|
316
|
+
SECRET_OR_CREDENTIAL_FIELD_PATTERN.test(normalizedKey)) {
|
|
317
|
+
if (!isBindingSlotMarker(entry)) {
|
|
318
|
+
throw new TypeError(`${path}.${key} is dynamic data; its value must be a typed $bindingSlot reference.`);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
assertStaticPayloadNode(entry, `${path}.${key}`);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
function isBindingSlotMarker(value) {
|
|
325
|
+
return (value !== null &&
|
|
326
|
+
typeof value === 'object' &&
|
|
327
|
+
!Array.isArray(value) &&
|
|
328
|
+
Object.hasOwn(value, '$bindingSlot'));
|
|
329
|
+
}
|
|
330
|
+
function assertDeclaredBindingSlotReferences(values, slots) {
|
|
331
|
+
const declared = new Set(slots.map((slot) => slot.name));
|
|
332
|
+
for (const [index, value] of values.entries()) {
|
|
333
|
+
inspectBindingSlotReferences(value, `staticPayloads[${index}]`, declared);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
function inspectBindingSlotReferences(value, path, declared) {
|
|
337
|
+
if (value === null || typeof value !== 'object') {
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
if (Array.isArray(value)) {
|
|
341
|
+
value.forEach((entry, index) => inspectBindingSlotReferences(entry, `${path}[${index}]`, declared));
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
if (isBindingSlotMarker(value)) {
|
|
345
|
+
const name = value.$bindingSlot;
|
|
346
|
+
if (typeof name !== 'string' || !declared.has(name)) {
|
|
347
|
+
throw new TypeError(`${path} references undeclared binding slot '${String(name)}'.`);
|
|
348
|
+
}
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
351
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
352
|
+
inspectBindingSlotReferences(entry, `${path}.${key}`, declared);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
function assertTemplateConsistency(input) {
|
|
356
|
+
const key = input.runtimeTemplateKey;
|
|
357
|
+
assertEqual(input.agent.revisionRef, key.agentRevision, 'agent.revisionRef', 'runtimeTemplateKey.agentRevision');
|
|
358
|
+
assertEqual(input.agent.contentHash, key.primaryAgentHash, 'agent.contentHash', 'runtimeTemplateKey.primaryAgentHash');
|
|
359
|
+
assertContentHash(key.subagentsHash, input.subagents, 'subagents');
|
|
360
|
+
assertContentHash(key.skillsHash, input.skills, 'skills');
|
|
361
|
+
assertContentHash(key.toolsHash, input.tools, 'tools');
|
|
362
|
+
assertContentHash(key.mcpDescriptorsHash, input.mcpDescriptors, 'mcpDescriptors');
|
|
363
|
+
assertContentHash(key.capabilityDescriptorsHash, input.capabilityDescriptors, 'capabilityDescriptors');
|
|
364
|
+
assertContentHash(key.workspacePlanHash, input.workspace, 'runtimeTemplateKey.workspacePlanHash');
|
|
365
|
+
assertEqual(input.runtimeRequirements.runtimeRef, key.runtimeRef, 'runtimeRequirements.runtimeRef', 'runtimeTemplateKey.runtimeRef');
|
|
366
|
+
assertEqual(input.runtimeRequirements.runtimeRevision, key.runtimeRevision, 'runtimeRequirements.runtimeRevision', 'runtimeTemplateKey.runtimeRevision');
|
|
367
|
+
assertEqual(input.runtimeRequirements.imageDigest, key.imageDigest, 'runtimeRequirements.imageDigest', 'runtimeTemplateKey.imageDigest');
|
|
368
|
+
assertEqual(input.policyCompatibility.tenantDependency, key.tenantDependency, 'policyCompatibility.tenantDependency', 'runtimeTemplateKey.tenantDependency');
|
|
369
|
+
assertEqual(input.policyCompatibility.trustPolicy, key.trustPolicy, 'policyCompatibility.trustPolicy', 'runtimeTemplateKey.trustPolicy');
|
|
370
|
+
}
|
|
371
|
+
function assertContentHash(expectedHash, content, path) {
|
|
372
|
+
const actualHash = (0, canonical_contract_1.hashCanonicalContract)(content);
|
|
373
|
+
if (actualHash !== expectedHash) {
|
|
374
|
+
throw new TypeError(`${path} content hash mismatch: expected '${expectedHash}', computed '${actualHash}'.`);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
function assertEqual(actual, expected, actualPath, expectedPath) {
|
|
378
|
+
if (actual !== expected) {
|
|
379
|
+
throw new TypeError(`${actualPath} must equal ${expectedPath}; received '${actual}' and '${expected}'.`);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
//# sourceMappingURL=compiled-session-launch-plan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compiled-session-launch-plan.js","sourceRoot":"","sources":["../../../src/lib/launch-identity/compiled-session-launch-plan.ts"],"names":[],"mappings":";;;AA0MA,0EAiFC;AAED,0EAIC;AAED,0EAYC;AAED,sEAIC;AAED,0EAIC;AA3TD,6DAY8B;AAC9B,iEAKgC;AAEhC,IAAY,yBAmBX;AAnBD,WAAY,yBAAyB;IACnC,+DAAkC,CAAA;IAClC,qDAAwB,CAAA;IACxB,+CAAkB,CAAA;IAClB,qDAAwB,CAAA;IACxB,mDAAsB,CAAA;IACtB,2DAA8B,CAAA;IAC9B,qDAAwB,CAAA;IACxB,4CAAe,CAAA;IACf,+DAAkC,CAAA;IAClC,4EAA+C,CAAA;IAC/C,6EAAgD,CAAA;IAChD,gEAAmC,CAAA;IACnC,8DAAiC,CAAA;IACjC,kEAAqC,CAAA;IACrC,oEAAuC,CAAA;IACvC,wEAA2C,CAAA;IAC3C,oEAAuC,CAAA;IACvC,qDAAwB,CAAA;AAC1B,CAAC,EAnBW,yBAAyB,yCAAzB,yBAAyB,QAmBpC;AAED,IAAY,gCAGX;AAHD,WAAY,gCAAgC;IAC1C,+CAAW,CAAA;IACX,iDAAa,CAAA;AACf,CAAC,EAHW,gCAAgC,gDAAhC,gCAAgC,QAG3C;AAkED,MAAM,SAAS,GAAG;IAChB,eAAe;IACf,oBAAoB;IACpB,OAAO;IACP,WAAW;IACX,QAAQ;IACR,OAAO;IACP,gBAAgB;IAChB,uBAAuB;IACvB,WAAW;IACX,qBAAqB;IACrB,qBAAqB;IACrB,eAAe;IACf,cAAc;CACN,CAAC;AACX,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,aAAa,CAAU,CAAC;AAC7E,MAAM,cAAc,GAAG;IACrB,aAAa;IACb,cAAc;IACd,WAAW;IACX,QAAQ;CACA,CAAC;AACX,MAAM,wBAAwB,GAAG;IAC/B,YAAY;IACZ,iBAAiB;IACjB,aAAa;IACb,kBAAkB;IAClB,cAAc;CACN,CAAC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AAW,CACT,KAAK,CAAC,mBAAmB,CAAC,eAAe,EACzC,GAAG,CAAC,eAAe,EACnB,qCAAqC,EACrC,oCAAoC,CACrC,CAAC;IACF,WAAW,CACT,KAAK,CAAC,mBAAmB,CAAC,WAAW,EACrC,GAAG,CAAC,WAAW,EACf,iCAAiC,EACjC,gCAAgC,CACjC,CAAC;IACF,WAAW,CACT,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,EAC1C,GAAG,CAAC,gBAAgB,EACpB,sCAAsC,EACtC,qCAAqC,CACtC,CAAC;IACF,WAAW,CACT,KAAK,CAAC,mBAAmB,CAAC,WAAW,EACrC,GAAG,CAAC,WAAW,EACf,iCAAiC,EACjC,gCAAgC,CACjC,CAAC;AACJ,CAAC;AAED,SAAS,iBAAiB,CACxB,YAAoB,EACpB,OAAgB,EAChB,IAAY;IAEZ,MAAM,UAAU,GAAG,IAAA,0CAAqB,EAAC,OAAO,CAAC,CAAC;IAClD,IAAI,UAAU,KAAK,YAAY,EAAE,CAAC;QAChC,MAAM,IAAI,SAAS,CACjB,GAAG,IAAI,qCAAqC,YAAY,gBAAgB,UAAU,IAAI,CACvF,CAAC;IACJ,CAAC;AACH,CAAC;AAED,SAAS,WAAW,CAClB,MAAc,EACd,QAAgB,EAChB,UAAkB,EAClB,YAAoB;IAEpB,IAAI,MAAM,KAAK,QAAQ,EAAE,CAAC;QACxB,MAAM,IAAI,SAAS,CACjB,GAAG,UAAU,eAAe,YAAY,eAAe,MAAM,UAAU,QAAQ,IAAI,CACpF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './canonical-contract';
|
|
2
|
+
export * from './compiled-session-launch-plan';
|
|
3
|
+
export * from './compiled-session-launch-plan-store';
|
|
4
|
+
export * from './runtime-template-key';
|
|
5
|
+
export * from './session-binding';
|
|
6
|
+
export * from './thread-reuse-key';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/launch-identity/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sCAAsC,CAAC;AACrD,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./canonical-contract"), exports);
|
|
18
|
+
__exportStar(require("./compiled-session-launch-plan"), exports);
|
|
19
|
+
__exportStar(require("./compiled-session-launch-plan-store"), exports);
|
|
20
|
+
__exportStar(require("./runtime-template-key"), exports);
|
|
21
|
+
__exportStar(require("./session-binding"), exports);
|
|
22
|
+
__exportStar(require("./thread-reuse-key"), exports);
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/launch-identity/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,iEAA+C;AAC/C,uEAAqD;AACrD,yDAAuC;AACvC,oDAAkC;AAClC,qDAAmC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare enum RuntimeTemplateTenantDependency {
|
|
2
|
+
OrganizationNeutral = "organization-neutral",
|
|
3
|
+
OrganizationBound = "organization-bound"
|
|
4
|
+
}
|
|
5
|
+
export declare enum RuntimeTemplateTrustPolicy {
|
|
6
|
+
Shared = "shared",
|
|
7
|
+
Dedicated = "dedicated",
|
|
8
|
+
Confidential = "confidential"
|
|
9
|
+
}
|
|
10
|
+
export interface RuntimeTemplateKey {
|
|
11
|
+
readonly schemaVersion: 1;
|
|
12
|
+
readonly tenantDependency: RuntimeTemplateTenantDependency;
|
|
13
|
+
readonly trustPolicy: RuntimeTemplateTrustPolicy;
|
|
14
|
+
readonly runtimeRef: string;
|
|
15
|
+
readonly runtimeRevision: string;
|
|
16
|
+
readonly imageDigest: string;
|
|
17
|
+
readonly agentRevision: string;
|
|
18
|
+
readonly primaryAgentHash: string;
|
|
19
|
+
readonly subagentsHash: string;
|
|
20
|
+
readonly skillsHash: string;
|
|
21
|
+
readonly toolsHash: string;
|
|
22
|
+
readonly capabilityDescriptorsHash: string;
|
|
23
|
+
readonly mcpDescriptorsHash: string;
|
|
24
|
+
readonly workspacePlanHash: string;
|
|
25
|
+
readonly layoutProfile: string;
|
|
26
|
+
}
|
|
27
|
+
export declare function createRuntimeTemplateKey(input: unknown): RuntimeTemplateKey;
|
|
28
|
+
export declare function serializeRuntimeTemplateKey(input: RuntimeTemplateKey): string;
|
|
29
|
+
export declare function hashRuntimeTemplateKey(input: RuntimeTemplateKey): string;
|
|
30
|
+
//# sourceMappingURL=runtime-template-key.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-template-key.d.ts","sourceRoot":"","sources":["../../../src/lib/launch-identity/runtime-template-key.ts"],"names":[],"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|
|
4
|
+
exports.createRuntimeTemplateKey = createRuntimeTemplateKey;
|
|
5
|
+
exports.serializeRuntimeTemplateKey = serializeRuntimeTemplateKey;
|
|
6
|
+
exports.hashRuntimeTemplateKey = hashRuntimeTemplateKey;
|
|
7
|
+
const canonical_contract_1 = require("./canonical-contract");
|
|
8
|
+
var RuntimeTemplateTenantDependency;
|
|
9
|
+
(function (RuntimeTemplateTenantDependency) {
|
|
10
|
+
RuntimeTemplateTenantDependency["OrganizationNeutral"] = "organization-neutral";
|
|
11
|
+
RuntimeTemplateTenantDependency["OrganizationBound"] = "organization-bound";
|
|
12
|
+
})(RuntimeTemplateTenantDependency || (exports.RuntimeTemplateTenantDependency = RuntimeTemplateTenantDependency = {}));
|
|
13
|
+
var RuntimeTemplateTrustPolicy;
|
|
14
|
+
(function (RuntimeTemplateTrustPolicy) {
|
|
15
|
+
RuntimeTemplateTrustPolicy["Shared"] = "shared";
|
|
16
|
+
RuntimeTemplateTrustPolicy["Dedicated"] = "dedicated";
|
|
17
|
+
RuntimeTemplateTrustPolicy["Confidential"] = "confidential";
|
|
18
|
+
})(RuntimeTemplateTrustPolicy || (exports.RuntimeTemplateTrustPolicy = RuntimeTemplateTrustPolicy = {}));
|
|
19
|
+
const REQUIRED_KEYS = [
|
|
20
|
+
'schemaVersion',
|
|
21
|
+
'tenantDependency',
|
|
22
|
+
'trustPolicy',
|
|
23
|
+
'runtimeRef',
|
|
24
|
+
'runtimeRevision',
|
|
25
|
+
'imageDigest',
|
|
26
|
+
'agentRevision',
|
|
27
|
+
'primaryAgentHash',
|
|
28
|
+
'subagentsHash',
|
|
29
|
+
'skillsHash',
|
|
30
|
+
'toolsHash',
|
|
31
|
+
'capabilityDescriptorsHash',
|
|
32
|
+
'mcpDescriptorsHash',
|
|
33
|
+
'workspacePlanHash',
|
|
34
|
+
'layoutProfile',
|
|
35
|
+
];
|
|
36
|
+
const TENANT_DEPENDENCIES = Object.values(RuntimeTemplateTenantDependency);
|
|
37
|
+
const TRUST_POLICIES = Object.values(RuntimeTemplateTrustPolicy);
|
|
38
|
+
function createRuntimeTemplateKey(input) {
|
|
39
|
+
(0, canonical_contract_1.assertNoTenantOrSecretTemplateFields)(input, 'RuntimeTemplateKey');
|
|
40
|
+
const object = (0, canonical_contract_1.requireExactObject)(input, 'RuntimeTemplateKey', REQUIRED_KEYS);
|
|
41
|
+
if (object.schemaVersion !== 1) {
|
|
42
|
+
throw new TypeError('RuntimeTemplateKey.schemaVersion must be 1.');
|
|
43
|
+
}
|
|
44
|
+
const imageDigest = (0, canonical_contract_1.requireImageDigest)(object.imageDigest, 'RuntimeTemplateKey.imageDigest');
|
|
45
|
+
return Object.freeze({
|
|
46
|
+
schemaVersion: 1,
|
|
47
|
+
tenantDependency: (0, canonical_contract_1.requireEnumValue)(object.tenantDependency, 'RuntimeTemplateKey.tenantDependency', TENANT_DEPENDENCIES),
|
|
48
|
+
trustPolicy: (0, canonical_contract_1.requireEnumValue)(object.trustPolicy, 'RuntimeTemplateKey.trustPolicy', TRUST_POLICIES),
|
|
49
|
+
runtimeRef: (0, canonical_contract_1.requireNonEmptyString)(object.runtimeRef, 'RuntimeTemplateKey.runtimeRef'),
|
|
50
|
+
runtimeRevision: (0, canonical_contract_1.requireNonEmptyString)(object.runtimeRevision, 'RuntimeTemplateKey.runtimeRevision'),
|
|
51
|
+
imageDigest,
|
|
52
|
+
agentRevision: (0, canonical_contract_1.requireNonEmptyString)(object.agentRevision, 'RuntimeTemplateKey.agentRevision'),
|
|
53
|
+
primaryAgentHash: (0, canonical_contract_1.requireSha256)(object.primaryAgentHash, 'RuntimeTemplateKey.primaryAgentHash'),
|
|
54
|
+
subagentsHash: (0, canonical_contract_1.requireSha256)(object.subagentsHash, 'RuntimeTemplateKey.subagentsHash'),
|
|
55
|
+
skillsHash: (0, canonical_contract_1.requireSha256)(object.skillsHash, 'RuntimeTemplateKey.skillsHash'),
|
|
56
|
+
toolsHash: (0, canonical_contract_1.requireSha256)(object.toolsHash, 'RuntimeTemplateKey.toolsHash'),
|
|
57
|
+
capabilityDescriptorsHash: (0, canonical_contract_1.requireSha256)(object.capabilityDescriptorsHash, 'RuntimeTemplateKey.capabilityDescriptorsHash'),
|
|
58
|
+
mcpDescriptorsHash: (0, canonical_contract_1.requireSha256)(object.mcpDescriptorsHash, 'RuntimeTemplateKey.mcpDescriptorsHash'),
|
|
59
|
+
workspacePlanHash: (0, canonical_contract_1.requireSha256)(object.workspacePlanHash, 'RuntimeTemplateKey.workspacePlanHash'),
|
|
60
|
+
layoutProfile: (0, canonical_contract_1.requireNonEmptyString)(object.layoutProfile, 'RuntimeTemplateKey.layoutProfile'),
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function serializeRuntimeTemplateKey(input) {
|
|
64
|
+
return (0, canonical_contract_1.canonicalContractJson)(createRuntimeTemplateKey(input));
|
|
65
|
+
}
|
|
66
|
+
function hashRuntimeTemplateKey(input) {
|
|
67
|
+
return (0, canonical_contract_1.hashCanonicalContract)(createRuntimeTemplateKey(input));
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=runtime-template-key.js.map
|