@inventarch/agent-composition-system 1.1.1 → 2.0.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/LANGUAGE.md +2 -2
- package/README.md +3 -1
- package/SPEC.md +3 -1
- package/dist/adapters.d.ts +2 -69
- package/dist/adapters.d.ts.map +1 -1
- package/dist/adapters.js +2 -211
- package/dist/adapters.js.map +1 -1
- package/dist/authoring-format.d.ts +2 -22
- package/dist/authoring-format.d.ts.map +1 -1
- package/dist/authoring-format.js +2 -287
- package/dist/authoring-format.js.map +1 -1
- package/dist/authoring-index.d.ts +2 -31
- package/dist/authoring-index.d.ts.map +1 -1
- package/dist/authoring-index.js +2 -251
- package/dist/authoring-index.js.map +1 -1
- package/dist/authoring-manifest.d.ts +2 -68
- package/dist/authoring-manifest.d.ts.map +1 -1
- package/dist/authoring-manifest.js +2 -386
- package/dist/authoring-manifest.js.map +1 -1
- package/dist/authoring-types.d.ts +2 -224
- package/dist/authoring-types.d.ts.map +1 -1
- package/dist/authoring-types.js +2 -1
- package/dist/authoring-types.js.map +1 -1
- package/dist/authoring.d.ts +2 -46
- package/dist/authoring.d.ts.map +1 -1
- package/dist/authoring.js +2 -564
- package/dist/authoring.js.map +1 -1
- package/dist/candidate.d.ts +2 -10
- package/dist/candidate.d.ts.map +1 -1
- package/dist/candidate.js +2 -83
- package/dist/candidate.js.map +1 -1
- package/dist/compile.d.ts +1 -1
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +8 -4
- package/dist/compile.js.map +1 -1
- package/dist/corpus.d.ts +2 -32
- package/dist/corpus.d.ts.map +1 -1
- package/dist/corpus.js +2 -181
- package/dist/corpus.js.map +1 -1
- package/dist/index.d.ts +9 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/installed-catalog.d.ts +2 -2
- package/dist/installed-catalog.d.ts.map +1 -1
- package/dist/installed-catalog.js +4 -45
- package/dist/installed-catalog.js.map +1 -1
- package/dist/installed-read.d.ts +1 -1
- package/dist/installed-read.d.ts.map +1 -1
- package/dist/installed-read.js +1 -1
- package/dist/installed-read.js.map +1 -1
- package/dist/installed-source-policy.d.ts +2 -30
- package/dist/installed-source-policy.d.ts.map +1 -1
- package/dist/installed-source-policy.js +2 -94
- package/dist/installed-source-policy.js.map +1 -1
- package/dist/lifecycle-profile.d.ts +2 -58
- package/dist/lifecycle-profile.d.ts.map +1 -1
- package/dist/lifecycle-profile.js +2 -205
- package/dist/lifecycle-profile.js.map +1 -1
- package/dist/lifecycle-rows.d.ts +2 -11
- package/dist/lifecycle-rows.d.ts.map +1 -1
- package/dist/lifecycle-rows.js +2 -34
- package/dist/lifecycle-rows.js.map +1 -1
- package/dist/lifecycle-transport.d.ts +2 -20
- package/dist/lifecycle-transport.d.ts.map +1 -1
- package/dist/lifecycle-transport.js +2 -126
- package/dist/lifecycle-transport.js.map +1 -1
- package/dist/lifecycle.d.ts +2 -121
- package/dist/lifecycle.d.ts.map +1 -1
- package/dist/lifecycle.js +2 -436
- package/dist/lifecycle.js.map +1 -1
- package/dist/local-store.d.ts +2 -49
- package/dist/local-store.d.ts.map +1 -1
- package/dist/local-store.js +2 -185
- package/dist/local-store.js.map +1 -1
- package/dist/native-selection.json +55 -55
- package/dist/native.ia.tgz +0 -0
- package/dist/projection-codex.d.ts +2 -14
- package/dist/projection-codex.d.ts.map +1 -1
- package/dist/projection-codex.js +2 -73
- package/dist/projection-codex.js.map +1 -1
- package/dist/projection-format.d.ts +2 -152
- package/dist/projection-format.d.ts.map +1 -1
- package/dist/projection-format.js +2 -200
- package/dist/projection-format.js.map +1 -1
- package/dist/projection-host.d.ts +2 -42
- package/dist/projection-host.d.ts.map +1 -1
- package/dist/projection-host.js +2 -338
- package/dist/projection-host.js.map +1 -1
- package/dist/projection-routine.d.ts +2 -3
- package/dist/projection-routine.d.ts.map +1 -1
- package/dist/projection-routine.js +2 -49
- package/dist/projection-routine.js.map +1 -1
- package/dist/projections.d.ts +2 -23
- package/dist/projections.d.ts.map +1 -1
- package/dist/projections.js +2 -430
- package/dist/projections.js.map +1 -1
- package/dist/publication.d.ts +2 -6
- package/dist/publication.d.ts.map +1 -1
- package/dist/publication.js +2 -139
- package/dist/publication.js.map +1 -1
- package/dist/resource-context.d.ts +2 -25
- package/dist/resource-context.d.ts.map +1 -1
- package/dist/resource-context.js +2 -270
- package/dist/resource-context.js.map +1 -1
- package/dist/resource-files.d.ts +2 -9
- package/dist/resource-files.d.ts.map +1 -1
- package/dist/resource-files.js +2 -87
- package/dist/resource-files.js.map +1 -1
- package/dist/resource-format.d.ts +2 -105
- package/dist/resource-format.d.ts.map +1 -1
- package/dist/resource-format.js +2 -241
- package/dist/resource-format.js.map +1 -1
- package/dist/resource-sources.d.ts +2 -6
- package/dist/resource-sources.d.ts.map +1 -1
- package/dist/resource-sources.js +2 -15
- package/dist/resource-sources.js.map +1 -1
- package/dist/resources.d.ts +2 -23
- package/dist/resources.d.ts.map +1 -1
- package/dist/resources.js +2 -82
- package/dist/resources.js.map +1 -1
- package/dist/sources.d.ts +2 -44
- package/dist/sources.d.ts.map +1 -1
- package/dist/sources.js +2 -289
- package/dist/sources.js.map +1 -1
- package/dist/system-package.json +313 -312
- package/dist/task-capture-format.d.ts +2 -24
- package/dist/task-capture-format.d.ts.map +1 -1
- package/dist/task-capture-format.js +2 -61
- package/dist/task-capture-format.js.map +1 -1
- package/dist/task-capture.d.ts +7 -7
- package/dist/task-capture.d.ts.map +1 -1
- package/dist/task-capture.js +8 -8
- package/dist/task-capture.js.map +1 -1
- package/dist/task-context-declaration.d.ts +2 -2
- package/dist/task-context-declaration.d.ts.map +1 -1
- package/dist/task-context-declaration.js +2 -2
- package/dist/task-context-declaration.js.map +1 -1
- package/dist/task-teaching-closure.d.ts +3 -3
- package/dist/task-teaching-closure.d.ts.map +1 -1
- package/dist/task-teaching-closure.js +4 -4
- package/dist/task-teaching-closure.js.map +1 -1
- package/dist/templates.d.ts +2 -34
- package/dist/templates.d.ts.map +1 -1
- package/dist/templates.js +2 -109
- package/dist/templates.js.map +1 -1
- package/dist/tools.d.ts +2 -2
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +3 -3
- package/dist/tools.js.map +1 -1
- package/package.json +13 -12
- package/references/public-spec.md +1 -1
|
@@ -1,153 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
exports: 128;
|
|
4
|
-
profiles: 16;
|
|
5
|
-
occurrences: 2000;
|
|
6
|
-
depth: 64;
|
|
7
|
-
files: 256;
|
|
8
|
-
fileBytes: number;
|
|
9
|
-
totalBytes: number;
|
|
10
|
-
metadataBytes: number;
|
|
11
|
-
contextBytes: number;
|
|
12
|
-
contextTokens: 8192;
|
|
13
|
-
}>;
|
|
14
|
-
export type ProjectionCode = 'IA-PROJECTION-INPUT-INVALID' | 'IA-PROJECTION-SOURCE-UNAVAILABLE' | 'IA-PROJECTION-FEATURE-UNAVAILABLE' | 'IA-RESOURCE-INVALID';
|
|
15
|
-
export interface ProjectionDiagnostic {
|
|
16
|
-
readonly code: ProjectionCode;
|
|
17
|
-
readonly message: string;
|
|
18
|
-
readonly occurrence?: ResourceOccurrence;
|
|
19
|
-
}
|
|
20
|
-
export declare class ProjectionError extends Error {
|
|
21
|
-
readonly diagnostic: ProjectionDiagnostic;
|
|
22
|
-
constructor(diagnostic: ProjectionDiagnostic);
|
|
23
|
-
}
|
|
24
|
-
export declare function fail(code: ProjectionCode, message: string, owner?: ResourceOccurrence): never;
|
|
25
|
-
export declare function inputFailure(message: string): never;
|
|
26
|
-
export interface ProfilePin {
|
|
27
|
-
readonly id: string;
|
|
28
|
-
readonly version: number;
|
|
29
|
-
readonly implementationDigest: string;
|
|
30
|
-
}
|
|
31
|
-
export interface ProjectionArgument {
|
|
32
|
-
readonly name: string;
|
|
33
|
-
readonly type: 'text' | 'boolean' | 'integer';
|
|
34
|
-
readonly required: boolean;
|
|
35
|
-
readonly target: string;
|
|
36
|
-
}
|
|
37
|
-
export interface ProjectionPattern {
|
|
38
|
-
readonly kind: 'path-glob' | 'command-prefix' | 'import-prefix' | 'prompt-literal';
|
|
39
|
-
readonly value: string;
|
|
40
|
-
readonly priority: number;
|
|
41
|
-
}
|
|
42
|
-
export type Presentation = {
|
|
43
|
-
readonly kind: 'agent';
|
|
44
|
-
readonly agent: ResourceOccurrence;
|
|
45
|
-
readonly agentProfile?: ResourceOccurrence;
|
|
46
|
-
readonly voice?: ResourceOccurrence;
|
|
47
|
-
readonly mandate?: ResourceOccurrence;
|
|
48
|
-
readonly model: string;
|
|
49
|
-
readonly tools: readonly string[];
|
|
50
|
-
readonly delegates: readonly string[];
|
|
51
|
-
} | {
|
|
52
|
-
readonly kind: 'skill';
|
|
53
|
-
readonly invocation: 'automatic-or-explicit';
|
|
54
|
-
readonly arguments: readonly ProjectionArgument[];
|
|
55
|
-
readonly patterns: readonly ProjectionPattern[];
|
|
56
|
-
readonly body: readonly ResourceOccurrence[];
|
|
57
|
-
} | {
|
|
58
|
-
readonly kind: 'command';
|
|
59
|
-
readonly invocation: 'explicit';
|
|
60
|
-
readonly arguments: readonly ProjectionArgument[];
|
|
61
|
-
readonly body: readonly ResourceOccurrence[];
|
|
62
|
-
};
|
|
63
|
-
export interface ProjectionExport {
|
|
64
|
-
readonly id: string;
|
|
65
|
-
readonly target: ResourceOccurrence;
|
|
66
|
-
readonly binding?: ResourceOccurrence;
|
|
67
|
-
readonly profile: string;
|
|
68
|
-
readonly outputName: string;
|
|
69
|
-
readonly required: boolean;
|
|
70
|
-
readonly description: string;
|
|
71
|
-
readonly resources: readonly ResourceUse[];
|
|
72
|
-
readonly requirements: readonly {
|
|
73
|
-
readonly feature: string;
|
|
74
|
-
readonly minimumEvidence: 'generated' | 'process' | 'live-host';
|
|
75
|
-
}[];
|
|
76
|
-
readonly presentation: Presentation;
|
|
77
|
-
}
|
|
78
|
-
export interface ProjectionDescriptor {
|
|
79
|
-
readonly format: 'ia.projection-descriptor.v1';
|
|
80
|
-
readonly sourceRevisions: readonly SourceRevision[];
|
|
81
|
-
readonly product: 'workspace' | 'plugin';
|
|
82
|
-
readonly profiles: readonly ProfilePin[];
|
|
83
|
-
readonly exports: readonly ProjectionExport[];
|
|
84
|
-
readonly resourcesDigest: string;
|
|
85
|
-
readonly inventoryDigest: string;
|
|
86
|
-
readonly digest: string;
|
|
87
|
-
/** Host-selected narrowing of the finite prompt ceilings; part of the descriptor pin. */
|
|
88
|
-
readonly contextBudget?: {
|
|
89
|
-
readonly bytes: number;
|
|
90
|
-
readonly tokens: number;
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
export interface ProjectionFile {
|
|
94
|
-
readonly path: string;
|
|
95
|
-
readonly bytes: number;
|
|
96
|
-
readonly sha256: string;
|
|
97
|
-
readonly encoding: 'utf8' | 'base64';
|
|
98
|
-
readonly content: string;
|
|
99
|
-
}
|
|
100
|
-
export interface ProjectionOutput {
|
|
101
|
-
readonly path: string;
|
|
102
|
-
readonly bytes: number;
|
|
103
|
-
readonly sha256: string;
|
|
104
|
-
readonly role: 'agent' | 'skill' | 'command' | 'resource' | 'plugin' | 'host-metadata';
|
|
105
|
-
readonly sources: readonly ResourceOccurrence[];
|
|
106
|
-
readonly resources: readonly ResourceKey[];
|
|
107
|
-
}
|
|
108
|
-
export interface ProjectionOmission {
|
|
109
|
-
readonly export: string;
|
|
110
|
-
readonly feature: string;
|
|
111
|
-
readonly reason: string;
|
|
112
|
-
}
|
|
113
|
-
export interface ProjectionManifest {
|
|
114
|
-
readonly format: 'ia.projection-manifest.v1';
|
|
115
|
-
readonly product: 'workspace' | 'plugin';
|
|
116
|
-
readonly sourceRevisions: readonly SourceRevision[];
|
|
117
|
-
readonly descriptorDigest: string;
|
|
118
|
-
readonly resourcesDigest: string;
|
|
119
|
-
readonly inventoryDigest: string;
|
|
120
|
-
readonly profiles: readonly ProfilePin[];
|
|
121
|
-
readonly exports: readonly {
|
|
122
|
-
readonly id: string;
|
|
123
|
-
readonly target: ResourceOccurrence;
|
|
124
|
-
readonly closure: readonly ResourceOccurrence[];
|
|
125
|
-
}[];
|
|
126
|
-
readonly outputs: readonly ProjectionOutput[];
|
|
127
|
-
readonly omissions: readonly ProjectionOmission[];
|
|
128
|
-
readonly enforcement: readonly {
|
|
129
|
-
readonly feature: string;
|
|
130
|
-
readonly level: 'guidance';
|
|
131
|
-
readonly evidence: string;
|
|
132
|
-
}[];
|
|
133
|
-
readonly digest: string;
|
|
134
|
-
}
|
|
135
|
-
export type ProjectionResult = {
|
|
136
|
-
readonly format: 'ia.projection-result.v1';
|
|
137
|
-
readonly status: 'refused';
|
|
138
|
-
readonly diagnostics: readonly ProjectionDiagnostic[];
|
|
139
|
-
} | {
|
|
140
|
-
readonly format: 'ia.projection-result.v1';
|
|
141
|
-
readonly status: 'compiled';
|
|
142
|
-
readonly manifest: ProjectionManifest;
|
|
143
|
-
readonly files: readonly ProjectionFile[];
|
|
144
|
-
readonly diagnostics: readonly ProjectionDiagnostic[];
|
|
145
|
-
};
|
|
146
|
-
export declare function closed(value: unknown, required: readonly string[], optional?: readonly string[]): Record<string, unknown>;
|
|
147
|
-
export declare function id(value: unknown): string;
|
|
148
|
-
export declare function catalogId(value: unknown): string;
|
|
149
|
-
export declare function bool(value: unknown): boolean;
|
|
150
|
-
export declare function unique<T>(rows: readonly T[], key: (row: T) => string): T[];
|
|
151
|
-
/** Strict sidecar validation; no native admission or host installation occurs here. */
|
|
152
|
-
export declare function verifyProjectionDescriptor(value: unknown): ProjectionDescriptor;
|
|
1
|
+
/** @deprecated Import from @inventarch/workspace-runtime/internal/projection-format. */
|
|
2
|
+
export * from '@inventarch/workspace-runtime/internal/projection-format';
|
|
153
3
|
//# sourceMappingURL=projection-format.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projection-format.d.ts","sourceRoot":"","sources":["../src/projection-format.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"projection-format.d.ts","sourceRoot":"","sources":["../src/projection-format.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,cAAc,0DAA0D,CAAC"}
|
|
@@ -1,201 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
exports: 128,
|
|
4
|
-
profiles: 16,
|
|
5
|
-
occurrences: 2000,
|
|
6
|
-
depth: 64,
|
|
7
|
-
files: 256,
|
|
8
|
-
fileBytes: 1024 * 1024,
|
|
9
|
-
totalBytes: 16 * 1024 * 1024,
|
|
10
|
-
metadataBytes: 2 * 1024 * 1024,
|
|
11
|
-
contextBytes: 32 * 1024,
|
|
12
|
-
contextTokens: 8192,
|
|
13
|
-
});
|
|
14
|
-
export class ProjectionError extends Error {
|
|
15
|
-
diagnostic;
|
|
16
|
-
constructor(diagnostic) {
|
|
17
|
-
super(diagnostic.message);
|
|
18
|
-
this.diagnostic = diagnostic;
|
|
19
|
-
this.name = 'ProjectionError';
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
export function fail(code, message, owner) {
|
|
23
|
-
throw new ProjectionError({ code, message, ...(owner ? { occurrence: owner } : {}) });
|
|
24
|
-
}
|
|
25
|
-
export function inputFailure(message) {
|
|
26
|
-
return fail('IA-PROJECTION-INPUT-INVALID', message);
|
|
27
|
-
}
|
|
28
|
-
export function closed(value, required, optional = []) {
|
|
29
|
-
const present = value !== null && typeof value === 'object' ? optional.filter((key) => Object.hasOwn(value, key)) : [];
|
|
30
|
-
return object(value, [...required, ...present]);
|
|
31
|
-
}
|
|
32
|
-
export function id(value) {
|
|
33
|
-
const result = text(value, 64);
|
|
34
|
-
if (!/^[a-z][a-z0-9-]{0,63}$/.test(result))
|
|
35
|
-
inputFailure('Invalid projection identifier');
|
|
36
|
-
return result;
|
|
37
|
-
}
|
|
38
|
-
export function catalogId(value) {
|
|
39
|
-
const result = text(value, 128);
|
|
40
|
-
if (!/^[a-zA-Z][a-zA-Z0-9_.-]{0,127}$/.test(result))
|
|
41
|
-
inputFailure('Invalid installed catalog key');
|
|
42
|
-
return result;
|
|
43
|
-
}
|
|
44
|
-
export function bool(value) {
|
|
45
|
-
if (typeof value !== 'boolean')
|
|
46
|
-
inputFailure('Expected a literal projection boolean');
|
|
47
|
-
return value;
|
|
48
|
-
}
|
|
49
|
-
function oneOf(value, values) {
|
|
50
|
-
if (typeof value !== 'string' || !values.includes(value))
|
|
51
|
-
inputFailure('Unknown projection variant');
|
|
52
|
-
return value;
|
|
53
|
-
}
|
|
54
|
-
export function unique(rows, key) {
|
|
55
|
-
if (new Set(rows.map(key)).size !== rows.length)
|
|
56
|
-
inputFailure('Duplicate projection entry');
|
|
57
|
-
return [...rows];
|
|
58
|
-
}
|
|
59
|
-
function pin(value) {
|
|
60
|
-
const row = object(value, ['id', 'version', 'implementationDigest']);
|
|
61
|
-
return {
|
|
62
|
-
id: catalogId(row['id']),
|
|
63
|
-
version: integer(row['version'], 1_000_000, 1),
|
|
64
|
-
implementationDigest: hash(row['implementationDigest']),
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
function argument(value) {
|
|
68
|
-
const row = object(value, ['name', 'type', 'required', 'target']), target = id(row['target']);
|
|
69
|
-
if ([
|
|
70
|
-
'root',
|
|
71
|
-
'actor',
|
|
72
|
-
'grant',
|
|
73
|
-
'implementation',
|
|
74
|
-
'scope',
|
|
75
|
-
'within',
|
|
76
|
-
'permissions',
|
|
77
|
-
'credentials',
|
|
78
|
-
'tenant',
|
|
79
|
-
'subject',
|
|
80
|
-
].includes(target))
|
|
81
|
-
inputFailure('Argument cannot target host authority');
|
|
82
|
-
return {
|
|
83
|
-
name: id(row['name']),
|
|
84
|
-
type: oneOf(row['type'], ['text', 'boolean', 'integer']),
|
|
85
|
-
required: bool(row['required']),
|
|
86
|
-
target,
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
function presentation(value) {
|
|
90
|
-
const kind = value !== null && typeof value === 'object' ? Object.getOwnPropertyDescriptor(value, 'kind')?.value : undefined;
|
|
91
|
-
if (kind === 'agent') {
|
|
92
|
-
const row = closed(value, ['kind', 'agent', 'model', 'tools', 'delegates'], ['agentProfile', 'voice', 'mandate']);
|
|
93
|
-
const extra = Object.fromEntries(['agentProfile', 'voice', 'mandate']
|
|
94
|
-
.filter((key) => Object.hasOwn(row, key))
|
|
95
|
-
.map((key) => [key, occurrence(row[key])]));
|
|
96
|
-
return {
|
|
97
|
-
kind,
|
|
98
|
-
agent: occurrence(row['agent']),
|
|
99
|
-
...extra,
|
|
100
|
-
model: catalogId(row['model']),
|
|
101
|
-
tools: unique(list(row['tools'], 64).map(catalogId), (v) => v),
|
|
102
|
-
delegates: unique(list(row['delegates'], 64).map(catalogId), (v) => v),
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
if (kind !== 'skill' && kind !== 'command')
|
|
106
|
-
inputFailure('Unsupported presentation kind');
|
|
107
|
-
const row = object(value, ['kind', 'invocation', 'arguments', 'body', ...(kind === 'skill' ? ['patterns'] : [])]);
|
|
108
|
-
const args = unique(list(row['arguments'], 32).map(argument), (a) => a.name);
|
|
109
|
-
unique(args, (a) => a.target);
|
|
110
|
-
const body = unique(list(row['body'], 64).map(occurrence), (o) => JSON.stringify(o));
|
|
111
|
-
if (kind === 'command')
|
|
112
|
-
return { kind, invocation: oneOf(row['invocation'], ['explicit']), arguments: args, body };
|
|
113
|
-
const patterns = list(row['patterns'], 32).map((value) => {
|
|
114
|
-
const p = object(value, ['kind', 'value', 'priority']);
|
|
115
|
-
return {
|
|
116
|
-
kind: oneOf(p['kind'], ['path-glob', 'command-prefix', 'import-prefix', 'prompt-literal']),
|
|
117
|
-
value: text(p['value'], 256),
|
|
118
|
-
priority: integer(p['priority'], 100, -100),
|
|
119
|
-
};
|
|
120
|
-
});
|
|
121
|
-
unique(patterns, (p) => `${p.kind}:${p.value}`);
|
|
122
|
-
return { kind, invocation: oneOf(row['invocation'], ['automatic-or-explicit']), arguments: args, body, patterns };
|
|
123
|
-
}
|
|
124
|
-
/** Strict sidecar validation; no native admission or host installation occurs here. */
|
|
125
|
-
export function verifyProjectionDescriptor(value) {
|
|
126
|
-
try {
|
|
127
|
-
if (typeof value === 'string' && Buffer.byteLength(value) > PROJECTION_LIMITS.metadataBytes)
|
|
128
|
-
inputFailure('Projection descriptor exceeds its ceiling');
|
|
129
|
-
const row = closed(typeof value === 'string' ? decodeJson(value) : value, ['format', 'sourceRevisions', 'product', 'profiles', 'exports', 'resourcesDigest', 'inventoryDigest', 'digest'], ['contextBudget']);
|
|
130
|
-
if (row['format'] !== 'ia.projection-descriptor.v1')
|
|
131
|
-
inputFailure('Unsupported projection descriptor format');
|
|
132
|
-
const sourceRevisions = ordered(unique(list(row['sourceRevisions'], 2001).map(sourceRevision), (s) => s.source), (s) => s.source);
|
|
133
|
-
const profiles = ordered(unique(list(row['profiles'], PROJECTION_LIMITS.profiles).map(pin), (p) => p.id), (p) => p.id);
|
|
134
|
-
const exports = ordered(unique(list(row['exports'], PROJECTION_LIMITS.exports).map((value) => {
|
|
135
|
-
const e = closed(value, [
|
|
136
|
-
'id',
|
|
137
|
-
'target',
|
|
138
|
-
'profile',
|
|
139
|
-
'outputName',
|
|
140
|
-
'required',
|
|
141
|
-
'description',
|
|
142
|
-
'resources',
|
|
143
|
-
'requirements',
|
|
144
|
-
'presentation',
|
|
145
|
-
], ['binding']);
|
|
146
|
-
const target = occurrence(e['target']), resources = association({ owner: target, resources: e['resources'] }).resources;
|
|
147
|
-
const requirements = ordered(unique(list(e['requirements'], 64).map((v) => {
|
|
148
|
-
const r = object(v, ['feature', 'minimumEvidence']);
|
|
149
|
-
return {
|
|
150
|
-
feature: id(r['feature']),
|
|
151
|
-
minimumEvidence: oneOf(r['minimumEvidence'], ['generated', 'process', 'live-host']),
|
|
152
|
-
};
|
|
153
|
-
}), (r) => r.feature), (r) => r.feature);
|
|
154
|
-
return {
|
|
155
|
-
id: id(e['id']),
|
|
156
|
-
target,
|
|
157
|
-
...(Object.hasOwn(e, 'binding') ? { binding: occurrence(e['binding']) } : {}),
|
|
158
|
-
profile: catalogId(e['profile']),
|
|
159
|
-
outputName: id(e['outputName']),
|
|
160
|
-
required: bool(e['required']),
|
|
161
|
-
description: text(e['description'], 1024),
|
|
162
|
-
resources,
|
|
163
|
-
requirements,
|
|
164
|
-
presentation: presentation(e['presentation']),
|
|
165
|
-
};
|
|
166
|
-
}), (e) => e.id), (e) => e.id);
|
|
167
|
-
if (!exports.length || exports.some((e) => !profiles.some((p) => p.id === e.profile)))
|
|
168
|
-
inputFailure('Exports require selected profile pins');
|
|
169
|
-
const budget = Object.hasOwn(row, 'contextBudget') ? object(row['contextBudget'], ['bytes', 'tokens']) : null;
|
|
170
|
-
const body = {
|
|
171
|
-
format: 'ia.projection-descriptor.v1',
|
|
172
|
-
sourceRevisions,
|
|
173
|
-
product: oneOf(row['product'], ['workspace', 'plugin']),
|
|
174
|
-
profiles,
|
|
175
|
-
exports,
|
|
176
|
-
resourcesDigest: hash(row['resourcesDigest']),
|
|
177
|
-
inventoryDigest: hash(row['inventoryDigest']),
|
|
178
|
-
...(budget
|
|
179
|
-
? {
|
|
180
|
-
contextBudget: {
|
|
181
|
-
bytes: integer(budget['bytes'], PROJECTION_LIMITS.contextBytes, 1),
|
|
182
|
-
tokens: integer(budget['tokens'], PROJECTION_LIMITS.contextTokens, 1),
|
|
183
|
-
},
|
|
184
|
-
}
|
|
185
|
-
: {}),
|
|
186
|
-
};
|
|
187
|
-
const digest = hash(row['digest']);
|
|
188
|
-
const { digest: _inputDigest, ...inputBody } = row;
|
|
189
|
-
if (Buffer.byteLength(JSON.stringify(body)) > PROJECTION_LIMITS.metadataBytes ||
|
|
190
|
-
metadataDigest(body) !== digest ||
|
|
191
|
-
metadataDigest(inputBody) !== digest)
|
|
192
|
-
inputFailure('Projection descriptor digest, order or size differs');
|
|
193
|
-
return frozen({ ...body, digest });
|
|
194
|
-
}
|
|
195
|
-
catch (error) {
|
|
196
|
-
if (error instanceof ProjectionError)
|
|
197
|
-
throw error;
|
|
198
|
-
inputFailure('Malformed projection descriptor');
|
|
199
|
-
}
|
|
200
|
-
}
|
|
1
|
+
/** @deprecated Import from @inventarch/workspace-runtime/internal/projection-format. */
|
|
2
|
+
export * from '@inventarch/workspace-runtime/internal/projection-format';
|
|
201
3
|
//# sourceMappingURL=projection-format.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projection-format.js","sourceRoot":"","sources":["../src/projection-format.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"projection-format.js","sourceRoot":"","sources":["../src/projection-format.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,cAAc,0DAA0D,CAAC"}
|
|
@@ -1,43 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import type { ProfilePin, ProjectionExport } from './projection-format.js';
|
|
4
|
-
import type { SerializedExport } from './projection-codex.js';
|
|
5
|
-
export { CODEX_PROSE_FEATURES, codexAgentRegistration } from './projection-codex.js';
|
|
6
|
-
export interface ProjectionCatalog {
|
|
7
|
-
readonly format: 'ia.projection-catalog.v1';
|
|
8
|
-
readonly profile: ProfilePin;
|
|
9
|
-
readonly models: readonly {
|
|
10
|
-
readonly id: string;
|
|
11
|
-
readonly name: string;
|
|
12
|
-
}[];
|
|
13
|
-
readonly tools: readonly {
|
|
14
|
-
readonly id: string;
|
|
15
|
-
readonly name: string;
|
|
16
|
-
}[];
|
|
17
|
-
readonly inputFields: readonly {
|
|
18
|
-
readonly name: string;
|
|
19
|
-
readonly type: 'text';
|
|
20
|
-
}[];
|
|
21
|
-
}
|
|
22
|
-
export declare const CLAUDE_PROSE_FEATURES: readonly string[];
|
|
23
|
-
/** Fixed v1 table of both prose profiles: the host tool ids a native capability effect covers. No other effect maps a tool. */
|
|
24
|
-
export declare const PROSE_EFFECT_TOOLS: ReadonlyMap<string, readonly string[]>;
|
|
25
|
-
/** Host-owned name mappings. Their presence is metadata support, never an execution grant. */
|
|
26
|
-
export declare function claudeProseCatalog(implementationDigest: string, selections?: Pick<ProjectionCatalog, 'models' | 'tools' | 'inputFields'>): ProjectionCatalog;
|
|
27
|
-
export declare function verifyCatalog(value: ProjectionCatalog): ProjectionCatalog;
|
|
28
|
-
export declare function codexProseCatalog(implementationDigest: string, selections?: Pick<ProjectionCatalog, 'models' | 'tools' | 'inputFields'>): ProjectionCatalog;
|
|
29
|
-
export declare const isCodex: (catalog: ProjectionCatalog) => boolean;
|
|
30
|
-
export declare function outputPath(product: 'workspace' | 'plugin', entry: ProjectionExport, catalog: ProjectionCatalog): string;
|
|
31
|
-
export declare function checkFeatures(entry: ProjectionExport, catalog: ProjectionCatalog, product: 'workspace' | 'plugin'): void;
|
|
32
|
-
export declare function inert(text: string): void;
|
|
33
|
-
export declare function nativeValue(value: CompiledValue): string;
|
|
34
|
-
export declare function renderRecord(record: CompiledRecord, owner: ResourceOccurrence): string;
|
|
35
|
-
export declare function resourceDestination(digest: string, file: ResourceFile): string;
|
|
36
|
-
export declare function discoveryLink(from: string, target: string, label: string): string;
|
|
37
|
-
/** Restricted Markdown linking: no lookup beyond the selected captured file set. */
|
|
38
|
-
export declare function resourceMarkdown(content: string, file: Pick<ResourceFile, 'key'>, output: string, destinations: ReadonlyMap<string, string>, rewrite: boolean): string;
|
|
39
|
-
export declare function frontmatter(entry: ProjectionExport, catalog: ProjectionCatalog): string;
|
|
40
|
-
export declare function invocation(entry: ProjectionExport, catalog: ProjectionCatalog, product: 'workspace' | 'plugin'): string;
|
|
41
|
-
export declare function serializeExport(product: 'workspace' | 'plugin', entry: ProjectionExport, catalog: ProjectionCatalog, body: string): readonly SerializedExport[];
|
|
42
|
-
export declare function pluginFile(catalog: ProjectionCatalog, name: string, version: string): SerializedExport;
|
|
1
|
+
/** @deprecated Import from @inventarch/workspace-runtime/internal/projection-host. */
|
|
2
|
+
export * from '@inventarch/workspace-runtime/internal/projection-host';
|
|
43
3
|
//# sourceMappingURL=projection-host.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projection-host.d.ts","sourceRoot":"","sources":["../src/projection-host.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"projection-host.d.ts","sourceRoot":"","sources":["../src/projection-host.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,cAAc,wDAAwD,CAAC"}
|