@lssm/example.workflow-system 0.0.0-canary-20251221132705 → 0.0.0-canary-20251221153314

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.
Files changed (70) hide show
  1. package/dist/approval/approval.contracts.js +2 -1
  2. package/dist/approval/approval.contracts.js.map +1 -1
  3. package/dist/approval/approval.event.d.ts +32 -32
  4. package/dist/approval/approval.event.d.ts.map +1 -1
  5. package/dist/approval/approval.schema.d.ts +24 -24
  6. package/dist/entities/approval.d.ts +36 -36
  7. package/dist/entities/index.d.ts +127 -127
  8. package/dist/entities/instance.d.ts +47 -47
  9. package/dist/entities/instance.d.ts.map +1 -1
  10. package/dist/entities/step.d.ts +32 -32
  11. package/dist/entities/step.d.ts.map +1 -1
  12. package/dist/entities/workflow.d.ts +23 -23
  13. package/dist/entities/workflow.d.ts.map +1 -1
  14. package/dist/instance/instance.contracts.d.ts +256 -256
  15. package/dist/instance/instance.contracts.d.ts.map +1 -1
  16. package/dist/instance/instance.contracts.js +2 -1
  17. package/dist/instance/instance.contracts.js.map +1 -1
  18. package/dist/instance/instance.enum.d.ts +2 -2
  19. package/dist/instance/instance.enum.d.ts.map +1 -1
  20. package/dist/instance/instance.event.d.ts +87 -87
  21. package/dist/instance/instance.schema.d.ts +54 -54
  22. package/dist/instance/instance.schema.d.ts.map +1 -1
  23. package/dist/libs/contracts/dist/capabilities/index.js +1 -0
  24. package/dist/libs/contracts/dist/client/react/feature-render.js +2 -1
  25. package/dist/libs/contracts/dist/client/react/form-render.js +1 -1
  26. package/dist/libs/contracts/dist/data-views/data-views.js +1 -0
  27. package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +2 -2
  28. package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js.map +1 -1
  29. package/dist/libs/contracts/dist/forms/forms.js +1 -0
  30. package/dist/libs/contracts/dist/index.js +15 -12
  31. package/dist/libs/contracts/dist/index.js.map +1 -1
  32. package/dist/libs/contracts/dist/install.js +1 -1
  33. package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +2 -1
  34. package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js.map +1 -1
  35. package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +2 -1
  36. package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js.map +1 -1
  37. package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +2 -1
  38. package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js.map +1 -1
  39. package/dist/libs/contracts/dist/integrations/{contracts.js → operations.js} +4 -3
  40. package/dist/libs/contracts/dist/integrations/operations.js.map +1 -0
  41. package/dist/libs/contracts/dist/knowledge/{contracts.js → operations.js} +4 -3
  42. package/dist/libs/contracts/dist/knowledge/operations.js.map +1 -0
  43. package/dist/libs/contracts/dist/llm/exporters.js +1 -0
  44. package/dist/libs/contracts/dist/llm/exporters.js.map +1 -1
  45. package/dist/libs/contracts/dist/onboarding-base.js +2 -1
  46. package/dist/libs/contracts/dist/onboarding-base.js.map +1 -1
  47. package/dist/libs/contracts/dist/operations/index.js +2 -0
  48. package/dist/libs/contracts/dist/{operation.js → operations/operation.js} +1 -1
  49. package/dist/libs/contracts/dist/operations/operation.js.map +1 -0
  50. package/dist/libs/contracts/dist/operations/registry.js +2 -0
  51. package/dist/libs/contracts/dist/presentations/index.js +2 -0
  52. package/dist/libs/contracts/dist/presentations/presentations.js +2 -0
  53. package/dist/libs/contracts/dist/{presentations.v2.js → presentations/transform-engine.js} +2 -2
  54. package/dist/libs/contracts/dist/presentations/transform-engine.js.map +1 -0
  55. package/dist/libs/contracts/dist/server/mcp/registerPresentations.js +3 -2
  56. package/dist/workflow/workflow.contracts.d.ts +246 -246
  57. package/dist/workflow/workflow.contracts.d.ts.map +1 -1
  58. package/dist/workflow/workflow.contracts.js +2 -1
  59. package/dist/workflow/workflow.contracts.js.map +1 -1
  60. package/dist/workflow/workflow.enum.d.ts +5 -5
  61. package/dist/workflow/workflow.event.d.ts +33 -33
  62. package/package.json +11 -11
  63. package/dist/libs/contracts/dist/data-views.js +0 -1
  64. package/dist/libs/contracts/dist/forms.js +0 -1
  65. package/dist/libs/contracts/dist/integrations/contracts.js.map +0 -1
  66. package/dist/libs/contracts/dist/knowledge/contracts.js.map +0 -1
  67. package/dist/libs/contracts/dist/operation.js.map +0 -1
  68. package/dist/libs/contracts/dist/presentations.js +0 -2
  69. package/dist/libs/contracts/dist/presentations.v2.js.map +0 -1
  70. package/dist/libs/contracts/dist/registry.js +0 -3
@@ -1 +1 @@
1
- {"version":3,"file":"workflow.contracts.d.ts","names":[],"sources":["../../src/workflow/workflow.contracts.ts"],"sourcesContent":[],"mappings":";;;;;;;cAgBa,6CAAsB,kCAAA;EAAtB,IAAA,EAAA;IA2BX,IAAA,EAAA,mBAAA,CAAA,SAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;;IA3BiC,IAAA,+BAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;;;;;;;;;;;;;;;UAAA,mBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAAA;EAAA,CAAA;EAgCtB,cAAA,EAAA;IA2BX,IAAA,+BAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;;IA3BiC,IAAA,+BAAA,KAAA,EAAA,MAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA,IAAA,EAAA,MAAA;EAgCtB,OAAA,EAAA,MAAA;EA2BX,IAAA,EAAA,MAAA;;;;;;;;;;;;gBA3B0B,EAAA,KAAA;IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;IAAA,cAAA,EAAA;MAgCf,IAAA,+BAmCX,CAAA,MAAA,EAAA,MAAA,CAAA;MAAA,UAAA,EAAA,IAAA;;IAnCkC,cAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAA,CA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A,CAAA;;;;;UAxB8B,mBAAA,CAAA"}
@@ -1,7 +1,8 @@
1
1
  import { E5, K5 } from "../libs/schema/dist/index.js";
2
2
  import { WorkflowStatusEnum } from "./workflow.enum.js";
3
3
  import { AddStepInputModel, CreateWorkflowInputModel, UpdateWorkflowInputModel, WorkflowDefinitionModel, WorkflowStepModel } from "./workflow.schema.js";
4
- import { defineCommand, defineQuery } from "../libs/contracts/dist/operation.js";
4
+ import { defineCommand, defineQuery } from "../libs/contracts/dist/operations/operation.js";
5
+ import "../libs/contracts/dist/operations/index.js";
5
6
 
6
7
  //#region src/workflow/workflow.contracts.ts
7
8
  const OWNERS = ["@example.workflow-system"];
@@ -1 +1 @@
1
- {"version":3,"file":"workflow.contracts.js","names":["defineSchemaModel","ScalarTypeEnum"],"sources":["../../src/workflow/workflow.contracts.ts"],"sourcesContent":["import { defineCommand, defineQuery } from '@lssm/lib.contracts/operation';\nimport { defineSchemaModel, ScalarTypeEnum } from '@lssm/lib.schema';\nimport { WorkflowStatusEnum } from './workflow.enum';\nimport {\n WorkflowDefinitionModel,\n WorkflowStepModel,\n CreateWorkflowInputModel,\n UpdateWorkflowInputModel,\n AddStepInputModel,\n} from './workflow.schema';\n\nconst OWNERS = ['@example.workflow-system'] as const;\n\n/**\n * Create a new workflow definition.\n */\nexport const CreateWorkflowContract = defineCommand({\n meta: {\n name: 'workflow.definition.create',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['workflow', 'definition', 'create'],\n description: 'Create a new workflow definition.',\n goal: 'Allow users to define new workflow blueprints.',\n context: 'Workflow designer, admin panel.',\n },\n io: {\n input: CreateWorkflowInputModel,\n output: WorkflowDefinitionModel,\n },\n policy: { auth: 'user' },\n sideEffects: {\n emits: [\n {\n name: 'workflow.definition.created',\n version: 1,\n when: 'Workflow is created',\n payload: WorkflowDefinitionModel,\n },\n ],\n audit: ['workflow.definition.created'],\n },\n});\n\n/**\n * Update an existing workflow definition.\n */\nexport const UpdateWorkflowContract = defineCommand({\n meta: {\n name: 'workflow.definition.update',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['workflow', 'definition', 'update'],\n description: 'Update an existing workflow definition.',\n goal: 'Allow users to modify workflow blueprints.',\n context: 'Workflow designer.',\n },\n io: {\n input: UpdateWorkflowInputModel,\n output: WorkflowDefinitionModel,\n },\n policy: { auth: 'user' },\n sideEffects: {\n emits: [\n {\n name: 'workflow.definition.updated',\n version: 1,\n when: 'Workflow is updated',\n payload: WorkflowDefinitionModel,\n },\n ],\n audit: ['workflow.definition.updated'],\n },\n});\n\n/**\n * Add a step to a workflow definition.\n */\nexport const AddStepContract = defineCommand({\n meta: {\n name: 'workflow.step.add',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['workflow', 'step', 'add'],\n description: 'Add a step to a workflow definition.',\n goal: 'Build workflow structure step by step.',\n context: 'Workflow designer.',\n },\n io: {\n input: AddStepInputModel,\n output: WorkflowStepModel,\n },\n policy: { auth: 'user' },\n sideEffects: {\n emits: [\n {\n name: 'workflow.step.added',\n version: 1,\n when: 'Step is added',\n payload: WorkflowStepModel,\n },\n ],\n audit: ['workflow.step.added'],\n },\n});\n\n/**\n * Publish a workflow definition (make it active).\n */\nexport const PublishWorkflowContract = defineCommand({\n meta: {\n name: 'workflow.definition.publish',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['workflow', 'definition', 'publish'],\n description: 'Publish a workflow definition to make it available for use.',\n goal: 'Activate workflow for production use.',\n context: 'Workflow designer, deployment.',\n },\n io: {\n input: defineSchemaModel({\n name: 'PublishWorkflowInput',\n fields: {\n workflowId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n },\n }),\n output: WorkflowDefinitionModel,\n },\n policy: { auth: 'user' },\n sideEffects: {\n emits: [\n {\n name: 'workflow.definition.published',\n version: 1,\n when: 'Workflow is published',\n payload: WorkflowDefinitionModel,\n },\n ],\n audit: ['workflow.definition.published'],\n },\n});\n\n/**\n * List workflow definitions.\n */\nexport const ListWorkflowsContract = defineQuery({\n meta: {\n name: 'workflow.definition.list',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['workflow', 'definition', 'list'],\n description: 'List workflow definitions with filtering.',\n goal: 'Browse and search available workflows.',\n context: 'Workflow list, search.',\n },\n io: {\n input: defineSchemaModel({\n name: 'ListWorkflowsInput',\n fields: {\n status: { type: WorkflowStatusEnum, isOptional: true },\n search: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n limit: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 20,\n },\n offset: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 0,\n },\n },\n }),\n output: defineSchemaModel({\n name: 'ListWorkflowsOutput',\n fields: {\n workflows: {\n type: WorkflowDefinitionModel,\n isArray: true,\n isOptional: false,\n },\n total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n },\n }),\n },\n policy: { auth: 'user' },\n});\n\n/**\n * Get a single workflow definition with steps.\n */\nexport const GetWorkflowContract = defineQuery({\n meta: {\n name: 'workflow.definition.get',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['workflow', 'definition', 'get'],\n description: 'Get a workflow definition with all steps.',\n goal: 'View workflow details.',\n context: 'Workflow designer, detail view.',\n },\n io: {\n input: defineSchemaModel({\n name: 'GetWorkflowInput',\n fields: {\n workflowId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n },\n }),\n output: WorkflowDefinitionModel,\n },\n policy: { auth: 'user' },\n});\n"],"mappings":";;;;;;AAWA,MAAM,SAAS,CAAC,2BAA2B;;;;AAK3C,MAAa,yBAAyB,cAAc;CAClD,MAAM;EACJ,MAAM;EACN,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM;GAAC;GAAY;GAAc;GAAS;EAC1C,aAAa;EACb,MAAM;EACN,SAAS;EACV;CACD,IAAI;EACF,OA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1
+ {"version":3,"file":"workflow.contracts.js","names":["defineSchemaModel","ScalarTypeEnum"],"sources":["../../src/workflow/workflow.contracts.ts"],"sourcesContent":["import { defineCommand, defineQuery } from '@lssm/lib.contracts/operations';\nimport { defineSchemaModel, ScalarTypeEnum } from '@lssm/lib.schema';\nimport { WorkflowStatusEnum } from './workflow.enum';\nimport {\n WorkflowDefinitionModel,\n WorkflowStepModel,\n CreateWorkflowInputModel,\n UpdateWorkflowInputModel,\n AddStepInputModel,\n} from './workflow.schema';\n\nconst OWNERS = ['@example.workflow-system'] as const;\n\n/**\n * Create a new workflow definition.\n */\nexport const CreateWorkflowContract = defineCommand({\n meta: {\n name: 'workflow.definition.create',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['workflow', 'definition', 'create'],\n description: 'Create a new workflow definition.',\n goal: 'Allow users to define new workflow blueprints.',\n context: 'Workflow designer, admin panel.',\n },\n io: {\n input: CreateWorkflowInputModel,\n output: WorkflowDefinitionModel,\n },\n policy: { auth: 'user' },\n sideEffects: {\n emits: [\n {\n name: 'workflow.definition.created',\n version: 1,\n when: 'Workflow is created',\n payload: WorkflowDefinitionModel,\n },\n ],\n audit: ['workflow.definition.created'],\n },\n});\n\n/**\n * Update an existing workflow definition.\n */\nexport const UpdateWorkflowContract = defineCommand({\n meta: {\n name: 'workflow.definition.update',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['workflow', 'definition', 'update'],\n description: 'Update an existing workflow definition.',\n goal: 'Allow users to modify workflow blueprints.',\n context: 'Workflow designer.',\n },\n io: {\n input: UpdateWorkflowInputModel,\n output: WorkflowDefinitionModel,\n },\n policy: { auth: 'user' },\n sideEffects: {\n emits: [\n {\n name: 'workflow.definition.updated',\n version: 1,\n when: 'Workflow is updated',\n payload: WorkflowDefinitionModel,\n },\n ],\n audit: ['workflow.definition.updated'],\n },\n});\n\n/**\n * Add a step to a workflow definition.\n */\nexport const AddStepContract = defineCommand({\n meta: {\n name: 'workflow.step.add',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['workflow', 'step', 'add'],\n description: 'Add a step to a workflow definition.',\n goal: 'Build workflow structure step by step.',\n context: 'Workflow designer.',\n },\n io: {\n input: AddStepInputModel,\n output: WorkflowStepModel,\n },\n policy: { auth: 'user' },\n sideEffects: {\n emits: [\n {\n name: 'workflow.step.added',\n version: 1,\n when: 'Step is added',\n payload: WorkflowStepModel,\n },\n ],\n audit: ['workflow.step.added'],\n },\n});\n\n/**\n * Publish a workflow definition (make it active).\n */\nexport const PublishWorkflowContract = defineCommand({\n meta: {\n name: 'workflow.definition.publish',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['workflow', 'definition', 'publish'],\n description: 'Publish a workflow definition to make it available for use.',\n goal: 'Activate workflow for production use.',\n context: 'Workflow designer, deployment.',\n },\n io: {\n input: defineSchemaModel({\n name: 'PublishWorkflowInput',\n fields: {\n workflowId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n },\n }),\n output: WorkflowDefinitionModel,\n },\n policy: { auth: 'user' },\n sideEffects: {\n emits: [\n {\n name: 'workflow.definition.published',\n version: 1,\n when: 'Workflow is published',\n payload: WorkflowDefinitionModel,\n },\n ],\n audit: ['workflow.definition.published'],\n },\n});\n\n/**\n * List workflow definitions.\n */\nexport const ListWorkflowsContract = defineQuery({\n meta: {\n name: 'workflow.definition.list',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['workflow', 'definition', 'list'],\n description: 'List workflow definitions with filtering.',\n goal: 'Browse and search available workflows.',\n context: 'Workflow list, search.',\n },\n io: {\n input: defineSchemaModel({\n name: 'ListWorkflowsInput',\n fields: {\n status: { type: WorkflowStatusEnum, isOptional: true },\n search: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n limit: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 20,\n },\n offset: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 0,\n },\n },\n }),\n output: defineSchemaModel({\n name: 'ListWorkflowsOutput',\n fields: {\n workflows: {\n type: WorkflowDefinitionModel,\n isArray: true,\n isOptional: false,\n },\n total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n },\n }),\n },\n policy: { auth: 'user' },\n});\n\n/**\n * Get a single workflow definition with steps.\n */\nexport const GetWorkflowContract = defineQuery({\n meta: {\n name: 'workflow.definition.get',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['workflow', 'definition', 'get'],\n description: 'Get a workflow definition with all steps.',\n goal: 'View workflow details.',\n context: 'Workflow designer, detail view.',\n },\n io: {\n input: defineSchemaModel({\n name: 'GetWorkflowInput',\n fields: {\n workflowId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n },\n }),\n output: WorkflowDefinitionModel,\n },\n policy: { auth: 'user' },\n});\n"],"mappings":";;;;;;;AAWA,MAAM,SAAS,CAAC,2BAA2B;;;;AAK3C,MAAa,yBAAyB,cAAc;CAClD,MAAM;EACJ,MAAM;EACN,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM;GAAC;GAAY;GAAc;GAAS;EAC1C,aAAa;EACb,MAAM;EACN,SAAS;EACV;CACD,IAAI;EACF,OAAO;EACP,QAAQ;EACT;CACD,QAAQ,EAAE,MAAM,QAAQ;CACxB,aAAa;EACX,OAAO,CACL;GACE,MAAM;GACN,SAAS;GACT,MAAM;GACN,SAAS;GACV,CACF;EACD,OAAO,CAAC,8BAA8B;EACvC;CACF,CAAC;;;;AAKF,MAAa,yBAAyB,cAAc;CAClD,MAAM;EACJ,MAAM;EACN,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM;GAAC;GAAY;GAAc;GAAS;EAC1C,aAAa;EACb,MAAM;EACN,SAAS;EACV;CACD,IAAI;EACF,OAAO;EACP,QAAQ;EACT;CACD,QAAQ,EAAE,MAAM,QAAQ;CAC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;KAAoB,YAAY;KAAM;IACtD,QAAQ;KAAE,MAAMC,GAAe,iBAAiB;KAAE,YAAY;KAAM;IACpE,OAAO;KACL,MAAMA,GAAe,cAAc;KACnC,YAAY;KACZ,cAAc;KACf;IACD,QAAQ;KACN,MAAMA,GAAe,cAAc;KACnC,YAAY;KACZ,cAAc;KACf;IACF;GACF,CAAC;EACF,QAAQD,GAAkB;GACxB,MAAM;GACN,QAAQ;IACN,WAAW;KACT,MAAM;KACN,SAAS;KACT,YAAY;KACb;IACD,OAAO;KAAE,MAAMC,GAAe,cAAc;KAAE,YAAY;KAAO;IAClE;GACF,CAAC;EACH;CACD,QAAQ,EAAE,MAAM,QAAQ;CACzB,CAAC;;;;AAKF,MAAa,sBAAsB,YAAY;CAC7C,MAAM;EACJ,MAAM;EACN,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM;GAAC;GAAY;GAAc;GAAM;EACvC,aAAa;EACb,MAAM;EACN,SAAS;EACV;CACD,IAAI;EACF,OAAOD,GAAkB;GACvB,MAAM;GACN,QAAQ,EACN,YAAY;IACV,MAAMC,GAAe,iBAAiB;IACtC,YAAY;IACb,EACF;GACF,CAAC;EACF,QAAQ;EACT;CACD,QAAQ,EAAE,MAAM,QAAQ;CACzB,CAAC"}
@@ -1,22 +1,22 @@
1
- import * as _lssm_lib_schema469 from "@lssm/lib.schema";
1
+ import * as _lssm_lib_schema901 from "@lssm/lib.schema";
2
2
 
3
3
  //#region src/workflow/workflow.enum.d.ts
4
4
  /**
5
5
  * Workflow status enum.
6
6
  */
7
- declare const WorkflowStatusEnum: _lssm_lib_schema469.EnumType<[string, string, string, string]>;
7
+ declare const WorkflowStatusEnum: _lssm_lib_schema901.EnumType<[string, string, string, string]>;
8
8
  /**
9
9
  * Trigger type enum.
10
10
  */
11
- declare const TriggerTypeEnum: _lssm_lib_schema469.EnumType<[string, string, string, string]>;
11
+ declare const TriggerTypeEnum: _lssm_lib_schema901.EnumType<[string, string, string, string]>;
12
12
  /**
13
13
  * Step type enum.
14
14
  */
15
- declare const StepTypeEnum: _lssm_lib_schema469.EnumType<[string, string, string, string, string, string, string, string]>;
15
+ declare const StepTypeEnum: _lssm_lib_schema901.EnumType<[string, string, string, string, string, string, string, string]>;
16
16
  /**
17
17
  * Approval mode enum.
18
18
  */
19
- declare const ApprovalModeEnum: _lssm_lib_schema469.EnumType<[string, string, string, string]>;
19
+ declare const ApprovalModeEnum: _lssm_lib_schema901.EnumType<[string, string, string, string]>;
20
20
  //#endregion
21
21
  export { ApprovalModeEnum, StepTypeEnum, TriggerTypeEnum, WorkflowStatusEnum };
22
22
  //# sourceMappingURL=workflow.enum.d.ts.map
@@ -1,132 +1,132 @@
1
- import * as _lssm_lib_schema473 from "@lssm/lib.schema";
2
- import * as _lssm_lib_contracts14 from "@lssm/lib.contracts";
1
+ import * as _lssm_lib_schema905 from "@lssm/lib.schema";
2
+ import * as _lssm_lib_contracts24 from "@lssm/lib.contracts";
3
3
 
4
4
  //#region src/workflow/workflow.event.d.ts
5
5
  /**
6
6
  * WorkflowCreatedEvent - A new workflow definition has been created.
7
7
  */
8
- declare const WorkflowCreatedEvent: _lssm_lib_contracts14.EventSpec<_lssm_lib_schema473.SchemaModel<{
8
+ declare const WorkflowCreatedEvent: _lssm_lib_contracts24.EventSpec<_lssm_lib_schema905.SchemaModel<{
9
9
  workflowId: {
10
- type: _lssm_lib_schema473.FieldType<string, string>;
10
+ type: _lssm_lib_schema905.FieldType<string, string>;
11
11
  isOptional: false;
12
12
  };
13
13
  key: {
14
- type: _lssm_lib_schema473.FieldType<string, string>;
14
+ type: _lssm_lib_schema905.FieldType<string, string>;
15
15
  isOptional: false;
16
16
  };
17
17
  name: {
18
- type: _lssm_lib_schema473.FieldType<string, string>;
18
+ type: _lssm_lib_schema905.FieldType<string, string>;
19
19
  isOptional: false;
20
20
  };
21
21
  version: {
22
- type: _lssm_lib_schema473.FieldType<number, number>;
22
+ type: _lssm_lib_schema905.FieldType<number, number>;
23
23
  isOptional: false;
24
24
  };
25
25
  organizationId: {
26
- type: _lssm_lib_schema473.FieldType<string, string>;
26
+ type: _lssm_lib_schema905.FieldType<string, string>;
27
27
  isOptional: false;
28
28
  };
29
29
  createdBy: {
30
- type: _lssm_lib_schema473.FieldType<string, string>;
30
+ type: _lssm_lib_schema905.FieldType<string, string>;
31
31
  isOptional: false;
32
32
  };
33
33
  timestamp: {
34
- type: _lssm_lib_schema473.FieldType<Date, string>;
34
+ type: _lssm_lib_schema905.FieldType<Date, string>;
35
35
  isOptional: false;
36
36
  };
37
37
  }>>;
38
38
  /**
39
39
  * WorkflowUpdatedEvent - A workflow definition has been updated.
40
40
  */
41
- declare const WorkflowUpdatedEvent: _lssm_lib_contracts14.EventSpec<_lssm_lib_schema473.SchemaModel<{
41
+ declare const WorkflowUpdatedEvent: _lssm_lib_contracts24.EventSpec<_lssm_lib_schema905.SchemaModel<{
42
42
  workflowId: {
43
- type: _lssm_lib_schema473.FieldType<string, string>;
43
+ type: _lssm_lib_schema905.FieldType<string, string>;
44
44
  isOptional: false;
45
45
  };
46
46
  key: {
47
- type: _lssm_lib_schema473.FieldType<string, string>;
47
+ type: _lssm_lib_schema905.FieldType<string, string>;
48
48
  isOptional: false;
49
49
  };
50
50
  name: {
51
- type: _lssm_lib_schema473.FieldType<string, string>;
51
+ type: _lssm_lib_schema905.FieldType<string, string>;
52
52
  isOptional: false;
53
53
  };
54
54
  version: {
55
- type: _lssm_lib_schema473.FieldType<number, number>;
55
+ type: _lssm_lib_schema905.FieldType<number, number>;
56
56
  isOptional: false;
57
57
  };
58
58
  organizationId: {
59
- type: _lssm_lib_schema473.FieldType<string, string>;
59
+ type: _lssm_lib_schema905.FieldType<string, string>;
60
60
  isOptional: false;
61
61
  };
62
62
  createdBy: {
63
- type: _lssm_lib_schema473.FieldType<string, string>;
63
+ type: _lssm_lib_schema905.FieldType<string, string>;
64
64
  isOptional: false;
65
65
  };
66
66
  timestamp: {
67
- type: _lssm_lib_schema473.FieldType<Date, string>;
67
+ type: _lssm_lib_schema905.FieldType<Date, string>;
68
68
  isOptional: false;
69
69
  };
70
70
  }>>;
71
71
  /**
72
72
  * WorkflowPublishedEvent - A workflow definition has been published.
73
73
  */
74
- declare const WorkflowPublishedEvent: _lssm_lib_contracts14.EventSpec<_lssm_lib_schema473.SchemaModel<{
74
+ declare const WorkflowPublishedEvent: _lssm_lib_contracts24.EventSpec<_lssm_lib_schema905.SchemaModel<{
75
75
  workflowId: {
76
- type: _lssm_lib_schema473.FieldType<string, string>;
76
+ type: _lssm_lib_schema905.FieldType<string, string>;
77
77
  isOptional: false;
78
78
  };
79
79
  key: {
80
- type: _lssm_lib_schema473.FieldType<string, string>;
80
+ type: _lssm_lib_schema905.FieldType<string, string>;
81
81
  isOptional: false;
82
82
  };
83
83
  name: {
84
- type: _lssm_lib_schema473.FieldType<string, string>;
84
+ type: _lssm_lib_schema905.FieldType<string, string>;
85
85
  isOptional: false;
86
86
  };
87
87
  version: {
88
- type: _lssm_lib_schema473.FieldType<number, number>;
88
+ type: _lssm_lib_schema905.FieldType<number, number>;
89
89
  isOptional: false;
90
90
  };
91
91
  organizationId: {
92
- type: _lssm_lib_schema473.FieldType<string, string>;
92
+ type: _lssm_lib_schema905.FieldType<string, string>;
93
93
  isOptional: false;
94
94
  };
95
95
  createdBy: {
96
- type: _lssm_lib_schema473.FieldType<string, string>;
96
+ type: _lssm_lib_schema905.FieldType<string, string>;
97
97
  isOptional: false;
98
98
  };
99
99
  timestamp: {
100
- type: _lssm_lib_schema473.FieldType<Date, string>;
100
+ type: _lssm_lib_schema905.FieldType<Date, string>;
101
101
  isOptional: false;
102
102
  };
103
103
  }>>;
104
104
  /**
105
105
  * StepAddedEvent - A step has been added to a workflow definition.
106
106
  */
107
- declare const StepAddedEvent: _lssm_lib_contracts14.EventSpec<_lssm_lib_schema473.SchemaModel<{
107
+ declare const StepAddedEvent: _lssm_lib_contracts24.EventSpec<_lssm_lib_schema905.SchemaModel<{
108
108
  stepId: {
109
- type: _lssm_lib_schema473.FieldType<string, string>;
109
+ type: _lssm_lib_schema905.FieldType<string, string>;
110
110
  isOptional: false;
111
111
  };
112
112
  workflowId: {
113
- type: _lssm_lib_schema473.FieldType<string, string>;
113
+ type: _lssm_lib_schema905.FieldType<string, string>;
114
114
  isOptional: false;
115
115
  };
116
116
  stepKey: {
117
- type: _lssm_lib_schema473.FieldType<string, string>;
117
+ type: _lssm_lib_schema905.FieldType<string, string>;
118
118
  isOptional: false;
119
119
  };
120
120
  stepType: {
121
- type: _lssm_lib_schema473.FieldType<string, string>;
121
+ type: _lssm_lib_schema905.FieldType<string, string>;
122
122
  isOptional: false;
123
123
  };
124
124
  position: {
125
- type: _lssm_lib_schema473.FieldType<number, number>;
125
+ type: _lssm_lib_schema905.FieldType<number, number>;
126
126
  isOptional: false;
127
127
  };
128
128
  timestamp: {
129
- type: _lssm_lib_schema473.FieldType<Date, string>;
129
+ type: _lssm_lib_schema905.FieldType<Date, string>;
130
130
  isOptional: false;
131
131
  };
132
132
  }>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lssm/example.workflow-system",
3
- "version": "0.0.0-canary-20251221132705",
3
+ "version": "0.0.0-canary-20251221153314",
4
4
  "description": "Workflow and approval system example for ContractSpec - State machine with role-based transitions",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -18,19 +18,19 @@
18
18
  "lint:check": "eslint src"
19
19
  },
20
20
  "dependencies": {
21
- "@lssm/lib.schema": "0.0.0-canary-20251221132705",
22
- "@lssm/lib.contracts": "0.0.0-canary-20251221132705",
23
- "@lssm/lib.bus": "0.0.0-canary-20251221132705",
24
- "@lssm/lib.identity-rbac": "0.0.0-canary-20251221132705",
25
- "@lssm/lib.feature-flags": "0.0.0-canary-20251221132705",
26
- "@lssm/lib.jobs": "0.0.0-canary-20251221132705",
27
- "@lssm/module.audit-trail": "0.0.0-canary-20251221132705",
28
- "@lssm/module.notifications": "0.0.0-canary-20251221132705",
21
+ "@lssm/lib.schema": "0.0.0-canary-20251221153314",
22
+ "@lssm/lib.contracts": "0.0.0-canary-20251221153314",
23
+ "@lssm/lib.bus": "0.0.0-canary-20251221153314",
24
+ "@lssm/lib.identity-rbac": "0.0.0-canary-20251221153314",
25
+ "@lssm/lib.feature-flags": "0.0.0-canary-20251221153314",
26
+ "@lssm/lib.jobs": "0.0.0-canary-20251221153314",
27
+ "@lssm/module.audit-trail": "0.0.0-canary-20251221153314",
28
+ "@lssm/module.notifications": "0.0.0-canary-20251221153314",
29
29
  "zod": "^4.1.13"
30
30
  },
31
31
  "devDependencies": {
32
- "@lssm/tool.typescript": "0.0.0-canary-20251221132705",
33
- "@lssm/tool.tsdown": "0.0.0-canary-20251221132705",
32
+ "@lssm/tool.typescript": "0.0.0-canary-20251221153314",
33
+ "@lssm/tool.tsdown": "0.0.0-canary-20251221153314",
34
34
  "typescript": "^5.9.3"
35
35
  },
36
36
  "exports": {
@@ -1 +0,0 @@
1
- import "./registry-utils.js";
@@ -1 +0,0 @@
1
- import "./registry-utils.js";
@@ -1 +0,0 @@
1
- {"version":3,"file":"contracts.js","names":[],"sources":["../../../../../../../libs/contracts/dist/integrations/contracts.js"],"sourcesContent":["import { E5, x8 } from \"../schema/dist/index.js\";\nimport { defineCommand, defineQuery } from \"../operation.js\";\n\n//#region src/integrations/contracts.ts\nconst IntegrationConnectionRecord = new x8({\n\tname: \"IntegrationConnectionRecord\",\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\tintegrationKey: {\n\t\t\ttype: E5.NonEmptyString(),\n\t\t\tisOptional: false\n\t\t},\n\t\tintegrationVersion: {\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\townershipMode: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: false\n\t\t},\n\t\texternalAccountId: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: true\n\t\t},\n\t\tsecretProvider: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: false\n\t\t},\n\t\tsecretRef: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: false\n\t\t},\n\t\tstatus: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: false\n\t\t},\n\t\tenvironment: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: true\n\t\t},\n\t\thealthStatus: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: true\n\t\t},\n\t\thealthCheckedAt: {\n\t\t\ttype: E5.DateTime(),\n\t\t\tisOptional: true\n\t\t},\n\t\thealthLatencyMs: {\n\t\t\ttype: E5.Float_unsecure(),\n\t\t\tisOptional: true\n\t\t},\n\t\thealthErrorCode: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: true\n\t\t},\n\t\thealthErrorMessage: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: true\n\t\t},\n\t\tusageRequestCount: {\n\t\t\ttype: E5.Int_unsecure(),\n\t\t\tisOptional: true\n\t\t},\n\t\tusageSuccessCount: {\n\t\t\ttype: E5.Int_unsecure(),\n\t\t\tisOptional: true\n\t\t},\n\t\tusageErrorCount: {\n\t\t\ttype: E5.Int_unsecure(),\n\t\t\tisOptional: true\n\t\t},\n\t\tusageLastUsedAt: {\n\t\t\ttype: E5.DateTime(),\n\t\t\tisOptional: true\n\t\t},\n\t\tusageLastErrorAt: {\n\t\t\ttype: E5.DateTime(),\n\t\t\tisOptional: true\n\t\t},\n\t\tusageLastErrorCode: {\n\t\t\ttype: E5.String_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 CreateIntegrationConnectionInput = new x8({\n\tname: \"CreateIntegrationConnectionInput\",\n\tfields: {\n\t\ttenantId: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: false\n\t\t},\n\t\tintegrationKey: {\n\t\t\ttype: E5.NonEmptyString(),\n\t\t\tisOptional: false\n\t\t},\n\t\tintegrationVersion: {\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\townershipMode: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: false\n\t\t},\n\t\texternalAccountId: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: true\n\t\t},\n\t\tsecretProvider: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: false\n\t\t},\n\t\tsecretRef: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: false\n\t\t},\n\t\tenvironment: {\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: false\n\t\t}\n\t}\n});\nconst UpdateIntegrationConnectionInput = new x8({\n\tname: \"UpdateIntegrationConnectionInput\",\n\tfields: {\n\t\tconnectionId: {\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\tstatus: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: true\n\t\t},\n\t\townershipMode: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: true\n\t\t},\n\t\texternalAccountId: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: true\n\t\t},\n\t\tsecretProvider: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: true\n\t\t},\n\t\tsecretRef: {\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}\n});\nconst DeleteIntegrationConnectionInput = new x8({\n\tname: \"DeleteIntegrationConnectionInput\",\n\tfields: { connectionId: {\n\t\ttype: E5.ID(),\n\t\tisOptional: false\n\t} }\n});\nconst ListIntegrationConnectionsInput = new x8({\n\tname: \"ListIntegrationConnectionsInput\",\n\tfields: {\n\t\ttenantId: {\n\t\t\ttype: E5.ID(),\n\t\t\tisOptional: false\n\t\t},\n\t\tcategory: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: true\n\t\t},\n\t\tstatus: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: true\n\t\t}\n\t}\n});\nconst ListIntegrationConnectionsOutput = new x8({\n\tname: \"ListIntegrationConnectionsOutput\",\n\tfields: { connections: {\n\t\ttype: IntegrationConnectionRecord,\n\t\tisOptional: false,\n\t\tisArray: true\n\t} }\n});\nconst TestIntegrationConnectionInput = new x8({\n\tname: \"TestIntegrationConnectionInput\",\n\tfields: { connectionId: {\n\t\ttype: E5.ID(),\n\t\tisOptional: false\n\t} }\n});\nconst TestIntegrationConnectionOutput = new x8({\n\tname: \"TestIntegrationConnectionOutput\",\n\tfields: {\n\t\tsuccess: {\n\t\t\ttype: E5.Boolean(),\n\t\t\tisOptional: false\n\t\t},\n\t\tstatus: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: true\n\t\t},\n\t\tlatencyMs: {\n\t\t\ttype: E5.Float_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\terrorCode: {\n\t\t\ttype: E5.String_unsecure(),\n\t\t\tisOptional: true\n\t\t}\n\t}\n});\nconst DeleteIntegrationConnectionOutput = new x8({\n\tname: \"DeleteIntegrationConnectionOutput\",\n\tfields: { success: {\n\t\ttype: E5.Boolean(),\n\t\tisOptional: false\n\t} }\n});\nconst CreateIntegrationConnection = defineCommand({\n\tmeta: {\n\t\tname: \"integrations.connection.create\",\n\t\tversion: 1,\n\t\tdescription: \"Create a new integration connection for a tenant.\",\n\t\tgoal: \"Provision a tenant-scoped connection to an external provider.\",\n\t\tcontext: \"Used by Ops or the App Studio to configure external integrations such as Stripe or Qdrant.\",\n\t\towners: [\"platform.integrations\"],\n\t\ttags: [\"integration\", \"connections\"],\n\t\tstability: \"experimental\"\n\t},\n\tio: {\n\t\tinput: CreateIntegrationConnectionInput,\n\t\toutput: IntegrationConnectionRecord\n\t},\n\tpolicy: {\n\t\tauth: \"admin\",\n\t\tpolicies: [{\n\t\t\tname: \"platform.integration.manage\",\n\t\t\tversion: 1\n\t\t}]\n\t}\n});\nconst UpdateIntegrationConnection = defineCommand({\n\tmeta: {\n\t\tname: \"integrations.connection.update\",\n\t\tversion: 1,\n\t\tdescription: \"Update metadata or credentials for an integration connection.\",\n\t\tgoal: \"Allow secure rotation of credentials and metadata adjustments.\",\n\t\tcontext: \"Supports rotating API keys, toggling status, or updating labels for tenant integrations.\",\n\t\towners: [\"platform.integrations\"],\n\t\ttags: [\"integration\", \"connections\"],\n\t\tstability: \"experimental\"\n\t},\n\tio: {\n\t\tinput: UpdateIntegrationConnectionInput,\n\t\toutput: IntegrationConnectionRecord\n\t},\n\tpolicy: {\n\t\tauth: \"admin\",\n\t\tpolicies: [{\n\t\t\tname: \"platform.integration.manage\",\n\t\t\tversion: 1\n\t\t}]\n\t}\n});\nconst DeleteIntegrationConnection = defineCommand({\n\tmeta: {\n\t\tname: \"integrations.connection.delete\",\n\t\tversion: 1,\n\t\tdescription: \"Delete an integration connection for a tenant.\",\n\t\tgoal: \"Safely remove credentials and disable connector usage.\",\n\t\tcontext: \"Ensures connections are de-provisioned when no longer needed or breached.\",\n\t\towners: [\"platform.integrations\"],\n\t\ttags: [\"integration\", \"connections\"],\n\t\tstability: \"experimental\"\n\t},\n\tio: {\n\t\tinput: DeleteIntegrationConnectionInput,\n\t\toutput: DeleteIntegrationConnectionOutput\n\t},\n\tpolicy: {\n\t\tauth: \"admin\",\n\t\tpolicies: [{\n\t\t\tname: \"platform.integration.manage\",\n\t\t\tversion: 1\n\t\t}]\n\t}\n});\nconst ListIntegrationConnections = defineQuery({\n\tmeta: {\n\t\tname: \"integrations.connection.list\",\n\t\tversion: 1,\n\t\tdescription: \"List integration connections for a tenant.\",\n\t\tgoal: \"Provide visibility into configured integrations and their status.\",\n\t\tcontext: \"Used by the App Studio and Ops flows to show bindings and health.\",\n\t\towners: [\"platform.integrations\"],\n\t\ttags: [\"integration\", \"connections\"],\n\t\tstability: \"experimental\"\n\t},\n\tio: {\n\t\tinput: ListIntegrationConnectionsInput,\n\t\toutput: ListIntegrationConnectionsOutput\n\t},\n\tpolicy: {\n\t\tauth: \"admin\",\n\t\tpolicies: [{\n\t\t\tname: \"platform.integration.read\",\n\t\t\tversion: 1\n\t\t}]\n\t}\n});\nconst TestIntegrationConnection = defineCommand({\n\tmeta: {\n\t\tname: \"integrations.connection.test\",\n\t\tversion: 1,\n\t\tdescription: \"Run a health check against a configured integration connection.\",\n\t\tgoal: \"Validate credentials and connectivity for external providers.\",\n\t\tcontext: \"Triggered manually or by background monitors to confirm provider availability.\",\n\t\towners: [\"platform.integrations\"],\n\t\ttags: [\"integration\", \"connections\"],\n\t\tstability: \"experimental\"\n\t},\n\tio: {\n\t\tinput: TestIntegrationConnectionInput,\n\t\toutput: TestIntegrationConnectionOutput\n\t},\n\tpolicy: {\n\t\tauth: \"admin\",\n\t\tpolicies: [{\n\t\t\tname: \"platform.integration.manage\",\n\t\t\tversion: 1\n\t\t}]\n\t}\n});\nconst integrationContracts = {\n\tCreateIntegrationConnection,\n\tUpdateIntegrationConnection,\n\tDeleteIntegrationConnection,\n\tListIntegrationConnections,\n\tTestIntegrationConnection\n};\nfunction registerIntegrationContracts(registry) {\n\treturn registry.register(CreateIntegrationConnection).register(UpdateIntegrationConnection).register(DeleteIntegrationConnection).register(ListIntegrationConnections).register(TestIntegrationConnection);\n}\n\n//#endregion\nexport { CreateIntegrationConnection, DeleteIntegrationConnection, ListIntegrationConnections, TestIntegrationConnection, UpdateIntegrationConnection, integrationContracts, registerIntegrationContracts };"],"mappings":";;;;AAIA,MAAM,8BAA8B,IAAI,GAAG;CAC1C,MAAM;CACN,QAAQ;EACP,IAAI;GACH,MAAM,GAAG,IAAI;GACb,YAAY;GACZ;EACD,UAAU;GACT,MAAM,GAAG,IAAI;GACb,YAAY;GACZ;EACD,gBAAgB;GACf,MAAM,GAAG,gBAAgB;GACzB,YAAY;GACZ;EACD,oBAAoB;GACnB,MAAM,GAAG,cAAc;GACvB,YAAY;GACZ;EACD,OAAO;GACN,MAAM,GAAG,iBAAiB;GAC1B,YAAY;GACZ;EACD,eAAe;GACd,MAAM,GAAG,iBAAiB;GAC1B,YAAY;GACZ;EACD,mBAAmB;GAClB,MAAM,GAAG,iBAAiB;GAC1B,YAAY;GACZ;EACD,gBAAgB;GACf,MAAM,GAAG,iBAAiB;GAC1B,YAAY;GACZ;EACD,WAAW;GACV,MAAM,GAAG,iBAAiB;GAC1B,YAAY;GACZ;EACD,QAAQ;GACP,MAAM,GAAG,iBAAiB;GAC1B,YAAY;GACZ;EACD,aAAa;GACZ,MAAM,GAAG,iBAAiB;GAC1B,YAAY;GACZ;EACD,cAAc;GACb,MAAM,GAAG,iBAAiB;GAC1B,YAAY;GACZ;EACD,iBAAiB;GAChB,MAAM,GAAG,UAAU;GACnB,YAAY;GACZ;EACD,iBAAiB;GAChB,MAAM,GAAG,gBAAgB;GACzB,YAAY;GACZ;EACD,iBAAiB;GAChB,MAAM,GAAG,iBAAiB;GAC1B,YAAY;GACZ;EACD,oBAAoB;GACnB,MAAM,GAAG,iBAAiB;GAC1B,YAAY;GAC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AAe,cAAc;EACpC,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,4BAA4B,cAAc;CAC/C,MAAM;EACL,MAAM;EACN,SAAS;EACT,aAAa;EACb,MAAM;EACN,SAAS;EACT,QAAQ,CAAC,wBAAwB;EACjC,MAAM,CAAC,eAAe,cAAc;EACpC,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 +0,0 @@
1
- {"version":3,"file":"contracts.js","names":[],"sources":["../../../../../../../libs/contracts/dist/knowledge/contracts.js"],"sourcesContent":["import { E5, x8 } from \"../schema/dist/index.js\";\nimport { defineCommand, defineQuery } from \"../operation.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,M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M;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 +0,0 @@
1
- {"version":3,"file":"operation.js","names":[],"sources":["../../../../../../libs/contracts/dist/operation.js"],"sourcesContent":["//#region src/operation.ts\nconst isEmitDeclRef = (e) => \"ref\" in e;\n/**\n* Helper to define a Command (write operation).\n* Sets `kind: 'command'` and defaults `idempotent: false`.\n*/\nconst defineCommand = (spec) => ({\n\t...spec,\n\tmeta: {\n\t\t...spec.meta,\n\t\tkind: \"command\"\n\t},\n\tpolicy: {\n\t\t...spec.policy,\n\t\tidempotent: spec.policy?.[\"policy\"]?.idempotent ?? false\n\t}\n});\n/**\n* Helper to define a Query (read-only operation).\n* Sets `kind: 'query'` and forces `idempotent: true`.\n*/\nconst defineQuery = (spec) => ({\n\t...spec,\n\tmeta: {\n\t\t...spec.meta,\n\t\tkind: \"query\"\n\t},\n\tpolicy: {\n\t\t...spec.policy,\n\t\tidempotent: true\n\t}\n});\n\n//#endregion\nexport { defineCommand, defineQuery, isEmitDeclRef };"],"mappings":";;;;;AAMA,MAAM,iBAAiB,UAAU;CAChC,GAAG;CACH,MAAM;EACL,GAAG,KAAK;EACR,MAAM;EACN;CACD,QAAQ;EACP,GAAG,KAAK;EACR,YAAY,KAAK,SAAS,WAAW,cAAc;EACnD;CACD;;;;;AAKD,MAAM,eAAe,UAAU;CAC9B,GAAG;CACH,MAAM;EACL,GAAG,KAAK;EACR,MAAM;EACN;CACD,QAAQ;EACP,GAAG,KAAK;EACR,YAAY;EACZ;CACD"}
@@ -1,2 +0,0 @@
1
- import "./registry-utils.js";
2
- import z from "zod";
@@ -1 +0,0 @@
1
- {"version":3,"file":"presentations.v2.js","names":[],"sources":["../../../../../../libs/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,3 +0,0 @@
1
- import "./registry-utils.js";
2
- import "./events.js";
3
- import { defaultDocRegistry, registerDocBlocks } from "./docs/registry.js";