@adea-ai/runtime-gateway-protocol 1.16.0 → 1.17.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 +12 -23
- package/dist/device-relay.d.ts +2 -0
- package/dist/device-relay.js +14 -0
- package/dist/device-sync.d.ts +241 -0
- package/dist/device-sync.js +557 -0
- package/dist/index.d.ts +2 -6
- package/dist/index.js +2 -6
- package/package.json +12 -16
- package/dist/acp-remote-sealed-channel.d.ts +0 -12
- package/dist/acp-remote-sealed-channel.js +0 -1
- package/dist/authentication.d.ts +0 -45
- package/dist/authentication.js +0 -71
- package/dist/emulator.d.ts +0 -24
- package/dist/emulator.js +0 -137
- package/dist/fixtures.d.ts +0 -149
- package/dist/fixtures.js +0 -48
- package/dist/protocol.d.ts +0 -716
- package/dist/protocol.js +0 -522
- package/dist/public-identity-validation-compatibility.d.ts +0 -1
- package/dist/public-identity-validation-compatibility.js +0 -10
- package/fixtures/golden/envelopes.json +0 -153
- package/fixtures/index.mjs +0 -4
- package/fixtures/malformed/envelopes.json +0 -70
- package/schema/gateway-envelope.v1.json +0 -990
package/dist/authentication.d.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const RuntimeNodeIdSchema: z.ZodString;
|
|
3
|
-
export declare const RuntimeNodeWorkspaceIdSchema: z.ZodString;
|
|
4
|
-
export declare const RuntimeNodeCredentialClaimsSchema: z.ZodObject<{
|
|
5
|
-
schemaVersion: z.ZodLiteral<1>;
|
|
6
|
-
credentialKind: z.ZodLiteral<"runtime_node">;
|
|
7
|
-
credentialId: z.ZodString;
|
|
8
|
-
issuer: z.ZodURL;
|
|
9
|
-
audience: z.ZodString;
|
|
10
|
-
nodeId: z.ZodString;
|
|
11
|
-
workspaceId: z.ZodString;
|
|
12
|
-
keyId: z.ZodString;
|
|
13
|
-
proofKeyThumbprint: z.ZodString;
|
|
14
|
-
revocationVersion: z.ZodNumber;
|
|
15
|
-
channelGeneration: z.ZodNumber;
|
|
16
|
-
issuedAt: z.ZodISODateTime;
|
|
17
|
-
expiresAt: z.ZodISODateTime;
|
|
18
|
-
}, z.core.$strict>;
|
|
19
|
-
export type RuntimeNodeCredentialClaims = z.output<typeof RuntimeNodeCredentialClaimsSchema>;
|
|
20
|
-
export declare const RuntimeNodeAuthenticationAttemptSchema: z.ZodObject<{
|
|
21
|
-
credential: z.ZodString;
|
|
22
|
-
proof: z.ZodObject<{
|
|
23
|
-
challenge: z.ZodString;
|
|
24
|
-
signature: z.ZodString;
|
|
25
|
-
}, z.core.$strict>;
|
|
26
|
-
}, z.core.$strict>;
|
|
27
|
-
export type RuntimeNodeAuthenticationAttempt = z.output<typeof RuntimeNodeAuthenticationAttemptSchema>;
|
|
28
|
-
export declare class RuntimeNodeIdentityValidationError extends Error {
|
|
29
|
-
readonly reason: 'credential' | 'proof';
|
|
30
|
-
constructor(reason: 'credential' | 'proof');
|
|
31
|
-
}
|
|
32
|
-
export type RuntimeNodeCredentialConsumptionResult = 'consumed' | 'replayed' | 'revoked' | 'expired' | 'unknown';
|
|
33
|
-
export declare function runtimeNodeWebSocketChallenge(secWebSocketKey: string): string;
|
|
34
|
-
export interface RuntimeNodeIdentityValidationPort {
|
|
35
|
-
verify(attempt: RuntimeNodeAuthenticationAttempt): Promise<unknown>;
|
|
36
|
-
isRevoked(credentialId: string, revocationVersion: number): Promise<boolean>;
|
|
37
|
-
subscribeRevocations(listener: (credentialId: string) => void): () => void;
|
|
38
|
-
}
|
|
39
|
-
export type RuntimeNodeIdentityInvalidation = {
|
|
40
|
-
readonly kind: 'credential';
|
|
41
|
-
readonly credentialId: string;
|
|
42
|
-
} | {
|
|
43
|
-
readonly kind: 'key';
|
|
44
|
-
readonly keyId: string;
|
|
45
|
-
};
|
package/dist/authentication.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
const TimestampSchema = z.iso.datetime();
|
|
3
|
-
const compactPart = z
|
|
4
|
-
.string()
|
|
5
|
-
.min(2)
|
|
6
|
-
.max(4096)
|
|
7
|
-
.regex(/^[A-Za-z0-9_-]+$/);
|
|
8
|
-
export const RuntimeNodeIdSchema = z.string().regex(/^rnr_[0-9A-HJKMNP-TV-Z]{26}$/);
|
|
9
|
-
export const RuntimeNodeWorkspaceIdSchema = z.string().regex(/^wsp_[0-9A-HJKMNP-TV-Z]{26}$/);
|
|
10
|
-
export const RuntimeNodeCredentialClaimsSchema = z
|
|
11
|
-
.object({
|
|
12
|
-
schemaVersion: z.literal(1),
|
|
13
|
-
credentialKind: z.literal('runtime_node'),
|
|
14
|
-
credentialId: z
|
|
15
|
-
.string()
|
|
16
|
-
.min(8)
|
|
17
|
-
.max(128)
|
|
18
|
-
.regex(/^rgc_[A-Za-z0-9_-]+$/),
|
|
19
|
-
issuer: z.url().max(512),
|
|
20
|
-
audience: z.string().min(3).max(256),
|
|
21
|
-
nodeId: RuntimeNodeIdSchema,
|
|
22
|
-
workspaceId: RuntimeNodeWorkspaceIdSchema,
|
|
23
|
-
keyId: z
|
|
24
|
-
.string()
|
|
25
|
-
.min(4)
|
|
26
|
-
.max(128)
|
|
27
|
-
.regex(/^rgk_[A-Za-z0-9_-]+$/),
|
|
28
|
-
proofKeyThumbprint: z.string().regex(/^sha256:[a-f0-9]{64}$/),
|
|
29
|
-
revocationVersion: z.number().int().positive(),
|
|
30
|
-
channelGeneration: z.number().int().positive(),
|
|
31
|
-
issuedAt: TimestampSchema,
|
|
32
|
-
expiresAt: TimestampSchema,
|
|
33
|
-
})
|
|
34
|
-
.strict()
|
|
35
|
-
.refine((claims) => Date.parse(claims.expiresAt) > Date.parse(claims.issuedAt), {
|
|
36
|
-
message: 'Credential expiry must follow issuance',
|
|
37
|
-
path: ['expiresAt'],
|
|
38
|
-
});
|
|
39
|
-
export const RuntimeNodeAuthenticationAttemptSchema = z
|
|
40
|
-
.object({
|
|
41
|
-
credential: z
|
|
42
|
-
.string()
|
|
43
|
-
.min(32)
|
|
44
|
-
.max(16_384)
|
|
45
|
-
.refine((value) => value.split('.').length === 3),
|
|
46
|
-
proof: z
|
|
47
|
-
.object({
|
|
48
|
-
challenge: z
|
|
49
|
-
.string()
|
|
50
|
-
.min(16)
|
|
51
|
-
.max(256)
|
|
52
|
-
.regex(/^[A-Za-z0-9._:-]+$/),
|
|
53
|
-
signature: compactPart,
|
|
54
|
-
})
|
|
55
|
-
.strict(),
|
|
56
|
-
})
|
|
57
|
-
.strict();
|
|
58
|
-
export class RuntimeNodeIdentityValidationError extends Error {
|
|
59
|
-
reason;
|
|
60
|
-
constructor(reason) {
|
|
61
|
-
super('RuntimeNode identity validation failed');
|
|
62
|
-
this.reason = reason;
|
|
63
|
-
this.name = 'RuntimeNodeIdentityValidationError';
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
export function runtimeNodeWebSocketChallenge(secWebSocketKey) {
|
|
67
|
-
if (!/^[A-Za-z0-9+/]{22}==$/.test(secWebSocketKey)) {
|
|
68
|
-
throw new Error('RUNTIME_NODE_WEBSOCKET_KEY_INVALID');
|
|
69
|
-
}
|
|
70
|
-
return secWebSocketKey.slice(0, -2).replaceAll('+', '-').replaceAll('/', '_');
|
|
71
|
-
}
|
package/dist/emulator.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { type GatewayAcknowledgementEnvelope, type GatewayResultEnvelope } from './protocol.js';
|
|
2
|
-
export interface ReferenceRuntimeNodeOptions {
|
|
3
|
-
readonly maxLedgerEntries?: number;
|
|
4
|
-
readonly now?: () => Date;
|
|
5
|
-
}
|
|
6
|
-
export declare class GatewayProtocolError extends Error {
|
|
7
|
-
readonly code: string;
|
|
8
|
-
constructor(code: string);
|
|
9
|
-
}
|
|
10
|
-
export declare class ReferenceRuntimeNode {
|
|
11
|
-
#private;
|
|
12
|
-
constructor(options?: ReferenceRuntimeNodeOptions);
|
|
13
|
-
observe(envelopeValue: unknown): string;
|
|
14
|
-
lastObservedSequence(): number;
|
|
15
|
-
receive(commandValue: unknown): {
|
|
16
|
-
readonly ack: GatewayAcknowledgementEnvelope;
|
|
17
|
-
readonly result?: GatewayResultEnvelope;
|
|
18
|
-
};
|
|
19
|
-
effectCount(commandId: string): number;
|
|
20
|
-
}
|
|
21
|
-
export declare function runGatewayProtocolConformance(): {
|
|
22
|
-
readonly scenarios: 9;
|
|
23
|
-
readonly passed: 9;
|
|
24
|
-
};
|
package/dist/emulator.js
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import { GatewayCommandEnvelopeSchema, GatewayEnvelopeSchema, GatewayProtocolManifest, negotiateGatewayProtocolVersion, } from './protocol.js';
|
|
2
|
-
import { inventoryFixtures } from './fixtures.js';
|
|
3
|
-
export class GatewayProtocolError extends Error {
|
|
4
|
-
code;
|
|
5
|
-
constructor(code) {
|
|
6
|
-
super(code);
|
|
7
|
-
this.code = code;
|
|
8
|
-
this.name = 'GatewayProtocolError';
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
export class ReferenceRuntimeNode {
|
|
12
|
-
#effects = new Map();
|
|
13
|
-
#ledger = new Map();
|
|
14
|
-
#maxLedgerEntries;
|
|
15
|
-
#now;
|
|
16
|
-
#lastObservedSequence = 0;
|
|
17
|
-
constructor(options = {}) {
|
|
18
|
-
const maxLedgerEntries = options.maxLedgerEntries ?? 10_000;
|
|
19
|
-
if (!Number.isSafeInteger(maxLedgerEntries) || maxLedgerEntries <= 0) {
|
|
20
|
-
throw new GatewayProtocolError('INVALID_LEDGER_CAPACITY');
|
|
21
|
-
}
|
|
22
|
-
this.#maxLedgerEntries = maxLedgerEntries;
|
|
23
|
-
this.#now = options.now ?? (() => new Date());
|
|
24
|
-
}
|
|
25
|
-
observe(envelopeValue) {
|
|
26
|
-
const envelope = GatewayEnvelopeSchema.parse(envelopeValue);
|
|
27
|
-
this.#lastObservedSequence = Math.max(this.#lastObservedSequence, envelope.sequence);
|
|
28
|
-
return envelope.type;
|
|
29
|
-
}
|
|
30
|
-
lastObservedSequence() {
|
|
31
|
-
return this.#lastObservedSequence;
|
|
32
|
-
}
|
|
33
|
-
receive(commandValue) {
|
|
34
|
-
const command = GatewayCommandEnvelopeSchema.parse(commandValue);
|
|
35
|
-
const recorded = this.#ledger.get(command.commandId);
|
|
36
|
-
if (recorded !== undefined) {
|
|
37
|
-
if (recorded.payloadHash !== command.payloadHash) {
|
|
38
|
-
throw new GatewayProtocolError('COMMAND_PAYLOAD_MISMATCH');
|
|
39
|
-
}
|
|
40
|
-
return { ack: this.#ack(command, 'replayed'), result: structuredClone(recorded.result) };
|
|
41
|
-
}
|
|
42
|
-
if (Date.parse(command.expiresAt) <= this.#now().getTime()) {
|
|
43
|
-
return { ack: this.#ack(command, 'expired') };
|
|
44
|
-
}
|
|
45
|
-
if (this.#ledger.size >= this.#maxLedgerEntries) {
|
|
46
|
-
throw new GatewayProtocolError('COMMAND_LEDGER_CAPACITY_EXCEEDED');
|
|
47
|
-
}
|
|
48
|
-
const result = this.#result(command);
|
|
49
|
-
this.#effects.set(command.commandId, 1);
|
|
50
|
-
this.#ledger.set(command.commandId, { payloadHash: command.payloadHash, result });
|
|
51
|
-
return { ack: this.#ack(command, 'accepted'), result: structuredClone(result) };
|
|
52
|
-
}
|
|
53
|
-
effectCount(commandId) {
|
|
54
|
-
return this.#effects.get(commandId) ?? 0;
|
|
55
|
-
}
|
|
56
|
-
#ack(command, disposition) {
|
|
57
|
-
return {
|
|
58
|
-
type: 'ack',
|
|
59
|
-
schemaVersion: 1,
|
|
60
|
-
protocolVersion: command.protocolVersion,
|
|
61
|
-
sequence: command.sequence,
|
|
62
|
-
nodeId: command.nodeId,
|
|
63
|
-
workspaceId: command.workspaceId,
|
|
64
|
-
traceId: command.traceId,
|
|
65
|
-
sentAt: this.#now().toISOString(),
|
|
66
|
-
channelGeneration: command.channelGeneration,
|
|
67
|
-
commandId: command.commandId,
|
|
68
|
-
payloadHash: command.payloadHash,
|
|
69
|
-
disposition,
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
#result(command) {
|
|
73
|
-
return {
|
|
74
|
-
type: 'result',
|
|
75
|
-
schemaVersion: 1,
|
|
76
|
-
protocolVersion: command.protocolVersion,
|
|
77
|
-
sequence: command.sequence + 1,
|
|
78
|
-
nodeId: command.nodeId,
|
|
79
|
-
workspaceId: command.workspaceId,
|
|
80
|
-
traceId: command.traceId,
|
|
81
|
-
sentAt: this.#now().toISOString(),
|
|
82
|
-
channelGeneration: command.channelGeneration,
|
|
83
|
-
commandId: command.commandId,
|
|
84
|
-
payloadHash: command.payloadHash,
|
|
85
|
-
status: 'succeeded',
|
|
86
|
-
completedAt: this.#now().toISOString(),
|
|
87
|
-
result: { data: { outcome: 'reference-complete' } },
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
export function runGatewayProtocolConformance() {
|
|
92
|
-
const command = conformanceCommand();
|
|
93
|
-
const node = new ReferenceRuntimeNode({ now: () => new Date('2026-08-25T12:00:01.000Z') });
|
|
94
|
-
const first = node.receive(command);
|
|
95
|
-
const replay = node.receive(command);
|
|
96
|
-
const checks = [
|
|
97
|
-
GatewayEnvelopeSchema.safeParse(command).success,
|
|
98
|
-
negotiateGatewayProtocolVersion(GatewayProtocolManifest.supported, [{ major: 1, minor: 0 }])
|
|
99
|
-
?.major === 1,
|
|
100
|
-
first.ack.disposition === 'accepted',
|
|
101
|
-
replay.ack.disposition === 'replayed',
|
|
102
|
-
node.effectCount(command.commandId) === 1,
|
|
103
|
-
inventoryFixtures.noProvider.contextProviders.length === 0,
|
|
104
|
-
inventoryFixtures.cortanaCompatible.contextProviders.length === 1,
|
|
105
|
-
inventoryFixtures.alternateProvider.contextProviders.length === 1,
|
|
106
|
-
GatewayEnvelopeSchema.safeParse({ ...command, operation: 'pi.command' }).success === false,
|
|
107
|
-
];
|
|
108
|
-
if (checks.some((check) => !check))
|
|
109
|
-
throw new GatewayProtocolError('CONFORMANCE_FAILED');
|
|
110
|
-
return { scenarios: 9, passed: 9 };
|
|
111
|
-
}
|
|
112
|
-
function conformanceCommand() {
|
|
113
|
-
return {
|
|
114
|
-
type: 'command',
|
|
115
|
-
schemaVersion: 1,
|
|
116
|
-
protocolVersion: { major: 1, minor: 0 },
|
|
117
|
-
sequence: 1,
|
|
118
|
-
nodeId: 'rnr_01JABCDEF0123456789ABCDEFG',
|
|
119
|
-
workspaceId: 'wsp_01JABCDEF0123456789ABCDEFG',
|
|
120
|
-
traceId: 'trc_01JABCDEF0123456789ABCDEFG',
|
|
121
|
-
sentAt: '2026-08-25T12:00:00.000Z',
|
|
122
|
-
channelGeneration: 1,
|
|
123
|
-
commandId: 'cmd_01JABCDEF0123456789ABCDEFG',
|
|
124
|
-
idempotencyKey: 'conformance:01JABCDEF0123456789ABCDEFG',
|
|
125
|
-
payloadHash: `sha256:${'a'.repeat(64)}`,
|
|
126
|
-
issuedAt: '2026-08-25T12:00:00.000Z',
|
|
127
|
-
expiresAt: '2026-08-25T12:01:00.000Z',
|
|
128
|
-
family: 'runtime',
|
|
129
|
-
operation: 'runtime.execute',
|
|
130
|
-
driver: { family: 'reference-runtime', version: '1.0.0' },
|
|
131
|
-
runtimeConnectionId: 'rtc_01JABCDEF0123456789ABCDEFG',
|
|
132
|
-
executionId: 'exe_01JABCDEF0123456789ABCDEFG',
|
|
133
|
-
attemptId: 'att_01JABCDEF0123456789ABCDEFG',
|
|
134
|
-
requiredCapabilities: ['runtime.execute'],
|
|
135
|
-
payload: { version: 1, parameters: { fixture: true } },
|
|
136
|
-
};
|
|
137
|
-
}
|
package/dist/fixtures.d.ts
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
export declare const inventoryFixtures: Readonly<{
|
|
2
|
-
noProvider: {
|
|
3
|
-
schemaVersion: 1;
|
|
4
|
-
protocolVersion: {
|
|
5
|
-
major: number;
|
|
6
|
-
minor: number;
|
|
7
|
-
};
|
|
8
|
-
sequence: number;
|
|
9
|
-
nodeId: string;
|
|
10
|
-
workspaceId: string;
|
|
11
|
-
traceId: string;
|
|
12
|
-
sentAt: string;
|
|
13
|
-
channelGeneration: number;
|
|
14
|
-
type: "inventory";
|
|
15
|
-
mode?: "delta" | "snapshot" | undefined;
|
|
16
|
-
snapshotVersion: number;
|
|
17
|
-
baseSnapshotVersion?: number | undefined;
|
|
18
|
-
observedAt: string;
|
|
19
|
-
runtimeDrivers: {
|
|
20
|
-
opaqueRef: string;
|
|
21
|
-
driverFamily: string;
|
|
22
|
-
adapterVersion?: string | undefined;
|
|
23
|
-
driverVersion: string;
|
|
24
|
-
harnessVersion?: string | undefined;
|
|
25
|
-
capabilityTtlMs?: number | undefined;
|
|
26
|
-
protocolVersion: {
|
|
27
|
-
major: number;
|
|
28
|
-
minor: number;
|
|
29
|
-
};
|
|
30
|
-
health: "degraded" | "healthy" | "unavailable";
|
|
31
|
-
capabilities: string[];
|
|
32
|
-
limitations: string[];
|
|
33
|
-
}[];
|
|
34
|
-
contextProviders: {
|
|
35
|
-
opaqueRef: string;
|
|
36
|
-
driverFamily: string;
|
|
37
|
-
adapterVersion?: string | undefined;
|
|
38
|
-
driverVersion: string;
|
|
39
|
-
harnessVersion?: string | undefined;
|
|
40
|
-
capabilityTtlMs?: number | undefined;
|
|
41
|
-
protocolVersion: {
|
|
42
|
-
major: number;
|
|
43
|
-
minor: number;
|
|
44
|
-
};
|
|
45
|
-
health: "degraded" | "healthy" | "unavailable";
|
|
46
|
-
capabilities: string[];
|
|
47
|
-
limitations: string[];
|
|
48
|
-
}[];
|
|
49
|
-
removedRuntimeRefs?: string[] | undefined;
|
|
50
|
-
};
|
|
51
|
-
cortanaCompatible: {
|
|
52
|
-
schemaVersion: 1;
|
|
53
|
-
protocolVersion: {
|
|
54
|
-
major: number;
|
|
55
|
-
minor: number;
|
|
56
|
-
};
|
|
57
|
-
sequence: number;
|
|
58
|
-
nodeId: string;
|
|
59
|
-
workspaceId: string;
|
|
60
|
-
traceId: string;
|
|
61
|
-
sentAt: string;
|
|
62
|
-
channelGeneration: number;
|
|
63
|
-
type: "inventory";
|
|
64
|
-
mode?: "delta" | "snapshot" | undefined;
|
|
65
|
-
snapshotVersion: number;
|
|
66
|
-
baseSnapshotVersion?: number | undefined;
|
|
67
|
-
observedAt: string;
|
|
68
|
-
runtimeDrivers: {
|
|
69
|
-
opaqueRef: string;
|
|
70
|
-
driverFamily: string;
|
|
71
|
-
adapterVersion?: string | undefined;
|
|
72
|
-
driverVersion: string;
|
|
73
|
-
harnessVersion?: string | undefined;
|
|
74
|
-
capabilityTtlMs?: number | undefined;
|
|
75
|
-
protocolVersion: {
|
|
76
|
-
major: number;
|
|
77
|
-
minor: number;
|
|
78
|
-
};
|
|
79
|
-
health: "degraded" | "healthy" | "unavailable";
|
|
80
|
-
capabilities: string[];
|
|
81
|
-
limitations: string[];
|
|
82
|
-
}[];
|
|
83
|
-
contextProviders: {
|
|
84
|
-
opaqueRef: string;
|
|
85
|
-
driverFamily: string;
|
|
86
|
-
adapterVersion?: string | undefined;
|
|
87
|
-
driverVersion: string;
|
|
88
|
-
harnessVersion?: string | undefined;
|
|
89
|
-
capabilityTtlMs?: number | undefined;
|
|
90
|
-
protocolVersion: {
|
|
91
|
-
major: number;
|
|
92
|
-
minor: number;
|
|
93
|
-
};
|
|
94
|
-
health: "degraded" | "healthy" | "unavailable";
|
|
95
|
-
capabilities: string[];
|
|
96
|
-
limitations: string[];
|
|
97
|
-
}[];
|
|
98
|
-
removedRuntimeRefs?: string[] | undefined;
|
|
99
|
-
};
|
|
100
|
-
alternateProvider: {
|
|
101
|
-
schemaVersion: 1;
|
|
102
|
-
protocolVersion: {
|
|
103
|
-
major: number;
|
|
104
|
-
minor: number;
|
|
105
|
-
};
|
|
106
|
-
sequence: number;
|
|
107
|
-
nodeId: string;
|
|
108
|
-
workspaceId: string;
|
|
109
|
-
traceId: string;
|
|
110
|
-
sentAt: string;
|
|
111
|
-
channelGeneration: number;
|
|
112
|
-
type: "inventory";
|
|
113
|
-
mode?: "delta" | "snapshot" | undefined;
|
|
114
|
-
snapshotVersion: number;
|
|
115
|
-
baseSnapshotVersion?: number | undefined;
|
|
116
|
-
observedAt: string;
|
|
117
|
-
runtimeDrivers: {
|
|
118
|
-
opaqueRef: string;
|
|
119
|
-
driverFamily: string;
|
|
120
|
-
adapterVersion?: string | undefined;
|
|
121
|
-
driverVersion: string;
|
|
122
|
-
harnessVersion?: string | undefined;
|
|
123
|
-
capabilityTtlMs?: number | undefined;
|
|
124
|
-
protocolVersion: {
|
|
125
|
-
major: number;
|
|
126
|
-
minor: number;
|
|
127
|
-
};
|
|
128
|
-
health: "degraded" | "healthy" | "unavailable";
|
|
129
|
-
capabilities: string[];
|
|
130
|
-
limitations: string[];
|
|
131
|
-
}[];
|
|
132
|
-
contextProviders: {
|
|
133
|
-
opaqueRef: string;
|
|
134
|
-
driverFamily: string;
|
|
135
|
-
adapterVersion?: string | undefined;
|
|
136
|
-
driverVersion: string;
|
|
137
|
-
harnessVersion?: string | undefined;
|
|
138
|
-
capabilityTtlMs?: number | undefined;
|
|
139
|
-
protocolVersion: {
|
|
140
|
-
major: number;
|
|
141
|
-
minor: number;
|
|
142
|
-
};
|
|
143
|
-
health: "degraded" | "healthy" | "unavailable";
|
|
144
|
-
capabilities: string[];
|
|
145
|
-
limitations: string[];
|
|
146
|
-
}[];
|
|
147
|
-
removedRuntimeRefs?: string[] | undefined;
|
|
148
|
-
};
|
|
149
|
-
}>;
|
package/dist/fixtures.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { GatewayInventoryEnvelopeSchema } from './protocol.js';
|
|
2
|
-
const common = {
|
|
3
|
-
type: 'inventory',
|
|
4
|
-
schemaVersion: 1,
|
|
5
|
-
protocolVersion: { major: 1, minor: 0 },
|
|
6
|
-
sequence: 2,
|
|
7
|
-
nodeId: 'rnr_01JABCDEF0123456789ABCDEFG',
|
|
8
|
-
workspaceId: 'wsp_01JABCDEF0123456789ABCDEFG',
|
|
9
|
-
traceId: 'trc_01JABCDEF0123456789ABCDEFG',
|
|
10
|
-
sentAt: '2026-08-25T12:00:00.000Z',
|
|
11
|
-
channelGeneration: 1,
|
|
12
|
-
snapshotVersion: 1,
|
|
13
|
-
observedAt: '2026-08-25T12:00:00.000Z',
|
|
14
|
-
runtimeDrivers: [
|
|
15
|
-
{
|
|
16
|
-
opaqueRef: 'nref_01JABCDEF0123456789ABCDEFG',
|
|
17
|
-
driverFamily: 'reference-runtime',
|
|
18
|
-
driverVersion: '1.0.0',
|
|
19
|
-
harnessVersion: '1.0.0',
|
|
20
|
-
protocolVersion: { major: 1, minor: 0 },
|
|
21
|
-
health: 'healthy',
|
|
22
|
-
capabilities: ['runtime.execute'],
|
|
23
|
-
limitations: [],
|
|
24
|
-
},
|
|
25
|
-
],
|
|
26
|
-
};
|
|
27
|
-
const contextProvider = (driverFamily, opaqueRef) => ({
|
|
28
|
-
opaqueRef,
|
|
29
|
-
driverFamily,
|
|
30
|
-
driverVersion: '1.0.0',
|
|
31
|
-
protocolVersion: { major: 1, minor: 0 },
|
|
32
|
-
health: 'healthy',
|
|
33
|
-
capabilities: ['context.status', 'context.read'],
|
|
34
|
-
limitations: [],
|
|
35
|
-
});
|
|
36
|
-
export const inventoryFixtures = Object.freeze({
|
|
37
|
-
noProvider: GatewayInventoryEnvelopeSchema.parse({ ...common, contextProviders: [] }),
|
|
38
|
-
cortanaCompatible: GatewayInventoryEnvelopeSchema.parse({
|
|
39
|
-
...common,
|
|
40
|
-
snapshotVersion: 2,
|
|
41
|
-
contextProviders: [contextProvider('local-context', 'pvr_01JABCDEF0123456789ABCDEFG')],
|
|
42
|
-
}),
|
|
43
|
-
alternateProvider: GatewayInventoryEnvelopeSchema.parse({
|
|
44
|
-
...common,
|
|
45
|
-
snapshotVersion: 3,
|
|
46
|
-
contextProviders: [contextProvider('alternate-context', 'pvr_01JBBCDEF0123456789ABCDEFG')],
|
|
47
|
-
}),
|
|
48
|
-
});
|