@inventarch/agent-composition-system 1.1.1 → 1.2.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
package/LANGUAGE.md
CHANGED
|
@@ -31,7 +31,7 @@ Spec source locators do not load documents. Resource capture and disclosure requ
|
|
|
31
31
|
| @kind | taxonomy | Defines a closed semantic role for records; lowering determines the role of each registered word. |
|
|
32
32
|
| @lane | taxonomy | Defines a retrieval lane associated with record kinds. |
|
|
33
33
|
| @law | governance-system | Declares a rule with severity. Structural admission cannot establish the truth or suitability of its prose. |
|
|
34
|
-
| @mandate | agent-system | States bounded authority and conditions for a participant. Host authorization remains independent. |
|
|
34
|
+
| @mandate | agent-system | States bounded authority and conditions for a participant. Host authorization remains independent. An authority section names the participant it binds, the closed moves it allows, the workspaces it scopes, the words it excludes and the paths it covers. |
|
|
35
35
|
| @milestone | work-system | Represents an outcome with an exit criterion inside exactly one plan; it names a condition, not the work toward it. |
|
|
36
36
|
| @move | taxonomy | Defines the closed classification of an agent action or activity. |
|
|
37
37
|
| @observation | learning-system | Represents an attributed evidence account with interpretation and retention metadata. Evidence claims are not verified by field typing. |
|
|
@@ -51,6 +51,6 @@ Spec source locators do not load documents. Resource capture and disclosure requ
|
|
|
51
51
|
| @template | template-system | Represents bounded rendering inputs and output structure. Rendering does not publish or install output. |
|
|
52
52
|
| @value-type | taxonomy | Defines the field types that schemas may require. |
|
|
53
53
|
| @voice | agent-composition-system | Declares communication attributes separate from authority and procedure. |
|
|
54
|
-
| @workspace | workspace-system | Groups systems into an explicit work boundary; relationships can describe dependencies between boundaries. |
|
|
54
|
+
| @workspace | workspace-system | Groups systems into an explicit work boundary; relationships can describe dependencies between boundaries. Its sources name the roots and placement bands its records are captured from, and its steward the agent that directs it by default. |
|
|
55
55
|
|
|
56
56
|
This guide describes the selected structural vocabulary. Private expert procedures, live provider behavior and unobserved platform qualification are separate from the installed public contract.
|
package/README.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
# @inventarch/agent-composition-system
|
|
2
2
|
|
|
3
|
-
See [the package contract](SPEC.md) and the exported TypeScript declarations.
|
|
3
|
+
The composition compiler: it compiles admitted `@agent-profile`, `@capability`, `@harness` and `@execution-binding` records against an installed catalog into a compiled harness and an execution manifest, and owns the captured-read adapters and the task-capture contract. See [the package contract](SPEC.md) and the exported TypeScript declarations.
|
|
4
|
+
|
|
5
|
+
The generic workspace runtime lives in `@inventarch/workspace-runtime` (packages/workspace-runtime in the repository); this package depends on it. The moved root symbols are re-exported from the package root, and every moved subpath, the `./internal/*` ones included, remains a plain alias that forwards to the corresponding module of `@inventarch/workspace-runtime`. Neither carries a per-symbol deprecation hint, because TypeScript does not apply a `@deprecated` tag to a re-export statement. Both are removed at the next major; import from `@inventarch/workspace-runtime` instead.
|
package/SPEC.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# @inventarch/agent-composition-system
|
|
2
2
|
|
|
3
|
-
Public language mechanism. The [language reference](LANGUAGE.md) defines vocabulary and evaluation limits. Package exports describe the installed API. Curated agent methods and hosted services are supplied independently.
|
|
3
|
+
Public language mechanism: the composition compiler for the `@agent-profile`, `@capability`, `@harness` and `@execution-binding` words. The [language reference](LANGUAGE.md) defines vocabulary and evaluation limits. Package exports describe the installed API. Curated agent methods and hosted services are supplied independently.
|
|
4
|
+
|
|
5
|
+
This package owns `compileHarness`, `executionManifest`, the installed catalog types, the captured-read adapters and the task-capture contract. The generic workspace runtime (capture and adoption, resources, projections, publication, candidates, templates, lifecycle, authoring index and manifest, installed catalog, sources, local store and adapters) lives in `@inventarch/workspace-runtime` (packages/workspace-runtime in the repository), which this package depends on and never the reverse. The root re-exports of the moved symbols, the `./resources`, `./projections`, `./templates`, `./sources`, `./authoring`, `./authoring-manifest`, `./lifecycle`, `./lifecycle-profile`, `./adapters` and `./local-store` subpaths, and the `./internal/*` subpaths of every moved module remain as plain aliases that forward to the corresponding module of `@inventarch/workspace-runtime`. They carry no per-symbol deprecation hint, because TypeScript does not apply a `@deprecated` tag to a re-export statement, and they are removed at the next major; import them from `@inventarch/workspace-runtime`. `tests/compatibility.test.ts` keeps every 1.1.0 subpath in both export maps and checks each alias against its target. `installedImplementationDigest` from this package pins the composition entrypoint on top of the generic runtime pin, so a changed composition module moves only this digest while a changed workspace-runtime module moves both; `tests/installed-catalog.test.ts` shows this over a copied install.
|
|
4
6
|
|
|
5
7
|
The [first-party installed captured read](references/installed-read.md) is available through fixed root exports. Current host authority and capture/code verification remain required; installation grants nothing.
|
|
6
8
|
|
package/dist/adapters.d.ts
CHANGED
|
@@ -1,70 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export { metadataDigest as adapterMetadataDigest } from './resource-format.js';
|
|
4
|
-
export declare const ADAPTER_LIMITS: Readonly<{
|
|
5
|
-
durationMs: 120000;
|
|
6
|
-
inputBytes: number;
|
|
7
|
-
outputBytes: number;
|
|
8
|
-
concurrency: 4;
|
|
9
|
-
operations: 64;
|
|
10
|
-
metadataBytes: number;
|
|
11
|
-
}>;
|
|
12
|
-
export declare class AdapterError extends Error {
|
|
13
|
-
readonly code = "IA-ADAPTER-INVALID";
|
|
14
|
-
constructor(message: string);
|
|
15
|
-
}
|
|
16
|
-
export declare const adapterInvalid: (message: string) => never;
|
|
17
|
-
export declare function adapterKey(value: unknown): string;
|
|
18
|
-
export declare function adapterJson(input: unknown): Json;
|
|
19
|
-
export interface InstalledAdapterEffect {
|
|
20
|
-
readonly id: string;
|
|
21
|
-
readonly kind: 'managed-draft' | 'retained-store' | 'temporary-files' | 'host-transcript-read' | 'loopback-listener' | 'process' | 'remote-call';
|
|
22
|
-
readonly targetPolicy: string;
|
|
23
|
-
readonly enforcement: 'adapter' | 'contained';
|
|
24
|
-
readonly credentials: readonly string[];
|
|
25
|
-
readonly telemetry: string;
|
|
26
|
-
}
|
|
27
|
-
export interface InstalledAdapterDescriptor {
|
|
28
|
-
readonly format: 'ia.installed-adapter.v1';
|
|
29
|
-
readonly id: string;
|
|
30
|
-
readonly version: string;
|
|
31
|
-
readonly implementation: {
|
|
32
|
-
readonly kind: 'local';
|
|
33
|
-
readonly inventoryDigest: string;
|
|
34
|
-
readonly entrypoint: string;
|
|
35
|
-
readonly transport: 'stdio' | 'process';
|
|
36
|
-
readonly runtime: string;
|
|
37
|
-
readonly platforms: readonly string[];
|
|
38
|
-
readonly abi: string;
|
|
39
|
-
} | {
|
|
40
|
-
readonly kind: 'remote';
|
|
41
|
-
readonly provider: string;
|
|
42
|
-
readonly origin: string;
|
|
43
|
-
readonly contractDigest: string;
|
|
44
|
-
readonly clientProfile: string;
|
|
45
|
-
};
|
|
46
|
-
readonly operations: readonly OperationDefinition[];
|
|
47
|
-
readonly effects: readonly InstalledAdapterEffect[];
|
|
48
|
-
readonly limits: {
|
|
49
|
-
readonly durationMs: number;
|
|
50
|
-
readonly inputBytes: number;
|
|
51
|
-
readonly outputBytes: number;
|
|
52
|
-
readonly concurrency: number;
|
|
53
|
-
};
|
|
54
|
-
readonly recovery: {
|
|
55
|
-
readonly id: string;
|
|
56
|
-
readonly contractDigest: string;
|
|
57
|
-
};
|
|
58
|
-
readonly digest: string;
|
|
59
|
-
}
|
|
60
|
-
export interface InstalledAdapterCatalog {
|
|
61
|
-
readonly adapters: Readonly<Record<string, unknown>>;
|
|
62
|
-
readonly containments: readonly {
|
|
63
|
-
readonly adapterDigest: string;
|
|
64
|
-
readonly targetPolicy: string;
|
|
65
|
-
}[];
|
|
66
|
-
}
|
|
67
|
-
/** Decode and hash only; installed qualification additionally requires verifyInstalledAdapter. */
|
|
68
|
-
export declare function decodeInstalledAdapter(input: unknown): InstalledAdapterDescriptor;
|
|
69
|
-
export declare function verifyInstalledAdapter(value: unknown, catalog: InstalledAdapterCatalog): InstalledAdapterDescriptor;
|
|
1
|
+
/** @deprecated Import from @inventarch/workspace-runtime/adapters. */
|
|
2
|
+
export * from '@inventarch/workspace-runtime/adapters';
|
|
70
3
|
//# sourceMappingURL=adapters.d.ts.map
|
package/dist/adapters.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapters.d.ts","sourceRoot":"","sources":["../src/adapters.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"adapters.d.ts","sourceRoot":"","sources":["../src/adapters.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,cAAc,wCAAwC,CAAC"}
|
package/dist/adapters.js
CHANGED
|
@@ -1,212 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export const ADAPTER_LIMITS = Object.freeze({
|
|
4
|
-
durationMs: 120_000,
|
|
5
|
-
inputBytes: 1024 * 1024,
|
|
6
|
-
outputBytes: 1024 * 1024,
|
|
7
|
-
concurrency: 4,
|
|
8
|
-
operations: 64,
|
|
9
|
-
metadataBytes: 2 * 1024 * 1024,
|
|
10
|
-
});
|
|
11
|
-
export class AdapterError extends Error {
|
|
12
|
-
code = 'IA-ADAPTER-INVALID';
|
|
13
|
-
constructor(message) {
|
|
14
|
-
super(message);
|
|
15
|
-
this.name = 'AdapterError';
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
export const adapterInvalid = (message) => {
|
|
19
|
-
throw new AdapterError(message);
|
|
20
|
-
};
|
|
21
|
-
export function adapterKey(value) {
|
|
22
|
-
const key = text(value, 128);
|
|
23
|
-
if (!/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/.test(key))
|
|
24
|
-
return adapterInvalid('An opaque installed catalog key is required');
|
|
25
|
-
return key;
|
|
26
|
-
}
|
|
27
|
-
function boundedText(value, limit = 128) {
|
|
28
|
-
const result = text(value, limit);
|
|
29
|
-
if (!result || /[\u0000-\u001f\u007f]/.test(result))
|
|
30
|
-
return adapterInvalid('Bounded installed metadata is required');
|
|
31
|
-
return result;
|
|
32
|
-
}
|
|
33
|
-
function one(value, values) {
|
|
34
|
-
if (typeof value !== 'string' || !values.includes(value))
|
|
35
|
-
return adapterInvalid('Unsupported installed adapter contract');
|
|
36
|
-
return value;
|
|
37
|
-
}
|
|
38
|
-
function strings(value, max, decode = adapterKey) {
|
|
39
|
-
const rows = list(value, max).map(decode), sorted = [...rows].sort();
|
|
40
|
-
if (new Set(rows).size !== rows.length || rows.some((row, index) => row !== sorted[index]))
|
|
41
|
-
return adapterInvalid('Installed metadata sets must be unique and sorted');
|
|
42
|
-
return rows;
|
|
43
|
-
}
|
|
44
|
-
export function adapterJson(input) {
|
|
45
|
-
let nodes = 0;
|
|
46
|
-
const read = (value, depth) => {
|
|
47
|
-
if (++nodes > 10_000 || depth > 16)
|
|
48
|
-
return adapterInvalid('Installed JSON shape exceeds its bound');
|
|
49
|
-
if (value === null || typeof value === 'boolean')
|
|
50
|
-
return value;
|
|
51
|
-
if (typeof value === 'string')
|
|
52
|
-
return text(value, ADAPTER_LIMITS.inputBytes);
|
|
53
|
-
if (typeof value === 'number' && Number.isFinite(value))
|
|
54
|
-
return value;
|
|
55
|
-
if (Array.isArray(value)) {
|
|
56
|
-
if (Reflect.ownKeys(value).length !== value.length + 1 ||
|
|
57
|
-
Object.values(Object.getOwnPropertyDescriptors(value)).some((field) => !Object.hasOwn(field, 'value')))
|
|
58
|
-
return adapterInvalid('Expected closed JSON array data');
|
|
59
|
-
return value.map((item) => read(item, depth + 1));
|
|
60
|
-
}
|
|
61
|
-
if (value && typeof value === 'object') {
|
|
62
|
-
const row = object(value, Object.keys(value));
|
|
63
|
-
return Object.fromEntries(Object.entries(row).map(([key, item]) => [key, read(item, depth + 1)]));
|
|
64
|
-
}
|
|
65
|
-
return adapterInvalid('Expected finite JSON data');
|
|
66
|
-
};
|
|
67
|
-
return read(input, 0);
|
|
68
|
-
}
|
|
69
|
-
/** Decode and hash only; installed qualification additionally requires verifyInstalledAdapter. */
|
|
70
|
-
export function decodeInstalledAdapter(input) {
|
|
71
|
-
const row = object(typeof input === 'string' ? decodeJson(input) : input, [
|
|
72
|
-
'format',
|
|
73
|
-
'id',
|
|
74
|
-
'version',
|
|
75
|
-
'implementation',
|
|
76
|
-
'operations',
|
|
77
|
-
'effects',
|
|
78
|
-
'limits',
|
|
79
|
-
'recovery',
|
|
80
|
-
'digest',
|
|
81
|
-
]);
|
|
82
|
-
one(row['format'], ['ia.installed-adapter.v1']);
|
|
83
|
-
const limitsRow = object(row['limits'], ['durationMs', 'inputBytes', 'outputBytes', 'concurrency']);
|
|
84
|
-
const limits = {
|
|
85
|
-
durationMs: integer(limitsRow['durationMs'], ADAPTER_LIMITS.durationMs, 1),
|
|
86
|
-
inputBytes: integer(limitsRow['inputBytes'], ADAPTER_LIMITS.inputBytes, 1),
|
|
87
|
-
outputBytes: integer(limitsRow['outputBytes'], ADAPTER_LIMITS.outputBytes, 1),
|
|
88
|
-
concurrency: integer(limitsRow['concurrency'], ADAPTER_LIMITS.concurrency, 1),
|
|
89
|
-
};
|
|
90
|
-
const implementationRow = row['implementation'];
|
|
91
|
-
if (!implementationRow || typeof implementationRow !== 'object' || Array.isArray(implementationRow))
|
|
92
|
-
return adapterInvalid('Installed implementation descriptor required');
|
|
93
|
-
const kind = Object.getOwnPropertyDescriptor(implementationRow, 'kind')?.value;
|
|
94
|
-
let implementation;
|
|
95
|
-
if (kind === 'local') {
|
|
96
|
-
const local = object(implementationRow, [
|
|
97
|
-
'kind',
|
|
98
|
-
'inventoryDigest',
|
|
99
|
-
'entrypoint',
|
|
100
|
-
'transport',
|
|
101
|
-
'runtime',
|
|
102
|
-
'platforms',
|
|
103
|
-
'abi',
|
|
104
|
-
]);
|
|
105
|
-
const platforms = strings(local['platforms'], 16);
|
|
106
|
-
if (!platforms.length)
|
|
107
|
-
return adapterInvalid('An explicit supported platform is required');
|
|
108
|
-
implementation = {
|
|
109
|
-
kind,
|
|
110
|
-
inventoryDigest: hash(local['inventoryDigest']),
|
|
111
|
-
entrypoint: adapterKey(local['entrypoint']),
|
|
112
|
-
transport: one(local['transport'], ['stdio', 'process']),
|
|
113
|
-
runtime: boundedText(local['runtime']),
|
|
114
|
-
platforms,
|
|
115
|
-
abi: adapterKey(local['abi']),
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
const remote = object(implementationRow, ['kind', 'provider', 'origin', 'contractDigest', 'clientProfile']);
|
|
120
|
-
one(remote['kind'], ['remote']);
|
|
121
|
-
const origin = boundedText(remote['origin'], 2048), url = new URL(origin);
|
|
122
|
-
if (url.protocol !== 'https:' || url.username || url.password || url.search || url.hash || url.href !== origin)
|
|
123
|
-
return adapterInvalid('An exact credential-free HTTPS service origin is required');
|
|
124
|
-
implementation = {
|
|
125
|
-
kind: 'remote',
|
|
126
|
-
provider: adapterKey(remote['provider']),
|
|
127
|
-
origin,
|
|
128
|
-
contractDigest: hash(remote['contractDigest']),
|
|
129
|
-
clientProfile: adapterKey(remote['clientProfile']),
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
const operations = list(row['operations'], ADAPTER_LIMITS.operations).map((value) => {
|
|
133
|
-
const hasPurpose = !!value && typeof value === 'object' && Object.hasOwn(value, 'purpose');
|
|
134
|
-
const op = object(value, [
|
|
135
|
-
'id',
|
|
136
|
-
'handler',
|
|
137
|
-
'digest',
|
|
138
|
-
'effects',
|
|
139
|
-
'recovery',
|
|
140
|
-
'timeoutMs',
|
|
141
|
-
'input',
|
|
142
|
-
'output',
|
|
143
|
-
'maxOutputBytes',
|
|
144
|
-
...(hasPurpose ? ['purpose'] : []),
|
|
145
|
-
]);
|
|
146
|
-
const effects = strings(op['effects'], 3).map((effect) => one(effect, ['read', 'local-write', 'external-write']));
|
|
147
|
-
return {
|
|
148
|
-
id: adapterKey(op['id']),
|
|
149
|
-
handler: adapterKey(op['handler']),
|
|
150
|
-
digest: hash(op['digest']),
|
|
151
|
-
effects,
|
|
152
|
-
recovery: one(op['recovery'], ['repeatable', 'idempotent', 'reconcile', 'manual']),
|
|
153
|
-
timeoutMs: integer(op['timeoutMs'], limits.durationMs, 1),
|
|
154
|
-
input: adapterJson(op['input']),
|
|
155
|
-
output: adapterJson(op['output']),
|
|
156
|
-
maxOutputBytes: integer(op['maxOutputBytes'], limits.outputBytes, 1),
|
|
157
|
-
...(hasPurpose ? { purpose: one(op['purpose'], ['candidate-validation']) } : {}),
|
|
158
|
-
};
|
|
159
|
-
});
|
|
160
|
-
if (!operations.length)
|
|
161
|
-
return adapterInvalid('At least one installed operation is required');
|
|
162
|
-
const effects = list(row['effects'], 64).map((value) => {
|
|
163
|
-
const effect = object(value, ['id', 'kind', 'targetPolicy', 'enforcement', 'credentials', 'telemetry']);
|
|
164
|
-
return {
|
|
165
|
-
id: adapterKey(effect['id']),
|
|
166
|
-
kind: one(effect['kind'], [
|
|
167
|
-
'managed-draft',
|
|
168
|
-
'retained-store',
|
|
169
|
-
'temporary-files',
|
|
170
|
-
'host-transcript-read',
|
|
171
|
-
'loopback-listener',
|
|
172
|
-
'process',
|
|
173
|
-
'remote-call',
|
|
174
|
-
]),
|
|
175
|
-
targetPolicy: adapterKey(effect['targetPolicy']),
|
|
176
|
-
enforcement: one(effect['enforcement'], ['adapter', 'contained']),
|
|
177
|
-
credentials: strings(effect['credentials'], 16),
|
|
178
|
-
telemetry: adapterKey(effect['telemetry']),
|
|
179
|
-
};
|
|
180
|
-
});
|
|
181
|
-
for (const rows of [operations, effects]) {
|
|
182
|
-
const ids = rows.map((item) => item.id);
|
|
183
|
-
if (new Set(ids).size !== ids.length || ids.join('\0') !== [...ids].sort().join('\0'))
|
|
184
|
-
return adapterInvalid('Installed operation/effect identities must be unique and sorted');
|
|
185
|
-
}
|
|
186
|
-
const recoveryRow = object(row['recovery'], ['id', 'contractDigest']);
|
|
187
|
-
const body = {
|
|
188
|
-
format: 'ia.installed-adapter.v1',
|
|
189
|
-
id: adapterKey(row['id']),
|
|
190
|
-
version: boundedText(row['version']),
|
|
191
|
-
implementation,
|
|
192
|
-
operations,
|
|
193
|
-
effects,
|
|
194
|
-
limits,
|
|
195
|
-
recovery: { id: adapterKey(recoveryRow['id']), contractDigest: hash(recoveryRow['contractDigest']) },
|
|
196
|
-
};
|
|
197
|
-
if (Buffer.byteLength(JSON.stringify(body)) > ADAPTER_LIMITS.metadataBytes ||
|
|
198
|
-
hash(row['digest']) !== metadataDigest(body))
|
|
199
|
-
return adapterInvalid('Installed adapter digest or metadata size differs');
|
|
200
|
-
return frozen({ ...body, digest: hash(row['digest']) });
|
|
201
|
-
}
|
|
202
|
-
export function verifyInstalledAdapter(value, catalog) {
|
|
203
|
-
const descriptor = decodeInstalledAdapter(value), installed = decodeInstalledAdapter(catalog.adapters[descriptor.id]);
|
|
204
|
-
if (descriptor.digest !== installed.digest)
|
|
205
|
-
return adapterInvalid('Installed adapter operation, effect, recovery or implementation contract changed');
|
|
206
|
-
for (const effect of descriptor.effects)
|
|
207
|
-
if (effect.enforcement === 'contained' &&
|
|
208
|
-
!catalog.containments.some((item) => item.adapterDigest === descriptor.digest && item.targetPolicy === effect.targetPolicy))
|
|
209
|
-
return adapterInvalid('Required containment has no qualified installed boundary');
|
|
210
|
-
return descriptor;
|
|
211
|
-
}
|
|
1
|
+
/** @deprecated Import from @inventarch/workspace-runtime/adapters. */
|
|
2
|
+
export * from '@inventarch/workspace-runtime/adapters';
|
|
212
3
|
//# sourceMappingURL=adapters.js.map
|
package/dist/adapters.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapters.js","sourceRoot":"","sources":["../src/adapters.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"adapters.js","sourceRoot":"","sources":["../src/adapters.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,cAAc,wCAAwC,CAAC"}
|
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
artifacts: 2000;
|
|
4
|
-
systems: 2000;
|
|
5
|
-
documents: 256;
|
|
6
|
-
profiles: 256;
|
|
7
|
-
models: 256;
|
|
8
|
-
members: 200;
|
|
9
|
-
metadataBytes: number;
|
|
10
|
-
}>;
|
|
11
|
-
export declare class AuthoringError extends Error {
|
|
12
|
-
readonly code: 'IA-AUTHORING-INVALID' | 'IA-AUTHORING-SCOPE' | 'IA-AUTHORING-STALE';
|
|
13
|
-
constructor(message: string, code?: AuthoringError['code']);
|
|
14
|
-
}
|
|
15
|
-
export declare function invalidAuthoring(message: string): never;
|
|
16
|
-
export declare function authoringId(value: unknown): string;
|
|
17
|
-
export declare function unique<T>(rows: readonly T[], key: (row: T) => string): T[];
|
|
18
|
-
export declare function authoringRequest(value: unknown): AuthoringTargetRequest;
|
|
19
|
-
export declare function decodeAuthoring(value: unknown, retained: false): AuthoringIndexInput;
|
|
20
|
-
export declare function decodeAuthoring(value: unknown, retained: true): CapturedAuthoringIndex;
|
|
21
|
-
export declare function indexBody(index: CapturedAuthoringIndex): Omit<CapturedAuthoringIndex, 'digest'>;
|
|
22
|
-
export declare const authoringDigest: (value: unknown) => string;
|
|
1
|
+
/** @deprecated Import from @inventarch/workspace-runtime/internal/authoring-format. */
|
|
2
|
+
export * from '@inventarch/workspace-runtime/internal/authoring-format';
|
|
23
3
|
//# sourceMappingURL=authoring-format.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authoring-format.d.ts","sourceRoot":"","sources":["../src/authoring-format.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"authoring-format.d.ts","sourceRoot":"","sources":["../src/authoring-format.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,cAAc,yDAAyD,CAAC"}
|