owenloop 0.5.9 → 0.5.11
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/CHANGELOG.md +51 -0
- package/README.md +77 -37
- package/bin/owenloop.mjs +16 -1
- package/dist/packages/work/src/agent/loop.js +7 -0
- package/dist/packages/work/src/bundle/pull.d.ts +21 -0
- package/dist/packages/work/src/bundle/pull.js +118 -0
- package/dist/packages/work/src/exec/instructions.d.ts +4 -1
- package/dist/packages/work/src/exec/instructions.js +3 -0
- package/dist/packages/work/src/exec/loop.d.ts +1 -1
- package/dist/packages/work/src/exec/loop.js +92 -14
- package/dist/packages/work/src/harness/claude.js +16 -0
- package/dist/packages/work/src/harness/codex.d.ts +8 -0
- package/dist/packages/work/src/harness/codex.js +27 -1
- package/dist/packages/work/src/harness/contract.d.ts +9 -0
- package/dist/packages/work/src/roles/agent-run.js +38 -10
- package/dist/packages/work/src/roles/exec.js +25 -8
- package/dist/packages/work/src/shift/loop.js +118 -4
- package/dist/packages/work/src/shift/runtime.d.ts +3 -0
- package/dist/packages/work/src/shift/runtime.js +10 -1
- package/dist/packages/work/src/submit-proof.d.ts +11 -8
- package/dist/packages/work/src/submit-proof.js +11 -8
- package/dist/src/capabilities.d.ts +70 -6
- package/dist/src/capabilities.js +49 -6
- package/dist/src/capability-mapping-client.d.ts +29 -0
- package/dist/src/capability-mapping-client.js +160 -0
- package/dist/src/cli.d.ts +2 -2
- package/dist/src/cli.js +1200 -166
- package/dist/src/defs.d.ts +41 -1
- package/dist/src/defs.js +461 -92
- package/dist/src/engine.d.ts +108 -22
- package/dist/src/engine.js +573 -85
- package/dist/src/factory.js +5 -3
- package/dist/src/hub.d.ts +77 -0
- package/dist/src/hub.js +162 -0
- package/dist/src/implements.d.ts +37 -0
- package/dist/src/implements.js +790 -0
- package/dist/src/index.d.ts +12 -10
- package/dist/src/index.js +7 -6
- package/dist/src/mcp/serve.js +254 -45
- package/dist/src/mcp/server.d.ts +10 -7
- package/dist/src/mcp/server.js +53 -8
- package/dist/src/model.d.ts +46 -10
- package/dist/src/model.js +224 -78
- package/dist/src/order-resolver.js +1 -0
- package/dist/src/store/def-source.d.ts +19 -0
- package/dist/src/store/def-source.js +87 -17
- package/dist/src/store/gc-recovery.d.ts +46 -0
- package/dist/src/store/gc-recovery.js +258 -0
- package/dist/src/store/gc.d.ts +94 -0
- package/dist/src/store/gc.js +563 -0
- package/dist/src/store/index.d.ts +3 -1
- package/dist/src/store/index.js +2 -0
- package/dist/src/store/install.d.ts +34 -5
- package/dist/src/store/install.js +73 -11
- package/dist/src/store/pre-commit-verifier.js +42 -2
- package/dist/src/store/snapshot-guard.d.ts +18 -0
- package/dist/src/store/snapshot-guard.js +94 -0
- package/dist/src/store.d.ts +66 -4
- package/dist/src/store.js +333 -12
- package/dist/src/types.d.ts +97 -17
- package/dist/src/types.js +4 -0
- package/dist/src/util.js +4 -1
- package/docs/authoring.md +214 -9
- package/docs/bundles.md +19 -0
- package/docs/cli.md +270 -30
- package/docs/crypto.md +13 -7
- package/docs/design.md +107 -46
- package/docs/evals/mcp-charter-baseline.json +428 -0
- package/docs/mcp-charter-eval.md +124 -0
- package/docs/shift-logs.md +18 -0
- package/docs/wire-contracts.md +28 -7
- package/examples/workflows/compile-dev-playbook.yaml +1 -1
- package/examples/workflows/ship.yaml +28 -2
- package/package.json +2 -1
- package/plugins/claude-code/plugin/.claude-plugin/plugin.json +1 -1
- package/plugins/claude-code/plugin/.mcp.json +1 -1
- package/plugins/claude-code/plugin/skills/author/SKILL.md +22 -0
- package/plugins/claude-code/plugin/skills/ephemeral/SKILL.md +95 -0
- package/plugins/claude-code/plugin/skills/graduate/SKILL.md +156 -0
- package/plugins/claude-code/plugin/skills/plan/SKILL.md +236 -0
- package/plugins/codex/plugins/owenloop/.codex-plugin/plugin.json +1 -1
- package/plugins/codex/plugins/owenloop/.mcp.json +1 -1
- package/plugins/codex/plugins/owenloop/skills/author/SKILL.md +22 -0
- package/plugins/codex/plugins/owenloop/skills/ephemeral/SKILL.md +95 -0
- package/plugins/codex/plugins/owenloop/skills/graduate/SKILL.md +156 -0
- package/plugins/codex/plugins/owenloop/skills/plan/SKILL.md +236 -0
package/dist/src/factory.js
CHANGED
|
@@ -23,7 +23,7 @@ import { dirname, join } from 'node:path';
|
|
|
23
23
|
import { Engine } from "./engine.js";
|
|
24
24
|
import { openStore } from "./store.js";
|
|
25
25
|
import { dbPathRefusingSymlink, mkdirRefusingSymlink } from "./util.js";
|
|
26
|
-
import { finalizeDefs, loadDefs, resolveCallsTarget } from "./defs.js";
|
|
26
|
+
import { digestScopedCallsTargetKey, finalizeDefs, loadDefs, resolveCallsTarget } from "./defs.js";
|
|
27
27
|
import { createDefInstructionSource, OrderResolver } from "./order-resolver.js";
|
|
28
28
|
/**
|
|
29
29
|
* Open a store, resolve definitions, and return a wired `Engine` ready to
|
|
@@ -80,8 +80,10 @@ export function createEngine(opts = {}) {
|
|
|
80
80
|
// flat-map branch and behavior here is unchanged; the branch exists so an
|
|
81
81
|
// embedder that DOES hand in store-loaded defs gets the same sibling-first
|
|
82
82
|
// rule `finalizeDefs` already validated the set against.
|
|
83
|
-
const resolveDef = (name, from) => {
|
|
84
|
-
const d =
|
|
83
|
+
const resolveDef = (name, from, bundleDigest) => {
|
|
84
|
+
const d = bundleDigest !== undefined
|
|
85
|
+
? defs.get(digestScopedCallsTargetKey(bundleDigest, name)) ?? defs.get(name)
|
|
86
|
+
: from === undefined ? defs.get(name) : resolveCallsTarget(defs, name, from);
|
|
85
87
|
if (!d)
|
|
86
88
|
throw new Error(`unknown workflow definition '${name}'`);
|
|
87
89
|
return d;
|
package/dist/src/hub.d.ts
CHANGED
|
@@ -537,6 +537,33 @@ export declare function computeServerDiff<T extends {
|
|
|
537
537
|
name: string;
|
|
538
538
|
hash: string;
|
|
539
539
|
}>(candidates: T[], server: Map<string, WorkflowSummary>, force: boolean): ServerDiff<T>;
|
|
540
|
+
/**
|
|
541
|
+
* One line of the hub's capability publish report — what the org's capability
|
|
542
|
+
* vocabulary looks like for the def that was just published, computed hub-side
|
|
543
|
+
* AFTER the write transaction.
|
|
544
|
+
*
|
|
545
|
+
* Mirrors `owenloop-service`'s `CapabilityPublishReportEntry`
|
|
546
|
+
* (`packages/hub-core/src/capability-publish-report.ts`). It is a WIRE shape
|
|
547
|
+
* read from the hub, not a local model: the hub verb is the enforcement of
|
|
548
|
+
* record and this is the client's narrowed copy of it.
|
|
549
|
+
*
|
|
550
|
+
* `authored` is emitted by the hub ONLY when a mapping changed the def author's
|
|
551
|
+
* spelling into a different org name (identity mappings are dropped by the
|
|
552
|
+
* hub's resolver), so its PRESENCE is a reliable signal that a non-identity
|
|
553
|
+
* mapping already exists for that authored name.
|
|
554
|
+
*/
|
|
555
|
+
export interface CapabilityPublishReportEntry {
|
|
556
|
+
/** The ORG name — what an operator would type into `capability bind`. */
|
|
557
|
+
capability: string;
|
|
558
|
+
/** The def author's spelling, present ONLY when a mapping changed it. */
|
|
559
|
+
authored?: string;
|
|
560
|
+
status: 'new' | 'shared' | 'bound';
|
|
561
|
+
/** `bound` only: the NAMES of the crews serving it today, sorted. */
|
|
562
|
+
crews?: string[];
|
|
563
|
+
/** Other def names resolving to this same org name, sorted. Present for
|
|
564
|
+
* `shared`, and also alongside `bound` when both facts hold. */
|
|
565
|
+
sharedWith?: string[];
|
|
566
|
+
}
|
|
540
567
|
/** Success shape of `POST /api/create_workflow`. */
|
|
541
568
|
export interface CreateWorkflowOk {
|
|
542
569
|
ok: true;
|
|
@@ -546,6 +573,16 @@ export interface CreateWorkflowOk {
|
|
|
546
573
|
/** `true` when the posted content's hash equals the latest stored version
|
|
547
574
|
* (server-side idempotent no-op) — no new version was minted. */
|
|
548
575
|
unchanged?: boolean;
|
|
576
|
+
/**
|
|
577
|
+
* The org capability vocabulary this def resolves to, as the hub computed it.
|
|
578
|
+
*
|
|
579
|
+
* `undefined` and `[]` are DIFFERENT answers and are deliberately kept apart:
|
|
580
|
+
* `undefined` is a hub older than the report (it sent no field at all), while
|
|
581
|
+
* `[]` is a current hub saying "this def authors no capabilities". A hub that
|
|
582
|
+
* sends the field sends it on every `ok:true` branch, the `unchanged:true`
|
|
583
|
+
* no-op included, so the distinction is reliable.
|
|
584
|
+
*/
|
|
585
|
+
capabilityReport?: CapabilityPublishReportEntry[];
|
|
549
586
|
}
|
|
550
587
|
/**
|
|
551
588
|
* `POST /api/create_workflow` returns HTTP 200 with `{ok:false,error}` on a
|
|
@@ -575,6 +612,46 @@ export declare function createWorkflowError(body: unknown): string | null;
|
|
|
575
612
|
* on any violation; the caller records it as a per-def failure.
|
|
576
613
|
*/
|
|
577
614
|
export declare function asCreateWorkflowOk(body: unknown, expectedName: string): CreateWorkflowOk;
|
|
615
|
+
/**
|
|
616
|
+
* The one human line a pusher reads after `owenloop push` / `owenloop install`.
|
|
617
|
+
*
|
|
618
|
+
* Deliberately a COPY of the hub's `capabilityPublishReportText`, not an import
|
|
619
|
+
* of it: the CLI does not depend on `owenloop-service`, and the wire contract
|
|
620
|
+
* that binds the two is the ENTRY SHAPE above, not the sentence. Empty string
|
|
621
|
+
* for a def that authors no capabilities, so the caller appends nothing rather
|
|
622
|
+
* than a dangling header.
|
|
623
|
+
*
|
|
624
|
+
* `authored → capability` whenever the hub reported an `authored` spelling —
|
|
625
|
+
* that arrow is how an operator sees a mapping took effect.
|
|
626
|
+
*
|
|
627
|
+
* Goes to STDERR. Stdout is the machine JSON.
|
|
628
|
+
*/
|
|
629
|
+
export declare function capabilityPublishReportText(entries: CapabilityPublishReportEntry[]): string;
|
|
630
|
+
/**
|
|
631
|
+
* Narrow `GET /api/capability_mappings`'s 200 body to a plain `authored → org`
|
|
632
|
+
* record. An EMPTY result is valid — that is "this def has no recorded
|
|
633
|
+
* mapping", not an error.
|
|
634
|
+
*
|
|
635
|
+
* TWO BODY SHAPES ARE ACCEPTED, because the shipped hub and this CLI arrived at
|
|
636
|
+
* the endpoint from opposite ends:
|
|
637
|
+
*
|
|
638
|
+
* - `{ mappings: { <authored>: <org>, … } }` — the compact map this module
|
|
639
|
+
* originally proposed. One def, one function from authored name.
|
|
640
|
+
* - `{ mappings: [ { defName, authored, target, … }, … ] }` — the ROW ARRAY
|
|
641
|
+
* `owenloop-service` ships, whose read is a console listing that may span
|
|
642
|
+
* every def and carries provenance columns this caller does not need.
|
|
643
|
+
*
|
|
644
|
+
* Both collapse to the same record. Tolerating both is deliberate and is not
|
|
645
|
+
* temporary compatibility scaffolding: the row array is the hub's answer to a
|
|
646
|
+
* broader question (`what has this org remapped, anywhere`) and will keep its
|
|
647
|
+
* shape, while an older hub that only ever spoke the compact map must not start
|
|
648
|
+
* failing. A caller reading one def passes `defName` so a hub that ignores the
|
|
649
|
+
* `?def=` filter cannot fold another def's rows into the answer — the array
|
|
650
|
+
* carries `defName` precisely so that check is possible.
|
|
651
|
+
*
|
|
652
|
+
* Neither shape's VALUES are ever echoed in an error, only the position.
|
|
653
|
+
*/
|
|
654
|
+
export declare function asCapabilityMappings(body: unknown, defName?: string): Record<string, string>;
|
|
578
655
|
/**
|
|
579
656
|
* Identity returned by `GET /api/whoami` (bearer auth, no RBAC verb — a 200
|
|
580
657
|
* proves the credential authenticates, not that it carries any particular
|
package/dist/src/hub.js
CHANGED
|
@@ -853,6 +853,168 @@ export function asCreateWorkflowOk(body, expectedName) {
|
|
|
853
853
|
const out = { ok: true, name: b.name, version: b.version, hash: b.hash };
|
|
854
854
|
if (b.unchanged === true)
|
|
855
855
|
out.unchanged = true;
|
|
856
|
+
if (b.capabilityReport !== undefined) {
|
|
857
|
+
out.capabilityReport = asCapabilityPublishReport(b.capabilityReport, 'create_workflow: malformed success response');
|
|
858
|
+
}
|
|
859
|
+
return out;
|
|
860
|
+
}
|
|
861
|
+
/**
|
|
862
|
+
* Narrow a `capabilityReport` payload to typed entries, or throw.
|
|
863
|
+
*
|
|
864
|
+
* Called ONLY when the field is present: an ABSENT field is a hub older than
|
|
865
|
+
* the report and must stay `undefined` rather than fail the push (see
|
|
866
|
+
* `CreateWorkflowOk.capabilityReport`). A PRESENT field, on the other hand, is
|
|
867
|
+
* validated strictly (REL-9) — a malformed report is a malformed response, not
|
|
868
|
+
* something to coerce to a default.
|
|
869
|
+
*
|
|
870
|
+
* Unknown extra fields on an entry are IGNORED, not rejected: the hub may add
|
|
871
|
+
* facts to the report and an older CLI must keep pushing.
|
|
872
|
+
*
|
|
873
|
+
* Every message names the offending FIELD and INDEX only, never a body value.
|
|
874
|
+
*/
|
|
875
|
+
function asCapabilityPublishReport(value, prefix) {
|
|
876
|
+
if (!Array.isArray(value)) {
|
|
877
|
+
throw new Error(`${prefix} — capabilityReport is not an array`);
|
|
878
|
+
}
|
|
879
|
+
return value.map((raw, i) => {
|
|
880
|
+
const where = `capabilityReport[${i}]`;
|
|
881
|
+
if (typeof raw !== 'object' || raw === null) {
|
|
882
|
+
throw new Error(`${prefix} — ${where} is not an object`);
|
|
883
|
+
}
|
|
884
|
+
const e = raw;
|
|
885
|
+
if (typeof e.capability !== 'string' || e.capability === '') {
|
|
886
|
+
throw new Error(`${prefix} — ${where} missing non-empty string capability`);
|
|
887
|
+
}
|
|
888
|
+
if (e.status !== 'new' && e.status !== 'shared' && e.status !== 'bound') {
|
|
889
|
+
throw new Error(`${prefix} — ${where} status must be one of new, shared, bound`);
|
|
890
|
+
}
|
|
891
|
+
const entry = { capability: e.capability, status: e.status };
|
|
892
|
+
if (e.authored !== undefined) {
|
|
893
|
+
if (typeof e.authored !== 'string' || e.authored === '') {
|
|
894
|
+
throw new Error(`${prefix} — ${where} authored must be a non-empty string when present`);
|
|
895
|
+
}
|
|
896
|
+
entry.authored = e.authored;
|
|
897
|
+
}
|
|
898
|
+
for (const field of ['crews', 'sharedWith']) {
|
|
899
|
+
const list = e[field];
|
|
900
|
+
if (list === undefined)
|
|
901
|
+
continue;
|
|
902
|
+
if (!Array.isArray(list) || list.some((v) => typeof v !== 'string' || v === '')) {
|
|
903
|
+
throw new Error(`${prefix} — ${where} ${field} must be an array of non-empty strings when present`);
|
|
904
|
+
}
|
|
905
|
+
entry[field] = list;
|
|
906
|
+
}
|
|
907
|
+
return entry;
|
|
908
|
+
});
|
|
909
|
+
}
|
|
910
|
+
/**
|
|
911
|
+
* The one human line a pusher reads after `owenloop push` / `owenloop install`.
|
|
912
|
+
*
|
|
913
|
+
* Deliberately a COPY of the hub's `capabilityPublishReportText`, not an import
|
|
914
|
+
* of it: the CLI does not depend on `owenloop-service`, and the wire contract
|
|
915
|
+
* that binds the two is the ENTRY SHAPE above, not the sentence. Empty string
|
|
916
|
+
* for a def that authors no capabilities, so the caller appends nothing rather
|
|
917
|
+
* than a dangling header.
|
|
918
|
+
*
|
|
919
|
+
* `authored → capability` whenever the hub reported an `authored` spelling —
|
|
920
|
+
* that arrow is how an operator sees a mapping took effect.
|
|
921
|
+
*
|
|
922
|
+
* Goes to STDERR. Stdout is the machine JSON.
|
|
923
|
+
*/
|
|
924
|
+
export function capabilityPublishReportText(entries) {
|
|
925
|
+
if (entries.length === 0)
|
|
926
|
+
return '';
|
|
927
|
+
const parts = entries.map((entry) => {
|
|
928
|
+
const name = entry.authored === undefined ? entry.capability : `${entry.authored} → ${entry.capability}`;
|
|
929
|
+
if (entry.status === 'bound')
|
|
930
|
+
return `${name}: bound (${(entry.crews ?? []).join(', ')})`;
|
|
931
|
+
if (entry.status === 'shared')
|
|
932
|
+
return `${name}: shared with ${(entry.sharedWith ?? []).join(', ')}`;
|
|
933
|
+
return `${name}: new — nothing serves it yet`;
|
|
934
|
+
});
|
|
935
|
+
return `Capabilities — ${parts.join('; ')}.`;
|
|
936
|
+
}
|
|
937
|
+
/**
|
|
938
|
+
* Narrow `GET /api/capability_mappings`'s 200 body to a plain `authored → org`
|
|
939
|
+
* record. An EMPTY result is valid — that is "this def has no recorded
|
|
940
|
+
* mapping", not an error.
|
|
941
|
+
*
|
|
942
|
+
* TWO BODY SHAPES ARE ACCEPTED, because the shipped hub and this CLI arrived at
|
|
943
|
+
* the endpoint from opposite ends:
|
|
944
|
+
*
|
|
945
|
+
* - `{ mappings: { <authored>: <org>, … } }` — the compact map this module
|
|
946
|
+
* originally proposed. One def, one function from authored name.
|
|
947
|
+
* - `{ mappings: [ { defName, authored, target, … }, … ] }` — the ROW ARRAY
|
|
948
|
+
* `owenloop-service` ships, whose read is a console listing that may span
|
|
949
|
+
* every def and carries provenance columns this caller does not need.
|
|
950
|
+
*
|
|
951
|
+
* Both collapse to the same record. Tolerating both is deliberate and is not
|
|
952
|
+
* temporary compatibility scaffolding: the row array is the hub's answer to a
|
|
953
|
+
* broader question (`what has this org remapped, anywhere`) and will keep its
|
|
954
|
+
* shape, while an older hub that only ever spoke the compact map must not start
|
|
955
|
+
* failing. A caller reading one def passes `defName` so a hub that ignores the
|
|
956
|
+
* `?def=` filter cannot fold another def's rows into the answer — the array
|
|
957
|
+
* carries `defName` precisely so that check is possible.
|
|
958
|
+
*
|
|
959
|
+
* Neither shape's VALUES are ever echoed in an error, only the position.
|
|
960
|
+
*/
|
|
961
|
+
export function asCapabilityMappings(body, defName) {
|
|
962
|
+
const prefix = 'capability_mappings: malformed success response';
|
|
963
|
+
if (typeof body !== 'object' || body === null) {
|
|
964
|
+
throw new Error(`${prefix} — not an object`);
|
|
965
|
+
}
|
|
966
|
+
const raw = body.mappings;
|
|
967
|
+
if (Array.isArray(raw))
|
|
968
|
+
return capabilityMappingsFromRows(raw, prefix, defName);
|
|
969
|
+
if (typeof raw !== 'object' || raw === null) {
|
|
970
|
+
throw new Error(`${prefix} — expected a \`mappings\` object or array`);
|
|
971
|
+
}
|
|
972
|
+
const out = {};
|
|
973
|
+
const entries = Object.entries(raw);
|
|
974
|
+
for (let i = 0; i < entries.length; i++) {
|
|
975
|
+
const [authored, target] = entries[i];
|
|
976
|
+
if (authored === '') {
|
|
977
|
+
throw new Error(`${prefix} — mappings[${i}] has an empty authored key`);
|
|
978
|
+
}
|
|
979
|
+
if (typeof target !== 'string' || target === '') {
|
|
980
|
+
throw new Error(`${prefix} — mappings[${i}] must map to a non-empty string`);
|
|
981
|
+
}
|
|
982
|
+
out[authored] = target;
|
|
983
|
+
}
|
|
984
|
+
return out;
|
|
985
|
+
}
|
|
986
|
+
/**
|
|
987
|
+
* The row-array half of `asCapabilityMappings`.
|
|
988
|
+
*
|
|
989
|
+
* A row whose `defName` is a string naming a DIFFERENT def is SKIPPED, not
|
|
990
|
+
* rejected: an unfiltered listing is a well-formed answer to a filtered
|
|
991
|
+
* question, just a broader one, and refusing it would fail a correct hub. A row
|
|
992
|
+
* carrying no `defName` at all is kept — only a positive mismatch excludes.
|
|
993
|
+
*
|
|
994
|
+
* A LATER ROW WINS over an earlier one for the same authored name. The hub keys
|
|
995
|
+
* this table `(def_name, authored)`, so within one def a duplicate cannot
|
|
996
|
+
* happen; across defs the `defName` filter above is what separates them. This
|
|
997
|
+
* rule therefore only ever settles a body that already contradicts itself, and
|
|
998
|
+
* settling it deterministically beats throwing.
|
|
999
|
+
*/
|
|
1000
|
+
function capabilityMappingsFromRows(rows, prefix, defName) {
|
|
1001
|
+
const out = {};
|
|
1002
|
+
for (let i = 0; i < rows.length; i++) {
|
|
1003
|
+
const row = rows[i];
|
|
1004
|
+
if (typeof row !== 'object' || row === null || Array.isArray(row)) {
|
|
1005
|
+
throw new Error(`${prefix} — mappings[${i}] is not an object`);
|
|
1006
|
+
}
|
|
1007
|
+
const r = row;
|
|
1008
|
+
if (defName !== undefined && typeof r.defName === 'string' && r.defName !== defName)
|
|
1009
|
+
continue;
|
|
1010
|
+
if (typeof r.authored !== 'string' || r.authored === '') {
|
|
1011
|
+
throw new Error(`${prefix} — mappings[${i}] has no non-empty \`authored\``);
|
|
1012
|
+
}
|
|
1013
|
+
if (typeof r.target !== 'string' || r.target === '') {
|
|
1014
|
+
throw new Error(`${prefix} — mappings[${i}] has no non-empty \`target\``);
|
|
1015
|
+
}
|
|
1016
|
+
out[r.authored] = r.target;
|
|
1017
|
+
}
|
|
856
1018
|
return out;
|
|
857
1019
|
}
|
|
858
1020
|
/** Narrow a `GET /api/whoami` 200 body to its typed shape. Throws on a malformed body. */
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { WorkflowDef, WorkflowInterfaceSignature } from './types.ts';
|
|
2
|
+
export type { WorkflowInterfaceArtifact, WorkflowInterfaceClaim, WorkflowInterfaceSignature, } from './types.ts';
|
|
3
|
+
/** One deterministic reason an implementation does not satisfy an interface. */
|
|
4
|
+
export interface InterfaceCompatibilityIssue {
|
|
5
|
+
path: string;
|
|
6
|
+
message: string;
|
|
7
|
+
}
|
|
8
|
+
/** The pure result returned when a signature is checked against a workflow. */
|
|
9
|
+
export interface InterfaceCompatibilityCheck {
|
|
10
|
+
compatible: boolean;
|
|
11
|
+
issues: InterfaceCompatibilityIssue[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Validate a workflow against a supplied external interface signature without
|
|
15
|
+
* mutating either value. x.discovery.interface remains the definition's
|
|
16
|
+
* self-description and owns local schemaRef pointers; x.implements only names
|
|
17
|
+
* external contracts and carries no copied schemas or second pointer syntax.
|
|
18
|
+
*
|
|
19
|
+
* This is structural JSON Schema compatibility, not a general theorem prover.
|
|
20
|
+
* It supports booleans; type/const/enum; numeric, string, array, and object
|
|
21
|
+
* bounds; array items and uniqueItems; object properties, required, and
|
|
22
|
+
* additionalProperties; and oneOf/anyOf. Union sibling constraints are
|
|
23
|
+
* compared separately from branch coverage. Target oneOf branches are accepted
|
|
24
|
+
* only when non-boolean, object-only schemas with required const/enum
|
|
25
|
+
* discriminators prove every pair disjoint.
|
|
26
|
+
* The checker remains structural and incomplete: coverage requiring multiple
|
|
27
|
+
* target branches fails closed. allOf, if/then/else, not, $ref, prefixItems,
|
|
28
|
+
* and other validation keywords fail closed with a path-specific issue. For a
|
|
29
|
+
* closed interface output, the projection rule permits extra implementation
|
|
30
|
+
* properties only when that implementation is also closed.
|
|
31
|
+
*/
|
|
32
|
+
export declare function checkInterfaceCompatibility(signature: WorkflowInterfaceSignature, def: WorkflowDef): InterfaceCompatibilityCheck;
|
|
33
|
+
/**
|
|
34
|
+
* Return advisory, field-qualified authoring issues for x.implements. The
|
|
35
|
+
* extension remains optional so old binaries keep loading existing definitions.
|
|
36
|
+
*/
|
|
37
|
+
export declare function implementsIssues(def: WorkflowDef): string[];
|