@antasphere/chassis-contract 0.0.0-stage → 1.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/LICENSE +82 -0
- package/dist/define.d.ts +177 -0
- package/dist/define.d.ts.map +1 -0
- package/dist/define.js +35 -0
- package/dist/define.js.map +1 -0
- package/dist/entitlements.d.ts +486 -0
- package/dist/entitlements.d.ts.map +1 -0
- package/dist/entitlements.js +344 -0
- package/dist/entitlements.js.map +1 -0
- package/dist/identity.d.ts +56 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +2 -0
- package/dist/identity.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/routes/index.d.ts +5403 -0
- package/dist/routes/index.d.ts.map +1 -0
- package/dist/routes/index.js +940 -0
- package/dist/routes/index.js.map +1 -0
- package/dist/schemas/api-keys.d.ts +54 -0
- package/dist/schemas/api-keys.d.ts.map +1 -0
- package/dist/schemas/api-keys.js +48 -0
- package/dist/schemas/api-keys.js.map +1 -0
- package/dist/schemas/audit.d.ts +74 -0
- package/dist/schemas/audit.d.ts.map +1 -0
- package/dist/schemas/audit.js +65 -0
- package/dist/schemas/audit.js.map +1 -0
- package/dist/schemas/break-glass.d.ts +42 -0
- package/dist/schemas/break-glass.d.ts.map +1 -0
- package/dist/schemas/break-glass.js +38 -0
- package/dist/schemas/break-glass.js.map +1 -0
- package/dist/schemas/cli-auth.d.ts +59 -0
- package/dist/schemas/cli-auth.d.ts.map +1 -0
- package/dist/schemas/cli-auth.js +68 -0
- package/dist/schemas/cli-auth.js.map +1 -0
- package/dist/schemas/common.d.ts +96 -0
- package/dist/schemas/common.d.ts.map +1 -0
- package/dist/schemas/common.js +205 -0
- package/dist/schemas/common.js.map +1 -0
- package/dist/schemas/demo-passes.d.ts +90 -0
- package/dist/schemas/demo-passes.d.ts.map +1 -0
- package/dist/schemas/demo-passes.js +60 -0
- package/dist/schemas/demo-passes.js.map +1 -0
- package/dist/schemas/files.d.ts +39 -0
- package/dist/schemas/files.d.ts.map +1 -0
- package/dist/schemas/files.js +26 -0
- package/dist/schemas/files.js.map +1 -0
- package/dist/schemas/instance.d.ts +58 -0
- package/dist/schemas/instance.d.ts.map +1 -0
- package/dist/schemas/instance.js +70 -0
- package/dist/schemas/instance.js.map +1 -0
- package/dist/schemas/invitations.d.ts +100 -0
- package/dist/schemas/invitations.d.ts.map +1 -0
- package/dist/schemas/invitations.js +55 -0
- package/dist/schemas/invitations.js.map +1 -0
- package/dist/schemas/me.d.ts +81 -0
- package/dist/schemas/me.d.ts.map +1 -0
- package/dist/schemas/me.js +178 -0
- package/dist/schemas/me.js.map +1 -0
- package/dist/schemas/members.d.ts +60 -0
- package/dist/schemas/members.d.ts.map +1 -0
- package/dist/schemas/members.js +43 -0
- package/dist/schemas/members.js.map +1 -0
- package/dist/schemas/projects.d.ts +232 -0
- package/dist/schemas/projects.d.ts.map +1 -0
- package/dist/schemas/projects.js +140 -0
- package/dist/schemas/projects.js.map +1 -0
- package/dist/schemas/scope.d.ts +14 -0
- package/dist/schemas/scope.d.ts.map +1 -0
- package/dist/schemas/scope.js +5 -0
- package/dist/schemas/scope.js.map +1 -0
- package/dist/schemas/setup.d.ts +28 -0
- package/dist/schemas/setup.d.ts.map +1 -0
- package/dist/schemas/setup.js +28 -0
- package/dist/schemas/setup.js.map +1 -0
- package/dist/schemas/sso-connect.d.ts +30 -0
- package/dist/schemas/sso-connect.d.ts.map +1 -0
- package/dist/schemas/sso-connect.js +38 -0
- package/dist/schemas/sso-connect.js.map +1 -0
- package/dist/schemas/sso-logout.d.ts +17 -0
- package/dist/schemas/sso-logout.d.ts.map +1 -0
- package/dist/schemas/sso-logout.js +16 -0
- package/dist/schemas/sso-logout.js.map +1 -0
- package/dist/schemas/teams.d.ts +100 -0
- package/dist/schemas/teams.d.ts.map +1 -0
- package/dist/schemas/teams.js +84 -0
- package/dist/schemas/teams.js.map +1 -0
- package/dist/schemas/workspaces.d.ts +99 -0
- package/dist/schemas/workspaces.d.ts.map +1 -0
- package/dist/schemas/workspaces.js +96 -0
- package/dist/schemas/workspaces.js.map +1 -0
- package/dist/seams.d.ts +185 -0
- package/dist/seams.d.ts.map +1 -0
- package/dist/seams.js +37 -0
- package/dist/seams.js.map +1 -0
- package/dist/wire.d.ts +101 -0
- package/dist/wire.d.ts.map +1 -0
- package/dist/wire.js +161 -0
- package/dist/wire.js.map +1 -0
- package/package.json +41 -3
- package/src/define.ts +64 -0
- package/src/entitlements.ts +527 -0
- package/src/identity.ts +49 -0
- package/src/index.ts +38 -0
- package/src/routes/index.ts +1146 -0
- package/src/schemas/api-keys.ts +53 -0
- package/src/schemas/audit.ts +74 -0
- package/src/schemas/break-glass.ts +46 -0
- package/src/schemas/cli-auth.ts +78 -0
- package/src/schemas/common.ts +206 -0
- package/src/schemas/demo-passes.ts +73 -0
- package/src/schemas/files.ts +30 -0
- package/src/schemas/instance.ts +71 -0
- package/src/schemas/invitations.ts +66 -0
- package/src/schemas/me.ts +184 -0
- package/src/schemas/members.ts +53 -0
- package/src/schemas/projects.ts +174 -0
- package/src/schemas/scope.ts +18 -0
- package/src/schemas/setup.ts +31 -0
- package/src/schemas/sso-connect.ts +40 -0
- package/src/schemas/sso-logout.ts +17 -0
- package/src/schemas/teams.ts +101 -0
- package/src/schemas/workspaces.ts +109 -0
- package/src/seams.ts +202 -0
- package/src/wire.ts +246 -0
- package/test/define.test.ts +59 -0
- package/test/hub-wire.test.ts +114 -0
- package/README.md +0 -3
package/dist/wire.d.ts
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* The chassis's side of the hub–tool wire check (PRDCT-2677). The hub owns
|
|
4
|
+
* the messages the tools exchange with it and publishes them as ONE
|
|
5
|
+
* generated snapshot, `packages/contract/wire/hub-tool-messages.json` of the
|
|
6
|
+
* hub, built by its `packages/contract/src/wire.ts`. The block below, from
|
|
7
|
+
* `WIRE_SCHEMA_KEYS` to `buildWireSnapshot`, is the chassis's copy of that
|
|
8
|
+
* builder, kept VERBATIM so both sides compute the same picture: the same
|
|
9
|
+
* JSON Schema export, the same probe verdicts, the same occurrence table.
|
|
10
|
+
* The hub's inputs (its offsets and probe payloads) and its definitions are
|
|
11
|
+
* NOT copied: the inputs are read back from the hub's file
|
|
12
|
+
* (`wireInputsOf`), the definitions are this package's own copies
|
|
13
|
+
* (`CHASSIS_WIRE_DEFINITIONS`, from `entitlements.ts`).
|
|
14
|
+
*
|
|
15
|
+
* `compareWireSnapshots` names every difference by its dotted path;
|
|
16
|
+
* `scripts/hub-wire-check.mjs` (`pnpm --filter @antasphere/chassis-contract
|
|
17
|
+
* wire:check`, the `hub-wire` CI job against the hub's `dev`) fails on any.
|
|
18
|
+
* The check runs one way: the hub changes first, the chassis follows.
|
|
19
|
+
*/
|
|
20
|
+
/** The keys of the six shapes, the same on both sides. */
|
|
21
|
+
export declare const WIRE_SCHEMA_KEYS: readonly ["usageEvent", "usageEventsBatch", "usageIngestResult", "usageEntitlements", "usageCheckRequest", "usageCheck"];
|
|
22
|
+
export type WireSchemaKey = (typeof WIRE_SCHEMA_KEYS)[number];
|
|
23
|
+
export interface WireConstants {
|
|
24
|
+
USAGE_WRITE_SCOPE: string;
|
|
25
|
+
BILLING_PLANS: readonly string[];
|
|
26
|
+
USAGE_EVENTS_BATCH_MAX: number;
|
|
27
|
+
USAGE_EVENT_MAX_PAST_MS: number;
|
|
28
|
+
USAGE_EVENT_MAX_FUTURE_MS: number;
|
|
29
|
+
USAGE_CHECK_REASONS: readonly string[];
|
|
30
|
+
USAGE_REJECT_REASONS: readonly string[];
|
|
31
|
+
USAGE_ROUTE_ERRORS: Readonly<Record<string, number>>;
|
|
32
|
+
}
|
|
33
|
+
export interface WireProbe {
|
|
34
|
+
name: string;
|
|
35
|
+
input: unknown;
|
|
36
|
+
}
|
|
37
|
+
export interface WireProbeResult extends WireProbe {
|
|
38
|
+
/** Whether the schema accepts the input. */
|
|
39
|
+
ok: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface WireOccurrence {
|
|
42
|
+
/** The event's `occurredAt` minus the receipt time, in milliseconds. */
|
|
43
|
+
offsetMs: number;
|
|
44
|
+
issue: {
|
|
45
|
+
path: 'occurredAt';
|
|
46
|
+
message: string;
|
|
47
|
+
} | null;
|
|
48
|
+
}
|
|
49
|
+
/** What one side feeds the builder: its own definitions. */
|
|
50
|
+
export interface WireDefinitions {
|
|
51
|
+
constants: WireConstants;
|
|
52
|
+
schemas: Record<WireSchemaKey, z.ZodType>;
|
|
53
|
+
occurrenceIssue: (occurredAt: Date, receivedAt: Date) => {
|
|
54
|
+
path: 'occurredAt';
|
|
55
|
+
message: string;
|
|
56
|
+
} | null;
|
|
57
|
+
}
|
|
58
|
+
/** The inputs the snapshot is computed on: the hub's, read back by the chassis from the hub's file. */
|
|
59
|
+
export interface WireInputs {
|
|
60
|
+
occurrenceOffsetsMs: readonly number[];
|
|
61
|
+
probes: Record<WireSchemaKey, readonly WireProbe[]>;
|
|
62
|
+
}
|
|
63
|
+
export interface HubToolWireSnapshot {
|
|
64
|
+
v: 1;
|
|
65
|
+
constants: WireConstants;
|
|
66
|
+
schemas: Record<WireSchemaKey, unknown>;
|
|
67
|
+
occurrence: WireOccurrence[];
|
|
68
|
+
probes: Record<WireSchemaKey, WireProbeResult[]>;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Build the snapshot from one side's definitions on the given inputs. The
|
|
72
|
+
* SAME function runs on both sides (the chassis carries a verbatim copy):
|
|
73
|
+
* the hub with its own inputs, the chassis with the inputs read from the
|
|
74
|
+
* hub's file. Deterministic: no clock, no randomness, no environment.
|
|
75
|
+
*/
|
|
76
|
+
export declare function buildWireSnapshot(defs: WireDefinitions, inputs: WireInputs): HubToolWireSnapshot;
|
|
77
|
+
/** The chassis's definitions: this package's copies of the hub's shapes, under the hub's keys. */
|
|
78
|
+
export declare const CHASSIS_WIRE_DEFINITIONS: WireDefinitions;
|
|
79
|
+
/** The inputs the hub computed its snapshot on, read back from its file: the offsets and the probe payloads. */
|
|
80
|
+
export declare function wireInputsOf(reference: HubToolWireSnapshot): WireInputs;
|
|
81
|
+
/** The snapshot the chassis's copies give on the hub's own inputs: what must equal the hub's file. */
|
|
82
|
+
export declare function chassisWireSnapshot(reference: HubToolWireSnapshot): HubToolWireSnapshot;
|
|
83
|
+
/** One place where the hub's snapshot and the chassis's differ: its dotted path and the two values. */
|
|
84
|
+
export interface WireDifference {
|
|
85
|
+
path: string;
|
|
86
|
+
hub: unknown;
|
|
87
|
+
chassis: unknown;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Every difference between the hub's snapshot and the chassis's, by dotted
|
|
91
|
+
* path (`constants.USAGE_CHECK_REASONS[2]`,
|
|
92
|
+
* `schemas.usageCheck.properties.reason.anyOf[0].enum`,
|
|
93
|
+
* `probes.usageCheck[3].ok`). Objects compare by the union of their keys,
|
|
94
|
+
* order ignored, an absent key and `undefined` being the same; arrays by
|
|
95
|
+
* index, a length difference being one difference at the array's path.
|
|
96
|
+
* Deterministic: keys sorted, arrays in order. Empty when they agree.
|
|
97
|
+
*/
|
|
98
|
+
export declare function compareWireSnapshots(hub: HubToolWireSnapshot, chassis: HubToolWireSnapshot): WireDifference[];
|
|
99
|
+
/** One line of figures for a snapshot: `6 shapes, N constants, M probes, K occurrence offsets`. */
|
|
100
|
+
export declare function describeWireSnapshot(snapshot: HubToolWireSnapshot): string;
|
|
101
|
+
//# sourceMappingURL=wire.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wire.d.ts","sourceRoot":"","sources":["../src/wire.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmBxB;;;;;;;;;;;;;;;;;GAiBG;AAIH,0DAA0D;AAC1D,eAAO,MAAM,gBAAg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OPE, entitlementProfileSchema, usageCheckRequestSchema, usageCheckSchema, usageEventOccurrenceIssue, usageEventSchema, usageEventsBatchSchema, usageIngestResultSchema } from './entitlements.js';
|
|
3
|
+
/**
|
|
4
|
+
* The chassis's side of the hub–tool wire check (PRDCT-2677). The hub owns
|
|
5
|
+
* the messages the tools exchange with it and publishes them as ONE
|
|
6
|
+
* generated snapshot, `packages/contract/wire/hub-tool-messages.json` of the
|
|
7
|
+
* hub, built by its `packages/contract/src/wire.ts`. The block below, from
|
|
8
|
+
* `WIRE_SCHEMA_KEYS` to `buildWireSnapshot`, is the chassis's copy of that
|
|
9
|
+
* builder, kept VERBATIM so both sides compute the same picture: the same
|
|
10
|
+
* JSON Schema export, the same probe verdicts, the same occurrence table.
|
|
11
|
+
* The hub's inputs (its offsets and probe payloads) and its definitions are
|
|
12
|
+
* NOT copied: the inputs are read back from the hub's file
|
|
13
|
+
* (`wireInputsOf`), the definitions are this package's own copies
|
|
14
|
+
* (`CHASSIS_WIRE_DEFINITIONS`, from `entitlements.ts`).
|
|
15
|
+
*
|
|
16
|
+
* `compareWireSnapshots` names every difference by its dotted path;
|
|
17
|
+
* `scripts/hub-wire-check.mjs` (`pnpm --filter @antasphere/chassis-contract
|
|
18
|
+
* wire:check`, the `hub-wire` CI job against the hub's `dev`) fails on any.
|
|
19
|
+
* The check runs one way: the hub changes first, the chassis follows.
|
|
20
|
+
*/
|
|
21
|
+
// ── Copied VERBATIM from the hub's packages/contract/src/wire.ts ──────────
|
|
22
|
+
/** The keys of the six shapes, the same on both sides. */
|
|
23
|
+
export const WIRE_SCHEMA_KEYS = [
|
|
24
|
+
'usageEvent',
|
|
25
|
+
'usageEventsBatch',
|
|
26
|
+
'usageIngestResult',
|
|
27
|
+
'usageEntitlements',
|
|
28
|
+
'usageCheckRequest',
|
|
29
|
+
'usageCheck'
|
|
30
|
+
];
|
|
31
|
+
/** A fixed receipt time, so the occurrence table is the same on every run. */
|
|
32
|
+
const RECEIVED_AT = new Date('2026-09-23T12:00:00.000Z');
|
|
33
|
+
/**
|
|
34
|
+
* Build the snapshot from one side's definitions on the given inputs. The
|
|
35
|
+
* SAME function runs on both sides (the chassis carries a verbatim copy):
|
|
36
|
+
* the hub with its own inputs, the chassis with the inputs read from the
|
|
37
|
+
* hub's file. Deterministic: no clock, no randomness, no environment.
|
|
38
|
+
*/
|
|
39
|
+
export function buildWireSnapshot(defs, inputs) {
|
|
40
|
+
const schemas = {};
|
|
41
|
+
const probes = {};
|
|
42
|
+
for (const key of WIRE_SCHEMA_KEYS) {
|
|
43
|
+
const schema = defs.schemas[key];
|
|
44
|
+
// A refinement has no JSON Schema form and is dropped on both sides
|
|
45
|
+
// alike; the probes below carry what it decides.
|
|
46
|
+
schemas[key] = z.toJSONSchema(schema, { unrepresentable: 'any' });
|
|
47
|
+
probes[key] = inputs.probes[key].map((probe) => ({
|
|
48
|
+
name: probe.name,
|
|
49
|
+
input: probe.input,
|
|
50
|
+
ok: schema.safeParse(probe.input).success
|
|
51
|
+
}));
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
v: 1,
|
|
55
|
+
constants: {
|
|
56
|
+
USAGE_WRITE_SCOPE: defs.constants.USAGE_WRITE_SCOPE,
|
|
57
|
+
BILLING_PLANS: [...defs.constants.BILLING_PLANS],
|
|
58
|
+
USAGE_EVENTS_BATCH_MAX: defs.constants.USAGE_EVENTS_BATCH_MAX,
|
|
59
|
+
USAGE_EVENT_MAX_PAST_MS: defs.constants.USAGE_EVENT_MAX_PAST_MS,
|
|
60
|
+
USAGE_EVENT_MAX_FUTURE_MS: defs.constants.USAGE_EVENT_MAX_FUTURE_MS,
|
|
61
|
+
USAGE_CHECK_REASONS: [...defs.constants.USAGE_CHECK_REASONS],
|
|
62
|
+
USAGE_REJECT_REASONS: [...defs.constants.USAGE_REJECT_REASONS],
|
|
63
|
+
USAGE_ROUTE_ERRORS: { ...defs.constants.USAGE_ROUTE_ERRORS }
|
|
64
|
+
},
|
|
65
|
+
schemas,
|
|
66
|
+
occurrence: inputs.occurrenceOffsetsMs.map((offsetMs) => ({
|
|
67
|
+
offsetMs,
|
|
68
|
+
issue: defs.occurrenceIssue(new Date(RECEIVED_AT.getTime() + offsetMs), RECEIVED_AT)
|
|
69
|
+
})),
|
|
70
|
+
probes
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
// ── The chassis's own half ─────────────────────────────────────────────────
|
|
74
|
+
/** The chassis's definitions: this package's copies of the hub's shapes, under the hub's keys. */
|
|
75
|
+
export const CHASSIS_WIRE_DEFINITIONS = {
|
|
76
|
+
constants: {
|
|
77
|
+
USAGE_WRITE_SCOPE,
|
|
78
|
+
BILLING_PLANS,
|
|
79
|
+
USAGE_EVENTS_BATCH_MAX,
|
|
80
|
+
USAGE_EVENT_MAX_PAST_MS,
|
|
81
|
+
USAGE_EVENT_MAX_FUTURE_MS,
|
|
82
|
+
USAGE_CHECK_REASONS,
|
|
83
|
+
USAGE_REJECT_REASONS,
|
|
84
|
+
USAGE_ROUTE_ERRORS
|
|
85
|
+
},
|
|
86
|
+
schemas: {
|
|
87
|
+
usageEvent: usageEventSchema,
|
|
88
|
+
usageEventsBatch: usageEventsBatchSchema,
|
|
89
|
+
usageIngestResult: usageIngestResultSchema,
|
|
90
|
+
usageEntitlements: entitlementProfileSchema,
|
|
91
|
+
usageCheckRequest: usageCheckRequestSchema,
|
|
92
|
+
usageCheck: usageCheckSchema
|
|
93
|
+
},
|
|
94
|
+
occurrenceIssue: usageEventOccurrenceIssue
|
|
95
|
+
};
|
|
96
|
+
/** The inputs the hub computed its snapshot on, read back from its file: the offsets and the probe payloads. */
|
|
97
|
+
export function wireInputsOf(reference) {
|
|
98
|
+
const probes = {};
|
|
99
|
+
for (const key of WIRE_SCHEMA_KEYS) {
|
|
100
|
+
probes[key] = (reference.probes[key] ?? []).map((probe) => ({ name: probe.name, input: probe.input }));
|
|
101
|
+
}
|
|
102
|
+
return {
|
|
103
|
+
occurrenceOffsetsMs: reference.occurrence.map((row) => row.offsetMs),
|
|
104
|
+
probes
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
/** The snapshot the chassis's copies give on the hub's own inputs: what must equal the hub's file. */
|
|
108
|
+
export function chassisWireSnapshot(reference) {
|
|
109
|
+
return buildWireSnapshot(CHASSIS_WIRE_DEFINITIONS, wireInputsOf(reference));
|
|
110
|
+
}
|
|
111
|
+
function isPlainObject(value) {
|
|
112
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
113
|
+
}
|
|
114
|
+
function childPath(parent, key) {
|
|
115
|
+
return /^[A-Za-z_$][\w$]*$/.test(key)
|
|
116
|
+
? parent === ''
|
|
117
|
+
? key
|
|
118
|
+
: `${parent}.${key}`
|
|
119
|
+
: `${parent}[${JSON.stringify(key)}]`;
|
|
120
|
+
}
|
|
121
|
+
function compareAt(path, hub, chassis, out) {
|
|
122
|
+
if (Array.isArray(hub) && Array.isArray(chassis)) {
|
|
123
|
+
if (hub.length !== chassis.length) {
|
|
124
|
+
out.push({ path, hub, chassis });
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
for (let i = 0; i < hub.length; i += 1)
|
|
128
|
+
compareAt(`${path}[${i}]`, hub[i], chassis[i], out);
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
if (isPlainObject(hub) && isPlainObject(chassis)) {
|
|
132
|
+
const keys = [...new Set([...Object.keys(hub), ...Object.keys(chassis)])].sort();
|
|
133
|
+
for (const key of keys)
|
|
134
|
+
compareAt(childPath(path, key), hub[key], chassis[key], out);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
if (!Object.is(hub, chassis))
|
|
138
|
+
out.push({ path, hub, chassis });
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Every difference between the hub's snapshot and the chassis's, by dotted
|
|
142
|
+
* path (`constants.USAGE_CHECK_REASONS[2]`,
|
|
143
|
+
* `schemas.usageCheck.properties.reason.anyOf[0].enum`,
|
|
144
|
+
* `probes.usageCheck[3].ok`). Objects compare by the union of their keys,
|
|
145
|
+
* order ignored, an absent key and `undefined` being the same; arrays by
|
|
146
|
+
* index, a length difference being one difference at the array's path.
|
|
147
|
+
* Deterministic: keys sorted, arrays in order. Empty when they agree.
|
|
148
|
+
*/
|
|
149
|
+
export function compareWireSnapshots(hub, chassis) {
|
|
150
|
+
const out = [];
|
|
151
|
+
compareAt('', hub, chassis, out);
|
|
152
|
+
return out;
|
|
153
|
+
}
|
|
154
|
+
/** One line of figures for a snapshot: `6 shapes, N constants, M probes, K occurrence offsets`. */
|
|
155
|
+
export function describeWireSnapshot(snapshot) {
|
|
156
|
+
const shapes = Object.keys(snapshot.schemas).length;
|
|
157
|
+
const constants = Object.keys(snapshot.constants).length;
|
|
158
|
+
const probes = Object.values(snapshot.probes).reduce((n, list) => n + list.length, 0);
|
|
159
|
+
return `${shapes} shapes, ${constants} constants, ${probes} probes, ${snapshot.occurrence.length} occurrence offsets`;
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=wire.js.map
|
package/dist/wire.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wire.js","sourceRoot":"","sources":["../src/wire.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,yBAAyB,EACzB,uBAAuB,EACvB,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,wBAAwB,EACxB,uBAAuB,EACvB,gBAAgB,EAChB,yBAAyB,EACzB,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;;;;;;;;;;;GAiBG;AAEH,6EAA6E;AAE7E,0DAA0D;AAC1D,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,YAAY;IACZ,kBAAkB;IAClB,mBAAmB;IACnB,mBAAmB;IACnB,mBAAmB;IACnB,YAAY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M,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IACtF,OAAO,GAAG,MAAM,YAAY,SAAS,eAAe,MAAM,YAAY,QAAQ,CAAC,UAAU,CAAC,MAAM,qBAAqB,CAAC;AACxH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antasphere/chassis-contract",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/antasphere/chassis.git",
|
|
8
|
+
"directory": "packages/chassis-contract"
|
|
9
|
+
},
|
|
10
|
+
"type": "module",
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"src",
|
|
17
|
+
"test",
|
|
18
|
+
"LICENSE"
|
|
19
|
+
],
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"default": "./dist/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./routes": {
|
|
26
|
+
"types": "./dist/routes/index.d.ts",
|
|
27
|
+
"default": "./dist/routes/index.js"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@hono/zod-openapi": "^1.4.0",
|
|
32
|
+
"zod": "^4.1.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"vitest": "^3.2.0"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "tsc -p tsconfig.json",
|
|
39
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
40
|
+
"lint": "eslint src test",
|
|
41
|
+
"test": "vitest run --passWithNoTests",
|
|
42
|
+
"wire:check": "node scripts/hub-wire-check.mjs"
|
|
43
|
+
}
|
|
6
44
|
}
|
package/src/define.ts
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import { defineApiKeySchemas } from './schemas/api-keys.js';
|
|
3
|
+
import { defineCliAuthSchemas } from './schemas/cli-auth.js';
|
|
4
|
+
import { defineMeSchemas } from './schemas/me.js';
|
|
5
|
+
import { defineScopeSchema, type ScopeSchema, type ScopeTuple } from './schemas/scope.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The scope-dependent half of the chassis contract. Everything else in this
|
|
9
|
+
* package is a plain static export; these schemas transitively hold the
|
|
10
|
+
* tool's scope enum, so they are BUILT, once per tool, from the scopes the
|
|
11
|
+
* tool names — no module-level state, the returned object is the contract.
|
|
12
|
+
*
|
|
13
|
+
* const { read, write, dataExport } = IDENTITY.scopes; // the tool's `ToolIdentity` value
|
|
14
|
+
* const contract = defineChassisContract({ scopes: [read, write, dataExport] });
|
|
15
|
+
* export const { scopeSchema, apiKeySchema, meResponseSchema } = contract;
|
|
16
|
+
* export type Scope = ScopeOf<typeof contract>;
|
|
17
|
+
*
|
|
18
|
+
* The scopes are a TUPLE, in the order the enum publishes them: a tool with
|
|
19
|
+
* more scopes than the three parts of its identity appends them here.
|
|
20
|
+
*
|
|
21
|
+
* The route contracts over these schemas come from
|
|
22
|
+
* `defineChassisRoutes(contract, IDENTITY, copy)` on the `./routes` entry (it pulls
|
|
23
|
+
* Hono; this one stays client-safe).
|
|
24
|
+
*/
|
|
25
|
+
export function defineChassisContract<const TScopes extends ScopeTuple>(tool: {
|
|
26
|
+
scopes: TScopes;
|
|
27
|
+
}): ChassisContract<TScopes[number]> {
|
|
28
|
+
return buildChassisContract(defineScopeSchema(tool.scopes));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function buildChassisContract<TScope extends string>(scopeSchema: ScopeSchema<TScope>) {
|
|
32
|
+
const apiKeys = defineApiKeySchemas(scopeSchema);
|
|
33
|
+
return {
|
|
34
|
+
scopeSchema,
|
|
35
|
+
...apiKeys,
|
|
36
|
+
...defineCliAuthSchemas(apiKeys.apiKeySchema),
|
|
37
|
+
...defineMeSchemas(scopeSchema)
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** The contract a tool gets for its scopes (`TScope` = the union of the scope literals). */
|
|
42
|
+
export type ChassisContract<TScope extends string> = ReturnType<typeof buildChassisContract<TScope>>;
|
|
43
|
+
|
|
44
|
+
/** The loosest reading of a contract — what the `…Of` type helpers below accept. */
|
|
45
|
+
export type ChassisContractShape = { [K in keyof ChassisContract<string>]: z.ZodType };
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The inferred types of an instantiated contract, under the names their
|
|
49
|
+
* schemas have always had: `type Scope = ScopeOf<typeof contract>`.
|
|
50
|
+
*/
|
|
51
|
+
export type ScopeOf<C extends Pick<ChassisContractShape, 'scopeSchema'>> = z.infer<C['scopeSchema']>;
|
|
52
|
+
export type ApiKeyInfoOf<C extends Pick<ChassisContractShape, 'apiKeySchema'>> = z.infer<C['apiKeySchema']>;
|
|
53
|
+
export type ApiKeyCreateOf<C extends Pick<ChassisContractShape, 'apiKeyCreateSchema'>> = z.infer<
|
|
54
|
+
C['apiKeyCreateSchema']
|
|
55
|
+
>;
|
|
56
|
+
export type ApiKeyCreatedOf<C extends Pick<ChassisContractShape, 'apiKeyCreatedSchema'>> = z.infer<
|
|
57
|
+
C['apiKeyCreatedSchema']
|
|
58
|
+
>;
|
|
59
|
+
export type CliAuthCompletedOf<C extends Pick<ChassisContractShape, 'cliAuthCompletedSchema'>> = z.infer<
|
|
60
|
+
C['cliAuthCompletedSchema']
|
|
61
|
+
>;
|
|
62
|
+
export type MeResponseOf<C extends Pick<ChassisContractShape, 'meResponseSchema'>> = z.infer<
|
|
63
|
+
C['meResponseSchema']
|
|
64
|
+
>;
|