@tacuchi/agent-workflow-cli 21.0.0 → 21.1.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 +1 -0
- package/dist/application/capability/compose.js +161 -0
- package/dist/application/capability/compose.js.map +1 -0
- package/dist/application/capability/descriptor-loader.js +109 -0
- package/dist/application/capability/descriptor-loader.js.map +1 -0
- package/dist/application/capability/design-handler.js +299 -0
- package/dist/application/capability/design-handler.js.map +1 -0
- package/dist/application/capability/dispatcher.js +312 -0
- package/dist/application/capability/dispatcher.js.map +1 -0
- package/dist/application/capability/durable-effect.js +220 -0
- package/dist/application/capability/durable-effect.js.map +1 -0
- package/dist/application/capability/installed-inventory.js +168 -0
- package/dist/application/capability/installed-inventory.js.map +1 -0
- package/dist/application/capability/readiness.js +204 -0
- package/dist/application/capability/readiness.js.map +1 -0
- package/dist/application/capability/resolution.js +264 -0
- package/dist/application/capability/resolution.js.map +1 -0
- package/dist/application/capability/wrapper.js +187 -0
- package/dist/application/capability/wrapper.js.map +1 -0
- package/dist/application/context/manifest.js +11 -5
- package/dist/application/context/manifest.js.map +1 -1
- package/dist/application/context/measure.js +5 -2
- package/dist/application/context/measure.js.map +1 -1
- package/dist/application/context/plan-service.js +6 -6
- package/dist/application/context/plan-service.js.map +1 -1
- package/dist/application/design/design-bundle-service.js +148 -0
- package/dist/application/design/design-bundle-service.js.map +1 -0
- package/dist/application/design/design-proposal-service.js +69 -0
- package/dist/application/design/design-proposal-service.js.map +1 -0
- package/dist/application/design/design-publish-service.js +275 -7
- package/dist/application/design/design-publish-service.js.map +1 -1
- package/dist/application/design/design-record-service.js +100 -0
- package/dist/application/design/design-record-service.js.map +1 -0
- package/dist/application/flow/advance.js +533 -0
- package/dist/application/flow/advance.js.map +1 -0
- package/dist/application/flow/flow-service.js +65 -0
- package/dist/application/flow/flow-service.js.map +1 -0
- package/dist/application/flow/run-projection.js +80 -0
- package/dist/application/flow/run-projection.js.map +1 -0
- package/dist/application/flow/run-state-service.js +107 -0
- package/dist/application/flow/run-state-service.js.map +1 -0
- package/dist/application/flow/submit.js +423 -0
- package/dist/application/flow/submit.js.map +1 -0
- package/dist/application/resume-service.js +23 -10
- package/dist/application/resume-service.js.map +1 -1
- package/dist/application/self/install-skill.js +11 -0
- package/dist/application/self/install-skill.js.map +1 -1
- package/dist/application/self/uninstall.js +21 -0
- package/dist/application/self/uninstall.js.map +1 -1
- package/dist/application/skills-resolver-service.js +8 -2
- package/dist/application/skills-resolver-service.js.map +1 -1
- package/dist/application/status-service.js +4 -1
- package/dist/application/status-service.js.map +1 -1
- package/dist/application/workspace-init-service.js +13 -1
- package/dist/application/workspace-init-service.js.map +1 -1
- package/dist/cli/commands/capability.js +182 -0
- package/dist/cli/commands/capability.js.map +1 -0
- package/dist/cli/commands/flow.js +71 -0
- package/dist/cli/commands/flow.js.map +1 -0
- package/dist/cli/commands/index.js +4 -0
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/skills.js +55 -2
- package/dist/cli/commands/skills.js.map +1 -1
- package/dist/cli/commands/status.js +5 -0
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/help-groups.js +6 -0
- package/dist/cli/help-groups.js.map +1 -1
- package/dist/cli/parser.js +6 -0
- package/dist/cli/parser.js.map +1 -1
- package/dist/cli/tui/data/workflow-content.js +5 -0
- package/dist/cli/tui/data/workflow-content.js.map +1 -1
- package/dist/cli/tui/tabs/workflow-tab.js +5 -1
- package/dist/cli/tui/tabs/workflow-tab.js.map +1 -1
- package/dist/domain/capability/descriptor.js +553 -0
- package/dist/domain/capability/descriptor.js.map +1 -0
- package/dist/domain/capability/effects.js +90 -0
- package/dist/domain/capability/effects.js.map +1 -0
- package/dist/domain/capability/protocol.js +494 -0
- package/dist/domain/capability/protocol.js.map +1 -0
- package/dist/domain/contract-reader.js +84 -0
- package/dist/domain/contract-reader.js.map +1 -0
- package/dist/domain/design/adapter.js +161 -0
- package/dist/domain/design/adapter.js.map +1 -0
- package/dist/domain/design/artifact.js +148 -4
- package/dist/domain/design/artifact.js.map +1 -1
- package/dist/domain/design/capability.js +263 -4
- package/dist/domain/design/capability.js.map +1 -1
- package/dist/domain/design/direct.js +108 -0
- package/dist/domain/design/direct.js.map +1 -0
- package/dist/domain/design/external-send.js +65 -0
- package/dist/domain/design/external-send.js.map +1 -0
- package/dist/domain/design/maturity.js +71 -0
- package/dist/domain/design/maturity.js.map +1 -1
- package/dist/domain/design/offline.js +92 -0
- package/dist/domain/design/offline.js.map +1 -0
- package/dist/domain/design/profiles.js +212 -0
- package/dist/domain/design/profiles.js.map +1 -0
- package/dist/domain/design/proposal.js +234 -0
- package/dist/domain/design/proposal.js.map +1 -0
- package/dist/domain/design/render-bundle.js +0 -0
- package/dist/domain/design/render-bundle.js.map +1 -0
- package/dist/domain/design/rendition.js +472 -0
- package/dist/domain/design/rendition.js.map +1 -0
- package/dist/domain/design/sources.js +180 -0
- package/dist/domain/design/sources.js.map +1 -0
- package/dist/domain/design/validation.js +12 -68
- package/dist/domain/design/validation.js.map +1 -1
- package/dist/domain/design/visual-evidence.js +155 -0
- package/dist/domain/design/visual-evidence.js.map +1 -0
- package/dist/domain/flow/answer.js +459 -0
- package/dist/domain/flow/answer.js.map +1 -0
- package/dist/domain/flow/authority.js +2276 -0
- package/dist/domain/flow/authority.js.map +1 -0
- package/dist/domain/flow/authorization.js +62 -0
- package/dist/domain/flow/authorization.js.map +1 -0
- package/dist/domain/flow/directive.js +421 -0
- package/dist/domain/flow/directive.js.map +1 -0
- package/dist/domain/flow/rules.js +140 -0
- package/dist/domain/flow/rules.js.map +1 -0
- package/dist/domain/flow/run-state.js +317 -0
- package/dist/domain/flow/run-state.js.map +1 -0
- package/dist/domain/harnesses.js +21 -0
- package/dist/domain/harnesses.js.map +1 -1
- package/dist/domain/skills.js +13 -14
- package/dist/domain/skills.js.map +1 -1
- package/package.json +1 -1
- package/skills/w/SKILL.md +5 -5
- package/skills/w/context/MANIFEST.json +38 -1
- package/skills/w/harness/HARNESS.md +20 -0
- package/skills/w/loops/CHASSIS.md +11 -20
- package/skills/w/loops/CODE-POLICIES.md +9 -15
- package/skills/w/loops/plan-exec-loop/LOOP.md +11 -13
- package/skills/w/loops/plan-new-loop/LOOP.md +6 -4
- package/skills/w/loops/plan-refine-loop/LOOP.md +5 -3
- package/skills/w/loops/quick-loop/LOOP.md +18 -26
- package/skills/w/loops/spec-refine-loop/LOOP.md +14 -18
- package/skills/w/modules/COMPACTION.md +2 -6
- package/skills/w/modules/DB-SCRIPTS-ONLY.md +2 -0
- package/skills/w/modules/DESIGN-REFERENCES.md +15 -11
- package/skills/w/modules/IDEATION-GATE.md +3 -3
- package/skills/w/modules/PLAN-EXECUTION-BATCHES.md +17 -36
- package/skills/w/modules/PLAN-INPUT.md +5 -3
- package/skills/w/modules/PLAN-REFINE-SPLIT.md +3 -1
- package/skills/w/modules/PLAN-SPLIT-GATE.md +7 -5
- package/skills/w/modules/PROMPT-CONTINUITY.md +3 -1
- package/skills/w/modules/SPEC-CHANGE-SHAPE.md +4 -4
- package/skills/w/roles/README.md +2 -0
- package/skills/w/roles/design/CONTRACT.md +80 -0
- package/skills/w/roles/design/ROLE.md +7 -0
- package/skills/w/schemas/capability-descriptor.schema.json +260 -0
- package/skills/w/schemas/design/design-render-bundle.v1.schema.json +191 -0
- package/skills/w/schemas/design/design-rendition.v1.schema.json +232 -0
- package/skills/w/schemas/design/ui-screen.v1.schema.json +29 -1
package/README.md
CHANGED
|
@@ -156,6 +156,7 @@ Workspace artifacts live under `.<namespace>/`. Resolution order (first match wi
|
|
|
156
156
|
- `skills` — show resolved capability → skill bindings.
|
|
157
157
|
- `sessions` / `session-create --type <research|refine|exec|quick>` / `session-close` / `session-resume` / `session-artifacts` — internal session lifecycle (used by the loops).
|
|
158
158
|
- `checkpoint-read` / `checkpoint-write` — `CHECKPOINT.md` handling.
|
|
159
|
+
- `flow <advance|submit>` — the direction engine: `advance` applies every consecutive `cli`-owned transition of a flow run and returns the directive of the first non-deterministic frontier; `submit` takes the response as JSON via stdin (`--approval <digest>` for effects) and keeps advancing.
|
|
159
160
|
- `sources` / `check-branch` / `set-working-branch` / `set-qa-branch` — multi-source git-safety (per-source base / working / QA branches).
|
|
160
161
|
- `git-flow <sync|to-dev|to-qa|to-prod> [--source|--all] [--target] [--dry-run]` — run the per-source branch flows (sync working ← base, promote to dev/QA/prod) with conflict-pause; `--all` processes every source and reports each one. Also surfaced as Project-tab actions.
|
|
161
162
|
- `release-data` — corpus reader backing the `export-*` skills.
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a flow composes a capability without handing over its own lifecycle.
|
|
3
|
+
*
|
|
4
|
+
* A flow reaches the SAME dispatcher, builder, handlers and receipt the direct
|
|
5
|
+
* wrapper reaches. What changes is who owns the conversation: the capability
|
|
6
|
+
* hands back requirements, output, validations, gaps and a receipt; the FLOW
|
|
7
|
+
* turns a `needs_input` into its own structured-choice, keeps its session, its
|
|
8
|
+
* gates, its references and its publication, and decides when it is done.
|
|
9
|
+
*
|
|
10
|
+
* The map below is the whole authorization. It is exhaustive and it is DATA:
|
|
11
|
+
*
|
|
12
|
+
* - **SPEC REFINE** authors — `create`, `update`, `validate`.
|
|
13
|
+
* - **PLAN NEW / PLAN REFINE** may revise the design their plan closes over —
|
|
14
|
+
* `update`, `validate` — but never start one from nothing.
|
|
15
|
+
* - **PLAN EXEC / QUICK** only `validate`, and then consume the package inside
|
|
16
|
+
* their own lifecycle. There is deliberately no sixth `consume` operation:
|
|
17
|
+
* consuming is what the FLOW does with a validated package, not something it
|
|
18
|
+
* asks the capability to do for it.
|
|
19
|
+
*
|
|
20
|
+
* Entries are `capability.operation`, so a second capability adds its own rows
|
|
21
|
+
* and the flows that do not consume it are untouched — a table, never a branch.
|
|
22
|
+
*/
|
|
23
|
+
import { satisfiesCompletenessGate } from "../../domain/capability/protocol.js";
|
|
24
|
+
import { resolveDesignPackage } from "../design/design-index-service.js";
|
|
25
|
+
import { dispatchCapability, } from "./dispatcher.js";
|
|
26
|
+
export const WORKLINE_FLOWS = [
|
|
27
|
+
"spec-refine",
|
|
28
|
+
"plan-new",
|
|
29
|
+
"plan-refine",
|
|
30
|
+
"plan-exec",
|
|
31
|
+
"quick",
|
|
32
|
+
];
|
|
33
|
+
export const COMPOSED_OPERATIONS = {
|
|
34
|
+
"spec-refine": ["design.create", "design.update", "design.validate"],
|
|
35
|
+
"plan-new": ["design.update", "design.validate"],
|
|
36
|
+
"plan-refine": ["design.update", "design.validate"],
|
|
37
|
+
"plan-exec": ["design.validate"],
|
|
38
|
+
quick: ["design.validate"],
|
|
39
|
+
};
|
|
40
|
+
export function composedOperationsOf(flow) {
|
|
41
|
+
return COMPOSED_OPERATIONS[flow];
|
|
42
|
+
}
|
|
43
|
+
export function mayCompose(flow, capability, operation) {
|
|
44
|
+
return COMPOSED_OPERATIONS[flow].includes(`${capability}.${operation}`);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* THE composed adapter. Every flow goes through it, and it refuses anything the
|
|
48
|
+
* map does not authorize instead of improvising a wider surface.
|
|
49
|
+
*
|
|
50
|
+
* `route` and `flow` are forced here rather than accepted from the caller: a
|
|
51
|
+
* flow that could declare itself `direct` would be a flow that escapes its own
|
|
52
|
+
* boundary, and the receipt would name the wrong caller.
|
|
53
|
+
*/
|
|
54
|
+
export async function composeCapability(input, ctx) {
|
|
55
|
+
const operation = input.operation ?? input.parent?.operation ?? null;
|
|
56
|
+
if (operation === null) {
|
|
57
|
+
return {
|
|
58
|
+
ok: false,
|
|
59
|
+
failure: {
|
|
60
|
+
code: "CAPABILITY_COMPOSE_OPERATION_MISSING",
|
|
61
|
+
message: `'${input.flow}' tiene que nombrar la operación que compone`,
|
|
62
|
+
action: `usá una de: ${composedOperationsOf(input.flow).join(", ")}`,
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
if (!mayCompose(input.flow, input.capability, operation)) {
|
|
67
|
+
return {
|
|
68
|
+
ok: false,
|
|
69
|
+
failure: {
|
|
70
|
+
code: "CAPABILITY_COMPOSE_NOT_ALLOWED",
|
|
71
|
+
message: `'${input.flow}' no compone '${input.capability}.${operation}'`,
|
|
72
|
+
action: `desde este flow solo: ${composedOperationsOf(input.flow).join(", ") || "(ninguna)"}`,
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
return dispatchCapability({ ...input, route: "compose", flow: input.flow }, ctx);
|
|
77
|
+
}
|
|
78
|
+
export function composeGates(attempt, flowGates, options = {}) {
|
|
79
|
+
if (!attempt.ok)
|
|
80
|
+
return { ok: false, failure: attempt.failure };
|
|
81
|
+
if (options.requireCompleteness === true && !satisfiesCompletenessGate(attempt.attempt.receipt)) {
|
|
82
|
+
return {
|
|
83
|
+
ok: false,
|
|
84
|
+
failure: {
|
|
85
|
+
code: "CAPABILITY_OUTPUT_INCOMPLETE",
|
|
86
|
+
message: `'${input(attempt)}' devolvió un output que no cubre el perfil pedido`,
|
|
87
|
+
action: "completá el package antes de consumirlo: un parcial no satisface este gate",
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
const capabilityGates = attempt.attempt.receipt.validations.map((v) => ({
|
|
92
|
+
id: v.id,
|
|
93
|
+
passed: v.passed,
|
|
94
|
+
}));
|
|
95
|
+
const overridden = flowGates.filter((g) => capabilityGates.some((c) => c.id === g.id && !c.passed && g.passed));
|
|
96
|
+
if (overridden.length > 0) {
|
|
97
|
+
return {
|
|
98
|
+
ok: false,
|
|
99
|
+
failure: {
|
|
100
|
+
code: "CAPABILITY_GATE_LOWERED",
|
|
101
|
+
message: `el flow declara en verde una validación que la capacidad reprobó: ${overridden
|
|
102
|
+
.map((g) => g.id)
|
|
103
|
+
.join(", ")}`,
|
|
104
|
+
action: "corregí el output, o sumá un gate propio en vez de reescribir el ajeno",
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
return { ok: true, gates: [...capabilityGates, ...flowGates] };
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Adopt an output that the DIRECT route produced, by exact reference.
|
|
112
|
+
*
|
|
113
|
+
* The identity, the revision and the digest are what get checked; the locator is
|
|
114
|
+
* a hint that may have gone stale without costing anything. Nothing is recreated
|
|
115
|
+
* and nothing is converted — a flow that rebuilt the package would produce a
|
|
116
|
+
* second artifact claiming to be the first, and the two would drift the moment
|
|
117
|
+
* either changed.
|
|
118
|
+
*/
|
|
119
|
+
export function adoptDurableReference(reference, index) {
|
|
120
|
+
const entry = resolveDesignPackage(index, reference.id);
|
|
121
|
+
if (entry === null) {
|
|
122
|
+
return {
|
|
123
|
+
ok: false,
|
|
124
|
+
failure: {
|
|
125
|
+
code: "CAPABILITY_ADOPTION_NOT_FOUND",
|
|
126
|
+
message: `no hay ningún package con identidad ${reference.id}`,
|
|
127
|
+
action: "revisá que el output directo se haya publicado en este workspace",
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
if (reference.revision !== null && entry.current_baseline?.revision !== reference.revision) {
|
|
132
|
+
return {
|
|
133
|
+
ok: false,
|
|
134
|
+
failure: {
|
|
135
|
+
code: "CAPABILITY_ADOPTION_REVISION_MISMATCH",
|
|
136
|
+
message: `${reference.id} está en r${entry.current_baseline?.revision ?? "—"} y la referencia dice r${reference.revision}`,
|
|
137
|
+
action: "adoptá la revisión vigente, o volvé a referenciar la que corresponde",
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
if (entry.current_baseline !== null && entry.current_baseline.digest !== reference.digest) {
|
|
142
|
+
return {
|
|
143
|
+
ok: false,
|
|
144
|
+
failure: {
|
|
145
|
+
code: "CAPABILITY_ADOPTION_DIGEST_MISMATCH",
|
|
146
|
+
message: `${reference.id} ya no tiene los bytes que la referencia sella`,
|
|
147
|
+
action: "re-resolvé la referencia: lo publicado cambió después de producirla",
|
|
148
|
+
},
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
// Same identity, same revision, same digest: adopted as it is.
|
|
152
|
+
return { ok: true, reference, entry };
|
|
153
|
+
}
|
|
154
|
+
function input(attempt) {
|
|
155
|
+
return `${attempt.attempt.receipt.capability}.${attempt.attempt.receipt.operation}`;
|
|
156
|
+
}
|
|
157
|
+
/** The request a flow passes on, unchanged — proof it shared, not re-derived. */
|
|
158
|
+
export function composedRequestOf(result) {
|
|
159
|
+
return result.ok ? result.attempt.request : null;
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=compose.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose.js","sourceRoot":"","sources":["../../../src/application/capability/compose.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAGhF,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEzE,OAAO,EAIL,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,aAAa;IACb,UAAU;IACV,aAAa;IACb,WAAW;IACX,OAAO;CACC,CAAC;AAIX,MAAM,CAAC,MAAM,mBAAmB,GAAsD;IACpF,aAAa,EAAE,CAAC,eAAe,EAAE,eAAe,EAAE,iBAAiB,CAAC;IACpE,UAAU,EAAE,CAAC,eAAe,EAAE,iBAAiB,CAAC;IAChD,aAAa,EAAE,CAAC,eAAe,EAAE,iBAAiB,CAAC;IACnD,WAAW,EAAE,CAAC,iBAAiB,CAAC;IAChC,KAAK,EAAE,CAAC,iBAAiB,CAAC;CAC3B,CAAC;AAEF,MAAM,UAAU,oBAAoB,CAAC,IAAkB;IACrD,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,IAAkB,EAAE,UAAkB,EAAE,SAAiB;IAClF,OAAO,mBAAmB,CAAC,I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AK,EAAE,CAAC;AACxC,CAAC;AAED,SAAS,KAAK,CAAC,OAA8C;IAC3D,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;AACtF,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,iBAAiB,CAAC,MAAsB;IACtD,OAAO,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reading the descriptor an installed skill claims to satisfy.
|
|
3
|
+
*
|
|
4
|
+
* The claim crosses a trust boundary: the frontmatter and the JSON next to it
|
|
5
|
+
* were authored by whoever wrote the skill, and nothing about being installed
|
|
6
|
+
* makes either of them true. So the loader verifies before it believes, in this
|
|
7
|
+
* order, and stops at the first failure:
|
|
8
|
+
*
|
|
9
|
+
* 1. the metadata key exists — its absence is not an error, it means the skill
|
|
10
|
+
* is ambient and gets no Workline surface;
|
|
11
|
+
* 2. the locator is a confined relative path to a `.json`, sealed with a digest;
|
|
12
|
+
* 3. the resolved file is a real file inside the skill's own directory and NOT a
|
|
13
|
+
* symlink — a link is how a confined path reaches outside anyway;
|
|
14
|
+
* 4. the bytes produce the sealed digest;
|
|
15
|
+
* 5. the contract version is one this CLI implements, checked before any other
|
|
16
|
+
* field is read.
|
|
17
|
+
*
|
|
18
|
+
* A failure never loads partially and never touches a binding.
|
|
19
|
+
*/
|
|
20
|
+
import { join } from "node:path";
|
|
21
|
+
import { CAPABILITY_DESCRIPTOR_METADATA_KEY, parseDescriptorLocator, verifyDescriptorPayload, } from "../../domain/capability/descriptor.js";
|
|
22
|
+
import { getSkillVersion, parseSkillFrontmatter } from "../../domain/skill-frontmatter.js";
|
|
23
|
+
/** Read a skill's `SKILL.md` head. Returns null when there is no readable one. */
|
|
24
|
+
export async function readSkillHead(fs, skillDir, dirName) {
|
|
25
|
+
const skillMd = join(skillDir, "SKILL.md");
|
|
26
|
+
if (!(await fs.exists(skillMd)))
|
|
27
|
+
return null;
|
|
28
|
+
let text;
|
|
29
|
+
try {
|
|
30
|
+
text = await fs.readText(skillMd);
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
const fm = parseSkillFrontmatter(text);
|
|
36
|
+
if (fm === null)
|
|
37
|
+
return null;
|
|
38
|
+
return {
|
|
39
|
+
name: fm.fields.name?.trim() || dirName,
|
|
40
|
+
version: getSkillVersion(fm),
|
|
41
|
+
locatorValue: fm.metadata[CAPABILITY_DESCRIPTOR_METADATA_KEY] ?? null,
|
|
42
|
+
skillMd,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export async function loadDescriptor(fs, skillDir, head) {
|
|
46
|
+
if (head.locatorValue === null)
|
|
47
|
+
return { state: "absent" };
|
|
48
|
+
const parsed = parseDescriptorLocator(head.locatorValue);
|
|
49
|
+
if (!parsed.ok) {
|
|
50
|
+
return {
|
|
51
|
+
state: "invalid",
|
|
52
|
+
failure: { code: parsed.code, message: parsed.message, action: parsed.action },
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
const absolute = join(skillDir, parsed.locator.path);
|
|
56
|
+
const link = await fs.lstat(absolute);
|
|
57
|
+
if (link === null) {
|
|
58
|
+
return {
|
|
59
|
+
state: "invalid",
|
|
60
|
+
failure: {
|
|
61
|
+
code: "CAPABILITY_DESCRIPTOR_MISSING",
|
|
62
|
+
message: `'${head.name}' declara un descriptor en '${parsed.locator.path}' y ahí no hay nada`,
|
|
63
|
+
action: "publicá el descriptor junto al SKILL.md, o quitá la clave de metadata",
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
// A confined relative path still lands outside if the target is a link. The
|
|
68
|
+
// containment rule is about WHICH BYTES get read, not about how the path looks.
|
|
69
|
+
if (link.isSymlink || link.type !== "file") {
|
|
70
|
+
return {
|
|
71
|
+
state: "invalid",
|
|
72
|
+
failure: {
|
|
73
|
+
code: "CAPABILITY_DESCRIPTOR_NOT_CONFINED",
|
|
74
|
+
message: `'${parsed.locator.path}' no es un archivo dentro del directorio de la skill`,
|
|
75
|
+
action: "publicá el descriptor como archivo real, sin enlaces simbólicos",
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
let bytes;
|
|
80
|
+
try {
|
|
81
|
+
bytes = await fs.readText(absolute);
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
return {
|
|
85
|
+
state: "invalid",
|
|
86
|
+
failure: {
|
|
87
|
+
code: "CAPABILITY_DESCRIPTOR_UNREADABLE",
|
|
88
|
+
message: `no se pudo leer '${parsed.locator.path}'`,
|
|
89
|
+
action: "revisá permisos del archivo del descriptor",
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
const verified = verifyDescriptorPayload(parsed.locator, bytes);
|
|
94
|
+
if (!verified.ok) {
|
|
95
|
+
return {
|
|
96
|
+
state: "invalid",
|
|
97
|
+
failure: { code: verified.code, message: verified.message, action: verified.action },
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
return {
|
|
101
|
+
state: "loaded",
|
|
102
|
+
loaded: {
|
|
103
|
+
descriptor: verified.descriptor,
|
|
104
|
+
path: parsed.locator.path,
|
|
105
|
+
digest: parsed.locator.digest,
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=descriptor-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"descriptor-loader.js","sourceRoot":"","sources":["../../../src/application/capability/descriptor-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EACL,kCAAk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AM,QAAQ,GAAG,uBAAuB,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAChE,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,OAAO;YACL,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE;SACrF,CAAC;IACJ,CAAC;IACD,OAAO;QACL,KAAK,EAAE,QAAQ;QACf,MAAM,EAAE;YACN,UAAU,EAAE,QAAQ,CAAC,UAAU;YAC/B,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI;YACzB,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM;SAC9B;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The built-in floor of `design`.
|
|
3
|
+
*
|
|
4
|
+
* "Floor" is not a placeholder: it is the implementation a core gate can count
|
|
5
|
+
* on when nothing extra is installed, and it is the same code an improvement
|
|
6
|
+
* gets compared against. It is built entirely out of what already exists —
|
|
7
|
+
* the package index, the published validators, the adapter registry, the
|
|
8
|
+
* semantic handshake — because a floor that reimplemented the design domain
|
|
9
|
+
* would be a second design domain.
|
|
10
|
+
*
|
|
11
|
+
* The split between the CLI and the agent is the repo's usual one, and it is why
|
|
12
|
+
* the authoring operations answer `needs_input` first: the CLI owns identity,
|
|
13
|
+
* destinations, limits, validation and writing; the AGENT authors the content.
|
|
14
|
+
* `create` cannot invent a package body, so it says what a valid answer must
|
|
15
|
+
* contain and waits for one — that is a question, not a failure.
|
|
16
|
+
*/
|
|
17
|
+
import { requireAdapter } from "../../domain/design/adapter.js";
|
|
18
|
+
import { DESIGN_DESCRIPTOR, DESIGN_OPERATIONS } from "../../domain/design/capability.js";
|
|
19
|
+
import { attainedMaturity, isIndexable, resolveOutputRoot, } from "../../domain/design/direct.js";
|
|
20
|
+
import { DESIGN_ADAPTERS } from "../../domain/design/profiles.js";
|
|
21
|
+
import { classifySource, reportSources } from "../../domain/design/sources.js";
|
|
22
|
+
import { readDesignIndex, resolveDesignPackage } from "../design/design-index-service.js";
|
|
23
|
+
import { checkRecordPrecondition } from "../design/design-record-service.js";
|
|
24
|
+
import { buildSemanticRequest, parseSemanticResponse } from "../semantic-operation/protocol.js";
|
|
25
|
+
import { registerCapability } from "./dispatcher.js";
|
|
26
|
+
/** Artefact ceilings for one authored revision. Generous, and still a ceiling. */
|
|
27
|
+
const LIMITS = { max_artifacts: 60, max_artifact_bytes: 256_000 };
|
|
28
|
+
export const designHandler = {
|
|
29
|
+
descriptor: DESIGN_DESCRIPTOR,
|
|
30
|
+
async run(ctx) {
|
|
31
|
+
if (ctx.operation.name === "validate")
|
|
32
|
+
return validatePackage(ctx);
|
|
33
|
+
return authoring(ctx);
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
registerCapability(designHandler);
|
|
37
|
+
/**
|
|
38
|
+
* Judge a package without writing anything.
|
|
39
|
+
*
|
|
40
|
+
* The one operation that survives `off`, so it deliberately depends on nothing
|
|
41
|
+
* but the workspace it was pointed at: it reads the index, resolves BY IDENTITY
|
|
42
|
+
* (never by path) and reports the validator's own verdict.
|
|
43
|
+
*/
|
|
44
|
+
async function validatePackage(ctx) {
|
|
45
|
+
const id = inputValue(ctx, "package");
|
|
46
|
+
if (typeof id !== "string" || id.trim().length === 0) {
|
|
47
|
+
return { kind: "needs_input", gaps: ["la identidad del package a validar, p. ej. 'DES-001'"] };
|
|
48
|
+
}
|
|
49
|
+
if (ctx.workspace === null) {
|
|
50
|
+
return {
|
|
51
|
+
kind: "blocked",
|
|
52
|
+
failure: {
|
|
53
|
+
code: "DESIGN_WORKSPACE_ABSENT",
|
|
54
|
+
message: "no hay workspace donde buscar el package",
|
|
55
|
+
action: "corré la validación desde el workspace que contiene docs/designs/",
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
const index = await readDesignIndex(ctx.fs, ctx.workspace);
|
|
60
|
+
const found = resolveDesignPackage(index, id.trim());
|
|
61
|
+
if (found === null) {
|
|
62
|
+
return {
|
|
63
|
+
kind: "blocked",
|
|
64
|
+
failure: {
|
|
65
|
+
code: "DESIGN_PACKAGE_NOT_FOUND",
|
|
66
|
+
message: `no hay ningún package con identidad ${id}`,
|
|
67
|
+
action: `revisá 'aw designs' para ver las identidades publicadas bajo ${index.root}/`,
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
const validations = [
|
|
72
|
+
{
|
|
73
|
+
id: "design-manifest",
|
|
74
|
+
passed: found.ok,
|
|
75
|
+
detail: found.ok ? null : found.failures.map((f) => `${f.code}: ${f.message}`).join("; "),
|
|
76
|
+
},
|
|
77
|
+
];
|
|
78
|
+
const report = reportSources([], `${id}`);
|
|
79
|
+
const maturity = attainedMaturity(requestedMaturity(ctx), found.ok ? "handoff" : "outline", report);
|
|
80
|
+
const fields = {
|
|
81
|
+
package: found.id,
|
|
82
|
+
baseline: found.current_baseline === null
|
|
83
|
+
? null
|
|
84
|
+
: { revision: found.current_baseline.revision, digest: found.current_baseline.digest },
|
|
85
|
+
path: found.path,
|
|
86
|
+
root: "workspace",
|
|
87
|
+
indexable: true,
|
|
88
|
+
maturity: { requested: requestedMaturity(ctx), attained: maturity.attained },
|
|
89
|
+
sources: [],
|
|
90
|
+
renditions: [],
|
|
91
|
+
};
|
|
92
|
+
return {
|
|
93
|
+
kind: "completed",
|
|
94
|
+
validations,
|
|
95
|
+
output: {
|
|
96
|
+
value: { design: fields, ok: found.ok, failures: found.failures },
|
|
97
|
+
reference: found.id === null || found.current_baseline === null
|
|
98
|
+
? null
|
|
99
|
+
: {
|
|
100
|
+
id: found.id,
|
|
101
|
+
revision: found.current_baseline.revision,
|
|
102
|
+
digest: found.current_baseline.digest,
|
|
103
|
+
locator: found.path,
|
|
104
|
+
},
|
|
105
|
+
// A verdict is either produced or not; there is no half of one, which is
|
|
106
|
+
// why `validate` declares only `complete` in its descriptor.
|
|
107
|
+
completeness: "complete",
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* The authoring operations, through the handshake the repo already uses.
|
|
113
|
+
*
|
|
114
|
+
* `prepare` publishes the contract a valid answer has to satisfy and stops;
|
|
115
|
+
* `validate` parses the answer against that same contract — destinations,
|
|
116
|
+
* limits, staleness — and hands back the artifacts for the durable step. Every
|
|
117
|
+
* rejection there comes from `parseSemanticResponse`, so the authoring path
|
|
118
|
+
* inherits the write boundary rather than restating it.
|
|
119
|
+
*/
|
|
120
|
+
async function authoring(ctx) {
|
|
121
|
+
// Where the output lands is decided BEFORE anything else: outside a workspace
|
|
122
|
+
// an explicit root is required, and without one nothing is written anywhere.
|
|
123
|
+
const root = resolveOutputRoot(ctx.workspace, ctx.request.context.target, ctx.operation.name);
|
|
124
|
+
if (!root.ok) {
|
|
125
|
+
return {
|
|
126
|
+
kind: "blocked",
|
|
127
|
+
failure: {
|
|
128
|
+
code: root.failure.code,
|
|
129
|
+
message: root.failure.message,
|
|
130
|
+
action: root.failure.action,
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
const precondition = await operationPrecondition(ctx);
|
|
135
|
+
if (precondition !== null)
|
|
136
|
+
return { kind: "blocked", failure: precondition };
|
|
137
|
+
const sources = declaredSources(ctx);
|
|
138
|
+
const report = reportSources(sources, ctx.operation.name);
|
|
139
|
+
if (report.failures.length > 0) {
|
|
140
|
+
const first = report.failures[0];
|
|
141
|
+
return {
|
|
142
|
+
kind: "blocked",
|
|
143
|
+
failure: {
|
|
144
|
+
code: first?.code ?? "DESIGN_SOURCE_INVALID",
|
|
145
|
+
message: first?.message ?? "una fuente declarada no es reportable",
|
|
146
|
+
action: first?.action ?? "declará la causa de cada fuente que no se usó",
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
const request = buildSemanticRequest({
|
|
151
|
+
operation: `${ctx.request.capability}.${ctx.request.operation}`,
|
|
152
|
+
inputs: ctx.request.inputs.map((i) => ({ name: i.name, value: i.value })),
|
|
153
|
+
contract: contractFor(ctx.operation.name),
|
|
154
|
+
inventory: { root: root.value.root, mode: root.value.kind },
|
|
155
|
+
allowedDestinations: [root.value.root],
|
|
156
|
+
limits: LIMITS,
|
|
157
|
+
readSet: [],
|
|
158
|
+
readSetBytes: 0,
|
|
159
|
+
});
|
|
160
|
+
if (ctx.verb !== "validate") {
|
|
161
|
+
return {
|
|
162
|
+
kind: "needs_input",
|
|
163
|
+
gaps: [request.contract, `destinos permitidos: ${request.allowed_destinations.join(", ")}`],
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
if (ctx.answer === null || ctx.answer.trim().length === 0) {
|
|
167
|
+
return {
|
|
168
|
+
kind: "needs_input",
|
|
169
|
+
gaps: ["la respuesta autorada, como un único objeto JSON por stdin"],
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
// The answer is DATA to validate. Its own `input_digest` has to match the one
|
|
173
|
+
// this request was built from, which is what stops an answer written against
|
|
174
|
+
// a world that has since moved.
|
|
175
|
+
const parsed = parseSemanticResponse(ctx.answer, request);
|
|
176
|
+
if (!parsed.ok)
|
|
177
|
+
return { kind: "blocked", failure: parsed.failure };
|
|
178
|
+
const artifacts = (parsed.value.artifacts ?? []).map((a) => ({
|
|
179
|
+
path: a.path,
|
|
180
|
+
content: a.content,
|
|
181
|
+
}));
|
|
182
|
+
// The gate verdict the `012` computes is not available until the package is
|
|
183
|
+
// on disk, so a proposal can never claim more than `outline` here — which is
|
|
184
|
+
// exactly the rule that stops a partial from being promoted.
|
|
185
|
+
const maturity = attainedMaturity(requestedMaturity(ctx), "outline", report);
|
|
186
|
+
const fields = {
|
|
187
|
+
package: typeof inputValue(ctx, "package") === "string" ? String(inputValue(ctx, "package")) : null,
|
|
188
|
+
baseline: null,
|
|
189
|
+
path: root.value.root,
|
|
190
|
+
root: root.value.kind,
|
|
191
|
+
indexable: isIndexable(root.value),
|
|
192
|
+
maturity: { requested: requestedMaturity(ctx), attained: maturity.attained },
|
|
193
|
+
sources: report.sources,
|
|
194
|
+
renditions: [],
|
|
195
|
+
};
|
|
196
|
+
return {
|
|
197
|
+
kind: "durable",
|
|
198
|
+
artifacts,
|
|
199
|
+
output: {
|
|
200
|
+
value: { design: fields, artifacts: artifacts.map((a) => a.path), gaps: maturity.gaps },
|
|
201
|
+
reference: null,
|
|
202
|
+
// The durable step has not run yet, so nothing is published. Claiming
|
|
203
|
+
// `complete` here would let a gate accept a proposal as a package.
|
|
204
|
+
completeness: "partial",
|
|
205
|
+
},
|
|
206
|
+
base: null,
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* What each operation has to be true BEFORE it can even ask for content.
|
|
211
|
+
*
|
|
212
|
+
* Kept apart from the authoring path so the two read as what they are: this is
|
|
213
|
+
* about the world (does the profile exist, is the evidence still current), the
|
|
214
|
+
* other is about the answer.
|
|
215
|
+
*/
|
|
216
|
+
async function operationPrecondition(ctx) {
|
|
217
|
+
// `record` seals a statement ABOUT a revision, so its evidence has to still
|
|
218
|
+
// be the evidence. This is the check the end of B2 deferred in writing.
|
|
219
|
+
if (ctx.operation.name === "record" && ctx.workspace !== null) {
|
|
220
|
+
const id = inputValue(ctx, "package");
|
|
221
|
+
if (typeof id === "string" && id.trim().length > 0) {
|
|
222
|
+
const outcome = await checkRecordPrecondition(ctx.fs, ctx.workspace, id.trim());
|
|
223
|
+
const first = outcome.failures[0];
|
|
224
|
+
if (!outcome.ok && first !== undefined) {
|
|
225
|
+
return { code: first.code, message: first.message, action: first.action };
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
// `render` resolves its profile BY ID, which is what the adapter registry is
|
|
230
|
+
// for: asking for one that does not exist has to list the ones that do.
|
|
231
|
+
if (ctx.operation.name === "render") {
|
|
232
|
+
const profile = inputValue(ctx, "profile");
|
|
233
|
+
const adapter = requireAdapter(String(profile ?? ""), DESIGN_ADAPTERS, ctx.operation.name);
|
|
234
|
+
if (!adapter.ok) {
|
|
235
|
+
const { code, message, action } = adapter.failure;
|
|
236
|
+
return { code, message, action };
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
return null;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* The sources the invocation declared, classified.
|
|
243
|
+
*
|
|
244
|
+
* A locator the catalog does not recognize becomes `unsupported` WITH its
|
|
245
|
+
* reason rather than an error: one unreadable attachment must not sink an
|
|
246
|
+
* operation that had four good sources — it has to show up in the receipt and
|
|
247
|
+
* cost the run its `handoff`, which is a very different thing.
|
|
248
|
+
*/
|
|
249
|
+
function declaredSources(ctx) {
|
|
250
|
+
const raw = ctx.request.inputs.find((i) => i.name === "sources")?.value;
|
|
251
|
+
const locators = Array.isArray(raw) ? raw.map(String) : typeof raw === "string" ? [raw] : [];
|
|
252
|
+
return locators.map((locator) => {
|
|
253
|
+
const kind = classifySource(locator);
|
|
254
|
+
if (kind === null) {
|
|
255
|
+
return {
|
|
256
|
+
name: "sources",
|
|
257
|
+
kind: "host_context",
|
|
258
|
+
locator,
|
|
259
|
+
disposition: "unsupported",
|
|
260
|
+
reason: `'${locator}' no corresponde a ningún tipo de fuente del catálogo v1`,
|
|
261
|
+
derived: [],
|
|
262
|
+
sensitivity: "public",
|
|
263
|
+
essential: true,
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
return {
|
|
267
|
+
name: "sources",
|
|
268
|
+
kind,
|
|
269
|
+
locator,
|
|
270
|
+
disposition: "used",
|
|
271
|
+
reason: null,
|
|
272
|
+
derived: [],
|
|
273
|
+
sensitivity: "public",
|
|
274
|
+
essential: true,
|
|
275
|
+
};
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
function requestedMaturity(ctx) {
|
|
279
|
+
const value = inputValue(ctx, "maturity");
|
|
280
|
+
return value === "handoff" || value === "outline" ? value : null;
|
|
281
|
+
}
|
|
282
|
+
function contractFor(operation) {
|
|
283
|
+
const shared = "Respondé un único objeto JSON con 'version', 'operation', 'input_digest', 'state': 'proposed' " +
|
|
284
|
+
"y 'artifacts': [{path, content}]. Cada 'path' es relativo al workspace y cae dentro de los " +
|
|
285
|
+
"destinos permitidos. Ningún artefacto inventa un formato: los del UI Design Package v1 son los únicos aceptados.";
|
|
286
|
+
const perOperation = {
|
|
287
|
+
create: "Autorá la PRIMERA revisión del package a partir de las fuentes declaradas.",
|
|
288
|
+
update: "Autorá la revisión SIGUIENTE sobre la base declarada. No reescribas revisiones ya selladas.",
|
|
289
|
+
render: "Regenerá las proyecciones de la revisión indicada. Una proyección no es normativa y nunca se sella.",
|
|
290
|
+
record: "Sellá la decisión de gobierno sobre la revisión indicada, sin tocar el contenido del package.",
|
|
291
|
+
};
|
|
292
|
+
return `${perOperation[operation] ?? ""} ${shared}`.trim();
|
|
293
|
+
}
|
|
294
|
+
function inputValue(ctx, name) {
|
|
295
|
+
return ctx.request.inputs.find((i) => i.name === name)?.value;
|
|
296
|
+
}
|
|
297
|
+
/** The five operations this floor answers — the descriptor's, not a second list. */
|
|
298
|
+
export const DESIGN_FLOOR_OPERATIONS = DESIGN_OPERATIONS;
|
|
299
|
+
//# sourceMappingURL=design-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"design-handler.js","sourceRoot":"","sources":["../../../src/application/capability/design-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACzF,OAAO,EAEL,gBAAgB,EAChB,WAAW,EACX,iBAAiB,GAClB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,O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