@lssm/lib.feature-flags 0.0.0-canary-20251219202229 → 0.0.0-canary-20251220002821
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/contracts/dist/capabilities/openbanking.js.map +1 -1
- package/dist/contracts/dist/contract-registry/schemas.js.map +1 -1
- package/dist/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js.map +1 -1
- package/dist/contracts/dist/docs/meta.docs.js.map +1 -1
- package/dist/contracts/dist/docs/presentations.js.map +1 -1
- package/dist/contracts/dist/docs/registry.js.map +1 -1
- package/dist/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js.map +1 -1
- package/dist/contracts/dist/docs/tech/contracts/openapi-export.docblock.js.map +1 -1
- package/dist/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js.map +1 -1
- package/dist/contracts/dist/docs/tech/llm/llm-integration.docblock.js.map +1 -1
- package/dist/contracts/dist/docs/tech/mcp-endpoints.docblock.js.map +1 -1
- package/dist/contracts/dist/docs/tech/presentation-runtime.docblock.js.map +1 -1
- package/dist/contracts/dist/docs/tech/schema/README.docblock.js.map +1 -1
- package/dist/contracts/dist/docs/tech/studio/learning-events.docblock.js.map +1 -1
- package/dist/contracts/dist/docs/tech/studio/learning-journeys.docblock.js.map +1 -1
- package/dist/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js.map +1 -1
- package/dist/contracts/dist/docs/tech/studio/project-access-teams.docblock.js.map +1 -1
- package/dist/contracts/dist/docs/tech/studio/project-routing.docblock.js.map +1 -1
- package/dist/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js.map +1 -1
- package/dist/contracts/dist/docs/tech/studio/team-invitations.docblock.js.map +1 -1
- package/dist/contracts/dist/docs/tech/studio/workspace-ops.docblock.js.map +1 -1
- package/dist/contracts/dist/docs/tech/studio/workspaces.docblock.js.map +1 -1
- package/dist/contracts/dist/docs/tech/telemetry-ingest.docblock.js.map +1 -1
- package/dist/contracts/dist/docs/tech/templates/runtime.docblock.js.map +1 -1
- package/dist/contracts/dist/docs/tech/vscode-extension.docblock.js.map +1 -1
- package/dist/contracts/dist/docs/tech/workflows/overview.docblock.js.map +1 -1
- package/dist/contracts/dist/docs/tech-contracts.docs.js.map +1 -1
- package/dist/contracts/dist/events.js.map +1 -1
- package/dist/contracts/dist/integrations/contracts.js.map +1 -1
- package/dist/contracts/dist/integrations/openbanking/contracts/accounts.js.map +1 -1
- package/dist/contracts/dist/integrations/openbanking/contracts/balances.js.map +1 -1
- package/dist/contracts/dist/integrations/openbanking/contracts/transactions.js.map +1 -1
- package/dist/contracts/dist/integrations/openbanking/models.js.map +1 -1
- package/dist/contracts/dist/integrations/openbanking/telemetry.js.map +1 -1
- package/dist/contracts/dist/integrations/providers/elevenlabs.js.map +1 -1
- package/dist/contracts/dist/integrations/providers/gcs-storage.js.map +1 -1
- package/dist/contracts/dist/integrations/providers/gmail.js.map +1 -1
- package/dist/contracts/dist/integrations/providers/google-calendar.js.map +1 -1
- package/dist/contracts/dist/integrations/providers/mistral.js.map +1 -1
- package/dist/contracts/dist/integrations/providers/postmark.js.map +1 -1
- package/dist/contracts/dist/integrations/providers/powens.js.map +1 -1
- package/dist/contracts/dist/integrations/providers/qdrant.js.map +1 -1
- package/dist/contracts/dist/integrations/providers/stripe.js.map +1 -1
- package/dist/contracts/dist/integrations/providers/twilio-sms.js.map +1 -1
- package/dist/contracts/dist/knowledge/contracts.js.map +1 -1
- package/dist/contracts/dist/knowledge/spaces/email-threads.js.map +1 -1
- package/dist/contracts/dist/knowledge/spaces/financial-docs.js.map +1 -1
- package/dist/contracts/dist/knowledge/spaces/financial-overview.js.map +1 -1
- package/dist/contracts/dist/knowledge/spaces/product-canon.js.map +1 -1
- package/dist/contracts/dist/knowledge/spaces/support-faq.js.map +1 -1
- package/dist/contracts/dist/knowledge/spaces/uploaded-docs.js.map +1 -1
- package/dist/contracts/dist/llm/exporters.js.map +1 -1
- package/dist/contracts/dist/onboarding-base.js.map +1 -1
- package/dist/contracts/dist/ownership.js.map +1 -1
- package/dist/contracts/dist/presentations.v2.js.map +1 -1
- package/dist/contracts/dist/regenerator/service.js.map +1 -1
- package/dist/contracts/dist/schema/dist/index.js.map +1 -1
- package/dist/contracts/dist/spec.js.map +1 -1
- package/dist/evaluation/index.d.ts.map +1 -1
- package/dist/evaluation/index.js.map +1 -1
- package/package.json +13 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postmark.js","names":[],"sources":["../../../../../../contracts/dist/integrations/providers/postmark.js"],"sourcesContent":["import { StabilityEnum } from \"../../ownership.js\";\n\n//#region src/integrations/providers/postmark.ts\nconst postmarkIntegrationSpec = {\n\tmeta: {\n\t\tkey: \"email.postmark\",\n\t\tversion: 1,\n\t\tcategory: \"email\",\n\t\tdisplayName: \"Postmark\",\n\t\ttitle: \"Postmark Transactional Email\",\n\t\tdescription: \"Postmark integration for transactional email delivery.\",\n\t\tdomain: \"communications\",\n\t\towners: [\"platform.messaging\"],\n\t\ttags: [\"email\", \"transactional\"],\n\t\tstability: StabilityEnum.Stable\n\t},\n\tsupportedModes: [\"managed\", \"byok\"],\n\tcapabilities: {\n\t\tprovides: [{\n\t\t\tkey: \"email.transactional\",\n\t\t\tversion: 1\n\t\t}],\n\t\trequires: [{\n\t\t\tkey: \"platform.webhooks\",\n\t\t\toptional: true,\n\t\t\treason: \"Optional for inbound bounce handling\"\n\t\t}]\n\t},\n\tconfigSchema: {\n\t\tschema: {\n\t\t\ttype: \"object\",\n\t\t\tproperties: {\n\t\t\t\tmessageStream: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tdescription: \"Optional message stream identifier (e.g., transactional).\"\n\t\t\t\t},\n\t\t\t\tfromEmail: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tdescription: \"Default From address used for outbound messages.\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\texample: {\n\t\t\tmessageStream: \"outbound\",\n\t\t\tfromEmail: \"notifications@example.com\"\n\t\t}\n\t},\n\tsecretSchema: {\n\t\tschema: {\n\t\t\ttype: \"object\",\n\t\t\trequired: [\"serverToken\"],\n\t\t\tproperties: { serverToken: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"Server token for the Postmark account.\"\n\t\t\t} }\n\t\t},\n\t\texample: { serverToken: \"server-***\" }\n\t},\n\thealthCheck: {\n\t\tmethod: \"ping\",\n\t\ttimeoutMs: 3e3\n\t},\n\tdocsUrl: \"https://postmarkapp.com/developer\",\n\tconstraints: { rateLimit: { rpm: 500 } },\n\tbyokSetup: { setupInstructions: \"Create a Postmark server token with outbound send permissions and configure allowed from addresses.\" }\n};\nfunction registerPostmarkIntegration(registry) {\n\treturn registry.register(postmarkIntegrationSpec);\n}\n\n//#endregion\nexport { postmarkIntegrationSpec, registerPostmarkIntegration }
|
|
1
|
+
{"version":3,"file":"postmark.js","names":[],"sources":["../../../../../../contracts/dist/integrations/providers/postmark.js"],"sourcesContent":["import { StabilityEnum } from \"../../ownership.js\";\n\n//#region src/integrations/providers/postmark.ts\nconst postmarkIntegrationSpec = {\n\tmeta: {\n\t\tkey: \"email.postmark\",\n\t\tversion: 1,\n\t\tcategory: \"email\",\n\t\tdisplayName: \"Postmark\",\n\t\ttitle: \"Postmark Transactional Email\",\n\t\tdescription: \"Postmark integration for transactional email delivery.\",\n\t\tdomain: \"communications\",\n\t\towners: [\"platform.messaging\"],\n\t\ttags: [\"email\", \"transactional\"],\n\t\tstability: StabilityEnum.Stable\n\t},\n\tsupportedModes: [\"managed\", \"byok\"],\n\tcapabilities: {\n\t\tprovides: [{\n\t\t\tkey: \"email.transactional\",\n\t\t\tversion: 1\n\t\t}],\n\t\trequires: [{\n\t\t\tkey: \"platform.webhooks\",\n\t\t\toptional: true,\n\t\t\treason: \"Optional for inbound bounce handling\"\n\t\t}]\n\t},\n\tconfigSchema: {\n\t\tschema: {\n\t\t\ttype: \"object\",\n\t\t\tproperties: {\n\t\t\t\tmessageStream: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tdescription: \"Optional message stream identifier (e.g., transactional).\"\n\t\t\t\t},\n\t\t\t\tfromEmail: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tdescription: \"Default From address used for outbound messages.\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\texample: {\n\t\t\tmessageStream: \"outbound\",\n\t\t\tfromEmail: \"notifications@example.com\"\n\t\t}\n\t},\n\tsecretSchema: {\n\t\tschema: {\n\t\t\ttype: \"object\",\n\t\t\trequired: [\"serverToken\"],\n\t\t\tproperties: { serverToken: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"Server token for the Postmark account.\"\n\t\t\t} }\n\t\t},\n\t\texample: { serverToken: \"server-***\" }\n\t},\n\thealthCheck: {\n\t\tmethod: \"ping\",\n\t\ttimeoutMs: 3e3\n\t},\n\tdocsUrl: \"https://postmarkapp.com/developer\",\n\tconstraints: { rateLimit: { rpm: 500 } },\n\tbyokSetup: { setupInstructions: \"Create a Postmark server token with outbound send permissions and configure allowed from addresses.\" }\n};\nfunction registerPostmarkIntegration(registry) {\n\treturn registry.register(postmarkIntegrationSpec);\n}\n\n//#endregion\nexport { postmarkIntegrationSpec, registerPostmarkIntegration };"],"mappings":";;;AAGA,MAAM,0BAA0B;CAC/B,MAAM;EACL,KAAK;EACL,SAAS;EACT,UAAU;EACV,aAAa;EACb,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,qBAAqB;EAC9B,MAAM,CAAC,SAAS,gBAAgB;EAChC,WAAW,cAAc;EACzB;CACD,gBAAgB,CAAC,WAAW,OAAO;CACnC,cAAc;EACb,UAAU,CAAC;GACV,KAAK;GACL,SAAS;GACT,CAAC;EACF,UAAU,CAAC;GACV,KAAK;GACL,UAAU;GACV,QAAQ;GACR,CAAC;EACF;CACD,cAAc;EACb,QAAQ;GACP,MAAM;GACN,YAAY;IACX,eAAe;KACd,MAAM;KACN,aAAa;KACb;IACD,WAAW;KACV,MAAM;KACN,aAAa;KACb;IACD;GACD;EACD,SAAS;GACR,eAAe;GACf,WAAW;GACX;EACD;CACD,cAAc;EACb,QAAQ;GACP,MAAM;GACN,UAAU,CAAC,cAAc;GACzB,YAAY,EAAE,aAAa;IAC1B,MAAM;IACN,aAAa;IACb,EAAE;GACH;EACD,SAAS,EAAE,aAAa,cAAc;EACtC;CACD,aAAa;EACZ,QAAQ;EACR,WAAW;EACX;CACD,SAAS;CACT,aAAa,EAAE,WAAW,EAAE,KAAK,KAAK,EAAE;CACxC,WAAW,EAAE,mBAAmB,uGAAuG;CACvI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"powens.js","names":[],"sources":["../../../../../../contracts/dist/integrations/providers/powens.js"],"sourcesContent":["import { StabilityEnum } from \"../../ownership.js\";\n\n//#region src/integrations/providers/powens.ts\nconst powensIntegrationSpec = {\n\tmeta: {\n\t\tkey: \"openbanking.powens\",\n\t\tversion: 1,\n\t\tcategory: \"open-banking\",\n\t\tdisplayName: \"Powens Open Banking\",\n\t\ttitle: \"Powens Open Banking (Read)\",\n\t\tdescription: \"Read-only Open Banking integration powered by Powens, exposing accounts, transactions, and balances.\",\n\t\tdomain: \"finance\",\n\t\towners: [\"platform.finance\"],\n\t\ttags: [\n\t\t\t\"open-banking\",\n\t\t\t\"powens\",\n\t\t\t\"finance\"\n\t\t],\n\t\tstability: StabilityEnum.Experimental\n\t},\n\tsupportedModes: [\"byok\"],\n\tcapabilities: { provides: [\n\t\t{\n\t\t\tkey: \"openbanking.accounts.read\",\n\t\t\tversion: 1\n\t\t},\n\t\t{\n\t\t\tkey: \"openbanking.transactions.read\",\n\t\t\tversion: 1\n\t\t},\n\t\t{\n\t\t\tkey: \"openbanking.balances.read\",\n\t\t\tversion: 1\n\t\t}\n\t] },\n\tconfigSchema: {\n\t\tschema: {\n\t\t\ttype: \"object\",\n\t\t\trequired: [\"environment\"],\n\t\t\tproperties: {\n\t\t\t\tenvironment: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tenum: [\"sandbox\", \"production\"],\n\t\t\t\t\tdescription: \"Powens environment to target. Sandbox uses Powens test API base URL, production uses live endpoints.\"\n\t\t\t\t},\n\t\t\t\tbaseUrl: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tdescription: \"Optional override for the Powens API base URL. Defaults to Powens environment defaults.\"\n\t\t\t\t},\n\t\t\t\tregion: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tdescription: \"Optional Powens region identifier when targeting a specific data residency cluster.\"\n\t\t\t\t},\n\t\t\t\tpollingIntervalMs: {\n\t\t\t\t\ttype: \"number\",\n\t\t\t\t\tdescription: \"Optional custom polling interval in milliseconds for background sync jobs (defaults to platform standard).\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\texample: {\n\t\t\tenvironment: \"sandbox\",\n\t\t\tbaseUrl: \"https://api-sandbox.powens.com/v2\",\n\t\t\tregion: \"eu-west-1\",\n\t\t\tpollingIntervalMs: 3e5\n\t\t}\n\t},\n\tsecretSchema: {\n\t\tschema: {\n\t\t\ttype: \"object\",\n\t\t\trequired: [\"clientId\", \"clientSecret\"],\n\t\t\tproperties: {\n\t\t\t\tclientId: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tdescription: \"Powens OAuth client identifier obtained from the Powens Console (BYOK project).\"\n\t\t\t\t},\n\t\t\t\tclientSecret: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tdescription: \"Powens OAuth client secret used to exchange for access tokens.\"\n\t\t\t\t},\n\t\t\t\tapiKey: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tdescription: \"Optional Powens API key (if the tenant project exposes a dedicated API token).\"\n\t\t\t\t},\n\t\t\t\twebhookSecret: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tdescription: \"Optional webhook signing secret used to verify Powens webhook payloads.\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\texample: {\n\t\t\tclientId: \"powens-client-id\",\n\t\t\tclientSecret: \"powens-client-secret\",\n\t\t\tapiKey: \"powens-api-key\",\n\t\t\twebhookSecret: \"powens-webhook-secret\"\n\t\t}\n\t},\n\thealthCheck: {\n\t\tmethod: \"ping\",\n\t\ttimeoutMs: 8e3\n\t},\n\tdocsUrl: \"https://docs.powens.com/\",\n\tconstraints: { rateLimit: {\n\t\trph: 1e4,\n\t\trpm: 600\n\t} },\n\tbyokSetup: {\n\t\tsetupInstructions: \"Create a Powens BYOK project, generate OAuth credentials, and optionally configure webhook delivery for account/transaction updates.\",\n\t\trequiredScopes: [\n\t\t\t\"accounts:read\",\n\t\t\t\"transactions:read\",\n\t\t\t\"balances:read\"\n\t\t]\n\t}\n};\nfunction registerPowensIntegration(registry) {\n\treturn registry.register(powensIntegrationSpec);\n}\n\n//#endregion\nexport { powensIntegrationSpec, registerPowensIntegration }
|
|
1
|
+
{"version":3,"file":"powens.js","names":[],"sources":["../../../../../../contracts/dist/integrations/providers/powens.js"],"sourcesContent":["import { StabilityEnum } from \"../../ownership.js\";\n\n//#region src/integrations/providers/powens.ts\nconst powensIntegrationSpec = {\n\tmeta: {\n\t\tkey: \"openbanking.powens\",\n\t\tversion: 1,\n\t\tcategory: \"open-banking\",\n\t\tdisplayName: \"Powens Open Banking\",\n\t\ttitle: \"Powens Open Banking (Read)\",\n\t\tdescription: \"Read-only Open Banking integration powered by Powens, exposing accounts, transactions, and balances.\",\n\t\tdomain: \"finance\",\n\t\towners: [\"platform.finance\"],\n\t\ttags: [\n\t\t\t\"open-banking\",\n\t\t\t\"powens\",\n\t\t\t\"finance\"\n\t\t],\n\t\tstability: StabilityEnum.Experimental\n\t},\n\tsupportedModes: [\"byok\"],\n\tcapabilities: { provides: [\n\t\t{\n\t\t\tkey: \"openbanking.accounts.read\",\n\t\t\tversion: 1\n\t\t},\n\t\t{\n\t\t\tkey: \"openbanking.transactions.read\",\n\t\t\tversion: 1\n\t\t},\n\t\t{\n\t\t\tkey: \"openbanking.balances.read\",\n\t\t\tversion: 1\n\t\t}\n\t] },\n\tconfigSchema: {\n\t\tschema: {\n\t\t\ttype: \"object\",\n\t\t\trequired: [\"environment\"],\n\t\t\tproperties: {\n\t\t\t\tenvironment: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tenum: [\"sandbox\", \"production\"],\n\t\t\t\t\tdescription: \"Powens environment to target. Sandbox uses Powens test API base URL, production uses live endpoints.\"\n\t\t\t\t},\n\t\t\t\tbaseUrl: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tdescription: \"Optional override for the Powens API base URL. Defaults to Powens environment defaults.\"\n\t\t\t\t},\n\t\t\t\tregion: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tdescription: \"Optional Powens region identifier when targeting a specific data residency cluster.\"\n\t\t\t\t},\n\t\t\t\tpollingIntervalMs: {\n\t\t\t\t\ttype: \"number\",\n\t\t\t\t\tdescription: \"Optional custom polling interval in milliseconds for background sync jobs (defaults to platform standard).\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\texample: {\n\t\t\tenvironment: \"sandbox\",\n\t\t\tbaseUrl: \"https://api-sandbox.powens.com/v2\",\n\t\t\tregion: \"eu-west-1\",\n\t\t\tpollingIntervalMs: 3e5\n\t\t}\n\t},\n\tsecretSchema: {\n\t\tschema: {\n\t\t\ttype: \"object\",\n\t\t\trequired: [\"clientId\", \"clientSecret\"],\n\t\t\tproperties: {\n\t\t\t\tclientId: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tdescription: \"Powens OAuth client identifier obtained from the Powens Console (BYOK project).\"\n\t\t\t\t},\n\t\t\t\tclientSecret: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tdescription: \"Powens OAuth client secret used to exchange for access tokens.\"\n\t\t\t\t},\n\t\t\t\tapiKey: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tdescription: \"Optional Powens API key (if the tenant project exposes a dedicated API token).\"\n\t\t\t\t},\n\t\t\t\twebhookSecret: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tdescription: \"Optional webhook signing secret used to verify Powens webhook payloads.\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\texample: {\n\t\t\tclientId: \"powens-client-id\",\n\t\t\tclientSecret: \"powens-client-secret\",\n\t\t\tapiKey: \"powens-api-key\",\n\t\t\twebhookSecret: \"powens-webhook-secret\"\n\t\t}\n\t},\n\thealthCheck: {\n\t\tmethod: \"ping\",\n\t\ttimeoutMs: 8e3\n\t},\n\tdocsUrl: \"https://docs.powens.com/\",\n\tconstraints: { rateLimit: {\n\t\trph: 1e4,\n\t\trpm: 600\n\t} },\n\tbyokSetup: {\n\t\tsetupInstructions: \"Create a Powens BYOK project, generate OAuth credentials, and optionally configure webhook delivery for account/transaction updates.\",\n\t\trequiredScopes: [\n\t\t\t\"accounts:read\",\n\t\t\t\"transactions:read\",\n\t\t\t\"balances:read\"\n\t\t]\n\t}\n};\nfunction registerPowensIntegration(registry) {\n\treturn registry.register(powensIntegrationSpec);\n}\n\n//#endregion\nexport { powensIntegrationSpec, registerPowensIntegration };"],"mappings":";;;AAGA,MAAM,wBAAwB;CAC7B,MAAM;EACL,KAAK;EACL,SAAS;EACT,UAAU;EACV,aAAa;EACb,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,mBAAmB;EAC5B,MAAM;GACL;GACA;GACA;GACA;EACD,WAAW,cAAc;EACzB;CACD,gBAAgB,CAAC,OAAO;CACxB,cAAc,EAAE,UAAU;EACzB;GACC,KAAK;GACL,SAAS;GACT;EACD;GACC,KAAK;GACL,SAAS;GACT;EACD;GACC,KAAK;GACL,SAAS;GACT;EACD,EAAE;CACH,cAAc;EACb,QAAQ;GACP,MAAM;GACN,UAAU,CAAC,cAAc;GACzB,YAAY;IACX,aAAa;KACZ,MAAM;KACN,MAAM,CAAC,WAAW,aAAa;KAC/B,aAAa;KACb;IACD,SAAS;KACR,MAAM;KACN,aAAa;KACb;IACD,QAAQ;KACP,MAAM;KACN,aAAa;KACb;IACD,mBAAmB;KAClB,MAAM;KACN,aAAa;KACb;IACD;GACD;EACD,SAAS;GACR,aAAa;GACb,SAAS;GACT,QAAQ;GACR,mBAAmB;GACnB;EACD;CACD,cAAc;EACb,QAAQ;GACP,MAAM;GACN,UAAU,CAAC,YAAY,eAAe;GACtC,YAAY;IACX,UAAU;KACT,MAAM;KACN,aAAa;KACb;IACD,cAAc;KACb,MAAM;KACN,aAAa;KACb;IACD,QAAQ;KACP,MAAM;KACN,aAAa;KACb;IACD,eAAe;KACd,MAAM;KACN,aAAa;KACb;IACD;GACD;EACD,SAAS;GACR,UAAU;GACV,cAAc;GACd,QAAQ;GACR,eAAe;GACf;EACD;CACD,aAAa;EACZ,QAAQ;EACR,WAAW;EACX;CACD,SAAS;CACT,aAAa,EAAE,WAAW;EACzB,KAAK;EACL,KAAK;EACL,EAAE;CACH,WAAW;EACV,mBAAmB;EACnB,gBAAgB;GACf;GACA;GACA;GACA;EACD;CACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"qdrant.js","names":[],"sources":["../../../../../../contracts/dist/integrations/providers/qdrant.js"],"sourcesContent":["import { StabilityEnum } from \"../../ownership.js\";\n\n//#region src/integrations/providers/qdrant.ts\nconst qdrantIntegrationSpec = {\n\tmeta: {\n\t\tkey: \"vectordb.qdrant\",\n\t\tversion: 1,\n\t\tcategory: \"vector-db\",\n\t\tdisplayName: \"Qdrant\",\n\t\ttitle: \"Qdrant Vector Database\",\n\t\tdescription: \"Qdrant integration for vector search and embeddings storage.\",\n\t\tdomain: \"ai\",\n\t\towners: [\"platform.ai\"],\n\t\ttags: [\"vector-db\", \"search\"],\n\t\tstability: StabilityEnum.Experimental\n\t},\n\tsupportedModes: [\"managed\", \"byok\"],\n\tcapabilities: {\n\t\tprovides: [{\n\t\t\tkey: \"vector-db.search\",\n\t\t\tversion: 1\n\t\t}, {\n\t\t\tkey: \"vector-db.storage\",\n\t\t\tversion: 1\n\t\t}],\n\t\trequires: [{\n\t\t\tkey: \"ai.embeddings\",\n\t\t\toptional: true,\n\t\t\treason: \"Required if vectors are generated via hosted embedding services\"\n\t\t}]\n\t},\n\tconfigSchema: {\n\t\tschema: {\n\t\t\ttype: \"object\",\n\t\t\tproperties: {\n\t\t\t\tapiUrl: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tdescription: \"Base URL for the Qdrant instance (e.g., https://qdrant.example.com).\"\n\t\t\t\t},\n\t\t\t\tcollectionPrefix: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tdescription: \"Prefix applied to all collection names for this tenant.\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\texample: {\n\t\t\tapiUrl: \"https://qdrant.example.com\",\n\t\t\tcollectionPrefix: \"tenant_\"\n\t\t}\n\t},\n\tsecretSchema: {\n\t\tschema: {\n\t\t\ttype: \"object\",\n\t\t\tproperties: { apiKey: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"API key or token when authentication is enabled.\"\n\t\t\t} }\n\t\t},\n\t\texample: { apiKey: \"qdrant-api-key\" }\n\t},\n\thealthCheck: {\n\t\tmethod: \"ping\",\n\t\ttimeoutMs: 4e3\n\t},\n\tdocsUrl: \"https://qdrant.tech/documentation/quick-start/\",\n\tconstraints: { quotas: {\n\t\tcollections: 100,\n\t\tpointsPerCollection: 1e6\n\t} },\n\tbyokSetup: { setupInstructions: \"Provide the HTTPS endpoint of your Qdrant cluster and generate an API key with read/write access to the collections that will be managed.\" }\n};\nfunction registerQdrantIntegration(registry) {\n\treturn registry.register(qdrantIntegrationSpec);\n}\n\n//#endregion\nexport { qdrantIntegrationSpec, registerQdrantIntegration }
|
|
1
|
+
{"version":3,"file":"qdrant.js","names":[],"sources":["../../../../../../contracts/dist/integrations/providers/qdrant.js"],"sourcesContent":["import { StabilityEnum } from \"../../ownership.js\";\n\n//#region src/integrations/providers/qdrant.ts\nconst qdrantIntegrationSpec = {\n\tmeta: {\n\t\tkey: \"vectordb.qdrant\",\n\t\tversion: 1,\n\t\tcategory: \"vector-db\",\n\t\tdisplayName: \"Qdrant\",\n\t\ttitle: \"Qdrant Vector Database\",\n\t\tdescription: \"Qdrant integration for vector search and embeddings storage.\",\n\t\tdomain: \"ai\",\n\t\towners: [\"platform.ai\"],\n\t\ttags: [\"vector-db\", \"search\"],\n\t\tstability: StabilityEnum.Experimental\n\t},\n\tsupportedModes: [\"managed\", \"byok\"],\n\tcapabilities: {\n\t\tprovides: [{\n\t\t\tkey: \"vector-db.search\",\n\t\t\tversion: 1\n\t\t}, {\n\t\t\tkey: \"vector-db.storage\",\n\t\t\tversion: 1\n\t\t}],\n\t\trequires: [{\n\t\t\tkey: \"ai.embeddings\",\n\t\t\toptional: true,\n\t\t\treason: \"Required if vectors are generated via hosted embedding services\"\n\t\t}]\n\t},\n\tconfigSchema: {\n\t\tschema: {\n\t\t\ttype: \"object\",\n\t\t\tproperties: {\n\t\t\t\tapiUrl: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tdescription: \"Base URL for the Qdrant instance (e.g., https://qdrant.example.com).\"\n\t\t\t\t},\n\t\t\t\tcollectionPrefix: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tdescription: \"Prefix applied to all collection names for this tenant.\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\texample: {\n\t\t\tapiUrl: \"https://qdrant.example.com\",\n\t\t\tcollectionPrefix: \"tenant_\"\n\t\t}\n\t},\n\tsecretSchema: {\n\t\tschema: {\n\t\t\ttype: \"object\",\n\t\t\tproperties: { apiKey: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"API key or token when authentication is enabled.\"\n\t\t\t} }\n\t\t},\n\t\texample: { apiKey: \"qdrant-api-key\" }\n\t},\n\thealthCheck: {\n\t\tmethod: \"ping\",\n\t\ttimeoutMs: 4e3\n\t},\n\tdocsUrl: \"https://qdrant.tech/documentation/quick-start/\",\n\tconstraints: { quotas: {\n\t\tcollections: 100,\n\t\tpointsPerCollection: 1e6\n\t} },\n\tbyokSetup: { setupInstructions: \"Provide the HTTPS endpoint of your Qdrant cluster and generate an API key with read/write access to the collections that will be managed.\" }\n};\nfunction registerQdrantIntegration(registry) {\n\treturn registry.register(qdrantIntegrationSpec);\n}\n\n//#endregion\nexport { qdrantIntegrationSpec, registerQdrantIntegration };"],"mappings":";;;AAGA,MAAM,wBAAwB;CAC7B,MAAM;EACL,KAAK;EACL,SAAS;EACT,UAAU;EACV,aAAa;EACb,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,cAAc;EACvB,MAAM,CAAC,aAAa,SAAS;EAC7B,WAAW,cAAc;EACzB;CACD,gBAAgB,CAAC,WAAW,OAAO;CACnC,cAAc;EACb,UAAU,CAAC;GACV,KAAK;GACL,SAAS;GACT,EAAE;GACF,KAAK;GACL,SAAS;GACT,CAAC;EACF,UAAU,CAAC;GACV,KAAK;GACL,UAAU;GACV,QAAQ;GACR,CAAC;EACF;CACD,cAAc;EACb,QAAQ;GACP,MAAM;GACN,YAAY;IACX,QAAQ;KACP,MAAM;KACN,aAAa;KACb;IACD,kBAAkB;KACjB,MAAM;KACN,aAAa;KACb;IACD;GACD;EACD,SAAS;GACR,QAAQ;GACR,kBAAkB;GAClB;EACD;CACD,cAAc;EACb,QAAQ;GACP,MAAM;GACN,YAAY,EAAE,QAAQ;IACrB,MAAM;IACN,aAAa;IACb,EAAE;GACH;EACD,SAAS,EAAE,QAAQ,kBAAkB;EACrC;CACD,aAAa;EACZ,QAAQ;EACR,WAAW;EACX;CACD,SAAS;CACT,aAAa,EAAE,QAAQ;EACtB,aAAa;EACb,qBAAqB;EACrB,EAAE;CACH,WAAW,EAAE,mBAAmB,6IAA6I;CAC7K"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stripe.js","names":[],"sources":["../../../../../../contracts/dist/integrations/providers/stripe.js"],"sourcesContent":["import { StabilityEnum } from \"../../ownership.js\";\n\n//#region src/integrations/providers/stripe.ts\nconst stripeIntegrationSpec = {\n\tmeta: {\n\t\tkey: \"payments.stripe\",\n\t\tversion: 1,\n\t\tcategory: \"payments\",\n\t\tdisplayName: \"Stripe\",\n\t\ttitle: \"Stripe Payments\",\n\t\tdescription: \"Stripe integration for payment processing, charges, and payouts.\",\n\t\tdomain: \"payments\",\n\t\towners: [\"platform.payments\"],\n\t\ttags: [\"payments\", \"psp\"],\n\t\tstability: StabilityEnum.Stable\n\t},\n\tsupportedModes: [\"managed\", \"byok\"],\n\tcapabilities: {\n\t\tprovides: [{\n\t\t\tkey: \"payments.psp\",\n\t\t\tversion: 1\n\t\t}],\n\t\trequires: [{\n\t\t\tkey: \"platform.webhooks\",\n\t\t\toptional: true,\n\t\t\treason: \"Recommended for reliable event ingestion\"\n\t\t}]\n\t},\n\tconfigSchema: {\n\t\tschema: {\n\t\t\ttype: \"object\",\n\t\t\tproperties: {\n\t\t\t\taccountId: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tdescription: \"Connected account ID when using Stripe Connect (BYOK).\"\n\t\t\t\t},\n\t\t\t\tregion: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tdescription: \"Optional Stripe region or data residency hint.\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\texample: {\n\t\t\taccountId: \"acct_123\",\n\t\t\tregion: \"us-east-1\"\n\t\t}\n\t},\n\tsecretSchema: {\n\t\tschema: {\n\t\t\ttype: \"object\",\n\t\t\trequired: [\"apiKey\", \"webhookSecret\"],\n\t\t\tproperties: {\n\t\t\t\tapiKey: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tdescription: \"Stripe secret API key (sk_live_... or sk_test_...).\"\n\t\t\t\t},\n\t\t\t\twebhookSecret: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tdescription: \"Signing secret for webhook verification.\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\texample: {\n\t\t\tapiKey: \"sk_live_***\",\n\t\t\twebhookSecret: \"whsec_***\"\n\t\t}\n\t},\n\thealthCheck: {\n\t\tmethod: \"ping\",\n\t\ttimeoutMs: 5e3\n\t},\n\tdocsUrl: \"https://stripe.com/docs/api\",\n\tconstraints: { rateLimit: {\n\t\trpm: 1e3,\n\t\trph: 2e4\n\t} },\n\tbyokSetup: {\n\t\tsetupInstructions: \"Create a restricted Stripe API key with write access to Charges and provide a webhook signing secret.\",\n\t\trequiredScopes: [\"charges:write\", \"customers:read\"]\n\t}\n};\nfunction registerStripeIntegration(registry) {\n\treturn registry.register(stripeIntegrationSpec);\n}\n\n//#endregion\nexport { registerStripeIntegration, stripeIntegrationSpec }
|
|
1
|
+
{"version":3,"file":"stripe.js","names":[],"sources":["../../../../../../contracts/dist/integrations/providers/stripe.js"],"sourcesContent":["import { StabilityEnum } from \"../../ownership.js\";\n\n//#region src/integrations/providers/stripe.ts\nconst stripeIntegrationSpec = {\n\tmeta: {\n\t\tkey: \"payments.stripe\",\n\t\tversion: 1,\n\t\tcategory: \"payments\",\n\t\tdisplayName: \"Stripe\",\n\t\ttitle: \"Stripe Payments\",\n\t\tdescription: \"Stripe integration for payment processing, charges, and payouts.\",\n\t\tdomain: \"payments\",\n\t\towners: [\"platform.payments\"],\n\t\ttags: [\"payments\", \"psp\"],\n\t\tstability: StabilityEnum.Stable\n\t},\n\tsupportedModes: [\"managed\", \"byok\"],\n\tcapabilities: {\n\t\tprovides: [{\n\t\t\tkey: \"payments.psp\",\n\t\t\tversion: 1\n\t\t}],\n\t\trequires: [{\n\t\t\tkey: \"platform.webhooks\",\n\t\t\toptional: true,\n\t\t\treason: \"Recommended for reliable event ingestion\"\n\t\t}]\n\t},\n\tconfigSchema: {\n\t\tschema: {\n\t\t\ttype: \"object\",\n\t\t\tproperties: {\n\t\t\t\taccountId: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tdescription: \"Connected account ID when using Stripe Connect (BYOK).\"\n\t\t\t\t},\n\t\t\t\tregion: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tdescription: \"Optional Stripe region or data residency hint.\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\texample: {\n\t\t\taccountId: \"acct_123\",\n\t\t\tregion: \"us-east-1\"\n\t\t}\n\t},\n\tsecretSchema: {\n\t\tschema: {\n\t\t\ttype: \"object\",\n\t\t\trequired: [\"apiKey\", \"webhookSecret\"],\n\t\t\tproperties: {\n\t\t\t\tapiKey: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tdescription: \"Stripe secret API key (sk_live_... or sk_test_...).\"\n\t\t\t\t},\n\t\t\t\twebhookSecret: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tdescription: \"Signing secret for webhook verification.\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\texample: {\n\t\t\tapiKey: \"sk_live_***\",\n\t\t\twebhookSecret: \"whsec_***\"\n\t\t}\n\t},\n\thealthCheck: {\n\t\tmethod: \"ping\",\n\t\ttimeoutMs: 5e3\n\t},\n\tdocsUrl: \"https://stripe.com/docs/api\",\n\tconstraints: { rateLimit: {\n\t\trpm: 1e3,\n\t\trph: 2e4\n\t} },\n\tbyokSetup: {\n\t\tsetupInstructions: \"Create a restricted Stripe API key with write access to Charges and provide a webhook signing secret.\",\n\t\trequiredScopes: [\"charges:write\", \"customers:read\"]\n\t}\n};\nfunction registerStripeIntegration(registry) {\n\treturn registry.register(stripeIntegrationSpec);\n}\n\n//#endregion\nexport { registerStripeIntegration, stripeIntegrationSpec };"],"mappings":";;;AAGA,MAAM,wBAAwB;CAC7B,MAAM;EACL,KAAK;EACL,SAAS;EACT,UAAU;EACV,aAAa;EACb,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,oBAAoB;EAC7B,MAAM,CAAC,YAAY,MAAM;EACzB,WAAW,cAAc;EACzB;CACD,gBAAgB,CAAC,WAAW,OAAO;CACnC,cAAc;EACb,UAAU,CAAC;GACV,KAAK;GACL,SAAS;GACT,CAAC;EACF,UAAU,CAAC;GACV,KAAK;GACL,UAAU;GACV,QAAQ;GACR,CAAC;EACF;CACD,cAAc;EACb,QAAQ;GACP,MAAM;GACN,YAAY;IACX,WAAW;KACV,MAAM;KACN,aAAa;KACb;IACD,QAAQ;KACP,MAAM;KACN,aAAa;KACb;IACD;GACD;EACD,SAAS;GACR,WAAW;GACX,QAAQ;GACR;EACD;CACD,cAAc;EACb,QAAQ;GACP,MAAM;GACN,UAAU,CAAC,UAAU,gBAAgB;GACrC,YAAY;IACX,QAAQ;KACP,MAAM;KACN,aAAa;KACb;IACD,eAAe;KACd,MAAM;KACN,aAAa;KACb;IACD;GACD;EACD,SAAS;GACR,QAAQ;GACR,eAAe;GACf;EACD;CACD,aAAa;EACZ,QAAQ;EACR,WAAW;EACX;CACD,SAAS;CACT,aAAa,EAAE,WAAW;EACzB,KAAK;EACL,KAAK;EACL,EAAE;CACH,WAAW;EACV,mBAAmB;EACnB,gBAAgB,CAAC,iBAAiB,iBAAiB;EACnD;CACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"twilio-sms.js","names":[],"sources":["../../../../../../contracts/dist/integrations/providers/twilio-sms.js"],"sourcesContent":["import { StabilityEnum } from \"../../ownership.js\";\n\n//#region src/integrations/providers/twilio-sms.ts\nconst twilioSmsIntegrationSpec = {\n\tmeta: {\n\t\tkey: \"sms.twilio\",\n\t\tversion: 1,\n\t\tcategory: \"sms\",\n\t\tdisplayName: \"Twilio SMS\",\n\t\ttitle: \"Twilio Messaging\",\n\t\tdescription: \"Twilio SMS integration for transactional and notification messaging.\",\n\t\tdomain: \"communications\",\n\t\towners: [\"platform.messaging\"],\n\t\ttags: [\"sms\", \"messaging\"],\n\t\tstability: StabilityEnum.Stable\n\t},\n\tsupportedModes: [\"managed\", \"byok\"],\n\tcapabilities: { provides: [{\n\t\tkey: \"sms.outbound\",\n\t\tversion: 1\n\t}] },\n\tconfigSchema: {\n\t\tschema: {\n\t\t\ttype: \"object\",\n\t\t\tproperties: { fromNumber: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"Default Twilio phone number used as sender.\"\n\t\t\t} }\n\t\t},\n\t\texample: { fromNumber: \"+15551234567\" }\n\t},\n\tsecretSchema: {\n\t\tschema: {\n\t\t\ttype: \"object\",\n\t\t\trequired: [\"accountSid\", \"authToken\"],\n\t\t\tproperties: {\n\t\t\t\taccountSid: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tdescription: \"Twilio Account SID.\"\n\t\t\t\t},\n\t\t\t\tauthToken: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tdescription: \"Twilio Auth Token.\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\texample: {\n\t\t\taccountSid: \"ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\n\t\t\tauthToken: \"auth-token\"\n\t\t}\n\t},\n\thealthCheck: {\n\t\tmethod: \"custom\",\n\t\ttimeoutMs: 3e3\n\t},\n\tdocsUrl: \"https://www.twilio.com/docs/sms/api\",\n\tconstraints: { rateLimit: { rpm: 200 } },\n\tbyokSetup: { setupInstructions: \"Provide a Twilio account SID, auth token, and verify the outbound sending numbers used by the integration.\" }\n};\nfunction registerTwilioSmsIntegration(registry) {\n\treturn registry.register(twilioSmsIntegrationSpec);\n}\n\n//#endregion\nexport { registerTwilioSmsIntegration, twilioSmsIntegrationSpec }
|
|
1
|
+
{"version":3,"file":"twilio-sms.js","names":[],"sources":["../../../../../../contracts/dist/integrations/providers/twilio-sms.js"],"sourcesContent":["import { StabilityEnum } from \"../../ownership.js\";\n\n//#region src/integrations/providers/twilio-sms.ts\nconst twilioSmsIntegrationSpec = {\n\tmeta: {\n\t\tkey: \"sms.twilio\",\n\t\tversion: 1,\n\t\tcategory: \"sms\",\n\t\tdisplayName: \"Twilio SMS\",\n\t\ttitle: \"Twilio Messaging\",\n\t\tdescription: \"Twilio SMS integration for transactional and notification messaging.\",\n\t\tdomain: \"communications\",\n\t\towners: [\"platform.messaging\"],\n\t\ttags: [\"sms\", \"messaging\"],\n\t\tstability: StabilityEnum.Stable\n\t},\n\tsupportedModes: [\"managed\", \"byok\"],\n\tcapabilities: { provides: [{\n\t\tkey: \"sms.outbound\",\n\t\tversion: 1\n\t}] },\n\tconfigSchema: {\n\t\tschema: {\n\t\t\ttype: \"object\",\n\t\t\tproperties: { fromNumber: {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: \"Default Twilio phone number used as sender.\"\n\t\t\t} }\n\t\t},\n\t\texample: { fromNumber: \"+15551234567\" }\n\t},\n\tsecretSchema: {\n\t\tschema: {\n\t\t\ttype: \"object\",\n\t\t\trequired: [\"accountSid\", \"authToken\"],\n\t\t\tproperties: {\n\t\t\t\taccountSid: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tdescription: \"Twilio Account SID.\"\n\t\t\t\t},\n\t\t\t\tauthToken: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tdescription: \"Twilio Auth Token.\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\texample: {\n\t\t\taccountSid: \"ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",\n\t\t\tauthToken: \"auth-token\"\n\t\t}\n\t},\n\thealthCheck: {\n\t\tmethod: \"custom\",\n\t\ttimeoutMs: 3e3\n\t},\n\tdocsUrl: \"https://www.twilio.com/docs/sms/api\",\n\tconstraints: { rateLimit: { rpm: 200 } },\n\tbyokSetup: { setupInstructions: \"Provide a Twilio account SID, auth token, and verify the outbound sending numbers used by the integration.\" }\n};\nfunction registerTwilioSmsIntegration(registry) {\n\treturn registry.register(twilioSmsIntegrationSpec);\n}\n\n//#endregion\nexport { registerTwilioSmsIntegration, twilioSmsIntegrationSpec };"],"mappings":";;;AAGA,MAAM,2BAA2B;CAChC,MAAM;EACL,KAAK;EACL,SAAS;EACT,UAAU;EACV,aAAa;EACb,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,qBAAqB;EAC9B,MAAM,CAAC,OAAO,YAAY;EAC1B,WAAW,cAAc;EACzB;CACD,gBAAgB,CAAC,WAAW,OAAO;CACnC,cAAc,EAAE,UAAU,CAAC;EAC1B,KAAK;EACL,SAAS;EACT,CAAC,EAAE;CACJ,cAAc;EACb,QAAQ;GACP,MAAM;GACN,YAAY,EAAE,YAAY;IACzB,MAAM;IACN,aAAa;IACb,EAAE;GACH;EACD,SAAS,EAAE,YAAY,gBAAgB;EACvC;CACD,cAAc;EACb,QAAQ;GACP,MAAM;GACN,UAAU,CAAC,cAAc,YAAY;GACrC,YAAY;IACX,YAAY;KACX,MAAM;KACN,aAAa;KACb;IACD,WAAW;KACV,MAAM;KACN,aAAa;KACb;IACD;GACD;EACD,SAAS;GACR,YAAY;GACZ,WAAW;GACX;EACD;CACD,aAAa;EACZ,QAAQ;EACR,WAAW;EACX;CACD,SAAS;CACT,aAAa,EAAE,WAAW,EAAE,KAAK,KAAK,EAAE;CACxC,WAAW,EAAE,mBAAmB,8GAA8G;CAC9I"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.js","names":[],"sources":["../../../../../contracts/dist/knowledge/contracts.js"],"sourcesContent":["import { E5, x8 } from \"../schema/dist/index.js\";\nimport { defineCommand, defineQuery } from \"../spec.js\";\n\n//#region src/knowledge/contracts.ts\nconst KnowledgeSyncSchedule = new x8({\n\tname: \"KnowledgeSyncSchedule\",\n\tfields: {\n\t\tenabled: {\n\t\t\ttype: E5.Boolean(),\n\t\t\tisOptional: false\n\t\t},\n\t\tcron: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: true\n\t\t},\n\t\tintervalMs: {\n\t\t\ttype: E5.Int_unsecure(),\n\t\t\tisOptional: true\n\t\t}\n\t}\n});\nconst KnowledgeSourceRecord = new x8({\n\tname: \"KnowledgeSourceRecord\",\n\tfields: {\n\t\tid: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: false\n\t\t},\n\t\ttenantId: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: false\n\t\t},\n\t\tspaceKey: {\n\t\t\ttype: E5.NonEmptyString(),\n\t\t\tisOptional: false\n\t\t},\n\t\tspaceVersion: {\n\t\t\ttype: E5.Int_unsecure(),\n\t\t\tisOptional: false\n\t\t},\n\t\tlabel: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: false\n\t\t},\n\t\tsourceType: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: false\n\t\t},\n\t\tsyncSchedule: {\n\t\t\ttype: KnowledgeSyncSchedule,\n\t\t\tisOptional: true\n\t\t},\n\t\tlastSyncStatus: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: true\n\t\t},\n\t\tlastSyncAt: {\n\t\t\ttype: E5.DateTime(),\n\t\t\tisOptional: true\n\t\t},\n\t\titemsProcessed: {\n\t\t\ttype: E5.Int_unsecure(),\n\t\t\tisOptional: true\n\t\t},\n\t\tcreatedAt: {\n\t\t\ttype: E5.DateTime(),\n\t\t\tisOptional: true\n\t\t},\n\t\tupdatedAt: {\n\t\t\ttype: E5.DateTime(),\n\t\t\tisOptional: true\n\t\t}\n\t}\n});\nconst CreateKnowledgeSourceInput = new x8({\n\tname: \"CreateKnowledgeSourceInput\",\n\tfields: {\n\t\ttenantId: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: false\n\t\t},\n\t\tspaceKey: {\n\t\t\ttype: E5.NonEmptyString(),\n\t\t\tisOptional: false\n\t\t},\n\t\tspaceVersion: {\n\t\t\ttype: E5.Int_unsecure(),\n\t\t\tisOptional: false\n\t\t},\n\t\tlabel: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: false\n\t\t},\n\t\tsourceType: {\n\t\t\ttype: E5.NonEmptyString(),\n\t\t\tisOptional: false\n\t\t},\n\t\tconfig: {\n\t\t\ttype: E5.JSONObject(),\n\t\t\tisOptional: false\n\t\t},\n\t\tsyncSchedule: {\n\t\t\ttype: KnowledgeSyncSchedule,\n\t\t\tisOptional: true\n\t\t}\n\t}\n});\nconst UpdateKnowledgeSourceInput = new x8({\n\tname: \"UpdateKnowledgeSourceInput\",\n\tfields: {\n\t\tsourceId: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: false\n\t\t},\n\t\tlabel: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: true\n\t\t},\n\t\tconfig: {\n\t\t\ttype: E5.JSONObject(),\n\t\t\tisOptional: true\n\t\t},\n\t\tsyncSchedule: {\n\t\t\ttype: KnowledgeSyncSchedule,\n\t\t\tisOptional: true\n\t\t}\n\t}\n});\nconst DeleteKnowledgeSourceInput = new x8({\n\tname: \"DeleteKnowledgeSourceInput\",\n\tfields: { sourceId: {\n\t\ttype: E5.ID(),\n\t\tisOptional: false\n\t} }\n});\nconst DeleteKnowledgeSourceOutput = new x8({\n\tname: \"DeleteKnowledgeSourceOutput\",\n\tfields: { success: {\n\t\ttype: E5.Boolean(),\n\t\tisOptional: false\n\t} }\n});\nconst ListKnowledgeSourcesInput = new x8({\n\tname: \"ListKnowledgeSourcesInput\",\n\tfields: {\n\t\ttenantId: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: false\n\t\t},\n\t\tspaceKey: {\n\t\t\ttype: E5.NonEmptyString(),\n\t\t\tisOptional: true\n\t\t}\n\t}\n});\nconst ListKnowledgeSourcesOutput = new x8({\n\tname: \"ListKnowledgeSourcesOutput\",\n\tfields: { sources: {\n\t\ttype: KnowledgeSourceRecord,\n\t\tisOptional: false,\n\t\tisArray: true\n\t} }\n});\nconst TriggerKnowledgeSyncInput = new x8({\n\tname: \"TriggerKnowledgeSyncInput\",\n\tfields: { sourceId: {\n\t\ttype: E5.ID(),\n\t\tisOptional: false\n\t} }\n});\nconst TriggerKnowledgeSyncOutput = new x8({\n\tname: \"TriggerKnowledgeSyncOutput\",\n\tfields: {\n\t\tsuccess: {\n\t\t\ttype: E5.Boolean(),\n\t\t\tisOptional: false\n\t\t},\n\t\titemsProcessed: {\n\t\t\ttype: E5.Int_unsecure(),\n\t\t\tisOptional: true\n\t\t},\n\t\terror: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: true\n\t\t}\n\t}\n});\nconst CreateKnowledgeSource = defineCommand({\n\tmeta: {\n\t\tname: \"knowledge.source.create\",\n\t\tversion: 1,\n\t\tdescription: \"Create a knowledge source binding for a tenant.\",\n\t\tgoal: \"Onboard a new knowledge ingestion source such as Notion or uploads.\",\n\t\tcontext: \"Used by Ops and App Studio to configure knowledge ingestion per tenant and space.\",\n\t\towners: [\"platform.knowledge\"],\n\t\ttags: [\"knowledge\", \"sources\"],\n\t\tstability: \"experimental\"\n\t},\n\tio: {\n\t\tinput: CreateKnowledgeSourceInput,\n\t\toutput: KnowledgeSourceRecord\n\t},\n\tpolicy: {\n\t\tauth: \"admin\",\n\t\tpolicies: [{\n\t\t\tname: \"platform.knowledge.manage\",\n\t\t\tversion: 1\n\t\t}]\n\t}\n});\nconst UpdateKnowledgeSource = defineCommand({\n\tmeta: {\n\t\tname: \"knowledge.source.update\",\n\t\tversion: 1,\n\t\tdescription: \"Update metadata or configuration for a knowledge source.\",\n\t\tgoal: \"Allow rotation of credentials, sync schedules, and labels.\",\n\t\tcontext: \"Supports editing how a tenant ingests knowledge (e.g., toggling sync cadence).\",\n\t\towners: [\"platform.knowledge\"],\n\t\ttags: [\"knowledge\", \"sources\"],\n\t\tstability: \"experimental\"\n\t},\n\tio: {\n\t\tinput: UpdateKnowledgeSourceInput,\n\t\toutput: KnowledgeSourceRecord\n\t},\n\tpolicy: {\n\t\tauth: \"admin\",\n\t\tpolicies: [{\n\t\t\tname: \"platform.knowledge.manage\",\n\t\t\tversion: 1\n\t\t}]\n\t}\n});\nconst DeleteKnowledgeSource = defineCommand({\n\tmeta: {\n\t\tname: \"knowledge.source.delete\",\n\t\tversion: 1,\n\t\tdescription: \"Delete a knowledge source binding for a tenant.\",\n\t\tgoal: \"Remove obsolete or compromised knowledge ingestion paths.\",\n\t\tcontext: \"Ensures ephemeral or external sources can be removed cleanly without leaving residual bindings.\",\n\t\towners: [\"platform.knowledge\"],\n\t\ttags: [\"knowledge\", \"sources\"],\n\t\tstability: \"experimental\"\n\t},\n\tio: {\n\t\tinput: DeleteKnowledgeSourceInput,\n\t\toutput: DeleteKnowledgeSourceOutput\n\t},\n\tpolicy: {\n\t\tauth: \"admin\",\n\t\tpolicies: [{\n\t\t\tname: \"platform.knowledge.manage\",\n\t\t\tversion: 1\n\t\t}]\n\t}\n});\nconst ListKnowledgeSources = defineQuery({\n\tmeta: {\n\t\tname: \"knowledge.source.list\",\n\t\tversion: 1,\n\t\tdescription: \"List knowledge sources configured for a tenant.\",\n\t\tgoal: \"Provide visibility into knowledge ingest configuration and schedules.\",\n\t\tcontext: \"Used by App Studio and Ops flows to surface knowledge sources and their health.\",\n\t\towners: [\"platform.knowledge\"],\n\t\ttags: [\"knowledge\", \"sources\"],\n\t\tstability: \"experimental\"\n\t},\n\tio: {\n\t\tinput: ListKnowledgeSourcesInput,\n\t\toutput: ListKnowledgeSourcesOutput\n\t},\n\tpolicy: {\n\t\tauth: \"admin\",\n\t\tpolicies: [{\n\t\t\tname: \"platform.knowledge.read\",\n\t\t\tversion: 1\n\t\t}]\n\t}\n});\nconst TriggerKnowledgeSourceSync = defineCommand({\n\tmeta: {\n\t\tname: \"knowledge.source.triggerSync\",\n\t\tversion: 1,\n\t\tdescription: \"Trigger an immediate sync for a knowledge source.\",\n\t\tgoal: \"Support manual or automated sync retries for knowledge ingestion.\",\n\t\tcontext: \"Invoked by Ops tooling or monitors when knowledge content must be refreshed or reprocessed.\",\n\t\towners: [\"platform.knowledge\"],\n\t\ttags: [\"knowledge\", \"sources\"],\n\t\tstability: \"experimental\"\n\t},\n\tio: {\n\t\tinput: TriggerKnowledgeSyncInput,\n\t\toutput: TriggerKnowledgeSyncOutput\n\t},\n\tpolicy: {\n\t\tauth: \"admin\",\n\t\tpolicies: [{\n\t\t\tname: \"platform.knowledge.manage\",\n\t\t\tversion: 1\n\t\t}]\n\t}\n});\nconst knowledgeContracts = {\n\tCreateKnowledgeSource,\n\tUpdateKnowledgeSource,\n\tDeleteKnowledgeSource,\n\tListKnowledgeSources,\n\tTriggerKnowledgeSourceSync\n};\nfunction registerKnowledgeContracts(registry) {\n\treturn registry.register(CreateKnowledgeSource).register(UpdateKnowledgeSource).register(DeleteKnowledgeSource).register(ListKnowledgeSources).register(TriggerKnowledgeSourceSync);\n}\n\n//#endregion\nexport { CreateKnowledgeSource, DeleteKnowledgeSource, ListKnowledgeSources, TriggerKnowledgeSourceSync, UpdateKnowledgeSource, knowledgeContracts, registerKnowledgeContracts };\n//# sourceMappingURL=contracts.js.map"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"contracts.js","names":[],"sources":["../../../../../contracts/dist/knowledge/contracts.js"],"sourcesContent":["import { E5, x8 } from \"../schema/dist/index.js\";\nimport { defineCommand, defineQuery } from \"../spec.js\";\n\n//#region src/knowledge/contracts.ts\nconst KnowledgeSyncSchedule = new x8({\n\tname: \"KnowledgeSyncSchedule\",\n\tfields: {\n\t\tenabled: {\n\t\t\ttype: E5.Boolean(),\n\t\t\tisOptional: false\n\t\t},\n\t\tcron: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: true\n\t\t},\n\t\tintervalMs: {\n\t\t\ttype: E5.Int_unsecure(),\n\t\t\tisOptional: true\n\t\t}\n\t}\n});\nconst KnowledgeSourceRecord = new x8({\n\tname: \"KnowledgeSourceRecord\",\n\tfields: {\n\t\tid: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: false\n\t\t},\n\t\ttenantId: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: false\n\t\t},\n\t\tspaceKey: {\n\t\t\ttype: E5.NonEmptyString(),\n\t\t\tisOptional: false\n\t\t},\n\t\tspaceVersion: {\n\t\t\ttype: E5.Int_unsecure(),\n\t\t\tisOptional: false\n\t\t},\n\t\tlabel: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: false\n\t\t},\n\t\tsourceType: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: false\n\t\t},\n\t\tsyncSchedule: {\n\t\t\ttype: KnowledgeSyncSchedule,\n\t\t\tisOptional: true\n\t\t},\n\t\tlastSyncStatus: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: true\n\t\t},\n\t\tlastSyncAt: {\n\t\t\ttype: E5.DateTime(),\n\t\t\tisOptional: true\n\t\t},\n\t\titemsProcessed: {\n\t\t\ttype: E5.Int_unsecure(),\n\t\t\tisOptional: true\n\t\t},\n\t\tcreatedAt: {\n\t\t\ttype: E5.DateTime(),\n\t\t\tisOptional: true\n\t\t},\n\t\tupdatedAt: {\n\t\t\ttype: E5.DateTime(),\n\t\t\tisOptional: true\n\t\t}\n\t}\n});\nconst CreateKnowledgeSourceInput = new x8({\n\tname: \"CreateKnowledgeSourceInput\",\n\tfields: {\n\t\ttenantId: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: false\n\t\t},\n\t\tspaceKey: {\n\t\t\ttype: E5.NonEmptyString(),\n\t\t\tisOptional: false\n\t\t},\n\t\tspaceVersion: {\n\t\t\ttype: E5.Int_unsecure(),\n\t\t\tisOptional: false\n\t\t},\n\t\tlabel: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: false\n\t\t},\n\t\tsourceType: {\n\t\t\ttype: E5.NonEmptyString(),\n\t\t\tisOptional: false\n\t\t},\n\t\tconfig: {\n\t\t\ttype: E5.JSONObject(),\n\t\t\tisOptional: false\n\t\t},\n\t\tsyncSchedule: {\n\t\t\ttype: KnowledgeSyncSchedule,\n\t\t\tisOptional: true\n\t\t}\n\t}\n});\nconst UpdateKnowledgeSourceInput = new x8({\n\tname: \"UpdateKnowledgeSourceInput\",\n\tfields: {\n\t\tsourceId: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: false\n\t\t},\n\t\tlabel: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: true\n\t\t},\n\t\tconfig: {\n\t\t\ttype: E5.JSONObject(),\n\t\t\tisOptional: true\n\t\t},\n\t\tsyncSchedule: {\n\t\t\ttype: KnowledgeSyncSchedule,\n\t\t\tisOptional: true\n\t\t}\n\t}\n});\nconst DeleteKnowledgeSourceInput = new x8({\n\tname: \"DeleteKnowledgeSourceInput\",\n\tfields: { sourceId: {\n\t\ttype: E5.ID(),\n\t\tisOptional: false\n\t} }\n});\nconst DeleteKnowledgeSourceOutput = new x8({\n\tname: \"DeleteKnowledgeSourceOutput\",\n\tfields: { success: {\n\t\ttype: E5.Boolean(),\n\t\tisOptional: false\n\t} }\n});\nconst ListKnowledgeSourcesInput = new x8({\n\tname: \"ListKnowledgeSourcesInput\",\n\tfields: {\n\t\ttenantId: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: false\n\t\t},\n\t\tspaceKey: {\n\t\t\ttype: E5.NonEmptyString(),\n\t\t\tisOptional: true\n\t\t}\n\t}\n});\nconst ListKnowledgeSourcesOutput = new x8({\n\tname: \"ListKnowledgeSourcesOutput\",\n\tfields: { sources: {\n\t\ttype: KnowledgeSourceRecord,\n\t\tisOptional: false,\n\t\tisArray: true\n\t} }\n});\nconst TriggerKnowledgeSyncInput = new x8({\n\tname: \"TriggerKnowledgeSyncInput\",\n\tfields: { sourceId: {\n\t\ttype: E5.ID(),\n\t\tisOptional: false\n\t} }\n});\nconst TriggerKnowledgeSyncOutput = new x8({\n\tname: \"TriggerKnowledgeSyncOutput\",\n\tfields: {\n\t\tsuccess: {\n\t\t\ttype: E5.Boolean(),\n\t\t\tisOptional: false\n\t\t},\n\t\titemsProcessed: {\n\t\t\ttype: E5.Int_unsecure(),\n\t\t\tisOptional: true\n\t\t},\n\t\terror: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: true\n\t\t}\n\t}\n});\nconst CreateKnowledgeSource = defineCommand({\n\tmeta: {\n\t\tname: \"knowledge.source.create\",\n\t\tversion: 1,\n\t\tdescription: \"Create a knowledge source binding for a tenant.\",\n\t\tgoal: \"Onboard a new knowledge ingestion source such as Notion or uploads.\",\n\t\tcontext: \"Used by Ops and App Studio to configure knowledge ingestion per tenant and space.\",\n\t\towners: [\"platform.knowledge\"],\n\t\ttags: [\"knowledge\", \"sources\"],\n\t\tstability: \"experimental\"\n\t},\n\tio: {\n\t\tinput: CreateKnowledgeSourceInput,\n\t\toutput: KnowledgeSourceRecord\n\t},\n\tpolicy: {\n\t\tauth: \"admin\",\n\t\tpolicies: [{\n\t\t\tname: \"platform.knowledge.manage\",\n\t\t\tversion: 1\n\t\t}]\n\t}\n});\nconst UpdateKnowledgeSource = defineCommand({\n\tmeta: {\n\t\tname: \"knowledge.source.update\",\n\t\tversion: 1,\n\t\tdescription: \"Update metadata or configuration for a knowledge source.\",\n\t\tgoal: \"Allow rotation of credentials, sync schedules, and labels.\",\n\t\tcontext: \"Supports editing how a tenant ingests knowledge (e.g., toggling sync cadence).\",\n\t\towners: [\"platform.knowledge\"],\n\t\ttags: [\"knowledge\", \"sources\"],\n\t\tstability: \"experimental\"\n\t},\n\tio: {\n\t\tinput: UpdateKnowledgeSourceInput,\n\t\toutput: KnowledgeSourceRecord\n\t},\n\tpolicy: {\n\t\tauth: \"admin\",\n\t\tpolicies: [{\n\t\t\tname: \"platform.knowledge.manage\",\n\t\t\tversion: 1\n\t\t}]\n\t}\n});\nconst DeleteKnowledgeSource = defineCommand({\n\tmeta: {\n\t\tname: \"knowledge.source.delete\",\n\t\tversion: 1,\n\t\tdescription: \"Delete a knowledge source binding for a tenant.\",\n\t\tgoal: \"Remove obsolete or compromised knowledge ingestion paths.\",\n\t\tcontext: \"Ensures ephemeral or external sources can be removed cleanly without leaving residual bindings.\",\n\t\towners: [\"platform.knowledge\"],\n\t\ttags: [\"knowledge\", \"sources\"],\n\t\tstability: \"experimental\"\n\t},\n\tio: {\n\t\tinput: DeleteKnowledgeSourceInput,\n\t\toutput: DeleteKnowledgeSourceOutput\n\t},\n\tpolicy: {\n\t\tauth: \"admin\",\n\t\tpolicies: [{\n\t\t\tname: \"platform.knowledge.manage\",\n\t\t\tversion: 1\n\t\t}]\n\t}\n});\nconst ListKnowledgeSources = defineQuery({\n\tmeta: {\n\t\tname: \"knowledge.source.list\",\n\t\tversion: 1,\n\t\tdescription: \"List knowledge sources configured for a tenant.\",\n\t\tgoal: \"Provide visibility into knowledge ingest configuration and schedules.\",\n\t\tcontext: \"Used by App Studio and Ops flows to surface knowledge sources and their health.\",\n\t\towners: [\"platform.knowledge\"],\n\t\ttags: [\"knowledge\", \"sources\"],\n\t\tstability: \"experimental\"\n\t},\n\tio: {\n\t\tinput: ListKnowledgeSourcesInput,\n\t\toutput: ListKnowledgeSourcesOutput\n\t},\n\tpolicy: {\n\t\tauth: \"admin\",\n\t\tpolicies: [{\n\t\t\tname: \"platform.knowledge.read\",\n\t\t\tversion: 1\n\t\t}]\n\t}\n});\nconst TriggerKnowledgeSourceSync = defineCommand({\n\tmeta: {\n\t\tname: \"knowledge.source.triggerSync\",\n\t\tversion: 1,\n\t\tdescription: \"Trigger an immediate sync for a knowledge source.\",\n\t\tgoal: \"Support manual or automated sync retries for knowledge ingestion.\",\n\t\tcontext: \"Invoked by Ops tooling or monitors when knowledge content must be refreshed or reprocessed.\",\n\t\towners: [\"platform.knowledge\"],\n\t\ttags: [\"knowledge\", \"sources\"],\n\t\tstability: \"experimental\"\n\t},\n\tio: {\n\t\tinput: TriggerKnowledgeSyncInput,\n\t\toutput: TriggerKnowledgeSyncOutput\n\t},\n\tpolicy: {\n\t\tauth: \"admin\",\n\t\tpolicies: [{\n\t\t\tname: \"platform.knowledge.manage\",\n\t\t\tversion: 1\n\t\t}]\n\t}\n});\nconst knowledgeContracts = {\n\tCreateKnowledgeSource,\n\tUpdateKnowledgeSource,\n\tDeleteKnowledgeSource,\n\tListKnowledgeSources,\n\tTriggerKnowledgeSourceSync\n};\nfunction registerKnowledgeContracts(registry) {\n\treturn registry.register(CreateKnowledgeSource).register(UpdateKnowledgeSource).register(DeleteKnowledgeSource).register(ListKnowledgeSources).register(TriggerKnowledgeSourceSync);\n}\n\n//#endregion\nexport { CreateKnowledgeSource, DeleteKnowledgeSource, ListKnowledgeSources, TriggerKnowledgeSourceSync, UpdateKnowledgeSource, knowledgeContracts, registerKnowledgeContracts };"],"mappings":";;;;AAIA,MAAM,wBAAwB,IAAI,GAAG;CACpC,MAAM;CACN,QAAQ;EACP,SAAS;GACR,MAAM,GAAG,SAAS;GAClB,YAAY;GACZ;EACD,MAAM;GACL,MAAM,GAAG,iBAAiB;GAC1B,YAAY;GACZ;EACD,YAAY;GACX,MAAM,GAAG,cAAc;GACvB,YAAY;GACZ;EACD;CACD,CAAC;AACF,MAAM,wBAAwB,IAAI,GAAG;CACpC,MAAM;CACN,QAAQ;EACP,IAAI;GACH,MAAM,GAAG,IAAI;GACb,YAAY;GACZ;EACD,UAAU;GACT,MAAM,GAAG,IAAI;GACb,YAAY;GACZ;EACD,UAAU;GACT,MAAM,GAAG,gBAAgB;GACzB,YAAY;GACZ;EACD,cAAc;GACb,MAAM,GAAG,cAAc;GACvB,YAAY;GACZ;EACD,OAAO;GACN,MAAM,GAAG,iBAAiB;GAC1B,YAAY;GACZ;EACD,YAAY;GACX,MAAM,GAAG,iBAAiB;GAC1B,YAAY;GACZ;EACD,cAAc;GACb,MAAM;GACN,YAAY;GACZ;EACD,gBAAgB;GACf,MAAM,GAAG,iBAAiB;GAC1B,YAAY;GACZ;EACD,YAAY;GACX,MAAM,GAAG,UAAU;GACnB,YAAY;GACZ;EACD,gBAAgB;GACf,MAAM,GAAG,cAAc;GACvB,YAAY;GACZ;EACD,WAAW;GACV,MAAM,GAAG,UAAU;GACnB,YAAY;GACZ;EACD,WAAW;GACV,MAAM,GAAG,UAAU;GACnB,YAAY;GACZ;EACD;CACD,CAAC;AACF,MAAM,6BAA6B,IAAI,GAAG;CACzC,MAAM;CACN,QAAQ;EACP,UAAU;GACT,MAAM,GAAG,IAAI;GACb,YAAY;GACZ;EACD,UAAU;GACT,MAAM,GAAG,gBAAgB;GACzB,YAAY;GACZ;EACD,cAAc;GACb,MAAM,GAAG,cAAc;GACvB,YAAY;GACZ;EACD,OAAO;GACN,MAAM,GAAG,iBAAiB;GAC1B,YAAY;GACZ;EACD,YAAY;GACX,MAAM,GAAG,gBAAgB;GACzB,YAAY;GACZ;EACD,QAAQ;GACP,MAAM,GAAG,YAAY;GACrB,YAAY;GACZ;EACD,cAAc;GACb,MAAM;GACN,YAAY;GACZ;EACD;CACD,CAAC;AACF,MAAM,6BAA6B,IAAI,GAAG;CACzC,MAAM;CACN,QAAQ;EACP,UAAU;GACT,MAAM,GAAG,IAAI;GACb,YAAY;GACZ;EACD,OAAO;GACN,MAAM,GAAG,iBAAiB;GAC1B,YAAY;GACZ;EACD,QAAQ;GACP,MAAM,GAAG,YAAY;GACrB,YAAY;GACZ;EACD,cAAc;GACb,MAAM;GACN,YAAY;GACZ;EACD;CACD,CAAC;AACF,MAAM,6BAA6B,IAAI,GAAG;CACzC,MAAM;CACN,QAAQ,EAAE,UAAU;EACnB,MAAM,GAAG,IAAI;EACb,YAAY;EACZ,EAAE;CACH,CAAC;AACF,MAAM,8BAA8B,IAAI,GAAG;CAC1C,MAAM;CACN,QAAQ,EAAE,SAAS;EAClB,MAAM,GAAG,SAAS;EAClB,YAAY;EACZ,EAAE;CACH,CAAC;AACF,MAAM,4BAA4B,IAAI,GAAG;CACxC,MAAM;CACN,QAAQ;EACP,UAAU;GACT,MAAM,GAAG,IAAI;GACb,YAAY;GACZ;EACD,UAAU;GACT,MAAM,GAAG,gBAAgB;GACzB,YAAY;GACZ;EACD;CACD,CAAC;AACF,MAAM,6BAA6B,IAAI,GAAG;CACzC,MAAM;CACN,QAAQ,EAAE,SAAS;EAClB,MAAM;EACN,YAAY;EACZ,SAAS;EACT,EAAE;CACH,CAAC;AACF,MAAM,4BAA4B,IAAI,GAAG;CACxC,MAAM;CACN,QAAQ,EAAE,UAAU;EACnB,MAAM,GAAG,IAAI;EACb,YAAY;EACZ,EAAE;CACH,CAAC;AACF,MAAM,6BAA6B,IAAI,GAAG;CACzC,MAAM;CACN,QAAQ;EACP,SAAS;GACR,MAAM,GAAG,SAAS;GAClB,YAAY;GACZ;EACD,gBAAgB;GACf,MAAM,GAAG,cAAc;GACvB,YAAY;GACZ;EACD,OAAO;GACN,MAAM,GAAG,iBAAiB;GAC1B,YAAY;GACZ;EACD;CACD,CAAC;AACF,MAAM,wBAAwB,cAAc;CAC3C,MAAM;EACL,MAAM;EACN,SAAS;EACT,aAAa;EACb,MAAM;EACN,SAAS;EACT,QAAQ,CAAC,qBAAqB;EAC9B,MAAM,CAAC,aAAa,UAAU;EAC9B,WAAW;EACX;CACD,IAAI;EACH,OAAO;EACP,QAAQ;EACR;CACD,QAAQ;EACP,MAAM;EACN,UAAU,CAAC;GACV,MAAM;GACN,SAAS;GACT,CAAC;EACF;CACD,CAAC;AACF,MAAM,wBAAwB,cAAc;CAC3C,MAAM;EACL,MAAM;EACN,SAAS;EACT,aAAa;EACb,MAAM;EACN,SAAS;EACT,QAAQ,CAAC,qBAAqB;EAC9B,MAAM,CAAC,aAAa,UAAU;EAC9B,WAAW;EACX;CACD,IAAI;EACH,OAAO;EACP,QAAQ;EACR;CACD,QAAQ;EACP,MAAM;EACN,UAAU,CAAC;GACV,MAAM;GACN,SAAS;GACT,CAAC;EACF;CACD,CAAC;AACF,MAAM,wBAAwB,cAAc;CAC3C,MAAM;EACL,MAAM;EACN,SAAS;EACT,aAAa;EACb,MAAM;EACN,SAAS;EACT,QAAQ,CAAC,qBAAqB;EAC9B,MAAM,CAAC,aAAa,UAAU;EAC9B,WAAW;EACX;CACD,IAAI;EACH,OAAO;EACP,QAAQ;EACR;CACD,QAAQ;EACP,MAAM;EACN,UAAU,CAAC;GACV,MAAM;GACN,SAAS;GACT,CAAC;EACF;CACD,CAAC;AACF,MAAM,uBAAuB,YAAY;CACxC,MAAM;EACL,MAAM;EACN,SAAS;EACT,aAAa;EACb,MAAM;EACN,SAAS;EACT,QAAQ,CAAC,qBAAqB;EAC9B,MAAM,CAAC,aAAa,UAAU;EAC9B,WAAW;EACX;CACD,IAAI;EACH,OAAO;EACP,QAAQ;EACR;CACD,QAAQ;EACP,MAAM;EACN,UAAU,CAAC;GACV,MAAM;GACN,SAAS;GACT,CAAC;EACF;CACD,CAAC;AACF,MAAM,6BAA6B,cAAc;CAChD,MAAM;EACL,MAAM;EACN,SAAS;EACT,aAAa;EACb,MAAM;EACN,SAAS;EACT,QAAQ,CAAC,qBAAqB;EAC9B,MAAM,CAAC,aAAa,UAAU;EAC9B,WAAW;EACX;CACD,IAAI;EACH,OAAO;EACP,QAAQ;EACR;CACD,QAAQ;EACP,MAAM;EACN,UAAU,CAAC;GACV,MAAM;GACN,SAAS;GACT,CAAC;EACF;CACD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email-threads.js","names":[],"sources":["../../../../../../contracts/dist/knowledge/spaces/email-threads.js"],"sourcesContent":["import { StabilityEnum } from \"../../ownership.js\";\n\n//#region src/knowledge/spaces/email-threads.ts\nconst emailThreadsKnowledgeSpace = {\n\tmeta: {\n\t\tkey: \"knowledge.email-threads\",\n\t\tversion: 1,\n\t\tcategory: \"operational\",\n\t\tdisplayName: \"Email Threads\",\n\t\ttitle: \"Operational Email Threads\",\n\t\tdescription: \"Indexed copies of operational email threads used for support, onboarding, and workflows.\",\n\t\tdomain: \"operations\",\n\t\towners: [\"platform.operations\"],\n\t\ttags: [\"email\", \"operations\"],\n\t\tstability: StabilityEnum.Beta\n\t},\n\tretention: { ttlDays: 365 },\n\taccess: {\n\t\tpolicy: {\n\t\t\tname: \"knowledge.access.email-threads\",\n\t\t\tversion: 1\n\t\t},\n\t\ttrustLevel: \"medium\",\n\t\tautomationWritable: true\n\t},\n\tindexing: {\n\t\tembeddingModel: \"mistral-embed\",\n\t\tchunkSize: 600,\n\t\tvectorDbIntegration: \"vectordb.qdrant\"\n\t},\n\tdescription: \"Operational email threads synchronized from Gmail to support automations and contextual assistance.\"\n};\nfunction registerEmailThreadsKnowledgeSpace(registry) {\n\treturn registry.register(emailThreadsKnowledgeSpace);\n}\n\n//#endregion\nexport { emailThreadsKnowledgeSpace, registerEmailThreadsKnowledgeSpace }
|
|
1
|
+
{"version":3,"file":"email-threads.js","names":[],"sources":["../../../../../../contracts/dist/knowledge/spaces/email-threads.js"],"sourcesContent":["import { StabilityEnum } from \"../../ownership.js\";\n\n//#region src/knowledge/spaces/email-threads.ts\nconst emailThreadsKnowledgeSpace = {\n\tmeta: {\n\t\tkey: \"knowledge.email-threads\",\n\t\tversion: 1,\n\t\tcategory: \"operational\",\n\t\tdisplayName: \"Email Threads\",\n\t\ttitle: \"Operational Email Threads\",\n\t\tdescription: \"Indexed copies of operational email threads used for support, onboarding, and workflows.\",\n\t\tdomain: \"operations\",\n\t\towners: [\"platform.operations\"],\n\t\ttags: [\"email\", \"operations\"],\n\t\tstability: StabilityEnum.Beta\n\t},\n\tretention: { ttlDays: 365 },\n\taccess: {\n\t\tpolicy: {\n\t\t\tname: \"knowledge.access.email-threads\",\n\t\t\tversion: 1\n\t\t},\n\t\ttrustLevel: \"medium\",\n\t\tautomationWritable: true\n\t},\n\tindexing: {\n\t\tembeddingModel: \"mistral-embed\",\n\t\tchunkSize: 600,\n\t\tvectorDbIntegration: \"vectordb.qdrant\"\n\t},\n\tdescription: \"Operational email threads synchronized from Gmail to support automations and contextual assistance.\"\n};\nfunction registerEmailThreadsKnowledgeSpace(registry) {\n\treturn registry.register(emailThreadsKnowledgeSpace);\n}\n\n//#endregion\nexport { emailThreadsKnowledgeSpace, registerEmailThreadsKnowledgeSpace };"],"mappings":";;;AAGA,MAAM,6BAA6B;CAClC,MAAM;EACL,KAAK;EACL,SAAS;EACT,UAAU;EACV,aAAa;EACb,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,sBAAsB;EAC/B,MAAM,CAAC,SAAS,aAAa;EAC7B,WAAW,cAAc;EACzB;CACD,WAAW,EAAE,SAAS,KAAK;CAC3B,QAAQ;EACP,QAAQ;GACP,MAAM;GACN,SAAS;GACT;EACD,YAAY;EACZ,oBAAoB;EACpB;CACD,UAAU;EACT,gBAAgB;EAChB,WAAW;EACX,qBAAqB;EACrB;CACD,aAAa;CACb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"financial-docs.js","names":[],"sources":["../../../../../../contracts/dist/knowledge/spaces/financial-docs.js"],"sourcesContent":["import { StabilityEnum } from \"../../ownership.js\";\n\n//#region src/knowledge/spaces/financial-docs.ts\nconst financialDocsKnowledgeSpace = {\n\tmeta: {\n\t\tkey: \"knowledge.financial-docs\",\n\t\tversion: 1,\n\t\tcategory: \"canonical\",\n\t\tdisplayName: \"Financial Documents\",\n\t\ttitle: \"Household Financial Documents\",\n\t\tdescription: \"Invoices, bills, and contracts powering Pocket Family Office financial automation.\",\n\t\tdomain: \"finance\",\n\t\towners: [\"platform.finance\"],\n\t\ttags: [\"finance\", \"documents\"],\n\t\tstability: StabilityEnum.Beta\n\t},\n\tretention: { ttlDays: null },\n\taccess: {\n\t\tpolicy: {\n\t\t\tname: \"knowledge.access.financial-docs\",\n\t\t\tversion: 1\n\t\t},\n\t\ttrustLevel: \"high\",\n\t\tautomationWritable: true\n\t},\n\tindexing: {\n\t\tembeddingModel: \"mistral-embed\",\n\t\tchunkSize: 700,\n\t\tvectorDbIntegration: \"vectordb.qdrant\"\n\t},\n\tdescription: \"Normalized financial documents enabling bill pay automation, reminders, and summaries.\"\n};\nfunction registerFinancialDocsKnowledgeSpace(registry) {\n\treturn registry.register(financialDocsKnowledgeSpace);\n}\n\n//#endregion\nexport { financialDocsKnowledgeSpace, registerFinancialDocsKnowledgeSpace }
|
|
1
|
+
{"version":3,"file":"financial-docs.js","names":[],"sources":["../../../../../../contracts/dist/knowledge/spaces/financial-docs.js"],"sourcesContent":["import { StabilityEnum } from \"../../ownership.js\";\n\n//#region src/knowledge/spaces/financial-docs.ts\nconst financialDocsKnowledgeSpace = {\n\tmeta: {\n\t\tkey: \"knowledge.financial-docs\",\n\t\tversion: 1,\n\t\tcategory: \"canonical\",\n\t\tdisplayName: \"Financial Documents\",\n\t\ttitle: \"Household Financial Documents\",\n\t\tdescription: \"Invoices, bills, and contracts powering Pocket Family Office financial automation.\",\n\t\tdomain: \"finance\",\n\t\towners: [\"platform.finance\"],\n\t\ttags: [\"finance\", \"documents\"],\n\t\tstability: StabilityEnum.Beta\n\t},\n\tretention: { ttlDays: null },\n\taccess: {\n\t\tpolicy: {\n\t\t\tname: \"knowledge.access.financial-docs\",\n\t\t\tversion: 1\n\t\t},\n\t\ttrustLevel: \"high\",\n\t\tautomationWritable: true\n\t},\n\tindexing: {\n\t\tembeddingModel: \"mistral-embed\",\n\t\tchunkSize: 700,\n\t\tvectorDbIntegration: \"vectordb.qdrant\"\n\t},\n\tdescription: \"Normalized financial documents enabling bill pay automation, reminders, and summaries.\"\n};\nfunction registerFinancialDocsKnowledgeSpace(registry) {\n\treturn registry.register(financialDocsKnowledgeSpace);\n}\n\n//#endregion\nexport { financialDocsKnowledgeSpace, registerFinancialDocsKnowledgeSpace };"],"mappings":";;;AAGA,MAAM,8BAA8B;CACnC,MAAM;EACL,KAAK;EACL,SAAS;EACT,UAAU;EACV,aAAa;EACb,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,mBAAmB;EAC5B,MAAM,CAAC,WAAW,YAAY;EAC9B,WAAW,cAAc;EACzB;CACD,WAAW,EAAE,SAAS,MAAM;CAC5B,QAAQ;EACP,QAAQ;GACP,MAAM;GACN,SAAS;GACT;EACD,YAAY;EACZ,oBAAoB;EACpB;CACD,UAAU;EACT,gBAAgB;EAChB,WAAW;EACX,qBAAqB;EACrB;CACD,aAAa;CACb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"financial-overview.js","names":[],"sources":["../../../../../../contracts/dist/knowledge/spaces/financial-overview.js"],"sourcesContent":["import { StabilityEnum } from \"../../ownership.js\";\n\n//#region src/knowledge/spaces/financial-overview.ts\nconst financialOverviewKnowledgeSpace = {\n\tmeta: {\n\t\tkey: \"knowledge.financial-overview\",\n\t\tversion: 1,\n\t\tcategory: \"operational\",\n\t\tdisplayName: \"Financial Overview Summaries\",\n\t\ttitle: \"Derived Financial Summaries\",\n\t\tdescription: \"Aggregated cashflow summaries, category breakdowns, and balance trends derived from open banking data.\",\n\t\tdomain: \"finance\",\n\t\towners: [\"platform.finance\"],\n\t\ttags: [\n\t\t\t\"open-banking\",\n\t\t\t\"summaries\",\n\t\t\t\"cashflow\"\n\t\t],\n\t\tstability: StabilityEnum.Experimental\n\t},\n\tretention: { ttlDays: 180 },\n\taccess: {\n\t\tpolicy: {\n\t\t\tname: \"knowledge.access.financial-overview\",\n\t\t\tversion: 1\n\t\t},\n\t\ttrustLevel: \"medium\",\n\t\tautomationWritable: true\n\t},\n\tindexing: {\n\t\tembeddingModel: \"mistral-embed\",\n\t\tchunkSize: 600,\n\t\tvectorDbIntegration: \"vectordb.qdrant\"\n\t},\n\tdescription: \"Derived knowledge space containing weekly/monthly cashflow rollups and account health summaries. Raw transactions are excluded to respect privacy guardrails.\"\n};\nfunction registerFinancialOverviewKnowledgeSpace(registry) {\n\treturn registry.register(financialOverviewKnowledgeSpace);\n}\n\n//#endregion\nexport { financialOverviewKnowledgeSpace, registerFinancialOverviewKnowledgeSpace }
|
|
1
|
+
{"version":3,"file":"financial-overview.js","names":[],"sources":["../../../../../../contracts/dist/knowledge/spaces/financial-overview.js"],"sourcesContent":["import { StabilityEnum } from \"../../ownership.js\";\n\n//#region src/knowledge/spaces/financial-overview.ts\nconst financialOverviewKnowledgeSpace = {\n\tmeta: {\n\t\tkey: \"knowledge.financial-overview\",\n\t\tversion: 1,\n\t\tcategory: \"operational\",\n\t\tdisplayName: \"Financial Overview Summaries\",\n\t\ttitle: \"Derived Financial Summaries\",\n\t\tdescription: \"Aggregated cashflow summaries, category breakdowns, and balance trends derived from open banking data.\",\n\t\tdomain: \"finance\",\n\t\towners: [\"platform.finance\"],\n\t\ttags: [\n\t\t\t\"open-banking\",\n\t\t\t\"summaries\",\n\t\t\t\"cashflow\"\n\t\t],\n\t\tstability: StabilityEnum.Experimental\n\t},\n\tretention: { ttlDays: 180 },\n\taccess: {\n\t\tpolicy: {\n\t\t\tname: \"knowledge.access.financial-overview\",\n\t\t\tversion: 1\n\t\t},\n\t\ttrustLevel: \"medium\",\n\t\tautomationWritable: true\n\t},\n\tindexing: {\n\t\tembeddingModel: \"mistral-embed\",\n\t\tchunkSize: 600,\n\t\tvectorDbIntegration: \"vectordb.qdrant\"\n\t},\n\tdescription: \"Derived knowledge space containing weekly/monthly cashflow rollups and account health summaries. Raw transactions are excluded to respect privacy guardrails.\"\n};\nfunction registerFinancialOverviewKnowledgeSpace(registry) {\n\treturn registry.register(financialOverviewKnowledgeSpace);\n}\n\n//#endregion\nexport { financialOverviewKnowledgeSpace, registerFinancialOverviewKnowledgeSpace };"],"mappings":";;;AAGA,MAAM,kCAAkC;CACvC,MAAM;EACL,KAAK;EACL,SAAS;EACT,UAAU;EACV,aAAa;EACb,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,mBAAmB;EAC5B,MAAM;GACL;GACA;GACA;GACA;EACD,WAAW,cAAc;EACzB;CACD,WAAW,EAAE,SAAS,KAAK;CAC3B,QAAQ;EACP,QAAQ;GACP,MAAM;GACN,SAAS;GACT;EACD,YAAY;EACZ,oBAAoB;EACpB;CACD,UAAU;EACT,gBAAgB;EAChB,WAAW;EACX,qBAAqB;EACrB;CACD,aAAa;CACb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product-canon.js","names":[],"sources":["../../../../../../contracts/dist/knowledge/spaces/product-canon.js"],"sourcesContent":["import { StabilityEnum } from \"../../ownership.js\";\n\n//#region src/knowledge/spaces/product-canon.ts\nconst productCanonKnowledgeSpace = {\n\tmeta: {\n\t\tkey: \"knowledge.product-canon\",\n\t\tversion: 1,\n\t\tcategory: \"canonical\",\n\t\tdisplayName: \"Product Canon\",\n\t\ttitle: \"Product Canon Knowledge Space\",\n\t\tdescription: \"Authoritative product knowledge covering strategy, roadmap, and delivery canon.\",\n\t\tdomain: \"product\",\n\t\towners: [\"platform.product\"],\n\t\ttags: [\"knowledge\", \"product\"],\n\t\tstability: StabilityEnum.Stable\n\t},\n\tretention: { ttlDays: null },\n\taccess: {\n\t\tpolicy: {\n\t\t\tname: \"knowledge.access.product-canon\",\n\t\t\tversion: 1\n\t\t},\n\t\ttrustLevel: \"high\",\n\t\tautomationWritable: false\n\t},\n\tindexing: {\n\t\tembeddingModel: \"text-embedding-3-large\",\n\t\tchunkSize: 800,\n\t\tvectorDbIntegration: \"vectordb.qdrant\"\n\t},\n\tdescription: \"Single source of truth for product canon, principles, and strategic narratives.\"\n};\nfunction registerProductCanonKnowledgeSpace(registry) {\n\treturn registry.register(productCanonKnowledgeSpace);\n}\n\n//#endregion\nexport { productCanonKnowledgeSpace, registerProductCanonKnowledgeSpace }
|
|
1
|
+
{"version":3,"file":"product-canon.js","names":[],"sources":["../../../../../../contracts/dist/knowledge/spaces/product-canon.js"],"sourcesContent":["import { StabilityEnum } from \"../../ownership.js\";\n\n//#region src/knowledge/spaces/product-canon.ts\nconst productCanonKnowledgeSpace = {\n\tmeta: {\n\t\tkey: \"knowledge.product-canon\",\n\t\tversion: 1,\n\t\tcategory: \"canonical\",\n\t\tdisplayName: \"Product Canon\",\n\t\ttitle: \"Product Canon Knowledge Space\",\n\t\tdescription: \"Authoritative product knowledge covering strategy, roadmap, and delivery canon.\",\n\t\tdomain: \"product\",\n\t\towners: [\"platform.product\"],\n\t\ttags: [\"knowledge\", \"product\"],\n\t\tstability: StabilityEnum.Stable\n\t},\n\tretention: { ttlDays: null },\n\taccess: {\n\t\tpolicy: {\n\t\t\tname: \"knowledge.access.product-canon\",\n\t\t\tversion: 1\n\t\t},\n\t\ttrustLevel: \"high\",\n\t\tautomationWritable: false\n\t},\n\tindexing: {\n\t\tembeddingModel: \"text-embedding-3-large\",\n\t\tchunkSize: 800,\n\t\tvectorDbIntegration: \"vectordb.qdrant\"\n\t},\n\tdescription: \"Single source of truth for product canon, principles, and strategic narratives.\"\n};\nfunction registerProductCanonKnowledgeSpace(registry) {\n\treturn registry.register(productCanonKnowledgeSpace);\n}\n\n//#endregion\nexport { productCanonKnowledgeSpace, registerProductCanonKnowledgeSpace };"],"mappings":";;;AAGA,MAAM,6BAA6B;CAClC,MAAM;EACL,KAAK;EACL,SAAS;EACT,UAAU;EACV,aAAa;EACb,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,mBAAmB;EAC5B,MAAM,CAAC,aAAa,UAAU;EAC9B,WAAW,cAAc;EACzB;CACD,WAAW,EAAE,SAAS,MAAM;CAC5B,QAAQ;EACP,QAAQ;GACP,MAAM;GACN,SAAS;GACT;EACD,YAAY;EACZ,oBAAoB;EACpB;CACD,UAAU;EACT,gBAAgB;EAChB,WAAW;EACX,qBAAqB;EACrB;CACD,aAAa;CACb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"support-faq.js","names":[],"sources":["../../../../../../contracts/dist/knowledge/spaces/support-faq.js"],"sourcesContent":["import { StabilityEnum } from \"../../ownership.js\";\n\n//#region src/knowledge/spaces/support-faq.ts\nconst supportFaqKnowledgeSpace = {\n\tmeta: {\n\t\tkey: \"knowledge.support-faq\",\n\t\tversion: 1,\n\t\tcategory: \"operational\",\n\t\tdisplayName: \"Support FAQ\",\n\t\ttitle: \"Support & Success FAQ\",\n\t\tdescription: \"Operational knowledge base for customer support and success.\",\n\t\tdomain: \"support\",\n\t\towners: [\"platform.support\"],\n\t\ttags: [\"knowledge\", \"support\"],\n\t\tstability: StabilityEnum.Beta\n\t},\n\tretention: {\n\t\tttlDays: 365,\n\t\tarchiveAfterDays: 180\n\t},\n\taccess: {\n\t\tpolicy: {\n\t\t\tname: \"knowledge.access.support\",\n\t\t\tversion: 1\n\t\t},\n\t\ttrustLevel: \"medium\",\n\t\tautomationWritable: true\n\t},\n\tindexing: {\n\t\tembeddingModel: \"text-embedding-3-small\",\n\t\tchunkSize: 700,\n\t\tvectorDbIntegration: \"vectordb.qdrant\"\n\t},\n\tdescription: \"Operational FAQs, runbooks, and customer success playbooks augmented with automation updates.\"\n};\nfunction registerSupportFaqKnowledgeSpace(registry) {\n\treturn registry.register(supportFaqKnowledgeSpace);\n}\n\n//#endregion\nexport { registerSupportFaqKnowledgeSpace, supportFaqKnowledgeSpace }
|
|
1
|
+
{"version":3,"file":"support-faq.js","names":[],"sources":["../../../../../../contracts/dist/knowledge/spaces/support-faq.js"],"sourcesContent":["import { StabilityEnum } from \"../../ownership.js\";\n\n//#region src/knowledge/spaces/support-faq.ts\nconst supportFaqKnowledgeSpace = {\n\tmeta: {\n\t\tkey: \"knowledge.support-faq\",\n\t\tversion: 1,\n\t\tcategory: \"operational\",\n\t\tdisplayName: \"Support FAQ\",\n\t\ttitle: \"Support & Success FAQ\",\n\t\tdescription: \"Operational knowledge base for customer support and success.\",\n\t\tdomain: \"support\",\n\t\towners: [\"platform.support\"],\n\t\ttags: [\"knowledge\", \"support\"],\n\t\tstability: StabilityEnum.Beta\n\t},\n\tretention: {\n\t\tttlDays: 365,\n\t\tarchiveAfterDays: 180\n\t},\n\taccess: {\n\t\tpolicy: {\n\t\t\tname: \"knowledge.access.support\",\n\t\t\tversion: 1\n\t\t},\n\t\ttrustLevel: \"medium\",\n\t\tautomationWritable: true\n\t},\n\tindexing: {\n\t\tembeddingModel: \"text-embedding-3-small\",\n\t\tchunkSize: 700,\n\t\tvectorDbIntegration: \"vectordb.qdrant\"\n\t},\n\tdescription: \"Operational FAQs, runbooks, and customer success playbooks augmented with automation updates.\"\n};\nfunction registerSupportFaqKnowledgeSpace(registry) {\n\treturn registry.register(supportFaqKnowledgeSpace);\n}\n\n//#endregion\nexport { registerSupportFaqKnowledgeSpace, supportFaqKnowledgeSpace };"],"mappings":";;;AAGA,MAAM,2BAA2B;CAChC,MAAM;EACL,KAAK;EACL,SAAS;EACT,UAAU;EACV,aAAa;EACb,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,mBAAmB;EAC5B,MAAM,CAAC,aAAa,UAAU;EAC9B,WAAW,cAAc;EACzB;CACD,WAAW;EACV,SAAS;EACT,kBAAkB;EAClB;CACD,QAAQ;EACP,QAAQ;GACP,MAAM;GACN,SAAS;GACT;EACD,YAAY;EACZ,oBAAoB;EACpB;CACD,UAAU;EACT,gBAAgB;EAChB,WAAW;EACX,qBAAqB;EACrB;CACD,aAAa;CACb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uploaded-docs.js","names":[],"sources":["../../../../../../contracts/dist/knowledge/spaces/uploaded-docs.js"],"sourcesContent":["import { StabilityEnum } from \"../../ownership.js\";\n\n//#region src/knowledge/spaces/uploaded-docs.ts\nconst uploadedDocsKnowledgeSpace = {\n\tmeta: {\n\t\tkey: \"knowledge.uploaded-docs\",\n\t\tversion: 1,\n\t\tcategory: \"external\",\n\t\tdisplayName: \"Uploaded Documents\",\n\t\ttitle: \"Uploaded Knowledge Assets\",\n\t\tdescription: \"Documents uploaded by households, including invoices, contracts, and reference files.\",\n\t\tdomain: \"operations\",\n\t\towners: [\"platform.operations\"],\n\t\ttags: [\"documents\", \"storage\"],\n\t\tstability: StabilityEnum.Beta\n\t},\n\tretention: { ttlDays: null },\n\taccess: {\n\t\tpolicy: {\n\t\t\tname: \"knowledge.access.uploaded-docs\",\n\t\t\tversion: 1\n\t\t},\n\t\ttrustLevel: \"medium\",\n\t\tautomationWritable: true\n\t},\n\tindexing: {\n\t\tembeddingModel: \"mistral-embed\",\n\t\tchunkSize: 900,\n\t\tvectorDbIntegration: \"vectordb.qdrant\"\n\t},\n\tdescription: \"User-provided documents normalized and embedded for retrieval augmented workflows.\"\n};\nfunction registerUploadedDocsKnowledgeSpace(registry) {\n\treturn registry.register(uploadedDocsKnowledgeSpace);\n}\n\n//#endregion\nexport { registerUploadedDocsKnowledgeSpace, uploadedDocsKnowledgeSpace }
|
|
1
|
+
{"version":3,"file":"uploaded-docs.js","names":[],"sources":["../../../../../../contracts/dist/knowledge/spaces/uploaded-docs.js"],"sourcesContent":["import { StabilityEnum } from \"../../ownership.js\";\n\n//#region src/knowledge/spaces/uploaded-docs.ts\nconst uploadedDocsKnowledgeSpace = {\n\tmeta: {\n\t\tkey: \"knowledge.uploaded-docs\",\n\t\tversion: 1,\n\t\tcategory: \"external\",\n\t\tdisplayName: \"Uploaded Documents\",\n\t\ttitle: \"Uploaded Knowledge Assets\",\n\t\tdescription: \"Documents uploaded by households, including invoices, contracts, and reference files.\",\n\t\tdomain: \"operations\",\n\t\towners: [\"platform.operations\"],\n\t\ttags: [\"documents\", \"storage\"],\n\t\tstability: StabilityEnum.Beta\n\t},\n\tretention: { ttlDays: null },\n\taccess: {\n\t\tpolicy: {\n\t\t\tname: \"knowledge.access.uploaded-docs\",\n\t\t\tversion: 1\n\t\t},\n\t\ttrustLevel: \"medium\",\n\t\tautomationWritable: true\n\t},\n\tindexing: {\n\t\tembeddingModel: \"mistral-embed\",\n\t\tchunkSize: 900,\n\t\tvectorDbIntegration: \"vectordb.qdrant\"\n\t},\n\tdescription: \"User-provided documents normalized and embedded for retrieval augmented workflows.\"\n};\nfunction registerUploadedDocsKnowledgeSpace(registry) {\n\treturn registry.register(uploadedDocsKnowledgeSpace);\n}\n\n//#endregion\nexport { registerUploadedDocsKnowledgeSpace, uploadedDocsKnowledgeSpace };"],"mappings":";;;AAGA,MAAM,6BAA6B;CAClC,MAAM;EACL,KAAK;EACL,SAAS;EACT,UAAU;EACV,aAAa;EACb,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,sBAAsB;EAC/B,MAAM,CAAC,aAAa,UAAU;EAC9B,WAAW,cAAc;EACzB;CACD,WAAW,EAAE,SAAS,MAAM;CAC5B,QAAQ;EACP,QAAQ;GACP,MAAM;GACN,SAAS;GACT;EACD,YAAY;EACZ,oBAAoB;EACpB;CACD,UAAU;EACT,gBAAgB;EAChB,WAAW;EACX,qBAAqB;EACrB;CACD,aAAa;CACb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exporters.js","names":[],"sources":["../../../../../contracts/dist/llm/exporters.js"],"sourcesContent":["import { jsonSchemaForSpec } from \"../jsonschema.js\";\nimport { isEmitDeclRef } from \"../spec.js\";\n\n//#region src/llm/exporters.ts\nconst DEFAULT_SPEC_OPTIONS = {\n\tformat: \"full\",\n\tincludeSchemas: true,\n\tincludeScenarios: true,\n\tincludeExamples: true,\n\tincludePolicy: true,\n\tincludeSideEffects: true\n};\nconst DEFAULT_FEATURE_OPTIONS = {\n\t...DEFAULT_SPEC_OPTIONS,\n\tincludeRelatedSpecs: true,\n\tincludeRelatedEvents: true,\n\tincludeRelatedPresentations: true\n};\n/**\n* Export a single spec to context-focused markdown.\n* Includes: goal, context, description, acceptance scenarios.\n* Best for: Understanding what the spec does, providing context to LLMs.\n*/\nfunction specToContextMarkdown(spec) {\n\tconst m = spec.meta;\n\tconst lines = [];\n\tlines.push(`# ${m.name} (v${m.version})`);\n\tlines.push(\"\");\n\tlines.push(`> ${m.description}`);\n\tlines.push(\"\");\n\tlines.push(`**Type:** ${m.kind} | **Stability:** ${m.stability}`);\n\tlines.push(\"\");\n\tlines.push(\"## Goal\");\n\tlines.push(\"\");\n\tlines.push(m.goal);\n\tlines.push(\"\");\n\tlines.push(\"## Context\");\n\tlines.push(\"\");\n\tlines.push(m.context);\n\tlines.push(\"\");\n\tif (spec.acceptance?.scenarios?.length) {\n\t\tlines.push(\"## Acceptance Criteria\");\n\t\tlines.push(\"\");\n\t\tfor (const s of spec.acceptance.scenarios) {\n\t\t\tlines.push(`### ${s.name}`);\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(\"**Given:**\");\n\t\t\tfor (const g of s.given) lines.push(`- ${g}`);\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(\"**When:**\");\n\t\t\tfor (const w of s.when) lines.push(`- ${w}`);\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(\"**Then:**\");\n\t\t\tfor (const t of s.then) lines.push(`- ${t}`);\n\t\t\tlines.push(\"\");\n\t\t}\n\t}\n\treturn lines.join(\"\\n\");\n}\n/**\n* Export a single spec to full markdown with all details.\n* Includes: all fields, I/O schemas, policy, events, examples.\n* Best for: Complete documentation, implementation reference.\n*/\nfunction specToFullMarkdown(spec, options = {}) {\n\tconst opts = {\n\t\t...DEFAULT_SPEC_OPTIONS,\n\t\t...options\n\t};\n\tconst m = spec.meta;\n\tconst lines = [];\n\tlines.push(`# ${m.name}.v${m.version}`);\n\tlines.push(\"\");\n\tlines.push(`> ${m.description}`);\n\tlines.push(\"\");\n\tlines.push(\"## Metadata\");\n\tlines.push(\"\");\n\tlines.push(\"| Field | Value |\");\n\tlines.push(\"|-------|-------|\");\n\tlines.push(`| Kind | ${m.kind} |`);\n\tlines.push(`| Stability | ${m.stability} |`);\n\tlines.push(`| Owners | ${m.owners.join(\", \")} |`);\n\tlines.push(`| Tags | ${m.tags.join(\", \")} |`);\n\tlines.push(\"\");\n\tlines.push(\"## Goal\");\n\tlines.push(\"\");\n\tlines.push(m.goal);\n\tlines.push(\"\");\n\tlines.push(\"## Context\");\n\tlines.push(\"\");\n\tlines.push(m.context);\n\tlines.push(\"\");\n\tif (opts.includeSchemas) {\n\t\tlines.push(\"## Input/Output\");\n\t\tlines.push(\"\");\n\t\tif (spec.io.input) {\n\t\t\tlines.push(\"### Input Schema\");\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(\"```json\");\n\t\t\ttry {\n\t\t\t\tconst schema = jsonSchemaForSpec(spec);\n\t\t\t\tlines.push(JSON.stringify(schema.input ?? {}, null, 2));\n\t\t\t} catch {\n\t\t\t\tlines.push(\"// Schema generation not available\");\n\t\t\t}\n\t\t\tlines.push(\"```\");\n\t\t\tlines.push(\"\");\n\t\t}\n\t\tlines.push(\"### Output Schema\");\n\t\tlines.push(\"\");\n\t\tlines.push(\"```json\");\n\t\ttry {\n\t\t\tconst schema = jsonSchemaForSpec(spec);\n\t\t\tlines.push(JSON.stringify(schema.output ?? {}, null, 2));\n\t\t} catch {\n\t\t\tlines.push(\"// Schema generation not available\");\n\t\t}\n\t\tlines.push(\"```\");\n\t\tlines.push(\"\");\n\t\tif (spec.io.errors && Object.keys(spec.io.errors).length) {\n\t\t\tlines.push(\"### Error Codes\");\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(\"| Code | HTTP | Description | When |\");\n\t\t\tlines.push(\"|------|------|-------------|------|\");\n\t\t\tfor (const [code, err] of Object.entries(spec.io.errors)) lines.push(`| \\`${code}\\` | ${err.http ?? 400} | ${err.description} | ${err.when} |`);\n\t\t\tlines.push(\"\");\n\t\t}\n\t}\n\tif (opts.includePolicy) {\n\t\tlines.push(\"## Policy\");\n\t\tlines.push(\"\");\n\t\tlines.push(`- **Auth Required:** ${spec.policy.auth}`);\n\t\tlines.push(`- **Idempotent:** ${spec.policy.idempotent ?? m.kind === \"query\"}`);\n\t\tif (spec.policy.rateLimit) lines.push(`- **Rate Limit:** ${spec.policy.rateLimit.rpm} rpm per ${spec.policy.rateLimit.key}`);\n\t\tif (spec.policy.flags?.length) lines.push(`- **Feature Flags:** ${spec.policy.flags.join(\", \")}`);\n\t\tif (spec.policy.pii?.length) lines.push(`- **PII Fields:** ${spec.policy.pii.join(\", \")}`);\n\t\tif (spec.policy.escalate) lines.push(`- **Escalation:** ${spec.policy.escalate}`);\n\t\tlines.push(\"\");\n\t}\n\tif (opts.includeSideEffects && spec.sideEffects) {\n\t\tif (spec.sideEffects.emits?.length) {\n\t\t\tlines.push(\"## Events Emitted\");\n\t\t\tlines.push(\"\");\n\t\t\tfor (const e of spec.sideEffects.emits) if (isEmitDeclRef(e)) lines.push(`- \\`${e.ref.name}.v${e.ref.version}\\` — ${e.when}`);\n\t\t\telse lines.push(`- \\`${e.name}.v${e.version}\\` — ${e.when}`);\n\t\t\tlines.push(\"\");\n\t\t}\n\t\tif (spec.sideEffects.analytics?.length) {\n\t\t\tlines.push(\"## Analytics Events\");\n\t\t\tlines.push(\"\");\n\t\t\tfor (const a of spec.sideEffects.analytics) lines.push(`- ${a}`);\n\t\t\tlines.push(\"\");\n\t\t}\n\t}\n\tif (opts.includeScenarios && spec.acceptance?.scenarios?.length) {\n\t\tlines.push(\"## Acceptance Scenarios\");\n\t\tlines.push(\"\");\n\t\tfor (const s of spec.acceptance.scenarios) {\n\t\t\tlines.push(`### ${s.name}`);\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(\"**Given:**\");\n\t\t\tfor (const g of s.given) lines.push(`- ${g}`);\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(\"**When:**\");\n\t\t\tfor (const w of s.when) lines.push(`- ${w}`);\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(\"**Then:**\");\n\t\t\tfor (const t of s.then) lines.push(`- ${t}`);\n\t\t\tlines.push(\"\");\n\t\t}\n\t}\n\tif (opts.includeExamples && spec.acceptance?.examples?.length) {\n\t\tlines.push(\"## Examples\");\n\t\tlines.push(\"\");\n\t\tfor (const ex of spec.acceptance.examples) {\n\t\t\tlines.push(`### ${ex.name}`);\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(\"**Input:**\");\n\t\t\tlines.push(\"```json\");\n\t\t\tlines.push(JSON.stringify(ex.input, null, 2));\n\t\t\tlines.push(\"```\");\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(\"**Output:**\");\n\t\t\tlines.push(\"```json\");\n\t\t\tlines.push(JSON.stringify(ex.output, null, 2));\n\t\t\tlines.push(\"```\");\n\t\t\tlines.push(\"\");\n\t\t}\n\t}\n\tif (spec.transport) {\n\t\tlines.push(\"## Transport Configuration\");\n\t\tlines.push(\"\");\n\t\tif (spec.transport.rest) lines.push(`- **REST:** ${spec.transport.rest.method ?? \"POST\"} ${spec.transport.rest.path ?? \"auto\"}`);\n\t\tif (spec.transport.gql) lines.push(`- **GraphQL:** ${spec.transport.gql.field ?? \"auto\"}`);\n\t\tif (spec.transport.mcp) lines.push(`- **MCP Tool:** ${spec.transport.mcp.toolName ?? \"auto\"}`);\n\t\tlines.push(\"\");\n\t}\n\treturn lines.join(\"\\n\");\n}\n/**\n* Export a single spec as an actionable agent prompt.\n* Includes: instructions, full spec, expected output format.\n* Best for: Directly feeding to coding agents for implementation.\n*/\nfunction specToAgentPrompt(spec, options) {\n\tconst taskType = options?.taskType ?? \"implement\";\n\tconst m = spec.meta;\n\tconst lines = [];\n\tconst taskVerb = {\n\t\timplement: \"Implement\",\n\t\ttest: \"Write tests for\",\n\t\trefactor: \"Refactor\",\n\t\treview: \"Review\"\n\t}[taskType];\n\tlines.push(`# Task: ${taskVerb} ${m.name}.v${m.version}`);\n\tlines.push(\"\");\n\tlines.push(\"## Context\");\n\tlines.push(\"\");\n\tlines.push(`You are working on a ContractSpec-driven codebase. This spec defines a ${m.kind} operation.`);\n\tlines.push(\"\");\n\tlines.push(`**Goal:** ${m.goal}`);\n\tlines.push(\"\");\n\tlines.push(`**Background:** ${m.context}`);\n\tlines.push(\"\");\n\tlines.push(\"## Specification\");\n\tlines.push(\"\");\n\tlines.push(specToFullMarkdown(spec));\n\tlines.push(\"\");\n\tlines.push(\"## Instructions\");\n\tlines.push(\"\");\n\tif (taskType === \"implement\") {\n\t\tlines.push(\"Implement this specification following these requirements:\");\n\t\tlines.push(\"\");\n\t\tlines.push(\"1. **Type Safety**: Use TypeScript with strict typing. No `any` types.\");\n\t\tlines.push(\"2. **Input Validation**: Validate input against the schema before processing.\");\n\t\tlines.push(\"3. **Error Handling**: Implement all error cases defined in the spec.\");\n\t\tlines.push(\"4. **Events**: Emit events as specified in sideEffects.emits.\");\n\t\tlines.push(\"5. **Policy**: Respect auth, rate limits, and feature flags.\");\n\t\tlines.push(\"6. **Idempotency**: \" + (spec.policy.idempotent ? \"This operation MUST be idempotent.\" : \"This operation may have side effects.\"));\n\t\tlines.push(\"\");\n\t\tif (spec.policy.pii?.length) {\n\t\t\tlines.push(\"**PII Handling**: The following fields contain PII and must be handled carefully:\");\n\t\t\tfor (const field of spec.policy.pii) lines.push(`- ${field}`);\n\t\t\tlines.push(\"\");\n\t\t}\n\t} else if (taskType === \"test\") {\n\t\tlines.push(\"Write comprehensive tests for this specification:\");\n\t\tlines.push(\"\");\n\t\tlines.push(\"1. Test all acceptance scenarios defined in the spec.\");\n\t\tlines.push(\"2. Test all error cases with appropriate assertions.\");\n\t\tlines.push(\"3. Test edge cases and boundary conditions.\");\n\t\tlines.push(\"4. Verify events are emitted correctly.\");\n\t\tlines.push(\"5. Use descriptive test names following the pattern: \\\"should [behavior] when [condition]\\\"\");\n\t\tlines.push(\"\");\n\t} else if (taskType === \"refactor\") {\n\t\tlines.push(\"Refactor this implementation while preserving all behavior:\");\n\t\tlines.push(\"\");\n\t\tlines.push(\"1. Maintain compliance with the specification.\");\n\t\tlines.push(\"2. Improve code clarity and maintainability.\");\n\t\tlines.push(\"3. Reduce complexity where possible.\");\n\t\tlines.push(\"4. Ensure all existing tests still pass.\");\n\t\tlines.push(\"\");\n\t} else if (taskType === \"review\") {\n\t\tlines.push(\"Review this implementation against the specification:\");\n\t\tlines.push(\"\");\n\t\tlines.push(\"1. Verify input/output types match the schema.\");\n\t\tlines.push(\"2. Check all error cases are handled.\");\n\t\tlines.push(\"3. Verify events are emitted as specified.\");\n\t\tlines.push(\"4. Check policy compliance (auth, rate limits).\");\n\t\tlines.push(\"5. Report any deviations from the spec.\");\n\t\tlines.push(\"\");\n\t}\n\tif (options?.existingCode) {\n\t\tlines.push(\"## Existing Code\");\n\t\tlines.push(\"\");\n\t\tlines.push(\"```typescript\");\n\t\tlines.push(options.existingCode);\n\t\tlines.push(\"```\");\n\t\tlines.push(\"\");\n\t}\n\tlines.push(\"## Expected Output\");\n\tlines.push(\"\");\n\tif (taskType === \"implement\" || taskType === \"refactor\") {\n\t\tlines.push(\"Provide a complete TypeScript implementation. Include:\");\n\t\tlines.push(\"- Type definitions for input/output\");\n\t\tlines.push(\"- Handler function with proper error handling\");\n\t\tlines.push(\"- JSDoc comments explaining the implementation\");\n\t} else if (taskType === \"test\") lines.push(\"Provide a complete test file using the testing framework available (prefer Vitest).\");\n\telse if (taskType === \"review\") {\n\t\tlines.push(\"Provide a structured review with:\");\n\t\tlines.push(\"- Compliance status (pass/fail for each requirement)\");\n\t\tlines.push(\"- Issues found with severity (error/warning/info)\");\n\t\tlines.push(\"- Suggestions for improvement\");\n\t}\n\tlines.push(\"\");\n\treturn lines.join(\"\\n\");\n}\n/**\n* Export a feature module to markdown.\n* Includes all related specs, events, and presentations.\n*/\nfunction featureToMarkdown(feature, deps, options = {}) {\n\tconst opts = {\n\t\t...DEFAULT_FEATURE_OPTIONS,\n\t\t...options\n\t};\n\tconst m = feature.meta;\n\tconst lines = [];\n\tlines.push(`# Feature: ${m.title ?? m.key}`);\n\tlines.push(\"\");\n\tif (m.description) {\n\t\tlines.push(`> ${m.description}`);\n\t\tlines.push(\"\");\n\t}\n\tlines.push(\"## Overview\");\n\tlines.push(\"\");\n\tlines.push(`- **Key:** \\`${m.key}\\``);\n\tlines.push(`- **Stability:** ${m.stability}`);\n\tlines.push(`- **Owners:** ${m.owners.join(\", \")}`);\n\tif (m.tags?.length) lines.push(`- **Tags:** ${m.tags.join(\", \")}`);\n\tlines.push(\"\");\n\tif (feature.operations?.length) {\n\t\tlines.push(\"## Operations\");\n\t\tlines.push(\"\");\n\t\tlines.push(\"| Name | Version | Type |\");\n\t\tlines.push(\"|------|---------|------|\");\n\t\tfor (const op of feature.operations) {\n\t\t\tconst kind = (deps?.specs?.getSpec(op.name, op.version))?.meta.kind ?? \"unknown\";\n\t\t\tlines.push(`| ${op.name} | v${op.version} | ${kind} |`);\n\t\t}\n\t\tlines.push(\"\");\n\t\tif (opts.includeRelatedSpecs && deps?.specs) {\n\t\t\tlines.push(\"### Operation Details\");\n\t\t\tlines.push(\"\");\n\t\t\tfor (const op of feature.operations) {\n\t\t\t\tconst spec = deps.specs.getSpec(op.name, op.version);\n\t\t\t\tif (spec) {\n\t\t\t\t\tlines.push(`---`);\n\t\t\t\t\tlines.push(\"\");\n\t\t\t\t\tlines.push(specToFullMarkdown(spec, opts));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif (feature.events?.length) {\n\t\tlines.push(\"## Events\");\n\t\tlines.push(\"\");\n\t\tlines.push(\"| Name | Version |\");\n\t\tlines.push(\"|------|---------|\");\n\t\tfor (const evt of feature.events) lines.push(`| ${evt.name} | v${evt.version} |`);\n\t\tlines.push(\"\");\n\t}\n\tif (feature.presentations?.length) {\n\t\tlines.push(\"## Presentations\");\n\t\tlines.push(\"\");\n\t\tlines.push(\"| Name | Version |\");\n\t\tlines.push(\"|------|---------|\");\n\t\tfor (const pres of feature.presentations) lines.push(`| ${pres.name} | v${pres.version} |`);\n\t\tlines.push(\"\");\n\t\tif (opts.includeRelatedPresentations && deps?.presentations) {\n\t\t\tlines.push(\"### Presentation Details\");\n\t\t\tlines.push(\"\");\n\t\t\tfor (const pres of feature.presentations) {\n\t\t\t\tconst p = deps.presentations.get(pres.name, pres.version);\n\t\t\t\tif (p) {\n\t\t\t\t\tlines.push(`#### ${pres.name}.v${pres.version}`);\n\t\t\t\t\tlines.push(\"\");\n\t\t\t\t\tlines.push(`- **Kind:** ${p.content.kind ?? \"unknown\"}`);\n\t\t\t\t\tif (\"componentKey\" in p.content) lines.push(`- **Component:** ${p.content.componentKey}`);\n\t\t\t\t\tlines.push(\"\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif (feature.capabilities) {\n\t\tif (feature.capabilities.provides?.length) {\n\t\t\tlines.push(\"## Capabilities Provided\");\n\t\t\tlines.push(\"\");\n\t\t\tfor (const cap of feature.capabilities.provides) lines.push(`- \\`${cap.key}.v${cap.version}\\``);\n\t\t\tlines.push(\"\");\n\t\t}\n\t\tif (feature.capabilities.requires?.length) {\n\t\t\tlines.push(\"## Capabilities Required\");\n\t\t\tlines.push(\"\");\n\t\t\tfor (const cap of feature.capabilities.requires) lines.push(`- \\`${cap.key}\\`${cap.version ? `.v${cap.version}` : \"\"} (${cap.optional ? \"optional\" : \"required\"})`);\n\t\t\tlines.push(\"\");\n\t\t}\n\t}\n\treturn lines.join(\"\\n\");\n}\n/**\n* Export a presentation descriptor to markdown.\n*/\nfunction presentationToMarkdown(presentation) {\n\tconst m = presentation.meta;\n\tconst lines = [];\n\tlines.push(`# Presentation: ${m.name}.v${m.version}`);\n\tlines.push(\"\");\n\tif (m.description) {\n\t\tlines.push(`> ${m.description}`);\n\t\tlines.push(\"\");\n\t}\n\tlines.push(\"## Metadata\");\n\tlines.push(\"\");\n\tlines.push(`- **Name:** ${m.name}`);\n\tlines.push(`- **Version:** ${m.version}`);\n\tif (m.stability) lines.push(`- **Stability:** ${m.stability}`);\n\tif (m.owners?.length) lines.push(`- **Owners:** ${m.owners.join(\", \")}`);\n\tif (m.tags?.length) lines.push(`- **Tags:** ${m.tags.join(\", \")}`);\n\tlines.push(\"\");\n\tlines.push(\"## Source\");\n\tlines.push(\"\");\n\tlines.push(`- **Type:** ${presentation.source.type}`);\n\tif (presentation.source.type === \"component\") {\n\t\tlines.push(`- **Framework:** ${presentation.source.framework}`);\n\t\tlines.push(`- **Component Key:** ${presentation.source.componentKey}`);\n\t}\n\tlines.push(\"\");\n\tlines.push(\"## Supported Targets\");\n\tlines.push(\"\");\n\tfor (const target of presentation.targets) lines.push(`- ${target}`);\n\tlines.push(\"\");\n\tif (presentation.policy) {\n\t\tlines.push(\"## Policy\");\n\t\tlines.push(\"\");\n\t\tif (presentation.policy.flags?.length) lines.push(`- **Feature Flags:** ${presentation.policy.flags.join(\", \")}`);\n\t\tif (presentation.policy.pii?.length) lines.push(`- **PII Fields:** ${presentation.policy.pii.join(\", \")}`);\n\t\tlines.push(\"\");\n\t}\n\treturn lines.join(\"\\n\");\n}\n/**\n* Export an event spec to markdown.\n*/\nfunction eventToMarkdown(event) {\n\tconst lines = [];\n\tlines.push(`# Event: ${event.name}.v${event.version}`);\n\tlines.push(\"\");\n\tlines.push(\"## Metadata\");\n\tlines.push(\"\");\n\tlines.push(`- **Name:** ${event.name}`);\n\tlines.push(`- **Version:** ${event.version}`);\n\tif (event.description) lines.push(`- **Description:** ${event.description}`);\n\tlines.push(\"\");\n\tlines.push(\"## Payload Schema\");\n\tlines.push(\"\");\n\tlines.push(\"```json\");\n\ttry {\n\t\tconst zodSchema = event.payload.getZod();\n\t\tif (\"shape\" in zodSchema && zodSchema.shape) {\n\t\t\tconst shape = zodSchema.shape;\n\t\t\tconst fields = Object.keys(shape);\n\t\t\tlines.push(JSON.stringify({ fields }, null, 2));\n\t\t} else lines.push(\"// Payload schema available at runtime\");\n\t} catch {\n\t\tlines.push(\"// Schema details available at runtime\");\n\t}\n\tlines.push(\"```\");\n\tlines.push(\"\");\n\treturn lines.join(\"\\n\");\n}\n/**\n* Export a DocBlock to markdown (already markdown, but formatted consistently).\n*/\nfunction docBlockToMarkdown(doc) {\n\tconst lines = [];\n\tlines.push(`# ${doc.title}`);\n\tlines.push(\"\");\n\tif (doc.summary) {\n\t\tlines.push(`> ${doc.summary}`);\n\t\tlines.push(\"\");\n\t}\n\tlines.push(\"## Metadata\");\n\tlines.push(\"\");\n\tlines.push(`- **ID:** ${doc.id}`);\n\tlines.push(`- **Kind:** ${doc.kind ?? \"reference\"}`);\n\tlines.push(`- **Visibility:** ${doc.visibility ?? \"public\"}`);\n\tif (doc.tags?.length) lines.push(`- **Tags:** ${doc.tags.join(\", \")}`);\n\tif (doc.owners?.length) lines.push(`- **Owners:** ${doc.owners.join(\", \")}`);\n\tif (doc.domain) lines.push(`- **Domain:** ${doc.domain}`);\n\tlines.push(\"\");\n\tlines.push(\"## Content\");\n\tlines.push(\"\");\n\tlines.push(doc.body);\n\tlines.push(\"\");\n\tif (doc.links?.length) {\n\t\tlines.push(\"## Related Links\");\n\t\tlines.push(\"\");\n\t\tfor (const link of doc.links) lines.push(`- [${link.label}](${link.href})`);\n\t\tlines.push(\"\");\n\t}\n\treturn lines.join(\"\\n\");\n}\n/**\n* Export a spec with a specific format.\n* Convenience function that wraps the format-specific functions.\n*/\nfunction exportSpec(spec, options = {}) {\n\tconst format = options.format ?? \"full\";\n\tlet markdown;\n\tswitch (format) {\n\t\tcase \"context\":\n\t\t\tmarkdown = specToContextMarkdown(spec);\n\t\t\tbreak;\n\t\tcase \"prompt\":\n\t\t\tmarkdown = specToAgentPrompt(spec);\n\t\t\tbreak;\n\t\tcase \"full\":\n\t\tdefault:\n\t\t\tmarkdown = specToFullMarkdown(spec, options);\n\t\t\tbreak;\n\t}\n\treturn {\n\t\tspec,\n\t\tmarkdown,\n\t\tformat,\n\t\tmeta: {\n\t\t\tspecName: spec.meta.name,\n\t\t\tspecVersion: spec.meta.version,\n\t\t\texportedAt: (/* @__PURE__ */ new Date()).toISOString(),\n\t\t\twordCount: markdown.split(/\\s+/).length\n\t\t}\n\t};\n}\n/**\n* Export a feature with a specific format.\n*/\nfunction exportFeature(feature, deps, options = {}) {\n\tconst format = options.format ?? \"full\";\n\treturn {\n\t\tfeature,\n\t\tmarkdown: featureToMarkdown(feature, deps, options),\n\t\tformat,\n\t\tincludedSpecs: feature.operations?.map((o) => `${o.name}.v${o.version}`) ?? [],\n\t\tincludedEvents: feature.events?.map((e) => `${e.name}.v${e.version}`) ?? [],\n\t\tincludedPresentations: feature.presentations?.map((p) => `${p.name}.v${p.version}`) ?? []\n\t};\n}\n\n//#endregion\nexport { docBlockToMarkdown, eventToMarkdown, exportFeature, exportSpec, featureToMarkdown, presentationToMarkdown, specToAgentPrompt, specToContextMarkdown, specToFullMarkdown };\n//# sourceMappingURL=exporters.js.map"],"mappings":";;;AAIA,MAAM,uBAAuB;CAC5B,QAAQ;CACR,gBAAgB;CAChB,kBAAkB;CAClB,iBAAiB;CACjB,eAAe;CACf,oBAAoB;CACpB;AACD,MAAM,0BAA0B;CAC/B,GAAG;CACH,qBAAqB;CACrB,sBAAsB;CACtB,6BAA6B;CAC7B"}
|
|
1
|
+
{"version":3,"file":"exporters.js","names":[],"sources":["../../../../../contracts/dist/llm/exporters.js"],"sourcesContent":["import { jsonSchemaForSpec } from \"../jsonschema.js\";\nimport { isEmitDeclRef } from \"../spec.js\";\n\n//#region src/llm/exporters.ts\nconst DEFAULT_SPEC_OPTIONS = {\n\tformat: \"full\",\n\tincludeSchemas: true,\n\tincludeScenarios: true,\n\tincludeExamples: true,\n\tincludePolicy: true,\n\tincludeSideEffects: true\n};\nconst DEFAULT_FEATURE_OPTIONS = {\n\t...DEFAULT_SPEC_OPTIONS,\n\tincludeRelatedSpecs: true,\n\tincludeRelatedEvents: true,\n\tincludeRelatedPresentations: true\n};\n/**\n* Export a single spec to context-focused markdown.\n* Includes: goal, context, description, acceptance scenarios.\n* Best for: Understanding what the spec does, providing context to LLMs.\n*/\nfunction specToContextMarkdown(spec) {\n\tconst m = spec.meta;\n\tconst lines = [];\n\tlines.push(`# ${m.name} (v${m.version})`);\n\tlines.push(\"\");\n\tlines.push(`> ${m.description}`);\n\tlines.push(\"\");\n\tlines.push(`**Type:** ${m.kind} | **Stability:** ${m.stability}`);\n\tlines.push(\"\");\n\tlines.push(\"## Goal\");\n\tlines.push(\"\");\n\tlines.push(m.goal);\n\tlines.push(\"\");\n\tlines.push(\"## Context\");\n\tlines.push(\"\");\n\tlines.push(m.context);\n\tlines.push(\"\");\n\tif (spec.acceptance?.scenarios?.length) {\n\t\tlines.push(\"## Acceptance Criteria\");\n\t\tlines.push(\"\");\n\t\tfor (const s of spec.acceptance.scenarios) {\n\t\t\tlines.push(`### ${s.name}`);\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(\"**Given:**\");\n\t\t\tfor (const g of s.given) lines.push(`- ${g}`);\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(\"**When:**\");\n\t\t\tfor (const w of s.when) lines.push(`- ${w}`);\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(\"**Then:**\");\n\t\t\tfor (const t of s.then) lines.push(`- ${t}`);\n\t\t\tlines.push(\"\");\n\t\t}\n\t}\n\treturn lines.join(\"\\n\");\n}\n/**\n* Export a single spec to full markdown with all details.\n* Includes: all fields, I/O schemas, policy, events, examples.\n* Best for: Complete documentation, implementation reference.\n*/\nfunction specToFullMarkdown(spec, options = {}) {\n\tconst opts = {\n\t\t...DEFAULT_SPEC_OPTIONS,\n\t\t...options\n\t};\n\tconst m = spec.meta;\n\tconst lines = [];\n\tlines.push(`# ${m.name}.v${m.version}`);\n\tlines.push(\"\");\n\tlines.push(`> ${m.description}`);\n\tlines.push(\"\");\n\tlines.push(\"## Metadata\");\n\tlines.push(\"\");\n\tlines.push(\"| Field | Value |\");\n\tlines.push(\"|-------|-------|\");\n\tlines.push(`| Kind | ${m.kind} |`);\n\tlines.push(`| Stability | ${m.stability} |`);\n\tlines.push(`| Owners | ${m.owners.join(\", \")} |`);\n\tlines.push(`| Tags | ${m.tags.join(\", \")} |`);\n\tlines.push(\"\");\n\tlines.push(\"## Goal\");\n\tlines.push(\"\");\n\tlines.push(m.goal);\n\tlines.push(\"\");\n\tlines.push(\"## Context\");\n\tlines.push(\"\");\n\tlines.push(m.context);\n\tlines.push(\"\");\n\tif (opts.includeSchemas) {\n\t\tlines.push(\"## Input/Output\");\n\t\tlines.push(\"\");\n\t\tif (spec.io.input) {\n\t\t\tlines.push(\"### Input Schema\");\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(\"```json\");\n\t\t\ttry {\n\t\t\t\tconst schema = jsonSchemaForSpec(spec);\n\t\t\t\tlines.push(JSON.stringify(schema.input ?? {}, null, 2));\n\t\t\t} catch {\n\t\t\t\tlines.push(\"// Schema generation not available\");\n\t\t\t}\n\t\t\tlines.push(\"```\");\n\t\t\tlines.push(\"\");\n\t\t}\n\t\tlines.push(\"### Output Schema\");\n\t\tlines.push(\"\");\n\t\tlines.push(\"```json\");\n\t\ttry {\n\t\t\tconst schema = jsonSchemaForSpec(spec);\n\t\t\tlines.push(JSON.stringify(schema.output ?? {}, null, 2));\n\t\t} catch {\n\t\t\tlines.push(\"// Schema generation not available\");\n\t\t}\n\t\tlines.push(\"```\");\n\t\tlines.push(\"\");\n\t\tif (spec.io.errors && Object.keys(spec.io.errors).length) {\n\t\t\tlines.push(\"### Error Codes\");\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(\"| Code | HTTP | Description | When |\");\n\t\t\tlines.push(\"|------|------|-------------|------|\");\n\t\t\tfor (const [code, err] of Object.entries(spec.io.errors)) lines.push(`| \\`${code}\\` | ${err.http ?? 400} | ${err.description} | ${err.when} |`);\n\t\t\tlines.push(\"\");\n\t\t}\n\t}\n\tif (opts.includePolicy) {\n\t\tlines.push(\"## Policy\");\n\t\tlines.push(\"\");\n\t\tlines.push(`- **Auth Required:** ${spec.policy.auth}`);\n\t\tlines.push(`- **Idempotent:** ${spec.policy.idempotent ?? m.kind === \"query\"}`);\n\t\tif (spec.policy.rateLimit) lines.push(`- **Rate Limit:** ${spec.policy.rateLimit.rpm} rpm per ${spec.policy.rateLimit.key}`);\n\t\tif (spec.policy.flags?.length) lines.push(`- **Feature Flags:** ${spec.policy.flags.join(\", \")}`);\n\t\tif (spec.policy.pii?.length) lines.push(`- **PII Fields:** ${spec.policy.pii.join(\", \")}`);\n\t\tif (spec.policy.escalate) lines.push(`- **Escalation:** ${spec.policy.escalate}`);\n\t\tlines.push(\"\");\n\t}\n\tif (opts.includeSideEffects && spec.sideEffects) {\n\t\tif (spec.sideEffects.emits?.length) {\n\t\t\tlines.push(\"## Events Emitted\");\n\t\t\tlines.push(\"\");\n\t\t\tfor (const e of spec.sideEffects.emits) if (isEmitDeclRef(e)) lines.push(`- \\`${e.ref.name}.v${e.ref.version}\\` — ${e.when}`);\n\t\t\telse lines.push(`- \\`${e.name}.v${e.version}\\` — ${e.when}`);\n\t\t\tlines.push(\"\");\n\t\t}\n\t\tif (spec.sideEffects.analytics?.length) {\n\t\t\tlines.push(\"## Analytics Events\");\n\t\t\tlines.push(\"\");\n\t\t\tfor (const a of spec.sideEffects.analytics) lines.push(`- ${a}`);\n\t\t\tlines.push(\"\");\n\t\t}\n\t}\n\tif (opts.includeScenarios && spec.acceptance?.scenarios?.length) {\n\t\tlines.push(\"## Acceptance Scenarios\");\n\t\tlines.push(\"\");\n\t\tfor (const s of spec.acceptance.scenarios) {\n\t\t\tlines.push(`### ${s.name}`);\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(\"**Given:**\");\n\t\t\tfor (const g of s.given) lines.push(`- ${g}`);\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(\"**When:**\");\n\t\t\tfor (const w of s.when) lines.push(`- ${w}`);\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(\"**Then:**\");\n\t\t\tfor (const t of s.then) lines.push(`- ${t}`);\n\t\t\tlines.push(\"\");\n\t\t}\n\t}\n\tif (opts.includeExamples && spec.acceptance?.examples?.length) {\n\t\tlines.push(\"## Examples\");\n\t\tlines.push(\"\");\n\t\tfor (const ex of spec.acceptance.examples) {\n\t\t\tlines.push(`### ${ex.name}`);\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(\"**Input:**\");\n\t\t\tlines.push(\"```json\");\n\t\t\tlines.push(JSON.stringify(ex.input, null, 2));\n\t\t\tlines.push(\"```\");\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(\"**Output:**\");\n\t\t\tlines.push(\"```json\");\n\t\t\tlines.push(JSON.stringify(ex.output, null, 2));\n\t\t\tlines.push(\"```\");\n\t\t\tlines.push(\"\");\n\t\t}\n\t}\n\tif (spec.transport) {\n\t\tlines.push(\"## Transport Configuration\");\n\t\tlines.push(\"\");\n\t\tif (spec.transport.rest) lines.push(`- **REST:** ${spec.transport.rest.method ?? \"POST\"} ${spec.transport.rest.path ?? \"auto\"}`);\n\t\tif (spec.transport.gql) lines.push(`- **GraphQL:** ${spec.transport.gql.field ?? \"auto\"}`);\n\t\tif (spec.transport.mcp) lines.push(`- **MCP Tool:** ${spec.transport.mcp.toolName ?? \"auto\"}`);\n\t\tlines.push(\"\");\n\t}\n\treturn lines.join(\"\\n\");\n}\n/**\n* Export a single spec as an actionable agent prompt.\n* Includes: instructions, full spec, expected output format.\n* Best for: Directly feeding to coding agents for implementation.\n*/\nfunction specToAgentPrompt(spec, options) {\n\tconst taskType = options?.taskType ?? \"implement\";\n\tconst m = spec.meta;\n\tconst lines = [];\n\tconst taskVerb = {\n\t\timplement: \"Implement\",\n\t\ttest: \"Write tests for\",\n\t\trefactor: \"Refactor\",\n\t\treview: \"Review\"\n\t}[taskType];\n\tlines.push(`# Task: ${taskVerb} ${m.name}.v${m.version}`);\n\tlines.push(\"\");\n\tlines.push(\"## Context\");\n\tlines.push(\"\");\n\tlines.push(`You are working on a ContractSpec-driven codebase. This spec defines a ${m.kind} operation.`);\n\tlines.push(\"\");\n\tlines.push(`**Goal:** ${m.goal}`);\n\tlines.push(\"\");\n\tlines.push(`**Background:** ${m.context}`);\n\tlines.push(\"\");\n\tlines.push(\"## Specification\");\n\tlines.push(\"\");\n\tlines.push(specToFullMarkdown(spec));\n\tlines.push(\"\");\n\tlines.push(\"## Instructions\");\n\tlines.push(\"\");\n\tif (taskType === \"implement\") {\n\t\tlines.push(\"Implement this specification following these requirements:\");\n\t\tlines.push(\"\");\n\t\tlines.push(\"1. **Type Safety**: Use TypeScript with strict typing. No `any` types.\");\n\t\tlines.push(\"2. **Input Validation**: Validate input against the schema before processing.\");\n\t\tlines.push(\"3. **Error Handling**: Implement all error cases defined in the spec.\");\n\t\tlines.push(\"4. **Events**: Emit events as specified in sideEffects.emits.\");\n\t\tlines.push(\"5. **Policy**: Respect auth, rate limits, and feature flags.\");\n\t\tlines.push(\"6. **Idempotency**: \" + (spec.policy.idempotent ? \"This operation MUST be idempotent.\" : \"This operation may have side effects.\"));\n\t\tlines.push(\"\");\n\t\tif (spec.policy.pii?.length) {\n\t\t\tlines.push(\"**PII Handling**: The following fields contain PII and must be handled carefully:\");\n\t\t\tfor (const field of spec.policy.pii) lines.push(`- ${field}`);\n\t\t\tlines.push(\"\");\n\t\t}\n\t} else if (taskType === \"test\") {\n\t\tlines.push(\"Write comprehensive tests for this specification:\");\n\t\tlines.push(\"\");\n\t\tlines.push(\"1. Test all acceptance scenarios defined in the spec.\");\n\t\tlines.push(\"2. Test all error cases with appropriate assertions.\");\n\t\tlines.push(\"3. Test edge cases and boundary conditions.\");\n\t\tlines.push(\"4. Verify events are emitted correctly.\");\n\t\tlines.push(\"5. Use descriptive test names following the pattern: \\\"should [behavior] when [condition]\\\"\");\n\t\tlines.push(\"\");\n\t} else if (taskType === \"refactor\") {\n\t\tlines.push(\"Refactor this implementation while preserving all behavior:\");\n\t\tlines.push(\"\");\n\t\tlines.push(\"1. Maintain compliance with the specification.\");\n\t\tlines.push(\"2. Improve code clarity and maintainability.\");\n\t\tlines.push(\"3. Reduce complexity where possible.\");\n\t\tlines.push(\"4. Ensure all existing tests still pass.\");\n\t\tlines.push(\"\");\n\t} else if (taskType === \"review\") {\n\t\tlines.push(\"Review this implementation against the specification:\");\n\t\tlines.push(\"\");\n\t\tlines.push(\"1. Verify input/output types match the schema.\");\n\t\tlines.push(\"2. Check all error cases are handled.\");\n\t\tlines.push(\"3. Verify events are emitted as specified.\");\n\t\tlines.push(\"4. Check policy compliance (auth, rate limits).\");\n\t\tlines.push(\"5. Report any deviations from the spec.\");\n\t\tlines.push(\"\");\n\t}\n\tif (options?.existingCode) {\n\t\tlines.push(\"## Existing Code\");\n\t\tlines.push(\"\");\n\t\tlines.push(\"```typescript\");\n\t\tlines.push(options.existingCode);\n\t\tlines.push(\"```\");\n\t\tlines.push(\"\");\n\t}\n\tlines.push(\"## Expected Output\");\n\tlines.push(\"\");\n\tif (taskType === \"implement\" || taskType === \"refactor\") {\n\t\tlines.push(\"Provide a complete TypeScript implementation. Include:\");\n\t\tlines.push(\"- Type definitions for input/output\");\n\t\tlines.push(\"- Handler function with proper error handling\");\n\t\tlines.push(\"- JSDoc comments explaining the implementation\");\n\t} else if (taskType === \"test\") lines.push(\"Provide a complete test file using the testing framework available (prefer Vitest).\");\n\telse if (taskType === \"review\") {\n\t\tlines.push(\"Provide a structured review with:\");\n\t\tlines.push(\"- Compliance status (pass/fail for each requirement)\");\n\t\tlines.push(\"- Issues found with severity (error/warning/info)\");\n\t\tlines.push(\"- Suggestions for improvement\");\n\t}\n\tlines.push(\"\");\n\treturn lines.join(\"\\n\");\n}\n/**\n* Export a feature module to markdown.\n* Includes all related specs, events, and presentations.\n*/\nfunction featureToMarkdown(feature, deps, options = {}) {\n\tconst opts = {\n\t\t...DEFAULT_FEATURE_OPTIONS,\n\t\t...options\n\t};\n\tconst m = feature.meta;\n\tconst lines = [];\n\tlines.push(`# Feature: ${m.title ?? m.key}`);\n\tlines.push(\"\");\n\tif (m.description) {\n\t\tlines.push(`> ${m.description}`);\n\t\tlines.push(\"\");\n\t}\n\tlines.push(\"## Overview\");\n\tlines.push(\"\");\n\tlines.push(`- **Key:** \\`${m.key}\\``);\n\tlines.push(`- **Stability:** ${m.stability}`);\n\tlines.push(`- **Owners:** ${m.owners.join(\", \")}`);\n\tif (m.tags?.length) lines.push(`- **Tags:** ${m.tags.join(\", \")}`);\n\tlines.push(\"\");\n\tif (feature.operations?.length) {\n\t\tlines.push(\"## Operations\");\n\t\tlines.push(\"\");\n\t\tlines.push(\"| Name | Version | Type |\");\n\t\tlines.push(\"|------|---------|------|\");\n\t\tfor (const op of feature.operations) {\n\t\t\tconst kind = (deps?.specs?.getSpec(op.name, op.version))?.meta.kind ?? \"unknown\";\n\t\t\tlines.push(`| ${op.name} | v${op.version} | ${kind} |`);\n\t\t}\n\t\tlines.push(\"\");\n\t\tif (opts.includeRelatedSpecs && deps?.specs) {\n\t\t\tlines.push(\"### Operation Details\");\n\t\t\tlines.push(\"\");\n\t\t\tfor (const op of feature.operations) {\n\t\t\t\tconst spec = deps.specs.getSpec(op.name, op.version);\n\t\t\t\tif (spec) {\n\t\t\t\t\tlines.push(`---`);\n\t\t\t\t\tlines.push(\"\");\n\t\t\t\t\tlines.push(specToFullMarkdown(spec, opts));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif (feature.events?.length) {\n\t\tlines.push(\"## Events\");\n\t\tlines.push(\"\");\n\t\tlines.push(\"| Name | Version |\");\n\t\tlines.push(\"|------|---------|\");\n\t\tfor (const evt of feature.events) lines.push(`| ${evt.name} | v${evt.version} |`);\n\t\tlines.push(\"\");\n\t}\n\tif (feature.presentations?.length) {\n\t\tlines.push(\"## Presentations\");\n\t\tlines.push(\"\");\n\t\tlines.push(\"| Name | Version |\");\n\t\tlines.push(\"|------|---------|\");\n\t\tfor (const pres of feature.presentations) lines.push(`| ${pres.name} | v${pres.version} |`);\n\t\tlines.push(\"\");\n\t\tif (opts.includeRelatedPresentations && deps?.presentations) {\n\t\t\tlines.push(\"### Presentation Details\");\n\t\t\tlines.push(\"\");\n\t\t\tfor (const pres of feature.presentations) {\n\t\t\t\tconst p = deps.presentations.get(pres.name, pres.version);\n\t\t\t\tif (p) {\n\t\t\t\t\tlines.push(`#### ${pres.name}.v${pres.version}`);\n\t\t\t\t\tlines.push(\"\");\n\t\t\t\t\tlines.push(`- **Kind:** ${p.content.kind ?? \"unknown\"}`);\n\t\t\t\t\tif (\"componentKey\" in p.content) lines.push(`- **Component:** ${p.content.componentKey}`);\n\t\t\t\t\tlines.push(\"\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif (feature.capabilities) {\n\t\tif (feature.capabilities.provides?.length) {\n\t\t\tlines.push(\"## Capabilities Provided\");\n\t\t\tlines.push(\"\");\n\t\t\tfor (const cap of feature.capabilities.provides) lines.push(`- \\`${cap.key}.v${cap.version}\\``);\n\t\t\tlines.push(\"\");\n\t\t}\n\t\tif (feature.capabilities.requires?.length) {\n\t\t\tlines.push(\"## Capabilities Required\");\n\t\t\tlines.push(\"\");\n\t\t\tfor (const cap of feature.capabilities.requires) lines.push(`- \\`${cap.key}\\`${cap.version ? `.v${cap.version}` : \"\"} (${cap.optional ? \"optional\" : \"required\"})`);\n\t\t\tlines.push(\"\");\n\t\t}\n\t}\n\treturn lines.join(\"\\n\");\n}\n/**\n* Export a presentation descriptor to markdown.\n*/\nfunction presentationToMarkdown(presentation) {\n\tconst m = presentation.meta;\n\tconst lines = [];\n\tlines.push(`# Presentation: ${m.name}.v${m.version}`);\n\tlines.push(\"\");\n\tif (m.description) {\n\t\tlines.push(`> ${m.description}`);\n\t\tlines.push(\"\");\n\t}\n\tlines.push(\"## Metadata\");\n\tlines.push(\"\");\n\tlines.push(`- **Name:** ${m.name}`);\n\tlines.push(`- **Version:** ${m.version}`);\n\tif (m.stability) lines.push(`- **Stability:** ${m.stability}`);\n\tif (m.owners?.length) lines.push(`- **Owners:** ${m.owners.join(\", \")}`);\n\tif (m.tags?.length) lines.push(`- **Tags:** ${m.tags.join(\", \")}`);\n\tlines.push(\"\");\n\tlines.push(\"## Source\");\n\tlines.push(\"\");\n\tlines.push(`- **Type:** ${presentation.source.type}`);\n\tif (presentation.source.type === \"component\") {\n\t\tlines.push(`- **Framework:** ${presentation.source.framework}`);\n\t\tlines.push(`- **Component Key:** ${presentation.source.componentKey}`);\n\t}\n\tlines.push(\"\");\n\tlines.push(\"## Supported Targets\");\n\tlines.push(\"\");\n\tfor (const target of presentation.targets) lines.push(`- ${target}`);\n\tlines.push(\"\");\n\tif (presentation.policy) {\n\t\tlines.push(\"## Policy\");\n\t\tlines.push(\"\");\n\t\tif (presentation.policy.flags?.length) lines.push(`- **Feature Flags:** ${presentation.policy.flags.join(\", \")}`);\n\t\tif (presentation.policy.pii?.length) lines.push(`- **PII Fields:** ${presentation.policy.pii.join(\", \")}`);\n\t\tlines.push(\"\");\n\t}\n\treturn lines.join(\"\\n\");\n}\n/**\n* Export an event spec to markdown.\n*/\nfunction eventToMarkdown(event) {\n\tconst lines = [];\n\tlines.push(`# Event: ${event.name}.v${event.version}`);\n\tlines.push(\"\");\n\tlines.push(\"## Metadata\");\n\tlines.push(\"\");\n\tlines.push(`- **Name:** ${event.name}`);\n\tlines.push(`- **Version:** ${event.version}`);\n\tif (event.description) lines.push(`- **Description:** ${event.description}`);\n\tlines.push(\"\");\n\tlines.push(\"## Payload Schema\");\n\tlines.push(\"\");\n\tlines.push(\"```json\");\n\ttry {\n\t\tconst zodSchema = event.payload.getZod();\n\t\tif (\"shape\" in zodSchema && zodSchema.shape) {\n\t\t\tconst shape = zodSchema.shape;\n\t\t\tconst fields = Object.keys(shape);\n\t\t\tlines.push(JSON.stringify({ fields }, null, 2));\n\t\t} else lines.push(\"// Payload schema available at runtime\");\n\t} catch {\n\t\tlines.push(\"// Schema details available at runtime\");\n\t}\n\tlines.push(\"```\");\n\tlines.push(\"\");\n\treturn lines.join(\"\\n\");\n}\n/**\n* Export a DocBlock to markdown (already markdown, but formatted consistently).\n*/\nfunction docBlockToMarkdown(doc) {\n\tconst lines = [];\n\tlines.push(`# ${doc.title}`);\n\tlines.push(\"\");\n\tif (doc.summary) {\n\t\tlines.push(`> ${doc.summary}`);\n\t\tlines.push(\"\");\n\t}\n\tlines.push(\"## Metadata\");\n\tlines.push(\"\");\n\tlines.push(`- **ID:** ${doc.id}`);\n\tlines.push(`- **Kind:** ${doc.kind ?? \"reference\"}`);\n\tlines.push(`- **Visibility:** ${doc.visibility ?? \"public\"}`);\n\tif (doc.tags?.length) lines.push(`- **Tags:** ${doc.tags.join(\", \")}`);\n\tif (doc.owners?.length) lines.push(`- **Owners:** ${doc.owners.join(\", \")}`);\n\tif (doc.domain) lines.push(`- **Domain:** ${doc.domain}`);\n\tlines.push(\"\");\n\tlines.push(\"## Content\");\n\tlines.push(\"\");\n\tlines.push(doc.body);\n\tlines.push(\"\");\n\tif (doc.links?.length) {\n\t\tlines.push(\"## Related Links\");\n\t\tlines.push(\"\");\n\t\tfor (const link of doc.links) lines.push(`- [${link.label}](${link.href})`);\n\t\tlines.push(\"\");\n\t}\n\treturn lines.join(\"\\n\");\n}\n/**\n* Export a spec with a specific format.\n* Convenience function that wraps the format-specific functions.\n*/\nfunction exportSpec(spec, options = {}) {\n\tconst format = options.format ?? \"full\";\n\tlet markdown;\n\tswitch (format) {\n\t\tcase \"context\":\n\t\t\tmarkdown = specToContextMarkdown(spec);\n\t\t\tbreak;\n\t\tcase \"prompt\":\n\t\t\tmarkdown = specToAgentPrompt(spec);\n\t\t\tbreak;\n\t\tcase \"full\":\n\t\tdefault:\n\t\t\tmarkdown = specToFullMarkdown(spec, options);\n\t\t\tbreak;\n\t}\n\treturn {\n\t\tspec,\n\t\tmarkdown,\n\t\tformat,\n\t\tmeta: {\n\t\t\tspecName: spec.meta.name,\n\t\t\tspecVersion: spec.meta.version,\n\t\t\texportedAt: (/* @__PURE__ */ new Date()).toISOString(),\n\t\t\twordCount: markdown.split(/\\s+/).length\n\t\t}\n\t};\n}\n/**\n* Export a feature with a specific format.\n*/\nfunction exportFeature(feature, deps, options = {}) {\n\tconst format = options.format ?? \"full\";\n\treturn {\n\t\tfeature,\n\t\tmarkdown: featureToMarkdown(feature, deps, options),\n\t\tformat,\n\t\tincludedSpecs: feature.operations?.map((o) => `${o.name}.v${o.version}`) ?? [],\n\t\tincludedEvents: feature.events?.map((e) => `${e.name}.v${e.version}`) ?? [],\n\t\tincludedPresentations: feature.presentations?.map((p) => `${p.name}.v${p.version}`) ?? []\n\t};\n}\n\n//#endregion\nexport { docBlockToMarkdown, eventToMarkdown, exportFeature, exportSpec, featureToMarkdown, presentationToMarkdown, specToAgentPrompt, specToContextMarkdown, specToFullMarkdown };"],"mappings":";;;AAIA,MAAM,uBAAuB;CAC5B,QAAQ;CACR,gBAAgB;CAChB,kBAAkB;CAClB,iBAAiB;CACjB,eAAe;CACf,oBAAoB;CACpB;AACD,MAAM,0BAA0B;CAC/B,GAAG;CACH,qBAAqB;CACrB,sBAAsB;CACtB,6BAA6B;CAC7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onboarding-base.js","names":[],"sources":["../../../../contracts/dist/onboarding-base.js"],"sourcesContent":["import { E5, x8 } from \"./schema/dist/index.js\";\nimport { defineCommand, defineQuery } from \"./spec.js\";\nimport { OwnersEnum, StabilityEnum } from \"./ownership.js\";\n\n//#region src/onboarding-base.ts\n/**\n* Shared base contracts for onboarding flows across verticals.\n* These operations are reusable for any app that needs multi-step onboarding with draft persistence.\n*/\n/** Save/update onboarding draft (auto-save during flow) */\nconst SaveOnboardingDraftInput = new x8({\n\tname: \"SaveOnboardingDraftInput\",\n\tdescription: \"Input for saving onboarding draft\",\n\tfields: { data: {\n\t\ttype: E5.JSON(),\n\t\tisOptional: false\n\t} }\n});\nconst SaveOnboardingDraftOutput = new x8({\n\tname: \"SaveOnboardingDraftOutput\",\n\tdescription: \"Output for saving onboarding draft\",\n\tfields: {\n\t\tid: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: false\n\t\t},\n\t\torganizationId: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: false\n\t\t}\n\t}\n});\nconst SaveOnboardingDraftBaseSpec = defineCommand({\n\tmeta: {\n\t\tname: \"base.onboarding.saveDraft\",\n\t\tversion: 1,\n\t\tstability: StabilityEnum.Beta,\n\t\towners: [OwnersEnum.PlatformSigil],\n\t\ttags: [\"onboarding\", \"draft\"],\n\t\tdescription: \"Save or update onboarding draft for active organization\",\n\t\tgoal: \"Persist onboarding progress incrementally for resumption and safety\",\n\t\tcontext: \"Auto-saves every few seconds during onboarding; enables users to leave and resume\"\n\t},\n\tio: {\n\t\tinput: SaveOnboardingDraftInput,\n\t\toutput: SaveOnboardingDraftOutput\n\t},\n\tpolicy: {\n\t\tauth: \"user\",\n\t\tescalate: null\n\t},\n\ttransport: {\n\t\tgql: { field: \"saveOnboardingDraft\" },\n\t\trest: { method: \"POST\" }\n\t}\n});\n/** Get current onboarding draft (on mount/restore) */\nconst GetOnboardingDraftOutput = new x8({\n\tname: \"GetOnboardingDraftOutput\",\n\tdescription: \"Onboarding draft payload\",\n\tfields: {\n\t\tid: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: true\n\t\t},\n\t\torganizationId: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: true\n\t\t},\n\t\tdata: {\n\t\t\ttype: E5.JSON(),\n\t\t\tisOptional: true\n\t\t},\n\t\tcreatedAt: {\n\t\t\ttype: E5.DateTime(),\n\t\t\tisOptional: true\n\t\t},\n\t\tupdatedAt: {\n\t\t\ttype: E5.DateTime(),\n\t\t\tisOptional: true\n\t\t}\n\t}\n});\nconst GetOnboardingDraftBaseSpec = defineQuery({\n\tmeta: {\n\t\tname: \"base.onboarding.getDraft\",\n\t\tversion: 1,\n\t\tstability: StabilityEnum.Beta,\n\t\towners: [OwnersEnum.PlatformSigil],\n\t\ttags: [\"onboarding\", \"draft\"],\n\t\tdescription: \"Get onboarding draft for active organization\",\n\t\tgoal: \"Retrieve saved onboarding progress\",\n\t\tcontext: \"Called on mount to restore in-progress onboarding\"\n\t},\n\tio: {\n\t\tinput: null,\n\t\toutput: GetOnboardingDraftOutput\n\t},\n\tpolicy: {\n\t\tauth: \"user\",\n\t\tescalate: null\n\t},\n\ttransport: {\n\t\tgql: { field: \"getOnboardingDraft\" },\n\t\trest: { method: \"GET\" }\n\t}\n});\n/** Delete onboarding draft (cleanup after completion or cancel) */\nconst DeleteOnboardingDraftOutput = new x8({\n\tname: \"DeleteOnboardingDraftOutput\",\n\tdescription: \"Result of delete operation\",\n\tfields: { ok: {\n\t\ttype: E5.Boolean(),\n\t\tisOptional: false\n\t} }\n});\nconst DeleteOnboardingDraftBaseSpec = defineCommand({\n\tmeta: {\n\t\tname: \"base.onboarding.deleteDraft\",\n\t\tversion: 1,\n\t\tstability: StabilityEnum.Beta,\n\t\towners: [OwnersEnum.PlatformSigil],\n\t\ttags: [\"onboarding\", \"draft\"],\n\t\tdescription: \"Delete onboarding draft for active organization\",\n\t\tgoal: \"Clear draft after completion or if user wants to restart\",\n\t\tcontext: \"Called after successful onboarding or explicit user reset\"\n\t},\n\tio: {\n\t\tinput: null,\n\t\toutput: DeleteOnboardingDraftOutput\n\t},\n\tpolicy: {\n\t\tauth: \"user\",\n\t\tescalate: null\n\t},\n\ttransport: {\n\t\tgql: { field: \"deleteOnboardingDraft\" },\n\t\trest: { method: \"POST\" }\n\t}\n});\n/** Complete onboarding (final submit, creates entities) */\nconst CompleteOnboardingBaseInput = new x8({\n\tname: \"CompleteOnboardingBaseInput\",\n\tdescription: \"Input for completing onboarding\",\n\tfields: { data: {\n\t\ttype: E5.JSON(),\n\t\tisOptional: false\n\t} }\n});\nconst CompleteOnboardingBaseOutput = new x8({\n\tname: \"CompleteOnboardingBaseOutput\",\n\tdescription: \"Result of onboarding completion\",\n\tfields: {\n\t\tsuccess: {\n\t\t\ttype: E5.Boolean(),\n\t\t\tisOptional: false\n\t\t},\n\t\tuserId: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: true\n\t\t},\n\t\torganizationId: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: true\n\t\t}\n\t}\n});\nconst CompleteOnboardingBaseSpec = defineCommand({\n\tmeta: {\n\t\tname: \"base.onboarding.complete\",\n\t\tversion: 1,\n\t\tstability: StabilityEnum.Beta,\n\t\towners: [OwnersEnum.PlatformSigil],\n\t\ttags: [\"onboarding\"],\n\t\tdescription: \"Complete onboarding and finalize user/organization setup\",\n\t\tgoal: \"Transition from draft to active profile\",\n\t\tcontext: \"Validates all required fields, creates/updates entities, marks onboarding complete\"\n\t},\n\tio: {\n\t\tinput: CompleteOnboardingBaseInput,\n\t\toutput: CompleteOnboardingBaseOutput\n\t},\n\tpolicy: {\n\t\tauth: \"user\",\n\t\tescalate: null\n\t},\n\ttransport: {\n\t\tgql: { field: \"completeOnboarding\" },\n\t\trest: { method: \"POST\" }\n\t}\n});\n\n//#endregion\nexport { CompleteOnboardingBaseInput, CompleteOnboardingBaseOutput, CompleteOnboardingBaseSpec, DeleteOnboardingDraftBaseSpec, DeleteOnboardingDraftOutput, GetOnboardingDraftBaseSpec, GetOnboardingDraftOutput, SaveOnboardingDraftBaseSpec, SaveOnboardingDraftInput, SaveOnboardingDraftOutput }
|
|
1
|
+
{"version":3,"file":"onboarding-base.js","names":[],"sources":["../../../../contracts/dist/onboarding-base.js"],"sourcesContent":["import { E5, x8 } from \"./schema/dist/index.js\";\nimport { defineCommand, defineQuery } from \"./spec.js\";\nimport { OwnersEnum, StabilityEnum } from \"./ownership.js\";\n\n//#region src/onboarding-base.ts\n/**\n* Shared base contracts for onboarding flows across verticals.\n* These operations are reusable for any app that needs multi-step onboarding with draft persistence.\n*/\n/** Save/update onboarding draft (auto-save during flow) */\nconst SaveOnboardingDraftInput = new x8({\n\tname: \"SaveOnboardingDraftInput\",\n\tdescription: \"Input for saving onboarding draft\",\n\tfields: { data: {\n\t\ttype: E5.JSON(),\n\t\tisOptional: false\n\t} }\n});\nconst SaveOnboardingDraftOutput = new x8({\n\tname: \"SaveOnboardingDraftOutput\",\n\tdescription: \"Output for saving onboarding draft\",\n\tfields: {\n\t\tid: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: false\n\t\t},\n\t\torganizationId: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: false\n\t\t}\n\t}\n});\nconst SaveOnboardingDraftBaseSpec = defineCommand({\n\tmeta: {\n\t\tname: \"base.onboarding.saveDraft\",\n\t\tversion: 1,\n\t\tstability: StabilityEnum.Beta,\n\t\towners: [OwnersEnum.PlatformSigil],\n\t\ttags: [\"onboarding\", \"draft\"],\n\t\tdescription: \"Save or update onboarding draft for active organization\",\n\t\tgoal: \"Persist onboarding progress incrementally for resumption and safety\",\n\t\tcontext: \"Auto-saves every few seconds during onboarding; enables users to leave and resume\"\n\t},\n\tio: {\n\t\tinput: SaveOnboardingDraftInput,\n\t\toutput: SaveOnboardingDraftOutput\n\t},\n\tpolicy: {\n\t\tauth: \"user\",\n\t\tescalate: null\n\t},\n\ttransport: {\n\t\tgql: { field: \"saveOnboardingDraft\" },\n\t\trest: { method: \"POST\" }\n\t}\n});\n/** Get current onboarding draft (on mount/restore) */\nconst GetOnboardingDraftOutput = new x8({\n\tname: \"GetOnboardingDraftOutput\",\n\tdescription: \"Onboarding draft payload\",\n\tfields: {\n\t\tid: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: true\n\t\t},\n\t\torganizationId: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: true\n\t\t},\n\t\tdata: {\n\t\t\ttype: E5.JSON(),\n\t\t\tisOptional: true\n\t\t},\n\t\tcreatedAt: {\n\t\t\ttype: E5.DateTime(),\n\t\t\tisOptional: true\n\t\t},\n\t\tupdatedAt: {\n\t\t\ttype: E5.DateTime(),\n\t\t\tisOptional: true\n\t\t}\n\t}\n});\nconst GetOnboardingDraftBaseSpec = defineQuery({\n\tmeta: {\n\t\tname: \"base.onboarding.getDraft\",\n\t\tversion: 1,\n\t\tstability: StabilityEnum.Beta,\n\t\towners: [OwnersEnum.PlatformSigil],\n\t\ttags: [\"onboarding\", \"draft\"],\n\t\tdescription: \"Get onboarding draft for active organization\",\n\t\tgoal: \"Retrieve saved onboarding progress\",\n\t\tcontext: \"Called on mount to restore in-progress onboarding\"\n\t},\n\tio: {\n\t\tinput: null,\n\t\toutput: GetOnboardingDraftOutput\n\t},\n\tpolicy: {\n\t\tauth: \"user\",\n\t\tescalate: null\n\t},\n\ttransport: {\n\t\tgql: { field: \"getOnboardingDraft\" },\n\t\trest: { method: \"GET\" }\n\t}\n});\n/** Delete onboarding draft (cleanup after completion or cancel) */\nconst DeleteOnboardingDraftOutput = new x8({\n\tname: \"DeleteOnboardingDraftOutput\",\n\tdescription: \"Result of delete operation\",\n\tfields: { ok: {\n\t\ttype: E5.Boolean(),\n\t\tisOptional: false\n\t} }\n});\nconst DeleteOnboardingDraftBaseSpec = defineCommand({\n\tmeta: {\n\t\tname: \"base.onboarding.deleteDraft\",\n\t\tversion: 1,\n\t\tstability: StabilityEnum.Beta,\n\t\towners: [OwnersEnum.PlatformSigil],\n\t\ttags: [\"onboarding\", \"draft\"],\n\t\tdescription: \"Delete onboarding draft for active organization\",\n\t\tgoal: \"Clear draft after completion or if user wants to restart\",\n\t\tcontext: \"Called after successful onboarding or explicit user reset\"\n\t},\n\tio: {\n\t\tinput: null,\n\t\toutput: DeleteOnboardingDraftOutput\n\t},\n\tpolicy: {\n\t\tauth: \"user\",\n\t\tescalate: null\n\t},\n\ttransport: {\n\t\tgql: { field: \"deleteOnboardingDraft\" },\n\t\trest: { method: \"POST\" }\n\t}\n});\n/** Complete onboarding (final submit, creates entities) */\nconst CompleteOnboardingBaseInput = new x8({\n\tname: \"CompleteOnboardingBaseInput\",\n\tdescription: \"Input for completing onboarding\",\n\tfields: { data: {\n\t\ttype: E5.JSON(),\n\t\tisOptional: false\n\t} }\n});\nconst CompleteOnboardingBaseOutput = new x8({\n\tname: \"CompleteOnboardingBaseOutput\",\n\tdescription: \"Result of onboarding completion\",\n\tfields: {\n\t\tsuccess: {\n\t\t\ttype: E5.Boolean(),\n\t\t\tisOptional: false\n\t\t},\n\t\tuserId: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: true\n\t\t},\n\t\torganizationId: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: true\n\t\t}\n\t}\n});\nconst CompleteOnboardingBaseSpec = defineCommand({\n\tmeta: {\n\t\tname: \"base.onboarding.complete\",\n\t\tversion: 1,\n\t\tstability: StabilityEnum.Beta,\n\t\towners: [OwnersEnum.PlatformSigil],\n\t\ttags: [\"onboarding\"],\n\t\tdescription: \"Complete onboarding and finalize user/organization setup\",\n\t\tgoal: \"Transition from draft to active profile\",\n\t\tcontext: \"Validates all required fields, creates/updates entities, marks onboarding complete\"\n\t},\n\tio: {\n\t\tinput: CompleteOnboardingBaseInput,\n\t\toutput: CompleteOnboardingBaseOutput\n\t},\n\tpolicy: {\n\t\tauth: \"user\",\n\t\tescalate: null\n\t},\n\ttransport: {\n\t\tgql: { field: \"completeOnboarding\" },\n\t\trest: { method: \"POST\" }\n\t}\n});\n\n//#endregion\nexport { CompleteOnboardingBaseInput, CompleteOnboardingBaseOutput, CompleteOnboardingBaseSpec, DeleteOnboardingDraftBaseSpec, DeleteOnboardingDraftOutput, GetOnboardingDraftBaseSpec, GetOnboardingDraftOutput, SaveOnboardingDraftBaseSpec, SaveOnboardingDraftInput, SaveOnboardingDraftOutput };"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ownership.js","names":[],"sources":["../../../../contracts/dist/ownership.js"],"sourcesContent":["//#region src/ownership.ts\nconst StabilityEnum = {\n\tIdea: \"idea\",\n\tInCreation: \"in_creation\",\n\tExperimental: \"experimental\",\n\tBeta: \"beta\",\n\tStable: \"stable\",\n\tDeprecated: \"deprecated\"\n};\nconst OwnersEnum = {\n\tProductColiving: \"product.coliving\",\n\tProductStrit: \"product.strit\",\n\tProductArtisanos: \"product.artisanos\",\n\tPlatformSigil: \"platform.sigil\",\n\tPlatformMarketplace: \"platform.marketplace\",\n\tPlatformContent: \"platform.content\",\n\tPlatformFeatureFlags: \"platform.featureflags\",\n\tPlatformFinance: \"platform.finance\"\n};\nconst Owners = OwnersEnum;\nconst TagsEnum = {\n\tSpots: \"spots\",\n\tCollectivity: \"collectivity\",\n\tMarketplace: \"marketplace\",\n\tSellers: \"sellers\",\n\tAuth: \"auth\",\n\tLogin: \"login\",\n\tSignup: \"signup\",\n\tGuide: \"guide\",\n\tDocs: \"docs\",\n\tI18n: \"i18n\",\n\tIncident: \"incident\",\n\tAutomation: \"automation\",\n\tHygiene: \"hygiene\"\n};\nconst Tags = TagsEnum;\n\n//#endregion\nexport { Owners, OwnersEnum, StabilityEnum, Tags, TagsEnum }
|
|
1
|
+
{"version":3,"file":"ownership.js","names":[],"sources":["../../../../contracts/dist/ownership.js"],"sourcesContent":["//#region src/ownership.ts\nconst StabilityEnum = {\n\tIdea: \"idea\",\n\tInCreation: \"in_creation\",\n\tExperimental: \"experimental\",\n\tBeta: \"beta\",\n\tStable: \"stable\",\n\tDeprecated: \"deprecated\"\n};\nconst OwnersEnum = {\n\tProductColiving: \"product.coliving\",\n\tProductStrit: \"product.strit\",\n\tProductArtisanos: \"product.artisanos\",\n\tPlatformSigil: \"platform.sigil\",\n\tPlatformMarketplace: \"platform.marketplace\",\n\tPlatformContent: \"platform.content\",\n\tPlatformFeatureFlags: \"platform.featureflags\",\n\tPlatformFinance: \"platform.finance\"\n};\nconst Owners = OwnersEnum;\nconst TagsEnum = {\n\tSpots: \"spots\",\n\tCollectivity: \"collectivity\",\n\tMarketplace: \"marketplace\",\n\tSellers: \"sellers\",\n\tAuth: \"auth\",\n\tLogin: \"login\",\n\tSignup: \"signup\",\n\tGuide: \"guide\",\n\tDocs: \"docs\",\n\tI18n: \"i18n\",\n\tIncident: \"incident\",\n\tAutomation: \"automation\",\n\tHygiene: \"hygiene\"\n};\nconst Tags = TagsEnum;\n\n//#endregion\nexport { Owners, OwnersEnum, StabilityEnum, Tags, TagsEnum };"],"mappings":";AACA,MAAM,gBAAgB;CACrB,MAAM;CACN,YAAY;CACZ,cAAc;CACd,MAAM;CACN,QAAQ;CACR,YAAY;CACZ;AACD,MAAM,aAAa;CAClB,iBAAiB;CACjB,cAAc;CACd,kBAAkB;CAClB,eAAe;CACf,qBAAqB;CACrB,iBAAiB;CACjB,sBAAsB;CACtB,iBAAiB;CACjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentations.v2.js","names":[],"sources":["../../../../contracts/dist/presentations.v2.js"],"sourcesContent":["import { schemaToMarkdown } from \"./schema-to-markdown.js\";\nimport React from \"react\";\nimport TurndownService from \"turndown\";\n\n//#region src/presentations.v2.ts\n/**\n* Pluggable transform engine that renders descriptors to various targets\n* and runs validators (e.g., basic metadata checks, PII redaction policies).\n*/\nconst turndown = new TurndownService();\nfunction renderTextNode(node) {\n\tconst text = node.text ?? \"\";\n\tif (!node.marks || node.marks.length === 0) return text;\n\treturn node.marks.reduce((acc, mark) => {\n\t\tswitch (mark.type) {\n\t\t\tcase \"bold\": return `**${acc}**`;\n\t\t\tcase \"italic\": return `*${acc}*`;\n\t\t\tcase \"underline\": return `__${acc}__`;\n\t\t\tcase \"strike\": return `~~${acc}~~`;\n\t\t\tcase \"code\": return `\\`${acc}\\``;\n\t\t\tcase \"link\": {\n\t\t\t\tconst href = mark.attrs?.href ?? \"\";\n\t\t\t\treturn href ? `[${acc}](${href})` : acc;\n\t\t\t}\n\t\t\tdefault: return acc;\n\t\t}\n\t}, text);\n}\nfunction renderInline(nodes) {\n\tif (!nodes?.length) return \"\";\n\treturn nodes.map((child) => renderNode(child)).join(\"\");\n}\nfunction renderList(nodes, ordered = false) {\n\tif (!nodes?.length) return \"\";\n\tlet counter = 1;\n\treturn nodes.map((item) => {\n\t\tconst body = renderInline(item.content ?? []);\n\t\tif (!body) return \"\";\n\t\treturn `${ordered ? `${counter++}. ` : \"- \"}${body}`;\n\t}).filter(Boolean).join(\"\\n\");\n}\nfunction renderNode(node) {\n\tswitch (node.type) {\n\t\tcase \"doc\": return renderInline(node.content);\n\t\tcase \"paragraph\": {\n\t\t\tconst text = renderInline(node.content);\n\t\t\treturn text.trim().length ? text : \"\";\n\t\t}\n\t\tcase \"heading\": {\n\t\t\tconst level = Math.min(Math.max(node.attrs?.level ?? 1, 1), 6);\n\t\t\treturn `${\"#\".repeat(level)} ${renderInline(node.content)}`.trim();\n\t\t}\n\t\tcase \"bullet_list\": return renderList(node.content, false);\n\t\tcase \"ordered_list\": return renderList(node.content, true);\n\t\tcase \"list_item\": return renderInline(node.content);\n\t\tcase \"blockquote\": return renderInline(node.content).split(\"\\n\").map((line) => `> ${line}`).join(\"\\n\");\n\t\tcase \"code_block\": {\n\t\t\tconst body = renderInline(node.content);\n\t\t\treturn body ? `\\`\\`\\`\\n${body}\\n\\`\\`\\`` : \"\";\n\t\t}\n\t\tcase \"horizontal_rule\": return \"---\";\n\t\tcase \"hard_break\": return \"\\n\";\n\t\tcase \"text\": return renderTextNode(node);\n\t\tdefault:\n\t\t\tif (node.text) return renderTextNode(node);\n\t\t\treturn \"\";\n\t}\n}\nfunction blockNoteToMarkdown(docJson) {\n\tif (typeof docJson === \"string\") return docJson;\n\tif (docJson && typeof docJson === \"object\" && \"html\" in docJson) {\n\t\tconst html = String(docJson.html);\n\t\treturn turndown.turndown(html);\n\t}\n\tconst root = docJson;\n\tif (root?.type === \"doc\" || root?.content) return (root.content ?? []).map((n) => renderNode(n)).filter(Boolean).join(\"\\n\\n\").trim();\n\ttry {\n\t\treturn JSON.stringify(docJson, null, 2);\n\t} catch {\n\t\treturn String(docJson);\n\t}\n}\nvar TransformEngine = class {\n\trenderers = /* @__PURE__ */ new Map();\n\tvalidators = [];\n\tregister(renderer) {\n\t\tconst arr = this.renderers.get(renderer.target) ?? [];\n\t\tarr.push(renderer);\n\t\tthis.renderers.set(renderer.target, arr);\n\t\treturn this;\n\t}\n\t/**\n\t* Register a renderer that will be tried BEFORE existing renderers for the same target.\n\t* Useful for custom renderers that should take priority over default ones.\n\t*/\n\tprependRegister(renderer) {\n\t\tconst arr = this.renderers.get(renderer.target) ?? [];\n\t\tarr.unshift(renderer);\n\t\tthis.renderers.set(renderer.target, arr);\n\t\treturn this;\n\t}\n\taddValidator(v) {\n\t\tthis.validators.push(v);\n\t\treturn this;\n\t}\n\tasync render(target, desc, ctx) {\n\t\tif (!desc.targets.includes(target)) throw new Error(`Target ${target} not declared for ${desc.meta.name}.v${desc.meta.version}`);\n\t\tfor (const v of this.validators) await v.validate(desc, target, ctx);\n\t\tconst arr = this.renderers.get(target) ?? [];\n\t\tfor (const r of arr) try {\n\t\t\treturn await r.render(desc, ctx);\n\t\t} catch (_e) {}\n\t\tthrow new Error(`No renderer available for ${target}`);\n\t}\n};\n/** Create a TransformEngine instance with default markdown/json/xml renderers. */\nfunction createDefaultTransformEngine() {\n\tconst engine = new TransformEngine();\n\tconst applyPii = (desc, obj) => {\n\t\tconst clone = JSON.parse(JSON.stringify(obj));\n\t\tconst paths = desc.policy?.pii ?? [];\n\t\tconst setAtPath = (root, path) => {\n\t\t\tconst segs = path.replace(/^\\//, \"\").replace(/\\[(\\d+)\\]/g, \".$1\").split(\".\").filter(Boolean);\n\t\t\tlet cur = root;\n\t\t\tfor (let i = 0; i < segs.length - 1; i++) {\n\t\t\t\tconst k = segs[i];\n\t\t\t\tif (cur && typeof cur === \"object\" && k in cur) cur = cur[k];\n\t\t\t\telse return;\n\t\t\t}\n\t\t\tconst last = segs[segs.length - 1];\n\t\t\tif (cur && typeof cur === \"object\" && last && last in cur) cur[last] = \"[REDACTED]\";\n\t\t};\n\t\tfor (const p of paths) setAtPath(clone, p);\n\t\treturn clone;\n\t};\n\tengine.register({\n\t\ttarget: \"markdown\",\n\t\tasync render(desc, ctx) {\n\t\t\tlet data = ctx?.data;\n\t\t\tif (!data && ctx?.fetchData) data = await ctx.fetchData();\n\t\t\tif (desc.source.type === \"component\" && desc.source.props && data !== void 0) {\n\t\t\t\tconst isArray = Array.isArray(data);\n\t\t\t\tconst isSimpleObject = !isArray && typeof data === \"object\" && data !== null && !Object.values(data).some((v) => Array.isArray(v) || typeof v === \"object\" && v !== null);\n\t\t\t\tif (isArray || isSimpleObject) return {\n\t\t\t\t\tmimeType: \"text/markdown\",\n\t\t\t\t\tbody: schemaToMarkdown(desc.source.props, data, {\n\t\t\t\t\t\ttitle: desc.meta.description ?? desc.meta.name,\n\t\t\t\t\t\tdescription: `${desc.meta.name} v${desc.meta.version}`\n\t\t\t\t\t})\n\t\t\t\t};\n\t\t\t\tthrow new Error(`Complex data structure for ${desc.meta.name} - expecting custom renderer`);\n\t\t\t}\n\t\t\tif (desc.source.type === \"blocknotejs\") {\n\t\t\t\tconst redacted = applyPii(desc, { text: blockNoteToMarkdown(desc.source.docJson) });\n\t\t\t\treturn {\n\t\t\t\t\tmimeType: \"text/markdown\",\n\t\t\t\t\tbody: String(redacted.text)\n\t\t\t\t};\n\t\t\t}\n\t\t\tif (desc.source.type === \"component\" && data !== void 0) throw new Error(`No schema (source.props) available for ${desc.meta.name} - expecting custom renderer`);\n\t\t\tif (desc.source.type === \"component\") return {\n\t\t\t\tmimeType: \"text/markdown\",\n\t\t\t\tbody: `${`# ${desc.meta.name} v${desc.meta.version}`}${desc.meta.description ? `\\n\\n${desc.meta.description}` : \"\"}${desc.meta.tags && desc.meta.tags.length ? `\\n\\nTags: ${desc.meta.tags.join(\", \")}` : \"\"}${desc.meta.owners && desc.meta.owners.length ? `\\n\\nOwners: ${desc.meta.owners.join(\", \")}` : \"\"}${`\\n\\nComponent: \\`${desc.source.componentKey}\\``}${desc.policy?.pii?.length ? `\\n\\nRedacted paths: ${desc.policy.pii.map((p) => `\\`${p}\\``).join(\", \")}` : \"\"}`\n\t\t\t};\n\t\t\tthrow new Error(\"unsupported\");\n\t\t}\n\t});\n\tengine.register({\n\t\ttarget: \"application/json\",\n\t\tasync render(desc) {\n\t\t\tconst payload = applyPii(desc, {\n\t\t\t\tmeta: desc.meta,\n\t\t\t\tsource: desc.source\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tmimeType: \"application/json\",\n\t\t\t\tbody: JSON.stringify(payload, null, 2)\n\t\t\t};\n\t\t}\n\t});\n\tengine.register({\n\t\ttarget: \"application/xml\",\n\t\tasync render(desc) {\n\t\t\tconst json = applyPii(desc, {\n\t\t\t\tmeta: desc.meta,\n\t\t\t\tsource: desc.source\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tmimeType: \"application/xml\",\n\t\t\t\tbody: `<presentation name=\"${desc.meta.name}\" version=\"${desc.meta.version}\"><json>${encodeURIComponent(JSON.stringify(json))}</json></presentation>`\n\t\t\t};\n\t\t}\n\t});\n\treturn engine;\n}\n/** Register a default React target renderer that returns a serializable descriptor. */\nfunction registerDefaultReactRenderer(engine) {\n\tengine.register({\n\t\ttarget: \"react\",\n\t\tasync render(desc) {\n\t\t\tif (desc.source.type === \"component\") {\n\t\t\t\tconst props = desc.source.props ? desc.source.props.getZod().safeParse({}).success ? {} : void 0 : void 0;\n\t\t\t\treturn {\n\t\t\t\t\tkind: \"react_component\",\n\t\t\t\t\tcomponentKey: desc.source.componentKey,\n\t\t\t\t\tprops\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tkind: \"blocknotejs\",\n\t\t\t\tdocJson: desc.source.docJson,\n\t\t\t\tblockConfig: desc.source.blockConfig\n\t\t\t};\n\t\t}\n\t});\n\treturn engine;\n}\n/**\n* Add basic validators (e.g., meta.description presence) to the engine.\n*/\nfunction registerBasicValidation(engine) {\n\tengine.addValidator({ validate(desc) {\n\t\tif (!desc.meta.description || desc.meta.description.length < 3) throw new Error(`Presentation ${desc.meta.name}.v${desc.meta.version} missing meta.description`);\n\t} });\n\treturn engine;\n}\n/**\n* Register a React-to-markdown renderer that renders React components to HTML\n* and converts them to markdown using turndown.\n* This renderer takes priority over the default metadata-only renderer.\n*/\nfunction registerReactToMarkdownRenderer(engine, componentMap) {\n\tconst turndownService = new TurndownService({\n\t\theadingStyle: \"atx\",\n\t\tcodeBlockStyle: \"fenced\",\n\t\tbulletListMarker: \"-\"\n\t});\n\tturndownService.addRule(\"link\", {\n\t\tfilter: \"a\",\n\t\treplacement: (content, node) => {\n\t\t\tconst href = node.href;\n\t\t\tif (href && content) return `[${content}](${href})`;\n\t\t\treturn content || \"\";\n\t\t}\n\t});\n\tengine.prependRegister({\n\t\ttarget: \"markdown\",\n\t\tasync render(desc, ctx) {\n\t\t\tif (desc.source.type !== \"component\") throw new Error(\"React-to-markdown renderer only handles component presentations\");\n\t\t\tconst { renderToStaticMarkup } = await import(\"react-dom/server\");\n\t\t\tconst Component = componentMap[desc.source.componentKey];\n\t\t\tif (!Component) throw new Error(`Component ${desc.source.componentKey} not found in componentMap`);\n\t\t\tlet html;\n\t\t\ttry {\n\t\t\t\thtml = renderToStaticMarkup(React.createElement(Component, desc.source.props ? {} : void 0));\n\t\t\t} catch (error) {\n\t\t\t\tthrow new Error(`Failed to render component ${desc.source.componentKey}: ${error instanceof Error ? error.message : \"Unknown error\"}`);\n\t\t\t}\n\t\t\tlet markdown;\n\t\t\ttry {\n\t\t\t\tmarkdown = turndownService.turndown(html);\n\t\t\t} catch (error) {\n\t\t\t\tthrow new Error(`Failed to convert HTML to markdown: ${error instanceof Error ? error.message : \"Unknown error\"}`);\n\t\t\t}\n\t\t\tif (desc.policy?.pii && desc.policy.pii.length > 0) return {\n\t\t\t\tmimeType: \"text/markdown\",\n\t\t\t\tbody: markdown.replace(/\\[REDACTED\\]/g, \"[REDACTED]\")\n\t\t\t};\n\t\t\treturn {\n\t\t\t\tmimeType: \"text/markdown\",\n\t\t\t\tbody: markdown\n\t\t\t};\n\t\t}\n\t});\n\treturn engine;\n}\n\n//#endregion\nexport { TransformEngine, createDefaultTransformEngine, registerBasicValidation, registerDefaultReactRenderer, registerReactToMarkdownRenderer };\n//# sourceMappingURL=presentations.v2.js.map"],"mappings":";;;;;;;;AASA,MAAM,WAAW,IAAI,iBAAiB"}
|
|
1
|
+
{"version":3,"file":"presentations.v2.js","names":[],"sources":["../../../../contracts/dist/presentations.v2.js"],"sourcesContent":["import { schemaToMarkdown } from \"./schema-to-markdown.js\";\nimport React from \"react\";\nimport TurndownService from \"turndown\";\n\n//#region src/presentations.v2.ts\n/**\n* Pluggable transform engine that renders descriptors to various targets\n* and runs validators (e.g., basic metadata checks, PII redaction policies).\n*/\nconst turndown = new TurndownService();\nfunction renderTextNode(node) {\n\tconst text = node.text ?? \"\";\n\tif (!node.marks || node.marks.length === 0) return text;\n\treturn node.marks.reduce((acc, mark) => {\n\t\tswitch (mark.type) {\n\t\t\tcase \"bold\": return `**${acc}**`;\n\t\t\tcase \"italic\": return `*${acc}*`;\n\t\t\tcase \"underline\": return `__${acc}__`;\n\t\t\tcase \"strike\": return `~~${acc}~~`;\n\t\t\tcase \"code\": return `\\`${acc}\\``;\n\t\t\tcase \"link\": {\n\t\t\t\tconst href = mark.attrs?.href ?? \"\";\n\t\t\t\treturn href ? `[${acc}](${href})` : acc;\n\t\t\t}\n\t\t\tdefault: return acc;\n\t\t}\n\t}, text);\n}\nfunction renderInline(nodes) {\n\tif (!nodes?.length) return \"\";\n\treturn nodes.map((child) => renderNode(child)).join(\"\");\n}\nfunction renderList(nodes, ordered = false) {\n\tif (!nodes?.length) return \"\";\n\tlet counter = 1;\n\treturn nodes.map((item) => {\n\t\tconst body = renderInline(item.content ?? []);\n\t\tif (!body) return \"\";\n\t\treturn `${ordered ? `${counter++}. ` : \"- \"}${body}`;\n\t}).filter(Boolean).join(\"\\n\");\n}\nfunction renderNode(node) {\n\tswitch (node.type) {\n\t\tcase \"doc\": return renderInline(node.content);\n\t\tcase \"paragraph\": {\n\t\t\tconst text = renderInline(node.content);\n\t\t\treturn text.trim().length ? text : \"\";\n\t\t}\n\t\tcase \"heading\": {\n\t\t\tconst levelAttr = node.attrs?.level;\n\t\t\tconst levelVal = typeof levelAttr === \"number\" ? levelAttr : 1;\n\t\t\tconst level = Math.min(Math.max(levelVal, 1), 6);\n\t\t\treturn `${\"#\".repeat(level)} ${renderInline(node.content)}`.trim();\n\t\t}\n\t\tcase \"bullet_list\": return renderList(node.content, false);\n\t\tcase \"ordered_list\": return renderList(node.content, true);\n\t\tcase \"list_item\": return renderInline(node.content);\n\t\tcase \"blockquote\": return renderInline(node.content).split(\"\\n\").map((line) => `> ${line}`).join(\"\\n\");\n\t\tcase \"code_block\": {\n\t\t\tconst body = renderInline(node.content);\n\t\t\treturn body ? `\\`\\`\\`\\n${body}\\n\\`\\`\\`` : \"\";\n\t\t}\n\t\tcase \"horizontal_rule\": return \"---\";\n\t\tcase \"hard_break\": return \"\\n\";\n\t\tcase \"text\": return renderTextNode(node);\n\t\tdefault:\n\t\t\tif (node.text) return renderTextNode(node);\n\t\t\treturn \"\";\n\t}\n}\nfunction blockNoteToMarkdown(docJson) {\n\tif (typeof docJson === \"string\") return docJson;\n\tif (docJson && typeof docJson === \"object\" && \"html\" in docJson) {\n\t\tconst html = String(docJson.html);\n\t\treturn turndown.turndown(html);\n\t}\n\tconst root = docJson;\n\tif (root?.type === \"doc\" || root?.content) return (root.content ?? []).map((n) => renderNode(n)).filter(Boolean).join(\"\\n\\n\").trim();\n\ttry {\n\t\treturn JSON.stringify(docJson, null, 2);\n\t} catch {\n\t\treturn String(docJson);\n\t}\n}\nvar TransformEngine = class {\n\trenderers = /* @__PURE__ */ new Map();\n\tvalidators = [];\n\tregister(renderer) {\n\t\tconst arr = this.renderers.get(renderer.target) ?? [];\n\t\tarr.push(renderer);\n\t\tthis.renderers.set(renderer.target, arr);\n\t\treturn this;\n\t}\n\t/**\n\t* Register a renderer that will be tried BEFORE existing renderers for the same target.\n\t* Useful for custom renderers that should take priority over default ones.\n\t*/\n\tprependRegister(renderer) {\n\t\tconst arr = this.renderers.get(renderer.target) ?? [];\n\t\tarr.unshift(renderer);\n\t\tthis.renderers.set(renderer.target, arr);\n\t\treturn this;\n\t}\n\taddValidator(v) {\n\t\tthis.validators.push(v);\n\t\treturn this;\n\t}\n\tasync render(target, desc, ctx) {\n\t\tif (!desc.targets.includes(target)) throw new Error(`Target ${target} not declared for ${desc.meta.name}.v${desc.meta.version}`);\n\t\tfor (const v of this.validators) await v.validate(desc, target, ctx);\n\t\tconst arr = this.renderers.get(target) ?? [];\n\t\tfor (const r of arr) try {\n\t\t\treturn await r.render(desc, ctx);\n\t\t} catch (_e) {}\n\t\tthrow new Error(`No renderer available for ${target}`);\n\t}\n};\n/** Create a TransformEngine instance with default markdown/json/xml renderers. */\nfunction createDefaultTransformEngine() {\n\tconst engine = new TransformEngine();\n\tconst applyPii = (desc, obj) => {\n\t\tconst clone = JSON.parse(JSON.stringify(obj));\n\t\tconst paths = desc.policy?.pii ?? [];\n\t\tconst setAtPath = (root, path) => {\n\t\t\tconst segs = path.replace(/^\\//, \"\").replace(/\\[(\\d+)\\]/g, \".$1\").split(\".\").filter(Boolean);\n\t\t\tlet cur = root;\n\t\t\tfor (let i = 0; i < segs.length - 1; i++) {\n\t\t\t\tconst k = segs[i];\n\t\t\t\tif (!k) continue;\n\t\t\t\tif (cur && typeof cur === \"object\" && k in cur) cur = cur[k];\n\t\t\t\telse return;\n\t\t\t}\n\t\t\tconst last = segs[segs.length - 1];\n\t\t\tif (cur && typeof cur === \"object\" && last && last in cur) cur[last] = \"[REDACTED]\";\n\t\t};\n\t\tfor (const p of paths) setAtPath(clone, p);\n\t\treturn clone;\n\t};\n\tengine.register({\n\t\ttarget: \"markdown\",\n\t\tasync render(desc, ctx) {\n\t\t\tlet data = ctx?.data;\n\t\t\tif (!data && ctx?.fetchData) data = await ctx.fetchData();\n\t\t\tif (desc.source.type === \"component\" && desc.source.props && data !== void 0) {\n\t\t\t\tconst isArray = Array.isArray(data);\n\t\t\t\tconst isSimpleObject = !isArray && typeof data === \"object\" && data !== null && !Object.values(data).some((v) => Array.isArray(v) || typeof v === \"object\" && v !== null);\n\t\t\t\tif (isArray || isSimpleObject) return {\n\t\t\t\t\tmimeType: \"text/markdown\",\n\t\t\t\t\tbody: schemaToMarkdown(desc.source.props, data, {\n\t\t\t\t\t\ttitle: desc.meta.description ?? desc.meta.name,\n\t\t\t\t\t\tdescription: `${desc.meta.name} v${desc.meta.version}`\n\t\t\t\t\t})\n\t\t\t\t};\n\t\t\t\tthrow new Error(`Complex data structure for ${desc.meta.name} - expecting custom renderer`);\n\t\t\t}\n\t\t\tif (desc.source.type === \"blocknotejs\") {\n\t\t\t\tconst redacted = applyPii(desc, { text: blockNoteToMarkdown(desc.source.docJson) });\n\t\t\t\treturn {\n\t\t\t\t\tmimeType: \"text/markdown\",\n\t\t\t\t\tbody: String(redacted.text)\n\t\t\t\t};\n\t\t\t}\n\t\t\tif (desc.source.type === \"component\" && data !== void 0) throw new Error(`No schema (source.props) available for ${desc.meta.name} - expecting custom renderer`);\n\t\t\tif (desc.source.type === \"component\") return {\n\t\t\t\tmimeType: \"text/markdown\",\n\t\t\t\tbody: `${`# ${desc.meta.name} v${desc.meta.version}`}${desc.meta.description ? `\\n\\n${desc.meta.description}` : \"\"}${desc.meta.tags && desc.meta.tags.length ? `\\n\\nTags: ${desc.meta.tags.join(\", \")}` : \"\"}${desc.meta.owners && desc.meta.owners.length ? `\\n\\nOwners: ${desc.meta.owners.join(\", \")}` : \"\"}${`\\n\\nComponent: \\`${desc.source.componentKey}\\``}${desc.policy?.pii?.length ? `\\n\\nRedacted paths: ${desc.policy.pii.map((p) => `\\`${p}\\``).join(\", \")}` : \"\"}`\n\t\t\t};\n\t\t\tthrow new Error(\"unsupported\");\n\t\t}\n\t});\n\tengine.register({\n\t\ttarget: \"application/json\",\n\t\tasync render(desc) {\n\t\t\tconst payload = applyPii(desc, {\n\t\t\t\tmeta: desc.meta,\n\t\t\t\tsource: desc.source\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tmimeType: \"application/json\",\n\t\t\t\tbody: JSON.stringify(payload, null, 2)\n\t\t\t};\n\t\t}\n\t});\n\tengine.register({\n\t\ttarget: \"application/xml\",\n\t\tasync render(desc) {\n\t\t\tconst json = applyPii(desc, {\n\t\t\t\tmeta: desc.meta,\n\t\t\t\tsource: desc.source\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tmimeType: \"application/xml\",\n\t\t\t\tbody: `<presentation name=\"${desc.meta.name}\" version=\"${desc.meta.version}\"><json>${encodeURIComponent(JSON.stringify(json))}</json></presentation>`\n\t\t\t};\n\t\t}\n\t});\n\treturn engine;\n}\n/** Register a default React target renderer that returns a serializable descriptor. */\nfunction registerDefaultReactRenderer(engine) {\n\tengine.register({\n\t\ttarget: \"react\",\n\t\tasync render(desc) {\n\t\t\tif (desc.source.type === \"component\") {\n\t\t\t\tconst props = desc.source.props ? desc.source.props.getZod().safeParse({}).success ? {} : void 0 : void 0;\n\t\t\t\treturn {\n\t\t\t\t\tkind: \"react_component\",\n\t\t\t\t\tcomponentKey: desc.source.componentKey,\n\t\t\t\t\tprops\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tkind: \"blocknotejs\",\n\t\t\t\tdocJson: desc.source.docJson,\n\t\t\t\tblockConfig: desc.source.blockConfig\n\t\t\t};\n\t\t}\n\t});\n\treturn engine;\n}\n/**\n* Add basic validators (e.g., meta.description presence) to the engine.\n*/\nfunction registerBasicValidation(engine) {\n\tengine.addValidator({ validate(desc) {\n\t\tif (!desc.meta.description || desc.meta.description.length < 3) throw new Error(`Presentation ${desc.meta.name}.v${desc.meta.version} missing meta.description`);\n\t} });\n\treturn engine;\n}\n/**\n* Register a React-to-markdown renderer that renders React components to HTML\n* and converts them to markdown using turndown.\n* This renderer takes priority over the default metadata-only renderer.\n*/\nfunction registerReactToMarkdownRenderer(engine, componentMap) {\n\tconst turndownService = new TurndownService({\n\t\theadingStyle: \"atx\",\n\t\tcodeBlockStyle: \"fenced\",\n\t\tbulletListMarker: \"-\"\n\t});\n\tturndownService.addRule(\"link\", {\n\t\tfilter: \"a\",\n\t\treplacement: (content, node) => {\n\t\t\tconst href = node.href;\n\t\t\tif (href && content) return `[${content}](${href})`;\n\t\t\treturn content || \"\";\n\t\t}\n\t});\n\tengine.prependRegister({\n\t\ttarget: \"markdown\",\n\t\tasync render(desc, _ctx) {\n\t\t\tif (desc.source.type !== \"component\") throw new Error(\"React-to-markdown renderer only handles component presentations\");\n\t\t\tconst { renderToStaticMarkup } = await import(\"react-dom/server\");\n\t\t\tconst Component = componentMap[desc.source.componentKey];\n\t\t\tif (!Component) throw new Error(`Component ${desc.source.componentKey} not found in componentMap`);\n\t\t\tlet html;\n\t\t\ttry {\n\t\t\t\thtml = renderToStaticMarkup(React.createElement(Component, desc.source.props ? {} : void 0));\n\t\t\t} catch (error) {\n\t\t\t\tthrow new Error(`Failed to render component ${desc.source.componentKey}: ${error instanceof Error ? error.message : \"Unknown error\"}`);\n\t\t\t}\n\t\t\tlet markdown;\n\t\t\ttry {\n\t\t\t\tmarkdown = turndownService.turndown(html);\n\t\t\t} catch (error) {\n\t\t\t\tthrow new Error(`Failed to convert HTML to markdown: ${error instanceof Error ? error.message : \"Unknown error\"}`);\n\t\t\t}\n\t\t\tif (desc.policy?.pii && desc.policy.pii.length > 0) return {\n\t\t\t\tmimeType: \"text/markdown\",\n\t\t\t\tbody: markdown.replace(/\\[REDACTED\\]/g, \"[REDACTED]\")\n\t\t\t};\n\t\t\treturn {\n\t\t\t\tmimeType: \"text/markdown\",\n\t\t\t\tbody: markdown\n\t\t\t};\n\t\t}\n\t});\n\treturn engine;\n}\n\n//#endregion\nexport { TransformEngine, createDefaultTransformEngine, registerBasicValidation, registerDefaultReactRenderer, registerReactToMarkdownRenderer };"],"mappings":";;;;;;;;AASA,MAAM,WAAW,IAAI,iBAAiB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","names":[],"sources":["../../../../../contracts/dist/regenerator/service.js"],"sourcesContent":["import { behaviorToEnvelope, errorToEnvelope, telemetryToEnvelope } from \"./utils.js\";\nimport { setTimeout } from \"node:timers/promises\";\n\n//#region src/regenerator/service.ts\nconst DEFAULT_POLL_INTERVAL = 6e4;\nconst DEFAULT_BATCH_DURATION = 5 * 6e4;\nvar RegeneratorService = class {\n\tcontexts;\n\tlastPoll = /* @__PURE__ */ new Map();\n\ttimer;\n\trunning = false;\n\tpollInterval;\n\tbatchDuration;\n\tclock;\n\tconstructor(options) {\n\t\tthis.options = options;\n\t\tthis.contexts = new Map(options.contexts.map((ctx) => [ctx.id, ctx]));\n\t\tthis.pollInterval = options.pollIntervalMs ?? DEFAULT_POLL_INTERVAL;\n\t\tthis.batchDuration = options.batchDurationMs ?? DEFAULT_BATCH_DURATION;\n\t\tthis.clock = options.clock ?? (() => /* @__PURE__ */ new Date());\n\t\tif (this.options.rules.length === 0) throw new Error(\"RegeneratorService requires at least one rule\");\n\t}\n\tstart() {\n\t\tif (this.running) return;\n\t\tthis.running = true;\n\t\tthis.tick();\n\t\tthis.timer = setInterval(() => {\n\t\t\tthis.tick();\n\t\t}, this.pollInterval);\n\t}\n\tstop() {\n\t\tif (!this.running) return;\n\t\tthis.running = false;\n\t\tif (this.timer) {\n\t\t\tclearInterval(this.timer);\n\t\t\tthis.timer = void 0;\n\t\t}\n\t}\n\tasync runOnce() {\n\t\tawait this.tick();\n\t}\n\tasync tick() {\n\t\tconst now = this.clock();\n\t\tconst sinceDefault = new Date(now.getTime() - this.batchDuration);\n\t\tfor (const context of this.contexts.values()) {\n\t\t\tconst last = this.lastPoll.get(context.id) ?? sinceDefault;\n\t\t\tawait this.evaluateContext(context, last, now);\n\t\t\tthis.lastPoll.set(context.id, now);\n\t\t}\n\t}\n\tasync evaluateContext(context, since, until) {\n\t\tconst signals = await this.collectSignals(context, since, until);\n\t\tif (signals.length === 0) return;\n\t\tfor (const rule of this.options.rules) {\n\t\t\tlet proposals = [];\n\t\t\ttry {\n\t\t\t\tproposals = await rule.evaluate(context, signals);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error(`[regenerator] rule ${rule.id} failed`, error instanceof Error ? error : new Error(String(error)));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tawait this.flushProposals(context, proposals);\n\t\t}\n\t}\n\tasync collectSignals(context, since, until) {\n\t\tconst envelopes = [];\n\t\tconst { adapters } = this.options;\n\t\tif (adapters.telemetry) {\n\t\t\tconst telemetrySignals = await adapters.telemetry.pollTelemetry(context, since, until);\n\t\t\tenvelopes.push(...telemetrySignals.map((signal) => telemetryToEnvelope(context.id, signal, this.clock)));\n\t\t}\n\t\tif (adapters.errors) {\n\t\t\tconst errorSignals = await adapters.errors.pollErrors(context, since, until);\n\t\t\tenvelopes.push(...errorSignals.map((signal) => errorToEnvelope(context.id, signal, this.clock)));\n\t\t}\n\t\tif (adapters.behavior) {\n\t\t\tconst behaviorSignals = await adapters.behavior.pollBehavior(context, since, until);\n\t\t\tenvelopes.push(...behaviorSignals.map((signal) => behaviorToEnvelope(context.id, signal, this.clock)));\n\t\t}\n\t\treturn envelopes;\n\t}\n\tasync flushProposals(context, proposals) {\n\t\tfor (const proposal of proposals) {\n\t\t\tif (proposal.signalIds.length === 0) continue;\n\t\t\tawait this.options.sink.submit(context, proposal);\n\t\t\tif (proposals.length > 10) await setTimeout(0);\n\t\t}\n\t}\n};\n\n//#endregion\nexport { RegeneratorService }
|
|
1
|
+
{"version":3,"file":"service.js","names":[],"sources":["../../../../../contracts/dist/regenerator/service.js"],"sourcesContent":["import { behaviorToEnvelope, errorToEnvelope, telemetryToEnvelope } from \"./utils.js\";\nimport { setTimeout } from \"node:timers/promises\";\n\n//#region src/regenerator/service.ts\nconst DEFAULT_POLL_INTERVAL = 6e4;\nconst DEFAULT_BATCH_DURATION = 5 * 6e4;\nvar RegeneratorService = class {\n\tcontexts;\n\tlastPoll = /* @__PURE__ */ new Map();\n\ttimer;\n\trunning = false;\n\tpollInterval;\n\tbatchDuration;\n\tclock;\n\tconstructor(options) {\n\t\tthis.options = options;\n\t\tthis.contexts = new Map(options.contexts.map((ctx) => [ctx.id, ctx]));\n\t\tthis.pollInterval = options.pollIntervalMs ?? DEFAULT_POLL_INTERVAL;\n\t\tthis.batchDuration = options.batchDurationMs ?? DEFAULT_BATCH_DURATION;\n\t\tthis.clock = options.clock ?? (() => /* @__PURE__ */ new Date());\n\t\tif (this.options.rules.length === 0) throw new Error(\"RegeneratorService requires at least one rule\");\n\t}\n\tstart() {\n\t\tif (this.running) return;\n\t\tthis.running = true;\n\t\tthis.tick();\n\t\tthis.timer = setInterval(() => {\n\t\t\tthis.tick();\n\t\t}, this.pollInterval);\n\t}\n\tstop() {\n\t\tif (!this.running) return;\n\t\tthis.running = false;\n\t\tif (this.timer) {\n\t\t\tclearInterval(this.timer);\n\t\t\tthis.timer = void 0;\n\t\t}\n\t}\n\tasync runOnce() {\n\t\tawait this.tick();\n\t}\n\tasync tick() {\n\t\tconst now = this.clock();\n\t\tconst sinceDefault = new Date(now.getTime() - this.batchDuration);\n\t\tfor (const context of this.contexts.values()) {\n\t\t\tconst last = this.lastPoll.get(context.id) ?? sinceDefault;\n\t\t\tawait this.evaluateContext(context, last, now);\n\t\t\tthis.lastPoll.set(context.id, now);\n\t\t}\n\t}\n\tasync evaluateContext(context, since, until) {\n\t\tconst signals = await this.collectSignals(context, since, until);\n\t\tif (signals.length === 0) return;\n\t\tfor (const rule of this.options.rules) {\n\t\t\tlet proposals = [];\n\t\t\ttry {\n\t\t\t\tproposals = await rule.evaluate(context, signals);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error(`[regenerator] rule ${rule.id} failed`, error instanceof Error ? error : new Error(String(error)));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tawait this.flushProposals(context, proposals);\n\t\t}\n\t}\n\tasync collectSignals(context, since, until) {\n\t\tconst envelopes = [];\n\t\tconst { adapters } = this.options;\n\t\tif (adapters.telemetry) {\n\t\t\tconst telemetrySignals = await adapters.telemetry.pollTelemetry(context, since, until);\n\t\t\tenvelopes.push(...telemetrySignals.map((signal) => telemetryToEnvelope(context.id, signal, this.clock)));\n\t\t}\n\t\tif (adapters.errors) {\n\t\t\tconst errorSignals = await adapters.errors.pollErrors(context, since, until);\n\t\t\tenvelopes.push(...errorSignals.map((signal) => errorToEnvelope(context.id, signal, this.clock)));\n\t\t}\n\t\tif (adapters.behavior) {\n\t\t\tconst behaviorSignals = await adapters.behavior.pollBehavior(context, since, until);\n\t\t\tenvelopes.push(...behaviorSignals.map((signal) => behaviorToEnvelope(context.id, signal, this.clock)));\n\t\t}\n\t\treturn envelopes;\n\t}\n\tasync flushProposals(context, proposals) {\n\t\tfor (const proposal of proposals) {\n\t\t\tif (proposal.signalIds.length === 0) continue;\n\t\t\tawait this.options.sink.submit(context, proposal);\n\t\t\tif (proposals.length > 10) await setTimeout(0);\n\t\t}\n\t}\n};\n\n//#endregion\nexport { RegeneratorService };"],"mappings":";;;AAKA,MAAM,yBAAyB,IAAI"}
|