@davidorex/pi-context 0.26.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/CHANGELOG.md +23 -0
- package/README.md +195 -0
- package/dist/block-api.d.ts +328 -0
- package/dist/block-api.d.ts.map +1 -0
- package/dist/block-api.js +1167 -0
- package/dist/block-api.js.map +1 -0
- package/dist/block-validation.d.ts +33 -0
- package/dist/block-validation.d.ts.map +1 -0
- package/dist/block-validation.js +213 -0
- package/dist/block-validation.js.map +1 -0
- package/dist/context-dir.d.ts +93 -0
- package/dist/context-dir.d.ts.map +1 -0
- package/dist/context-dir.js +224 -0
- package/dist/context-dir.js.map +1 -0
- package/dist/context-sdk.d.ts +428 -0
- package/dist/context-sdk.d.ts.map +1 -0
- package/dist/context-sdk.js +1327 -0
- package/dist/context-sdk.js.map +1 -0
- package/dist/context.d.ts +497 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +1060 -0
- package/dist/context.js.map +1 -0
- package/dist/dispatch-context.d.ts +112 -0
- package/dist/dispatch-context.d.ts.map +1 -0
- package/dist/dispatch-context.js +119 -0
- package/dist/dispatch-context.js.map +1 -0
- package/dist/execution-context.d.ts +138 -0
- package/dist/execution-context.d.ts.map +1 -0
- package/dist/execution-context.js +151 -0
- package/dist/execution-context.js.map +1 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1655 -0
- package/dist/index.js.map +1 -0
- package/dist/lens-validator.d.ts +50 -0
- package/dist/lens-validator.d.ts.map +1 -0
- package/dist/lens-validator.js +46 -0
- package/dist/lens-validator.js.map +1 -0
- package/dist/lens-view.d.ts +75 -0
- package/dist/lens-view.d.ts.map +1 -0
- package/dist/lens-view.js +253 -0
- package/dist/lens-view.js.map +1 -0
- package/dist/rename-canonical-id.d.ts +64 -0
- package/dist/rename-canonical-id.d.ts.map +1 -0
- package/dist/rename-canonical-id.js +378 -0
- package/dist/rename-canonical-id.js.map +1 -0
- package/dist/roadmap-plan.d.ts +186 -0
- package/dist/roadmap-plan.d.ts.map +1 -0
- package/dist/roadmap-plan.js +534 -0
- package/dist/roadmap-plan.js.map +1 -0
- package/dist/samples-catalog.d.ts +48 -0
- package/dist/samples-catalog.d.ts.map +1 -0
- package/dist/samples-catalog.js +128 -0
- package/dist/samples-catalog.js.map +1 -0
- package/dist/schema-migrations.d.ts +82 -0
- package/dist/schema-migrations.d.ts.map +1 -0
- package/dist/schema-migrations.js +106 -0
- package/dist/schema-migrations.js.map +1 -0
- package/dist/schema-validator.d.ts +76 -0
- package/dist/schema-validator.d.ts.map +1 -0
- package/dist/schema-validator.js +219 -0
- package/dist/schema-validator.js.map +1 -0
- package/dist/schema-write.d.ts +122 -0
- package/dist/schema-write.d.ts.map +1 -0
- package/dist/schema-write.js +210 -0
- package/dist/schema-write.js.map +1 -0
- package/dist/status-vocab.d.ts +60 -0
- package/dist/status-vocab.d.ts.map +1 -0
- package/dist/status-vocab.js +109 -0
- package/dist/status-vocab.js.map +1 -0
- package/dist/test-helpers.d.ts +12 -0
- package/dist/test-helpers.d.ts.map +1 -0
- package/dist/test-helpers.js +28 -0
- package/dist/test-helpers.js.map +1 -0
- package/dist/topo.d.ts +19 -0
- package/dist/topo.d.ts.map +1 -0
- package/dist/topo.js +99 -0
- package/dist/topo.js.map +1 -0
- package/dist/update-check.d.ts +6 -0
- package/dist/update-check.d.ts.map +1 -0
- package/dist/update-check.js +82 -0
- package/dist/update-check.js.map +1 -0
- package/package.json +115 -0
- package/samples/blocks/context-contracts.json +3 -0
- package/samples/blocks/conventions.json +3 -0
- package/samples/blocks/decisions.json +3 -0
- package/samples/blocks/features.json +3 -0
- package/samples/blocks/framework-gaps.json +3 -0
- package/samples/blocks/issues.json +3 -0
- package/samples/blocks/layer-plans.json +3 -0
- package/samples/blocks/phase.json +3 -0
- package/samples/blocks/rationale.json +3 -0
- package/samples/blocks/requirements.json +3 -0
- package/samples/blocks/research.json +3 -0
- package/samples/blocks/spec-reviews.json +3 -0
- package/samples/blocks/story.json +3 -0
- package/samples/blocks/tasks.json +3 -0
- package/samples/blocks/verification.json +3 -0
- package/samples/conception.json +467 -0
- package/samples/schemas/context-contracts.schema.json +89 -0
- package/samples/schemas/conventions.schema.json +34 -0
- package/samples/schemas/decisions.schema.json +87 -0
- package/samples/schemas/features.schema.json +53 -0
- package/samples/schemas/framework-gaps.schema.json +64 -0
- package/samples/schemas/issues.schema.json +39 -0
- package/samples/schemas/layer-plans.schema.json +92 -0
- package/samples/schemas/phase.schema.json +118 -0
- package/samples/schemas/rationale.schema.json +24 -0
- package/samples/schemas/requirements.schema.json +34 -0
- package/samples/schemas/research.schema.json +134 -0
- package/samples/schemas/spec-reviews.schema.json +62 -0
- package/samples/schemas/story.schema.json +73 -0
- package/samples/schemas/tasks.schema.json +34 -0
- package/samples/schemas/verification.schema.json +37 -0
- package/schemas/bootstrap.schema.json +24 -0
- package/schemas/config.schema.json +193 -0
- package/schemas/layer.schema.json +9 -0
- package/schemas/priority.schema.json +9 -0
- package/schemas/relations.schema.json +31 -0
- package/schemas/severity.schema.json +9 -0
- package/schemas/source.schema.json +9 -0
- package/schemas/status.schema.json +9 -0
- package/schemas/verification-method.schema.json +9 -0
- package/skill-narrative.md +130 -0
- package/skills/pi-context/SKILL.md +684 -0
- package/skills/pi-context/references/bundled-resources.md +47 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,6BAA6B,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,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tF,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACrE,IAAI,CAAC,QAAQ;QAAE,OAAO,EAAE,CAAC;IACzB,OAAO,GAAG,CAAC,QAAQ,CAAiB,CAAC;AACtC,CAAC;AAED,oEAAoE;AACpE,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dispatch context — authorship attestation surface for block-api writes.
|
|
3
|
+
*
|
|
4
|
+
* Closes structurally:
|
|
5
|
+
* - FGAP-004 (authorship attestation at block write time): block-api write
|
|
6
|
+
* functions accept an optional `DispatchContext`. When provided AND the
|
|
7
|
+
* target schema declares author fields (created_by / created_at /
|
|
8
|
+
* modified_by / modified_at), the write surface stamps the item before
|
|
9
|
+
* AJV validation. When omitted, behavior is byte-identical to the prior
|
|
10
|
+
* surface — the parameter is purely additive.
|
|
11
|
+
*
|
|
12
|
+
* Convention reference: `created_by` strings already in committed blocks
|
|
13
|
+
* follow `<kind>/<id>`, e.g. `agent/claude-opus-4-6` in
|
|
14
|
+
* `.project/decisions.json`. `writerToString` reproduces that exact format
|
|
15
|
+
* across the four `WriterIdentity` discriminants.
|
|
16
|
+
*
|
|
17
|
+
* Out-of-scope for step 3:
|
|
18
|
+
* - Adding author fields to schemas that lack them (FGAP-006 schema
|
|
19
|
+
* versioning territory; step 4)
|
|
20
|
+
* - Migrating existing block-api callers to pass `ctx` (incremental;
|
|
21
|
+
* opt-in by design — never required)
|
|
22
|
+
* - Deprecating non-ctx writes (no — `ctx` remains optional for the
|
|
23
|
+
* full rebuild arc)
|
|
24
|
+
*
|
|
25
|
+
* This module has no external dependencies — pure types + helpers — so it
|
|
26
|
+
* can be imported from block-api.ts, schema-write.ts, or any consumer
|
|
27
|
+
* without forming a cycle through context / context-sdk.
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* Discriminated union of writer kinds. Each branch carries the minimum id
|
|
31
|
+
* needed to round-trip through `writerToString`. The string form is the
|
|
32
|
+
* canonical write-time author marker shape used in `.project/*.json`.
|
|
33
|
+
*/
|
|
34
|
+
export type WriterIdentity = {
|
|
35
|
+
kind: "human";
|
|
36
|
+
user: string;
|
|
37
|
+
} | {
|
|
38
|
+
kind: "agent";
|
|
39
|
+
agent_id: string;
|
|
40
|
+
model?: string;
|
|
41
|
+
} | {
|
|
42
|
+
kind: "monitor";
|
|
43
|
+
monitor_name: string;
|
|
44
|
+
} | {
|
|
45
|
+
kind: "workflow";
|
|
46
|
+
workflow_step_id: string;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Optional final argument passed to block-api write functions. The shape
|
|
50
|
+
* stays minimal in step 3 — `writer` is the single field — so future
|
|
51
|
+
* additions (trace ids, run ids, intent labels) extend the interface
|
|
52
|
+
* without breaking existing callers.
|
|
53
|
+
*/
|
|
54
|
+
export interface DispatchContext {
|
|
55
|
+
writer: WriterIdentity;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Render a `WriterIdentity` into the canonical `<kind>/<id>` string form.
|
|
59
|
+
* The id segment is the human-readable identifier per kind:
|
|
60
|
+
* - human → `user`
|
|
61
|
+
* - agent → `agent_id`
|
|
62
|
+
* - monitor → `monitor_name`
|
|
63
|
+
* - workflow → `workflow_step_id`
|
|
64
|
+
*
|
|
65
|
+
* Examples (matches existing decisions.json convention):
|
|
66
|
+
* writerToString({kind: "agent", agent_id: "claude-opus-4-7"})
|
|
67
|
+
* → "agent/claude-opus-4-7"
|
|
68
|
+
* writerToString({kind: "human", user: "david"})
|
|
69
|
+
* → "human/david"
|
|
70
|
+
* writerToString({kind: "monitor", monitor_name: "fragility-detector"})
|
|
71
|
+
* → "monitor/fragility-detector"
|
|
72
|
+
* writerToString({kind: "workflow", workflow_step_id: "step-5"})
|
|
73
|
+
* → "workflow/step-5"
|
|
74
|
+
*
|
|
75
|
+
* `model` on agent writers is informational metadata — it is intentionally
|
|
76
|
+
* excluded from the canonical string form to keep author markers stable
|
|
77
|
+
* across model upgrades for the same agent.
|
|
78
|
+
*/
|
|
79
|
+
export declare function writerToString(w: WriterIdentity): string;
|
|
80
|
+
/**
|
|
81
|
+
* Stamp authorship fields onto a copy of `item` and return the new object.
|
|
82
|
+
* The original `item` is never mutated — callers can safely retain the
|
|
83
|
+
* pre-stamp reference.
|
|
84
|
+
*
|
|
85
|
+
* Stamping rules (each field is only assigned when `declaredFields` includes
|
|
86
|
+
* its name — schemas that declare a SUBSET of the four author fields receive
|
|
87
|
+
* stamps only for the declared subset; the rest are left untouched so that
|
|
88
|
+
* `additionalProperties: false` schemas validate cleanly):
|
|
89
|
+
* - mode === "create":
|
|
90
|
+
* `created_by` and `created_at` (if declared) are set ONLY if the field
|
|
91
|
+
* is missing (or present-but-undefined). Pre-existing values are
|
|
92
|
+
* preserved so that re-creates / replays do not overwrite the original
|
|
93
|
+
* author. `modified_by` and `modified_at` (if declared) are always set
|
|
94
|
+
* to current values.
|
|
95
|
+
* - mode === "update":
|
|
96
|
+
* `created_by` and `created_at` are NEVER touched even when declared.
|
|
97
|
+
* `modified_by` and `modified_at` (if declared) are always refreshed
|
|
98
|
+
* to current values.
|
|
99
|
+
*
|
|
100
|
+
* Timestamps use ISO 8601 via `new Date().toISOString()`, matching the
|
|
101
|
+
* format shipping in `.project/decisions.json` etc.
|
|
102
|
+
*
|
|
103
|
+
* `declaredFields` is the per-schema set of author-field property names that
|
|
104
|
+
* the target shape's `properties` object declares. The block-api schema
|
|
105
|
+
* introspection cache builds the set per (block, arrayKey or envelope) and
|
|
106
|
+
* threads it in here. An empty set means "schema declares no author fields"
|
|
107
|
+
* — `stampItem` then returns the item unchanged. Callers should normally
|
|
108
|
+
* route through `maybeStampItem` (block-api.ts) which short-circuits before
|
|
109
|
+
* this function on an empty set; the empty-set path here is defensive.
|
|
110
|
+
*/
|
|
111
|
+
export declare function stampItem(item: Record<string, unknown>, ctx: DispatchContext, mode: "create" | "update", declaredFields: ReadonlySet<string>): Record<string, unknown>;
|
|
112
|
+
//# sourceMappingURL=dispatch-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dispatch-context.d.ts","sourceRoot":"","sources":["../src/dispatch-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAIH;;;;GAIG;AACH,MAAM,MAAM,cAAc,GACvB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC/B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GACnD;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GACzC;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAA;CAAE,CAAC;AAElD;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC/B,MAAM,EAAE,cAAc,CAAC;CACvB;AAID;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,cAAc,GAAG,MAAM,CAWxD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,SAAS,CACxB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,GAAG,EAAE,eAAe,EACpB,IAAI,EAAE,QAAQ,GAAG,QAAQ,EACzB,cAAc,EAAE,WAAW,CAAC,MAAM,CAAC,GACjC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA0BzB"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dispatch context — authorship attestation surface for block-api writes.
|
|
3
|
+
*
|
|
4
|
+
* Closes structurally:
|
|
5
|
+
* - FGAP-004 (authorship attestation at block write time): block-api write
|
|
6
|
+
* functions accept an optional `DispatchContext`. When provided AND the
|
|
7
|
+
* target schema declares author fields (created_by / created_at /
|
|
8
|
+
* modified_by / modified_at), the write surface stamps the item before
|
|
9
|
+
* AJV validation. When omitted, behavior is byte-identical to the prior
|
|
10
|
+
* surface — the parameter is purely additive.
|
|
11
|
+
*
|
|
12
|
+
* Convention reference: `created_by` strings already in committed blocks
|
|
13
|
+
* follow `<kind>/<id>`, e.g. `agent/claude-opus-4-6` in
|
|
14
|
+
* `.project/decisions.json`. `writerToString` reproduces that exact format
|
|
15
|
+
* across the four `WriterIdentity` discriminants.
|
|
16
|
+
*
|
|
17
|
+
* Out-of-scope for step 3:
|
|
18
|
+
* - Adding author fields to schemas that lack them (FGAP-006 schema
|
|
19
|
+
* versioning territory; step 4)
|
|
20
|
+
* - Migrating existing block-api callers to pass `ctx` (incremental;
|
|
21
|
+
* opt-in by design — never required)
|
|
22
|
+
* - Deprecating non-ctx writes (no — `ctx` remains optional for the
|
|
23
|
+
* full rebuild arc)
|
|
24
|
+
*
|
|
25
|
+
* This module has no external dependencies — pure types + helpers — so it
|
|
26
|
+
* can be imported from block-api.ts, schema-write.ts, or any consumer
|
|
27
|
+
* without forming a cycle through context / context-sdk.
|
|
28
|
+
*/
|
|
29
|
+
// ── Helpers ─────────────────────────────────────────────────────────────────
|
|
30
|
+
/**
|
|
31
|
+
* Render a `WriterIdentity` into the canonical `<kind>/<id>` string form.
|
|
32
|
+
* The id segment is the human-readable identifier per kind:
|
|
33
|
+
* - human → `user`
|
|
34
|
+
* - agent → `agent_id`
|
|
35
|
+
* - monitor → `monitor_name`
|
|
36
|
+
* - workflow → `workflow_step_id`
|
|
37
|
+
*
|
|
38
|
+
* Examples (matches existing decisions.json convention):
|
|
39
|
+
* writerToString({kind: "agent", agent_id: "claude-opus-4-7"})
|
|
40
|
+
* → "agent/claude-opus-4-7"
|
|
41
|
+
* writerToString({kind: "human", user: "david"})
|
|
42
|
+
* → "human/david"
|
|
43
|
+
* writerToString({kind: "monitor", monitor_name: "fragility-detector"})
|
|
44
|
+
* → "monitor/fragility-detector"
|
|
45
|
+
* writerToString({kind: "workflow", workflow_step_id: "step-5"})
|
|
46
|
+
* → "workflow/step-5"
|
|
47
|
+
*
|
|
48
|
+
* `model` on agent writers is informational metadata — it is intentionally
|
|
49
|
+
* excluded from the canonical string form to keep author markers stable
|
|
50
|
+
* across model upgrades for the same agent.
|
|
51
|
+
*/
|
|
52
|
+
export function writerToString(w) {
|
|
53
|
+
switch (w.kind) {
|
|
54
|
+
case "human":
|
|
55
|
+
return `human/${w.user}`;
|
|
56
|
+
case "agent":
|
|
57
|
+
return `agent/${w.agent_id}`;
|
|
58
|
+
case "monitor":
|
|
59
|
+
return `monitor/${w.monitor_name}`;
|
|
60
|
+
case "workflow":
|
|
61
|
+
return `workflow/${w.workflow_step_id}`;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Stamp authorship fields onto a copy of `item` and return the new object.
|
|
66
|
+
* The original `item` is never mutated — callers can safely retain the
|
|
67
|
+
* pre-stamp reference.
|
|
68
|
+
*
|
|
69
|
+
* Stamping rules (each field is only assigned when `declaredFields` includes
|
|
70
|
+
* its name — schemas that declare a SUBSET of the four author fields receive
|
|
71
|
+
* stamps only for the declared subset; the rest are left untouched so that
|
|
72
|
+
* `additionalProperties: false` schemas validate cleanly):
|
|
73
|
+
* - mode === "create":
|
|
74
|
+
* `created_by` and `created_at` (if declared) are set ONLY if the field
|
|
75
|
+
* is missing (or present-but-undefined). Pre-existing values are
|
|
76
|
+
* preserved so that re-creates / replays do not overwrite the original
|
|
77
|
+
* author. `modified_by` and `modified_at` (if declared) are always set
|
|
78
|
+
* to current values.
|
|
79
|
+
* - mode === "update":
|
|
80
|
+
* `created_by` and `created_at` are NEVER touched even when declared.
|
|
81
|
+
* `modified_by` and `modified_at` (if declared) are always refreshed
|
|
82
|
+
* to current values.
|
|
83
|
+
*
|
|
84
|
+
* Timestamps use ISO 8601 via `new Date().toISOString()`, matching the
|
|
85
|
+
* format shipping in `.project/decisions.json` etc.
|
|
86
|
+
*
|
|
87
|
+
* `declaredFields` is the per-schema set of author-field property names that
|
|
88
|
+
* the target shape's `properties` object declares. The block-api schema
|
|
89
|
+
* introspection cache builds the set per (block, arrayKey or envelope) and
|
|
90
|
+
* threads it in here. An empty set means "schema declares no author fields"
|
|
91
|
+
* — `stampItem` then returns the item unchanged. Callers should normally
|
|
92
|
+
* route through `maybeStampItem` (block-api.ts) which short-circuits before
|
|
93
|
+
* this function on an empty set; the empty-set path here is defensive.
|
|
94
|
+
*/
|
|
95
|
+
export function stampItem(item, ctx, mode, declaredFields) {
|
|
96
|
+
if (declaredFields.size === 0)
|
|
97
|
+
return { ...item };
|
|
98
|
+
const writer = writerToString(ctx.writer);
|
|
99
|
+
const now = new Date().toISOString();
|
|
100
|
+
const out = { ...item };
|
|
101
|
+
if (mode === "create") {
|
|
102
|
+
if (declaredFields.has("created_by") && (out.created_by === undefined || out.created_by === null)) {
|
|
103
|
+
out.created_by = writer;
|
|
104
|
+
}
|
|
105
|
+
if (declaredFields.has("created_at") && (out.created_at === undefined || out.created_at === null)) {
|
|
106
|
+
out.created_at = now;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
// modified_by + modified_at refresh on every call — both create (item is
|
|
110
|
+
// also being modified at create time) and update — but only when declared.
|
|
111
|
+
if (declaredFields.has("modified_by")) {
|
|
112
|
+
out.modified_by = writer;
|
|
113
|
+
}
|
|
114
|
+
if (declaredFields.has("modified_at")) {
|
|
115
|
+
out.modified_at = now;
|
|
116
|
+
}
|
|
117
|
+
return out;
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=dispatch-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dispatch-context.js","sourceRoot":"","sources":["../src/dispatch-context.ts"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UAAU,KAAK,IAAI,CAAC,EAAE,CAAC;YACnG,GAAG,CAAC,UAAU,GAAG,GAAG,CAAC;QACtB,CAAC;IACF,CAAC;IAED,yEAAyE;IACzE,2EAA2E;IAC3E,IAAI,cAAc,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;QACvC,GAAG,CAAC,WAAW,GAAG,MAAM,CAAC;IAC1B,CAAC;IACD,IAAI,cAAc,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;QACvC,GAAG,CAAC,WAAW,GAAG,GAAG,CAAC;IACvB,CAAC;IAED,OAAO,GAAG,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* gatherExecutionContext primitive — work-unit-driven context bundling per
|
|
3
|
+
* DEC-0017. Reads the unit + reads its context-contract (keyed by unit_kind)
|
|
4
|
+
* + walks each declared relation_type in the contract bidirectionally per
|
|
5
|
+
* direction semantic + resolves reached ids to full items via the bulk
|
|
6
|
+
* resolver + returns the composed ContextBundle as one structured payload.
|
|
7
|
+
*
|
|
8
|
+
* Closure scope: this module closes FGAP-031 (gather-execution-context
|
|
9
|
+
* primitive) by composing existing pieces:
|
|
10
|
+
* - filterBlockItems (context-sdk.ts; TASK-034 / Phase 2.1) — locates the
|
|
11
|
+
* context-contract entry by unit_kind without scanning the whole block.
|
|
12
|
+
* - resolveItemsByIds (context-sdk.ts; TASK-035 / Phase 2.2) — cross-block
|
|
13
|
+
* bulk lookup over a single buildIdIndex traversal; used twice (once to
|
|
14
|
+
* read the unit by id, once to resolve reached ids per relation_type).
|
|
15
|
+
* - walkAncestors / walkDescendants / findReferences (context.ts;
|
|
16
|
+
* TASK-036/037 / Phase 2.3/2.4) — closure-table traversal primitives.
|
|
17
|
+
* - loadRelations (context.ts existing) — single substrate read of
|
|
18
|
+
* relations.json reused across every declared relation_type's walk; the
|
|
19
|
+
* traversal primitives operate on the loaded Edge[] in-memory rather
|
|
20
|
+
* than re-reading disk per relation_type.
|
|
21
|
+
*
|
|
22
|
+
* Direction semantics (BundleRelationTypeSpec.direction):
|
|
23
|
+
* "in" — walk inbound chain (walkAncestors) — items that point AT the
|
|
24
|
+
* unit through this relation_type (e.g. constrained_by edges
|
|
25
|
+
* where unit is the constrained child).
|
|
26
|
+
* "out" — walk outbound chain (walkDescendants) — items the unit points
|
|
27
|
+
* AT through this relation_type.
|
|
28
|
+
* "both" — union of in + out as a deduped id set.
|
|
29
|
+
*
|
|
30
|
+
* Depth bound: callers MAY override per-spec.max_depth via args.maxDepth;
|
|
31
|
+
* the effective depth is `Math.min(args.maxDepth, spec.max_depth)`. The
|
|
32
|
+
* traversal primitives themselves are visited-set bounded but not currently
|
|
33
|
+
* depth-bounded (cycle-safe via the visited set); recording the effective
|
|
34
|
+
* depth on the bundle preserves the contract surface for a future
|
|
35
|
+
* depth-bounded variant (FGAP-029 depth-bound territory) without breaking
|
|
36
|
+
* the current callable shape.
|
|
37
|
+
*
|
|
38
|
+
* Error surface: returns `{ error: string }` (NOT throw) for three failure
|
|
39
|
+
* modes:
|
|
40
|
+
* - unit id not found in the cross-block index.
|
|
41
|
+
* - context-contracts read failure (e.g. schema absent / corrupt file).
|
|
42
|
+
* - no context-contract entry matches the requested unit_kind.
|
|
43
|
+
* Other errors (relations.json schema failure, block-file parse failure)
|
|
44
|
+
* propagate as throws via the underlying primitives — these are substrate
|
|
45
|
+
* corruption, not lookup misses.
|
|
46
|
+
*
|
|
47
|
+
* Per DEC-0019 dual-surface pattern: this library function pairs with the
|
|
48
|
+
* gather-execution-context pi tool (index.ts) and the orchestrator script
|
|
49
|
+
* scripts/orchestrator/gather-execution-context.ts; all three ship as one
|
|
50
|
+
* atomic unit. TASK-039 / Phase 3 sub-phase 3.2.
|
|
51
|
+
*/
|
|
52
|
+
/**
|
|
53
|
+
* One entry in a context-contract's bundle_relation_types[] — declares a
|
|
54
|
+
* relation_type to walk, the direction of traversal, the per-relation depth
|
|
55
|
+
* bound, and an optional applicability_predicate (FGAP-010 territory;
|
|
56
|
+
* reserved, not yet consumed by this primitive).
|
|
57
|
+
*/
|
|
58
|
+
export interface BundleRelationTypeSpec {
|
|
59
|
+
relation_type: string;
|
|
60
|
+
direction: "in" | "out" | "both";
|
|
61
|
+
max_depth: number;
|
|
62
|
+
applicability_predicate?: string;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Context-contract block-item shape (matches the registry schema at
|
|
66
|
+
* `packages/pi-context/registry/schemas/context-contracts.schema.json`).
|
|
67
|
+
* Re-declared here at the consumer boundary rather than imported from a
|
|
68
|
+
* generated types module — the schema is the source of truth and the
|
|
69
|
+
* shape is small enough that explicit duplication is cheaper than a
|
|
70
|
+
* codegen step.
|
|
71
|
+
*/
|
|
72
|
+
export interface ContextContract {
|
|
73
|
+
id: string;
|
|
74
|
+
unit_kind: string;
|
|
75
|
+
bundle_relation_types: BundleRelationTypeSpec[];
|
|
76
|
+
description?: string;
|
|
77
|
+
notes?: string;
|
|
78
|
+
created_by: string;
|
|
79
|
+
created_at: string;
|
|
80
|
+
modified_by?: string;
|
|
81
|
+
modified_at?: string;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Composed execution-context bundle returned by gatherExecutionContext.
|
|
85
|
+
*
|
|
86
|
+
* unit — the work-unit item payload as read from its block.
|
|
87
|
+
* perRelationType — map from relation_type to the resolved item payloads
|
|
88
|
+
* reached by walking that relation_type per the
|
|
89
|
+
* contract's direction + depth bound.
|
|
90
|
+
* traversal_depth — the max effective depth applied across all walks
|
|
91
|
+
* (i.e. max over `min(args.maxDepth, spec.max_depth)`).
|
|
92
|
+
* Reflects the bound applied, not the depth actually
|
|
93
|
+
* reached — callers reasoning about reach should
|
|
94
|
+
* inspect perRelationType lengths directly.
|
|
95
|
+
* scoped_at — ISO timestamp at which the bundle was composed;
|
|
96
|
+
* records when the substrate snapshot read happened.
|
|
97
|
+
*/
|
|
98
|
+
export interface ContextBundle {
|
|
99
|
+
unit: Record<string, unknown>;
|
|
100
|
+
perRelationType: Record<string, Record<string, unknown>[]>;
|
|
101
|
+
traversal_depth: number;
|
|
102
|
+
scoped_at: string;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Arguments to gatherExecutionContext. `kind` selects the context-contract
|
|
106
|
+
* entry to apply (by `unit_kind`); `maxDepth` optionally caps every
|
|
107
|
+
* BundleRelationTypeSpec.max_depth via Math.min.
|
|
108
|
+
*/
|
|
109
|
+
export interface GatherExecutionContextArgs {
|
|
110
|
+
unitId: string;
|
|
111
|
+
kind: string;
|
|
112
|
+
maxDepth?: number;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Compose a ContextBundle for `args.unitId` of kind `args.kind`.
|
|
116
|
+
*
|
|
117
|
+
* Steps:
|
|
118
|
+
* 1. Cross-block lookup of the unit item (via the bulk resolver — single
|
|
119
|
+
* buildIdIndex traversal). Missing unit → return `{ error }`.
|
|
120
|
+
* 2. Filter context-contracts.json by `unit_kind == args.kind`. The block
|
|
121
|
+
* read failure surfaces as `{ error }`; missing match also returns
|
|
122
|
+
* `{ error }`. First match wins when multiple contracts share a
|
|
123
|
+
* unit_kind — the schema permits multiple entries but the substrate
|
|
124
|
+
* convention is one contract per unit_kind.
|
|
125
|
+
* 3. Single loadRelations(cwd) read; reused across every declared
|
|
126
|
+
* relation_type walk.
|
|
127
|
+
* 4. For each BundleRelationTypeSpec: compute effective depth, dispatch
|
|
128
|
+
* direction → walkAncestors / walkDescendants / union; resolve the
|
|
129
|
+
* reached id set to full items via resolveItemsByIds (bulk over the
|
|
130
|
+
* already-built index for that relation_type — index is rebuilt per
|
|
131
|
+
* resolveItemsByIds call by current contract).
|
|
132
|
+
* 5. Return ContextBundle with unit + perRelationType map + max effective
|
|
133
|
+
* depth + scoped_at timestamp.
|
|
134
|
+
*/
|
|
135
|
+
export declare function gatherExecutionContext(cwd: string, args: GatherExecutionContextArgs): ContextBundle | {
|
|
136
|
+
error: string;
|
|
137
|
+
};
|
|
138
|
+
//# sourceMappingURL=execution-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution-context.d.ts","sourceRoot":"","sources":["../src/execution-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAKH;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACtC,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,IAAI,GAAG,KAAK,GAAG,MAAM,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,uBAAuB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,qBAAqB,EAAE,sBAAsB,EAAE,CAAC;IAChD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;IAC3D,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,WAAW,0BAA0B;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,sBAAsB,CACrC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,0BAA0B,GAC9B,aAAa,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CA6EnC"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* gatherExecutionContext primitive — work-unit-driven context bundling per
|
|
3
|
+
* DEC-0017. Reads the unit + reads its context-contract (keyed by unit_kind)
|
|
4
|
+
* + walks each declared relation_type in the contract bidirectionally per
|
|
5
|
+
* direction semantic + resolves reached ids to full items via the bulk
|
|
6
|
+
* resolver + returns the composed ContextBundle as one structured payload.
|
|
7
|
+
*
|
|
8
|
+
* Closure scope: this module closes FGAP-031 (gather-execution-context
|
|
9
|
+
* primitive) by composing existing pieces:
|
|
10
|
+
* - filterBlockItems (context-sdk.ts; TASK-034 / Phase 2.1) — locates the
|
|
11
|
+
* context-contract entry by unit_kind without scanning the whole block.
|
|
12
|
+
* - resolveItemsByIds (context-sdk.ts; TASK-035 / Phase 2.2) — cross-block
|
|
13
|
+
* bulk lookup over a single buildIdIndex traversal; used twice (once to
|
|
14
|
+
* read the unit by id, once to resolve reached ids per relation_type).
|
|
15
|
+
* - walkAncestors / walkDescendants / findReferences (context.ts;
|
|
16
|
+
* TASK-036/037 / Phase 2.3/2.4) — closure-table traversal primitives.
|
|
17
|
+
* - loadRelations (context.ts existing) — single substrate read of
|
|
18
|
+
* relations.json reused across every declared relation_type's walk; the
|
|
19
|
+
* traversal primitives operate on the loaded Edge[] in-memory rather
|
|
20
|
+
* than re-reading disk per relation_type.
|
|
21
|
+
*
|
|
22
|
+
* Direction semantics (BundleRelationTypeSpec.direction):
|
|
23
|
+
* "in" — walk inbound chain (walkAncestors) — items that point AT the
|
|
24
|
+
* unit through this relation_type (e.g. constrained_by edges
|
|
25
|
+
* where unit is the constrained child).
|
|
26
|
+
* "out" — walk outbound chain (walkDescendants) — items the unit points
|
|
27
|
+
* AT through this relation_type.
|
|
28
|
+
* "both" — union of in + out as a deduped id set.
|
|
29
|
+
*
|
|
30
|
+
* Depth bound: callers MAY override per-spec.max_depth via args.maxDepth;
|
|
31
|
+
* the effective depth is `Math.min(args.maxDepth, spec.max_depth)`. The
|
|
32
|
+
* traversal primitives themselves are visited-set bounded but not currently
|
|
33
|
+
* depth-bounded (cycle-safe via the visited set); recording the effective
|
|
34
|
+
* depth on the bundle preserves the contract surface for a future
|
|
35
|
+
* depth-bounded variant (FGAP-029 depth-bound territory) without breaking
|
|
36
|
+
* the current callable shape.
|
|
37
|
+
*
|
|
38
|
+
* Error surface: returns `{ error: string }` (NOT throw) for three failure
|
|
39
|
+
* modes:
|
|
40
|
+
* - unit id not found in the cross-block index.
|
|
41
|
+
* - context-contracts read failure (e.g. schema absent / corrupt file).
|
|
42
|
+
* - no context-contract entry matches the requested unit_kind.
|
|
43
|
+
* Other errors (relations.json schema failure, block-file parse failure)
|
|
44
|
+
* propagate as throws via the underlying primitives — these are substrate
|
|
45
|
+
* corruption, not lookup misses.
|
|
46
|
+
*
|
|
47
|
+
* Per DEC-0019 dual-surface pattern: this library function pairs with the
|
|
48
|
+
* gather-execution-context pi tool (index.ts) and the orchestrator script
|
|
49
|
+
* scripts/orchestrator/gather-execution-context.ts; all three ship as one
|
|
50
|
+
* atomic unit. TASK-039 / Phase 3 sub-phase 3.2.
|
|
51
|
+
*/
|
|
52
|
+
import { loadRelations, walkAncestors, walkDescendants } from "./context.js";
|
|
53
|
+
import { filterBlockItems, resolveItemsByIds } from "./context-sdk.js";
|
|
54
|
+
/**
|
|
55
|
+
* Compose a ContextBundle for `args.unitId` of kind `args.kind`.
|
|
56
|
+
*
|
|
57
|
+
* Steps:
|
|
58
|
+
* 1. Cross-block lookup of the unit item (via the bulk resolver — single
|
|
59
|
+
* buildIdIndex traversal). Missing unit → return `{ error }`.
|
|
60
|
+
* 2. Filter context-contracts.json by `unit_kind == args.kind`. The block
|
|
61
|
+
* read failure surfaces as `{ error }`; missing match also returns
|
|
62
|
+
* `{ error }`. First match wins when multiple contracts share a
|
|
63
|
+
* unit_kind — the schema permits multiple entries but the substrate
|
|
64
|
+
* convention is one contract per unit_kind.
|
|
65
|
+
* 3. Single loadRelations(cwd) read; reused across every declared
|
|
66
|
+
* relation_type walk.
|
|
67
|
+
* 4. For each BundleRelationTypeSpec: compute effective depth, dispatch
|
|
68
|
+
* direction → walkAncestors / walkDescendants / union; resolve the
|
|
69
|
+
* reached id set to full items via resolveItemsByIds (bulk over the
|
|
70
|
+
* already-built index for that relation_type — index is rebuilt per
|
|
71
|
+
* resolveItemsByIds call by current contract).
|
|
72
|
+
* 5. Return ContextBundle with unit + perRelationType map + max effective
|
|
73
|
+
* depth + scoped_at timestamp.
|
|
74
|
+
*/
|
|
75
|
+
export function gatherExecutionContext(cwd, args) {
|
|
76
|
+
// 1. Read the unit by id (cross-block via the bulk resolver — single
|
|
77
|
+
// buildIdIndex traversal even for the singleton lookup; same
|
|
78
|
+
// contract as resolveItemById, just the bulk surface).
|
|
79
|
+
const unitMap = resolveItemsByIds(cwd, [args.unitId]);
|
|
80
|
+
const unitLoc = unitMap.get(args.unitId);
|
|
81
|
+
if (!unitLoc)
|
|
82
|
+
return { error: `unit not found: ${args.unitId}` };
|
|
83
|
+
const unit = unitLoc.item;
|
|
84
|
+
// 2. Look up the context-contract by unit_kind. filterBlockItems throws
|
|
85
|
+
// on substrate read / schema failure — convert that to an error
|
|
86
|
+
// return so the tool surface doesn't propagate substrate-corruption
|
|
87
|
+
// style throws as unhandled.
|
|
88
|
+
let contracts;
|
|
89
|
+
try {
|
|
90
|
+
contracts = filterBlockItems(cwd, "context-contracts", {
|
|
91
|
+
field: "unit_kind",
|
|
92
|
+
op: "eq",
|
|
93
|
+
value: args.kind,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
catch (err) {
|
|
97
|
+
return {
|
|
98
|
+
error: `context-contracts read failed: ${err instanceof Error ? err.message : String(err)}`,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
if (contracts.length === 0) {
|
|
102
|
+
return { error: `no context-contract for kind: ${args.kind}` };
|
|
103
|
+
}
|
|
104
|
+
const contract = contracts[0];
|
|
105
|
+
// 3. Single relations.json read; reused across every relation_type walk.
|
|
106
|
+
const edges = loadRelations(cwd);
|
|
107
|
+
// 4. Walk each declared relation_type per direction, resolve reached
|
|
108
|
+
// ids to full items, accumulate perRelationType buckets.
|
|
109
|
+
const perRelationType = {};
|
|
110
|
+
let maxDepthSeen = 0;
|
|
111
|
+
for (const spec of contract.bundle_relation_types) {
|
|
112
|
+
const effectiveDepth = args.maxDepth !== undefined ? Math.min(args.maxDepth, spec.max_depth) : spec.max_depth;
|
|
113
|
+
maxDepthSeen = Math.max(maxDepthSeen, effectiveDepth);
|
|
114
|
+
let reachedIds;
|
|
115
|
+
if (spec.direction === "in") {
|
|
116
|
+
reachedIds = walkAncestors(args.unitId, spec.relation_type, edges);
|
|
117
|
+
}
|
|
118
|
+
else if (spec.direction === "out") {
|
|
119
|
+
reachedIds = walkDescendants(args.unitId, spec.relation_type, edges);
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
// "both" — deduped union of inbound + outbound id chains.
|
|
123
|
+
const inIds = walkAncestors(args.unitId, spec.relation_type, edges);
|
|
124
|
+
const outIds = walkDescendants(args.unitId, spec.relation_type, edges);
|
|
125
|
+
reachedIds = Array.from(new Set([...inIds, ...outIds]));
|
|
126
|
+
}
|
|
127
|
+
if (reachedIds.length === 0) {
|
|
128
|
+
perRelationType[spec.relation_type] = [];
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
// Bulk resolve reached ids; preserve traversal-order in the output
|
|
132
|
+
// bucket. Unresolvable ids (e.g. dangling edges referencing items
|
|
133
|
+
// not present in any block) are dropped silently — the bucket
|
|
134
|
+
// reflects the substrate-resolved subset, not the edge set.
|
|
135
|
+
const itemMap = resolveItemsByIds(cwd, reachedIds);
|
|
136
|
+
const items = [];
|
|
137
|
+
for (const id of reachedIds) {
|
|
138
|
+
const loc = itemMap.get(id);
|
|
139
|
+
if (loc)
|
|
140
|
+
items.push(loc.item);
|
|
141
|
+
}
|
|
142
|
+
perRelationType[spec.relation_type] = items;
|
|
143
|
+
}
|
|
144
|
+
return {
|
|
145
|
+
unit: unit,
|
|
146
|
+
perRelationType,
|
|
147
|
+
traversal_depth: maxDepthSeen,
|
|
148
|
+
scoped_at: new Date().toISOString(),
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=execution-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution-context.js","sourceRoot":"","sources":["../src/execution-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAEH,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAoEvE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,sBAAsB,CACrC,GAAW,EACX,IAAgC;IAEhC,qEAAqE;IACrE,gEAAgE;IAChE,0DAA0D;IAC1D,MAAM,OAAO,GAAG,iBAAiB,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IACtD,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACzC,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,KAAK,EAAE,mBAAmB,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;IACjE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAE1B,wEAAwE;IACxE,mEAAmE;IACnE,uEAAuE;IACvE,gCAAgC;IAChC,IAAI,SAAoB,CAAC;IACzB,IAAI,CAAC;QACJ,SAAS,GAAG,gBAAgB,CAAC,GAAG,EAAE,mBAAmB,EAAE;YACtD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
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
/**
|
|
3
|
+
* Result shape from installContext. installed/updated/skipped/notFound carry
|
|
4
|
+
* relative-to-project-root destination paths (schemas/<name>.schema.json or
|
|
5
|
+
* <name>.json). error is set only when no .project/config.json exists.
|
|
6
|
+
*/
|
|
7
|
+
export interface InstallResult {
|
|
8
|
+
error?: string;
|
|
9
|
+
installed: string[];
|
|
10
|
+
updated: string[];
|
|
11
|
+
skipped: string[];
|
|
12
|
+
notFound: string[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* /context install opt-in mechanism (DEC-0011). Reads config.installed_schemas
|
|
16
|
+
* and config.installed_blocks, copies declared assets from the package
|
|
17
|
+
* samples catalog (samples/, keyed by conception.json's block_kinds) into the
|
|
18
|
+
* project's substrate root + schemas dir.
|
|
19
|
+
*
|
|
20
|
+
* - Default behavior is skip-if-exists. With overwrite=true, replaces the
|
|
21
|
+
* destination file and reports as "updated" rather than "installed".
|
|
22
|
+
* - Sources missing from the samples catalog are reported as "notFound".
|
|
23
|
+
* - Empty install lists are not an error — the result is a clean no-op.
|
|
24
|
+
*/
|
|
25
|
+
export declare function installContext(cwd: string, options?: {
|
|
26
|
+
overwrite?: boolean;
|
|
27
|
+
}): InstallResult;
|
|
28
|
+
declare const extension: (pi: ExtensionAPI) => void;
|
|
29
|
+
export default extension;
|
|
30
|
+
export type { CompleteTaskResult, ItemLocation } from "./context-sdk.js";
|
|
31
|
+
export { blockStructure, buildIdIndex, CONTEXT_BLOCK_TYPES, completeTask, findAppendableBlocks, resolveItemById, schemaInfo, schemaVocabulary, } from "./context-sdk.js";
|
|
32
|
+
export { type RenameKind, type RenameReport, renameCanonicalId } from "./rename-canonical-id.js";
|
|
33
|
+
export { listRoadmaps, loadRoadmap, type PhaseSpec, type PhaseStatus, type PhaseView, type RoadmapSpec, type RoadmapView, renderRoadmap, resolveStatusVocabulary, rollupPhaseStatus, topoSort, validateRoadmaps, } from "./roadmap-plan.js";
|
|
34
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAGX,YAAY,EAGZ,MAAM,iCAAiC,CAAC;AA0QzC;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,aAAa,CAoFhG;AAiED,QAAA,MAAM,SAAS,GAAI,IAAI,YAAY,SAouDlC,CAAC;AAEF,eAAe,SAAS,CAAC;AAEzB,YAAY,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEzE,OAAO,EACN,cAAc,EACd,YAAY,EACZ,mBAAmB,EACnB,YAAY,EACZ,oBAAoB,EACpB,eAAe,EACf,UAAU,EACV,gBAAgB,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,YAAY,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACjG,OAAO,EACN,YAAY,EACZ,WAAW,EACX,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,aAAa,EACb,uBAAuB,EACvB,iBAAiB,EACjB,QAAQ,EACR,gBAAgB,GAChB,MAAM,mBAAmB,CAAC"}
|