@wildo-ai/dev-companion 1.1.15 → 1.1.16
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/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.d.ts +165 -5
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.d.ts.map +1 -1
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.js +239 -8
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.js.map +1 -1
- package/dist/esm/claude-cli/models/concurrent-coding-runs.models.d.ts +2 -1
- package/dist/esm/claude-cli/models/concurrent-coding-runs.models.d.ts.map +1 -1
- package/dist/esm/claude-cli/models/concurrent-coding-runs.models.js +2 -1
- package/dist/esm/claude-cli/models/concurrent-coding-runs.models.js.map +1 -1
- package/dist/esm/claude-cli/models/isolated-recheck-interference.models.d.ts +68 -0
- package/dist/esm/claude-cli/models/isolated-recheck-interference.models.d.ts.map +1 -0
- package/dist/esm/claude-cli/models/isolated-recheck-interference.models.js +198 -0
- package/dist/esm/claude-cli/models/isolated-recheck-interference.models.js.map +1 -0
- package/dist/esm/claude-cli/models/workspace-path-claims.models.d.ts +138 -0
- package/dist/esm/claude-cli/models/workspace-path-claims.models.d.ts.map +1 -0
- package/dist/esm/claude-cli/models/workspace-path-claims.models.js +204 -0
- package/dist/esm/claude-cli/models/workspace-path-claims.models.js.map +1 -0
- package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.d.ts +20 -0
- package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.d.ts.map +1 -1
- package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.js +27 -12
- package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.js.map +1 -1
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.d.ts +155 -3
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.d.ts.map +1 -1
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js +791 -151
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js.map +1 -1
- package/dist/esm/companion-api/controllers/companion.controller.d.ts.map +1 -1
- package/dist/esm/companion-api/controllers/companion.controller.js +7 -1
- package/dist/esm/companion-api/controllers/companion.controller.js.map +1 -1
- package/dist/esm/core/introspection/resources/creation-home-projection.companion.js +1 -1
- package/dist/esm/core/introspection/resources/creation-home-projection.companion.js.map +1 -1
- package/dist/esm/core/introspection/subprocess/app-shell-placement-content.behavior.d.ts +13 -0
- package/dist/esm/core/introspection/subprocess/app-shell-placement-content.behavior.d.ts.map +1 -1
- package/dist/esm/core/introspection/subprocess/app-shell-placement-content.behavior.js +98 -16
- package/dist/esm/core/introspection/subprocess/app-shell-placement-content.behavior.js.map +1 -1
- package/dist/esm/expert-personas/services/expert-persona.companion.service.d.ts +21 -1
- package/dist/esm/expert-personas/services/expert-persona.companion.service.d.ts.map +1 -1
- package/dist/esm/expert-personas/services/expert-persona.companion.service.js +35 -3
- package/dist/esm/expert-personas/services/expert-persona.companion.service.js.map +1 -1
- package/dist/esm/i18n/components/APP_LAYOUTS_AGENT_ACTIVITY_SETTINGS.en.d.ts +62 -0
- package/dist/esm/i18n/components/APP_LAYOUTS_AGENT_ACTIVITY_SETTINGS.en.d.ts.map +1 -0
- package/dist/esm/i18n/components/APP_LAYOUTS_AGENT_ACTIVITY_SETTINGS.en.js +62 -0
- package/dist/esm/i18n/components/APP_LAYOUTS_AGENT_ACTIVITY_SETTINGS.en.js.map +1 -0
- package/dist/esm/i18n/components/APP_LAYOUTS_AGENT_ACTIVITY_SETTINGS.fr.d.ts +62 -0
- package/dist/esm/i18n/components/APP_LAYOUTS_AGENT_ACTIVITY_SETTINGS.fr.d.ts.map +1 -0
- package/dist/esm/i18n/components/APP_LAYOUTS_AGENT_ACTIVITY_SETTINGS.fr.js +62 -0
- package/dist/esm/i18n/components/APP_LAYOUTS_AGENT_ACTIVITY_SETTINGS.fr.js.map +1 -0
- package/dist/esm/i18n/system_enums/workbench-build.en.d.ts +1 -1
- package/dist/esm/i18n/system_enums/workbench-build.en.js +1 -1
- package/dist/esm/i18n/system_enums/workbench-build.en.js.map +1 -1
- package/dist/esm/meta-workflows/models/carried-verification-failure.models.d.ts +23 -0
- package/dist/esm/meta-workflows/models/carried-verification-failure.models.d.ts.map +1 -1
- package/dist/esm/meta-workflows/models/carried-verification-failure.models.js +14 -0
- package/dist/esm/meta-workflows/models/carried-verification-failure.models.js.map +1 -1
- package/dist/esm/meta-workflows/models/creation-journey-timeline.models.d.ts +12 -1
- package/dist/esm/meta-workflows/models/creation-journey-timeline.models.d.ts.map +1 -1
- package/dist/esm/meta-workflows/models/creation-journey-timeline.models.js +99 -1
- package/dist/esm/meta-workflows/models/creation-journey-timeline.models.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-assembly-checks.companion.utils.d.ts +5 -0
- package/dist/esm/meta-workflows/services/application-assembly-checks.companion.utils.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-assembly-checks.companion.utils.js +22 -1
- package/dist/esm/meta-workflows/services/application-assembly-checks.companion.utils.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts +67 -20
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.js +344 -76
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.js +9 -0
- package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.d.ts +47 -1
- package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.js +98 -9
- package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.d.ts +38 -2
- package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.js +176 -22
- package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-website-context.companion.service.d.ts +45 -0
- package/dist/esm/meta-workflows/services/application-build-website-context.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-website-context.companion.service.js +74 -0
- package/dist/esm/meta-workflows/services/application-build-website-context.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/creation-run-report.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/creation-run-report.companion.service.js +9 -1
- package/dist/esm/meta-workflows/services/creation-run-report.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts +64 -5
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.js +139 -14
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/website-demo-facts.models.d.ts +19 -1
- package/dist/esm/meta-workflows/services/website-demo-facts.models.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/website-demo-facts.models.js +7 -5
- package/dist/esm/meta-workflows/services/website-demo-facts.models.js.map +1 -1
- package/dist/esm/technical-doc/services/technical-documentation-pilot.companion.service.d.ts +2 -0
- package/dist/esm/technical-doc/services/technical-documentation-pilot.companion.service.d.ts.map +1 -1
- package/dist/esm/technical-doc/services/technical-documentation-pilot.companion.service.js +3 -1
- package/dist/esm/technical-doc/services/technical-documentation-pilot.companion.service.js.map +1 -1
- package/package.json +17 -17
|
@@ -27,6 +27,22 @@ export interface WebsiteDemoScenarioCheck {
|
|
|
27
27
|
readonly bound: number;
|
|
28
28
|
/** Each way a bound scenario is untrue of the application, as a sentence naming where it was defined. */
|
|
29
29
|
readonly problems: readonly string[];
|
|
30
|
+
/**
|
|
31
|
+
* The same problems, one per entry in the same order, with what each is ABOUT (#3881): where the scenario was defined
|
|
32
|
+
* (`definedAt`, `<file>:<line>` or `null`) and the resource it draws, with that resource's module when the application
|
|
33
|
+
* has the resource. What lets a coding run be charged only with the demos it touched.
|
|
34
|
+
*/
|
|
35
|
+
readonly findings: readonly WebsiteDemoScenarioFinding[];
|
|
36
|
+
}
|
|
37
|
+
/** One way a bound demo scenario is untrue of the application, and what it is about (#3881). */
|
|
38
|
+
export interface WebsiteDemoScenarioFinding {
|
|
39
|
+
readonly sentence: string;
|
|
40
|
+
/** The problem without the site, so the same untruth keeps one identity when the line it is defined on moves. */
|
|
41
|
+
readonly problem: string;
|
|
42
|
+
readonly definedAt: string | null;
|
|
43
|
+
readonly resourceType: string;
|
|
44
|
+
/** The module that registers the resource; `null` for an engine resource, absent when the application lacks it. */
|
|
45
|
+
readonly moduleId?: string | null;
|
|
30
46
|
}
|
|
31
47
|
/**
|
|
32
48
|
* Checks every scenario a site defined against the application it draws (#2784): a scenario bound to a resource
|
|
@@ -39,5 +55,7 @@ export interface WebsiteDemoScenarioCheck {
|
|
|
39
55
|
* several scenarios (`goalScenario('done')`, `goalScenario('achieved')`) defines them all on one line, and keying on the
|
|
40
56
|
* line kept only the last and dropped the rest unchecked.
|
|
41
57
|
*/
|
|
42
|
-
export declare function checkWebsiteDemoScenarios(records: readonly DefinedWebsiteDemoScenarioRecord[], resources: ReadonlyMap<string, Pick<DomainModelResourceRow, 'resourceType' | 'fields' | 'operations'
|
|
58
|
+
export declare function checkWebsiteDemoScenarios(records: readonly DefinedWebsiteDemoScenarioRecord[], resources: ReadonlyMap<string, Pick<DomainModelResourceRow, 'resourceType' | 'fields' | 'operations'> & {
|
|
59
|
+
readonly moduleId?: string | null;
|
|
60
|
+
}>, describeSite: (definedAt: string | null) => string): WebsiteDemoScenarioCheck;
|
|
43
61
|
//# sourceMappingURL=website-demo-facts.models.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"website-demo-facts.models.d.ts","sourceRoot":"","sources":["../../../../src/meta-workflows/services/website-demo-facts.models.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,gCAAgC,EACrC,KAAK,wBAAwB,EAC9B,MAAM,kCAAkC,CAAC;AAI1C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uEAAuE,CAAC;AAsBpH;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,IAAI,CAAC,sBAAsB,EAAE,cAAc,GAAG,QAAQ,GAAG,YAAY,CAAC,GAAG,wBAAwB,CAqBnJ;AAED,kEAAkE;AAClE,MAAM,WAAW,wBAAwB;IACvC,yDAAyD;IACzD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,yGAAyG;IACzG,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"website-demo-facts.models.d.ts","sourceRoot":"","sources":["../../../../src/meta-workflows/services/website-demo-facts.models.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,gCAAgC,EACrC,KAAK,wBAAwB,EAC9B,MAAM,kCAAkC,CAAC;AAI1C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uEAAuE,CAAC;AAsBpH;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,IAAI,CAAC,sBAAsB,EAAE,cAAc,GAAG,QAAQ,GAAG,YAAY,CAAC,GAAG,wBAAwB,CAqBnJ;AAED,kEAAkE;AAClE,MAAM,WAAW,wBAAwB;IACvC,yDAAyD;IACzD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,yGAAyG;IACzG,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,SAAS,0BAA0B,EAAE,CAAC;CAC1D;AAED,gGAAgG;AAChG,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,iHAAiH;IACjH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,mHAAmH;IACnH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,SAAS,gCAAgC,EAAE,EACpD,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,sBAAsB,EAAE,cAAc,GAAG,QAAQ,GAAG,YAAY,CAAC,GAAG;IAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC,EAC9I,YAAY,EAAE,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,KAAK,MAAM,GACjD,wBAAwB,CAqB1B"}
|
|
@@ -78,7 +78,7 @@ export function checkWebsiteDemoScenarios(records, resources, describeSite) {
|
|
|
78
78
|
const distinct = new Map();
|
|
79
79
|
for (const record of records)
|
|
80
80
|
distinct.set(`${record.definedAt ?? ''}\u0000${JSON.stringify(record.scenario)}`, record);
|
|
81
|
-
const
|
|
81
|
+
const findings = [];
|
|
82
82
|
let bound = 0;
|
|
83
83
|
for (const record of distinct.values()) {
|
|
84
84
|
const resourceType = record.scenario.resource;
|
|
@@ -88,12 +88,14 @@ export function checkWebsiteDemoScenarios(records, resources, describeSite) {
|
|
|
88
88
|
const where = describeSite(record.definedAt);
|
|
89
89
|
const resource = resources.get(resourceType);
|
|
90
90
|
if (resource === undefined) {
|
|
91
|
-
|
|
91
|
+
const problem = `the scenario shows "${resourceType}", which is not a resource of the application`;
|
|
92
|
+
findings.push({ sentence: `${where}: ${problem}`, problem, definedAt: record.definedAt, resourceType });
|
|
92
93
|
continue;
|
|
93
94
|
}
|
|
94
|
-
for (const problem of validateWebsiteDemoScenario(record.scenario, websiteDemoResourceFacts(resource)))
|
|
95
|
-
|
|
95
|
+
for (const problem of validateWebsiteDemoScenario(record.scenario, websiteDemoResourceFacts(resource))) {
|
|
96
|
+
findings.push({ sentence: `${where}: ${problem}`, problem, definedAt: record.definedAt, resourceType, moduleId: resource.moduleId ?? null });
|
|
97
|
+
}
|
|
96
98
|
}
|
|
97
|
-
return { defined: distinct.size, bound, problems };
|
|
99
|
+
return { defined: distinct.size, bound, problems: findings.map((finding) => finding.sentence), findings };
|
|
98
100
|
}
|
|
99
101
|
//# sourceMappingURL=website-demo-facts.models.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"website-demo-facts.models.js","sourceRoot":"","sources":["../../../../src/meta-workflows/services/website-demo-facts.models.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,2BAA2B,GAG5B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,iEAAiE,CAAC;AAE5G;;;;;;;;GAQG;AAEH,wHAAwH;AACxH,MAAM,UAAU,GAAsE;IACpF,CAAC,yBAAyB,CAAC,IAAI,CAAC,EAAE,oBAAoB,CAAC,IAAI;IAC3D,CAAC,yBAAyB,CAAC,MAAM,CAAC,EAAE,oBAAoB,CAAC,MAAM;IAC/D,CAAC,yBAAyB,CAAC,IAAI,CAA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SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IACxH,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,MAAM,IAAI,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC;QACvC,MAAM,YAAY,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAC9C,IAAI,YAAY,KAAK,SAAS;YAAE,SAAS;QACzC,KAAK,IAAI,CAAC,CAAC;QACX,MAAM,KAAK,GAAG,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAC7C,MAAM,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAC7C,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,QAAQ,CAAC,IAAI,CAAC,GAAG,KAAK,yBAAyB,YAAY,+CAA+C,CAAC,CAAC;YAC5G,SAAS;QACX,CAAC;QACD,KAAK,MAAM,OAAO,IAAI,2BAA2B,CAAC,MAAM,CAAC,QAAQ,EAAE,wBAAwB,CAAC,QAAQ,CAAC,CAAC;YAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,KAAK,KAAK,OAAO,EAAE,CAAC,CAAC;IAChJ,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACrD,CAAC","sourcesContent":["import {\n WebsiteDemoFieldKind,\n validateWebsiteDemoScenario,\n type DefinedWebsiteDemoScenarioRecord,\n type WebsiteDemoResourceFacts,\n} from '@wildo-ai/saas-website/companion';\nimport { Resources_SharedUtils } from '@wildo-ai/saas-models';\nimport { ZodDecorator } from '@wildo-ai/zod-decorators';\n\nimport type { DomainModelResourceRow } from '../../core/introspection/subprocess/application-domain-model.behavior';\nimport { DomainModelFieldValueKind } from '../../core/introspection/subprocess/field-value-shape.companion';\n\n/**\n * What a drawn demo may show of the resource it is bound to (#2742 step 5e), as the website engine's scenario validator\n * reads it (`validateWebsiteDemoScenario`): every field with the kind of its values and an enum's members, read from the\n * resource's SCHEMA through the domain model, and the fields an update writes.\n *\n * The section's coding agent is handed these facts with the demo the plan decided, so a status it draws is one the\n * resource has and a change it shows is one an update makes. The same facts are what the validator checks a scenario\n * against, so the brief and the check cannot disagree about the application.\n */\n\n/** The domain model's value kinds as the scenario validator's field kinds. Total over the domain model's vocabulary. */\nconst FIELD_KIND: Readonly<Record<DomainModelFieldValueKind, WebsiteDemoFieldKind>> = {\n [DomainModelFieldValueKind.ENUM]: WebsiteDemoFieldKind.ENUM,\n [DomainModelFieldValueKind.NUMBER]: WebsiteDemoFieldKind.NUMBER,\n [DomainModelFieldValueKind.TEXT]: WebsiteDemoFieldKind.TEXT,\n [DomainModelFieldValueKind.BOOLEAN]: WebsiteDemoFieldKind.BOOLEAN,\n [DomainModelFieldValueKind.OTHER]: WebsiteDemoFieldKind.OTHER,\n};\n\n/**\n * The facts of one resource. A field whose schema could not be read is OTHER (named, its value unchecked), never\n * dropped: a drawing may still show it. A field is updatable unless its decorators exclude it from an update.\n *\n * Each CUSTOM operation is listed with the fields it writes, its `authoritativeFields` (every variant's, together):\n * that is how a lifecycle moves a status the update cannot touch (`resource-status-lifecycle` makes the status\n * `.excludeFromUpdate()` and each transition a custom operation naming it), so a status demo that moves through\n * `submit` or `approve` is true, and the same change drawn as an update is not. A custom operation that declares no\n * authoritative field is listed writing nothing, so a change drawn through it is reported rather than assumed.\n *\n * Only operations an author declared and the application serves: an operation the framework GENERATES is not a\n * transition, and a disabled or unimplemented one is not something the product does yet. The framework marks two\n * kinds with `generatedOperation` (a collection export, a file regeneration, which can inherit the update's\n * `authoritativeFields`). Its bulk relationship actions (`bulk_set_<field>`, …) carry no such marker and spread the\n * bulk update, so they are recognised the way the engine itself recognises them, by their identifier\n * (`Resources_SharedUtils.parseRelationshipBulkOperationIdentifier`). An AUTHORED bulk transition (\"complete all\")\n * stays: the predicate is \"generated\", never \"bulk\".\n */\nexport function websiteDemoResourceFacts(resource: Pick<DomainModelResourceRow, 'resourceType' | 'fields' | 'operations'>): WebsiteDemoResourceFacts {\n const fields: Record<string, { kind: WebsiteDemoFieldKind; members?: readonly string[] }> = {};\n const updatable: string[] = [];\n for (const field of resource.fields) {\n const shape = field.valueShape;\n const kind = shape === null ? WebsiteDemoFieldKind.OTHER : FIELD_KIND[shape.kind];\n fields[field.fieldName] = kind === WebsiteDemoFieldKind.ENUM ? { kind, members: [...(shape?.members ?? [])] } : { kind };\n // The metadata is keyed by decorator, its value the decorator's params: a key that is present is a decorator applied.\n const metadata = field.metadata ?? {};\n if (!Object.hasOwn(metadata, ZodDecorator.EXCLUDE_FROM_UPDATE) && !Object.hasOwn(metadata, ZodDecorator.IS_PRIMARY_KEY)) updatable.push(field.fieldName);\n }\n const operations: Record<string, string[]> = {};\n for (const operation of resource.operations) {\n if (operation.resourceOperationLike === null || operation.isDisabled || operation.isUnimplemented) continue;\n if (operation.attributes['generatedOperation'] !== undefined) continue;\n if (Resources_SharedUtils.parseRelationshipBulkOperationIdentifier(operation.operationIdentifier) !== undefined) continue;\n const written = operation.attributes['authoritativeFields'];\n const fieldsOfVariant = Array.isArray(written) ? written.filter((field): field is string => typeof field === 'string') : [];\n operations[operation.operationIdentifier] = [...new Set([...(operations[operation.operationIdentifier] ?? []), ...fieldsOfVariant])];\n }\n return { resource: resource.resourceType, fields, updatable, ...(Object.keys(operations).length > 0 ? { operations } : {}) };\n}\n\n/** What checking a site's landed demo scenarios found (#2784). */\nexport interface WebsiteDemoScenarioCheck {\n /** Distinct scenarios the site defined, bound or not. */\n readonly defined: number;\n /** Of those, the ones bound to a resource, which are the ones checked. */\n readonly bound: number;\n /** Each way a bound scenario is untrue of the application, as a sentence naming where it was defined. */\n readonly problems: readonly string[];\n}\n\n/**\n * Checks every scenario a site defined against the application it draws (#2784): a scenario bound to a resource\n * (`resource`) must name one the application has, and every value it shows or changes must be one that resource's\n * facts allow (`validateWebsiteDemoScenario`, with the facts `websiteDemoResourceFacts` derives, the same facts the\n * section's brief carried). An unbound scenario draws no record and is only counted.\n *\n * `records` may name one scenario twice (a check that imports two entries of the site evaluates a module once per\n * entry): a scenario is one DEFINITION SITE with one CONTENT. The site alone is not enough: a helper that builds\n * several scenarios (`goalScenario('done')`, `goalScenario('achieved')`) defines them all on one line, and keying on the\n * line kept only the last and dropped the rest unchecked.\n */\nexport function checkWebsiteDemoScenarios(\n records: readonly DefinedWebsiteDemoScenarioRecord[],\n resources: ReadonlyMap<string, Pick<DomainModelResourceRow, 'resourceType' | 'fields' | 'operations'>>,\n describeSite: (definedAt: string | null) => string,\n): WebsiteDemoScenarioCheck {\n const distinct = new Map<string, DefinedWebsiteDemoScenarioRecord>();\n for (const record of records) distinct.set(`${record.definedAt ?? ''}\\u0000${JSON.stringify(record.scenario)}`, record);\n const problems: string[] = [];\n let bound = 0;\n for (const record of distinct.values()) {\n const resourceType = record.scenario.resource;\n if (resourceType === undefined) continue;\n bound += 1;\n const where = describeSite(record.definedAt);\n const resource = resources.get(resourceType);\n if (resource === undefined) {\n problems.push(`${where}: the scenario shows \"${resourceType}\", which is not a resource of the application`);\n continue;\n }\n for (const problem of validateWebsiteDemoScenario(record.scenario, websiteDemoResourceFacts(resource))) problems.push(`${where}: ${problem}`);\n }\n return { defined: distinct.size, bound, problems };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"website-demo-facts.models.js","sourceRoot":"","sources":["../../../../src/meta-workflows/services/website-demo-facts.models.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,2BAA2B,GAG5B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,iEAAiE,CAAC;AAE5G;;;;;;;;GAQG;AAEH,wHAAwH;AAC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,CAAC,QAAQ,IAAI,IAAI,EAAE,CAAC,CAAC;QAC/I,CAAC;IACH,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;AAC5G,CAAC","sourcesContent":["import {\n WebsiteDemoFieldKind,\n validateWebsiteDemoScenario,\n type DefinedWebsiteDemoScenarioRecord,\n type WebsiteDemoResourceFacts,\n} from '@wildo-ai/saas-website/companion';\nimport { Resources_SharedUtils } from '@wildo-ai/saas-models';\nimport { ZodDecorator } from '@wildo-ai/zod-decorators';\n\nimport type { DomainModelResourceRow } from '../../core/introspection/subprocess/application-domain-model.behavior';\nimport { DomainModelFieldValueKind } from '../../core/introspection/subprocess/field-value-shape.companion';\n\n/**\n * What a drawn demo may show of the resource it is bound to (#2742 step 5e), as the website engine's scenario validator\n * reads it (`validateWebsiteDemoScenario`): every field with the kind of its values and an enum's members, read from the\n * resource's SCHEMA through the domain model, and the fields an update writes.\n *\n * The section's coding agent is handed these facts with the demo the plan decided, so a status it draws is one the\n * resource has and a change it shows is one an update makes. The same facts are what the validator checks a scenario\n * against, so the brief and the check cannot disagree about the application.\n */\n\n/** The domain model's value kinds as the scenario validator's field kinds. Total over the domain model's vocabulary. */\nconst FIELD_KIND: Readonly<Record<DomainModelFieldValueKind, WebsiteDemoFieldKind>> = {\n [DomainModelFieldValueKind.ENUM]: WebsiteDemoFieldKind.ENUM,\n [DomainModelFieldValueKind.NUMBER]: WebsiteDemoFieldKind.NUMBER,\n [DomainModelFieldValueKind.TEXT]: WebsiteDemoFieldKind.TEXT,\n [DomainModelFieldValueKind.BOOLEAN]: WebsiteDemoFieldKind.BOOLEAN,\n [DomainModelFieldValueKind.OTHER]: WebsiteDemoFieldKind.OTHER,\n};\n\n/**\n * The facts of one resource. A field whose schema could not be read is OTHER (named, its value unchecked), never\n * dropped: a drawing may still show it. A field is updatable unless its decorators exclude it from an update.\n *\n * Each CUSTOM operation is listed with the fields it writes, its `authoritativeFields` (every variant's, together):\n * that is how a lifecycle moves a status the update cannot touch (`resource-status-lifecycle` makes the status\n * `.excludeFromUpdate()` and each transition a custom operation naming it), so a status demo that moves through\n * `submit` or `approve` is true, and the same change drawn as an update is not. A custom operation that declares no\n * authoritative field is listed writing nothing, so a change drawn through it is reported rather than assumed.\n *\n * Only operations an author declared and the application serves: an operation the framework GENERATES is not a\n * transition, and a disabled or unimplemented one is not something the product does yet. The framework marks two\n * kinds with `generatedOperation` (a collection export, a file regeneration, which can inherit the update's\n * `authoritativeFields`). Its bulk relationship actions (`bulk_set_<field>`, …) carry no such marker and spread the\n * bulk update, so they are recognised the way the engine itself recognises them, by their identifier\n * (`Resources_SharedUtils.parseRelationshipBulkOperationIdentifier`). An AUTHORED bulk transition (\"complete all\")\n * stays: the predicate is \"generated\", never \"bulk\".\n */\nexport function websiteDemoResourceFacts(resource: Pick<DomainModelResourceRow, 'resourceType' | 'fields' | 'operations'>): WebsiteDemoResourceFacts {\n const fields: Record<string, { kind: WebsiteDemoFieldKind; members?: readonly string[] }> = {};\n const updatable: string[] = [];\n for (const field of resource.fields) {\n const shape = field.valueShape;\n const kind = shape === null ? WebsiteDemoFieldKind.OTHER : FIELD_KIND[shape.kind];\n fields[field.fieldName] = kind === WebsiteDemoFieldKind.ENUM ? { kind, members: [...(shape?.members ?? [])] } : { kind };\n // The metadata is keyed by decorator, its value the decorator's params: a key that is present is a decorator applied.\n const metadata = field.metadata ?? {};\n if (!Object.hasOwn(metadata, ZodDecorator.EXCLUDE_FROM_UPDATE) && !Object.hasOwn(metadata, ZodDecorator.IS_PRIMARY_KEY)) updatable.push(field.fieldName);\n }\n const operations: Record<string, string[]> = {};\n for (const operation of resource.operations) {\n if (operation.resourceOperationLike === null || operation.isDisabled || operation.isUnimplemented) continue;\n if (operation.attributes['generatedOperation'] !== undefined) continue;\n if (Resources_SharedUtils.parseRelationshipBulkOperationIdentifier(operation.operationIdentifier) !== undefined) continue;\n const written = operation.attributes['authoritativeFields'];\n const fieldsOfVariant = Array.isArray(written) ? written.filter((field): field is string => typeof field === 'string') : [];\n operations[operation.operationIdentifier] = [...new Set([...(operations[operation.operationIdentifier] ?? []), ...fieldsOfVariant])];\n }\n return { resource: resource.resourceType, fields, updatable, ...(Object.keys(operations).length > 0 ? { operations } : {}) };\n}\n\n/** What checking a site's landed demo scenarios found (#2784). */\nexport interface WebsiteDemoScenarioCheck {\n /** Distinct scenarios the site defined, bound or not. */\n readonly defined: number;\n /** Of those, the ones bound to a resource, which are the ones checked. */\n readonly bound: number;\n /** Each way a bound scenario is untrue of the application, as a sentence naming where it was defined. */\n readonly problems: readonly string[];\n /**\n * The same problems, one per entry in the same order, with what each is ABOUT (#3881): where the scenario was defined\n * (`definedAt`, `<file>:<line>` or `null`) and the resource it draws, with that resource's module when the application\n * has the resource. What lets a coding run be charged only with the demos it touched.\n */\n readonly findings: readonly WebsiteDemoScenarioFinding[];\n}\n\n/** One way a bound demo scenario is untrue of the application, and what it is about (#3881). */\nexport interface WebsiteDemoScenarioFinding {\n readonly sentence: string;\n /** The problem without the site, so the same untruth keeps one identity when the line it is defined on moves. */\n readonly problem: string;\n readonly definedAt: string | null;\n readonly resourceType: string;\n /** The module that registers the resource; `null` for an engine resource, absent when the application lacks it. */\n readonly moduleId?: string | null;\n}\n\n/**\n * Checks every scenario a site defined against the application it draws (#2784): a scenario bound to a resource\n * (`resource`) must name one the application has, and every value it shows or changes must be one that resource's\n * facts allow (`validateWebsiteDemoScenario`, with the facts `websiteDemoResourceFacts` derives, the same facts the\n * section's brief carried). An unbound scenario draws no record and is only counted.\n *\n * `records` may name one scenario twice (a check that imports two entries of the site evaluates a module once per\n * entry): a scenario is one DEFINITION SITE with one CONTENT. The site alone is not enough: a helper that builds\n * several scenarios (`goalScenario('done')`, `goalScenario('achieved')`) defines them all on one line, and keying on the\n * line kept only the last and dropped the rest unchecked.\n */\nexport function checkWebsiteDemoScenarios(\n records: readonly DefinedWebsiteDemoScenarioRecord[],\n resources: ReadonlyMap<string, Pick<DomainModelResourceRow, 'resourceType' | 'fields' | 'operations'> & { readonly moduleId?: string | null }>,\n describeSite: (definedAt: string | null) => string,\n): WebsiteDemoScenarioCheck {\n const distinct = new Map<string, DefinedWebsiteDemoScenarioRecord>();\n for (const record of records) distinct.set(`${record.definedAt ?? ''}\\u0000${JSON.stringify(record.scenario)}`, record);\n const findings: WebsiteDemoScenarioFinding[] = [];\n let bound = 0;\n for (const record of distinct.values()) {\n const resourceType = record.scenario.resource;\n if (resourceType === undefined) continue;\n bound += 1;\n const where = describeSite(record.definedAt);\n const resource = resources.get(resourceType);\n if (resource === undefined) {\n const problem = `the scenario shows \"${resourceType}\", which is not a resource of the application`;\n findings.push({ sentence: `${where}: ${problem}`, problem, definedAt: record.definedAt, resourceType });\n continue;\n }\n for (const problem of validateWebsiteDemoScenario(record.scenario, websiteDemoResourceFacts(resource))) {\n findings.push({ sentence: `${where}: ${problem}`, problem, definedAt: record.definedAt, resourceType, moduleId: resource.moduleId ?? null });\n }\n }\n return { defined: distinct.size, bound, problems: findings.map((finding) => finding.sentence), findings };\n}\n"]}
|
package/dist/esm/technical-doc/services/technical-documentation-pilot.companion.service.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { type TechnicalDocumentationApiReferenceTargetV1, type TechnicalDocumentationAuthorizedBundleManifestV1, type TechnicalDocumentationPrivateDerivationManifestV1, type TechnicalDocumentationVersionedIdentityV1, type TechnicalDocumentationResolvedAssetBundleManifestV1, type TechnicalDocumentationSupportedApiVersion } from '@wildo-ai/saas-specifications/technical-documentation';
|
|
2
2
|
import { createTechnicalDocumentationAggregateRenderManifest, validateTechnicalDocumentationManagedTree, type OpenApiGenerationOutput, type TechnicalDocumentationOutputBudgets, type TechnicalDocumentationRendererResult } from '@wildo-ai/saas-technical-doc/companion';
|
|
3
|
+
/** Where the publish writes the API reference, application-root relative (also the documentation step's write scope). */
|
|
4
|
+
export declare const API_REFERENCE_GENERATED_ROOT = "technical-doc/src/generated/api-reference";
|
|
3
5
|
export interface TechnicalDocumentationPilotPublicationResult {
|
|
4
6
|
readonly rootPath: string;
|
|
5
7
|
readonly contentPath: string;
|
package/dist/esm/technical-doc/services/technical-documentation-pilot.companion.service.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"technical-documentation-pilot.companion.service.d.ts","sourceRoot":"","sources":["../../../../src/technical-doc/services/technical-documentation-pilot.companion.service.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,KAAK,0CAA0C,EAG/C,KAAK,gDAAgD,EACrD,KAAK,iDAAiD,EACtD,KAAK,yCAAyC,EAC9C,KAAK,mDAAmD,EACxD,KAAK,yCAAyC,EAC/C,MAAM,uDAAuD,CAAC;AAC/D,OAAO,EACL,mDAAmD,EAOnD,yCAAyC,EACzC,KAAK,uBAAuB,EAC5B,KAAK,mCAAmC,EAExC,KAAK,oCAAoC,EAC1C,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"technical-documentation-pilot.companion.service.d.ts","sourceRoot":"","sources":["../../../../src/technical-doc/services/technical-documentation-pilot.companion.service.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,KAAK,0CAA0C,EAG/C,KAAK,gDAAgD,EACrD,KAAK,iDAAiD,EACtD,KAAK,yCAAyC,EAC9C,KAAK,mDAAmD,EACxD,KAAK,yCAAyC,EAC/C,MAAM,uDAAuD,CAAC;AAC/D,OAAO,EACL,mDAAmD,EAOnD,yCAAyC,EACzC,KAAK,uBAAuB,EAC5B,KAAK,mCAAmC,EAExC,KAAK,oCAAoC,EAC1C,MAAM,wCAAwC,CAAC;AAKhD,yHAAyH;AACzH,eAAO,MAAM,4BAA4B,8CAA8C,CAAC;AAYxF,MAAM,WAAW,4CAA4C;IAC3D,QAAQ,CAAC,QAAQ,EAAE,M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AC,4CAA4C,CAAC;IAyBzD,iFAAiF;IACpE,uBAAuB,CAAC,KAAK,EAAE;QAC1C,QAAQ,CAAC,SAAS,EAAE,uBAAuB,CAAC;QAC5C,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;KAC5C,GAAG,OAAO,CAAC;QAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,CAAC;IAanF;;;;;;;OAOG;YACW,yBAAyB;YAqBzB,wBAAwB;IAiCtC;;;;;;;;OAQG;YACW,2CAA2C;YAqB3C,kBAAkB;YAyBlB,sBAAsB;YAiBtB,2BAA2B;CAkB1C"}
|
|
@@ -6,7 +6,9 @@ import { TechnicalDocumentationApplicabilityEvidenceStatus, TechnicalDocumentati
|
|
|
6
6
|
import { createTechnicalDocumentationAggregateRenderManifest, createTechnicalDocumentationRenderModel, readTechnicalDocumentationAuthorizedRenderInput, renderTechnicalDocumentationDocusaurus, renderTechnicalDocumentationSearchIndexes, renderVerifiedTechnicalDocumentationOpenApi, technicalDocumentationSha256Bytes, validateTechnicalDocumentationManagedTree, } from '@wildo-ai/saas-technical-doc/companion';
|
|
7
7
|
import { TechnicalDocumentationPilotAssetsCompanionService } from './technical-documentation-pilot-assets.companion.service.js';
|
|
8
8
|
const GENERATED_ROOT_RELATIVE_PATH = path.join('technical-doc', 'src', 'generated', 'consumer-documentation');
|
|
9
|
-
|
|
9
|
+
/** Where the publish writes the API reference, application-root relative (also the documentation step's write scope). */
|
|
10
|
+
export const API_REFERENCE_GENERATED_ROOT = 'technical-doc/src/generated/api-reference';
|
|
11
|
+
const API_REFERENCE_GENERATED_ROOT_RELATIVE_PATH = path.join(...API_REFERENCE_GENERATED_ROOT.split('/'));
|
|
10
12
|
const RENDER_MANIFEST_FILE_NAME = 'render-output-manifest.json';
|
|
11
13
|
const CONSUMER_DOCUMENTATION_RENDER_REF = 'technical-documentation:render/consumer-documentation';
|
|
12
14
|
const CONSUMER_DOCUMENTATION_PUBLICATION_SIGNAL_RELATIVE_PATH = path.join('.wildo-saas', 'runtime-signals', 'technical-documentation', 'consumer-documentation-published.json');
|
package/dist/esm/technical-doc/services/technical-documentation-pilot.companion.service.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"technical-documentation-pilot.companion.service.js","sourceRoot":"","sources":["../../../../src/technical-doc/services/technical-documentation-pilot.companion.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACxG,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EACL,iDAAiD,EAEjD,2CAA2C,EAC3C,6BAA6B,GAM9B,MAAM,uDAAuD,CAAC;AAC/D,OAAO,EACL,mDAAmD,EACnD,uCAAuC,EACvC,+CAA+C,EAC/C,sCAAsC,EACtC,yCAAyC,EACzC,2CAA2C,EAC3C,iCAAiC,EACjC,yCAAyC,GAK1C,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAAE,iDAAiD,EAAE,MAAM,0DAA0D,CAAC;AAE7H,MAAM,4BAA4B,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,KAAK,EAAE,WAAW,EAAE,wBAAwB,CAAC,CAAC;AAC9G,MAAM,0CAA0C,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,KAAK,EAAE,WAAW,EAAE,eAAe,CAAC,CAAC;AACnH,MAAM,yBAAyB,GAAG,6BAA6B,CAAC;AAChE,MAAM,iCAAiC,GAAG,uDAAuD,CAAC;AAClG,MAAM,uDAAuD,GAAG,IAAI,CAAC,IAAI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AAC,CAAC,GAAG,iBAAiB,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAC9H,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;YACvD,IAAI,KAAK,CAAC,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,EAAE,CAAC;gBACnD,MAAM,iBAAiB,GAAG,CAAC,GAAG,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,YAAY,GAAG,CAAC,CAAC,CAAC;gBACjH,IAAI,CAAC,iBAAiB;oBAAE,MAAM,EAAE,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;;oBAC/D,MAAM,IAAI,CAAC,2BAA2B,CAAC,QAAQ,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC;YACrF,CAAC;iBAAM,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC;gBAC5C,MAAM,EAAE,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YAC1C,CAAC;QACH,CAAC;IACH,CAAC;CACF","sourcesContent":["import { randomUUID } from 'node:crypto';\nimport { constants } from 'node:fs';\nimport { access, lstat, mkdir, open, readFile, readdir, rename, rm, writeFile } from 'node:fs/promises';\nimport path from 'node:path';\n\nimport {\n TechnicalDocumentationApplicabilityEvidenceStatus,\n type TechnicalDocumentationApiReferenceTargetV1,\n TechnicalDocumentationAssetResolutionStatus,\n TechnicalDocumentationChannel,\n type TechnicalDocumentationAuthorizedBundleManifestV1,\n type TechnicalDocumentationPrivateDerivationManifestV1,\n type TechnicalDocumentationVersionedIdentityV1,\n type TechnicalDocumentationResolvedAssetBundleManifestV1,\n type TechnicalDocumentationSupportedApiVersion,\n} from '@wildo-ai/saas-specifications/technical-documentation';\nimport {\n createTechnicalDocumentationAggregateRenderManifest,\n createTechnicalDocumentationRenderModel,\n readTechnicalDocumentationAuthorizedRenderInput,\n renderTechnicalDocumentationDocusaurus,\n renderTechnicalDocumentationSearchIndexes,\n renderVerifiedTechnicalDocumentationOpenApi,\n technicalDocumentationSha256Bytes,\n validateTechnicalDocumentationManagedTree,\n type OpenApiGenerationOutput,\n type TechnicalDocumentationOutputBudgets,\n type TechnicalDocumentationRenderedFile,\n type TechnicalDocumentationRendererResult,\n} from '@wildo-ai/saas-technical-doc/companion';\n\nimport { TechnicalDocumentationPilotAssetsCompanionService } from './technical-documentation-pilot-assets.companion.service';\n\nconst GENERATED_ROOT_RELATIVE_PATH = path.join('technical-doc', 'src', 'generated', 'consumer-documentation');\nconst API_REFERENCE_GENERATED_ROOT_RELATIVE_PATH = path.join('technical-doc', 'src', 'generated', 'api-reference');\nconst RENDER_MANIFEST_FILE_NAME = 'render-output-manifest.json';\nconst CONSUMER_DOCUMENTATION_RENDER_REF = 'technical-documentation:render/consumer-documentation';\nconst CONSUMER_DOCUMENTATION_PUBLICATION_SIGNAL_RELATIVE_PATH = path.join(\n '.wildo-saas',\n 'runtime-signals',\n 'technical-documentation',\n 'consumer-documentation-published.json',\n);\nconst publicationOperationQueues = new Map<string, Promise<void>>();\n\nexport interface TechnicalDocumentationPilotPublicationResult {\n readonly rootPath: string;\n readonly contentPath: string;\n readonly manifest: ReturnType<typeof createTechnicalDocumentationAggregateRenderManifest>;\n readonly validation: ReturnType<typeof validateTechnicalDocumentationManagedTree>;\n}\n\nexport interface TechnicalDocumentationPilotOperationResult extends TechnicalDocumentationPilotPublicationResult {\n /**\n * Which exact stage outputs this operation joined, named `ref@version`. Four sha256 fields until\n * 2026-08-27 — unreadable in a log, unmergeable across branches, and never compared to anything.\n */\n readonly causalIdentities: {\n readonly derivation: TechnicalDocumentationVersionedIdentityV1;\n readonly authorizedBundle: TechnicalDocumentationVersionedIdentityV1;\n readonly resolvedAssetBundle: TechnicalDocumentationVersionedIdentityV1;\n readonly render: TechnicalDocumentationVersionedIdentityV1;\n };\n readonly channelCounts: { readonly publicUnits: number };\n readonly suppressions: readonly { readonly unitRef: string; readonly reason: string }[];\n readonly evidenceLimitations: readonly { readonly axis: string; readonly subjectRef: string; readonly status: string; readonly reason: string }[];\n readonly assetStates: readonly { readonly assetRef: string; readonly status: string; readonly byteDigest: string | null }[];\n readonly freshnessEvaluatedAt: string;\n}\n\nexport interface TechnicalDocumentationPilotCompositionDerivation {\n readonly privateDerivation: Pick<\n TechnicalDocumentationPrivateDerivationManifestV1,\n 'derivationRef' | 'derivationVersion' | 'environmentEvidenceSnapshot'\n >;\n readonly publicBundle: TechnicalDocumentationAuthorizedBundleManifestV1;\n}\n\nfunction assertPathWithin(parent: string, child: string): void {\n const relative = path.relative(parent, child);\n if (relative === '' || relative.startsWith('..') || path.isAbsolute(relative)) {\n throw new Error(`technical-documentation managed path escapes its root: ${child}`);\n }\n}\n\nasync function pathExists(target: string): Promise<boolean> {\n try {\n await access(target, constants.F_OK);\n return true;\n } catch {\n return false;\n }\n}\n\nasync function fsyncPath(target: string): Promise<void> {\n const handle = await open(target, 'r');\n try {\n await handle.sync();\n } finally {\n await handle.close();\n }\n}\n\nasync function listRegularFiles(root: string, relative = ''): Promise<string[]> {\n const current = relative === '' ? root : path.join(root, relative);\n const entries = await readdir(current, { withFileTypes: true });\n const files: string[] = [];\n for (const entry of entries) {\n const childRelative = relative === '' ? entry.name : path.join(relative, entry.name);\n const child = path.join(root, childRelative);\n const info = await lstat(child);\n if (info.isSymbolicLink()) throw new Error(`technical-documentation generated tree rejects symbolic links: ${childRelative}`);\n if (info.isDirectory()) files.push(...await listRegularFiles(root, childRelative));\n else if (info.isFile()) files.push(childRelative.split(path.sep).join('/'));\n else throw new Error(`technical-documentation generated tree rejects non-regular entry: ${childRelative}`);\n }\n return files.sort();\n}\n\n/**\n * Companion-owned generation boundary for application-consumer documentation.\n *\n * The complete result is synchronized into one stable, generator-owned tree.\n * API-reference files are managed directly at stable semantic paths with no\n * checksum manifest or content-addressed identity. Previous versions, diffs,\n * and rollback are intentionally delegated to Git.\n */\nexport class TechnicalDocumentationPilotCompanionService {\n public constructor(private readonly saasRoot: string) {}\n\n private async withExclusivePublicationOperation<T>(rootPath: string, operation: () => Promise<T>): Promise<T> {\n const predecessor = publicationOperationQueues.get(rootPath) ?? Promise.resolve();\n let release!: () => void;\n const currentOperation = new Promise<void>((resolve) => {\n release = resolve;\n });\n const queueTail = predecessor.catch(() => undefined).then(() => currentOperation);\n publicationOperationQueues.set(rootPath, queueTail);\n await predecessor.catch(() => undefined);\n try {\n return await operation();\n } finally {\n release();\n if (publicationOperationQueues.get(rootPath) === queueTail) publicationOperationQueues.delete(rootPath);\n }\n }\n\n public async generateValidateAndPublish(input: {\n readonly derivation: TechnicalDocumentationPilotCompositionDerivation;\n readonly supportedApiVersion: TechnicalDocumentationSupportedApiVersion;\n readonly refuseProvisionalAssets?: boolean;\n readonly forbiddenPublicSentinels: readonly string[];\n readonly budgets: TechnicalDocumentationOutputBudgets;\n /** Returns `null` when this application does not publish the target — the link degrades to plain text (#472). */\n readonly resolveApiReferenceTarget?: (target: TechnicalDocumentationApiReferenceTargetV1) => string | null;\n readonly resolvedAt?: string;\n readonly publishedAt?: string;\n }): Promise<TechnicalDocumentationPilotOperationResult> {\n const publicationEvaluatedAt = input.publishedAt ?? new Date().toISOString();\n const publicationEvaluatedAtEpochMs = Date.parse(publicationEvaluatedAt);\n const freshnessEvaluatedAtEpochMs = Date.parse(input.derivation.privateDerivation.environmentEvidenceSnapshot.freshnessEvaluatedAt);\n if (publicationEvaluatedAtEpochMs < freshnessEvaluatedAtEpochMs) {\n throw new Error('technical-documentation publication time cannot precede the derivation freshness evaluation');\n }\n const assets = await new TechnicalDocumentationPilotAssetsCompanionService().resolve({\n authorizedBundle: input.derivation.publicBundle,\n ...(input.resolvedAt === undefined ? {} : { resolvedAt: input.resolvedAt }),\n });\n if (input.refuseProvisionalAssets === true) {\n const provisional = assets.resolvedAssetBundle.resolvedAssetSet.assets\n .filter((asset) => asset.status === TechnicalDocumentationAssetResolutionStatus.PLACEHOLDER)\n .map((asset) => asset.assetRef);\n if (provisional.length > 0) {\n throw new Error(`technical-documentation publication refuses provisional assets in this environment: ${provisional.join(', ')}`);\n }\n }\n\n const verified = readTechnicalDocumentationAuthorizedRenderInput({\n authorizedBundle: input.derivation.publicBundle,\n resolvedAssetBundle: assets.resolvedAssetBundle,\n assetBytesByPath: assets.assetBytesByPath,\n });\n for (const observation of input.derivation.privateDerivation.environmentEvidenceSnapshot.observations) {\n if (\n observation.validUntil !== null\n && [\n TechnicalDocumentationApplicabilityEvidenceStatus.PROVEN,\n TechnicalDocumentationApplicabilityEvidenceStatus.DISPROVEN,\n TechnicalDocumentationApplicabilityEvidenceStatus.CONFLICTED,\n ].includes(observation.status)\n && Date.parse(observation.validUntil) <= publicationEvaluatedAtEpochMs\n ) {\n throw new Error(`technical-documentation publication requires re-derivation because evidence expired during asset resolution: ${observation.axis}/${observation.subjectRef}`);\n }\n }\n\n const renderModel = createTechnicalDocumentationRenderModel(verified.authorizedBundle);\n /*\n * Two renderers, not three. A portable-markdown family was rendered here for as long as this\n * pipeline existed and NOTHING ever read it: the site mounts `docusaurus/docs`,\n * `docusaurus/sidebars.json` and `docusaurus/static`, and `src/pages/search.tsx` reads\n * `indexes/search.json` — measured with a positive control, so the empty result is a real\n * absence rather than a bad probe. It cost 81 files and 511 KB per publication, half the\n * published bytes, and it silently DOUBLED the operator-facing page budget: both families emit\n * `MARKDOWN_DOCUMENT`, so a 81-page application counted 162 against `maximumPageCount` (#274).\n */\n const rendererResults = [\n renderTechnicalDocumentationSearchIndexes(renderModel),\n renderTechnicalDocumentationDocusaurus({ model: renderModel, resolvedAssetBundle: verified.resolvedAssetBundle, assetBytesByPath: assets.assetBytesByPath, resolveApiReferenceTarget: input.resolveApiReferenceTarget }),\n ];\n const publication = await this.publish({\n authorizedBundle: verified.authorizedBundle,\n resolvedAssetBundle: verified.resolvedAssetBundle,\n supportedApiVersion: input.supportedApiVersion,\n rendererResults,\n forbiddenPublicSentinels: input.forbiddenPublicSentinels,\n budgets: input.budgets,\n publishedAt: publicationEvaluatedAt,\n });\n const evidenceLimitations = input.derivation.privateDerivation.environmentEvidenceSnapshot.observations\n .filter((observation) => observation.status !== TechnicalDocumentationApplicabilityEvidenceStatus.PROVEN)\n .map((observation) => ({ axis: observation.axis, subjectRef: observation.subjectRef, status: observation.status, reason: observation.reason }));\n\n return Object.freeze({\n ...publication,\n causalIdentities: Object.freeze({\n derivation: { ref: input.derivation.privateDerivation.derivationRef, version: input.derivation.privateDerivation.derivationVersion },\n authorizedBundle: { ref: verified.authorizedBundle.bundleRef, version: verified.authorizedBundle.bundleVersion },\n resolvedAssetBundle: { ref: verified.resolvedAssetBundle.assetBundleRef, version: verified.resolvedAssetBundle.assetBundleVersion },\n render: { ref: publication.manifest.renderRef, version: publication.manifest.renderVersion },\n }),\n channelCounts: Object.freeze({ publicUnits: input.derivation.publicBundle.units.length }),\n suppressions: Object.freeze(input.derivation.publicBundle.decisions\n .filter((decision) => decision.publishedUnitVersion === null)\n .map((decision) => ({ unitRef: decision.unitRef, reason: decision.reason }))),\n evidenceLimitations: Object.freeze(evidenceLimitations),\n assetStates: Object.freeze(assets.resolvedAssetBundle.resolvedAssetSet.assets.map((asset) => ({\n assetRef: asset.assetRef,\n status: asset.status,\n byteDigest: asset.byteDigest,\n }))),\n freshnessEvaluatedAt: input.derivation.privateDerivation.environmentEvidenceSnapshot.freshnessEvaluatedAt,\n });\n }\n\n public async publish(input: {\n readonly authorizedBundle: TechnicalDocumentationAuthorizedBundleManifestV1;\n readonly resolvedAssetBundle: TechnicalDocumentationResolvedAssetBundleManifestV1;\n readonly supportedApiVersion: TechnicalDocumentationSupportedApiVersion;\n readonly rendererResults: readonly TechnicalDocumentationRendererResult[];\n readonly forbiddenPublicSentinels: readonly string[];\n readonly budgets: TechnicalDocumentationOutputBudgets;\n readonly publishedAt?: string;\n }): Promise<TechnicalDocumentationPilotPublicationResult> {\n const rootPath = path.resolve(this.saasRoot, GENERATED_ROOT_RELATIVE_PATH);\n return this.withExclusivePublicationOperation(rootPath, async () => {\n if (input.authorizedBundle.channel !== TechnicalDocumentationChannel.PUBLIC_PORTAL) {\n throw new Error('technical-documentation consumer publisher accepts only a PUBLIC_PORTAL bundle');\n }\n const manifest = createTechnicalDocumentationAggregateRenderManifest({\n ...input,\n renderRef: CONSUMER_DOCUMENTATION_RENDER_REF,\n // One render per authorized bundle version: re-rendering the same bundle is the same render.\n renderVersion: input.authorizedBundle.bundleVersion,\n });\n const files = input.rendererResults.flatMap((result) => result.files);\n const validation = validateTechnicalDocumentationManagedTree({ ...input, manifest, files });\n assertPathWithin(path.resolve(this.saasRoot), rootPath);\n await this.synchronizeGeneratedTree(rootPath, RENDER_MANIFEST_FILE_NAME, manifest, files);\n await this.writeConsumerDocumentationPublicationSignal({\n renderRef: manifest.renderRef,\n renderVersion: manifest.renderVersion,\n publishedAt: input.publishedAt ?? new Date().toISOString(),\n });\n return Object.freeze({ rootPath, contentPath: rootPath, manifest, validation });\n });\n }\n\n /** Publishes only renderer-produced OpenAPI files into the separate API tree. */\n public async publishOpenApiDocuments(input: {\n readonly documents: OpenApiGenerationOutput;\n readonly sourceUnitRefs: readonly string[];\n }): Promise<{ readonly rootPath: string; readonly outputPaths: readonly string[] }> {\n const rootPath = path.resolve(this.saasRoot, API_REFERENCE_GENERATED_ROOT_RELATIVE_PATH);\n return this.withExclusivePublicationOperation(rootPath, async () => {\n assertPathWithin(path.resolve(this.saasRoot), rootPath);\n const renderer = renderVerifiedTechnicalDocumentationOpenApi(input);\n await this.synchronizeGeneratedFiles(rootPath, renderer.files);\n return Object.freeze({\n rootPath,\n outputPaths: Object.freeze(renderer.files.map((file) => file.normalizedRelativePath).sort()),\n });\n });\n }\n\n /**\n * Synchronizes a generated tree from semantic paths alone.\n *\n * The API reference is reproducible output checked into Git, so a parallel\n * checksum inventory adds a second representation without adding product\n * meaning. Exact path inventory still prevents stale generated files from\n * surviving a section or filename change.\n */\n private async synchronizeGeneratedFiles(\n rootPath: string,\n files: readonly Pick<TechnicalDocumentationRenderedFile, 'normalizedRelativePath' | 'bytes'>[],\n ): Promise<void> {\n await mkdir(rootPath, { recursive: true });\n const rootInfo = await lstat(rootPath);\n if (!rootInfo.isDirectory() || rootInfo.isSymbolicLink()) {\n throw new Error('technical-documentation generated root must be a regular directory');\n }\n\n const expectedPaths = new Set(files.map((file) => file.normalizedRelativePath));\n for (const file of files) await this.writeGeneratedFile(rootPath, file.normalizedRelativePath, file.bytes);\n await this.removeStaleGeneratedEntries(rootPath, expectedPaths);\n\n const inventory = await listRegularFiles(rootPath);\n if (inventory.join('\\0') !== [...expectedPaths].sort().join('\\0')) {\n throw new Error('technical-documentation generated tree inventory does not match the render result');\n }\n await fsyncPath(rootPath);\n }\n\n private async synchronizeGeneratedTree(\n rootPath: string,\n manifestFileName: string,\n manifest: { readonly outputs: readonly { readonly normalizedRelativePath: string; readonly byteLength: number; readonly byteDigest: string }[] },\n files: readonly TechnicalDocumentationRenderedFile[],\n ): Promise<void> {\n await mkdir(rootPath, { recursive: true });\n const rootInfo = await lstat(rootPath);\n if (!rootInfo.isDirectory() || rootInfo.isSymbolicLink()) {\n throw new Error('technical-documentation generated root must be a regular directory');\n }\n\n const expectedPaths = new Set<string>([\n manifestFileName,\n ...files.map((file) => file.normalizedRelativePath),\n ]);\n for (const file of files) await this.writeGeneratedFile(rootPath, file.normalizedRelativePath, file.bytes);\n await this.writeGeneratedFile(rootPath, manifestFileName, `${JSON.stringify(manifest, null, 2)}\\n`);\n await this.removeStaleGeneratedEntries(rootPath, expectedPaths);\n\n const inventory = await listRegularFiles(rootPath);\n if (inventory.join('\\0') !== [...expectedPaths].sort().join('\\0')) {\n throw new Error('technical-documentation generated tree inventory does not match the render result');\n }\n for (const output of manifest.outputs) {\n const bytes = await readFile(path.join(rootPath, output.normalizedRelativePath));\n if (bytes.byteLength !== output.byteLength || technicalDocumentationSha256Bytes(bytes) !== output.byteDigest) {\n throw new Error(`technical-documentation generated tree byte mismatch: ${output.normalizedRelativePath}`);\n }\n }\n await fsyncPath(rootPath);\n }\n\n /**\n * Tells the local docs host that a complete, verified publication is ready.\n *\n * This signal is deliberately outside the checked-in generated tree. The\n * tree remains a stable, content-addressed-by-manifest publication owned by\n * Git; the signal is ephemeral local-dev orchestration state. It is written\n * only after all rendered bytes and the manifest have been synchronized and\n * re-verified, so a Docusaurus reload cannot observe a half-publication.\n */\n private async writeConsumerDocumentationPublicationSignal(input: {\n readonly renderRef: string;\n readonly renderVersion: number;\n readonly publishedAt: string;\n }): Promise<void> {\n const signalPath = path.resolve(this.saasRoot, CONSUMER_DOCUMENTATION_PUBLICATION_SIGNAL_RELATIVE_PATH);\n assertPathWithin(path.resolve(this.saasRoot), signalPath);\n const signalDirectory = path.dirname(signalPath);\n await mkdir(signalDirectory, { recursive: true });\n const temporaryPath = path.join(signalDirectory, `.${path.basename(signalPath)}.wildo-tmp-${randomUUID()}`);\n try {\n await writeFile(temporaryPath, `${JSON.stringify({ schemaVersion: 1, ...input }, null, 2)}\\n`);\n await fsyncPath(temporaryPath);\n await rename(temporaryPath, signalPath);\n await fsyncPath(signalDirectory);\n } catch (error) {\n await rm(temporaryPath, { force: true });\n throw error;\n }\n }\n\n private async writeGeneratedFile(rootPath: string, relativePath: string, bytes: Uint8Array | string): Promise<void> {\n const target = path.resolve(rootPath, relativePath);\n assertPathWithin(rootPath, target);\n await this.prepareGeneratedParent(rootPath, path.dirname(target));\n if (await pathExists(target)) {\n const targetInfo = await lstat(target);\n if (targetInfo.isDirectory()) await rm(target, { recursive: true });\n else if (targetInfo.isFile()) {\n const currentBytes = await readFile(target);\n const nextBytes = typeof bytes === 'string' ? Buffer.from(bytes, 'utf8') : bytes;\n if (currentBytes.equals(nextBytes)) return;\n }\n }\n const temporary = path.join(path.dirname(target), `.${path.basename(target)}.wildo-tmp-${randomUUID()}`);\n try {\n await writeFile(temporary, bytes);\n await fsyncPath(temporary);\n await rename(temporary, target);\n await fsyncPath(path.dirname(target));\n } catch (error) {\n await rm(temporary, { force: true });\n throw error;\n }\n }\n\n private async prepareGeneratedParent(rootPath: string, parentPath: string): Promise<void> {\n const relative = path.relative(rootPath, parentPath);\n if (relative === '') return;\n let current = rootPath;\n for (const segment of relative.split(path.sep)) {\n current = path.join(current, segment);\n let directoryExists = false;\n if (await pathExists(current)) {\n const info = await lstat(current);\n if (info.isSymbolicLink()) throw new Error(`technical-documentation generated path rejects symbolic-link parent: ${current}`);\n if (!info.isDirectory()) await rm(current);\n else directoryExists = true;\n }\n if (!directoryExists) await mkdir(current);\n }\n }\n\n private async removeStaleGeneratedEntries(\n rootPath: string,\n expectedPaths: ReadonlySet<string>,\n relativeDirectory = '',\n ): Promise<void> {\n const directory = relativeDirectory === '' ? rootPath : path.join(rootPath, relativeDirectory);\n for (const entry of await readdir(directory, { withFileTypes: true })) {\n const relativePath = (relativeDirectory === '' ? entry.name : `${relativeDirectory}/${entry.name}`).split(path.sep).join('/');\n const absolutePath = path.join(rootPath, relativePath);\n if (entry.isDirectory() && !entry.isSymbolicLink()) {\n const directoryIsNeeded = [...expectedPaths].some((expectedPath) => expectedPath.startsWith(`${relativePath}/`));\n if (!directoryIsNeeded) await rm(absolutePath, { recursive: true });\n else await this.removeStaleGeneratedEntries(rootPath, expectedPaths, relativePath);\n } else if (!expectedPaths.has(relativePath)) {\n await rm(absolutePath, { force: true });\n }\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"technical-documentation-pilot.companion.service.js","sourceRoot":"","sources":["../../../../src/technical-doc/services/technical-documentation-pilot.companion.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,MAAM,EAA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AAC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,YAAY,GAAG,CAAC,CAAC,CAAC;gBACjH,IAAI,CAAC,iBAAiB;oBAAE,MAAM,EAAE,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;;oBAC/D,MAAM,IAAI,CAAC,2BAA2B,CAAC,QAAQ,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC;YACrF,CAAC;iBAAM,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC;gBAC5C,MAAM,EAAE,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YAC1C,CAAC;QACH,CAAC;IACH,CAAC;CACF","sourcesContent":["import { randomUUID } from 'node:crypto';\nimport { constants } from 'node:fs';\nimport { access, lstat, mkdir, open, readFile, readdir, rename, rm, writeFile } from 'node:fs/promises';\nimport path from 'node:path';\n\nimport {\n TechnicalDocumentationApplicabilityEvidenceStatus,\n type TechnicalDocumentationApiReferenceTargetV1,\n TechnicalDocumentationAssetResolutionStatus,\n TechnicalDocumentationChannel,\n type TechnicalDocumentationAuthorizedBundleManifestV1,\n type TechnicalDocumentationPrivateDerivationManifestV1,\n type TechnicalDocumentationVersionedIdentityV1,\n type TechnicalDocumentationResolvedAssetBundleManifestV1,\n type TechnicalDocumentationSupportedApiVersion,\n} from '@wildo-ai/saas-specifications/technical-documentation';\nimport {\n createTechnicalDocumentationAggregateRenderManifest,\n createTechnicalDocumentationRenderModel,\n readTechnicalDocumentationAuthorizedRenderInput,\n renderTechnicalDocumentationDocusaurus,\n renderTechnicalDocumentationSearchIndexes,\n renderVerifiedTechnicalDocumentationOpenApi,\n technicalDocumentationSha256Bytes,\n validateTechnicalDocumentationManagedTree,\n type OpenApiGenerationOutput,\n type TechnicalDocumentationOutputBudgets,\n type TechnicalDocumentationRenderedFile,\n type TechnicalDocumentationRendererResult,\n} from '@wildo-ai/saas-technical-doc/companion';\n\nimport { TechnicalDocumentationPilotAssetsCompanionService } from './technical-documentation-pilot-assets.companion.service';\n\nconst GENERATED_ROOT_RELATIVE_PATH = path.join('technical-doc', 'src', 'generated', 'consumer-documentation');\n/** Where the publish writes the API reference, application-root relative (also the documentation step's write scope). */\nexport const API_REFERENCE_GENERATED_ROOT = 'technical-doc/src/generated/api-reference';\nconst API_REFERENCE_GENERATED_ROOT_RELATIVE_PATH = path.join(...API_REFERENCE_GENERATED_ROOT.split('/'));\nconst RENDER_MANIFEST_FILE_NAME = 'render-output-manifest.json';\nconst CONSUMER_DOCUMENTATION_RENDER_REF = 'technical-documentation:render/consumer-documentation';\nconst CONSUMER_DOCUMENTATION_PUBLICATION_SIGNAL_RELATIVE_PATH = path.join(\n '.wildo-saas',\n 'runtime-signals',\n 'technical-documentation',\n 'consumer-documentation-published.json',\n);\nconst publicationOperationQueues = new Map<string, Promise<void>>();\n\nexport interface TechnicalDocumentationPilotPublicationResult {\n readonly rootPath: string;\n readonly contentPath: string;\n readonly manifest: ReturnType<typeof createTechnicalDocumentationAggregateRenderManifest>;\n readonly validation: ReturnType<typeof validateTechnicalDocumentationManagedTree>;\n}\n\nexport interface TechnicalDocumentationPilotOperationResult extends TechnicalDocumentationPilotPublicationResult {\n /**\n * Which exact stage outputs this operation joined, named `ref@version`. Four sha256 fields until\n * 2026-08-27 — unreadable in a log, unmergeable across branches, and never compared to anything.\n */\n readonly causalIdentities: {\n readonly derivation: TechnicalDocumentationVersionedIdentityV1;\n readonly authorizedBundle: TechnicalDocumentationVersionedIdentityV1;\n readonly resolvedAssetBundle: TechnicalDocumentationVersionedIdentityV1;\n readonly render: TechnicalDocumentationVersionedIdentityV1;\n };\n readonly channelCounts: { readonly publicUnits: number };\n readonly suppressions: readonly { readonly unitRef: string; readonly reason: string }[];\n readonly evidenceLimitations: readonly { readonly axis: string; readonly subjectRef: string; readonly status: string; readonly reason: string }[];\n readonly assetStates: readonly { readonly assetRef: string; readonly status: string; readonly byteDigest: string | null }[];\n readonly freshnessEvaluatedAt: string;\n}\n\nexport interface TechnicalDocumentationPilotCompositionDerivation {\n readonly privateDerivation: Pick<\n TechnicalDocumentationPrivateDerivationManifestV1,\n 'derivationRef' | 'derivationVersion' | 'environmentEvidenceSnapshot'\n >;\n readonly publicBundle: TechnicalDocumentationAuthorizedBundleManifestV1;\n}\n\nfunction assertPathWithin(parent: string, child: string): void {\n const relative = path.relative(parent, child);\n if (relative === '' || relative.startsWith('..') || path.isAbsolute(relative)) {\n throw new Error(`technical-documentation managed path escapes its root: ${child}`);\n }\n}\n\nasync function pathExists(target: string): Promise<boolean> {\n try {\n await access(target, constants.F_OK);\n return true;\n } catch {\n return false;\n }\n}\n\nasync function fsyncPath(target: string): Promise<void> {\n const handle = await open(target, 'r');\n try {\n await handle.sync();\n } finally {\n await handle.close();\n }\n}\n\nasync function listRegularFiles(root: string, relative = ''): Promise<string[]> {\n const current = relative === '' ? root : path.join(root, relative);\n const entries = await readdir(current, { withFileTypes: true });\n const files: string[] = [];\n for (const entry of entries) {\n const childRelative = relative === '' ? entry.name : path.join(relative, entry.name);\n const child = path.join(root, childRelative);\n const info = await lstat(child);\n if (info.isSymbolicLink()) throw new Error(`technical-documentation generated tree rejects symbolic links: ${childRelative}`);\n if (info.isDirectory()) files.push(...await listRegularFiles(root, childRelative));\n else if (info.isFile()) files.push(childRelative.split(path.sep).join('/'));\n else throw new Error(`technical-documentation generated tree rejects non-regular entry: ${childRelative}`);\n }\n return files.sort();\n}\n\n/**\n * Companion-owned generation boundary for application-consumer documentation.\n *\n * The complete result is synchronized into one stable, generator-owned tree.\n * API-reference files are managed directly at stable semantic paths with no\n * checksum manifest or content-addressed identity. Previous versions, diffs,\n * and rollback are intentionally delegated to Git.\n */\nexport class TechnicalDocumentationPilotCompanionService {\n public constructor(private readonly saasRoot: string) {}\n\n private async withExclusivePublicationOperation<T>(rootPath: string, operation: () => Promise<T>): Promise<T> {\n const predecessor = publicationOperationQueues.get(rootPath) ?? Promise.resolve();\n let release!: () => void;\n const currentOperation = new Promise<void>((resolve) => {\n release = resolve;\n });\n const queueTail = predecessor.catch(() => undefined).then(() => currentOperation);\n publicationOperationQueues.set(rootPath, queueTail);\n await predecessor.catch(() => undefined);\n try {\n return await operation();\n } finally {\n release();\n if (publicationOperationQueues.get(rootPath) === queueTail) publicationOperationQueues.delete(rootPath);\n }\n }\n\n public async generateValidateAndPublish(input: {\n readonly derivation: TechnicalDocumentationPilotCompositionDerivation;\n readonly supportedApiVersion: TechnicalDocumentationSupportedApiVersion;\n readonly refuseProvisionalAssets?: boolean;\n readonly forbiddenPublicSentinels: readonly string[];\n readonly budgets: TechnicalDocumentationOutputBudgets;\n /** Returns `null` when this application does not publish the target — the link degrades to plain text (#472). */\n readonly resolveApiReferenceTarget?: (target: TechnicalDocumentationApiReferenceTargetV1) => string | null;\n readonly resolvedAt?: string;\n readonly publishedAt?: string;\n }): Promise<TechnicalDocumentationPilotOperationResult> {\n const publicationEvaluatedAt = input.publishedAt ?? new Date().toISOString();\n const publicationEvaluatedAtEpochMs = Date.parse(publicationEvaluatedAt);\n const freshnessEvaluatedAtEpochMs = Date.parse(input.derivation.privateDerivation.environmentEvidenceSnapshot.freshnessEvaluatedAt);\n if (publicationEvaluatedAtEpochMs < freshnessEvaluatedAtEpochMs) {\n throw new Error('technical-documentation publication time cannot precede the derivation freshness evaluation');\n }\n const assets = await new TechnicalDocumentationPilotAssetsCompanionService().resolve({\n authorizedBundle: input.derivation.publicBundle,\n ...(input.resolvedAt === undefined ? {} : { resolvedAt: input.resolvedAt }),\n });\n if (input.refuseProvisionalAssets === true) {\n const provisional = assets.resolvedAssetBundle.resolvedAssetSet.assets\n .filter((asset) => asset.status === TechnicalDocumentationAssetResolutionStatus.PLACEHOLDER)\n .map((asset) => asset.assetRef);\n if (provisional.length > 0) {\n throw new Error(`technical-documentation publication refuses provisional assets in this environment: ${provisional.join(', ')}`);\n }\n }\n\n const verified = readTechnicalDocumentationAuthorizedRenderInput({\n authorizedBundle: input.derivation.publicBundle,\n resolvedAssetBundle: assets.resolvedAssetBundle,\n assetBytesByPath: assets.assetBytesByPath,\n });\n for (const observation of input.derivation.privateDerivation.environmentEvidenceSnapshot.observations) {\n if (\n observation.validUntil !== null\n && [\n TechnicalDocumentationApplicabilityEvidenceStatus.PROVEN,\n TechnicalDocumentationApplicabilityEvidenceStatus.DISPROVEN,\n TechnicalDocumentationApplicabilityEvidenceStatus.CONFLICTED,\n ].includes(observation.status)\n && Date.parse(observation.validUntil) <= publicationEvaluatedAtEpochMs\n ) {\n throw new Error(`technical-documentation publication requires re-derivation because evidence expired during asset resolution: ${observation.axis}/${observation.subjectRef}`);\n }\n }\n\n const renderModel = createTechnicalDocumentationRenderModel(verified.authorizedBundle);\n /*\n * Two renderers, not three. A portable-markdown family was rendered here for as long as this\n * pipeline existed and NOTHING ever read it: the site mounts `docusaurus/docs`,\n * `docusaurus/sidebars.json` and `docusaurus/static`, and `src/pages/search.tsx` reads\n * `indexes/search.json` — measured with a positive control, so the empty result is a real\n * absence rather than a bad probe. It cost 81 files and 511 KB per publication, half the\n * published bytes, and it silently DOUBLED the operator-facing page budget: both families emit\n * `MARKDOWN_DOCUMENT`, so a 81-page application counted 162 against `maximumPageCount` (#274).\n */\n const rendererResults = [\n renderTechnicalDocumentationSearchIndexes(renderModel),\n renderTechnicalDocumentationDocusaurus({ model: renderModel, resolvedAssetBundle: verified.resolvedAssetBundle, assetBytesByPath: assets.assetBytesByPath, resolveApiReferenceTarget: input.resolveApiReferenceTarget }),\n ];\n const publication = await this.publish({\n authorizedBundle: verified.authorizedBundle,\n resolvedAssetBundle: verified.resolvedAssetBundle,\n supportedApiVersion: input.supportedApiVersion,\n rendererResults,\n forbiddenPublicSentinels: input.forbiddenPublicSentinels,\n budgets: input.budgets,\n publishedAt: publicationEvaluatedAt,\n });\n const evidenceLimitations = input.derivation.privateDerivation.environmentEvidenceSnapshot.observations\n .filter((observation) => observation.status !== TechnicalDocumentationApplicabilityEvidenceStatus.PROVEN)\n .map((observation) => ({ axis: observation.axis, subjectRef: observation.subjectRef, status: observation.status, reason: observation.reason }));\n\n return Object.freeze({\n ...publication,\n causalIdentities: Object.freeze({\n derivation: { ref: input.derivation.privateDerivation.derivationRef, version: input.derivation.privateDerivation.derivationVersion },\n authorizedBundle: { ref: verified.authorizedBundle.bundleRef, version: verified.authorizedBundle.bundleVersion },\n resolvedAssetBundle: { ref: verified.resolvedAssetBundle.assetBundleRef, version: verified.resolvedAssetBundle.assetBundleVersion },\n render: { ref: publication.manifest.renderRef, version: publication.manifest.renderVersion },\n }),\n channelCounts: Object.freeze({ publicUnits: input.derivation.publicBundle.units.length }),\n suppressions: Object.freeze(input.derivation.publicBundle.decisions\n .filter((decision) => decision.publishedUnitVersion === null)\n .map((decision) => ({ unitRef: decision.unitRef, reason: decision.reason }))),\n evidenceLimitations: Object.freeze(evidenceLimitations),\n assetStates: Object.freeze(assets.resolvedAssetBundle.resolvedAssetSet.assets.map((asset) => ({\n assetRef: asset.assetRef,\n status: asset.status,\n byteDigest: asset.byteDigest,\n }))),\n freshnessEvaluatedAt: input.derivation.privateDerivation.environmentEvidenceSnapshot.freshnessEvaluatedAt,\n });\n }\n\n public async publish(input: {\n readonly authorizedBundle: TechnicalDocumentationAuthorizedBundleManifestV1;\n readonly resolvedAssetBundle: TechnicalDocumentationResolvedAssetBundleManifestV1;\n readonly supportedApiVersion: TechnicalDocumentationSupportedApiVersion;\n readonly rendererResults: readonly TechnicalDocumentationRendererResult[];\n readonly forbiddenPublicSentinels: readonly string[];\n readonly budgets: TechnicalDocumentationOutputBudgets;\n readonly publishedAt?: string;\n }): Promise<TechnicalDocumentationPilotPublicationResult> {\n const rootPath = path.resolve(this.saasRoot, GENERATED_ROOT_RELATIVE_PATH);\n return this.withExclusivePublicationOperation(rootPath, async () => {\n if (input.authorizedBundle.channel !== TechnicalDocumentationChannel.PUBLIC_PORTAL) {\n throw new Error('technical-documentation consumer publisher accepts only a PUBLIC_PORTAL bundle');\n }\n const manifest = createTechnicalDocumentationAggregateRenderManifest({\n ...input,\n renderRef: CONSUMER_DOCUMENTATION_RENDER_REF,\n // One render per authorized bundle version: re-rendering the same bundle is the same render.\n renderVersion: input.authorizedBundle.bundleVersion,\n });\n const files = input.rendererResults.flatMap((result) => result.files);\n const validation = validateTechnicalDocumentationManagedTree({ ...input, manifest, files });\n assertPathWithin(path.resolve(this.saasRoot), rootPath);\n await this.synchronizeGeneratedTree(rootPath, RENDER_MANIFEST_FILE_NAME, manifest, files);\n await this.writeConsumerDocumentationPublicationSignal({\n renderRef: manifest.renderRef,\n renderVersion: manifest.renderVersion,\n publishedAt: input.publishedAt ?? new Date().toISOString(),\n });\n return Object.freeze({ rootPath, contentPath: rootPath, manifest, validation });\n });\n }\n\n /** Publishes only renderer-produced OpenAPI files into the separate API tree. */\n public async publishOpenApiDocuments(input: {\n readonly documents: OpenApiGenerationOutput;\n readonly sourceUnitRefs: readonly string[];\n }): Promise<{ readonly rootPath: string; readonly outputPaths: readonly string[] }> {\n const rootPath = path.resolve(this.saasRoot, API_REFERENCE_GENERATED_ROOT_RELATIVE_PATH);\n return this.withExclusivePublicationOperation(rootPath, async () => {\n assertPathWithin(path.resolve(this.saasRoot), rootPath);\n const renderer = renderVerifiedTechnicalDocumentationOpenApi(input);\n await this.synchronizeGeneratedFiles(rootPath, renderer.files);\n return Object.freeze({\n rootPath,\n outputPaths: Object.freeze(renderer.files.map((file) => file.normalizedRelativePath).sort()),\n });\n });\n }\n\n /**\n * Synchronizes a generated tree from semantic paths alone.\n *\n * The API reference is reproducible output checked into Git, so a parallel\n * checksum inventory adds a second representation without adding product\n * meaning. Exact path inventory still prevents stale generated files from\n * surviving a section or filename change.\n */\n private async synchronizeGeneratedFiles(\n rootPath: string,\n files: readonly Pick<TechnicalDocumentationRenderedFile, 'normalizedRelativePath' | 'bytes'>[],\n ): Promise<void> {\n await mkdir(rootPath, { recursive: true });\n const rootInfo = await lstat(rootPath);\n if (!rootInfo.isDirectory() || rootInfo.isSymbolicLink()) {\n throw new Error('technical-documentation generated root must be a regular directory');\n }\n\n const expectedPaths = new Set(files.map((file) => file.normalizedRelativePath));\n for (const file of files) await this.writeGeneratedFile(rootPath, file.normalizedRelativePath, file.bytes);\n await this.removeStaleGeneratedEntries(rootPath, expectedPaths);\n\n const inventory = await listRegularFiles(rootPath);\n if (inventory.join('\\0') !== [...expectedPaths].sort().join('\\0')) {\n throw new Error('technical-documentation generated tree inventory does not match the render result');\n }\n await fsyncPath(rootPath);\n }\n\n private async synchronizeGeneratedTree(\n rootPath: string,\n manifestFileName: string,\n manifest: { readonly outputs: readonly { readonly normalizedRelativePath: string; readonly byteLength: number; readonly byteDigest: string }[] },\n files: readonly TechnicalDocumentationRenderedFile[],\n ): Promise<void> {\n await mkdir(rootPath, { recursive: true });\n const rootInfo = await lstat(rootPath);\n if (!rootInfo.isDirectory() || rootInfo.isSymbolicLink()) {\n throw new Error('technical-documentation generated root must be a regular directory');\n }\n\n const expectedPaths = new Set<string>([\n manifestFileName,\n ...files.map((file) => file.normalizedRelativePath),\n ]);\n for (const file of files) await this.writeGeneratedFile(rootPath, file.normalizedRelativePath, file.bytes);\n await this.writeGeneratedFile(rootPath, manifestFileName, `${JSON.stringify(manifest, null, 2)}\\n`);\n await this.removeStaleGeneratedEntries(rootPath, expectedPaths);\n\n const inventory = await listRegularFiles(rootPath);\n if (inventory.join('\\0') !== [...expectedPaths].sort().join('\\0')) {\n throw new Error('technical-documentation generated tree inventory does not match the render result');\n }\n for (const output of manifest.outputs) {\n const bytes = await readFile(path.join(rootPath, output.normalizedRelativePath));\n if (bytes.byteLength !== output.byteLength || technicalDocumentationSha256Bytes(bytes) !== output.byteDigest) {\n throw new Error(`technical-documentation generated tree byte mismatch: ${output.normalizedRelativePath}`);\n }\n }\n await fsyncPath(rootPath);\n }\n\n /**\n * Tells the local docs host that a complete, verified publication is ready.\n *\n * This signal is deliberately outside the checked-in generated tree. The\n * tree remains a stable, content-addressed-by-manifest publication owned by\n * Git; the signal is ephemeral local-dev orchestration state. It is written\n * only after all rendered bytes and the manifest have been synchronized and\n * re-verified, so a Docusaurus reload cannot observe a half-publication.\n */\n private async writeConsumerDocumentationPublicationSignal(input: {\n readonly renderRef: string;\n readonly renderVersion: number;\n readonly publishedAt: string;\n }): Promise<void> {\n const signalPath = path.resolve(this.saasRoot, CONSUMER_DOCUMENTATION_PUBLICATION_SIGNAL_RELATIVE_PATH);\n assertPathWithin(path.resolve(this.saasRoot), signalPath);\n const signalDirectory = path.dirname(signalPath);\n await mkdir(signalDirectory, { recursive: true });\n const temporaryPath = path.join(signalDirectory, `.${path.basename(signalPath)}.wildo-tmp-${randomUUID()}`);\n try {\n await writeFile(temporaryPath, `${JSON.stringify({ schemaVersion: 1, ...input }, null, 2)}\\n`);\n await fsyncPath(temporaryPath);\n await rename(temporaryPath, signalPath);\n await fsyncPath(signalDirectory);\n } catch (error) {\n await rm(temporaryPath, { force: true });\n throw error;\n }\n }\n\n private async writeGeneratedFile(rootPath: string, relativePath: string, bytes: Uint8Array | string): Promise<void> {\n const target = path.resolve(rootPath, relativePath);\n assertPathWithin(rootPath, target);\n await this.prepareGeneratedParent(rootPath, path.dirname(target));\n if (await pathExists(target)) {\n const targetInfo = await lstat(target);\n if (targetInfo.isDirectory()) await rm(target, { recursive: true });\n else if (targetInfo.isFile()) {\n const currentBytes = await readFile(target);\n const nextBytes = typeof bytes === 'string' ? Buffer.from(bytes, 'utf8') : bytes;\n if (currentBytes.equals(nextBytes)) return;\n }\n }\n const temporary = path.join(path.dirname(target), `.${path.basename(target)}.wildo-tmp-${randomUUID()}`);\n try {\n await writeFile(temporary, bytes);\n await fsyncPath(temporary);\n await rename(temporary, target);\n await fsyncPath(path.dirname(target));\n } catch (error) {\n await rm(temporary, { force: true });\n throw error;\n }\n }\n\n private async prepareGeneratedParent(rootPath: string, parentPath: string): Promise<void> {\n const relative = path.relative(rootPath, parentPath);\n if (relative === '') return;\n let current = rootPath;\n for (const segment of relative.split(path.sep)) {\n current = path.join(current, segment);\n let directoryExists = false;\n if (await pathExists(current)) {\n const info = await lstat(current);\n if (info.isSymbolicLink()) throw new Error(`technical-documentation generated path rejects symbolic-link parent: ${current}`);\n if (!info.isDirectory()) await rm(current);\n else directoryExists = true;\n }\n if (!directoryExists) await mkdir(current);\n }\n }\n\n private async removeStaleGeneratedEntries(\n rootPath: string,\n expectedPaths: ReadonlySet<string>,\n relativeDirectory = '',\n ): Promise<void> {\n const directory = relativeDirectory === '' ? rootPath : path.join(rootPath, relativeDirectory);\n for (const entry of await readdir(directory, { withFileTypes: true })) {\n const relativePath = (relativeDirectory === '' ? entry.name : `${relativeDirectory}/${entry.name}`).split(path.sep).join('/');\n const absolutePath = path.join(rootPath, relativePath);\n if (entry.isDirectory() && !entry.isSymbolicLink()) {\n const directoryIsNeeded = [...expectedPaths].some((expectedPath) => expectedPath.startsWith(`${relativePath}/`));\n if (!directoryIsNeeded) await rm(absolutePath, { recursive: true });\n else await this.removeStaleGeneratedEntries(rootPath, expectedPaths, relativePath);\n } else if (!expectedPaths.has(relativePath)) {\n await rm(absolutePath, { force: true });\n }\n }\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildo-ai/dev-companion",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.16",
|
|
4
4
|
"description": "Wildo.ai Dev Companion — local development management and introspection service. Canonical source home; applications receive only the built dist below their .wildo-saas/wildo-dev-companion drop.",
|
|
5
5
|
"author": "Wildo AI",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -46,22 +46,22 @@
|
|
|
46
46
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
47
47
|
"@react-email/components": "^1.0.8",
|
|
48
48
|
"@react-email/render": "^2.0.4",
|
|
49
|
-
"@wildo-ai/application-creation-runtime": "1.1.
|
|
50
|
-
"@wildo-ai/external-connectors-models": "1.1.
|
|
51
|
-
"@wildo-ai/framework-knowledge": "1.1.
|
|
52
|
-
"@wildo-ai/platform-config-lib": "1.1.
|
|
53
|
-
"@wildo-ai/platform-core-backend": "1.1.
|
|
54
|
-
"@wildo-ai/platform-core-shared": "1.1.
|
|
55
|
-
"@wildo-ai/platform-shared-lib": "1.1.
|
|
56
|
-
"@wildo-ai/presets-components-models": "1.1.
|
|
57
|
-
"@wildo-ai/saas-backend-lib": "1.1.
|
|
58
|
-
"@wildo-ai/saas-frontend-lib": "1.1.
|
|
59
|
-
"@wildo-ai/saas-models": "1.1.
|
|
60
|
-
"@wildo-ai/saas-specifications": "1.1.
|
|
61
|
-
"@wildo-ai/saas-technical-doc": "1.1.
|
|
62
|
-
"@wildo-ai/saas-website": "1.1.
|
|
63
|
-
"@wildo-ai/wildo-module-client": "1.1.
|
|
64
|
-
"@wildo-ai/zod-decorators": "1.1.
|
|
49
|
+
"@wildo-ai/application-creation-runtime": "1.1.16",
|
|
50
|
+
"@wildo-ai/external-connectors-models": "1.1.16",
|
|
51
|
+
"@wildo-ai/framework-knowledge": "1.1.16",
|
|
52
|
+
"@wildo-ai/platform-config-lib": "1.1.16",
|
|
53
|
+
"@wildo-ai/platform-core-backend": "1.1.16",
|
|
54
|
+
"@wildo-ai/platform-core-shared": "1.1.16",
|
|
55
|
+
"@wildo-ai/platform-shared-lib": "1.1.16",
|
|
56
|
+
"@wildo-ai/presets-components-models": "1.1.16",
|
|
57
|
+
"@wildo-ai/saas-backend-lib": "1.1.16",
|
|
58
|
+
"@wildo-ai/saas-frontend-lib": "1.1.16",
|
|
59
|
+
"@wildo-ai/saas-models": "1.1.16",
|
|
60
|
+
"@wildo-ai/saas-specifications": "1.1.16",
|
|
61
|
+
"@wildo-ai/saas-technical-doc": "1.1.16",
|
|
62
|
+
"@wildo-ai/saas-website": "1.1.16",
|
|
63
|
+
"@wildo-ai/wildo-module-client": "1.1.16",
|
|
64
|
+
"@wildo-ai/zod-decorators": "1.1.16",
|
|
65
65
|
"@xyflow/react": "^12.9.3",
|
|
66
66
|
"big.js": "^6.2.2",
|
|
67
67
|
"cors": "^2.8.5",
|