@wildo-ai/saas-technical-doc 1.1.3 → 1.1.4
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/build/csp-emit.d.ts.map +1 -1
- package/dist/esm/build/load-materialized-frontend-providers.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/application-administration-documentation.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/application-administration-documentation.js.map +1 -1
- package/dist/esm/companion/application-documentation/application-authentication-documentation.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/application-connection-documentation.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/application-connection-documentation.js.map +1 -1
- package/dist/esm/companion/application-documentation/application-domain-documentation.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/application-domain-documentation.js.map +1 -1
- package/dist/esm/companion/application-documentation/application-integration-documentation.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/application-integration-documentation.js.map +1 -1
- package/dist/esm/companion/application-documentation/application-organization-role-documentation.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/application-organization-role-documentation.js.map +1 -1
- package/dist/esm/companion/application-documentation/application-organization-unit-resource-documentation.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/technical-documentation-engine-content-bundle.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/technical-documentation-engine-content-bundle.js.map +1 -1
- package/dist/esm/companion/application-documentation/technical-documentation-operational-evidence.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/technical-documentation-private-derivation.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/technical-documentation-private-derivation.js.map +1 -1
- package/dist/esm/companion/application-documentation/technical-documentation-publication-policy.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/technical-documentation-publication-policy.js.map +1 -1
- package/dist/esm/companion/content/application-consumer-documentation-content-loader.d.ts.map +1 -1
- package/dist/esm/companion/index.d.ts.map +1 -1
- package/dist/esm/companion/index.js.map +1 -1
- package/dist/esm/companion/manual-controller-route-projection.d.ts.map +1 -1
- package/dist/esm/companion/manual-controller-route-projection.js.map +1 -1
- package/dist/esm/companion/openapi-generator.d.ts.map +1 -1
- package/dist/esm/companion/openapi-generator.js +4 -0
- package/dist/esm/companion/openapi-generator.js.map +1 -1
- package/dist/esm/companion/operation-projection.schemas.d.ts.map +1 -1
- package/dist/esm/companion/operation-projection.schemas.js.map +1 -1
- package/dist/esm/companion/publish-result.types.d.ts +37 -4
- package/dist/esm/companion/publish-result.types.d.ts.map +1 -1
- package/dist/esm/companion/publish-result.types.js.map +1 -1
- package/dist/esm/companion/rendering/technical-documentation-authorized-bundle-reader.d.ts.map +1 -1
- package/dist/esm/companion/rendering/technical-documentation-docusaurus-renderer.d.ts.map +1 -1
- package/dist/esm/companion/rendering/technical-documentation-docusaurus-renderer.js.map +1 -1
- package/dist/esm/companion/rendering/technical-documentation-managed-tree-validator.d.ts.map +1 -1
- package/dist/esm/companion/rendering/technical-documentation-managed-tree-validator.js.map +1 -1
- package/dist/esm/companion/rendering/technical-documentation-openapi-renderer.d.ts.map +1 -1
- package/dist/esm/companion/rendering/technical-documentation-render-model.d.ts.map +1 -1
- package/dist/esm/companion/rendering/technical-documentation-render-model.js.map +1 -1
- package/dist/esm/companion/rendering/technical-documentation-search-index-renderer.d.ts.map +1 -1
- package/dist/esm/companion/rendering/technical-documentation-search-index-renderer.js.map +1 -1
- package/dist/esm/companion/technical-documentation-asset-path.d.ts.map +1 -1
- package/dist/esm/companion/technical-documentation-capture-execution-port.d.ts.map +1 -1
- package/dist/esm/companion/technical-documentation-capture-execution-port.js.map +1 -1
- package/dist/esm/companion/technical-documentation-diagram-definitions.d.ts.map +1 -1
- package/dist/esm/companion/technical-documentation-diagram-definitions.js.map +1 -1
- package/dist/esm/companion/technical-documentation-diagram-materializer.d.ts.map +1 -1
- package/dist/esm/companion/technical-documentation-diagram-materializer.js.map +1 -1
- package/dist/esm/companion/technical-documentation-placeholder-materializer.d.ts.map +1 -1
- package/dist/esm/companion/zod-to-openapi.d.ts.map +1 -1
- package/dist/esm/companion-exports.d.ts.map +1 -1
- package/dist/esm/config/define-tech-doc-config.d.ts.map +1 -1
- package/dist/esm/config/index.d.ts.map +1 -1
- package/dist/esm/config/wildo-tech-doc-config.schemas.d.ts.map +1 -1
- package/dist/esm/config/wildo-tech-doc-config.schemas.js.map +1 -1
- package/dist/esm/content/application-consumer-documentation-content-manifest.schemas.d.ts.map +1 -1
- package/dist/esm/content/application-consumer-documentation-content.techdoc.d.ts.map +1 -1
- package/dist/esm/content/application-consumer-documentation-content.techdoc.js.map +1 -1
- package/dist/esm/content.exports.d.ts.map +1 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/openapi/api-reference-link-index.d.ts.map +1 -1
- package/dist/esm/openapi/index.d.ts.map +1 -1
- package/dist/esm/openapi/openapi-generation-output.schemas.d.ts.map +1 -1
- package/dist/esm/openapi-reference-model.exports.d.ts.map +1 -1
- package/dist/esm/runtime/AuthExchangePage.d.ts.map +1 -1
- package/dist/esm/runtime/DocsAuthContext.d.ts.map +1 -1
- package/dist/esm/runtime/DocsAuthContext.js.map +1 -1
- package/dist/esm/runtime/decode-jwt-claims.d.ts.map +1 -1
- package/dist/esm/runtime/docs-auth-client.d.ts.map +1 -1
- package/dist/esm/runtime/docs-auth-session.schemas.d.ts.map +1 -1
- package/dist/esm/runtime/frontend-provider-registry.techdoc.d.ts.map +1 -1
- package/dist/esm/runtime/frontend-provider-registry.techdoc.js.map +1 -1
- package/dist/esm/runtime/index.d.ts.map +1 -1
- package/dist/esm/runtime/index.js.map +1 -1
- package/dist/esm/runtime/openapi-reference-conservation.d.ts.map +1 -1
- package/dist/esm/runtime/use-docs-auth-session.d.ts.map +1 -1
- package/dist/esm/runtime/use-docs-frontend-provider-registry.d.ts.map +1 -1
- package/dist/esm/runtime/use-docs-provider-sdks.d.ts.map +1 -1
- package/dist/esm/runtime/use-docs-provider-sdks.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +6 -6
- package/dist/esm/companion/rendering/technical-documentation-markdown-renderer.d.ts +0 -0
- package/dist/esm/companion/rendering/technical-documentation-markdown-renderer.d.ts.map +0 -0
- package/dist/esm/companion/rendering/technical-documentation-markdown-renderer.js +0 -0
- package/dist/esm/companion/rendering/technical-documentation-markdown-renderer.js.map +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"csp-emit.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"csp-emit.d.ts","sourceRoot":"","sources":["../../../src/build/csp-emit.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,IAAI,wBAAwB,EAG5C,gBAAgB,IAAI,wBAAwB,EAC5C,0BAA0B,IAAI,kCAAkC,EAChE,gCAAgC,IAAI,wCAAwC,EAC5E,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACxB,MAAM,+BAA+B,CAAC;AAEvC,YAAY,EACV,gBAAgB,EAChB,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,GACnB,CAAC;AAEF,eAAO,MAAM,sBAAsB,0BAAkC,CAAC;AACtE,eAAO,MAAM,oBAAoB,wBAAgC,CAAC;AAClE,eAAO,MAAM,gBAAgB,iCAA2B,CAAC;AACzD,eAAO,MAAM,gBAAgB,iCAA2B,CAAC;AACzD,eAAO,MAAM,0BAA0B,2CAAqC,CAAC;AAC7E,eAAO,MAAM,gCAAgC,iDAA2C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-materialized-frontend-providers.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"load-materialized-frontend-providers.d.ts","sourceRoot":"","sources":["../../../src/build/load-materialized-frontend-providers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,iCAAiC,EACjC,mCAAmC,GACpC,MAAM,+BAA+B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-administration-documentation.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"application-administration-documentation.d.ts","sourceRoot":"","sources":["../../../../src/companion/application-documentation/application-administration-documentation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mDAAmD,EAAG,wDAAiE,CAAC;AACrI,eAAO,MAAM,uDAAuD,IAAI,CAAC;AAEzE,MAAM,WAAW,qCAAqC;IACpD,wFAAwF;IACxF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC;;;;OAIG;IACH,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC;CACrC;AAED,MAAM,WAAW,4CAA4C;IAC3D,QAAQ,CAAC,aAAa,EAAE,SAAS,qCAAqC,EAAE,CAAC;IACzE,QAAQ,CAAC,uBAAuB,EAAE,SAAS,qCAAqC,EAAE,CAAC;CACpF;AAED,+FAA+F;AAC/F,oBAAY,qCAAqC;IAC/C,wGAAwG;IACxG,cAAc,kBAAkB;IAChC,oEAAoE;IACpE,yBAAyB,4BAA4B;CACtD;AAED,MAAM,WAAW,0CAA0C;IACzD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,qCAAqC,EAAE,MAAM,CAAC,CAAC,CAAC;CACzF;AAoBD;;;GAGG;AACH,wBAAgB,6CAA6C,CAC3D,MAAM,EAAE,4CAA4C,GACnD,0CAA0C,CAoB5C"}
|
package/dist/esm/companion/application-documentation/application-administration-documentation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-administration-documentation.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"application-administration-documentation.js","sourceRoot":"","sources":["../../../../src/companion/application-documentation/application-administration-documentation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,mDAAmD,GAAG,wDAAiE,CAAC;AACrI,MAAM,CAAC,MAAM,uDAAuD,GAAG,CAAC,CAAC;AAuBzE,+FAA+F;AAC/F,MAAM,CAAN,IAAY,qCAKX;AALD,WAAY,qCAAqC;IAC/C,wGAAwG;IACxG,yEAAgC,CAAA;IAChC,oEAAoE;IACpE,8FAAqD,CAAA;AACvD,CAAC,EALW,qCAAqC,KAArC,qCAAqC,QAKhD;AAQD,SAAS,YAAY,CACnB,OAAyD,EACzD,YAAoB;IAEpB,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,YAAY,CAAC;IAC9C,MAAM,IAAI,GAAG,OAAO;SACjB,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QACd,MAAM,GAAG,GAAG,MAAM,CAAC,iBAAiB;YAClC,CAAC,CAAC,uCAAuC;YACzC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC;gBAC9B,CAAC,CAAC,sCAAsC;gBACxC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnC,OAAO,KAAK,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC;IACzC,CAAC,CAAC;SACD,IAAI,CAAC,IAAI,CAAC,CAAC;IACd,OAAO,mDAAmD,IAAI,wPAAwP,CAAC;AACzT,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,6CAA6C,CAC3D,MAAoD;IAEpD,KAAK,MAAM,MAAM,IAAI,CAAC,GAAG,MAAM,CAAC,aAAa,EAAE,GAAG,MAAM,CAAC,uBAAuB,CAAC,EAAE,CAAC;QAClF,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtC,MAAM,IAAI,KAAK,CAAC,8EAA8E,CAAC,CAAC;QAClG,CAAC;IACH,CAAC;IACD,OAAO;QACL,SAAS,EAAE,mDAAmD;QAC9D,aAAa,EAAE,uDAAuD;QACtE,aAAa,EAAE,MAAM,CAAC,MAAM,CAAC;YAC3B,CAAC,qCAAqC,CAAC,cAAc,CAAC,EAAE,YAAY,CAClE,MAAM,CAAC,aAAa,EACpB,6HAA6H,CAC9H;YACD,CAAC,qCAAqC,CAAC,yBAAyB,CAAC,EAAE,YAAY,CAC7E,MAAM,CAAC,uBAAuB,EAC9B,oGAAoG,CACrG;SACF,CAAC;KACH,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Who may perform each administrative action in THIS application.\n *\n * The roles page lists the roles and what each is for; it could not say which role may actually\n * invite a person, change their access or move a team, because that lives on the operations —\n * every one of which declares the roles it accepts. An administrator's first question (\"can a\n * manager do this, or does it need an owner?\") therefore had no answer anywhere in the portal, and\n * the pages fell back on prose about least privilege.\n *\n * The projection joins two things the companion already holds: the admitted operations for the\n * membership and organization-unit resources, and the application's own role labels. It is a\n * matrix of what this application publishes, not a restatement of the framework's defaults.\n */\nexport const APPLICATION_ADMINISTRATION_DOCUMENTATION_SOURCE_REF = 'source:companion-projection:application-administration' as const;\nexport const APPLICATION_ADMINISTRATION_DOCUMENTATION_SOURCE_VERSION = 1;\n\nexport interface ApplicationAdministrationActionSource {\n /** What the action does, in the words the API reference uses for the same operation. */\n readonly action: string;\n /**\n * Labels of the organization roles that may perform it, in the application's own words.\n * Empty means the operation declares no role gate — see `openToEveryMember`.\n */\n readonly roleLabels: readonly string[];\n /**\n * True when the operation declares no required role. That is a real, intentional state (any\n * authenticated member of the organization may call it), not a gap in the projection, so it is\n * said explicitly rather than shown as an empty cell.\n */\n readonly openToEveryMember: boolean;\n}\n\nexport interface ApplicationAdministrationDocumentationSource {\n readonly memberActions: readonly ApplicationAdministrationActionSource[];\n readonly organizationUnitActions: readonly ApplicationAdministrationActionSource[];\n}\n\n/** Named presentations a page may request with `{{APPLICATION_ADMINISTRATION:<selector>}}`. */\nexport enum ApplicationAdministrationPresentation {\n /** Membership actions — invite, change access, suspend, remove — against the roles that may do them. */\n MEMBER_ACTIONS = 'memberActions',\n /** Organization-unit actions against the roles that may do them. */\n ORGANIZATION_UNIT_ACTIONS = 'organizationUnitActions',\n}\n\nexport interface ApplicationAdministrationDocumentationFact {\n readonly sourceRef: string;\n readonly sourceVersion: number;\n readonly presentations: Readonly<Record<ApplicationAdministrationPresentation, string>>;\n}\n\nfunction actionsTable(\n actions: readonly ApplicationAdministrationActionSource[],\n emptyMessage: string,\n): string {\n if (actions.length === 0) return emptyMessage;\n const rows = actions\n .map((action) => {\n const who = action.openToEveryMember\n ? 'Any active member of the organization'\n : action.roleLabels.length === 0\n ? 'Not published for organization roles'\n : action.roleLabels.join(', ');\n return `| ${action.action} | ${who} |`;\n })\n .join('\\n');\n return `| Action | Who may perform it |\\n| --- | --- |\\n${rows}\\n\\nA role higher in the inheritance chain can do everything the roles below it can, so a role that is not named here may still qualify through the role it includes. The operation contract in the API reference is authoritative for one exact call.`;\n}\n\n/**\n * Projects the administrative matrix. A pure function of the source, so two runs over the same\n * application produce identical bytes.\n */\nexport function projectApplicationAdministrationDocumentation(\n source: ApplicationAdministrationDocumentationSource,\n): ApplicationAdministrationDocumentationFact {\n for (const action of [...source.memberActions, ...source.organizationUnitActions]) {\n if (action.action.trim().length === 0) {\n throw new Error('application administration projection received an action with no description');\n }\n }\n return {\n sourceRef: APPLICATION_ADMINISTRATION_DOCUMENTATION_SOURCE_REF,\n sourceVersion: APPLICATION_ADMINISTRATION_DOCUMENTATION_SOURCE_VERSION,\n presentations: Object.freeze({\n [ApplicationAdministrationPresentation.MEMBER_ACTIONS]: actionsTable(\n source.memberActions,\n 'This application publishes no membership administration operations, so member access is managed outside this documentation.',\n ),\n [ApplicationAdministrationPresentation.ORGANIZATION_UNIT_ACTIONS]: actionsTable(\n source.organizationUnitActions,\n 'This application does not publish organization units, so there are no unit administration actions.',\n ),\n }),\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-authentication-documentation.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"application-authentication-documentation.d.ts","sourceRoot":"","sources":["../../../../src/companion/application-documentation/application-authentication-documentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA8D,MAAM,uBAAuB,CAAC;AAG/G;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,mDAAmD,EAAG,wDAAiE,CAAC;AACrI,eAAO,MAAM,uDAAuD,IAAI,CAAC;AAEzE,MAAM,WAAW,uCAAuC;IACtD,2FAA2F;IAC3F,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,6FAA6F;IAC7F,QAAQ,CAAC,cAAc,EAAE,SAAS,UAAU,EAAE,CAAC;IAC/C,QAAQ,CAAC,WAAW,EAAE;QACpB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;QAC3B,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;QACjC,QAAQ,CAAC,yBAAyB,EAAE,MAAM,CAAC;QAC3C,QAAQ,CAAC,4BAA4B,EAAE,OAAO,CAAC;QAC/C,kEAAkE;QAClE,QAAQ,CAAC,iBAAiB,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;KACpD,CAAC;IACF,QAAQ,CAAC,QAAQ,EAAE;QACjB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAC3B,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;QACnC,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;QACnC,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;QACjC,QAAQ,CAAC,mBAAmB,EAAE,OAAO,CAAC;QACtC,4EAA4E;QAC5E,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;KAC7B,CAAC;IACF,QAAQ,CAAC,OAAO,EAAE;QAChB,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;QACjC,QAAQ,CAAC,qBAAqB,CAAC,EAAE,MAAM,CAAC;KACzC,CAAC;IACF,QAAQ,CAAC,OAAO,EAAE;QAChB,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;QAClC,QAAQ,CAAC,sBAAsB,EAAE,MAAM,CAAC;QACxC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;QAC9B,QAAQ,CAAC,0BAA0B,EAAE,MAAM,CAAC;KAC7C,CAAC;CACH;AAED,MAAM,WAAW,4CAA4C;IAC3D,QAAQ,CAAC,SAAS,EAAE,SAAS,uCAAuC,EAAE,CAAC;CACxE;AAED,+FAA+F;AAC/F,oBAAY,qCAAqC;IAC/C,mEAAmE;IACnE,uBAAuB,yBAAyB;IAChD,2FAA2F;IAC3F,kBAAkB,sBAAsB;IACxC,gDAAgD;IAChD,cAAc,kBAAkB;IAChC,wEAAwE;IACxE,mBAAmB,sBAAsB;CAC1C;AAED,MAAM,WAAW,0CAA0C;IACzD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,qCAAqC,EAAE,MAAM,CAAC,CAAC,CAAC;CACzF;AAoED;;;GAGG;AACH,wBAAgB,6CAA6C,CAC3D,MAAM,EAAE,4CAA4C,GACnD,0CAA0C,CAmB5C"}
|
package/dist/esm/companion/application-documentation/application-connection-documentation.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-connection-documentation.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"application-connection-documentation.d.ts","sourceRoot":"","sources":["../../../../src/companion/application-documentation/application-connection-documentation.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO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,CAAC,MAAM,CAAC,iCAAiC,EAAE,MAAM,CAAC,CAAC,CAAC;IACpF,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,gCAAgC,EAAE,MAAM,CAAC,CAAC,CAAC;CACnF;AA0DD;;;;GAIG;AACH,wBAAgB,yCAAyC,CACvD,MAAM,EAAE,wCAAwC,GAC/C,sCAAsC,CA2BxC"}
|
package/dist/esm/companion/application-documentation/application-connection-documentation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-connection-documentation.js","sourceRoot":"","sources":["../../../../../src/companion/application-documentation/application-connection-documentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,6BAA6B,EAAE,wBAAwB,EAAE,sCAAsC,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAEpL;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,+CAA+C,GAAG,oDAA6D,CAAC;AAC7H,MAAM,CAAC,MAAM,mDAAmD,GAAG,CAAC,CAAC;AA0BrE,2FAA2F;AAC3F,MAAM,CAAN,IAAY,iCAcX;AAdD,WAAY,iCAAiC;IAC3C,uFAAuF;IACvF,6EAAwC,CAAA;IACxC,gFAAgF;IAChF,2DAAsB,CAAA;IACtB;;;;;OAKG;IACH,iEAA4B,CAAA;IAC5B,yFAAyF;IACzF,oEAA+B,CAAA;AACjC,CAAC,EAdW,iCAAiC,KAAjC,iCAAiC,QAc5C;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,gCAiCX;AAjCD,WAAY,gCAAgC;IAC1C,oGAAoG;IACpG,wDAAoB,CAAA;IACpB,qDAAqD;IACrD,uEAAmC,CAAA;IACnC,mDAAmD;IACnD,mEAA+B,CAAA;IAC/B,sCAAsC;IACtC,mEAA+B,CAAA;IAC/B;;;;;;;;OAQG;IACH,iEAA6B,CAAA;IAC7B,kGAAkG;IAClG,gEAA4B,CAAA;IAC5B;;;;;;;;;;OA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AAC,wBAAwB,CAAC,cAAc,CAAC,EAAE;YACxI,CAAC,gCAAgC,CAAC,cAAc,CAAC,EAAE,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG,eAAe,CAAC,wBAAwB,CAAC,SAAS,CAAC,EAAE;YACnI,CAAC,gCAAgC,CAAC,aAAa,CAAC,EAAE,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG,sBAAsB,EAAE;YACrG,CAAC,gCAAgC,CAAC,YAAY,CAAC,EAAE,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG,kBAAkB,EAAE;YAChG,CAAC,gCAAgC,CAAC,kBAAkB,CAAC,EAAE,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG,sCAAsC,CAAC,kBAAkB,CAAC,EAAE;SAC/I,CAAC;KACH,CAAC;AACJ,CAAC","sourcesContent":["import { MAIN_API_BASE_PATH, MANUAL_CONTROLLER_ROUTES_URLS, ManualControllerRouteKey, rfc8414AuthorizationServerMetadataPath, SCIM_SERVICE_BASE_PATH } from '@wildo-ai/saas-models';\n\n/**\n * The application's own name and the addresses an integrator connects to.\n *\n * Engine documentation is written once for every generated application, so it\n * used to hedge everything an application knows about itself: \"the server origin\n * from this application's API reference\", \"the address published for this\n * environment\", \"the application\". Every one of those values is available to the\n * companion at derivation time, and this projection is how they reach the page.\n *\n * The split is deliberate. The APPLICATION supplies what only it knows — its\n * customer-facing name and the base URLs it publishes. The ENGINE supplies the\n * paths, because a route is the engine's own contract and an application that\n * restated it would hold a second copy that can drift (see\n * `MANUAL_CONTROLLER_ROUTES_URLS`, whose values are mounted under\n * `MAIN_API_BASE_PATH`). An endpoint appears only when the companion has\n * observed that the application configures that surface, so a page never\n * advertises a door this application does not open.\n */\nexport const APPLICATION_CONNECTION_DOCUMENTATION_SOURCE_REF = 'source:companion-projection:application-connection' as const;\nexport const APPLICATION_CONNECTION_DOCUMENTATION_SOURCE_VERSION = 1;\n\n/** One base URL an application publishes for an environment a reader may call. */\nexport interface ApplicationConnectionServer {\n readonly url: string;\n readonly description?: string;\n}\n\n/**\n * What the companion measures about this application. `surfaces` mirrors the\n * evidence the derivation already computes for applicability gating: the same\n * observation that decides whether the MCP pages are published decides whether\n * the MCP endpoint is printed, so a published address and a published page can\n * never disagree.\n */\nexport interface ApplicationConnectionDocumentationSource {\n /** The name customers see. The application's `displayName`, else its `appName`. */\n readonly applicationName: string;\n /** Base URLs the application publishes, in the order it authored them. Possibly empty. */\n readonly apiServers: readonly ApplicationConnectionServer[];\n readonly surfaces: {\n readonly mcpToolServer: boolean;\n readonly a2aAgent: boolean;\n };\n}\n\n/** Named presentations a page may request with `{{APPLICATION_CONNECTION:<selector>}}`. */\nexport enum ApplicationConnectionPresentation {\n /** Every connection detail as one table: base URLs, the API mount, agent endpoints. */\n CONNECTION_DETAILS = 'connectionDetails',\n /** The base URLs alone, for a page that only needs to say where requests go. */\n BASE_URLS = 'baseUrls',\n /**\n * The MCP endpoint sentence. Never empty: an application that exposes no MCP surface gets a\n * sentence saying so. Projection runs for every unit and gating happens afterwards, so a\n * presentation that rendered nothing would leave a blank where a suppressed page's prose was,\n * and would say nothing at all if the page were ever published without its gate.\n */\n MCP_ENDPOINT = 'mcpEndpoint',\n /** The A2A agent-card sentence. Never empty, for the same reason as the MCP endpoint. */\n A2A_AGENT_CARD = 'a2aAgentCard',\n}\n\n/**\n * Values a page substitutes INSIDE a sample — a JSON client configuration, an HTTP request line —\n * where a block presentation cannot go. Each is a single string, never markdown.\n */\nexport enum ApplicationConnectionInlineValue {\n /** The first base URL the application publishes, or an explicit stand-in when it publishes none. */\n BASE_URL = 'baseUrl',\n /** The full MCP endpoint URL a client configures. */\n MCP_ENDPOINT_URL = 'mcpEndpointUrl',\n /** The full agent-card URL an A2A peer fetches. */\n AGENT_CARD_URL = 'agentCardUrl',\n /** The full A2A task endpoint URL. */\n AGENT_TASK_URL = 'agentTaskUrl',\n /**\n * The full SCIM base URL an administrator pastes into their identity provider.\n *\n * Unlike the endpoints above this one is NOT gated on an observed surface, because SCIM is\n * configured in the IdP rather than advertised by the application: the base is where traffic\n * would be pushed, and whether a given organization has enabled provisioning is a tenant setting\n * the page discusses separately. Derived from `SCIM_SERVICE_BASE_PATH` for the same reason the\n * others derive from the route map — the engine owns the mount.\n */\n SCIM_BASE_URL = 'scimBaseUrl',\n /** The OAuth issuer a client configures, and checks the discovery document's `issuer` against. */\n OAUTH_ISSUER = 'oauthIssuer',\n /**\n * Where RFC 8414 authorization-server metadata is served.\n *\n * Derived with the engine's own `rfc8414AuthorizationServerMetadataPath`, never by appending the\n * well-known segment to the issuer. The RFC inserts it BETWEEN the host and the issuer's path, so\n * an issuer of `…/api/v1` publishes at `/.well-known/oauth-authorization-server/api/v1` — the\n * opposite construction from OIDC discovery. Getting that backwards is not hypothetical: a real\n * MCP client derived the RFC location, received the SPA shell, and abandoned authorization\n * without opening a browser. Documentation that showed a hand-built path would be teaching the\n * shape that failed.\n */\n OAUTH_METADATA_URL = 'oauthMetadataUrl',\n}\n\nexport interface ApplicationConnectionDocumentationFact {\n readonly sourceRef: string;\n readonly sourceVersion: number;\n /** Substituted wherever a page writes the inline application-name token. */\n readonly applicationName: string;\n readonly presentations: Readonly<Record<ApplicationConnectionPresentation, string>>;\n readonly inlineValues: Readonly<Record<ApplicationConnectionInlineValue, string>>;\n}\n\n/** A manual route as a reader must call it: the mount plus the engine-owned path segment. */\nfunction publicRoutePath(routeKey: ManualControllerRouteKey): string {\n return `${MAIN_API_BASE_PATH}${MANUAL_CONTROLLER_ROUTES_URLS[routeKey]}`;\n}\n\nfunction baseUrlsMarkdown(source: ApplicationConnectionDocumentationSource): string {\n if (source.apiServers.length === 0) {\n // Honest rather than invented: an application that publishes no base URL cannot have one\n // printed for it, and the reader is told where the answer actually lives.\n return `${source.applicationName} does not publish its base URLs in this documentation. Read them from the **Servers** list at the top of the API reference, or ask whoever operates the environment you are calling.`;\n }\n const rows = source.apiServers\n .map((server) => `| \\`${server.url}\\` | ${server.description ?? 'Published base URL'} |`)\n .join('\\n');\n return `| Base URL | Environment |\\n| --- | --- |\\n${rows}`;\n}\n\nfunction mcpEndpointMarkdown(source: ApplicationConnectionDocumentationSource): string {\n if (!source.surfaces.mcpToolServer) return `${source.applicationName} does not publish a Model Context Protocol endpoint.`;\n return `${source.applicationName} serves its Model Context Protocol endpoint at \\`${publicRoutePath(ManualControllerRouteKey.MCP_ENDPOINT)}\\`, under the base URL of the environment you are connecting to.`;\n}\n\nfunction a2aAgentCardMarkdown(source: ApplicationConnectionDocumentationSource): string {\n if (!source.surfaces.a2aAgent) return `${source.applicationName} does not publish an agent card.`;\n return `${source.applicationName} publishes its agent card at \\`${publicRoutePath(ManualControllerRouteKey.A2A_AGENT_CARD)}\\` and accepts task calls at \\`${publicRoutePath(ManualControllerRouteKey.A2A_TASKS)}\\`, under the base URL of the environment you are connecting to.`;\n}\n\nfunction connectionDetailsMarkdown(source: ApplicationConnectionDocumentationSource): string {\n const rows: string[] = [];\n for (const server of source.apiServers) {\n rows.push(`| Base URL${server.description === undefined ? '' : ` (${server.description})`} | \\`${server.url}\\` |`);\n }\n rows.push(`| API mount | \\`${MAIN_API_BASE_PATH}\\` — every path in the API reference already includes it |`);\n if (source.surfaces.mcpToolServer) {\n rows.push(`| MCP endpoint | \\`${publicRoutePath(ManualControllerRouteKey.MCP_ENDPOINT)}\\` |`);\n }\n if (source.surfaces.a2aAgent) {\n rows.push(`| A2A agent card | \\`${publicRoutePath(ManualControllerRouteKey.A2A_AGENT_CARD)}\\` |`);\n rows.push(`| A2A task endpoint | \\`${publicRoutePath(ManualControllerRouteKey.A2A_TASKS)}\\` |`);\n }\n const table = `| What | Value |\\n| --- | --- |\\n${rows.join('\\n')}`;\n return source.apiServers.length > 0\n ? table\n : `${table}\\n\\nThis application publishes no base URL here; read it from the **Servers** list at the top of the API reference.`;\n}\n\n/**\n * The origin a sample should show. An application that publishes no base URL gets an explicit\n * stand-in rather than a fabricated host: the reader must substitute their own environment, and the\n * sample says so in the place where the value belongs.\n */\nfunction primaryBaseUrl(source: ApplicationConnectionDocumentationSource): string {\n const first = source.apiServers[0];\n return first === undefined ? 'https://your-environment.example' : first.url.replace(/\\/+$/, '');\n}\n\n/**\n * Projects the application's connection facts into the presentations a page may\n * request. Every presentation is a pure function of the source, so two runs over\n * the same application produce identical bytes.\n */\nexport function projectApplicationConnectionDocumentation(\n source: ApplicationConnectionDocumentationSource,\n): ApplicationConnectionDocumentationFact {\n const applicationName = source.applicationName.trim();\n if (applicationName.length === 0) throw new Error('application connection projection requires a customer-facing application name');\n for (const server of source.apiServers) {\n if (server.url.trim().length === 0) throw new Error('application connection projection received an empty base URL');\n }\n const named: ApplicationConnectionDocumentationSource = { ...source, applicationName };\n return {\n sourceRef: APPLICATION_CONNECTION_DOCUMENTATION_SOURCE_REF,\n sourceVersion: APPLICATION_CONNECTION_DOCUMENTATION_SOURCE_VERSION,\n applicationName,\n presentations: Object.freeze({\n [ApplicationConnectionPresentation.CONNECTION_DETAILS]: connectionDetailsMarkdown(named),\n [ApplicationConnectionPresentation.BASE_URLS]: baseUrlsMarkdown(named),\n [ApplicationConnectionPresentation.MCP_ENDPOINT]: mcpEndpointMarkdown(named),\n [ApplicationConnectionPresentation.A2A_AGENT_CARD]: a2aAgentCardMarkdown(named),\n }),\n inlineValues: Object.freeze({\n [ApplicationConnectionInlineValue.BASE_URL]: primaryBaseUrl(named),\n [ApplicationConnectionInlineValue.MCP_ENDPOINT_URL]: `${primaryBaseUrl(named)}${publicRoutePath(ManualControllerRouteKey.MCP_ENDPOINT)}`,\n [ApplicationConnectionInlineValue.AGENT_CARD_URL]: `${primaryBaseUrl(named)}${publicRoutePath(ManualControllerRouteKey.A2A_AGENT_CARD)}`,\n [ApplicationConnectionInlineValue.AGENT_TASK_URL]: `${primaryBaseUrl(named)}${publicRoutePath(ManualControllerRouteKey.A2A_TASKS)}`,\n [ApplicationConnectionInlineValue.SCIM_BASE_URL]: `${primaryBaseUrl(named)}${SCIM_SERVICE_BASE_PATH}`,\n [ApplicationConnectionInlineValue.OAUTH_ISSUER]: `${primaryBaseUrl(named)}${MAIN_API_BASE_PATH}`,\n [ApplicationConnectionInlineValue.OAUTH_METADATA_URL]: `${primaryBaseUrl(named)}${rfc8414AuthorizationServerMetadataPath(MAIN_API_BASE_PATH)}`,\n }),\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"application-connection-documentation.js","sourceRoot":"","sources":["../../../../src/companion/application-documentation/application-connection-documentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,6BAA6B,EAAE,wBAAwB,EAAE,sCAAsC,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAEpL;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,+CAA+C,GAAG,oDAA6D,CAAC;AAC7H,MAAM,CAAC,MAAM,mDAAmD,GAAG,CAAC,CAAC;AA0BrE,2FAA2F;AAC3F,MAAM,CAAN,IAAY,iCAcX;AAdD,WAAY,iCAAiC;IAC3C,uFAAuF;IACvF,6EAAwC,CAAA;IACxC,gFAAgF;IAChF,2DAAsB,CAAA;IACtB;;;;;OAKG;IACH,iEAA4B,CAAA;IAC5B,yFAAyF;IACzF,oEAA+B,CAAA;AACjC,CAAC,EAdW,iCAAiC,KAAjC,iCAAiC,QAc5C;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,gCAiCX;AAjCD,WAAY,gCAAgC;IAC1C,oGAAoG;IACpG,wDAAoB,CAAA;IACpB,qDAAqD;IACrD,uEAAmC,CAAA;IACnC,mDAAmD;IACnD,mEAA+B,CAAA;IAC/B,sCAAsC;IACtC,mEAA+B,CAAA;IAC/B;;;;;;;;OAQG;IACH,iEAA6B,CAAA;IAC7B,kGAAkG;IAClG,gEAA4B,CAAA;IAC5B;;;;;;;;;;OAUG;IACH,2EAAuC,CAAA;AACzC,CAAC,EAjCW,gCAAgC,KAAhC,gCAAgC,QAiC3C;AAWD,6FAA6F;AAC7F,SAAS,eAAe,CAAC,QAAkC;IACzD,OAA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BAAwB,CAAC,SAAS,CAAC,EAAE;YACnI,CAAC,gCAAgC,CAAC,aAAa,CAAC,EAAE,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG,sBAAsB,EAAE;YACrG,CAAC,gCAAgC,CAAC,YAAY,CAAC,EAAE,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG,kBAAkB,EAAE;YAChG,CAAC,gCAAgC,CAAC,kBAAkB,CAAC,EAAE,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG,sCAAsC,CAAC,kBAAkB,CAAC,EAAE;SAC/I,CAAC;KACH,CAAC;AACJ,CAAC","sourcesContent":["import { MAIN_API_BASE_PATH, MANUAL_CONTROLLER_ROUTES_URLS, ManualControllerRouteKey, rfc8414AuthorizationServerMetadataPath, SCIM_SERVICE_BASE_PATH } from '@wildo-ai/saas-models';\n\n/**\n * The application's own name and the addresses an integrator connects to.\n *\n * Engine documentation is written once for every generated application, so it\n * used to hedge everything an application knows about itself: \"the server origin\n * from this application's API reference\", \"the address published for this\n * environment\", \"the application\". Every one of those values is available to the\n * companion at derivation time, and this projection is how they reach the page.\n *\n * The split is deliberate. The APPLICATION supplies what only it knows — its\n * customer-facing name and the base URLs it publishes. The ENGINE supplies the\n * paths, because a route is the engine's own contract and an application that\n * restated it would hold a second copy that can drift (see\n * `MANUAL_CONTROLLER_ROUTES_URLS`, whose values are mounted under\n * `MAIN_API_BASE_PATH`). An endpoint appears only when the companion has\n * observed that the application configures that surface, so a page never\n * advertises a door this application does not open.\n */\nexport const APPLICATION_CONNECTION_DOCUMENTATION_SOURCE_REF = 'source:companion-projection:application-connection' as const;\nexport const APPLICATION_CONNECTION_DOCUMENTATION_SOURCE_VERSION = 1;\n\n/** One base URL an application publishes for an environment a reader may call. */\nexport interface ApplicationConnectionServer {\n readonly url: string;\n readonly description?: string;\n}\n\n/**\n * What the companion measures about this application. `surfaces` mirrors the\n * evidence the derivation already computes for applicability gating: the same\n * observation that decides whether the MCP pages are published decides whether\n * the MCP endpoint is printed, so a published address and a published page can\n * never disagree.\n */\nexport interface ApplicationConnectionDocumentationSource {\n /** The name customers see. The application's `displayName`, else its `appName`. */\n readonly applicationName: string;\n /** Base URLs the application publishes, in the order it authored them. Possibly empty. */\n readonly apiServers: readonly ApplicationConnectionServer[];\n readonly surfaces: {\n readonly mcpToolServer: boolean;\n readonly a2aAgent: boolean;\n };\n}\n\n/** Named presentations a page may request with `{{APPLICATION_CONNECTION:<selector>}}`. */\nexport enum ApplicationConnectionPresentation {\n /** Every connection detail as one table: base URLs, the API mount, agent endpoints. */\n CONNECTION_DETAILS = 'connectionDetails',\n /** The base URLs alone, for a page that only needs to say where requests go. */\n BASE_URLS = 'baseUrls',\n /**\n * The MCP endpoint sentence. Never empty: an application that exposes no MCP surface gets a\n * sentence saying so. Projection runs for every unit and gating happens afterwards, so a\n * presentation that rendered nothing would leave a blank where a suppressed page's prose was,\n * and would say nothing at all if the page were ever published without its gate.\n */\n MCP_ENDPOINT = 'mcpEndpoint',\n /** The A2A agent-card sentence. Never empty, for the same reason as the MCP endpoint. */\n A2A_AGENT_CARD = 'a2aAgentCard',\n}\n\n/**\n * Values a page substitutes INSIDE a sample — a JSON client configuration, an HTTP request line —\n * where a block presentation cannot go. Each is a single string, never markdown.\n */\nexport enum ApplicationConnectionInlineValue {\n /** The first base URL the application publishes, or an explicit stand-in when it publishes none. */\n BASE_URL = 'baseUrl',\n /** The full MCP endpoint URL a client configures. */\n MCP_ENDPOINT_URL = 'mcpEndpointUrl',\n /** The full agent-card URL an A2A peer fetches. */\n AGENT_CARD_URL = 'agentCardUrl',\n /** The full A2A task endpoint URL. */\n AGENT_TASK_URL = 'agentTaskUrl',\n /**\n * The full SCIM base URL an administrator pastes into their identity provider.\n *\n * Unlike the endpoints above this one is NOT gated on an observed surface, because SCIM is\n * configured in the IdP rather than advertised by the application: the base is where traffic\n * would be pushed, and whether a given organization has enabled provisioning is a tenant setting\n * the page discusses separately. Derived from `SCIM_SERVICE_BASE_PATH` for the same reason the\n * others derive from the route map — the engine owns the mount.\n */\n SCIM_BASE_URL = 'scimBaseUrl',\n /** The OAuth issuer a client configures, and checks the discovery document's `issuer` against. */\n OAUTH_ISSUER = 'oauthIssuer',\n /**\n * Where RFC 8414 authorization-server metadata is served.\n *\n * Derived with the engine's own `rfc8414AuthorizationServerMetadataPath`, never by appending the\n * well-known segment to the issuer. The RFC inserts it BETWEEN the host and the issuer's path, so\n * an issuer of `…/api/v1` publishes at `/.well-known/oauth-authorization-server/api/v1` — the\n * opposite construction from OIDC discovery. Getting that backwards is not hypothetical: a real\n * MCP client derived the RFC location, received the SPA shell, and abandoned authorization\n * without opening a browser. Documentation that showed a hand-built path would be teaching the\n * shape that failed.\n */\n OAUTH_METADATA_URL = 'oauthMetadataUrl',\n}\n\nexport interface ApplicationConnectionDocumentationFact {\n readonly sourceRef: string;\n readonly sourceVersion: number;\n /** Substituted wherever a page writes the inline application-name token. */\n readonly applicationName: string;\n readonly presentations: Readonly<Record<ApplicationConnectionPresentation, string>>;\n readonly inlineValues: Readonly<Record<ApplicationConnectionInlineValue, string>>;\n}\n\n/** A manual route as a reader must call it: the mount plus the engine-owned path segment. */\nfunction publicRoutePath(routeKey: ManualControllerRouteKey): string {\n return `${MAIN_API_BASE_PATH}${MANUAL_CONTROLLER_ROUTES_URLS[routeKey]}`;\n}\n\nfunction baseUrlsMarkdown(source: ApplicationConnectionDocumentationSource): string {\n if (source.apiServers.length === 0) {\n // Honest rather than invented: an application that publishes no base URL cannot have one\n // printed for it, and the reader is told where the answer actually lives.\n return `${source.applicationName} does not publish its base URLs in this documentation. Read them from the **Servers** list at the top of the API reference, or ask whoever operates the environment you are calling.`;\n }\n const rows = source.apiServers\n .map((server) => `| \\`${server.url}\\` | ${server.description ?? 'Published base URL'} |`)\n .join('\\n');\n return `| Base URL | Environment |\\n| --- | --- |\\n${rows}`;\n}\n\nfunction mcpEndpointMarkdown(source: ApplicationConnectionDocumentationSource): string {\n if (!source.surfaces.mcpToolServer) return `${source.applicationName} does not publish a Model Context Protocol endpoint.`;\n return `${source.applicationName} serves its Model Context Protocol endpoint at \\`${publicRoutePath(ManualControllerRouteKey.MCP_ENDPOINT)}\\`, under the base URL of the environment you are connecting to.`;\n}\n\nfunction a2aAgentCardMarkdown(source: ApplicationConnectionDocumentationSource): string {\n if (!source.surfaces.a2aAgent) return `${source.applicationName} does not publish an agent card.`;\n return `${source.applicationName} publishes its agent card at \\`${publicRoutePath(ManualControllerRouteKey.A2A_AGENT_CARD)}\\` and accepts task calls at \\`${publicRoutePath(ManualControllerRouteKey.A2A_TASKS)}\\`, under the base URL of the environment you are connecting to.`;\n}\n\nfunction connectionDetailsMarkdown(source: ApplicationConnectionDocumentationSource): string {\n const rows: string[] = [];\n for (const server of source.apiServers) {\n rows.push(`| Base URL${server.description === undefined ? '' : ` (${server.description})`} | \\`${server.url}\\` |`);\n }\n rows.push(`| API mount | \\`${MAIN_API_BASE_PATH}\\` — every path in the API reference already includes it |`);\n if (source.surfaces.mcpToolServer) {\n rows.push(`| MCP endpoint | \\`${publicRoutePath(ManualControllerRouteKey.MCP_ENDPOINT)}\\` |`);\n }\n if (source.surfaces.a2aAgent) {\n rows.push(`| A2A agent card | \\`${publicRoutePath(ManualControllerRouteKey.A2A_AGENT_CARD)}\\` |`);\n rows.push(`| A2A task endpoint | \\`${publicRoutePath(ManualControllerRouteKey.A2A_TASKS)}\\` |`);\n }\n const table = `| What | Value |\\n| --- | --- |\\n${rows.join('\\n')}`;\n return source.apiServers.length > 0\n ? table\n : `${table}\\n\\nThis application publishes no base URL here; read it from the **Servers** list at the top of the API reference.`;\n}\n\n/**\n * The origin a sample should show. An application that publishes no base URL gets an explicit\n * stand-in rather than a fabricated host: the reader must substitute their own environment, and the\n * sample says so in the place where the value belongs.\n */\nfunction primaryBaseUrl(source: ApplicationConnectionDocumentationSource): string {\n const first = source.apiServers[0];\n return first === undefined ? 'https://your-environment.example' : first.url.replace(/\\/+$/, '');\n}\n\n/**\n * Projects the application's connection facts into the presentations a page may\n * request. Every presentation is a pure function of the source, so two runs over\n * the same application produce identical bytes.\n */\nexport function projectApplicationConnectionDocumentation(\n source: ApplicationConnectionDocumentationSource,\n): ApplicationConnectionDocumentationFact {\n const applicationName = source.applicationName.trim();\n if (applicationName.length === 0) throw new Error('application connection projection requires a customer-facing application name');\n for (const server of source.apiServers) {\n if (server.url.trim().length === 0) throw new Error('application connection projection received an empty base URL');\n }\n const named: ApplicationConnectionDocumentationSource = { ...source, applicationName };\n return {\n sourceRef: APPLICATION_CONNECTION_DOCUMENTATION_SOURCE_REF,\n sourceVersion: APPLICATION_CONNECTION_DOCUMENTATION_SOURCE_VERSION,\n applicationName,\n presentations: Object.freeze({\n [ApplicationConnectionPresentation.CONNECTION_DETAILS]: connectionDetailsMarkdown(named),\n [ApplicationConnectionPresentation.BASE_URLS]: baseUrlsMarkdown(named),\n [ApplicationConnectionPresentation.MCP_ENDPOINT]: mcpEndpointMarkdown(named),\n [ApplicationConnectionPresentation.A2A_AGENT_CARD]: a2aAgentCardMarkdown(named),\n }),\n inlineValues: Object.freeze({\n [ApplicationConnectionInlineValue.BASE_URL]: primaryBaseUrl(named),\n [ApplicationConnectionInlineValue.MCP_ENDPOINT_URL]: `${primaryBaseUrl(named)}${publicRoutePath(ManualControllerRouteKey.MCP_ENDPOINT)}`,\n [ApplicationConnectionInlineValue.AGENT_CARD_URL]: `${primaryBaseUrl(named)}${publicRoutePath(ManualControllerRouteKey.A2A_AGENT_CARD)}`,\n [ApplicationConnectionInlineValue.AGENT_TASK_URL]: `${primaryBaseUrl(named)}${publicRoutePath(ManualControllerRouteKey.A2A_TASKS)}`,\n [ApplicationConnectionInlineValue.SCIM_BASE_URL]: `${primaryBaseUrl(named)}${SCIM_SERVICE_BASE_PATH}`,\n [ApplicationConnectionInlineValue.OAUTH_ISSUER]: `${primaryBaseUrl(named)}${MAIN_API_BASE_PATH}`,\n [ApplicationConnectionInlineValue.OAUTH_METADATA_URL]: `${primaryBaseUrl(named)}${rfc8414AuthorizationServerMetadataPath(MAIN_API_BASE_PATH)}`,\n }),\n };\n}\n"]}
|
package/dist/esm/companion/application-documentation/application-domain-documentation.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-domain-documentation.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"application-domain-documentation.d.ts","sourceRoot":"","sources":["../../../../src/companion/application-documentation/application-domain-documentation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,2CAA2C,EAAG,gDAAyD,CAAC;AACrH,eAAO,MAAM,+CAA+C,IAAI,CAAC;AAEjE,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;IACrC,wEAAwE;IACxE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,yFAAyF;IACzF,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,yFAAyF;IACzF,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC;IACpC,8CAA8C;IAC9C,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,iEAAiE;IACjE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;OAMG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE;QACjB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;QAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;KAC7B,CAAC;CACH;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,mCAAmC;IAClD,QAAQ,CAAC,yBAAyB,EAAE,MAAM,CAAC;IAC3C,oEAAoE;IACpE,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;IACzC,kDAAkD;IAClD,QAAQ,CAAC,WAAW,EAAE,MAAM,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,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,6BAA6B,EAAE,MAAM,CAAC,CAAC,CAAC;IAChF,QAAQ,CAAC,aAAa,EAAE,SAAS,6BAA6B,EAAE,CAAC;CAClE;AA0DD,kGAAkG;AAClG,wBAAgB,iCAAiC,CAAC,kBAAkB,EAAE,MAAM,GAAG,MAAM,CAEpF;AAwID;;;GAGG;AACH,wBAAgB,qCAAqC,CACnD,MAAM,EAAE,oCAAoC,GAC3C,kCAAkC,CA+BpC"}
|
package/dist/esm/companion/application-documentation/application-domain-documentation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-domain-documentation.js","sourceRoot":"","sources":["../../../../../src/companion/application-documentation/application-domain-documentation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,MAAM,2CAA2C,GAAG,gDAAyD,CAAC;AACrH,MAAM,CAAC,MAAM,+CAA+C,GAAG,CAAC,CAAC;AAgFjE,uFAAuF;AACvF,MAAM,CAAN,IAAY,6BAKX;AALD,WAAY,6BAA6B;IACvC,6FAA6F;IAC7F,mEAAkC,CAAA;IAClC,uEAAuE;IACvE,kFAAiD,CAAA;AACnD,CAAC,EALW,6BAA6B,KAA7B,6BAA6B,QAKxC;AAwBD;;;;;;GAMG;AACH,MAAM,iBAAiB,GAAG,wIAAwI,CAAC;AAEnK,SAAS,SAAS,CAAC,SAA2C;IAC5D,IAAI,SAAS,CAAC,iBAAiB;QAAE,OAAO,mBAAmB,CAAC;IAC5D,IAAI,SAAS,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,sCAAsC,CAAC;IACrF,OAAO,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACzC,CAAC;AAED,SAAS,sBAAsB,CAAC,MAA4C;IAC1E,IAAI,MAAM,CAA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AC,CAAC;YAChI,CAAC;YACD,aAAa,CAAC,GAAG,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC;QACjD,CAAC;IACH,CAAC;IACD,OAAO;QACL,SAAS,EAAE,2CAA2C;QACtD,aAAa,EAAE,+CAA+C;QAC9D,aAAa,EAAE,MAAM,CAAC,MAAM,CAAC;YAC3B,CAAC,6BAA6B,CAAC,eAAe,CAAC,EAAE,sBAAsB,CAAC,MAAM,CAAC;YAC/E,CAAC,6BAA6B,CAAC,uBAAuB,CAAC,EAAE,6BAA6B,CAAC,MAAM,CAAC;SAC/F,CAAC;QACF,aAAa,EAAE,aAAa,CAAC,MAAM,CAAC;KACrC,CAAC;AACJ,CAAC","sourcesContent":["/**\n * What THIS application is actually for.\n *\n * The documentation covered access, user administration, integrations, security and billing, and\n * said nothing about the product. A Wonder Todos customer could learn how to verify a webhook\n * signature before learning what a todo is — 104 published operations over the application's own\n * domain and not one page about them. The content module stated the omission as policy, which is\n * how it survived: a deliberate gap reads as a decision rather than a defect.\n *\n * Nothing here is authored per application, and nothing is inferred from a name. Every sentence\n * comes from a source the application already accepted:\n *\n * | what the page says | where it comes from |\n * | --- | --- |\n * | which resources are the product's domain | the application's own resource registry, not the core map |\n * | how they group, and what the group is called | `apiReferenceResourceCategories` in the app's tech-doc config |\n * | what each resource IS | the resource specification's `purpose`, carried on its OpenAPI tag |\n * | how it changes over time | the specification's lifecycle prose |\n * | who may do what to it | the resolved role list on each operation |\n *\n * The application/core split is what keeps this page from restating the rest of the site. An\n * application-owned resource has no framework page to belong to; a core one already has several.\n */\nexport const APPLICATION_DOMAIN_DOCUMENTATION_SOURCE_REF = 'source:companion-projection:application-domain' as const;\nexport const APPLICATION_DOMAIN_DOCUMENTATION_SOURCE_VERSION = 1;\n\nexport interface ApplicationDomainOperationSource {\n readonly operationIdentifier: string;\n /** The operation's own summary, when its specification authored one. */\n readonly summary?: string;\n /** Labels of the organization roles that may call it, in the application's own words. */\n readonly roleLabels: readonly string[];\n /** True when the operation declares no required role — a real state, said explicitly. */\n readonly openToEveryMember: boolean;\n /** The method a client sends, e.g. `POST`. */\n readonly httpMethod?: string;\n /** The mounted path a client sends it to, parameters and all. */\n readonly path?: string;\n /**\n * One worked call, when the operation's specification authored one.\n *\n * A single example per RESOURCE reaches the page, not one per operation: the point is to show\n * what this application's payloads look like, and twenty near-identical bodies would bury the\n * page a reader came to for orientation. The API reference carries every operation's own.\n */\n readonly example?: {\n readonly title: string;\n readonly request?: unknown;\n readonly response?: unknown;\n };\n}\n\n/**\n * One connection between this resource and another, as a page may state it.\n *\n * `cascade` is the part that had to be earned rather than read off. The framework's own\n * `onParentDelete` lives under CHILD operations — it says what happens to the child when the\n * parent is deleted — but the fact is copied onto BOTH sides of the relationship, so a row alone\n * does not say which side this resource is on. Measured on a real application: the policy sits on\n * a many-side row 36 times and on a shape that resolves neither way 51 times.\n *\n * So the companion resolves the direction where the cardinality settles it (the ONE side of a\n * one-to-many is the parent, and the FK sits on the many side), and passes NOTHING where it does\n * not. A page that told somebody their data survives a delete when it does not is the most\n * expensive sentence this corpus could contain; an absent sentence costs a lookup.\n */\nexport interface ApplicationDomainRelationshipSource {\n readonly relatedResourceIdentifier: string;\n /** How many of the related thing participate, in consumer words. */\n readonly relatedCardinalityWords: string;\n /** What kind of link it is, in consumer words. */\n readonly natureWords: string;\n /** The field that carries the link, when one does. */\n readonly foreignKeyField?: string;\n /**\n * What a delete does, stated only when the direction is unambiguous AND a cascade is enabled.\n * Absent means \"not stated here\", never \"nothing happens\".\n */\n readonly cascade?: string;\n}\n\nexport interface ApplicationDomainResourceSource {\n readonly resourceIdentifier: string;\n /** The specification's `purpose`: what this thing IS, in the product's words. */\n readonly purpose?: string;\n /** The specification's account of how the resource changes over time. */\n readonly lifecycleRole?: string;\n readonly operations: readonly ApplicationDomainOperationSource[];\n readonly relationships?: readonly ApplicationDomainRelationshipSource[];\n}\n\nexport interface ApplicationDomainCategorySource {\n readonly id: string;\n /** The application's own name for this part of its domain, e.g. \"Work management\". */\n readonly label: string;\n readonly description?: string;\n readonly resources: readonly ApplicationDomainResourceSource[];\n}\n\nexport interface ApplicationDomainDocumentationSource {\n readonly applicationName: string;\n readonly categories: readonly ApplicationDomainCategorySource[];\n}\n\n/** Named presentations a page may request with `{{APPLICATION_DOMAIN:<selector>}}`. */\nexport enum ApplicationDomainPresentation {\n /** One line per thing the application manages, grouped the way the application groups it. */\n DOMAIN_OVERVIEW = 'domainOverview',\n /** Per resource: what it is, how it changes, and who may act on it. */\n DOMAIN_RESOURCE_DETAILS = 'domainResourceDetails',\n}\n\n/**\n * One complete page about one resource, ready to become a published unit.\n *\n * The projection emits the whole page rather than a fragment because the unit set is VARIABLE —\n * there is no authored Markdown for `todos` to carry a token, and there cannot be: the resources\n * are the application's, and an engine that authored a page per possible resource would be\n * authoring the application.\n */\nexport interface ApplicationDomainResourcePage {\n readonly resourceIdentifier: string;\n readonly title: string;\n /** A complete page body: `# Title` followed by `##` sections, as the engine content parser expects. */\n readonly markdown: string;\n}\n\nexport interface ApplicationDomainDocumentationFact {\n readonly sourceRef: string;\n readonly sourceVersion: number;\n readonly presentations: Readonly<Record<ApplicationDomainPresentation, string>>;\n readonly resourcePages: readonly ApplicationDomainResourcePage[];\n}\n\n/**\n * The sentence a page shows when an application publishes no domain of its own.\n *\n * Said explicitly rather than left blank, for the reason every empty inventory in this family is:\n * a reader who sees nothing cannot tell an application that manages nothing through its API from\n * documentation that failed to describe it.\n */\nconst NO_DOMAIN_MESSAGE = 'publishes no resources of its own through its API, so everything it exposes is described by the framework pages in this documentation.';\n\nfunction whoMayAct(operation: ApplicationDomainOperationSource): string {\n if (operation.openToEveryMember) return 'Any active member';\n if (operation.roleLabels.length === 0) return 'Not published for organization roles';\n return operation.roleLabels.join(', ');\n}\n\nfunction domainOverviewMarkdown(source: ApplicationDomainDocumentationSource): string {\n if (source.categories.length === 0) return `${source.applicationName} ${NO_DOMAIN_MESSAGE}`;\n const blocks = source.categories.map((category) => {\n const heading = category.description === undefined\n ? `### ${category.label}`\n : `### ${category.label}\\n\\n${category.description}`;\n const rows = category.resources\n .map((resource) => {\n // Linked, because each resource now HAS a page. The link text stays the API's own name so\n // a reader can match it against a payload, an error message or the reference.\n const name = `[\\`${resource.resourceIdentifier}\\`](/what-this-application-manages/${applicationDomainResourcePageSlug(resource.resourceIdentifier)})`;\n return `| ${name} | ${resource.purpose ?? 'Not described by its specification.'} |`;\n })\n .join('\\n');\n return `${heading}\\n\\n| Resource | What it is |\\n| --- | --- |\\n${rows}`;\n });\n return `${blocks.join('\\n\\n')}\\n\\nEach name above is the one the API uses, so it is also what you will find in the API reference and in any tool or webhook payload that mentions it.`;\n}\n\nfunction domainResourceDetailsMarkdown(source: ApplicationDomainDocumentationSource): string {\n if (source.categories.length === 0) return `${source.applicationName} ${NO_DOMAIN_MESSAGE}`;\n const blocks: string[] = [];\n for (const category of source.categories) {\n for (const resource of category.resources) {\n const lines = [`### \\`${resource.resourceIdentifier}\\``, ''];\n if (resource.purpose !== undefined) lines.push(resource.purpose, '');\n if (resource.lifecycleRole !== undefined) lines.push(resource.lifecycleRole, '');\n if (resource.operations.length === 0) {\n lines.push('This resource publishes no operations a client may call directly.');\n } else {\n lines.push('| Operation | What it does | Who may call it |', '| --- | --- | --- |');\n for (const operation of resource.operations) {\n lines.push(`| \\`${operation.operationIdentifier}\\` | ${operation.summary ?? '—'} | ${whoMayAct(operation)} |`);\n }\n }\n blocks.push(lines.join('\\n').trim());\n }\n }\n return `${blocks.join('\\n\\n')}\\n\\nA role higher in the inheritance chain can do everything the roles below it can, so a role that is not named here may still qualify through the role it includes. The API reference carries each operation's exact arguments and responses.`;\n}\n\n/** The route every generated resource page lives at, and the only place that shape is written. */\nexport function applicationDomainResourcePageSlug(resourceIdentifier: string): string {\n return resourceIdentifier;\n}\n\nfunction jsonBlock(label: string, value: unknown): string[] {\n return ['', `**${label}**`, '', '~~~json', JSON.stringify(value, null, 2), '~~~'];\n}\n\nfunction operationsTable(resource: ApplicationDomainResourceSource): string[] {\n if (resource.operations.length === 0) {\n return ['This resource publishes no operations a client may call directly.'];\n }\n /*\n * The `Send` column only appears when at least one operation resolved a method and a path. A\n * column of dashes is worse than no column: it reads as \"this cannot be called\" rather than\n * \"this projection did not resolve it\".\n */\n const anyWire = resource.operations.some((operation) => operation.httpMethod !== undefined && operation.path !== undefined);\n const columns = anyWire\n ? ['Operation', 'What it does', 'Send', 'Who may call it']\n : ['Operation', 'What it does', 'Who may call it'];\n const header = [`| ${columns.join(' | ')} |`, `| ${columns.map(() => '---').join(' | ')} |`];\n const rows = resource.operations.map((operation) => {\n const wire = operation.httpMethod !== undefined && operation.path !== undefined\n ? `\\`${operation.httpMethod} ${operation.path}\\``\n : '—';\n const cells = anyWire\n ? [`\\`${operation.operationIdentifier}\\``, operation.summary ?? '—', wire, whoMayAct(operation)]\n : [`\\`${operation.operationIdentifier}\\``, operation.summary ?? '—', whoMayAct(operation)];\n return `| ${cells.join(' | ')} |`;\n });\n return [...header, ...rows];\n}\n\n/**\n * Builds the page for one resource.\n *\n * Deliberately NOT a summary of the API reference. The reference answers \"what are this\n * operation's exact arguments\"; this page answers \"what is this thing, what can I do with it, and\n * may I\". So it carries the specification's own prose, one worked call, and a route onward — and\n * refuses to restate field tables that would go stale the moment a schema moves.\n */\nfunction resourcePageMarkdown(\n applicationName: string,\n category: ApplicationDomainCategorySource,\n resource: ApplicationDomainResourceSource,\n describedResourceIdentifiers: ReadonlySet<string>,\n): string {\n const lines: string[] = [`# ${resource.resourceIdentifier}`, ''];\n lines.push(resource.purpose ?? `\\`${resource.resourceIdentifier}\\` is published by ${applicationName} under ${category.label}. Its specification authored no description, so this page can only show what the application exposes.`);\n /*\n * The purpose is the page's opening line, which the engine content parser reads as the unit\n * SUMMARY — so it becomes the description in navigation and search, which is exactly what a\n * one-line \"what is this thing\" belongs in. The lifecycle then gets its own section, under a\n * heading that says what it actually answers.\n */\n lines.push('', '## How it changes', '');\n lines.push(resource.lifecycleRole ?? 'Its specification does not describe how it changes over time.');\n lines.push('', '## What you can do', '', ...operationsTable(resource));\n\n const relationships = resource.relationships ?? [];\n if (relationships.length > 0) {\n lines.push('', '## What it connects to', '');\n const anyCascade = relationships.some((relationship) => relationship.cascade !== undefined);\n const columns = anyCascade\n ? ['Related', 'How many', 'Link', 'Field', 'When something is deleted']\n : ['Related', 'How many', 'Link', 'Field'];\n lines.push(`| ${columns.join(' | ')} |`, `| ${columns.map(() => '---').join(' | ')} |`);\n for (const relationship of relationships) {\n /*\n * Linked only when the related resource HAS a page. A domain resource usually relates\n * outward as well — every one is organization-scoped, and many point at a user — and those\n * facts belong on the page even though the framework, not this section, documents them.\n * Dropping them was the first cut and it was wrong: Wonder CRM's `deal` relates to\n * `organizations` and `users` and to none of its own resources, so an owned-only filter left\n * the section empty on a resource that has two real connections.\n */\n const name = describedResourceIdentifiers.has(relationship.relatedResourceIdentifier)\n ? `[\\`${relationship.relatedResourceIdentifier}\\`](/what-this-application-manages/${applicationDomainResourcePageSlug(relationship.relatedResourceIdentifier)})`\n : `\\`${relationship.relatedResourceIdentifier}\\``;\n const cells = [\n name,\n relationship.relatedCardinalityWords,\n relationship.natureWords,\n relationship.foreignKeyField === undefined ? '—' : `\\`${relationship.foreignKeyField}\\``,\n ];\n if (anyCascade) cells.push(relationship.cascade ?? 'Not stated here');\n lines.push(`| ${cells.join(' | ')} |`);\n }\n if (anyCascade) {\n lines.push(\n '',\n 'An empty **When something is deleted** cell means this page does not state it, not that nothing happens — the relationship is one whose direction the documentation cannot resolve on its own. Check the operation contract before relying on a delete either way.',\n );\n }\n }\n\n const exampleOperation = resource.operations.find((operation) => operation.example !== undefined);\n if (exampleOperation?.example !== undefined) {\n const { example } = exampleOperation;\n lines.push('', `## Worked example: \\`${exampleOperation.operationIdentifier}\\``, '', example.title);\n if (example.request !== undefined) lines.push(...jsonBlock('Request', example.request));\n if (example.response !== undefined) lines.push(...jsonBlock('Response', example.response));\n lines.push('', 'Identifiers and values above are illustrative; every field is defined in the API reference.');\n }\n\n lines.push(\n '',\n '## Where to go next',\n '',\n '| You need to | Go to |',\n '| --- | --- |',\n '| The exact fields, arguments and responses | [API reference](/api) |',\n '| To call this from your own code | [Send your first API request](/integrations/rest/send-request) |',\n '| To be told when one changes | [Webhooks](/integrations/webhooks) |',\n `| Everything else this application manages | [What ${applicationName} manages](/what-this-application-manages) |`,\n );\n return lines.join('\\n');\n}\n\nfunction resourcePages(source: ApplicationDomainDocumentationSource): ApplicationDomainResourcePage[] {\n // Exactly the resources this projection gives a page, which is what a link may point at.\n const describedResourceIdentifiers = new Set(\n source.categories.flatMap((category) => category.resources.map((resource) => resource.resourceIdentifier)),\n );\n const pages: ApplicationDomainResourcePage[] = [];\n for (const category of source.categories) {\n for (const resource of category.resources) {\n pages.push({\n resourceIdentifier: resource.resourceIdentifier,\n title: resource.resourceIdentifier,\n markdown: resourcePageMarkdown(source.applicationName, category, resource, describedResourceIdentifiers),\n });\n }\n }\n return pages;\n}\n\n/**\n * Projects the application's own domain. A pure function of the source, so two runs over the same\n * application produce identical bytes.\n */\nexport function projectApplicationDomainDocumentation(\n source: ApplicationDomainDocumentationSource,\n): ApplicationDomainDocumentationFact {\n if (source.applicationName.trim().length === 0) {\n throw new Error('application domain projection requires a customer-facing application name');\n }\n const seenResources = new Set<string>();\n for (const category of source.categories) {\n if (category.label.trim().length === 0) {\n throw new Error(`application domain projection received category '${category.id}' with no label`);\n }\n for (const resource of category.resources) {\n if (resource.resourceIdentifier.trim().length === 0) {\n throw new Error('application domain projection received a resource with no identifier');\n }\n // A resource belongs to exactly one part of the domain. Two categories claiming the same one\n // would describe it twice with no way for a reader to tell which reading is current — and the\n // config's own contract is that every published resource is listed exactly once.\n if (seenResources.has(resource.resourceIdentifier)) {\n throw new Error(`application domain projection received resource '${resource.resourceIdentifier}' in more than one category`);\n }\n seenResources.add(resource.resourceIdentifier);\n }\n }\n return {\n sourceRef: APPLICATION_DOMAIN_DOCUMENTATION_SOURCE_REF,\n sourceVersion: APPLICATION_DOMAIN_DOCUMENTATION_SOURCE_VERSION,\n presentations: Object.freeze({\n [ApplicationDomainPresentation.DOMAIN_OVERVIEW]: domainOverviewMarkdown(source),\n [ApplicationDomainPresentation.DOMAIN_RESOURCE_DETAILS]: domainResourceDetailsMarkdown(source),\n }),\n resourcePages: resourcePages(source),\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"application-domain-documentation.js","sourceRoot":"","sources":["../../../../src/companion/application-documentation/application-domain-documentation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,MAAM,2CAA2C,GAAG,gDAAyD,CAAC;AACrH,MAAM,CAAC,MAAM,+CAA+C,GAAG,CAAC,CAAC;AAgFjE,uFAAuF;AACvF,MAAM,CAAN,IAAY,6BAKX;AALD,WAAY,6BAA6B;IACvC,6FAA6F;IAC7F,mEAAkC,CAAA;IAClC,uEAAuE;IACvE,kFAAiD,CAAA;AACnD,CAAC,EALW,6BAA6B,KAA7B,6BAA6B,QAKxC;AAwBD;;;;;;GAMG;AACH,MAAM,iBAAiB,GAAG,wIAAwI,CAAC;AAEnK,SAAS,SAAS,CAAC,SAA2C;IAC5D,IAAI,SAAS,CAAC,iBAAiB;QAAE,OAAO,mBAAmB,CAAC;IAC5D,IAAI,SAAS,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,sCAAsC,CAAC;IACrF,OAAO,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACzC,CAAC;AAED,SAAS,sBAAsB,CAAC,MAA4C;IAC1E,IAAI,MAAM,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,GAAG,MAAM,CAAC,eAAe,IAAI,iBAAiB,EAAE,CAAC;IAC5F,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;QAChD,MAAM,OAAO,GAAG,QAAQ,CAAC,WAAW,KAAK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A6B,CAAC,eAAe,CAAC,EAAE,sBAAsB,CAAC,MAAM,CAAC;YAC/E,CAAC,6BAA6B,CAAC,uBAAuB,CAAC,EAAE,6BAA6B,CAAC,MAAM,CAAC;SAC/F,CAAC;QACF,aAAa,EAAE,aAAa,CAAC,MAAM,CAAC;KACrC,CAAC;AACJ,CAAC","sourcesContent":["/**\n * What THIS application is actually for.\n *\n * The documentation covered access, user administration, integrations, security and billing, and\n * said nothing about the product. A Wonder Todos customer could learn how to verify a webhook\n * signature before learning what a todo is — 104 published operations over the application's own\n * domain and not one page about them. The content module stated the omission as policy, which is\n * how it survived: a deliberate gap reads as a decision rather than a defect.\n *\n * Nothing here is authored per application, and nothing is inferred from a name. Every sentence\n * comes from a source the application already accepted:\n *\n * | what the page says | where it comes from |\n * | --- | --- |\n * | which resources are the product's domain | the application's own resource registry, not the core map |\n * | how they group, and what the group is called | `apiReferenceResourceCategories` in the app's tech-doc config |\n * | what each resource IS | the resource specification's `purpose`, carried on its OpenAPI tag |\n * | how it changes over time | the specification's lifecycle prose |\n * | who may do what to it | the resolved role list on each operation |\n *\n * The application/core split is what keeps this page from restating the rest of the site. An\n * application-owned resource has no framework page to belong to; a core one already has several.\n */\nexport const APPLICATION_DOMAIN_DOCUMENTATION_SOURCE_REF = 'source:companion-projection:application-domain' as const;\nexport const APPLICATION_DOMAIN_DOCUMENTATION_SOURCE_VERSION = 1;\n\nexport interface ApplicationDomainOperationSource {\n readonly operationIdentifier: string;\n /** The operation's own summary, when its specification authored one. */\n readonly summary?: string;\n /** Labels of the organization roles that may call it, in the application's own words. */\n readonly roleLabels: readonly string[];\n /** True when the operation declares no required role — a real state, said explicitly. */\n readonly openToEveryMember: boolean;\n /** The method a client sends, e.g. `POST`. */\n readonly httpMethod?: string;\n /** The mounted path a client sends it to, parameters and all. */\n readonly path?: string;\n /**\n * One worked call, when the operation's specification authored one.\n *\n * A single example per RESOURCE reaches the page, not one per operation: the point is to show\n * what this application's payloads look like, and twenty near-identical bodies would bury the\n * page a reader came to for orientation. The API reference carries every operation's own.\n */\n readonly example?: {\n readonly title: string;\n readonly request?: unknown;\n readonly response?: unknown;\n };\n}\n\n/**\n * One connection between this resource and another, as a page may state it.\n *\n * `cascade` is the part that had to be earned rather than read off. The framework's own\n * `onParentDelete` lives under CHILD operations — it says what happens to the child when the\n * parent is deleted — but the fact is copied onto BOTH sides of the relationship, so a row alone\n * does not say which side this resource is on. Measured on a real application: the policy sits on\n * a many-side row 36 times and on a shape that resolves neither way 51 times.\n *\n * So the companion resolves the direction where the cardinality settles it (the ONE side of a\n * one-to-many is the parent, and the FK sits on the many side), and passes NOTHING where it does\n * not. A page that told somebody their data survives a delete when it does not is the most\n * expensive sentence this corpus could contain; an absent sentence costs a lookup.\n */\nexport interface ApplicationDomainRelationshipSource {\n readonly relatedResourceIdentifier: string;\n /** How many of the related thing participate, in consumer words. */\n readonly relatedCardinalityWords: string;\n /** What kind of link it is, in consumer words. */\n readonly natureWords: string;\n /** The field that carries the link, when one does. */\n readonly foreignKeyField?: string;\n /**\n * What a delete does, stated only when the direction is unambiguous AND a cascade is enabled.\n * Absent means \"not stated here\", never \"nothing happens\".\n */\n readonly cascade?: string;\n}\n\nexport interface ApplicationDomainResourceSource {\n readonly resourceIdentifier: string;\n /** The specification's `purpose`: what this thing IS, in the product's words. */\n readonly purpose?: string;\n /** The specification's account of how the resource changes over time. */\n readonly lifecycleRole?: string;\n readonly operations: readonly ApplicationDomainOperationSource[];\n readonly relationships?: readonly ApplicationDomainRelationshipSource[];\n}\n\nexport interface ApplicationDomainCategorySource {\n readonly id: string;\n /** The application's own name for this part of its domain, e.g. \"Work management\". */\n readonly label: string;\n readonly description?: string;\n readonly resources: readonly ApplicationDomainResourceSource[];\n}\n\nexport interface ApplicationDomainDocumentationSource {\n readonly applicationName: string;\n readonly categories: readonly ApplicationDomainCategorySource[];\n}\n\n/** Named presentations a page may request with `{{APPLICATION_DOMAIN:<selector>}}`. */\nexport enum ApplicationDomainPresentation {\n /** One line per thing the application manages, grouped the way the application groups it. */\n DOMAIN_OVERVIEW = 'domainOverview',\n /** Per resource: what it is, how it changes, and who may act on it. */\n DOMAIN_RESOURCE_DETAILS = 'domainResourceDetails',\n}\n\n/**\n * One complete page about one resource, ready to become a published unit.\n *\n * The projection emits the whole page rather than a fragment because the unit set is VARIABLE —\n * there is no authored Markdown for `todos` to carry a token, and there cannot be: the resources\n * are the application's, and an engine that authored a page per possible resource would be\n * authoring the application.\n */\nexport interface ApplicationDomainResourcePage {\n readonly resourceIdentifier: string;\n readonly title: string;\n /** A complete page body: `# Title` followed by `##` sections, as the engine content parser expects. */\n readonly markdown: string;\n}\n\nexport interface ApplicationDomainDocumentationFact {\n readonly sourceRef: string;\n readonly sourceVersion: number;\n readonly presentations: Readonly<Record<ApplicationDomainPresentation, string>>;\n readonly resourcePages: readonly ApplicationDomainResourcePage[];\n}\n\n/**\n * The sentence a page shows when an application publishes no domain of its own.\n *\n * Said explicitly rather than left blank, for the reason every empty inventory in this family is:\n * a reader who sees nothing cannot tell an application that manages nothing through its API from\n * documentation that failed to describe it.\n */\nconst NO_DOMAIN_MESSAGE = 'publishes no resources of its own through its API, so everything it exposes is described by the framework pages in this documentation.';\n\nfunction whoMayAct(operation: ApplicationDomainOperationSource): string {\n if (operation.openToEveryMember) return 'Any active member';\n if (operation.roleLabels.length === 0) return 'Not published for organization roles';\n return operation.roleLabels.join(', ');\n}\n\nfunction domainOverviewMarkdown(source: ApplicationDomainDocumentationSource): string {\n if (source.categories.length === 0) return `${source.applicationName} ${NO_DOMAIN_MESSAGE}`;\n const blocks = source.categories.map((category) => {\n const heading = category.description === undefined\n ? `### ${category.label}`\n : `### ${category.label}\\n\\n${category.description}`;\n const rows = category.resources\n .map((resource) => {\n // Linked, because each resource now HAS a page. The link text stays the API's own name so\n // a reader can match it against a payload, an error message or the reference.\n const name = `[\\`${resource.resourceIdentifier}\\`](/what-this-application-manages/${applicationDomainResourcePageSlug(resource.resourceIdentifier)})`;\n return `| ${name} | ${resource.purpose ?? 'Not described by its specification.'} |`;\n })\n .join('\\n');\n return `${heading}\\n\\n| Resource | What it is |\\n| --- | --- |\\n${rows}`;\n });\n return `${blocks.join('\\n\\n')}\\n\\nEach name above is the one the API uses, so it is also what you will find in the API reference and in any tool or webhook payload that mentions it.`;\n}\n\nfunction domainResourceDetailsMarkdown(source: ApplicationDomainDocumentationSource): string {\n if (source.categories.length === 0) return `${source.applicationName} ${NO_DOMAIN_MESSAGE}`;\n const blocks: string[] = [];\n for (const category of source.categories) {\n for (const resource of category.resources) {\n const lines = [`### \\`${resource.resourceIdentifier}\\``, ''];\n if (resource.purpose !== undefined) lines.push(resource.purpose, '');\n if (resource.lifecycleRole !== undefined) lines.push(resource.lifecycleRole, '');\n if (resource.operations.length === 0) {\n lines.push('This resource publishes no operations a client may call directly.');\n } else {\n lines.push('| Operation | What it does | Who may call it |', '| --- | --- | --- |');\n for (const operation of resource.operations) {\n lines.push(`| \\`${operation.operationIdentifier}\\` | ${operation.summary ?? '—'} | ${whoMayAct(operation)} |`);\n }\n }\n blocks.push(lines.join('\\n').trim());\n }\n }\n return `${blocks.join('\\n\\n')}\\n\\nA role higher in the inheritance chain can do everything the roles below it can, so a role that is not named here may still qualify through the role it includes. The API reference carries each operation's exact arguments and responses.`;\n}\n\n/** The route every generated resource page lives at, and the only place that shape is written. */\nexport function applicationDomainResourcePageSlug(resourceIdentifier: string): string {\n return resourceIdentifier;\n}\n\nfunction jsonBlock(label: string, value: unknown): string[] {\n return ['', `**${label}**`, '', '~~~json', JSON.stringify(value, null, 2), '~~~'];\n}\n\nfunction operationsTable(resource: ApplicationDomainResourceSource): string[] {\n if (resource.operations.length === 0) {\n return ['This resource publishes no operations a client may call directly.'];\n }\n /*\n * The `Send` column only appears when at least one operation resolved a method and a path. A\n * column of dashes is worse than no column: it reads as \"this cannot be called\" rather than\n * \"this projection did not resolve it\".\n */\n const anyWire = resource.operations.some((operation) => operation.httpMethod !== undefined && operation.path !== undefined);\n const columns = anyWire\n ? ['Operation', 'What it does', 'Send', 'Who may call it']\n : ['Operation', 'What it does', 'Who may call it'];\n const header = [`| ${columns.join(' | ')} |`, `| ${columns.map(() => '---').join(' | ')} |`];\n const rows = resource.operations.map((operation) => {\n const wire = operation.httpMethod !== undefined && operation.path !== undefined\n ? `\\`${operation.httpMethod} ${operation.path}\\``\n : '—';\n const cells = anyWire\n ? [`\\`${operation.operationIdentifier}\\``, operation.summary ?? '—', wire, whoMayAct(operation)]\n : [`\\`${operation.operationIdentifier}\\``, operation.summary ?? '—', whoMayAct(operation)];\n return `| ${cells.join(' | ')} |`;\n });\n return [...header, ...rows];\n}\n\n/**\n * Builds the page for one resource.\n *\n * Deliberately NOT a summary of the API reference. The reference answers \"what are this\n * operation's exact arguments\"; this page answers \"what is this thing, what can I do with it, and\n * may I\". So it carries the specification's own prose, one worked call, and a route onward — and\n * refuses to restate field tables that would go stale the moment a schema moves.\n */\nfunction resourcePageMarkdown(\n applicationName: string,\n category: ApplicationDomainCategorySource,\n resource: ApplicationDomainResourceSource,\n describedResourceIdentifiers: ReadonlySet<string>,\n): string {\n const lines: string[] = [`# ${resource.resourceIdentifier}`, ''];\n lines.push(resource.purpose ?? `\\`${resource.resourceIdentifier}\\` is published by ${applicationName} under ${category.label}. Its specification authored no description, so this page can only show what the application exposes.`);\n /*\n * The purpose is the page's opening line, which the engine content parser reads as the unit\n * SUMMARY — so it becomes the description in navigation and search, which is exactly what a\n * one-line \"what is this thing\" belongs in. The lifecycle then gets its own section, under a\n * heading that says what it actually answers.\n */\n lines.push('', '## How it changes', '');\n lines.push(resource.lifecycleRole ?? 'Its specification does not describe how it changes over time.');\n lines.push('', '## What you can do', '', ...operationsTable(resource));\n\n const relationships = resource.relationships ?? [];\n if (relationships.length > 0) {\n lines.push('', '## What it connects to', '');\n const anyCascade = relationships.some((relationship) => relationship.cascade !== undefined);\n const columns = anyCascade\n ? ['Related', 'How many', 'Link', 'Field', 'When something is deleted']\n : ['Related', 'How many', 'Link', 'Field'];\n lines.push(`| ${columns.join(' | ')} |`, `| ${columns.map(() => '---').join(' | ')} |`);\n for (const relationship of relationships) {\n /*\n * Linked only when the related resource HAS a page. A domain resource usually relates\n * outward as well — every one is organization-scoped, and many point at a user — and those\n * facts belong on the page even though the framework, not this section, documents them.\n * Dropping them was the first cut and it was wrong: Wonder CRM's `deal` relates to\n * `organizations` and `users` and to none of its own resources, so an owned-only filter left\n * the section empty on a resource that has two real connections.\n */\n const name = describedResourceIdentifiers.has(relationship.relatedResourceIdentifier)\n ? `[\\`${relationship.relatedResourceIdentifier}\\`](/what-this-application-manages/${applicationDomainResourcePageSlug(relationship.relatedResourceIdentifier)})`\n : `\\`${relationship.relatedResourceIdentifier}\\``;\n const cells = [\n name,\n relationship.relatedCardinalityWords,\n relationship.natureWords,\n relationship.foreignKeyField === undefined ? '—' : `\\`${relationship.foreignKeyField}\\``,\n ];\n if (anyCascade) cells.push(relationship.cascade ?? 'Not stated here');\n lines.push(`| ${cells.join(' | ')} |`);\n }\n if (anyCascade) {\n lines.push(\n '',\n 'An empty **When something is deleted** cell means this page does not state it, not that nothing happens — the relationship is one whose direction the documentation cannot resolve on its own. Check the operation contract before relying on a delete either way.',\n );\n }\n }\n\n const exampleOperation = resource.operations.find((operation) => operation.example !== undefined);\n if (exampleOperation?.example !== undefined) {\n const { example } = exampleOperation;\n lines.push('', `## Worked example: \\`${exampleOperation.operationIdentifier}\\``, '', example.title);\n if (example.request !== undefined) lines.push(...jsonBlock('Request', example.request));\n if (example.response !== undefined) lines.push(...jsonBlock('Response', example.response));\n lines.push('', 'Identifiers and values above are illustrative; every field is defined in the API reference.');\n }\n\n lines.push(\n '',\n '## Where to go next',\n '',\n '| You need to | Go to |',\n '| --- | --- |',\n '| The exact fields, arguments and responses | [API reference](/api) |',\n '| To call this from your own code | [Send your first API request](/integrations/rest/send-request) |',\n '| To be told when one changes | [Webhooks](/integrations/webhooks) |',\n `| Everything else this application manages | [What ${applicationName} manages](/what-this-application-manages) |`,\n );\n return lines.join('\\n');\n}\n\nfunction resourcePages(source: ApplicationDomainDocumentationSource): ApplicationDomainResourcePage[] {\n // Exactly the resources this projection gives a page, which is what a link may point at.\n const describedResourceIdentifiers = new Set(\n source.categories.flatMap((category) => category.resources.map((resource) => resource.resourceIdentifier)),\n );\n const pages: ApplicationDomainResourcePage[] = [];\n for (const category of source.categories) {\n for (const resource of category.resources) {\n pages.push({\n resourceIdentifier: resource.resourceIdentifier,\n title: resource.resourceIdentifier,\n markdown: resourcePageMarkdown(source.applicationName, category, resource, describedResourceIdentifiers),\n });\n }\n }\n return pages;\n}\n\n/**\n * Projects the application's own domain. A pure function of the source, so two runs over the same\n * application produce identical bytes.\n */\nexport function projectApplicationDomainDocumentation(\n source: ApplicationDomainDocumentationSource,\n): ApplicationDomainDocumentationFact {\n if (source.applicationName.trim().length === 0) {\n throw new Error('application domain projection requires a customer-facing application name');\n }\n const seenResources = new Set<string>();\n for (const category of source.categories) {\n if (category.label.trim().length === 0) {\n throw new Error(`application domain projection received category '${category.id}' with no label`);\n }\n for (const resource of category.resources) {\n if (resource.resourceIdentifier.trim().length === 0) {\n throw new Error('application domain projection received a resource with no identifier');\n }\n // A resource belongs to exactly one part of the domain. Two categories claiming the same one\n // would describe it twice with no way for a reader to tell which reading is current — and the\n // config's own contract is that every published resource is listed exactly once.\n if (seenResources.has(resource.resourceIdentifier)) {\n throw new Error(`application domain projection received resource '${resource.resourceIdentifier}' in more than one category`);\n }\n seenResources.add(resource.resourceIdentifier);\n }\n }\n return {\n sourceRef: APPLICATION_DOMAIN_DOCUMENTATION_SOURCE_REF,\n sourceVersion: APPLICATION_DOMAIN_DOCUMENTATION_SOURCE_VERSION,\n presentations: Object.freeze({\n [ApplicationDomainPresentation.DOMAIN_OVERVIEW]: domainOverviewMarkdown(source),\n [ApplicationDomainPresentation.DOMAIN_RESOURCE_DETAILS]: domainResourceDetailsMarkdown(source),\n }),\n resourcePages: resourcePages(source),\n };\n}\n"]}
|
package/dist/esm/companion/application-documentation/application-integration-documentation.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-integration-documentation.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"application-integration-documentation.d.ts","sourceRoot":"","sources":["../../../../src/companion/application-documentation/application-integration-documentation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gDAAgD,EAAG,qDAA8D,CAAC;AAC/H,eAAO,MAAM,oDAAoD,IAAI,CAAC;AAEtE,MAAM,WAAW,wBAAwB;IACvC,gEAAgE;IAChE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;CACtC;AAED,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;IACrC,kFAAkF;IAClF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,yCAAyC;IACxD,QAAQ,CAAC,QAAQ,EAAE,SAAS,wBAAwB,EAAE,CAAC;IACvD,QAAQ,CAAC,aAAa,EAAE,SAAS,6BAA6B,EAAE,CAAC;CAClE;AAED,4FAA4F;AAC5F,oBAAY,kCAAkC;IAC5C,4DAA4D;IAC5D,SAAS,aAAa;IACtB,2EAA2E;IAC3E,cAAc,kBAAkB;CACjC;AAED,MAAM,WAAW,uCAAuC;IACtD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,kCAAkC,EAAE,MAAM,CAAC,CAAC,CAAC;CACtF;AAsBD;;;GAGG;AACH,wBAAgB,0CAA0C,CACxD,MAAM,EAAE,yCAAyC,GAChD,uCAAuC,CAsCzC"}
|
package/dist/esm/companion/application-documentation/application-integration-documentation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-integration-documentation.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"application-integration-documentation.js","sourceRoot":"","sources":["../../../../src/companion/application-documentation/application-integration-documentation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,gDAAgD,GAAG,qDAA8D,CAAC;AAC/H,MAAM,CAAC,MAAM,oDAAoD,GAAG,CAAC,CAAC;AAqBtE,4FAA4F;AAC5F,MAAM,CAAN,IAAY,kCAKX;AALD,WAAY,kCAAkC;IAC5C,4DAA4D;IAC5D,4DAAsB,CAAA;IACtB,2EAA2E;IAC3E,sEAAgC,CAAA;AAClC,CAAC,EALW,kCAAkC,KAAlC,kCAAkC,QAK7C;AAQD,SAAS,gBAAgB,CAAC,MAAiD;IACzE,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACjC,OAAO,8FAA8F,CAAC;IACxG,CAAC;IACD,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ;SACzB,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,IAAI,CAAC,QAAQ,QAAQ,IAAI,CAAC,kBAAkB,MAAM,IAAI,CAAC,mBAAmB,IAAI,CAAC;SACpG,IAAI,CAAC,IAAI,CAAC,CAAC;IACd,OAAO,yDAAyD,IAAI,+PAA+P,CAAC;AACtU,CAAC;AAED,SAAS,qBAAqB,CAAC,MAAiD;IAC9E,IAAI,MAAM,CAAC,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtC,OAAO,qIAAqI,CAAC;IAC/I,CAAC;IACD,MAAM,IAAI,GAAG,MAAM,CAAC,aAAa;SAC9B,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,CAAC,kBAAkB,MAAM,KAAK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AAC;IACD,OAAO;QACL,SAAS,EAAE,gDAAgD;QAC3D,aAAa,EAAE,oDAAoD;QACnE,aAAa,EAAE,MAAM,CAAC,MAAM,CAAC;YAC3B,CAAC,kCAAkC,CAAC,SAAS,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC;YACxE,CAAC,kCAAkC,CAAC,cAAc,CAAC,EAAE,qBAAqB,CAAC,MAAM,CAAC;SACnF,CAAC;KACH,CAAC;AACJ,CAAC","sourcesContent":["/**\n * The tools an MCP client will find, and the events a webhook receiver will be sent.\n *\n * Five webhook pages explained delivery, verification, retries and reconciliation without ever\n * naming an event, and the MCP page described a catalogue without naming a tool in it. Both\n * inventories were already being computed — as booleans, to decide whether those pages publish at\n * all — so the reader was one projection away from the list the whole time.\n *\n * Names are the application's own: a tool is `<resource>__<operation>` exactly as an agent must\n * type it, and an event names the resource and operation that produce it. Nothing here is\n * humanized, because every one of these strings is a value someone matches on in code.\n */\nexport const APPLICATION_INTEGRATION_DOCUMENTATION_SOURCE_REF = 'source:companion-projection:application-integration' as const;\nexport const APPLICATION_INTEGRATION_DOCUMENTATION_SOURCE_VERSION = 1;\n\nexport interface ApplicationMcpToolSource {\n /** The exact name an agent calls, `<resource>__<operation>`. */\n readonly toolName: string;\n readonly resourceIdentifier: string;\n readonly operationIdentifier: string;\n}\n\nexport interface ApplicationWebhookEventSource {\n readonly resourceIdentifier: string;\n readonly operationIdentifier: string;\n /** The notification channel that carries it, which is also its delivery scope. */\n readonly channel: string;\n}\n\nexport interface ApplicationIntegrationDocumentationSource {\n readonly mcpTools: readonly ApplicationMcpToolSource[];\n readonly webhookEvents: readonly ApplicationWebhookEventSource[];\n}\n\n/** Named presentations a page may request with `{{APPLICATION_INTEGRATION:<selector>}}`. */\nexport enum ApplicationIntegrationPresentation {\n /** Every tool this application publishes to MCP clients. */\n MCP_TOOLS = 'mcpTools',\n /** Every resource operation that produces an outbound webhook delivery. */\n WEBHOOK_EVENTS = 'webhookEvents',\n}\n\nexport interface ApplicationIntegrationDocumentationFact {\n readonly sourceRef: string;\n readonly sourceVersion: number;\n readonly presentations: Readonly<Record<ApplicationIntegrationPresentation, string>>;\n}\n\nfunction mcpToolsMarkdown(source: ApplicationIntegrationDocumentationSource): string {\n if (source.mcpTools.length === 0) {\n return 'This application publishes no MCP tools, so a connected client will find an empty catalogue.';\n }\n const rows = source.mcpTools\n .map((tool) => `| \\`${tool.toolName}\\` | ${tool.resourceIdentifier} | ${tool.operationIdentifier} |`)\n .join('\\n');\n return `| Tool | Resource | Operation |\\n| --- | --- | --- |\\n${rows}\\n\\nThese are the tools the application publishes. What YOU see is the subset your credential is allowed to call, so a shorter catalogue is an authorization result and not a fault. The API reference carries each operation's exact arguments and response.`;\n}\n\nfunction webhookEventsMarkdown(source: ApplicationIntegrationDocumentationSource): string {\n if (source.webhookEvents.length === 0) {\n return 'This application declares no outbound webhook events, so an endpoint would receive nothing even when one is configured and enabled.';\n }\n const rows = source.webhookEvents\n .map((event) => `| ${event.resourceIdentifier} | ${event.operationIdentifier} | \\`${event.channel}\\` |`)\n .join('\\n');\n return `| Resource | Operation that fires it | Channel |\\n| --- | --- | --- |\\n${rows}\\n\\nEvery enabled endpoint on the matching channel receives every event on that channel: an endpoint is not subscribed to a subset. Route on the signed \\`resourceIdentifier\\` and \\`operationIdentifier\\` claims rather than on the destination URL, and ignore an event your receiver does not handle.`;\n}\n\n/**\n * Projects both integration inventories. A pure function of the source, so two runs over the same\n * application produce identical bytes.\n */\nexport function projectApplicationIntegrationDocumentation(\n source: ApplicationIntegrationDocumentationSource,\n): ApplicationIntegrationDocumentationFact {\n /*\n * Both inventories are ADDRESSES: a tool name is what an agent types, and a (resource, operation,\n * channel) triple is one fact about one delivery. Neither can legitimately appear twice, so a\n * repeat is a producer walking something twice — which is exactly what the companion's collector\n * did, visiting every selected core resource once from the prepared list and once from the core\n * factory sweep. It survived because the collector used to answer a boolean, where duplicates are\n * unobservable.\n *\n * The refusal lives HERE rather than only in that collector because this is the one place every\n * producer passes through, and a duplicated row is worse than a loud failure: it reads as two\n * separate things a reader must tell apart.\n */\n const seenToolNames = new Set<string>();\n for (const tool of source.mcpTools) {\n if (tool.toolName.trim().length === 0) throw new Error('application integration projection received an MCP tool with no name');\n if (seenToolNames.has(tool.toolName)) {\n throw new Error(`application integration projection received the MCP tool '${tool.toolName}' twice — a tool name addresses one operation`);\n }\n seenToolNames.add(tool.toolName);\n }\n const seenEvents = new Set<string>();\n for (const event of source.webhookEvents) {\n if (event.channel.trim().length === 0) throw new Error('application integration projection received a webhook event with no channel');\n const identity = `${event.resourceIdentifier}.${event.operationIdentifier}.${event.channel}`;\n if (seenEvents.has(identity)) {\n throw new Error(`application integration projection received the webhook event '${identity}' twice — one operation on one channel is one event`);\n }\n seenEvents.add(identity);\n }\n return {\n sourceRef: APPLICATION_INTEGRATION_DOCUMENTATION_SOURCE_REF,\n sourceVersion: APPLICATION_INTEGRATION_DOCUMENTATION_SOURCE_VERSION,\n presentations: Object.freeze({\n [ApplicationIntegrationPresentation.MCP_TOOLS]: mcpToolsMarkdown(source),\n [ApplicationIntegrationPresentation.WEBHOOK_EVENTS]: webhookEventsMarkdown(source),\n }),\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-organization-role-documentation.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"application-organization-role-documentation.d.ts","sourceRoot":"","sources":["../../../../src/companion/application-documentation/application-organization-role-documentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,oBAAoB,EACrB,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,EAAE,6CAA6C,EAAE,MAAM,iDAAiD,CAAC;AAErH,eAAO,MAAM,uDAAuD,EAAG,gDAAyD,CAAC;AACjI,4GAA4G;AAC5G,eAAO,MAAM,2DAA2D,IAAI,CAAC;AAE7E,sFAAsF;AACtF,MAAM,WAAW,kCAAkC;IACjD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,Q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AM,EAAE,kCAAkC,CAAC,CAkBzD;AAED;;;;;GAKG;AACH,wBAAgB,sDAAsD,CACpE,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,2CAA2C,CAAC,CAAC,GAAG,SAAS,EAC9F,cAAc,EAAE,WAAW,CAAC,MAAM,EAAE,kCAAkC,CAAC,GACtE,SAAS,8CAA8C,EAAE,CA8C3D;AAED;;;;GAIG;AACH,wBAAgB,+CAA+C,CAC7D,KAAK,EAAE,SAAS,8CAA8C,EAAE,EAChE,mBAAmB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GACpD,SAAS,wCAAwC,EAAE,CAMrD;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,wCAAwC,CACtD,CAAC,SAAS;IAAE,QAAQ,CAAC,MAAM,CAAC,EAAE;QAAE,QAAQ,CAAC,gBAAgB,EAAE,SAAS;YAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;SAAE,EAAE,CAAA;KAAE,CAAA;CAAE,EAC3H,UAAU,EAAE,SAAS,CAAC,EAAE,EAAE,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,SAAS,CAAC,EAAE,CAavF;AAED;;;;GAIG;AACH,wBAAgB,mDAAmD,CACjE,KAAK,EAAE,SAAS,wCAAwC,EAAE,GACzD,6CAA6C,CAgC/C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-organization-role-documentation.js","sourceRoot":"","sources":["../../../../../src/companion/application-documentation/application-organization-role-documentation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,0BAA0B,EAC1B,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAM/B,MAAM,CAAC,MAAM,uDAAuD,GAAG,gDAAyD,CAAC;AACjI,4GAA4G;AAC5G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KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,YAAY,CAAC,KAAa;IACjC,OAAO,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,UAAU,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;AAC7G,CAAC;AAED,gFAAgF;AAChF,SAAS,aAAa,CAAC,KAAa;IAClC,OAAO,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AAC9C,CAAC;AAED,SAAS,UAAU,CAAC,KAAa;IAC/B,OAAO,KAAK,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC;AACjD,CAAC","sourcesContent":["import {\n CORE_ORG_ROLES,\n DEFAULT_ORGANIZATION_ROLES,\n ResourcePrimaryScope,\n} from '@wildo-ai/saas-models';\nimport {\n} from '@wildo-ai/saas-specifications/technical-documentation';\n\nimport type { ApplicationOrganizationRolesDocumentationFact } from './technical-documentation-engine-content-bundle';\n\nexport const APPLICATION_ORGANIZATION_ROLES_DOCUMENTATION_SOURCE_REF = 'source:companion-projection:organization-roles' as const;\n/** Advances when this projection's shape changes; it is the fact's version wherever provenance cites it. */\nexport const APPLICATION_ORGANIZATION_ROLES_DOCUMENTATION_SOURCE_VERSION = 1;\n\n/** Minimal application/engine role specification needed by consumer documentation. */\nexport interface ApplicationRoleDocumentationSource {\n readonly ref: string;\n readonly purpose: string | null;\n readonly businessRole: string | null;\n readonly authorityBoundary: string | null;\n readonly useWhen: string | null;\n readonly avoidWhen: string | null;\n readonly businessConstraints: readonly string[] | null;\n}\n\n/**\n * Application-independent organization-role projection before UI labels are\n * joined. The introspection subprocess can safely emit this JSON-only shape;\n * the parent companion later joins the application's primary-locale labels.\n */\nexport interface ApplicationOrganizationRoleDocumentationSource {\n readonly role: string;\n readonly inheritFrom: string | null;\n readonly purpose: string;\n readonly businessRole: string | null;\n readonly authorityBoundary: string;\n readonly useWhen: string;\n readonly avoidWhen: string;\n readonly businessConstraints: readonly string[];\n}\n\n/** Complete consumer-visible role documentation after the application label join. */\nexport interface ApplicationOrganizationRoleDocumentation extends ApplicationOrganizationRoleDocumentationSource {\n readonly label: string;\n readonly description: string;\n}\n\ninterface ApplicationRoleConfigurationProjectionInput {\n readonly role?: string;\n readonly inheritFrom?: string;\n readonly relatedPrimaryScope: ResourcePrimaryScope;\n}\n\n/**\n * Index companion-exported role specifications by their runtime role token.\n * Engine and application-defined roles intentionally share this namespace.\n */\nexport function indexApplicationRoleDocumentationSources(\n roleSpecifications: Record<string, unknown> | undefined,\n): ReadonlyMap<string, ApplicationRoleDocumentationSource> {\n const result = new Map<string, ApplicationRoleDocumentationSource>();\n for (const candidate of Object.values(roleSpecifications ?? {})) {\n if (!isPlainObject(candidate) || typeof candidate.ref !== 'string' || candidate.ref.length === 0) continue;\n if (result.has(candidate.ref)) {\n throw new Error(`application organization-role projector: duplicate role specification for '${candidate.ref}'`);\n }\n result.set(candidate.ref, {\n ref: candidate.ref,\n purpose: nonEmptyStringOrNull(candidate.purpose),\n businessRole: nonEmptyStringOrNull(candidate.businessRole),\n authorityBoundary: nonEmptyStringOrNull(candidate.authorityBoundary),\n useWhen: nonEmptyStringOrNull(candidate.useWhen),\n avoidWhen: nonEmptyStringOrNull(candidate.avoidWhen),\n businessConstraints: nonEmptyStringArrayOrNull(candidate.businessConstraints),\n });\n }\n return result;\n}\n\n/**\n * Resolve every framework and application-defined organization role from the\n * application's merged runtime registry and authored role specifications.\n * Application-scoped roles are deliberately excluded from this organization\n * administration reference.\n */\nexport function projectApplicationOrganizationRoleDocumentationSources(\n customRoles: Readonly<Record<string, ApplicationRoleConfigurationProjectionInput>> | undefined,\n roleSpecsByRef: ReadonlyMap<string, ApplicationRoleDocumentationSource>,\n): readonly ApplicationOrganizationRoleDocumentationSource[] {\n const configured = new Map<string, ApplicationRoleConfigurationProjectionInput & { readonly role: string }>();\n for (const config of Object.values(DEFAULT_ORGANIZATION_ROLES)) {\n if (typeof config.role !== 'string' || config.role.length === 0) {\n throw new Error('application organization-role projector: framework organization role configuration has no role token');\n }\n configured.set(config.role, { ...config, role: config.role });\n }\n for (const config of Object.values(customRoles ?? {})) {\n if (typeof config.role !== 'string' || config.role.length === 0) {\n throw new Error('application organization-role projector: application organization role configuration has no role token');\n }\n if (configured.has(config.role)) {\n throw new Error(`application organization-role projector: application role '${config.role}' collides with a framework organization role`);\n }\n configured.set(config.role, { ...config, role: config.role });\n }\n\n return Object.freeze([...configured.values()]\n .filter((config) => config.relatedPrimaryScope === ResourcePrimaryScope.ORGANIZATIONS)\n .map((config) => {\n const specification = roleSpecsByRef.get(config.role);\n if (\n specification === undefined\n || specification.purpose === null\n || specification.authorityBoundary === null\n || specification.useWhen === null\n || specification.avoidWhen === null\n || specification.businessConstraints === null\n ) {\n throw new Error(\n `application organization-role projector: organization role '${config.role}' has no companion-exported role specification with complete consumer guidance`,\n );\n }\n return Object.freeze({\n role: config.role,\n inheritFrom: config.inheritFrom ?? null,\n purpose: specification.purpose,\n businessRole: specification.businessRole,\n authorityBoundary: specification.authorityBoundary,\n useWhen: specification.useWhen,\n avoidWhen: specification.avoidWhen,\n businessConstraints: specification.businessConstraints,\n });\n })\n .sort((left, right) => left.role.localeCompare(right.role, 'en-US')));\n}\n\n/**\n * Join role semantics to the exact primary-locale labels shown by the\n * application. Missing values fail closed: publishing a guessed label would\n * make the guide disagree with member-management and role-picker UI.\n */\nexport function resolveApplicationOrganizationRoleDocumentation(\n roles: readonly ApplicationOrganizationRoleDocumentationSource[],\n primaryLocaleLabels: Readonly<Record<string, string>>,\n): readonly ApplicationOrganizationRoleDocumentation[] {\n return Object.freeze(roles.map((role) => Object.freeze({\n ...role,\n label: requiredRoleLabel(primaryLocaleLabels, role.role, 'label'),\n description: requiredRoleLabel(primaryLocaleLabels, role.role, 'description'),\n })));\n}\n\n/**\n * Give every operation's access documentation the role names the APPLICATION authored.\n *\n * ## The defect this closes\n *\n * `roleRequirements[].label` was derived from the role TOKEN in the projector subprocess —\n * `ORG_MANAGER` became \"Organization Manager\" and `APP_ADMIN_SUPER_ADMIN` became \"Application Admin\n * Super Admin\". That is invented display text (`.claude/rules/display-text-comes-from-i18n.md`), and\n * it appeared on EVERY documented operation, which is the largest surface the defect had. Meanwhile\n * the same roles carry authored labels resolved from the application's own i18n unit, and\n * publication already refuses to proceed without them — but those labels reached only the roles\n * page. Two names for one role, and the invented one was the one beside every endpoint (#382).\n *\n * ## Why a token is the fallback, and not a prettier guess\n *\n * A label this map does not carry stays the raw token. `ORG_MANAGER` is honest, searchable, and\n * visibly not a product's word — an invented English phrase is none of those, and once printed it is\n * indistinguishable from an authored one. The refusal belongs at the door that PUBLISHES, which\n * already has it; a read that merely generates a document must not fail closed on an authoring gap.\n *\n * Returns new objects; the input projections are left untouched.\n */\nexport function applyAuthoredRoleLabelsToOperationAccess<\n T extends { readonly access?: { readonly roleRequirements: readonly { readonly role: string; readonly label: string }[] } },\n>(operations: readonly T[], labelByRole: Readonly<Record<string, string>>): readonly T[] {\n return operations.map((operation) => {\n const access = operation.access;\n if (access === undefined || access.roleRequirements.length === 0) return operation;\n let changed = false;\n const roleRequirements = access.roleRequirements.map((requirement) => {\n const authored = labelByRole[requirement.role];\n if (authored === undefined || authored === requirement.label) return requirement;\n changed = true;\n return { ...requirement, label: authored };\n });\n return changed ? { ...operation, access: { ...access, roleRequirements } } : operation;\n });\n}\n\n/**\n * Materialize the reusable Markdown fact consumed by the Roles and permissions\n * topic. This function knows no application identity: different applications\n * receive different role inputs and therefore different facts.\n */\nexport function createApplicationOrganizationRolesDocumentationFact(\n roles: readonly ApplicationOrganizationRoleDocumentation[],\n): ApplicationOrganizationRolesDocumentationFact {\n if (roles.length === 0) throw new Error('technical documentation requires at least one resolved organization role');\n if (new Set(roles.map((role) => role.role)).size !== roles.length) {\n throw new Error('technical documentation received duplicate resolved organization roles');\n }\n\n const roleByIdentifier = new Map(roles.map((role) => [role.role, role]));\n const hierarchyDepthByRole = new Map(roles.map((role) => [role.role, hierarchyDepth(role, roleByIdentifier)]));\n // Readers compare authority from broadest to narrowest. Derive that order\n // from the actual inheritance chain; sibling branches use visible labels and\n // stable role tokens only as deterministic tie-breakers.\n const canonicalRoles = [...roles].sort((left, right) =>\n hierarchyDepthByRole.get(right.role)! - hierarchyDepthByRole.get(left.role)!\n || left.label.localeCompare(right.label, 'en-US')\n || left.role.localeCompare(right.role, 'en-US'));\n\n const roleSections = canonicalRoles.map((role) => {\n const inheritedRole = role.inheritFrom === null ? undefined : roleByIdentifier.get(role.inheritFrom);\n const inheritance = role.inheritFrom === null\n ? 'This role does not inherit another organization role.'\n : `This role includes the permissions of **${markdownText(inheritedRole?.label ?? role.inheritFrom)}** (${inlineCode(role.inheritFrom)}).`;\n const limits = [role.avoidWhen, ...role.businessConstraints]\n .map((constraint) => `- ${markdownProse(constraint)}`)\n .join('\\n');\n return `### ${markdownText(role.label)}\\n\\n${markdownText(role.description)}\\n\\n- **Where it applies:** ${markdownProse(role.authorityBoundary)}\\n- **Inherited access:** ${inheritance}\\n- **Technical identifier:** ${inlineCode(role.role)}\\n\\n#### Can do\\n\\n${markdownProse(role.purpose)}\\n\\n${markdownProse(role.useWhen)}\\n\\n#### Cannot do\\n\\n${limits}\\n\\n#### Can assign\\n\\n${roleAssignmentMarkdown(role, roleByIdentifier)}`;\n }).join('\\n\\n');\n\n return Object.freeze({\n sourceRef: APPLICATION_ORGANIZATION_ROLES_DOCUMENTATION_SOURCE_REF,\n markdown: `These are all the organization roles available in this application. Their names and short descriptions match the application's primary-language interface; the technical identifier is included so you can recognize the same role in an access request, audit record, or API response.\\n\\n${roleSections}\\n\\n> **How inherited access works:** when one role includes another, it receives the included role’s permissions as well as its own. The reverse is not true: assigning the included role never grants the higher role.`,\n sourceVersion: APPLICATION_ORGANIZATION_ROLES_DOCUMENTATION_SOURCE_VERSION,\n });\n}\n\nfunction hierarchyDepth(\n role: ApplicationOrganizationRoleDocumentation,\n roleByIdentifier: ReadonlyMap<string, ApplicationOrganizationRoleDocumentation>,\n ancestors = new Set<string>(),\n): number {\n if (role.inheritFrom === null) return 0;\n if (ancestors.has(role.role)) {\n throw new Error(`technical documentation organization-role hierarchy contains a cycle at ${role.role}`);\n }\n const inheritedRole = roleByIdentifier.get(role.inheritFrom);\n if (inheritedRole === undefined) {\n throw new Error(`technical documentation organization role ${role.role} inherits absent role ${role.inheritFrom}`);\n }\n return 1 + hierarchyDepth(inheritedRole, roleByIdentifier, new Set([...ancestors, role.role]));\n}\n\n/**\n * Explain the standard organization-role assignment ceiling from the exact\n * application role graph. This deliberately does not flatten custom roles into\n * a total order: sibling custom branches are outside one another's ceiling.\n * A role must also inherit the administrator gate before it can use the\n * standard membership and unit-assignment controls at all.\n */\nfunction roleAssignmentMarkdown(\n role: ApplicationOrganizationRoleDocumentation,\n roleByIdentifier: ReadonlyMap<string, ApplicationOrganizationRoleDocumentation>,\n): string {\n const effectiveRoles: ApplicationOrganizationRoleDocumentation[] = [];\n let current: ApplicationOrganizationRoleDocumentation | undefined = role;\n const visited = new Set<string>();\n while (current !== undefined) {\n if (visited.has(current.role)) {\n throw new Error(`technical documentation organization-role hierarchy contains a cycle at ${current.role}`);\n }\n visited.add(current.role);\n effectiveRoles.push(current);\n current = current.inheritFrom === null ? undefined : roleByIdentifier.get(current.inheritFrom);\n }\n\n if (!effectiveRoles.some((candidate) => candidate.role === CORE_ORG_ROLES.ORG_ADMIN)) {\n return 'This role cannot use the standard organization-membership or organization-unit assignment controls. It therefore cannot assign an organization or unit role through those controls.';\n }\n\n const assignableRoles = effectiveRoles\n .map((candidate) => `**${markdownText(candidate.label)}** (${inlineCode(candidate.role)})`)\n .join(', ');\n return `Through the standard membership and unit-assignment controls, this role can assign: ${assignableRoles}. It cannot assign a role outside this inheritance chain unless the person also holds another organization-wide role whose chain includes it.`;\n}\n\nfunction requiredRoleLabel(\n labels: Readonly<Record<string, string>>,\n role: string,\n field: 'label' | 'description',\n): string {\n const key = `roles.${role}.${field}`;\n const value = labels[key];\n if (typeof value !== 'string' || value.trim().length === 0) {\n throw new Error(\n `application organization-role documentation requires primary-locale label '${key}'; generate the application's role labels before publishing documentation`,\n );\n }\n return value.trim();\n}\n\nfunction nonEmptyStringOrNull(value: unknown): string | null {\n return typeof value === 'string' && value.trim().length > 0 ? value.trim() : null;\n}\n\nfunction nonEmptyStringArrayOrNull(value: unknown): readonly string[] | null {\n if (!Array.isArray(value) || value.length === 0) return null;\n const normalized = value.map(nonEmptyStringOrNull);\n return normalized.every((entry): entry is string => entry !== null)\n ? Object.freeze(normalized)\n : null;\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction markdownText(value: string): string {\n return value.replaceAll(/\\s+/g, ' ').trim().replaceAll('\\\\', '\\\\\\\\').replaceAll(/([`*_[\\]<>#|])/g, '\\\\$1');\n}\n\n/** Role specifications intentionally author small inline-Markdown semantics. */\nfunction markdownProse(value: string): string {\n return value.replaceAll(/\\s+/g, ' ').trim();\n}\n\nfunction inlineCode(value: string): string {\n return `\\`${value.replaceAll('`', '`')}\\``;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"application-organization-role-documentation.js","sourceRoot":"","sources":["../../../../src/companion/application-documentation/application-organization-role-documentation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,0BAA0B,EAC1B,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAM/B,MAAM,CAAC,MAAM,uDAAuD,GAAG,gDAAyD,CAAC;AACjI,4GAA4G;AAC5G,MAAM,CAAC,MAAM,2DAA2D,GAAG,CAAC,CAAC;AAyC7E;;;GAGG;AACH,MAAM,UAAU,wCAAwC,CACtD,kBAAuD;IAEvD,MAAM,MAAM,GAAG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,CAAC,KAAa;IACjC,OAAO,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,UAAU,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;AAC7G,CAAC;AAED,gFAAgF;AAChF,SAAS,aAAa,CAAC,KAAa;IAClC,OAAO,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AAC9C,CAAC;AAED,SAAS,UAAU,CAAC,KAAa;IAC/B,OAAO,KAAK,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC;AACjD,CAAC","sourcesContent":["import {\n CORE_ORG_ROLES,\n DEFAULT_ORGANIZATION_ROLES,\n ResourcePrimaryScope,\n} from '@wildo-ai/saas-models';\nimport {\n} from '@wildo-ai/saas-specifications/technical-documentation';\n\nimport type { ApplicationOrganizationRolesDocumentationFact } from './technical-documentation-engine-content-bundle';\n\nexport const APPLICATION_ORGANIZATION_ROLES_DOCUMENTATION_SOURCE_REF = 'source:companion-projection:organization-roles' as const;\n/** Advances when this projection's shape changes; it is the fact's version wherever provenance cites it. */\nexport const APPLICATION_ORGANIZATION_ROLES_DOCUMENTATION_SOURCE_VERSION = 1;\n\n/** Minimal application/engine role specification needed by consumer documentation. */\nexport interface ApplicationRoleDocumentationSource {\n readonly ref: string;\n readonly purpose: string | null;\n readonly businessRole: string | null;\n readonly authorityBoundary: string | null;\n readonly useWhen: string | null;\n readonly avoidWhen: string | null;\n readonly businessConstraints: readonly string[] | null;\n}\n\n/**\n * Application-independent organization-role projection before UI labels are\n * joined. The introspection subprocess can safely emit this JSON-only shape;\n * the parent companion later joins the application's primary-locale labels.\n */\nexport interface ApplicationOrganizationRoleDocumentationSource {\n readonly role: string;\n readonly inheritFrom: string | null;\n readonly purpose: string;\n readonly businessRole: string | null;\n readonly authorityBoundary: string;\n readonly useWhen: string;\n readonly avoidWhen: string;\n readonly businessConstraints: readonly string[];\n}\n\n/** Complete consumer-visible role documentation after the application label join. */\nexport interface ApplicationOrganizationRoleDocumentation extends ApplicationOrganizationRoleDocumentationSource {\n readonly label: string;\n readonly description: string;\n}\n\ninterface ApplicationRoleConfigurationProjectionInput {\n readonly role?: string;\n readonly inheritFrom?: string;\n readonly relatedPrimaryScope: ResourcePrimaryScope;\n}\n\n/**\n * Index companion-exported role specifications by their runtime role token.\n * Engine and application-defined roles intentionally share this namespace.\n */\nexport function indexApplicationRoleDocumentationSources(\n roleSpecifications: Record<string, unknown> | undefined,\n): ReadonlyMap<string, ApplicationRoleDocumentationSource> {\n const result = new Map<string, ApplicationRoleDocumentationSource>();\n for (const candidate of Object.values(roleSpecifications ?? {})) {\n if (!isPlainObject(candidate) || typeof candidate.ref !== 'string' || candidate.ref.length === 0) continue;\n if (result.has(candidate.ref)) {\n throw new Error(`application organization-role projector: duplicate role specification for '${candidate.ref}'`);\n }\n result.set(candidate.ref, {\n ref: candidate.ref,\n purpose: nonEmptyStringOrNull(candidate.purpose),\n businessRole: nonEmptyStringOrNull(candidate.businessRole),\n authorityBoundary: nonEmptyStringOrNull(candidate.authorityBoundary),\n useWhen: nonEmptyStringOrNull(candidate.useWhen),\n avoidWhen: nonEmptyStringOrNull(candidate.avoidWhen),\n businessConstraints: nonEmptyStringArrayOrNull(candidate.businessConstraints),\n });\n }\n return result;\n}\n\n/**\n * Resolve every framework and application-defined organization role from the\n * application's merged runtime registry and authored role specifications.\n * Application-scoped roles are deliberately excluded from this organization\n * administration reference.\n */\nexport function projectApplicationOrganizationRoleDocumentationSources(\n customRoles: Readonly<Record<string, ApplicationRoleConfigurationProjectionInput>> | undefined,\n roleSpecsByRef: ReadonlyMap<string, ApplicationRoleDocumentationSource>,\n): readonly ApplicationOrganizationRoleDocumentationSource[] {\n const configured = new Map<string, ApplicationRoleConfigurationProjectionInput & { readonly role: string }>();\n for (const config of Object.values(DEFAULT_ORGANIZATION_ROLES)) {\n if (typeof config.role !== 'string' || config.role.length === 0) {\n throw new Error('application organization-role projector: framework organization role configuration has no role token');\n }\n configured.set(config.role, { ...config, role: config.role });\n }\n for (const config of Object.values(customRoles ?? {})) {\n if (typeof config.role !== 'string' || config.role.length === 0) {\n throw new Error('application organization-role projector: application organization role configuration has no role token');\n }\n if (configured.has(config.role)) {\n throw new Error(`application organization-role projector: application role '${config.role}' collides with a framework organization role`);\n }\n configured.set(config.role, { ...config, role: config.role });\n }\n\n return Object.freeze([...configured.values()]\n .filter((config) => config.relatedPrimaryScope === ResourcePrimaryScope.ORGANIZATIONS)\n .map((config) => {\n const specification = roleSpecsByRef.get(config.role);\n if (\n specification === undefined\n || specification.purpose === null\n || specification.authorityBoundary === null\n || specification.useWhen === null\n || specification.avoidWhen === null\n || specification.businessConstraints === null\n ) {\n throw new Error(\n `application organization-role projector: organization role '${config.role}' has no companion-exported role specification with complete consumer guidance`,\n );\n }\n return Object.freeze({\n role: config.role,\n inheritFrom: config.inheritFrom ?? null,\n purpose: specification.purpose,\n businessRole: specification.businessRole,\n authorityBoundary: specification.authorityBoundary,\n useWhen: specification.useWhen,\n avoidWhen: specification.avoidWhen,\n businessConstraints: specification.businessConstraints,\n });\n })\n .sort((left, right) => left.role.localeCompare(right.role, 'en-US')));\n}\n\n/**\n * Join role semantics to the exact primary-locale labels shown by the\n * application. Missing values fail closed: publishing a guessed label would\n * make the guide disagree with member-management and role-picker UI.\n */\nexport function resolveApplicationOrganizationRoleDocumentation(\n roles: readonly ApplicationOrganizationRoleDocumentationSource[],\n primaryLocaleLabels: Readonly<Record<string, string>>,\n): readonly ApplicationOrganizationRoleDocumentation[] {\n return Object.freeze(roles.map((role) => Object.freeze({\n ...role,\n label: requiredRoleLabel(primaryLocaleLabels, role.role, 'label'),\n description: requiredRoleLabel(primaryLocaleLabels, role.role, 'description'),\n })));\n}\n\n/**\n * Give every operation's access documentation the role names the APPLICATION authored.\n *\n * ## The defect this closes\n *\n * `roleRequirements[].label` was derived from the role TOKEN in the projector subprocess —\n * `ORG_MANAGER` became \"Organization Manager\" and `APP_ADMIN_SUPER_ADMIN` became \"Application Admin\n * Super Admin\". That is invented display text (`.claude/rules/display-text-comes-from-i18n.md`), and\n * it appeared on EVERY documented operation, which is the largest surface the defect had. Meanwhile\n * the same roles carry authored labels resolved from the application's own i18n unit, and\n * publication already refuses to proceed without them — but those labels reached only the roles\n * page. Two names for one role, and the invented one was the one beside every endpoint (#382).\n *\n * ## Why a token is the fallback, and not a prettier guess\n *\n * A label this map does not carry stays the raw token. `ORG_MANAGER` is honest, searchable, and\n * visibly not a product's word — an invented English phrase is none of those, and once printed it is\n * indistinguishable from an authored one. The refusal belongs at the door that PUBLISHES, which\n * already has it; a read that merely generates a document must not fail closed on an authoring gap.\n *\n * Returns new objects; the input projections are left untouched.\n */\nexport function applyAuthoredRoleLabelsToOperationAccess<\n T extends { readonly access?: { readonly roleRequirements: readonly { readonly role: string; readonly label: string }[] } },\n>(operations: readonly T[], labelByRole: Readonly<Record<string, string>>): readonly T[] {\n return operations.map((operation) => {\n const access = operation.access;\n if (access === undefined || access.roleRequirements.length === 0) return operation;\n let changed = false;\n const roleRequirements = access.roleRequirements.map((requirement) => {\n const authored = labelByRole[requirement.role];\n if (authored === undefined || authored === requirement.label) return requirement;\n changed = true;\n return { ...requirement, label: authored };\n });\n return changed ? { ...operation, access: { ...access, roleRequirements } } : operation;\n });\n}\n\n/**\n * Materialize the reusable Markdown fact consumed by the Roles and permissions\n * topic. This function knows no application identity: different applications\n * receive different role inputs and therefore different facts.\n */\nexport function createApplicationOrganizationRolesDocumentationFact(\n roles: readonly ApplicationOrganizationRoleDocumentation[],\n): ApplicationOrganizationRolesDocumentationFact {\n if (roles.length === 0) throw new Error('technical documentation requires at least one resolved organization role');\n if (new Set(roles.map((role) => role.role)).size !== roles.length) {\n throw new Error('technical documentation received duplicate resolved organization roles');\n }\n\n const roleByIdentifier = new Map(roles.map((role) => [role.role, role]));\n const hierarchyDepthByRole = new Map(roles.map((role) => [role.role, hierarchyDepth(role, roleByIdentifier)]));\n // Readers compare authority from broadest to narrowest. Derive that order\n // from the actual inheritance chain; sibling branches use visible labels and\n // stable role tokens only as deterministic tie-breakers.\n const canonicalRoles = [...roles].sort((left, right) =>\n hierarchyDepthByRole.get(right.role)! - hierarchyDepthByRole.get(left.role)!\n || left.label.localeCompare(right.label, 'en-US')\n || left.role.localeCompare(right.role, 'en-US'));\n\n const roleSections = canonicalRoles.map((role) => {\n const inheritedRole = role.inheritFrom === null ? undefined : roleByIdentifier.get(role.inheritFrom);\n const inheritance = role.inheritFrom === null\n ? 'This role does not inherit another organization role.'\n : `This role includes the permissions of **${markdownText(inheritedRole?.label ?? role.inheritFrom)}** (${inlineCode(role.inheritFrom)}).`;\n const limits = [role.avoidWhen, ...role.businessConstraints]\n .map((constraint) => `- ${markdownProse(constraint)}`)\n .join('\\n');\n return `### ${markdownText(role.label)}\\n\\n${markdownText(role.description)}\\n\\n- **Where it applies:** ${markdownProse(role.authorityBoundary)}\\n- **Inherited access:** ${inheritance}\\n- **Technical identifier:** ${inlineCode(role.role)}\\n\\n#### Can do\\n\\n${markdownProse(role.purpose)}\\n\\n${markdownProse(role.useWhen)}\\n\\n#### Cannot do\\n\\n${limits}\\n\\n#### Can assign\\n\\n${roleAssignmentMarkdown(role, roleByIdentifier)}`;\n }).join('\\n\\n');\n\n return Object.freeze({\n sourceRef: APPLICATION_ORGANIZATION_ROLES_DOCUMENTATION_SOURCE_REF,\n markdown: `These are all the organization roles available in this application. Their names and short descriptions match the application's primary-language interface; the technical identifier is included so you can recognize the same role in an access request, audit record, or API response.\\n\\n${roleSections}\\n\\n> **How inherited access works:** when one role includes another, it receives the included role’s permissions as well as its own. The reverse is not true: assigning the included role never grants the higher role.`,\n sourceVersion: APPLICATION_ORGANIZATION_ROLES_DOCUMENTATION_SOURCE_VERSION,\n });\n}\n\nfunction hierarchyDepth(\n role: ApplicationOrganizationRoleDocumentation,\n roleByIdentifier: ReadonlyMap<string, ApplicationOrganizationRoleDocumentation>,\n ancestors = new Set<string>(),\n): number {\n if (role.inheritFrom === null) return 0;\n if (ancestors.has(role.role)) {\n throw new Error(`technical documentation organization-role hierarchy contains a cycle at ${role.role}`);\n }\n const inheritedRole = roleByIdentifier.get(role.inheritFrom);\n if (inheritedRole === undefined) {\n throw new Error(`technical documentation organization role ${role.role} inherits absent role ${role.inheritFrom}`);\n }\n return 1 + hierarchyDepth(inheritedRole, roleByIdentifier, new Set([...ancestors, role.role]));\n}\n\n/**\n * Explain the standard organization-role assignment ceiling from the exact\n * application role graph. This deliberately does not flatten custom roles into\n * a total order: sibling custom branches are outside one another's ceiling.\n * A role must also inherit the administrator gate before it can use the\n * standard membership and unit-assignment controls at all.\n */\nfunction roleAssignmentMarkdown(\n role: ApplicationOrganizationRoleDocumentation,\n roleByIdentifier: ReadonlyMap<string, ApplicationOrganizationRoleDocumentation>,\n): string {\n const effectiveRoles: ApplicationOrganizationRoleDocumentation[] = [];\n let current: ApplicationOrganizationRoleDocumentation | undefined = role;\n const visited = new Set<string>();\n while (current !== undefined) {\n if (visited.has(current.role)) {\n throw new Error(`technical documentation organization-role hierarchy contains a cycle at ${current.role}`);\n }\n visited.add(current.role);\n effectiveRoles.push(current);\n current = current.inheritFrom === null ? undefined : roleByIdentifier.get(current.inheritFrom);\n }\n\n if (!effectiveRoles.some((candidate) => candidate.role === CORE_ORG_ROLES.ORG_ADMIN)) {\n return 'This role cannot use the standard organization-membership or organization-unit assignment controls. It therefore cannot assign an organization or unit role through those controls.';\n }\n\n const assignableRoles = effectiveRoles\n .map((candidate) => `**${markdownText(candidate.label)}** (${inlineCode(candidate.role)})`)\n .join(', ');\n return `Through the standard membership and unit-assignment controls, this role can assign: ${assignableRoles}. It cannot assign a role outside this inheritance chain unless the person also holds another organization-wide role whose chain includes it.`;\n}\n\nfunction requiredRoleLabel(\n labels: Readonly<Record<string, string>>,\n role: string,\n field: 'label' | 'description',\n): string {\n const key = `roles.${role}.${field}`;\n const value = labels[key];\n if (typeof value !== 'string' || value.trim().length === 0) {\n throw new Error(\n `application organization-role documentation requires primary-locale label '${key}'; generate the application's role labels before publishing documentation`,\n );\n }\n return value.trim();\n}\n\nfunction nonEmptyStringOrNull(value: unknown): string | null {\n return typeof value === 'string' && value.trim().length > 0 ? value.trim() : null;\n}\n\nfunction nonEmptyStringArrayOrNull(value: unknown): readonly string[] | null {\n if (!Array.isArray(value) || value.length === 0) return null;\n const normalized = value.map(nonEmptyStringOrNull);\n return normalized.every((entry): entry is string => entry !== null)\n ? Object.freeze(normalized)\n : null;\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction markdownText(value: string): string {\n return value.replaceAll(/\\s+/g, ' ').trim().replaceAll('\\\\', '\\\\\\\\').replaceAll(/([`*_[\\]<>#|])/g, '\\\\$1');\n}\n\n/** Role specifications intentionally author small inline-Markdown semantics. */\nfunction markdownProse(value: string): string {\n return value.replaceAll(/\\s+/g, ' ').trim();\n}\n\nfunction inlineCode(value: string): string {\n return `\\`${value.replaceAll('`', '`')}\\``;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-organization-unit-resource-documentation.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"application-organization-unit-resource-documentation.d.ts","sourceRoot":"","sources":["../../../../src/companion/application-documentation/application-organization-unit-resource-documentation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAEnE,eAAO,MAAM,gEAAgE,EAC3E,+DAAwE,CAAC;AAC3E,4GAA4G;AAC5G,eAAO,MAAM,oEAAoE,IAAI,CAAC;AAEtF,0EAA0E;AAC1E,MAAM,WAAW,qDAAqD;IACpE,QAAQ,CAAC,SAAS,EAAE,OAAO,gEAAgE,CAAC;IAC5F,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAED;;;;;GAKG;AACH,MAAM,WAAW,gDAAgD;IAC/D,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;GAQG;AACH,wBAAgB,uDAAuD,CACrE,yBAAyB,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE;IAAE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAAC,GAAG,SAAS,EAC5G,YAAY,EAAE,SAAS,WAAW,EAAE,GACnC,SAAS,gDAAgD,EAAE,CA4B7D;AAED,kFAAkF;AAClF,wBAAgB,2DAA2D,CACzE,SAAS,EAAE,SAAS,gDAAgD,EAAE,GACrE,qDAAqD,CAiBvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"technical-documentation-engine-content-bundle.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"technical-documentation-engine-content-bundle.d.ts","sourceRoot":"","sources":["../../../../src/companion/application-documentation/technical-documentation-engine-content-bundle.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,sCAAsC,EAC5C,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAGL,KAAK,0CAA0C,EAChD,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAGL,KAAK,uCAAuC,EAC7C,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAGL,KAAK,kCAAkC,EACxC,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAGL,KAAK,0CAA0C,EAChD,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAEL,iCAAiC,EAKjC,qCAAqC,EAGrC,oCAAoC,EAEpC,KAAK,oCAAoC,EAEzC,8BAA8B,EAE9B,KAAK,gDAAgD,EACrD,KAAK,0CAA0C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