@lucern/pack-host 1.0.29 → 1.0.30

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 (67) hide show
  1. package/dist/contracts.d.ts +35 -35
  2. package/dist/contracts.js.map +1 -1
  3. package/dist/dependencyResolution.d.ts +3 -3
  4. package/dist/dependencyResolution.js +83 -59
  5. package/dist/dependencyResolution.js.map +1 -1
  6. package/dist/domain-pack/authoring.core.d.ts +82 -82
  7. package/dist/domain-pack/authoring.core.js +7 -6
  8. package/dist/domain-pack/authoring.core.js.map +1 -1
  9. package/dist/domain-pack/authoring.js +400 -281
  10. package/dist/domain-pack/authoring.js.map +1 -1
  11. package/dist/domain-pack/authoring.validation.js +400 -281
  12. package/dist/domain-pack/authoring.validation.js.map +1 -1
  13. package/dist/domain-pack/contracts.d.ts +95 -95
  14. package/dist/domain-pack/contracts.js.map +1 -1
  15. package/dist/domain-pack/index.js +416 -285
  16. package/dist/domain-pack/index.js.map +1 -1
  17. package/dist/domain-pack/ontology/software-entities-v1.d.ts +7 -7
  18. package/dist/domain-pack/ontology/software-entities-v1.js.map +1 -1
  19. package/dist/domain-pack/packs/developer-reasoning.js +7 -1
  20. package/dist/domain-pack/packs/developer-reasoning.js.map +1 -1
  21. package/dist/domain-pack/packs/engineering-accelerator.js.map +1 -1
  22. package/dist/domain-pack/packs/index.js +333 -239
  23. package/dist/domain-pack/packs/index.js.map +1 -1
  24. package/dist/domain-pack/shaping.d.ts +15 -15
  25. package/dist/domain-pack/shaping.js +326 -238
  26. package/dist/domain-pack/shaping.js.map +1 -1
  27. package/dist/domain-pack/validation.d.ts +6 -6
  28. package/dist/domain-pack/validation.js +318 -236
  29. package/dist/domain-pack/validation.js.map +1 -1
  30. package/dist/domain-pack.js +416 -285
  31. package/dist/domain-pack.js.map +1 -1
  32. package/dist/index.d.ts +6 -6
  33. package/dist/index.js +3793 -3643
  34. package/dist/index.js.map +1 -1
  35. package/dist/lifecycle.d.ts +9 -9
  36. package/dist/lifecycle.js.map +1 -1
  37. package/dist/manifestValidation.d.ts +9 -9
  38. package/dist/manifestValidation.js.map +1 -1
  39. package/dist/manifests/chat-v1.js.map +1 -1
  40. package/dist/manifests/deals-v1.js +1 -6
  41. package/dist/manifests/deals-v1.js.map +1 -1
  42. package/dist/manifests/decisions-v1.js.map +1 -1
  43. package/dist/manifests/documents-v1.js.map +1 -1
  44. package/dist/manifests/epistemic-algorithms-v1.js.map +1 -1
  45. package/dist/manifests/graph-visualization-v1.js.map +1 -1
  46. package/dist/manifests/index.js +1 -6
  47. package/dist/manifests/index.js.map +1 -1
  48. package/dist/manifests/news-v1.js.map +1 -1
  49. package/dist/manifests/philosophy-mode-v1.js.map +1 -1
  50. package/dist/manifests/sprints-v1.js.map +1 -1
  51. package/dist/manifests/task-management-v1.js.map +1 -1
  52. package/dist/manifests/team-analysis-v1.js.map +1 -1
  53. package/dist/manifests/themes-v1.js.map +1 -1
  54. package/dist/manifests/user-profiles-v1.js.map +1 -1
  55. package/dist/manifests.js +1 -6
  56. package/dist/manifests.js.map +1 -1
  57. package/dist/namespacePolicy.d.ts +6 -6
  58. package/dist/namespacePolicy.js.map +1 -1
  59. package/dist/proof-attestation.json +1 -1
  60. package/dist/registry.js +84 -65
  61. package/dist/registry.js.map +1 -1
  62. package/dist/runtime.d.ts +6 -6
  63. package/dist/runtime.js +83 -59
  64. package/dist/runtime.js.map +1 -1
  65. package/dist/serviceContracts.d.ts +4 -4
  66. package/dist/serviceContracts.js.map +1 -1
  67. package/package.json +1 -1
@@ -7,20 +7,20 @@ import { PackLifecycle, AppPackManifest } from './contracts.js';
7
7
  */
8
8
 
9
9
  type PackEnablementReason = "allowed" | "pack_not_found" | "lifecycle_blocked" | "license_missing" | "dependency_missing" | "dependency_not_installed" | "dependency_not_enabled";
10
- type PackEnablementDecision = {
11
- packKey: string;
10
+ interface PackEnablementDecision {
12
11
  allowed: boolean;
13
- reason: PackEnablementReason;
14
12
  missingDependencies: string[];
15
- };
16
- type PackEnablementPolicy = {
17
- requireExplicitEntitlement?: boolean;
13
+ packKey: string;
14
+ reason: PackEnablementReason;
15
+ }
16
+ interface PackEnablementPolicy {
18
17
  allowedLifecycles?: readonly PackLifecycle[];
18
+ enabledPackKeys?: readonly string[];
19
+ installedPackKeys?: readonly string[];
20
+ requireExplicitEntitlement?: boolean;
19
21
  tenantEntitledPackKeys?: readonly string[];
20
22
  workspaceEntitledPackKeys?: readonly string[];
21
- installedPackKeys?: readonly string[];
22
- enabledPackKeys?: readonly string[];
23
- };
23
+ }
24
24
  declare function evaluatePackEnablement(packKey: string, registry: Record<string, AppPackManifest>, policy?: PackEnablementPolicy): PackEnablementDecision;
25
25
  declare function evaluateCatalogEnablement(registry: Record<string, AppPackManifest>, policy?: PackEnablementPolicy): PackEnablementDecision[];
26
26
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/lifecycle.ts"],"names":[],"mappings":";AAiCA,IAAM,0BAAA,GAA8C;AAAA,EAClD,QAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA;AAEA,SAAS,MAAM,MAAA,EAAyC;AACtD,EAAA,OAAO,IAAI,GAAA,CAAI,MAAA,IAAU,EAAE,CAAA;AAC7B;AAEO,SAAS,sBAAA,CACd,OAAA,EACA,QAAA,EACA,MAAA,GAA+B,EAAC,EACR;AACxB,EAAA,MAAM,QAAA,GAAW,SAAS,OAAO,CAAA;AACjC,EAAA,IAAI,CAAC,QAAA,EAAU;AACb,IAAA,OAAO;AAAA,MACL,OAAA;AAAA,MACA,OAAA,EAAS,KAAA;AAAA,MACT,MAAA,EAAQ,gBAAA;AAAA,MACR,qBAAqB;AAAC,KACxB;AAAA,EACF;AAEA,EAAA,MAAM,oBAAoB,IAAI,GAAA;AAAA,IAC5B,OAAO,iBAAA,IAAqB;AAAA,GAC9B;AACA,EAAA,IAAI,CAAC,iBAAA,CAAkB,GAAA,CAAI,QAAA,CAAS,SAAS,CAAA,EAAG;AAC9C,IAAA,OAAO;A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OAAA,EAAS,KAAA;AAAA,QACT,MAAA,EAAQ,0BAAA;AAAA,QACR,mBAAA,EAAqB;AAAA,OACvB;AAAA,IACF;AAAA,EACF;AAEA,EAAA,MAAM,OAAA,GAAU,KAAA,CAAM,MAAA,CAAO,eAAe,CAAA;AAC5C,EAAA,IAAI,OAAA,CAAQ,OAAO,CAAA,EAAG;AACpB,IAAA,MAAM,UAAA,GAAa,SAAS,YAAA,CAAa,MAAA;AAAA,MACvC,CAAC,UAAA,KAAe,CAAC,OAAA,CAAQ,IAAI,UAAU;AAAA,KACzC;AACA,IAAA,IAAI,UAAA,CAAW,SAAS,CAAA,EAAG;AACzB,MAAA,OAAO;AAAA,QACL,OAAA;AAAA,QACA,OAAA,EAAS,KAAA;AAAA,QACT,MAAA,EAAQ,wBAAA;AAAA,QACR,mBAAA,EAAqB;AAAA,OACvB;AAAA,IACF;AAAA,EACF;AAEA,EAAA,OAAO;AAAA,IACL,OAAA;AAAA,IACA,OAAA,EAAS,IAAA;AAAA,IACT,MAAA,EAAQ,SAAA;AAAA,IACR,qBAAqB;AAAC,GACxB;AACF;AAEO,SAAS,yBAAA,CACd,QAAA,EACA,MAAA,GAA+B,EAAC,EACN;AAC1B,EAAA,OAAO,MAAA,CAAO,IAAA,CAAK,QAAQ,CAAA,CACxB,IAAA,EAAK,CACL,GAAA,CAAI,CAAC,OAAA,KAAY,sBAAA,CAAuB,OAAA,EAAS,QAAA,EAAU,MAAM,CAAC,CAAA;AACvE","file":"lifecycle.js","sourcesContent":["/**\n * Pack Lifecycle Enforcement\n *\n * License and dependency checks for tenant/workspace pack enablement.\n */\n\nimport type { AppPackManifest, PackLifecycle } from \"./contracts\";\n\nexport type PackEnablementReason =\n | \"allowed\"\n | \"pack_not_found\"\n | \"lifecycle_blocked\"\n | \"license_missing\"\n | \"dependency_missing\"\n | \"dependency_not_installed\"\n | \"dependency_not_enabled\";\n\nexport type PackEnablementDecision = {\n packKey: string;\n allowed: boolean;\n reason: PackEnablementReason;\n missingDependencies: string[];\n};\n\nexport type PackEnablementPolicy = {\n requireExplicitEntitlement?: boolean;\n allowedLifecycles?: readonly PackLifecycle[];\n tenantEntitledPackKeys?: readonly string[];\n workspaceEntitledPackKeys?: readonly string[];\n installedPackKeys?: readonly string[];\n enabledPackKeys?: readonly string[];\n};\n\nconst DEFAULT_ALLOWED_LIFECYCLES: PackLifecycle[] = [\n \"active\",\n \"beta\",\n \"experimental\",\n];\n\nfunction toSet(values?: readonly string[]): Set<string> {\n return new Set(values ?? []);\n}\n\nexport function evaluatePackEnablement(\n packKey: string,\n registry: Record<string, AppPackManifest>,\n policy: PackEnablementPolicy = {}\n): PackEnablementDecision {\n const manifest = registry[packKey];\n if (!manifest) {\n return {\n packKey,\n allowed: false,\n reason: \"pack_not_found\",\n missingDependencies: [],\n };\n }\n\n const allowedLifecycles = new Set(\n policy.allowedLifecycles ?? DEFAULT_ALLOWED_LIFECYCLES\n );\n if (!allowedLifecycles.has(manifest.lifecycle)) {\n return {\n packKey,\n allowed: false,\n reason: \"lifecycle_blocked\",\n missingDependencies: [],\n };\n }\n\n const requireExplicitEntitlement = policy.requireExplicitEntitlement ?? false;\n if (requireExplicitEntitlement) {\n const entitled = new Set([\n ...toSet(policy.tenantEntitledPackKeys),\n ...toSet(policy.workspaceEntitledPackKeys),\n ]);\n if (!entitled.has(packKey)) {\n return {\n packKey,\n allowed: false,\n reason: \"license_missing\",\n missingDependencies: [],\n };\n }\n }\n\n const missingDependencies = manifest.dependencies.filter(\n (dependency) => !registry[dependency]\n );\n if (missingDependencies.length > 0) {\n return {\n packKey,\n allowed: false,\n reason: \"dependency_missing\",\n missingDependencies,\n };\n }\n\n const installed = toSet(policy.installedPackKeys);\n if (installed.size > 0) {\n const notInstalled = manifest.dependencies.filter(\n (dependency) => !installed.has(dependency)\n );\n if (notInstalled.length > 0) {\n return {\n packKey,\n allowed: false,\n reason: \"dependency_not_installed\",\n missingDependencies: notInstalled,\n };\n }\n }\n\n const enabled = toSet(policy.enabledPackKeys);\n if (enabled.size > 0) {\n const notEnabled = manifest.dependencies.filter(\n (dependency) => !enabled.has(dependency)\n );\n if (notEnabled.length > 0) {\n return {\n packKey,\n allowed: false,\n reason: \"dependency_not_enabled\",\n missingDependencies: notEnabled,\n };\n }\n }\n\n return {\n packKey,\n allowed: true,\n reason: \"allowed\",\n missingDependencies: [],\n };\n}\n\nexport function evaluateCatalogEnablement(\n registry: Record<string, AppPackManifest>,\n policy: PackEnablementPolicy = {}\n): PackEnablementDecision[] {\n return Object.keys(registry)\n .sort()\n .map((packKey) => evaluatePackEnablement(packKey, registry, policy));\n}\n"]}
1
+ {"version":3,"sources":["../src/lifecycle.ts"],"names":[],"mappings":";AAiCA,IAAM,0BAAA,GAA8C;AAAA,EAClD,QAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA;AAEA,SAAS,MAAM,MAAA,EAAyC;AACtD,EAAA,OAAO,IAAI,GAAA,CAAI,MAAA,IAAU,EAAE,CAAA;AAC7B;AAEO,SAAS,sBAAA,CACd,OAAA,EACA,QAAA,EACA,MAAA,GAA+B,EAAC,EACR;AACxB,EAAA,MAAM,QAAA,GAAW,SAAS,OAAO,CAAA;AACjC,EAAA,IAAI,CAAC,QAAA,EAAU;AACb,IAAA,OAAO;AAAA,MACL,OAAA;AAAA,MACA,OAAA,EAAS,KAAA;AAAA,MACT,MAAA,EAAQ,gBAAA;AAAA,MACR,qBAAqB;AAAC,KACxB;AAAA,EACF;AAEA,EAAA,MAAM,oBAAoB,IAAI,GAAA;AAAA,IAC5B,OAAO,iBAAA,IAAqB;AAAA,GAC9B;AACA,EAAA,IAAI,CAAC,iBAAA,CAAkB,GAAA,CAAI,QAAA,CAAS,SAAS,CAAA,EAAG;AAC9C,IAAA,OAAO;AAAA,MACL,OAAA;AAAA,MACA,OAAA,EAAS,KAAA;AAAA,MACT,MAAA,EAAQ,mBAAA;AAAA,MACR,qBAAqB;AAAC,KACxB;AAAA,EACF;AAEA,EAAA,MAAM,0BAAA,GA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AAM,MAAA,CAAO,eAAe,CAAA;AAC5C,EAAA,IAAI,OAAA,CAAQ,OAAO,CAAA,EAAG;AACpB,IAAA,MAAM,UAAA,GAAa,SAAS,YAAA,CAAa,MAAA;AAAA,MACvC,CAAC,UAAA,KAAe,CAAC,OAAA,CAAQ,IAAI,UAAU;AAAA,KACzC;AACA,IAAA,IAAI,UAAA,CAAW,SAAS,CAAA,EAAG;AACzB,MAAA,OAAO;AAAA,QACL,OAAA;AAAA,QACA,OAAA,EAAS,KAAA;AAAA,QACT,MAAA,EAAQ,wBAAA;AAAA,QACR,mBAAA,EAAqB;AAAA,OACvB;AAAA,IACF;AAAA,EACF;AAEA,EAAA,OAAO;AAAA,IACL,OAAA;AAAA,IACA,OAAA,EAAS,IAAA;AAAA,IACT,MAAA,EAAQ,SAAA;AAAA,IACR,qBAAqB;AAAC,GACxB;AACF;AAEO,SAAS,yBAAA,CACd,QAAA,EACA,MAAA,GAA+B,EAAC,EACN;AAC1B,EAAA,OAAO,MAAA,CAAO,IAAA,CAAK,QAAQ,CAAA,CACxB,IAAA,EAAK,CACL,GAAA,CAAI,CAAC,OAAA,KAAY,sBAAA,CAAuB,OAAA,EAAS,QAAA,EAAU,MAAM,CAAC,CAAA;AACvE","file":"lifecycle.js","sourcesContent":["/**\n * Pack Lifecycle Enforcement\n *\n * License and dependency checks for tenant/workspace pack enablement.\n */\n\nimport type { AppPackManifest, PackLifecycle } from \"./contracts\";\n\nexport type PackEnablementReason =\n | \"allowed\"\n | \"pack_not_found\"\n | \"lifecycle_blocked\"\n | \"license_missing\"\n | \"dependency_missing\"\n | \"dependency_not_installed\"\n | \"dependency_not_enabled\";\n\nexport interface PackEnablementDecision {\n allowed: boolean;\n missingDependencies: string[];\n packKey: string;\n reason: PackEnablementReason;\n}\n\nexport interface PackEnablementPolicy {\n allowedLifecycles?: readonly PackLifecycle[];\n enabledPackKeys?: readonly string[];\n installedPackKeys?: readonly string[];\n requireExplicitEntitlement?: boolean;\n tenantEntitledPackKeys?: readonly string[];\n workspaceEntitledPackKeys?: readonly string[];\n}\n\nconst DEFAULT_ALLOWED_LIFECYCLES: PackLifecycle[] = [\n \"active\",\n \"beta\",\n \"experimental\",\n];\n\nfunction toSet(values?: readonly string[]): Set<string> {\n return new Set(values ?? []);\n}\n\nexport function evaluatePackEnablement(\n packKey: string,\n registry: Record<string, AppPackManifest>,\n policy: PackEnablementPolicy = {}\n): PackEnablementDecision {\n const manifest = registry[packKey];\n if (!manifest) {\n return {\n packKey,\n allowed: false,\n reason: \"pack_not_found\",\n missingDependencies: [],\n };\n }\n\n const allowedLifecycles = new Set(\n policy.allowedLifecycles ?? DEFAULT_ALLOWED_LIFECYCLES\n );\n if (!allowedLifecycles.has(manifest.lifecycle)) {\n return {\n packKey,\n allowed: false,\n reason: \"lifecycle_blocked\",\n missingDependencies: [],\n };\n }\n\n const requireExplicitEntitlement = policy.requireExplicitEntitlement ?? false;\n if (requireExplicitEntitlement) {\n const entitled = new Set([\n ...toSet(policy.tenantEntitledPackKeys),\n ...toSet(policy.workspaceEntitledPackKeys),\n ]);\n if (!entitled.has(packKey)) {\n return {\n packKey,\n allowed: false,\n reason: \"license_missing\",\n missingDependencies: [],\n };\n }\n }\n\n const missingDependencies = manifest.dependencies.filter(\n (dependency) => !registry[dependency]\n );\n if (missingDependencies.length > 0) {\n return {\n packKey,\n allowed: false,\n reason: \"dependency_missing\",\n missingDependencies,\n };\n }\n\n const installed = toSet(policy.installedPackKeys);\n if (installed.size > 0) {\n const notInstalled = manifest.dependencies.filter(\n (dependency) => !installed.has(dependency)\n );\n if (notInstalled.length > 0) {\n return {\n packKey,\n allowed: false,\n reason: \"dependency_not_installed\",\n missingDependencies: notInstalled,\n };\n }\n }\n\n const enabled = toSet(policy.enabledPackKeys);\n if (enabled.size > 0) {\n const notEnabled = manifest.dependencies.filter(\n (dependency) => !enabled.has(dependency)\n );\n if (notEnabled.length > 0) {\n return {\n packKey,\n allowed: false,\n reason: \"dependency_not_enabled\",\n missingDependencies: notEnabled,\n };\n }\n }\n\n return {\n packKey,\n allowed: true,\n reason: \"allowed\",\n missingDependencies: [],\n };\n}\n\nexport function evaluateCatalogEnablement(\n registry: Record<string, AppPackManifest>,\n policy: PackEnablementPolicy = {}\n): PackEnablementDecision[] {\n return Object.keys(registry)\n .sort()\n .map((packKey) => evaluatePackEnablement(packKey, registry, policy));\n}\n"]}
@@ -7,22 +7,22 @@ import { AppPackManifest } from './contracts.js';
7
7
  */
8
8
 
9
9
  type PackValidationSeverity = "error" | "warning";
10
- type PackValidationIssue = {
10
+ interface PackValidationIssue {
11
11
  code: string;
12
- severity: PackValidationSeverity;
13
12
  message: string;
14
13
  path: string;
15
- };
16
- type PackManifestValidationResult = {
14
+ severity: PackValidationSeverity;
15
+ }
16
+ interface PackManifestValidationResult {
17
+ issues: PackValidationIssue[];
17
18
  manifestKey: string;
18
19
  valid: boolean;
19
- issues: PackValidationIssue[];
20
- };
21
- type PackSchemaDictionary = {
22
- nodeTypes: readonly string[];
20
+ }
21
+ interface PackSchemaDictionary {
23
22
  edgeTypes: readonly string[];
23
+ nodeTypes: readonly string[];
24
24
  tables: readonly string[];
25
- };
25
+ }
26
26
  declare function validateAppPackManifest(manifest: AppPackManifest, dictionary?: PackSchemaDictionary): PackManifestValidationResult;
27
27
 
28
28
  export { type PackManifestValidationResult, type PackSchemaDictionary, type PackValidationIssue, type PackValidationSeverity, validateAppPackManifest };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/manifestValidation.ts"],"names":[],"mappings":";;;AASA,IAAM,kBAAA,GAAqB,oCAAA;AAC3B,IAAM,aAAA,GAAgB,wCAAA;AAuBtB,IAAM,qBAAA,GAAwB,EAAE,MAAA,CAAO;AAAA,EACrC,GAAA,EAAK,CAAA,CAAE,MAAA,EAAO,CAAE,MAAM,kBAAkB,CAAA;AAAA,EACxC,IAAA,EAAM,CAAA,CAAE,MAAA,EAAO,CAAE,IAAI,CAAC,CAAA;AAAA,EACtB,OAAA,EAAS,CAAA,CAA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;AAAA,IACtB,UAAA,CAAW;AAAA,GACb;AAEA,EAAA,IAAI,gBAAA,CAAiB,SAAS,CAAA,EAAG;AAC/B,IAAA,MAAA,CAAO,IAAA;AAAA,MACL,OAAA;AAAA,QACE,yBAAA;AAAA,QACA,CAAA,6BAAA,EAAgC,gBAAA,CAAiB,IAAA,CAAK,IAAI,CAAC,CAAA,CAAA;AAAA,QAC3D;AAAA;AACF,KACF;AAAA,EACF;AAEA,EAAA,IAAI,gBAAA,CAAiB,SAAS,CAAA,EAAG;AAC/B,IAAA,MAAA,CAAO,IAAA;AAAA,MACL,OAAA;AAAA,QACE,yBAAA;AAAA,QACA,CAAA,6BAAA,EAAgC,gBAAA,CAAiB,IAAA,CAAK,IAAI,CAAC,CAAA,CAAA;AAAA,QAC3D;AAAA;AACF,KACF;AAAA,EACF;AAEA,EAAA,IAAI,aAAA,CAAc,SAAS,CAAA,EAAG;AAC5B,IAAA,MAAA,CAAO,IAAA;AAAA,MACL,OAAA;AAAA,QACE,qBAAA;AAAA,QACA,CAAA,yBAAA,EAA4B,aAAA,CAAc,IAAA,CAAK,IAAI,CAAC,CAAA,CAAA;AAAA,QACpD;AAAA;AACF,KACF;AAAA,EACF;AAEA,EAAA,OAAO,MAAA;AACT;AAEO,SAAS,uBAAA,CACd,UACA,UAAA,EAC8B;AAC9B,EAAA,MAAM,MAAA,GAAgC;AAAA,IACpC,GAAG,sBAAsB,QAAQ,CAAA;AAAA,IACjC,GAAG,2BAA2B,QAAQ,CAAA;AAAA,IACtC,GAAG,0BAAA,CAA2B,QAAA,EAAU,UAAU;AAAA,GACpD;AAEA,EAAA,OAAO;AAAA,IACL,aAAa,QAAA,CAAS,GAAA;AAAA,IACtB,OAAO,MAAA,CAAO,KAAA,CAAM,CAAC,KAAA,KAAU,KAAA,CAAM,aAAa,OAAO,CAAA;AAAA,IACzD;AAAA,GACF;AACF","file":"manifestValidation.js","sourcesContent":["/**\n * Pack Manifest Validation\n *\n * Runtime schema and dictionary validation for app-pack manifests.\n */\n\nimport { z } from \"zod\";\nimport type { AppPackManifest } from \"./contracts\";\n\nconst manifestKeyPattern = /^[a-z0-9]+(?:-[a-z0-9]+)*-v[0-9]+$/;\nconst semverPattern = /^\\d+\\.\\d+\\.\\d+(?:[-+][0-9A-Za-z.-]+)?$/;\n\nexport type PackValidationSeverity = \"error\" | \"warning\";\n\nexport type PackValidationIssue = {\n code: string;\n severity: PackValidationSeverity;\n message: string;\n path: string;\n};\n\nexport type PackManifestValidationResult = {\n manifestKey: string;\n valid: boolean;\n issues: PackValidationIssue[];\n};\n\nexport type PackSchemaDictionary = {\n nodeTypes: readonly string[];\n edgeTypes: readonly string[];\n tables: readonly string[];\n};\n\nconst appPackManifestSchema = z.object({\n key: z.string().regex(manifestKeyPattern),\n name: z.string().min(1),\n version: z.string().regex(semverPattern),\n lifecycle: z.enum([\"active\", \"beta\", \"experimental\"]),\n category: z.enum([\n \"conversation\",\n \"research\",\n \"graph\",\n \"analytics\",\n \"workflow\",\n \"decision\",\n \"news\",\n \"documents\",\n \"identity\",\n \"operations\",\n \"domain\",\n ]),\n description: z.string().min(1),\n dependencies: z.array(z.string().min(1)),\n capabilityFlags: z.array(z.string().min(1)),\n routeNamespace: z.object({\n web: z.array(z.string().min(1)),\n api: z.array(z.string().min(1)),\n }),\n surfaces: z.object({\n components: z.array(z.string().min(1)),\n convex: z.array(z.string().min(1)),\n tools: z.array(z.string().min(1)),\n }),\n policyProfile: z.object({\n audiences: z.array(z.string().min(1)).min(1),\n rules: z\n .array(\n z.object({\n resource: z.enum([\n \"project\",\n \"node\",\n \"edge\",\n \"artifact\",\n \"report_section\",\n \"tool_action\",\n \"task\",\n \"user_profile\",\n \"team_analytics\",\n ]),\n actions: z\n .array(z.enum([\"read\", \"summarize\", \"export\", \"mutate\", \"admin\"]))\n .min(1),\n notes: z.string().optional(),\n })\n )\n .min(1),\n }),\n dataContract: z.object({\n requiredNodeTypes: z.array(z.string().min(1)),\n requiredEdgeTypes: z.array(z.string().min(1)),\n requiredTables: z.array(z.string().min(1)).min(1),\n projectionBehavior: z.enum([\n \"none\",\n \"inherits_policy\",\n \"projection_required\",\n ]),\n }),\n templates: z.object({\n workflows: z.array(z.string().min(1)),\n prompts: z.array(z.string().min(1)),\n reports: z.array(z.string().min(1)),\n uiLabels: z.array(z.string().min(1)),\n }),\n testSuite: z.object({\n parity: z.array(z.string().min(1)).min(1),\n policy: z.array(z.string().min(1)).min(1),\n contract: z.array(z.string().min(1)).min(1),\n }),\n sharedServices: z.array(\n z.object({\n service: z.enum([\n \"decision-kernel\",\n \"knowledge-compiler\",\n \"learning-loop\",\n ]),\n mode: z.enum([\"required\", \"optional\"]),\n contracts: z.array(z.string().min(1)).min(1),\n })\n ),\n});\n\nfunction toIssue(\n code: string,\n message: string,\n path: string,\n severity: PackValidationSeverity = \"error\"\n): PackValidationIssue {\n return {\n code,\n severity,\n message,\n path,\n };\n}\n\nfunction collectDuplicateValues(values: readonly string[]): string[] {\n const counts = new Map<string, number>();\n for (const value of values) {\n counts.set(value, (counts.get(value) ?? 0) + 1);\n }\n return [...counts.entries()]\n .filter(([, count]) => count > 1)\n .map(([value]) => value)\n .sort();\n}\n\nfunction collectUnknownValues(\n values: readonly string[],\n knownValues: readonly string[]\n): string[] {\n const known = new Set(knownValues);\n return values.filter((value) => !known.has(value));\n}\n\nfunction validateManifestShape(\n manifest: AppPackManifest\n): PackValidationIssue[] {\n const parsed = appPackManifestSchema.safeParse(manifest);\n if (parsed.success) {\n return [];\n }\n\n return parsed.error.issues.map((issue) =>\n toIssue(\n \"PACK_MANIFEST_SCHEMA_INVALID\",\n issue.message,\n issue.path.join(\".\") || \"(root)\"\n )\n );\n}\n\nfunction validateManifestUniqueness(\n manifest: AppPackManifest\n): PackValidationIssue[] {\n const issues: PackValidationIssue[] = [];\n\n const duplicateDependencies = collectDuplicateValues(manifest.dependencies);\n if (duplicateDependencies.length > 0) {\n issues.push(\n toIssue(\n \"PACK_DEPENDENCIES_DUPLICATE\",\n `Duplicate dependencies declared: ${duplicateDependencies.join(\", \")}`,\n \"dependencies\"\n )\n );\n }\n\n if (manifest.dependencies.includes(manifest.key)) {\n issues.push(\n toIssue(\n \"PACK_DEPENDENCY_SELF_REFERENCE\",\n `Pack \"${manifest.key}\" cannot depend on itself.`,\n \"dependencies\"\n )\n );\n }\n\n const duplicateCapabilities = collectDuplicateValues(\n manifest.capabilityFlags\n );\n if (duplicateCapabilities.length > 0) {\n issues.push(\n toIssue(\n \"PACK_CAPABILITIES_DUPLICATE\",\n `Duplicate capability flags declared: ${duplicateCapabilities.join(\", \")}`,\n \"capabilityFlags\"\n )\n );\n }\n\n const duplicateWebRoutes = collectDuplicateValues(\n manifest.routeNamespace.web\n );\n if (duplicateWebRoutes.length > 0) {\n issues.push(\n toIssue(\n \"PACK_WEB_ROUTES_DUPLICATE\",\n `Duplicate web routes declared: ${duplicateWebRoutes.join(\", \")}`,\n \"routeNamespace.web\"\n )\n );\n }\n\n const duplicateApiRoutes = collectDuplicateValues(\n manifest.routeNamespace.api\n );\n if (duplicateApiRoutes.length > 0) {\n issues.push(\n toIssue(\n \"PACK_API_ROUTES_DUPLICATE\",\n `Duplicate api routes declared: ${duplicateApiRoutes.join(\", \")}`,\n \"routeNamespace.api\"\n )\n );\n }\n\n const duplicateServices = collectDuplicateValues(\n manifest.sharedServices.map((integration) => integration.service)\n );\n if (duplicateServices.length > 0) {\n issues.push(\n toIssue(\n \"PACK_SHARED_SERVICE_DUPLICATE\",\n `Duplicate shared-service integrations declared: ${duplicateServices.join(\", \")}`,\n \"sharedServices\"\n )\n );\n }\n\n return issues;\n}\n\nfunction validateManifestDictionary(\n manifest: AppPackManifest,\n dictionary?: PackSchemaDictionary\n): PackValidationIssue[] {\n if (!dictionary) {\n return [];\n }\n\n const issues: PackValidationIssue[] = [];\n const unknownNodeTypes = collectUnknownValues(\n manifest.dataContract.requiredNodeTypes,\n dictionary.nodeTypes\n );\n const unknownEdgeTypes = collectUnknownValues(\n manifest.dataContract.requiredEdgeTypes,\n dictionary.edgeTypes\n );\n const unknownTables = collectUnknownValues(\n manifest.dataContract.requiredTables,\n dictionary.tables\n );\n\n if (unknownNodeTypes.length > 0) {\n issues.push(\n toIssue(\n \"PACK_UNKNOWN_NODE_TYPES\",\n `Unknown required node types: ${unknownNodeTypes.join(\", \")}`,\n \"dataContract.requiredNodeTypes\"\n )\n );\n }\n\n if (unknownEdgeTypes.length > 0) {\n issues.push(\n toIssue(\n \"PACK_UNKNOWN_EDGE_TYPES\",\n `Unknown required edge types: ${unknownEdgeTypes.join(\", \")}`,\n \"dataContract.requiredEdgeTypes\"\n )\n );\n }\n\n if (unknownTables.length > 0) {\n issues.push(\n toIssue(\n \"PACK_UNKNOWN_TABLES\",\n `Unknown required tables: ${unknownTables.join(\", \")}`,\n \"dataContract.requiredTables\"\n )\n );\n }\n\n return issues;\n}\n\nexport function validateAppPackManifest(\n manifest: AppPackManifest,\n dictionary?: PackSchemaDictionary\n): PackManifestValidationResult {\n const issues: PackValidationIssue[] = [\n ...validateManifestShape(manifest),\n ...validateManifestUniqueness(manifest),\n ...validateManifestDictionary(manifest, dictionary),\n ];\n\n return {\n manifestKey: manifest.key,\n valid: issues.every((issue) => issue.severity !== \"error\"),\n issues,\n };\n}\n"]}
1
+ {"version":3,"sources":["../src/manifestValidation.ts"],"names":[],"mappings":";;;AAUA,IAAM,kBAAA,GAAqB,oCAAA;AAC3B,IAAM,aAAA,GAAgB,wCAAA;AAuBtB,IAAM,qBAAA,GAAwB,EAAE,MAAA,CAAO;AAAA,EACrC,GAAA,EAAK,CAAA,CAAE,MAAA,EAAO,CAAE,MAAM,kBAAkB,CAAA;AAAA,EACxC,IAAA,EAAM,CAAA,CAAE,MAAA,EAAO,CAAE,IAAI,CAAC,CAAA;AAAA,EACtB,OAAA,EAAS,CAAA,CAAE,MAAA,EAAO,CAAE,MAAM,aAAa,CAAA;AAAA,EACvC,WAAW,CAAA,CAAE,IAAA,CAAK,CAAC,QAAA,EAAU,MAAA,EAAQ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O,IAAA;AAAA,MACL,OAAA;AAAA,QACE,yBAAA;AAAA,QACA,CAAA,6BAAA,EAAgC,gBAAA,CAAiB,IAAA,CAAK,IAAI,CAAC,CAAA,CAAA;AAAA,QAC3D;AAAA;AACF,KACF;AAAA,EACF;AAEA,EAAA,IAAI,gBAAA,CAAiB,SAAS,CAAA,EAAG;AAC/B,IAAA,MAAA,CAAO,IAAA;AAAA,MACL,OAAA;AAAA,QACE,yBAAA;AAAA,QACA,CAAA,6BAAA,EAAgC,gBAAA,CAAiB,IAAA,CAAK,IAAI,CAAC,CAAA,CAAA;AAAA,QAC3D;AAAA;AACF,KACF;AAAA,EACF;AAEA,EAAA,IAAI,aAAA,CAAc,SAAS,CAAA,EAAG;AAC5B,IAAA,MAAA,CAAO,IAAA;AAAA,MACL,OAAA;AAAA,QACE,qBAAA;AAAA,QACA,CAAA,yBAAA,EAA4B,aAAA,CAAc,IAAA,CAAK,IAAI,CAAC,CAAA,CAAA;AAAA,QACpD;AAAA;AACF,KACF;AAAA,EACF;AAEA,EAAA,OAAO,MAAA;AACT;AAEO,SAAS,uBAAA,CACd,UACA,UAAA,EAC8B;AAC9B,EAAA,MAAM,MAAA,GAAgC;AAAA,IACpC,GAAG,sBAAsB,QAAQ,CAAA;AAAA,IACjC,GAAG,2BAA2B,QAAQ,CAAA;AAAA,IACtC,GAAG,0BAAA,CAA2B,QAAA,EAAU,UAAU;AAAA,GACpD;AAEA,EAAA,OAAO;AAAA,IACL,aAAa,QAAA,CAAS,GAAA;AAAA,IACtB,OAAO,MAAA,CAAO,KAAA,CAAM,CAAC,KAAA,KAAU,KAAA,CAAM,aAAa,OAAO,CAAA;AAAA,IACzD;AAAA,GACF;AACF","file":"manifestValidation.js","sourcesContent":["// biome-ignore-all lint/style/useFilenamingConvention: Legacy public @lucern/pack-host/manifestValidation subpath.\n/**\n * Pack Manifest Validation\n *\n * Runtime schema and dictionary validation for app-pack manifests.\n */\n\nimport { z } from \"zod\";\nimport type { AppPackManifest } from \"./contracts\";\n\nconst manifestKeyPattern = /^[a-z0-9]+(?:-[a-z0-9]+)*-v[0-9]+$/;\nconst semverPattern = /^\\d+\\.\\d+\\.\\d+(?:[-+][0-9A-Za-z.-]+)?$/;\n\nexport type PackValidationSeverity = \"error\" | \"warning\";\n\nexport interface PackValidationIssue {\n code: string;\n message: string;\n path: string;\n severity: PackValidationSeverity;\n}\n\nexport interface PackManifestValidationResult {\n issues: PackValidationIssue[];\n manifestKey: string;\n valid: boolean;\n}\n\nexport interface PackSchemaDictionary {\n edgeTypes: readonly string[];\n nodeTypes: readonly string[];\n tables: readonly string[];\n}\n\nconst appPackManifestSchema = z.object({\n key: z.string().regex(manifestKeyPattern),\n name: z.string().min(1),\n version: z.string().regex(semverPattern),\n lifecycle: z.enum([\"active\", \"beta\", \"experimental\"]),\n category: z.enum([\n \"conversation\",\n \"research\",\n \"graph\",\n \"analytics\",\n \"workflow\",\n \"decision\",\n \"news\",\n \"documents\",\n \"identity\",\n \"operations\",\n \"domain\",\n ]),\n description: z.string().min(1),\n dependencies: z.array(z.string().min(1)),\n capabilityFlags: z.array(z.string().min(1)),\n routeNamespace: z.object({\n web: z.array(z.string().min(1)),\n api: z.array(z.string().min(1)),\n }),\n surfaces: z.object({\n components: z.array(z.string().min(1)),\n convex: z.array(z.string().min(1)),\n tools: z.array(z.string().min(1)),\n }),\n policyProfile: z.object({\n audiences: z.array(z.string().min(1)).min(1),\n rules: z\n .array(\n z.object({\n resource: z.enum([\n \"project\",\n \"node\",\n \"edge\",\n \"artifact\",\n \"report_section\",\n \"tool_action\",\n \"task\",\n \"user_profile\",\n \"team_analytics\",\n ]),\n actions: z\n .array(z.enum([\"read\", \"summarize\", \"export\", \"mutate\", \"admin\"]))\n .min(1),\n notes: z.string().optional(),\n })\n )\n .min(1),\n }),\n dataContract: z.object({\n requiredNodeTypes: z.array(z.string().min(1)),\n requiredEdgeTypes: z.array(z.string().min(1)),\n requiredTables: z.array(z.string().min(1)).min(1),\n projectionBehavior: z.enum([\n \"none\",\n \"inherits_policy\",\n \"projection_required\",\n ]),\n }),\n templates: z.object({\n workflows: z.array(z.string().min(1)),\n prompts: z.array(z.string().min(1)),\n reports: z.array(z.string().min(1)),\n uiLabels: z.array(z.string().min(1)),\n }),\n testSuite: z.object({\n parity: z.array(z.string().min(1)).min(1),\n policy: z.array(z.string().min(1)).min(1),\n contract: z.array(z.string().min(1)).min(1),\n }),\n sharedServices: z.array(\n z.object({\n service: z.enum([\n \"decision-kernel\",\n \"knowledge-compiler\",\n \"learning-loop\",\n ]),\n mode: z.enum([\"required\", \"optional\"]),\n contracts: z.array(z.string().min(1)).min(1),\n })\n ),\n});\n\nfunction toIssue(\n code: string,\n message: string,\n path: string,\n severity: PackValidationSeverity = \"error\"\n): PackValidationIssue {\n return {\n code,\n severity,\n message,\n path,\n };\n}\n\nfunction collectDuplicateValues(values: readonly string[]): string[] {\n const counts = new Map<string, number>();\n for (const value of values) {\n counts.set(value, (counts.get(value) ?? 0) + 1);\n }\n return [...counts.entries()]\n .filter(([, count]) => count > 1)\n .map(([value]) => value)\n .sort();\n}\n\nfunction collectUnknownValues(\n values: readonly string[],\n knownValues: readonly string[]\n): string[] {\n const known = new Set(knownValues);\n return values.filter((value) => !known.has(value));\n}\n\nfunction validateManifestShape(\n manifest: AppPackManifest\n): PackValidationIssue[] {\n const parsed = appPackManifestSchema.safeParse(manifest);\n if (parsed.success) {\n return [];\n }\n\n return parsed.error.issues.map((issue) =>\n toIssue(\n \"PACK_MANIFEST_SCHEMA_INVALID\",\n issue.message,\n issue.path.join(\".\") || \"(root)\"\n )\n );\n}\n\nfunction validateManifestUniqueness(\n manifest: AppPackManifest\n): PackValidationIssue[] {\n const issues: PackValidationIssue[] = [];\n\n const duplicateDependencies = collectDuplicateValues(manifest.dependencies);\n if (duplicateDependencies.length > 0) {\n issues.push(\n toIssue(\n \"PACK_DEPENDENCIES_DUPLICATE\",\n `Duplicate dependencies declared: ${duplicateDependencies.join(\", \")}`,\n \"dependencies\"\n )\n );\n }\n\n if (manifest.dependencies.includes(manifest.key)) {\n issues.push(\n toIssue(\n \"PACK_DEPENDENCY_SELF_REFERENCE\",\n `Pack \"${manifest.key}\" cannot depend on itself.`,\n \"dependencies\"\n )\n );\n }\n\n const duplicateCapabilities = collectDuplicateValues(\n manifest.capabilityFlags\n );\n if (duplicateCapabilities.length > 0) {\n issues.push(\n toIssue(\n \"PACK_CAPABILITIES_DUPLICATE\",\n `Duplicate capability flags declared: ${duplicateCapabilities.join(\", \")}`,\n \"capabilityFlags\"\n )\n );\n }\n\n const duplicateWebRoutes = collectDuplicateValues(\n manifest.routeNamespace.web\n );\n if (duplicateWebRoutes.length > 0) {\n issues.push(\n toIssue(\n \"PACK_WEB_ROUTES_DUPLICATE\",\n `Duplicate web routes declared: ${duplicateWebRoutes.join(\", \")}`,\n \"routeNamespace.web\"\n )\n );\n }\n\n const duplicateApiRoutes = collectDuplicateValues(\n manifest.routeNamespace.api\n );\n if (duplicateApiRoutes.length > 0) {\n issues.push(\n toIssue(\n \"PACK_API_ROUTES_DUPLICATE\",\n `Duplicate api routes declared: ${duplicateApiRoutes.join(\", \")}`,\n \"routeNamespace.api\"\n )\n );\n }\n\n const duplicateServices = collectDuplicateValues(\n manifest.sharedServices.map((integration) => integration.service)\n );\n if (duplicateServices.length > 0) {\n issues.push(\n toIssue(\n \"PACK_SHARED_SERVICE_DUPLICATE\",\n `Duplicate shared-service integrations declared: ${duplicateServices.join(\", \")}`,\n \"sharedServices\"\n )\n );\n }\n\n return issues;\n}\n\nfunction validateManifestDictionary(\n manifest: AppPackManifest,\n dictionary?: PackSchemaDictionary\n): PackValidationIssue[] {\n if (!dictionary) {\n return [];\n }\n\n const issues: PackValidationIssue[] = [];\n const unknownNodeTypes = collectUnknownValues(\n manifest.dataContract.requiredNodeTypes,\n dictionary.nodeTypes\n );\n const unknownEdgeTypes = collectUnknownValues(\n manifest.dataContract.requiredEdgeTypes,\n dictionary.edgeTypes\n );\n const unknownTables = collectUnknownValues(\n manifest.dataContract.requiredTables,\n dictionary.tables\n );\n\n if (unknownNodeTypes.length > 0) {\n issues.push(\n toIssue(\n \"PACK_UNKNOWN_NODE_TYPES\",\n `Unknown required node types: ${unknownNodeTypes.join(\", \")}`,\n \"dataContract.requiredNodeTypes\"\n )\n );\n }\n\n if (unknownEdgeTypes.length > 0) {\n issues.push(\n toIssue(\n \"PACK_UNKNOWN_EDGE_TYPES\",\n `Unknown required edge types: ${unknownEdgeTypes.join(\", \")}`,\n \"dataContract.requiredEdgeTypes\"\n )\n );\n }\n\n if (unknownTables.length > 0) {\n issues.push(\n toIssue(\n \"PACK_UNKNOWN_TABLES\",\n `Unknown required tables: ${unknownTables.join(\", \")}`,\n \"dataContract.requiredTables\"\n )\n );\n }\n\n return issues;\n}\n\nexport function validateAppPackManifest(\n manifest: AppPackManifest,\n dictionary?: PackSchemaDictionary\n): PackManifestValidationResult {\n const issues: PackValidationIssue[] = [\n ...validateManifestShape(manifest),\n ...validateManifestUniqueness(manifest),\n ...validateManifestDictionary(manifest, dictionary),\n ];\n\n return {\n manifestKey: manifest.key,\n valid: issues.every((issue) => issue.severity !== \"error\"),\n issues,\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/contracts.ts","../../src/manifests/chat-v1.ts"],"names":[],"mappings":";AA+HA,SAAS,qBAAqB,MAAA,EAA4B;AACxD,EAAA,MAAM,UAAA,GAAa,MAAA,CAChB,GAAA,CAAI,CAAC,UAAU,KAAA,CAAM,IAAA,EAAM,CAAA,CAC3B,MAAA,CAAO,CAAC,KAAA,KAAU,KAAA,CAAM,SAAS,CAAC,CAAA;AACrC,EAAA,OAAO,KAAA,CAAM,IAAA,CAAK,IAAI,GAAA,CAAI,UAAU,CAAC,CAAA;AACvC;AAEO,SAAS,sBACd,QAAA,EACiB;AACjB,EAAA,MAAM,kBAAkB,QAAA,CAAS,cAAA,IAAkB,EAAC,EAAG,GAAA,CAAI,CAAC,WAAA,MAAiB;AAAA,IAC3E,GA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S,CAAC,MAAA,EAAQ,WAAW,CAAA,EAAE;AAAA,MACtD;AAAA,QACE,QAAA,EAAU,aAAA;AAAA,QACV,OAAA,EAAS,CAAC,MAAA,EAAQ,QAAQ,CAAA;AAAA,QAC1B,KAAA,EAAO;AAAA,OACT;AAAA,MACA,EAAE,QAAA,EAAU,UAAA,EAAY,SAAS,CAAC,MAAA,EAAQ,WAAW,CAAA;AAAE;AACzD,GACF;AAAA,EACA,YAAA,EAAc;AAAA,IACZ,mBAAmB,CAAC,QAAA,EAAU,UAAA,EAAY,UAAA,EAAY,SAAS,MAAM,CAAA;AAAA,IACrE,iBAAA,EAAmB,CAAC,SAAA,EAAW,SAAA,EAAW,YAAY,CAAA;AAAA,IACtD,cAAA,EAAgB;AAAA,MACd,eAAA;AAAA,MACA,mBAAA;AAAA,MACA,2BAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,kBAAA,EAAoB;AAAA,GACtB;AAAA,EACA,SAAA,EAAW;AAAA,IACT,SAAA,EAAW,CAAC,cAAA,EAAgB,iBAAiB,CAAA;AAAA,IAC7C,OAAA,EAAS,CAAC,yBAAA,EAA2B,uBAAuB,CAAA;AAAA,IAC5D,SAAS,EAAC;AAAA,IACV,QAAA,EAAU,CAAC,MAAA,EAAQ,WAAA,EAAa,cAAc;AAAA,GAChD;AAAA,EACA,SAAA,EAAW;AAAA,IACT,MAAA,EAAQ,CAAC,uBAAA,EAAyB,sBAAsB,CAAA;AAAA,IACxD,MAAA,EAAQ,CAAC,wBAAA,EAA0B,uBAAuB,CAAA;AAAA,IAC1D,QAAA,EAAU,CAAC,uBAAuB;AAAA;AAEtC,CAAC","file":"chat-v1.js","sourcesContent":["/**\n * App Pack Contracts\n *\n * Canonical type contracts for Lucern app-pack manifests and runtime metadata.\n */\n\nexport type PackLifecycle = \"active\" | \"beta\" | \"experimental\";\n\nexport type PackCategory =\n | \"conversation\"\n | \"research\"\n | \"graph\"\n | \"analytics\"\n | \"workflow\"\n | \"decision\"\n | \"news\"\n | \"documents\"\n | \"identity\"\n | \"operations\"\n | \"domain\";\n\nexport type PackAudience = string;\n\nexport type PolicyAction = \"read\" | \"summarize\" | \"export\" | \"mutate\" | \"admin\";\n\nexport type PolicyResource =\n | \"project\"\n | \"node\"\n | \"edge\"\n | \"artifact\"\n | \"report_section\"\n | \"tool_action\"\n | \"task\"\n | \"user_profile\"\n | \"team_analytics\";\n\nexport type ProjectionBehavior =\n | \"none\"\n | \"inherits_policy\"\n | \"projection_required\";\n\nexport type PackRuntimeStage =\n | \"registered\"\n | \"validated\"\n | \"installed\"\n | \"enabled\"\n | \"degraded\"\n | \"disabled\"\n | \"removed\";\n\nexport type SharedService =\n | \"decision-kernel\"\n | \"knowledge-compiler\"\n | \"learning-loop\";\n\nexport type SharedServiceMode = \"required\" | \"optional\";\n\nexport type RouteNamespace = {\n web: string[];\n api: string[];\n};\n\nexport type SurfaceOwnership = {\n components: string[];\n convex: string[];\n tools: string[];\n};\n\nexport type PolicyRule = {\n resource: PolicyResource;\n actions: PolicyAction[];\n notes?: string;\n};\n\nexport type PolicyProfile = {\n audiences: PackAudience[];\n rules: PolicyRule[];\n};\n\nexport type DataContract = {\n requiredNodeTypes: string[];\n requiredEdgeTypes: string[];\n requiredTables: string[];\n projectionBehavior: ProjectionBehavior;\n};\n\nexport type TemplateAssets = {\n workflows: string[];\n prompts: string[];\n reports: string[];\n uiLabels: string[];\n};\n\nexport type PackTestSuite = {\n parity: string[];\n policy: string[];\n contract: string[];\n};\n\nexport type SharedServiceIntegration = {\n service: SharedService;\n mode: SharedServiceMode;\n contracts: string[];\n};\n\nexport type AppPackManifest = {\n key: string;\n name: string;\n version: string;\n lifecycle: PackLifecycle;\n category: PackCategory;\n description: string;\n dependencies: string[];\n capabilityFlags: string[];\n routeNamespace: RouteNamespace;\n surfaces: SurfaceOwnership;\n policyProfile: PolicyProfile;\n dataContract: DataContract;\n templates: TemplateAssets;\n testSuite: PackTestSuite;\n sharedServices: SharedServiceIntegration[];\n};\n\ntype AppPackManifestInput = Omit<AppPackManifest, \"sharedServices\"> & {\n sharedServices?: SharedServiceIntegration[];\n};\n\nfunction normalizeStringArray(values: string[]): string[] {\n const normalized = values\n .map((value) => value.trim())\n .filter((value) => value.length > 0);\n return Array.from(new Set(normalized));\n}\n\nexport function defineAppPackManifest(\n manifest: AppPackManifestInput\n): AppPackManifest {\n const sharedServices = (manifest.sharedServices ?? []).map((integration) => ({\n ...integration,\n contracts: normalizeStringArray(integration.contracts),\n }));\n\n return {\n ...manifest,\n dependencies: normalizeStringArray(manifest.dependencies),\n capabilityFlags: normalizeStringArray(manifest.capabilityFlags),\n sharedServices,\n };\n}\n","/**\n * App Pack Manifest: chat-v1\n *\n * Declarative runtime contract for the chat-v1 application pack.\n */\n\nimport { defineAppPackManifest } from \"../contracts\";\n\nexport const chatV1Manifest = defineAppPackManifest({\n key: \"chat-v1\",\n name: \"Chat\",\n version: \"1.0.0\",\n lifecycle: \"active\",\n category: \"conversation\",\n description:\n \"Core conversational runtime, streaming orchestration, and tool invocation shell.\",\n dependencies: [],\n capabilityFlags: [\n \"chat.streaming\",\n \"chat.history\",\n \"tool.invocation\",\n \"slash.commands\",\n \"voice.mode\",\n ],\n routeNamespace: {\n web: [\"/(chat)/chat\", \"/(chat)/chat/[id]\"],\n api: [\n \"/(chat)/api/chat\",\n \"/(chat)/api/coach\",\n \"/(chat)/api/history\",\n \"/(chat)/api/suggestions\",\n \"/(chat)/api/vote\",\n ],\n },\n surfaces: {\n components: [\n \"apps/web/components/lucern/dev/chat-debug-panel.tsx\",\n \"apps/web/app/lucern/packs/_components/pack-try-it-panel.tsx\",\n ],\n convex: [\n \"packages/reasoning-kernel/src/adapters/events.ts\",\n \"services/master-control/convex/tools.ts\",\n \"services/master-control/convex/toolAccess.ts\",\n ],\n tools: [\n \"packages/mcp/src/handlers/functionSurface.ts\",\n \"packages/server-core/src/mcp-context-tools.ts\",\n ],\n },\n policyProfile: {\n audiences: [\"internal\", \"lp\", \"public\"],\n rules: [\n { resource: \"project\", actions: [\"read\", \"summarize\"] },\n {\n resource: \"tool_action\",\n actions: [\"read\", \"mutate\"],\n notes: \"Mutation tools must pass server-side policy checks.\",\n },\n { resource: \"artifact\", actions: [\"read\", \"summarize\"] },\n ],\n },\n dataContract: {\n requiredNodeTypes: [\"belief\", \"question\", \"evidence\", \"theme\", \"deal\"],\n requiredEdgeTypes: [\"informs\", \"answers\", \"belongs_to\"],\n requiredTables: [\n \"agentMessages\",\n \"platformAgentRuns\",\n \"platformAgentRunToolCalls\",\n \"epistemicNodes\",\n ],\n projectionBehavior: \"inherits_policy\",\n },\n templates: {\n workflows: [\"chat/default\", \"chat/voice-mode\"],\n prompts: [\"chat/main-system-prompt\", \"chat/voice-mode-style\"],\n reports: [],\n uiLabels: [\"chat\", \"assistant\", \"conversation\"],\n },\n testSuite: {\n parity: [\"chat-streaming-parity\", \"slash-command-parity\"],\n policy: [\"chat-context-filtering\", \"tool-deny-enforcement\"],\n contract: [\"chat-pack-contract-v1\"],\n },\n});\n"]}
1
+ {"version":3,"sources":["../../src/contracts.ts","../../src/manifests/chat-v1.ts"],"names":[],"mappings":";AA+HA,SAAS,qBAAqB,MAAA,EAA4B;AACxD,EAAA,MAAM,UAAA,GAAa,MAAA,CAChB,GAAA,CAAI,CAAC,UAAU,KAAA,CAAM,IAAA,EAAM,CAAA,CAC3B,MAAA,CAAO,CAAC,KAAA,KAAU,KAAA,CAAM,SAAS,CAAC,CAAA;AACrC,EAAA,OAAO,KAAA,CAAM,IAAA,CAAK,IAAI,GAAA,CAAI,UAAU,CAAC,CAAA;AACvC;AAEO,SAAS,sBACd,QAAA,EACiB;AACjB,EAAA,MAAM,kBAAkB,QAAA,CAAS,cAAA,IAAkB,EAAC,EAAG,GAAA,CAAI,CAAC,WAAA,MAAiB;AAAA,IAC3E,GAAG,WAAA;AAAA,IACH,SAAA,EAAW,oBAAA,CAAqB,WAAA,CAAY,SAAS;AAAA,GACvD,CAAE,CAAA;AAEF,EAAA,OAAO;AAA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AAA,EAAQ,QAAQ,CAAA;AAAA,QAC1B,KAAA,EAAO;AAAA,OACT;AAAA,MACA,EAAE,QAAA,EAAU,UAAA,EAAY,SAAS,CAAC,MAAA,EAAQ,WAAW,CAAA;AAAE;AACzD,GACF;AAAA,EACA,YAAA,EAAc;AAAA,IACZ,mBAAmB,CAAC,QAAA,EAAU,UAAA,EAAY,UAAA,EAAY,SAAS,MAAM,CAAA;AAAA,IACrE,iBAAA,EAAmB,CAAC,SAAA,EAAW,SAAA,EAAW,YAAY,CAAA;AAAA,IACtD,cAAA,EAAgB;AAAA,MACd,eAAA;AAAA,MACA,mBAAA;AAAA,MACA,2BAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,kBAAA,EAAoB;AAAA,GACtB;AAAA,EACA,SAAA,EAAW;AAAA,IACT,SAAA,EAAW,CAAC,cAAA,EAAgB,iBAAiB,CAAA;AAAA,IAC7C,OAAA,EAAS,CAAC,yBAAA,EAA2B,uBAAuB,CAAA;AAAA,IAC5D,SAAS,EAAC;AAAA,IACV,QAAA,EAAU,CAAC,MAAA,EAAQ,WAAA,EAAa,cAAc;AAAA,GAChD;AAAA,EACA,SAAA,EAAW;AAAA,IACT,MAAA,EAAQ,CAAC,uBAAA,EAAyB,sBAAsB,CAAA;AAAA,IACxD,MAAA,EAAQ,CAAC,wBAAA,EAA0B,uBAAuB,CAAA;AAAA,IAC1D,QAAA,EAAU,CAAC,uBAAuB;AAAA;AAEtC,CAAC","file":"chat-v1.js","sourcesContent":["/**\n * App Pack Contracts\n *\n * Canonical type contracts for Lucern app-pack manifests and runtime metadata.\n */\n\nexport type PackLifecycle = \"active\" | \"beta\" | \"experimental\";\n\nexport type PackCategory =\n | \"conversation\"\n | \"research\"\n | \"graph\"\n | \"analytics\"\n | \"workflow\"\n | \"decision\"\n | \"news\"\n | \"documents\"\n | \"identity\"\n | \"operations\"\n | \"domain\";\n\nexport type PackAudience = string;\n\nexport type PolicyAction = \"read\" | \"summarize\" | \"export\" | \"mutate\" | \"admin\";\n\nexport type PolicyResource =\n | \"project\"\n | \"node\"\n | \"edge\"\n | \"artifact\"\n | \"report_section\"\n | \"tool_action\"\n | \"task\"\n | \"user_profile\"\n | \"team_analytics\";\n\nexport type ProjectionBehavior =\n | \"none\"\n | \"inherits_policy\"\n | \"projection_required\";\n\nexport type PackRuntimeStage =\n | \"registered\"\n | \"validated\"\n | \"installed\"\n | \"enabled\"\n | \"degraded\"\n | \"disabled\"\n | \"removed\";\n\nexport type SharedService =\n | \"decision-kernel\"\n | \"knowledge-compiler\"\n | \"learning-loop\";\n\nexport type SharedServiceMode = \"required\" | \"optional\";\n\nexport interface RouteNamespace {\n api: string[];\n web: string[];\n}\n\nexport interface SurfaceOwnership {\n components: string[];\n convex: string[];\n tools: string[];\n}\n\nexport interface PolicyRule {\n actions: PolicyAction[];\n notes?: string;\n resource: PolicyResource;\n}\n\nexport interface PolicyProfile {\n audiences: PackAudience[];\n rules: PolicyRule[];\n}\n\nexport interface DataContract {\n projectionBehavior: ProjectionBehavior;\n requiredEdgeTypes: string[];\n requiredNodeTypes: string[];\n requiredTables: string[];\n}\n\nexport interface TemplateAssets {\n prompts: string[];\n reports: string[];\n uiLabels: string[];\n workflows: string[];\n}\n\nexport interface PackTestSuite {\n contract: string[];\n parity: string[];\n policy: string[];\n}\n\nexport interface SharedServiceIntegration {\n contracts: string[];\n mode: SharedServiceMode;\n service: SharedService;\n}\n\nexport interface AppPackManifest {\n capabilityFlags: string[];\n category: PackCategory;\n dataContract: DataContract;\n dependencies: string[];\n description: string;\n key: string;\n lifecycle: PackLifecycle;\n name: string;\n policyProfile: PolicyProfile;\n routeNamespace: RouteNamespace;\n sharedServices: SharedServiceIntegration[];\n surfaces: SurfaceOwnership;\n templates: TemplateAssets;\n testSuite: PackTestSuite;\n version: string;\n}\n\ntype AppPackManifestInput = Omit<AppPackManifest, \"sharedServices\"> & {\n sharedServices?: SharedServiceIntegration[];\n};\n\nfunction normalizeStringArray(values: string[]): string[] {\n const normalized = values\n .map((value) => value.trim())\n .filter((value) => value.length > 0);\n return Array.from(new Set(normalized));\n}\n\nexport function defineAppPackManifest(\n manifest: AppPackManifestInput\n): AppPackManifest {\n const sharedServices = (manifest.sharedServices ?? []).map((integration) => ({\n ...integration,\n contracts: normalizeStringArray(integration.contracts),\n }));\n\n return {\n ...manifest,\n dependencies: normalizeStringArray(manifest.dependencies),\n capabilityFlags: normalizeStringArray(manifest.capabilityFlags),\n sharedServices,\n };\n}\n","/**\n * App Pack Manifest: chat-v1\n *\n * Declarative runtime contract for the chat-v1 application pack.\n */\n\nimport { defineAppPackManifest } from \"../contracts\";\n\nexport const chatV1Manifest = defineAppPackManifest({\n key: \"chat-v1\",\n name: \"Chat\",\n version: \"1.0.0\",\n lifecycle: \"active\",\n category: \"conversation\",\n description:\n \"Core conversational runtime, streaming orchestration, and tool invocation shell.\",\n dependencies: [],\n capabilityFlags: [\n \"chat.streaming\",\n \"chat.history\",\n \"tool.invocation\",\n \"slash.commands\",\n \"voice.mode\",\n ],\n routeNamespace: {\n web: [\"/(chat)/chat\", \"/(chat)/chat/[id]\"],\n api: [\n \"/(chat)/api/chat\",\n \"/(chat)/api/coach\",\n \"/(chat)/api/history\",\n \"/(chat)/api/suggestions\",\n \"/(chat)/api/vote\",\n ],\n },\n surfaces: {\n components: [\n \"apps/web/components/lucern/dev/chat-debug-panel.tsx\",\n \"apps/web/app/lucern/packs/_components/pack-try-it-panel.tsx\",\n ],\n convex: [\n \"packages/reasoning-kernel/src/adapters/events.ts\",\n \"services/master-control/convex/tools.ts\",\n \"services/master-control/convex/toolAccess.ts\",\n ],\n tools: [\n \"packages/mcp/src/handlers/functionSurface.ts\",\n \"packages/server-core/src/mcp-context-tools.ts\",\n ],\n },\n policyProfile: {\n audiences: [\"internal\", \"lp\", \"public\"],\n rules: [\n { resource: \"project\", actions: [\"read\", \"summarize\"] },\n {\n resource: \"tool_action\",\n actions: [\"read\", \"mutate\"],\n notes: \"Mutation tools must pass server-side policy checks.\",\n },\n { resource: \"artifact\", actions: [\"read\", \"summarize\"] },\n ],\n },\n dataContract: {\n requiredNodeTypes: [\"belief\", \"question\", \"evidence\", \"theme\", \"deal\"],\n requiredEdgeTypes: [\"informs\", \"answers\", \"belongs_to\"],\n requiredTables: [\n \"agentMessages\",\n \"platformAgentRuns\",\n \"platformAgentRunToolCalls\",\n \"epistemicNodes\",\n ],\n projectionBehavior: \"inherits_policy\",\n },\n templates: {\n workflows: [\"chat/default\", \"chat/voice-mode\"],\n prompts: [\"chat/main-system-prompt\", \"chat/voice-mode-style\"],\n reports: [],\n uiLabels: [\"chat\", \"assistant\", \"conversation\"],\n },\n testSuite: {\n parity: [\"chat-streaming-parity\", \"slash-command-parity\"],\n policy: [\"chat-context-filtering\", \"tool-deny-enforcement\"],\n contract: [\"chat-pack-contract-v1\"],\n },\n});\n"]}
@@ -24,12 +24,7 @@ var dealsV1Manifest = defineAppPackManifest({
24
24
  lifecycle: "beta",
25
25
  category: "domain",
26
26
  description: "Deal diligence application using shared reasoning graph primitives with deal-calibrated workflows.",
27
- dependencies: [
28
- "chat-v1",
29
- "documents-v1",
30
- "news-v1",
31
- "decisions-v1"
32
- ],
27
+ dependencies: ["chat-v1", "documents-v1", "news-v1", "decisions-v1"],
33
28
  capabilityFlags: [
34
29
  "deal.lifecycle",
35
30
  "diligence.workflow",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/contracts.ts","../../src/manifests/deals-v1.ts"],"names":[],"mappings":";AA+HA,SAAS,qBAAqB,MAAA,EAA4B;AACxD,EAAA,MAAM,UAAA,GAAa,MAAA,CAChB,GAAA,CAAI,CAAC,UAAU,KAAA,CAAM,IAAA,EAAM,CAAA,CAC3B,MAAA,CAAO,CAAC,KAAA,KAAU,KAAA,CAAM,SAAS,CAAC,CAAA;AACrC,EAAA,OAAO,KAAA,CAAM,IAAA,CAAK,IAAI,GAAA,CAAI,UAAU,CAAC,CAAA;AACvC;AAEO,SAAS,sBACd,QAAA,EACiB;AACjB,EAAA,MA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A,EACA,cAAA,EAAgB;AAAA,IACd;AAAA,MACE,OAAA,EAAS,iBAAA;AAAA,MACT,IAAA,EAAM,UAAA;AAAA,MACN,SAAA,EAAW,CAAC,oBAAoB;AAAA,KAClC;AAAA,IACA;AAAA,MACE,OAAA,EAAS,oBAAA;AAAA,MACT,IAAA,EAAM,UAAA;AAAA,MACN,SAAA,EAAW,CAAC,uBAAuB;AAAA;AACrC;AAEJ,CAAC","file":"deals-v1.js","sourcesContent":["/**\n * App Pack Contracts\n *\n * Canonical type contracts for Lucern app-pack manifests and runtime metadata.\n */\n\nexport type PackLifecycle = \"active\" | \"beta\" | \"experimental\";\n\nexport type PackCategory =\n | \"conversation\"\n | \"research\"\n | \"graph\"\n | \"analytics\"\n | \"workflow\"\n | \"decision\"\n | \"news\"\n | \"documents\"\n | \"identity\"\n | \"operations\"\n | \"domain\";\n\nexport type PackAudience = string;\n\nexport type PolicyAction = \"read\" | \"summarize\" | \"export\" | \"mutate\" | \"admin\";\n\nexport type PolicyResource =\n | \"project\"\n | \"node\"\n | \"edge\"\n | \"artifact\"\n | \"report_section\"\n | \"tool_action\"\n | \"task\"\n | \"user_profile\"\n | \"team_analytics\";\n\nexport type ProjectionBehavior =\n | \"none\"\n | \"inherits_policy\"\n | \"projection_required\";\n\nexport type PackRuntimeStage =\n | \"registered\"\n | \"validated\"\n | \"installed\"\n | \"enabled\"\n | \"degraded\"\n | \"disabled\"\n | \"removed\";\n\nexport type SharedService =\n | \"decision-kernel\"\n | \"knowledge-compiler\"\n | \"learning-loop\";\n\nexport type SharedServiceMode = \"required\" | \"optional\";\n\nexport type RouteNamespace = {\n web: string[];\n api: string[];\n};\n\nexport type SurfaceOwnership = {\n components: string[];\n convex: string[];\n tools: string[];\n};\n\nexport type PolicyRule = {\n resource: PolicyResource;\n actions: PolicyAction[];\n notes?: string;\n};\n\nexport type PolicyProfile = {\n audiences: PackAudience[];\n rules: PolicyRule[];\n};\n\nexport type DataContract = {\n requiredNodeTypes: string[];\n requiredEdgeTypes: string[];\n requiredTables: string[];\n projectionBehavior: ProjectionBehavior;\n};\n\nexport type TemplateAssets = {\n workflows: string[];\n prompts: string[];\n reports: string[];\n uiLabels: string[];\n};\n\nexport type PackTestSuite = {\n parity: string[];\n policy: string[];\n contract: string[];\n};\n\nexport type SharedServiceIntegration = {\n service: SharedService;\n mode: SharedServiceMode;\n contracts: string[];\n};\n\nexport type AppPackManifest = {\n key: string;\n name: string;\n version: string;\n lifecycle: PackLifecycle;\n category: PackCategory;\n description: string;\n dependencies: string[];\n capabilityFlags: string[];\n routeNamespace: RouteNamespace;\n surfaces: SurfaceOwnership;\n policyProfile: PolicyProfile;\n dataContract: DataContract;\n templates: TemplateAssets;\n testSuite: PackTestSuite;\n sharedServices: SharedServiceIntegration[];\n};\n\ntype AppPackManifestInput = Omit<AppPackManifest, \"sharedServices\"> & {\n sharedServices?: SharedServiceIntegration[];\n};\n\nfunction normalizeStringArray(values: string[]): string[] {\n const normalized = values\n .map((value) => value.trim())\n .filter((value) => value.length > 0);\n return Array.from(new Set(normalized));\n}\n\nexport function defineAppPackManifest(\n manifest: AppPackManifestInput\n): AppPackManifest {\n const sharedServices = (manifest.sharedServices ?? []).map((integration) => ({\n ...integration,\n contracts: normalizeStringArray(integration.contracts),\n }));\n\n return {\n ...manifest,\n dependencies: normalizeStringArray(manifest.dependencies),\n capabilityFlags: normalizeStringArray(manifest.capabilityFlags),\n sharedServices,\n };\n}\n","/**\n * App Pack Manifest: deals-v1\n *\n * Declarative runtime contract for the deals-v1 application pack.\n */\n\nimport { defineAppPackManifest } from \"../contracts\";\n\nexport const dealsV1Manifest = defineAppPackManifest({\n key: \"deals-v1\",\n name: \"Deals\",\n version: \"1.0.0\",\n lifecycle: \"beta\",\n category: \"domain\",\n description:\n \"Deal diligence application using shared reasoning graph primitives with deal-calibrated workflows.\",\n dependencies: [\n \"chat-v1\",\n \"documents-v1\",\n \"news-v1\",\n \"decisions-v1\",\n ],\n capabilityFlags: [\n \"deal.lifecycle\",\n \"diligence.workflow\",\n \"deal.risk-assessment\",\n \"decision.integration\",\n ],\n routeNamespace: {\n web: [\"/(projects)/projects\", \"/(projects)/projects/[projectId]\"],\n api: [\"/api/research/*\", \"/api/tasks/*\", \"/api/reports/*\"],\n },\n surfaces: {\n components: [\n \"apps/web/app/lucern/tenant/workspaces/page.tsx\",\n \"apps/web/app/lucern/tenant/_components/workspaces/*\",\n ],\n convex: [\n \"packages/reasoning-kernel/src/adapters/topics.ts\",\n \"packages/reasoning-kernel/src/adapters/decisions.ts\",\n \"services/master-control/convex/workspaces.ts\",\n ],\n tools: [\n \"packages/server-core/src/domain/topics.ts\",\n \"packages/server-core/src/domain/worktrees.ts\",\n ],\n },\n policyProfile: {\n audiences: [\"internal\", \"lp\"],\n rules: [\n { resource: \"project\", actions: [\"read\", \"summarize\", \"mutate\"] },\n { resource: \"node\", actions: [\"read\", \"summarize\", \"mutate\"] },\n { resource: \"artifact\", actions: [\"read\", \"summarize\", \"export\"] },\n { resource: \"tool_action\", actions: [\"read\", \"mutate\"] },\n ],\n },\n dataContract: {\n requiredNodeTypes: [\"deal\", \"belief\", \"question\", \"evidence\", \"decision\"],\n requiredEdgeTypes: [\n \"evaluates\",\n \"informs\",\n \"depends_on\",\n \"based_on_belief\",\n ],\n requiredTables: [\n \"topics\",\n \"epistemicNodes\",\n \"epistemicEdges\",\n \"decisionEvents\",\n ],\n projectionBehavior: \"projection_required\",\n },\n templates: {\n workflows: [\"deals/diligence-default\", \"deals/ic-prep\"],\n prompts: [\"deals/main-system-prompt\", \"deals/risk-ledger-draft\"],\n reports: [\"deal-memo\", \"knowledge-map\"],\n uiLabels: [\"deal\", \"diligence\", \"investment_case\", \"ic_readiness\"],\n },\n testSuite: {\n parity: [\"deal-workflow-parity\"],\n policy: [\"deal-data-audience-filtering\"],\n contract: [\"deals-pack-contract-v1\"],\n },\n sharedServices: [\n {\n service: \"decision-kernel\",\n mode: \"required\",\n contracts: [\"decision-kernel-v1\"],\n },\n {\n service: \"knowledge-compiler\",\n mode: \"required\",\n contracts: [\"knowledge-compiler-v1\"],\n },\n ],\n});\n"]}
1
+ {"version":3,"sources":["../../src/contracts.ts","../../src/manifests/deals-v1.ts"],"names":[],"mappings":";AA+HA,SAAS,qBAAqB,MAAA,EAA4B;AACxD,EAAA,MAAM,UAAA,GAAa,MAAA,CAChB,GAAA,CAAI,CAAC,UAAU,KAAA,CAAM,IAAA,EAAM,CAAA,CAC3B,MAAA,CAAO,CAAC,KAAA,KAAU,KAAA,CAAM,SAAS,CAAC,CAAA;AACrC,EAAA,OAAO,KAAA,CAAM,IAAA,CAAK,IAAI,GAAA,CAAI,UAAU,CAAC,CAAA;AACvC;AAEO,SAAS,sBACd,QAAA,EACiB;AACjB,EAAA,MAAM,kBAAkB,QAAA,CAAS,cAAA,IAAkB,EAAC,EAAG,GAAA,CAAI,CAAC,WAAA,MAAiB;AAAA,IAC3E,GAAG,WAAA;AAAA,IACH,SAAA,EAAW,oBAAA,CAAqB,WAAA,CAAY,SAAS;AAAA,GACvD,CAAE,CAAA;AAEF,EAAA,OAAO;AAAA,IACL,GAAG,QAAA;AAAA,IACH,YAAA,EAAc,oBAAA,CAAqB,QAAA,CAAS,YAAY,CAAA;AAAA,IACxD,eAAA,EAAiB,oBAAA,CAAqB,QAAA,CAAS,eAAe,CAAA;AAAA,IAC9D;AAAA,GACF;AACF;;;AC5IO,IAAM,kBAAkB,qBAAA,CAAsB;AAAA,EACnD,GAAA,EAAK,UAAA;AAAA,EACL,IAAA,EAAM,OAAA;AAAA,EACN,OAAA,EAAS,OAAA;AAAA,EACT,SAAA,EAAW,MAAA;AAAA,EACX,QAAA,EAAU,QAAA;AAAA,EACV,WAAA,EACE,oGAAA;AAAA,EACF,YAAA,EAAc,CAAC,SAAA,EAAW,cAAA,EAAgB,WAAW,cAAc,CAAA;AAAA,EACnE,eAAA,EAAiB;AAAA,IACf,gBAAA;AAAA,IACA,oBAAA;AAAA,IACA,sBAAA;AAAA,IACA;AAAA,GACF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;AAAA,EACA,SAAA,EAAW;AAAA,IACT,SAAA,EAAW,CAAC,yBAAA,EAA2B,eAAe,CAAA;AAAA,IACtD,OAAA,EAAS,CAAC,0BAAA,EAA4B,yBAAyB,CAAA;AAAA,IAC/D,OAAA,EAAS,CAAC,WAAA,EAAa,eAAe,CAAA;AAAA,IACtC,QAAA,EAAU,CAAC,MAAA,EAAQ,WAAA,EAAa,mBAAmB,cAAc;AAAA,GACnE;AAAA,EACA,SAAA,EAAW;AAAA,IACT,MAAA,EAAQ,CAAC,sBAAsB,CAAA;AAAA,IAC/B,MAAA,EAAQ,CAAC,8BAA8B,CAAA;AAAA,IACvC,QAAA,EAAU,CAAC,wBAAwB;AAAA,GACrC;AAAA,EACA,cAAA,EAAgB;AAAA,IACd;AAAA,MACE,OAAA,EAAS,iBAAA;AAAA,MACT,IAAA,EAAM,UAAA;AAAA,MACN,SAAA,EAAW,CAAC,oBAAoB;AAAA,KAClC;AAAA,IACA;AAAA,MACE,OAAA,EAAS,oBAAA;AAAA,MACT,IAAA,EAAM,UAAA;AAAA,MACN,SAAA,EAAW,CAAC,uBAAuB;AAAA;AACrC;AAEJ,CAAC","file":"deals-v1.js","sourcesContent":["/**\n * App Pack Contracts\n *\n * Canonical type contracts for Lucern app-pack manifests and runtime metadata.\n */\n\nexport type PackLifecycle = \"active\" | \"beta\" | \"experimental\";\n\nexport type PackCategory =\n | \"conversation\"\n | \"research\"\n | \"graph\"\n | \"analytics\"\n | \"workflow\"\n | \"decision\"\n | \"news\"\n | \"documents\"\n | \"identity\"\n | \"operations\"\n | \"domain\";\n\nexport type PackAudience = string;\n\nexport type PolicyAction = \"read\" | \"summarize\" | \"export\" | \"mutate\" | \"admin\";\n\nexport type PolicyResource =\n | \"project\"\n | \"node\"\n | \"edge\"\n | \"artifact\"\n | \"report_section\"\n | \"tool_action\"\n | \"task\"\n | \"user_profile\"\n | \"team_analytics\";\n\nexport type ProjectionBehavior =\n | \"none\"\n | \"inherits_policy\"\n | \"projection_required\";\n\nexport type PackRuntimeStage =\n | \"registered\"\n | \"validated\"\n | \"installed\"\n | \"enabled\"\n | \"degraded\"\n | \"disabled\"\n | \"removed\";\n\nexport type SharedService =\n | \"decision-kernel\"\n | \"knowledge-compiler\"\n | \"learning-loop\";\n\nexport type SharedServiceMode = \"required\" | \"optional\";\n\nexport interface RouteNamespace {\n api: string[];\n web: string[];\n}\n\nexport interface SurfaceOwnership {\n components: string[];\n convex: string[];\n tools: string[];\n}\n\nexport interface PolicyRule {\n actions: PolicyAction[];\n notes?: string;\n resource: PolicyResource;\n}\n\nexport interface PolicyProfile {\n audiences: PackAudience[];\n rules: PolicyRule[];\n}\n\nexport interface DataContract {\n projectionBehavior: ProjectionBehavior;\n requiredEdgeTypes: string[];\n requiredNodeTypes: string[];\n requiredTables: string[];\n}\n\nexport interface TemplateAssets {\n prompts: string[];\n reports: string[];\n uiLabels: string[];\n workflows: string[];\n}\n\nexport interface PackTestSuite {\n contract: string[];\n parity: string[];\n policy: string[];\n}\n\nexport interface SharedServiceIntegration {\n contracts: string[];\n mode: SharedServiceMode;\n service: SharedService;\n}\n\nexport interface AppPackManifest {\n capabilityFlags: string[];\n category: PackCategory;\n dataContract: DataContract;\n dependencies: string[];\n description: string;\n key: string;\n lifecycle: PackLifecycle;\n name: string;\n policyProfile: PolicyProfile;\n routeNamespace: RouteNamespace;\n sharedServices: SharedServiceIntegration[];\n surfaces: SurfaceOwnership;\n templates: TemplateAssets;\n testSuite: PackTestSuite;\n version: string;\n}\n\ntype AppPackManifestInput = Omit<AppPackManifest, \"sharedServices\"> & {\n sharedServices?: SharedServiceIntegration[];\n};\n\nfunction normalizeStringArray(values: string[]): string[] {\n const normalized = values\n .map((value) => value.trim())\n .filter((value) => value.length > 0);\n return Array.from(new Set(normalized));\n}\n\nexport function defineAppPackManifest(\n manifest: AppPackManifestInput\n): AppPackManifest {\n const sharedServices = (manifest.sharedServices ?? []).map((integration) => ({\n ...integration,\n contracts: normalizeStringArray(integration.contracts),\n }));\n\n return {\n ...manifest,\n dependencies: normalizeStringArray(manifest.dependencies),\n capabilityFlags: normalizeStringArray(manifest.capabilityFlags),\n sharedServices,\n };\n}\n","/**\n * App Pack Manifest: deals-v1\n *\n * Declarative runtime contract for the deals-v1 application pack.\n */\n\nimport { defineAppPackManifest } from \"../contracts\";\n\nexport const dealsV1Manifest = defineAppPackManifest({\n key: \"deals-v1\",\n name: \"Deals\",\n version: \"1.0.0\",\n lifecycle: \"beta\",\n category: \"domain\",\n description:\n \"Deal diligence application using shared reasoning graph primitives with deal-calibrated workflows.\",\n dependencies: [\"chat-v1\", \"documents-v1\", \"news-v1\", \"decisions-v1\"],\n capabilityFlags: [\n \"deal.lifecycle\",\n \"diligence.workflow\",\n \"deal.risk-assessment\",\n \"decision.integration\",\n ],\n routeNamespace: {\n web: [\"/(projects)/projects\", \"/(projects)/projects/[projectId]\"],\n api: [\"/api/research/*\", \"/api/tasks/*\", \"/api/reports/*\"],\n },\n surfaces: {\n components: [\n \"apps/web/app/lucern/tenant/workspaces/page.tsx\",\n \"apps/web/app/lucern/tenant/_components/workspaces/*\",\n ],\n convex: [\n \"packages/reasoning-kernel/src/adapters/topics.ts\",\n \"packages/reasoning-kernel/src/adapters/decisions.ts\",\n \"services/master-control/convex/workspaces.ts\",\n ],\n tools: [\n \"packages/server-core/src/domain/topics.ts\",\n \"packages/server-core/src/domain/worktrees.ts\",\n ],\n },\n policyProfile: {\n audiences: [\"internal\", \"lp\"],\n rules: [\n { resource: \"project\", actions: [\"read\", \"summarize\", \"mutate\"] },\n { resource: \"node\", actions: [\"read\", \"summarize\", \"mutate\"] },\n { resource: \"artifact\", actions: [\"read\", \"summarize\", \"export\"] },\n { resource: \"tool_action\", actions: [\"read\", \"mutate\"] },\n ],\n },\n dataContract: {\n requiredNodeTypes: [\"deal\", \"belief\", \"question\", \"evidence\", \"decision\"],\n requiredEdgeTypes: [\n \"evaluates\",\n \"informs\",\n \"depends_on\",\n \"based_on_belief\",\n ],\n requiredTables: [\n \"topics\",\n \"epistemicNodes\",\n \"epistemicEdges\",\n \"decisionEvents\",\n ],\n projectionBehavior: \"projection_required\",\n },\n templates: {\n workflows: [\"deals/diligence-default\", \"deals/ic-prep\"],\n prompts: [\"deals/main-system-prompt\", \"deals/risk-ledger-draft\"],\n reports: [\"deal-memo\", \"knowledge-map\"],\n uiLabels: [\"deal\", \"diligence\", \"investment_case\", \"ic_readiness\"],\n },\n testSuite: {\n parity: [\"deal-workflow-parity\"],\n policy: [\"deal-data-audience-filtering\"],\n contract: [\"deals-pack-contract-v1\"],\n },\n sharedServices: [\n {\n service: \"decision-kernel\",\n mode: \"required\",\n contracts: [\"decision-kernel-v1\"],\n },\n {\n service: \"knowledge-compiler\",\n mode: \"required\",\n contracts: [\"knowledge-compiler-v1\"],\n },\n ],\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/contracts.ts","../../src/manifests/decisions-v1.ts"],"names":[],"mappings":";AA+HA,SAAS,qBAAqB,MAAA,EAA4B;AACxD,EAAA,MAAM,UAAA,GAAa,MAAA,CAChB,GAAA,CAAI,CAAC,UAAU,KAAA,CAAM,IAAA,EAAM,CAAA,CAC3B,MAAA,CAAO,CAAC,KAAA,KAAU,KAAA,CAAM,SAAS,CAAC,CAAA;AACrC,EAAA,OAAO,KAAA,CAAM,IAAA,CAAK,IAAI,GAAA,CAAI,UAAU,CAAC,CAAA;AACvC;AAEO,SAAS,sBACd,QAAA,EACiB;AACjB,EAAA,MAAM,kBAAkB,QAAA,CAAS,cAAA,IAAkB,EAAC,EAAG,GAAA,CAAI,CAAC,WAAA,MAAiB;AAAA,IAC3E,GAAG,WAAA;AAAA,IACH,SAAA,EAAW,oBAAA,CAAqB,WAAA,CAAY,SAAS;AAAA,GACvD,CAAE,CAAA;AAEF,EAAA,OAAO;AAAA,IACL,GAAG,QAAA;AAAA,IACH,YAAA,EAAc,oBAAA,CAAqB,QAAA,CAAS,YAAY,CAAA;AAAA,IACxD,eAAA,EAAiB,oBAAA,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EAAQ,QAAQ,CAAA;AAAE;AACtD,GACF;AAAA,EACA,YAAA,EAAc;AAAA,IACZ,mBAAmB,CAAC,UAAA,EAAY,QAAA,EAAU,UAAA,EAAY,YAAY,OAAO,CAAA;AAAA,IACzE,iBAAA,EAAmB;AAAA,MACjB,iBAAA;AAAA,MACA,mBAAA;AAAA,MACA,mBAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,cAAA,EAAgB;AAAA,MACd,gBAAA;AAAA,MACA,gBAAA;AAAA,MACA,gBAAA;AAAA,MACA,aAAA;AAAA,MACA,oBAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,kBAAA,EAAoB;AAAA,GACtB;AAAA,EACA,SAAA,EAAW;AAAA,IACT,SAAA,EAAW,CAAC,kBAAA,EAAoB,iBAAA,EAAmB,mBAAmB,CAAA;AAAA,IACtE,OAAA,EAAS;AAAA,MACP,8BAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,OAAA,EAAS,CAAC,gBAAA,EAAkB,SAAS,CAAA;AAAA,IACrC,QAAA,EAAU,CAAC,UAAA,EAAY,aAAA,EAAe,YAAY,UAAU;AAAA,GAC9D;AAAA,EACA,SAAA,EAAW;AAAA,IACT,MAAA,EAAQ,CAAC,sBAAsB,CAAA;AAAA,IAC/B,MAAA,EAAQ,CAAC,6BAA6B,CAAA;AAAA,IACtC,QAAA,EAAU,CAAC,4BAA4B;AAAA,GACzC;AAAA,EACA,cAAA,EAAgB;AAAA,IACd;AAAA,MACE,OAAA,EAAS,iBAAA;AAAA,MACT,IAAA,EAAM,UAAA;AAAA,MACN,SAAA,EAAW,CAAC,oBAAoB;AAAA,KAClC;AAAA,IACA;AAAA,MACE,OAAA,EAAS,oBAAA;AAAA,MACT,IAAA,EAAM,UAAA;AAAA,MACN,SAAA,EAAW,CAAC,uBAAuB;AAAA;AACrC;AAEJ,CAAC","file":"decisions-v1.js","sourcesContent":["/**\n * App Pack Contracts\n *\n * Canonical type contracts for Lucern app-pack manifests and runtime metadata.\n */\n\nexport type PackLifecycle = \"active\" | \"beta\" | \"experimental\";\n\nexport type PackCategory =\n | \"conversation\"\n | \"research\"\n | \"graph\"\n | \"analytics\"\n | \"workflow\"\n | \"decision\"\n | \"news\"\n | \"documents\"\n | \"identity\"\n | \"operations\"\n | \"domain\";\n\nexport type PackAudience = string;\n\nexport type PolicyAction = \"read\" | \"summarize\" | \"export\" | \"mutate\" | \"admin\";\n\nexport type PolicyResource =\n | \"project\"\n | \"node\"\n | \"edge\"\n | \"artifact\"\n | \"report_section\"\n | \"tool_action\"\n | \"task\"\n | \"user_profile\"\n | \"team_analytics\";\n\nexport type ProjectionBehavior =\n | \"none\"\n | \"inherits_policy\"\n | \"projection_required\";\n\nexport type PackRuntimeStage =\n | \"registered\"\n | \"validated\"\n | \"installed\"\n | \"enabled\"\n | \"degraded\"\n | \"disabled\"\n | \"removed\";\n\nexport type SharedService =\n | \"decision-kernel\"\n | \"knowledge-compiler\"\n | \"learning-loop\";\n\nexport type SharedServiceMode = \"required\" | \"optional\";\n\nexport type RouteNamespace = {\n web: string[];\n api: string[];\n};\n\nexport type SurfaceOwnership = {\n components: string[];\n convex: string[];\n tools: string[];\n};\n\nexport type PolicyRule = {\n resource: PolicyResource;\n actions: PolicyAction[];\n notes?: string;\n};\n\nexport type PolicyProfile = {\n audiences: PackAudience[];\n rules: PolicyRule[];\n};\n\nexport type DataContract = {\n requiredNodeTypes: string[];\n requiredEdgeTypes: string[];\n requiredTables: string[];\n projectionBehavior: ProjectionBehavior;\n};\n\nexport type TemplateAssets = {\n workflows: string[];\n prompts: string[];\n reports: string[];\n uiLabels: string[];\n};\n\nexport type PackTestSuite = {\n parity: string[];\n policy: string[];\n contract: string[];\n};\n\nexport type SharedServiceIntegration = {\n service: SharedService;\n mode: SharedServiceMode;\n contracts: string[];\n};\n\nexport type AppPackManifest = {\n key: string;\n name: string;\n version: string;\n lifecycle: PackLifecycle;\n category: PackCategory;\n description: string;\n dependencies: string[];\n capabilityFlags: string[];\n routeNamespace: RouteNamespace;\n surfaces: SurfaceOwnership;\n policyProfile: PolicyProfile;\n dataContract: DataContract;\n templates: TemplateAssets;\n testSuite: PackTestSuite;\n sharedServices: SharedServiceIntegration[];\n};\n\ntype AppPackManifestInput = Omit<AppPackManifest, \"sharedServices\"> & {\n sharedServices?: SharedServiceIntegration[];\n};\n\nfunction normalizeStringArray(values: string[]): string[] {\n const normalized = values\n .map((value) => value.trim())\n .filter((value) => value.length > 0);\n return Array.from(new Set(normalized));\n}\n\nexport function defineAppPackManifest(\n manifest: AppPackManifestInput\n): AppPackManifest {\n const sharedServices = (manifest.sharedServices ?? []).map((integration) => ({\n ...integration,\n contracts: normalizeStringArray(integration.contracts),\n }));\n\n return {\n ...manifest,\n dependencies: normalizeStringArray(manifest.dependencies),\n capabilityFlags: normalizeStringArray(manifest.capabilityFlags),\n sharedServices,\n };\n}\n","/**\n * App Pack Manifest: decisions-v1\n *\n * Declarative runtime contract for the decisions-v1 application pack.\n */\n\nimport { defineAppPackManifest } from \"../contracts\";\n\nexport const decisionsV1Manifest = defineAppPackManifest({\n key: \"decisions-v1\",\n name: \"Decisions\",\n version: \"1.0.0\",\n lifecycle: \"beta\",\n category: \"decision\",\n description:\n \"Graph-native decision workflow with belief-level voting, risk ledgers, and snapshot locking.\",\n dependencies: [\"epistemic-algorithms-v1\"],\n capabilityFlags: [\n \"decision.workflow\",\n \"belief.level-voting\",\n \"risk.ledger\",\n \"decision.snapshot\",\n ],\n routeNamespace: {\n web: [\"/(projects)/projects/[projectId]/decisions\"],\n api: [\"/api/thesis-audit/*\", \"/api/reports/*\"],\n },\n surfaces: {\n components: [\n \"apps/web/app/lucern/tenant/policy/page.tsx\",\n \"apps/web/app/lucern/mc/policy/page.tsx\",\n ],\n convex: [\n \"packages/reasoning-kernel/src/adapters/decisions.ts\",\n \"packages/reasoning-kernel/src/adapters/questionsConvictionMutations.ts\",\n \"packages/reasoning-kernel/src/adapters/beliefs.confidence.ts\",\n ],\n tools: [\n \"packages/mcp/src/handlers/judgments.ts\",\n \"packages/server-core/src/policy/index.ts\",\n ],\n },\n policyProfile: {\n audiences: [\"internal\", \"lp\"],\n rules: [\n { resource: \"project\", actions: [\"read\", \"summarize\", \"mutate\"] },\n { resource: \"node\", actions: [\"read\", \"summarize\", \"mutate\"] },\n { resource: \"edge\", actions: [\"read\", \"mutate\"] },\n { resource: \"artifact\", actions: [\"read\", \"export\"] },\n ],\n },\n dataContract: {\n requiredNodeTypes: [\"decision\", \"belief\", \"question\", \"evidence\", \"theme\"],\n requiredEdgeTypes: [\n \"based_on_belief\",\n \"based_on_question\",\n \"informed_by_theme\",\n \"blocked_by_contradiction\",\n ],\n requiredTables: [\n \"epistemicNodes\",\n \"epistemicEdges\",\n \"decisionEvents\",\n \"beliefVotes\",\n \"decisionRiskLedger\",\n \"decisionSnapshots\",\n ],\n projectionBehavior: \"projection_required\",\n },\n templates: {\n workflows: [\"decisions/pre-ic\", \"decisions/in-ic\", \"decisions/post-ic\"],\n prompts: [\n \"decisions/main-system-prompt\",\n \"decisions/risk-ledger-assistant\",\n ],\n reports: [\"decision-brief\", \"ic-memo\"],\n uiLabels: [\"decision\", \"risk_ledger\", \"vote_map\", \"snapshot\"],\n },\n testSuite: {\n parity: [\"decision-flow-parity\"],\n policy: [\"decision-lineage-visibility\"],\n contract: [\"decisions-pack-contract-v1\"],\n },\n sharedServices: [\n {\n service: \"decision-kernel\",\n mode: \"required\",\n contracts: [\"decision-kernel-v1\"],\n },\n {\n service: \"knowledge-compiler\",\n mode: \"required\",\n contracts: [\"knowledge-compiler-v1\"],\n },\n ],\n});\n"]}
1
+ {"version":3,"sources":["../../src/contracts.ts","../../src/manifests/decisions-v1.ts"],"names":[],"mappings":";AA+HA,SAAS,qBAAqB,MAAA,EAA4B;AACxD,EAAA,MAAM,UAAA,GAAa,MAAA,CAChB,GAAA,CAAI,CAAC,UAAU,KAAA,CAAM,IAAA,EAAM,CAAA,CAC3B,MAAA,CAAO,CAAC,KAAA,KAAU,KAAA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AAC,sBAAsB,CAAA;AAAA,IAC/B,MAAA,EAAQ,CAAC,6BAA6B,CAAA;AAAA,IACtC,QAAA,EAAU,CAAC,4BAA4B;AAAA,GACzC;AAAA,EACA,cAAA,EAAgB;AAAA,IACd;AAAA,MACE,OAAA,EAAS,iBAAA;AAAA,MACT,IAAA,EAAM,UAAA;AAAA,MACN,SAAA,EAAW,CAAC,oBAAoB;AAAA,KAClC;AAAA,IACA;AAAA,MACE,OAAA,EAAS,oBAAA;AAAA,MACT,IAAA,EAAM,UAAA;AAAA,MACN,SAAA,EAAW,CAAC,uBAAuB;AAAA;AACrC;AAEJ,CAAC","file":"decisions-v1.js","sourcesContent":["/**\n * App Pack Contracts\n *\n * Canonical type contracts for Lucern app-pack manifests and runtime metadata.\n */\n\nexport type PackLifecycle = \"active\" | \"beta\" | \"experimental\";\n\nexport type PackCategory =\n | \"conversation\"\n | \"research\"\n | \"graph\"\n | \"analytics\"\n | \"workflow\"\n | \"decision\"\n | \"news\"\n | \"documents\"\n | \"identity\"\n | \"operations\"\n | \"domain\";\n\nexport type PackAudience = string;\n\nexport type PolicyAction = \"read\" | \"summarize\" | \"export\" | \"mutate\" | \"admin\";\n\nexport type PolicyResource =\n | \"project\"\n | \"node\"\n | \"edge\"\n | \"artifact\"\n | \"report_section\"\n | \"tool_action\"\n | \"task\"\n | \"user_profile\"\n | \"team_analytics\";\n\nexport type ProjectionBehavior =\n | \"none\"\n | \"inherits_policy\"\n | \"projection_required\";\n\nexport type PackRuntimeStage =\n | \"registered\"\n | \"validated\"\n | \"installed\"\n | \"enabled\"\n | \"degraded\"\n | \"disabled\"\n | \"removed\";\n\nexport type SharedService =\n | \"decision-kernel\"\n | \"knowledge-compiler\"\n | \"learning-loop\";\n\nexport type SharedServiceMode = \"required\" | \"optional\";\n\nexport interface RouteNamespace {\n api: string[];\n web: string[];\n}\n\nexport interface SurfaceOwnership {\n components: string[];\n convex: string[];\n tools: string[];\n}\n\nexport interface PolicyRule {\n actions: PolicyAction[];\n notes?: string;\n resource: PolicyResource;\n}\n\nexport interface PolicyProfile {\n audiences: PackAudience[];\n rules: PolicyRule[];\n}\n\nexport interface DataContract {\n projectionBehavior: ProjectionBehavior;\n requiredEdgeTypes: string[];\n requiredNodeTypes: string[];\n requiredTables: string[];\n}\n\nexport interface TemplateAssets {\n prompts: string[];\n reports: string[];\n uiLabels: string[];\n workflows: string[];\n}\n\nexport interface PackTestSuite {\n contract: string[];\n parity: string[];\n policy: string[];\n}\n\nexport interface SharedServiceIntegration {\n contracts: string[];\n mode: SharedServiceMode;\n service: SharedService;\n}\n\nexport interface AppPackManifest {\n capabilityFlags: string[];\n category: PackCategory;\n dataContract: DataContract;\n dependencies: string[];\n description: string;\n key: string;\n lifecycle: PackLifecycle;\n name: string;\n policyProfile: PolicyProfile;\n routeNamespace: RouteNamespace;\n sharedServices: SharedServiceIntegration[];\n surfaces: SurfaceOwnership;\n templates: TemplateAssets;\n testSuite: PackTestSuite;\n version: string;\n}\n\ntype AppPackManifestInput = Omit<AppPackManifest, \"sharedServices\"> & {\n sharedServices?: SharedServiceIntegration[];\n};\n\nfunction normalizeStringArray(values: string[]): string[] {\n const normalized = values\n .map((value) => value.trim())\n .filter((value) => value.length > 0);\n return Array.from(new Set(normalized));\n}\n\nexport function defineAppPackManifest(\n manifest: AppPackManifestInput\n): AppPackManifest {\n const sharedServices = (manifest.sharedServices ?? []).map((integration) => ({\n ...integration,\n contracts: normalizeStringArray(integration.contracts),\n }));\n\n return {\n ...manifest,\n dependencies: normalizeStringArray(manifest.dependencies),\n capabilityFlags: normalizeStringArray(manifest.capabilityFlags),\n sharedServices,\n };\n}\n","/**\n * App Pack Manifest: decisions-v1\n *\n * Declarative runtime contract for the decisions-v1 application pack.\n */\n\nimport { defineAppPackManifest } from \"../contracts\";\n\nexport const decisionsV1Manifest = defineAppPackManifest({\n key: \"decisions-v1\",\n name: \"Decisions\",\n version: \"1.0.0\",\n lifecycle: \"beta\",\n category: \"decision\",\n description:\n \"Graph-native decision workflow with belief-level voting, risk ledgers, and snapshot locking.\",\n dependencies: [\"epistemic-algorithms-v1\"],\n capabilityFlags: [\n \"decision.workflow\",\n \"belief.level-voting\",\n \"risk.ledger\",\n \"decision.snapshot\",\n ],\n routeNamespace: {\n web: [\"/(projects)/projects/[projectId]/decisions\"],\n api: [\"/api/thesis-audit/*\", \"/api/reports/*\"],\n },\n surfaces: {\n components: [\n \"apps/web/app/lucern/tenant/policy/page.tsx\",\n \"apps/web/app/lucern/mc/policy/page.tsx\",\n ],\n convex: [\n \"packages/reasoning-kernel/src/adapters/decisions.ts\",\n \"packages/reasoning-kernel/src/adapters/questionsConvictionMutations.ts\",\n \"packages/reasoning-kernel/src/adapters/beliefs.confidence.ts\",\n ],\n tools: [\n \"packages/mcp/src/handlers/judgments.ts\",\n \"packages/server-core/src/policy/index.ts\",\n ],\n },\n policyProfile: {\n audiences: [\"internal\", \"lp\"],\n rules: [\n { resource: \"project\", actions: [\"read\", \"summarize\", \"mutate\"] },\n { resource: \"node\", actions: [\"read\", \"summarize\", \"mutate\"] },\n { resource: \"edge\", actions: [\"read\", \"mutate\"] },\n { resource: \"artifact\", actions: [\"read\", \"export\"] },\n ],\n },\n dataContract: {\n requiredNodeTypes: [\"decision\", \"belief\", \"question\", \"evidence\", \"theme\"],\n requiredEdgeTypes: [\n \"based_on_belief\",\n \"based_on_question\",\n \"informed_by_theme\",\n \"blocked_by_contradiction\",\n ],\n requiredTables: [\n \"epistemicNodes\",\n \"epistemicEdges\",\n \"decisionEvents\",\n \"beliefVotes\",\n \"decisionRiskLedger\",\n \"decisionSnapshots\",\n ],\n projectionBehavior: \"projection_required\",\n },\n templates: {\n workflows: [\"decisions/pre-ic\", \"decisions/in-ic\", \"decisions/post-ic\"],\n prompts: [\n \"decisions/main-system-prompt\",\n \"decisions/risk-ledger-assistant\",\n ],\n reports: [\"decision-brief\", \"ic-memo\"],\n uiLabels: [\"decision\", \"risk_ledger\", \"vote_map\", \"snapshot\"],\n },\n testSuite: {\n parity: [\"decision-flow-parity\"],\n policy: [\"decision-lineage-visibility\"],\n contract: [\"decisions-pack-contract-v1\"],\n },\n sharedServices: [\n {\n service: \"decision-kernel\",\n mode: \"required\",\n contracts: [\"decision-kernel-v1\"],\n },\n {\n service: \"knowledge-compiler\",\n mode: \"required\",\n contracts: [\"knowledge-compiler-v1\"],\n },\n ],\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/contracts.ts","../../src/manifests/documents-v1.ts"],"names":[],"mappings":";AA+HA,SAAS,qBAAqB,MAAA,EAA4B;AACxD,EAAA,MAAM,UAAA,GAAa,MAAA,CAChB,GAAA,CAAI,CAAC,UAAU,KAAA,CAAM,IAAA,EAAM,CAAA,CAC3B,MAAA,CAAO,CAAC,KAAA,KAAU,KAAA,CAAM,SAAS,CAAC,CAAA;AACrC,EAAA,OAAO,KAAA,CAAM,IAAA,CAAK,IAAI,GAAA,CAAI,UAAU,CAAC,CAAA;AACvC;AAEO,SAAS,sBACd,QAAA,EACiB;AACjB,EAAA,MAAM,kBAAkB,QAAA,CAAS,cAAA,IAAkB,EAAC,EAAG,GAAA,CAAI,CAAC,WAAA,MAAiB;AAAA,IAC3E,GAAG,WAAA;AAAA,IACH,SAAA,EAAW,oBAAA,CAAqB,WAAA,CAAY,SAAS;AAAA,GACvD,CAAE,CAAA;AAEF,EAAA,OAAO;AAAA,IACL,GAAG,QAAA;AAAA,IACH,YAAA,EAAc,oBAAA,CAAqB,QAAA,CAAS,YAAY,CAAA;AAAA,IACxD,eAAA,EAAiB,oBAAA,CAAqB,QAAA,CAAS,eAAe,CAAA;AAAA,IAC9D;AAAA,GACF;AACF;;;AC5IO,IAAM,sBAAsB,qBAAA,CAAsB;AAAA,EACvD,GAAA,EAAK,cAAA;AAAA,EACL,IAAA,EAAM,WAAA;AAAA,EACN,OAAA,EAAS,OAAA;AAAA,EACT,SAAA,EAAW,QAAA;AAAA,EACX,QAAA,EAAU,WAAA;AAAA,EACV,WAAA,EACE,uFAAA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,EAAW;AAAA,IACT,SAAA,EAAW;AAAA,MACT,+BAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,OAAA,EAAS,CAAC,sBAAA,EAAwB,yBAAyB,CAAA;AAAA,IAC3D,SAAS,EAAC;AAAA,IACV,QAAA,EAAU,CAAC,WAAA,EAAa,aAAA,EAAe,YAAY,SAAS;AAAA,GAC9D;AAAA,EACA,SAAA,EAAW;AAAA,IACT,MAAA,EAAQ,CAAC,uBAAuB,CAAA;AAAA,IAChC,MAAA,EAAQ,CAAC,6BAA6B,CAAA;AAAA,IACtC,QAAA,EAAU,CAAC,4BAA4B;AAAA;AAE3C,CAAC","file":"documents-v1.js","sourcesContent":["/**\n * App Pack Contracts\n *\n * Canonical type contracts for Lucern app-pack manifests and runtime metadata.\n */\n\nexport type PackLifecycle = \"active\" | \"beta\" | \"experimental\";\n\nexport type PackCategory =\n | \"conversation\"\n | \"research\"\n | \"graph\"\n | \"analytics\"\n | \"workflow\"\n | \"decision\"\n | \"news\"\n | \"documents\"\n | \"identity\"\n | \"operations\"\n | \"domain\";\n\nexport type PackAudience = string;\n\nexport type PolicyAction = \"read\" | \"summarize\" | \"export\" | \"mutate\" | \"admin\";\n\nexport type PolicyResource =\n | \"project\"\n | \"node\"\n | \"edge\"\n | \"artifact\"\n | \"report_section\"\n | \"tool_action\"\n | \"task\"\n | \"user_profile\"\n | \"team_analytics\";\n\nexport type ProjectionBehavior =\n | \"none\"\n | \"inherits_policy\"\n | \"projection_required\";\n\nexport type PackRuntimeStage =\n | \"registered\"\n | \"validated\"\n | \"installed\"\n | \"enabled\"\n | \"degraded\"\n | \"disabled\"\n | \"removed\";\n\nexport type SharedService =\n | \"decision-kernel\"\n | \"knowledge-compiler\"\n | \"learning-loop\";\n\nexport type SharedServiceMode = \"required\" | \"optional\";\n\nexport type RouteNamespace = {\n web: string[];\n api: string[];\n};\n\nexport type SurfaceOwnership = {\n components: string[];\n convex: string[];\n tools: string[];\n};\n\nexport type PolicyRule = {\n resource: PolicyResource;\n actions: PolicyAction[];\n notes?: string;\n};\n\nexport type PolicyProfile = {\n audiences: PackAudience[];\n rules: PolicyRule[];\n};\n\nexport type DataContract = {\n requiredNodeTypes: string[];\n requiredEdgeTypes: string[];\n requiredTables: string[];\n projectionBehavior: ProjectionBehavior;\n};\n\nexport type TemplateAssets = {\n workflows: string[];\n prompts: string[];\n reports: string[];\n uiLabels: string[];\n};\n\nexport type PackTestSuite = {\n parity: string[];\n policy: string[];\n contract: string[];\n};\n\nexport type SharedServiceIntegration = {\n service: SharedService;\n mode: SharedServiceMode;\n contracts: string[];\n};\n\nexport type AppPackManifest = {\n key: string;\n name: string;\n version: string;\n lifecycle: PackLifecycle;\n category: PackCategory;\n description: string;\n dependencies: string[];\n capabilityFlags: string[];\n routeNamespace: RouteNamespace;\n surfaces: SurfaceOwnership;\n policyProfile: PolicyProfile;\n dataContract: DataContract;\n templates: TemplateAssets;\n testSuite: PackTestSuite;\n sharedServices: SharedServiceIntegration[];\n};\n\ntype AppPackManifestInput = Omit<AppPackManifest, \"sharedServices\"> & {\n sharedServices?: SharedServiceIntegration[];\n};\n\nfunction normalizeStringArray(values: string[]): string[] {\n const normalized = values\n .map((value) => value.trim())\n .filter((value) => value.length > 0);\n return Array.from(new Set(normalized));\n}\n\nexport function defineAppPackManifest(\n manifest: AppPackManifestInput\n): AppPackManifest {\n const sharedServices = (manifest.sharedServices ?? []).map((integration) => ({\n ...integration,\n contracts: normalizeStringArray(integration.contracts),\n }));\n\n return {\n ...manifest,\n dependencies: normalizeStringArray(manifest.dependencies),\n capabilityFlags: normalizeStringArray(manifest.capabilityFlags),\n sharedServices,\n };\n}\n","/**\n * App Pack Manifest: documents-v1\n *\n * Declarative runtime contract for the documents-v1 application pack.\n */\n\nimport { defineAppPackManifest } from \"../contracts\";\n\nexport const documentsV1Manifest = defineAppPackManifest({\n key: \"documents-v1\",\n name: \"Documents\",\n version: \"1.0.0\",\n lifecycle: \"active\",\n category: \"documents\",\n description:\n \"Document upload, extraction, annotation, and conversion into graph-grounded evidence.\",\n dependencies: [\"chat-v1\"],\n capabilityFlags: [\n \"document.ingestion\",\n \"document.extraction\",\n \"document.annotation\",\n \"document.rag\",\n ],\n routeNamespace: {\n web: [\n \"/(projects)/projects/[projectId]/documents\",\n \"/(projects)/projects/[projectId]/documents/[documentId]\",\n ],\n api: [\"/api/documents/*\", \"/api/rag/document\", \"/api/rag/extract-pdf\"],\n },\n surfaces: {\n components: [\n \"apps/web/app/lucern/tenant/_components/workspaces/workspace-pack-panel.tsx\",\n \"apps/web/app/lucern/packs/_components/pack-detail-page.tsx\",\n ],\n convex: [\n \"packages/reasoning-kernel/src/adapters/evidence.ts\",\n \"packages/reasoning-kernel/src/adapters/evidenceCreate.ts\",\n \"packages/reasoning-kernel/src/adapters/epistemicSources.ts\",\n ],\n tools: [\n \"packages/server-core/src/domain/sources.ts\",\n \"packages/mcp/src/handlers/evidence.ts\",\n ],\n },\n policyProfile: {\n audiences: [\"internal\", \"lp\"],\n rules: [\n { resource: \"artifact\", actions: [\"read\", \"summarize\", \"mutate\"] },\n { resource: \"project\", actions: [\"read\", \"summarize\", \"mutate\"] },\n { resource: \"tool_action\", actions: [\"read\", \"mutate\"] },\n ],\n },\n dataContract: {\n requiredNodeTypes: [\"source\", \"excerpt\", \"evidence\", \"synthesis\"],\n requiredEdgeTypes: [\"derived_from\", \"based_on\", \"informs\"],\n requiredTables: [\"researchJobs\", \"epistemicNodes\", \"epistemicEdges\"],\n projectionBehavior: \"inherits_policy\",\n },\n templates: {\n workflows: [\n \"documents/upload-extract-link\",\n \"documents/annotate-to-evidence\",\n ],\n prompts: [\"documents/extraction\", \"documents/summarization\"],\n reports: [],\n uiLabels: [\"documents\", \"annotations\", \"excerpts\", \"sources\"],\n },\n testSuite: {\n parity: [\"documents-page-parity\"],\n policy: [\"document-access-enforcement\"],\n contract: [\"documents-pack-contract-v1\"],\n },\n});\n"]}
1
+ {"version":3,"sources":["../../src/contracts.ts","../../src/manifests/documents-v1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AAA;AAAA,IAChC,MAAA,EAAQ,CAAC,6BAA6B,CAAA;AAAA,IACtC,QAAA,EAAU,CAAC,4BAA4B;AAAA;AAE3C,CAAC","file":"documents-v1.js","sourcesContent":["/**\n * App Pack Contracts\n *\n * Canonical type contracts for Lucern app-pack manifests and runtime metadata.\n */\n\nexport type PackLifecycle = \"active\" | \"beta\" | \"experimental\";\n\nexport type PackCategory =\n | \"conversation\"\n | \"research\"\n | \"graph\"\n | \"analytics\"\n | \"workflow\"\n | \"decision\"\n | \"news\"\n | \"documents\"\n | \"identity\"\n | \"operations\"\n | \"domain\";\n\nexport type PackAudience = string;\n\nexport type PolicyAction = \"read\" | \"summarize\" | \"export\" | \"mutate\" | \"admin\";\n\nexport type PolicyResource =\n | \"project\"\n | \"node\"\n | \"edge\"\n | \"artifact\"\n | \"report_section\"\n | \"tool_action\"\n | \"task\"\n | \"user_profile\"\n | \"team_analytics\";\n\nexport type ProjectionBehavior =\n | \"none\"\n | \"inherits_policy\"\n | \"projection_required\";\n\nexport type PackRuntimeStage =\n | \"registered\"\n | \"validated\"\n | \"installed\"\n | \"enabled\"\n | \"degraded\"\n | \"disabled\"\n | \"removed\";\n\nexport type SharedService =\n | \"decision-kernel\"\n | \"knowledge-compiler\"\n | \"learning-loop\";\n\nexport type SharedServiceMode = \"required\" | \"optional\";\n\nexport interface RouteNamespace {\n api: string[];\n web: string[];\n}\n\nexport interface SurfaceOwnership {\n components: string[];\n convex: string[];\n tools: string[];\n}\n\nexport interface PolicyRule {\n actions: PolicyAction[];\n notes?: string;\n resource: PolicyResource;\n}\n\nexport interface PolicyProfile {\n audiences: PackAudience[];\n rules: PolicyRule[];\n}\n\nexport interface DataContract {\n projectionBehavior: ProjectionBehavior;\n requiredEdgeTypes: string[];\n requiredNodeTypes: string[];\n requiredTables: string[];\n}\n\nexport interface TemplateAssets {\n prompts: string[];\n reports: string[];\n uiLabels: string[];\n workflows: string[];\n}\n\nexport interface PackTestSuite {\n contract: string[];\n parity: string[];\n policy: string[];\n}\n\nexport interface SharedServiceIntegration {\n contracts: string[];\n mode: SharedServiceMode;\n service: SharedService;\n}\n\nexport interface AppPackManifest {\n capabilityFlags: string[];\n category: PackCategory;\n dataContract: DataContract;\n dependencies: string[];\n description: string;\n key: string;\n lifecycle: PackLifecycle;\n name: string;\n policyProfile: PolicyProfile;\n routeNamespace: RouteNamespace;\n sharedServices: SharedServiceIntegration[];\n surfaces: SurfaceOwnership;\n templates: TemplateAssets;\n testSuite: PackTestSuite;\n version: string;\n}\n\ntype AppPackManifestInput = Omit<AppPackManifest, \"sharedServices\"> & {\n sharedServices?: SharedServiceIntegration[];\n};\n\nfunction normalizeStringArray(values: string[]): string[] {\n const normalized = values\n .map((value) => value.trim())\n .filter((value) => value.length > 0);\n return Array.from(new Set(normalized));\n}\n\nexport function defineAppPackManifest(\n manifest: AppPackManifestInput\n): AppPackManifest {\n const sharedServices = (manifest.sharedServices ?? []).map((integration) => ({\n ...integration,\n contracts: normalizeStringArray(integration.contracts),\n }));\n\n return {\n ...manifest,\n dependencies: normalizeStringArray(manifest.dependencies),\n capabilityFlags: normalizeStringArray(manifest.capabilityFlags),\n sharedServices,\n };\n}\n","/**\n * App Pack Manifest: documents-v1\n *\n * Declarative runtime contract for the documents-v1 application pack.\n */\n\nimport { defineAppPackManifest } from \"../contracts\";\n\nexport const documentsV1Manifest = defineAppPackManifest({\n key: \"documents-v1\",\n name: \"Documents\",\n version: \"1.0.0\",\n lifecycle: \"active\",\n category: \"documents\",\n description:\n \"Document upload, extraction, annotation, and conversion into graph-grounded evidence.\",\n dependencies: [\"chat-v1\"],\n capabilityFlags: [\n \"document.ingestion\",\n \"document.extraction\",\n \"document.annotation\",\n \"document.rag\",\n ],\n routeNamespace: {\n web: [\n \"/(projects)/projects/[projectId]/documents\",\n \"/(projects)/projects/[projectId]/documents/[documentId]\",\n ],\n api: [\"/api/documents/*\", \"/api/rag/document\", \"/api/rag/extract-pdf\"],\n },\n surfaces: {\n components: [\n \"apps/web/app/lucern/tenant/_components/workspaces/workspace-pack-panel.tsx\",\n \"apps/web/app/lucern/packs/_components/pack-detail-page.tsx\",\n ],\n convex: [\n \"packages/reasoning-kernel/src/adapters/evidence.ts\",\n \"packages/reasoning-kernel/src/adapters/evidenceCreate.ts\",\n \"packages/reasoning-kernel/src/adapters/epistemicSources.ts\",\n ],\n tools: [\n \"packages/server-core/src/domain/sources.ts\",\n \"packages/mcp/src/handlers/evidence.ts\",\n ],\n },\n policyProfile: {\n audiences: [\"internal\", \"lp\"],\n rules: [\n { resource: \"artifact\", actions: [\"read\", \"summarize\", \"mutate\"] },\n { resource: \"project\", actions: [\"read\", \"summarize\", \"mutate\"] },\n { resource: \"tool_action\", actions: [\"read\", \"mutate\"] },\n ],\n },\n dataContract: {\n requiredNodeTypes: [\"source\", \"excerpt\", \"evidence\", \"synthesis\"],\n requiredEdgeTypes: [\"derived_from\", \"based_on\", \"informs\"],\n requiredTables: [\"researchJobs\", \"epistemicNodes\", \"epistemicEdges\"],\n projectionBehavior: \"inherits_policy\",\n },\n templates: {\n workflows: [\n \"documents/upload-extract-link\",\n \"documents/annotate-to-evidence\",\n ],\n prompts: [\"documents/extraction\", \"documents/summarization\"],\n reports: [],\n uiLabels: [\"documents\", \"annotations\", \"excerpts\", \"sources\"],\n },\n testSuite: {\n parity: [\"documents-page-parity\"],\n policy: [\"document-access-enforcement\"],\n contract: [\"documents-pack-contract-v1\"],\n },\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/contracts.ts","../../src/manifests/epistemic-algorithms-v1.ts"],"names":[],"mappings":";AA+HA,SAAS,qBAAqB,MAAA,EAA4B;AACxD,EAAA,MAAM,UAAA,GAAa,MAAA,CAChB,GAAA,CAAI,CAAC,UAAU,KAAA,CAAM,IAAA,EAAM,CAAA,CAC3B,MAAA,CAAO,CAAC,KAAA,KAAU,KAAA,CAAM,SAAS,CAAC,CAAA;AACrC,EAAA,OAAO,KAAA,CAAM,IAAA,CAAK,IAAI,GAAA,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,IACd;AAAA,MACE,OAAA,EAAS,oBAAA;AAAA,MACT,IAAA,EAAM,UAAA;AAAA,MACN,SAAA,EAAW,CAAC,uBAAuB;AAAA;AACrC;AAEJ,CAAC","file":"epistemic-algorithms-v1.js","sourcesContent":["/**\n * App Pack Contracts\n *\n * Canonical type contracts for Lucern app-pack manifests and runtime metadata.\n */\n\nexport type PackLifecycle = \"active\" | \"beta\" | \"experimental\";\n\nexport type PackCategory =\n | \"conversation\"\n | \"research\"\n | \"graph\"\n | \"analytics\"\n | \"workflow\"\n | \"decision\"\n | \"news\"\n | \"documents\"\n | \"identity\"\n | \"operations\"\n | \"domain\";\n\nexport type PackAudience = string;\n\nexport type PolicyAction = \"read\" | \"summarize\" | \"export\" | \"mutate\" | \"admin\";\n\nexport type PolicyResource =\n | \"project\"\n | \"node\"\n | \"edge\"\n | \"artifact\"\n | \"report_section\"\n | \"tool_action\"\n | \"task\"\n | \"user_profile\"\n | \"team_analytics\";\n\nexport type ProjectionBehavior =\n | \"none\"\n | \"inherits_policy\"\n | \"projection_required\";\n\nexport type PackRuntimeStage =\n | \"registered\"\n | \"validated\"\n | \"installed\"\n | \"enabled\"\n | \"degraded\"\n | \"disabled\"\n | \"removed\";\n\nexport type SharedService =\n | \"decision-kernel\"\n | \"knowledge-compiler\"\n | \"learning-loop\";\n\nexport type SharedServiceMode = \"required\" | \"optional\";\n\nexport type RouteNamespace = {\n web: string[];\n api: string[];\n};\n\nexport type SurfaceOwnership = {\n components: string[];\n convex: string[];\n tools: string[];\n};\n\nexport type PolicyRule = {\n resource: PolicyResource;\n actions: PolicyAction[];\n notes?: string;\n};\n\nexport type PolicyProfile = {\n audiences: PackAudience[];\n rules: PolicyRule[];\n};\n\nexport type DataContract = {\n requiredNodeTypes: string[];\n requiredEdgeTypes: string[];\n requiredTables: string[];\n projectionBehavior: ProjectionBehavior;\n};\n\nexport type TemplateAssets = {\n workflows: string[];\n prompts: string[];\n reports: string[];\n uiLabels: string[];\n};\n\nexport type PackTestSuite = {\n parity: string[];\n policy: string[];\n contract: string[];\n};\n\nexport type SharedServiceIntegration = {\n service: SharedService;\n mode: SharedServiceMode;\n contracts: string[];\n};\n\nexport type AppPackManifest = {\n key: string;\n name: string;\n version: string;\n lifecycle: PackLifecycle;\n category: PackCategory;\n description: string;\n dependencies: string[];\n capabilityFlags: string[];\n routeNamespace: RouteNamespace;\n surfaces: SurfaceOwnership;\n policyProfile: PolicyProfile;\n dataContract: DataContract;\n templates: TemplateAssets;\n testSuite: PackTestSuite;\n sharedServices: SharedServiceIntegration[];\n};\n\ntype AppPackManifestInput = Omit<AppPackManifest, \"sharedServices\"> & {\n sharedServices?: SharedServiceIntegration[];\n};\n\nfunction normalizeStringArray(values: string[]): string[] {\n const normalized = values\n .map((value) => value.trim())\n .filter((value) => value.length > 0);\n return Array.from(new Set(normalized));\n}\n\nexport function defineAppPackManifest(\n manifest: AppPackManifestInput\n): AppPackManifest {\n const sharedServices = (manifest.sharedServices ?? []).map((integration) => ({\n ...integration,\n contracts: normalizeStringArray(integration.contracts),\n }));\n\n return {\n ...manifest,\n dependencies: normalizeStringArray(manifest.dependencies),\n capabilityFlags: normalizeStringArray(manifest.capabilityFlags),\n sharedServices,\n };\n}\n","/**\n * App Pack Manifest: epistemic-algorithms-v1\n *\n * Declarative runtime contract for the epistemic-algorithms-v1 application pack.\n */\n\nimport { defineAppPackManifest } from \"../contracts\";\n\nexport const epistemicAlgorithmsV1Manifest = defineAppPackManifest({\n key: \"epistemic-algorithms-v1\",\n name: \"Epistemic Algorithms\",\n version: \"1.0.0\",\n lifecycle: \"active\",\n category: \"analytics\",\n description:\n \"Reasoning quality engines: contradiction detection, conviction dynamics, and graph intelligence analytics.\",\n dependencies: [\"graph-visualization-v1\", \"chat-v1\"],\n capabilityFlags: [\n \"contradiction.detection\",\n \"conviction.analytics\",\n \"reasoning.depth\",\n \"bias.detection\",\n ],\n routeNamespace: {\n web: [\n \"/(projects)/projects/[projectId]/contradictions\",\n \"/(projects)/projects/[projectId]/thesis-audit\",\n ],\n api: [\"/api/thesis-audit\", \"/api/graph-explain\", \"/api/lucern/*\"],\n },\n surfaces: {\n components: [\n \"apps/web/app/lucern/tenant/_components/graph/*\",\n \"apps/web/lib/platform/react/components/ContradictionList.ts\",\n ],\n convex: [\n \"packages/reasoning-kernel/src/adapters/contradictions.ts\",\n \"packages/reasoning-kernel/src/adapters/graphIntelligence.ts\",\n \"packages/reasoning-kernel/src/adapters/graphAnalysisResults.ts\",\n ],\n tools: [\n \"packages/mcp/src/handlers/contradictions.ts\",\n \"packages/server-core/src/graph-analysis.ts\",\n ],\n },\n policyProfile: {\n audiences: [\"internal\", \"lp\"],\n rules: [\n { resource: \"node\", actions: [\"read\", \"summarize\"] },\n { resource: \"edge\", actions: [\"read\", \"summarize\"] },\n { resource: \"artifact\", actions: [\"read\", \"summarize\", \"export\"] },\n ],\n },\n dataContract: {\n requiredNodeTypes: [\"belief\", \"question\", \"evidence\", \"theme\", \"decision\"],\n requiredEdgeTypes: [\n \"informs\",\n \"contradicts\",\n \"depends_on\",\n \"strengthened_by\",\n \"weakened_by\",\n \"collapses_if\",\n ],\n requiredTables: [\n \"contradictions\",\n \"beliefConfidence\",\n \"epistemicAudit\",\n \"graphAnalysisResults\",\n ],\n projectionBehavior: \"inherits_policy\",\n },\n templates: {\n workflows: [\"epistemic/contradiction-resolution\", \"epistemic/thesis-audit\"],\n prompts: [\n \"graph-intelligence/full-guide\",\n \"graph-intelligence/bias-detection\",\n ],\n reports: [\"knowledge_map\"],\n uiLabels: [\n \"contradiction\",\n \"conviction\",\n \"thesis_audit\",\n \"epistemic_health\",\n ],\n },\n testSuite: {\n parity: [\"epistemic-algorithm-output-parity\"],\n policy: [\"epistemic-output-scope-filtering\"],\n contract: [\"epistemic-algorithms-pack-contract-v1\"],\n },\n sharedServices: [\n {\n service: \"knowledge-compiler\",\n mode: \"required\",\n contracts: [\"knowledge-compiler-v1\"],\n },\n ],\n});\n"]}
1
+ {"version":3,"sources":["../../src/cont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,CAAA;AAAA,IACzB,QAAA,EAAU;AAAA,MACR,eAAA;AAAA,MACA,YAAA;AAAA,MACA,cAAA;AAAA,MACA;AAAA;AACF,GACF;AAAA,EACA,SAAA,EAAW;AAAA,IACT,MAAA,EAAQ,CAAC,mCAAmC,CAAA;AAAA,IAC5C,MAAA,EAAQ,CAAC,kCAAkC,CAAA;AAAA,IAC3C,QAAA,EAAU,CAAC,uCAAuC;AAAA,GACpD;AAAA,EACA,cAAA,EAAgB;AAAA,IACd;AAAA,MACE,OAAA,EAAS,oBAAA;AAAA,MACT,IAAA,EAAM,UAAA;AAAA,MACN,SAAA,EAAW,CAAC,uBAAuB;AAAA;AACrC;AAEJ,CAAC","file":"epistemic-algorithms-v1.js","sourcesContent":["/**\n * App Pack Contracts\n *\n * Canonical type contracts for Lucern app-pack manifests and runtime metadata.\n */\n\nexport type PackLifecycle = \"active\" | \"beta\" | \"experimental\";\n\nexport type PackCategory =\n | \"conversation\"\n | \"research\"\n | \"graph\"\n | \"analytics\"\n | \"workflow\"\n | \"decision\"\n | \"news\"\n | \"documents\"\n | \"identity\"\n | \"operations\"\n | \"domain\";\n\nexport type PackAudience = string;\n\nexport type PolicyAction = \"read\" | \"summarize\" | \"export\" | \"mutate\" | \"admin\";\n\nexport type PolicyResource =\n | \"project\"\n | \"node\"\n | \"edge\"\n | \"artifact\"\n | \"report_section\"\n | \"tool_action\"\n | \"task\"\n | \"user_profile\"\n | \"team_analytics\";\n\nexport type ProjectionBehavior =\n | \"none\"\n | \"inherits_policy\"\n | \"projection_required\";\n\nexport type PackRuntimeStage =\n | \"registered\"\n | \"validated\"\n | \"installed\"\n | \"enabled\"\n | \"degraded\"\n | \"disabled\"\n | \"removed\";\n\nexport type SharedService =\n | \"decision-kernel\"\n | \"knowledge-compiler\"\n | \"learning-loop\";\n\nexport type SharedServiceMode = \"required\" | \"optional\";\n\nexport interface RouteNamespace {\n api: string[];\n web: string[];\n}\n\nexport interface SurfaceOwnership {\n components: string[];\n convex: string[];\n tools: string[];\n}\n\nexport interface PolicyRule {\n actions: PolicyAction[];\n notes?: string;\n resource: PolicyResource;\n}\n\nexport interface PolicyProfile {\n audiences: PackAudience[];\n rules: PolicyRule[];\n}\n\nexport interface DataContract {\n projectionBehavior: ProjectionBehavior;\n requiredEdgeTypes: string[];\n requiredNodeTypes: string[];\n requiredTables: string[];\n}\n\nexport interface TemplateAssets {\n prompts: string[];\n reports: string[];\n uiLabels: string[];\n workflows: string[];\n}\n\nexport interface PackTestSuite {\n contract: string[];\n parity: string[];\n policy: string[];\n}\n\nexport interface SharedServiceIntegration {\n contracts: string[];\n mode: SharedServiceMode;\n service: SharedService;\n}\n\nexport interface AppPackManifest {\n capabilityFlags: string[];\n category: PackCategory;\n dataContract: DataContract;\n dependencies: string[];\n description: string;\n key: string;\n lifecycle: PackLifecycle;\n name: string;\n policyProfile: PolicyProfile;\n routeNamespace: RouteNamespace;\n sharedServices: SharedServiceIntegration[];\n surfaces: SurfaceOwnership;\n templates: TemplateAssets;\n testSuite: PackTestSuite;\n version: string;\n}\n\ntype AppPackManifestInput = Omit<AppPackManifest, \"sharedServices\"> & {\n sharedServices?: SharedServiceIntegration[];\n};\n\nfunction normalizeStringArray(values: string[]): string[] {\n const normalized = values\n .map((value) => value.trim())\n .filter((value) => value.length > 0);\n return Array.from(new Set(normalized));\n}\n\nexport function defineAppPackManifest(\n manifest: AppPackManifestInput\n): AppPackManifest {\n const sharedServices = (manifest.sharedServices ?? []).map((integration) => ({\n ...integration,\n contracts: normalizeStringArray(integration.contracts),\n }));\n\n return {\n ...manifest,\n dependencies: normalizeStringArray(manifest.dependencies),\n capabilityFlags: normalizeStringArray(manifest.capabilityFlags),\n sharedServices,\n };\n}\n","/**\n * App Pack Manifest: epistemic-algorithms-v1\n *\n * Declarative runtime contract for the epistemic-algorithms-v1 application pack.\n */\n\nimport { defineAppPackManifest } from \"../contracts\";\n\nexport const epistemicAlgorithmsV1Manifest = defineAppPackManifest({\n key: \"epistemic-algorithms-v1\",\n name: \"Epistemic Algorithms\",\n version: \"1.0.0\",\n lifecycle: \"active\",\n category: \"analytics\",\n description:\n \"Reasoning quality engines: contradiction detection, conviction dynamics, and graph intelligence analytics.\",\n dependencies: [\"graph-visualization-v1\", \"chat-v1\"],\n capabilityFlags: [\n \"contradiction.detection\",\n \"conviction.analytics\",\n \"reasoning.depth\",\n \"bias.detection\",\n ],\n routeNamespace: {\n web: [\n \"/(projects)/projects/[projectId]/contradictions\",\n \"/(projects)/projects/[projectId]/thesis-audit\",\n ],\n api: [\"/api/thesis-audit\", \"/api/graph-explain\", \"/api/lucern/*\"],\n },\n surfaces: {\n components: [\n \"apps/web/app/lucern/tenant/_components/graph/*\",\n \"apps/web/lib/platform/react/components/ContradictionList.ts\",\n ],\n convex: [\n \"packages/reasoning-kernel/src/adapters/contradictions.ts\",\n \"packages/reasoning-kernel/src/adapters/graphIntelligence.ts\",\n \"packages/reasoning-kernel/src/adapters/graphAnalysisResults.ts\",\n ],\n tools: [\n \"packages/mcp/src/handlers/contradictions.ts\",\n \"packages/server-core/src/graph-analysis.ts\",\n ],\n },\n policyProfile: {\n audiences: [\"internal\", \"lp\"],\n rules: [\n { resource: \"node\", actions: [\"read\", \"summarize\"] },\n { resource: \"edge\", actions: [\"read\", \"summarize\"] },\n { resource: \"artifact\", actions: [\"read\", \"summarize\", \"export\"] },\n ],\n },\n dataContract: {\n requiredNodeTypes: [\"belief\", \"question\", \"evidence\", \"theme\", \"decision\"],\n requiredEdgeTypes: [\n \"informs\",\n \"contradicts\",\n \"depends_on\",\n \"strengthened_by\",\n \"weakened_by\",\n \"collapses_if\",\n ],\n requiredTables: [\n \"contradictions\",\n \"beliefConfidence\",\n \"epistemicAudit\",\n \"graphAnalysisResults\",\n ],\n projectionBehavior: \"inherits_policy\",\n },\n templates: {\n workflows: [\"epistemic/contradiction-resolution\", \"epistemic/thesis-audit\"],\n prompts: [\n \"graph-intelligence/full-guide\",\n \"graph-intelligence/bias-detection\",\n ],\n reports: [\"knowledge_map\"],\n uiLabels: [\n \"contradiction\",\n \"conviction\",\n \"thesis_audit\",\n \"epistemic_health\",\n ],\n },\n testSuite: {\n parity: [\"epistemic-algorithm-output-parity\"],\n policy: [\"epistemic-output-scope-filtering\"],\n contract: [\"epistemic-algorithms-pack-contract-v1\"],\n },\n sharedServices: [\n {\n service: \"knowledge-compiler\",\n mode: \"required\",\n contracts: [\"knowledge-compiler-v1\"],\n },\n ],\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/contracts.ts","../../src/manifests/graph-visualization-v1.ts"],"names":[],"mappings":";AA+HA,SAAS,qBAAqB,MAAA,EAA4B;AACxD,EAAA,MAAM,UAAA,GAAa,MAAA,CAChB,GAAA,CAAI,CAAC,UAAU,KAAA,CAAM,IAAA,EAAM,CAAA,CAC3B,MAAA,CAAO,CAAC,KAAA,KAAU,KAAA,CAAM,SAAS,CAAC,CAAA;AACrC,EAAA,OAAO,KAAA,CAAM,IAAA,CAAK,IAAI,GAAA,CAAI,UAAU,CAAC,CAAA;AACvC;AAEO,SAAS,sBACd,QAAA,EACiB;AACjB,EAAA,MAAM,kBAAkB,QAAA,CAAS,cAAA,IAAkB,EAAC,EAAG,GAAA,CAAI,CAAC,WAAA,MAAiB;AAAA,IAC3E,GAAG,WAAA;AAAA,IACH,SAAA,EAAW,oBAAA,CAAqB,WAAA,CAAY,SAAS;AAAA,GACvD,CAAE,CAAA;AAEF,EAAA,OAAO;AAAA,IACL,GAAG,QAAA;AAAA,IACH,YAAA,EAAc,oBAAA,CAAqB,QAAA,CAAS,YAAY,CAAA;AAAA,IACxD,eAAA,EAAiB,oBAAA,CAAqB,QAAA,CAAS,eAAe,CAAA;AAAA,IAC9D;AAAA,GACF;AACF;;;AC5IO,IAAM,+BAA+B,qBAAA,CAAsB;AAAA,EAChE,GAAA,EAAK,wBAAA;AAAA,EACL,IAAA,EAAM,qBAAA;AAAA,EACN,OAAA,EAAS,OAAA;AAAA,EACT,SAAA,EAAW,QAAA;AAA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A,IACnD,kBAAA,EAAoB;AAAA,GACtB;AAAA,EACA,SAAA,EAAW;AAAA,IACT,SAAA,EAAW,CAAC,0BAA0B,CAAA;AAAA,IACtC,OAAA,EAAS;AAAA,MACP,0BAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,SAAS,EAAC;AAAA,IACV,QAAA,EAAU,CAAC,OAAA,EAAS,OAAA,EAAS,SAAS,SAAS;AAAA,GACjD;AAAA,EACA,SAAA,EAAW;AAAA,IACT,MAAA,EAAQ,CAAC,oBAAA,EAAsB,qBAAqB,CAAA;AAAA,IACpD,MAAA,EAAQ,CAAC,iCAAiC,CAAA;AAAA,IAC1C,QAAA,EAAU,CAAC,sCAAsC;AAAA;AAErD,CAAC","file":"graph-visualization-v1.js","sourcesContent":["/**\n * App Pack Contracts\n *\n * Canonical type contracts for Lucern app-pack manifests and runtime metadata.\n */\n\nexport type PackLifecycle = \"active\" | \"beta\" | \"experimental\";\n\nexport type PackCategory =\n | \"conversation\"\n | \"research\"\n | \"graph\"\n | \"analytics\"\n | \"workflow\"\n | \"decision\"\n | \"news\"\n | \"documents\"\n | \"identity\"\n | \"operations\"\n | \"domain\";\n\nexport type PackAudience = string;\n\nexport type PolicyAction = \"read\" | \"summarize\" | \"export\" | \"mutate\" | \"admin\";\n\nexport type PolicyResource =\n | \"project\"\n | \"node\"\n | \"edge\"\n | \"artifact\"\n | \"report_section\"\n | \"tool_action\"\n | \"task\"\n | \"user_profile\"\n | \"team_analytics\";\n\nexport type ProjectionBehavior =\n | \"none\"\n | \"inherits_policy\"\n | \"projection_required\";\n\nexport type PackRuntimeStage =\n | \"registered\"\n | \"validated\"\n | \"installed\"\n | \"enabled\"\n | \"degraded\"\n | \"disabled\"\n | \"removed\";\n\nexport type SharedService =\n | \"decision-kernel\"\n | \"knowledge-compiler\"\n | \"learning-loop\";\n\nexport type SharedServiceMode = \"required\" | \"optional\";\n\nexport type RouteNamespace = {\n web: string[];\n api: string[];\n};\n\nexport type SurfaceOwnership = {\n components: string[];\n convex: string[];\n tools: string[];\n};\n\nexport type PolicyRule = {\n resource: PolicyResource;\n actions: PolicyAction[];\n notes?: string;\n};\n\nexport type PolicyProfile = {\n audiences: PackAudience[];\n rules: PolicyRule[];\n};\n\nexport type DataContract = {\n requiredNodeTypes: string[];\n requiredEdgeTypes: string[];\n requiredTables: string[];\n projectionBehavior: ProjectionBehavior;\n};\n\nexport type TemplateAssets = {\n workflows: string[];\n prompts: string[];\n reports: string[];\n uiLabels: string[];\n};\n\nexport type PackTestSuite = {\n parity: string[];\n policy: string[];\n contract: string[];\n};\n\nexport type SharedServiceIntegration = {\n service: SharedService;\n mode: SharedServiceMode;\n contracts: string[];\n};\n\nexport type AppPackManifest = {\n key: string;\n name: string;\n version: string;\n lifecycle: PackLifecycle;\n category: PackCategory;\n description: string;\n dependencies: string[];\n capabilityFlags: string[];\n routeNamespace: RouteNamespace;\n surfaces: SurfaceOwnership;\n policyProfile: PolicyProfile;\n dataContract: DataContract;\n templates: TemplateAssets;\n testSuite: PackTestSuite;\n sharedServices: SharedServiceIntegration[];\n};\n\ntype AppPackManifestInput = Omit<AppPackManifest, \"sharedServices\"> & {\n sharedServices?: SharedServiceIntegration[];\n};\n\nfunction normalizeStringArray(values: string[]): string[] {\n const normalized = values\n .map((value) => value.trim())\n .filter((value) => value.length > 0);\n return Array.from(new Set(normalized));\n}\n\nexport function defineAppPackManifest(\n manifest: AppPackManifestInput\n): AppPackManifest {\n const sharedServices = (manifest.sharedServices ?? []).map((integration) => ({\n ...integration,\n contracts: normalizeStringArray(integration.contracts),\n }));\n\n return {\n ...manifest,\n dependencies: normalizeStringArray(manifest.dependencies),\n capabilityFlags: normalizeStringArray(manifest.capabilityFlags),\n sharedServices,\n };\n}\n","/**\n * App Pack Manifest: graph-visualization-v1\n *\n * Declarative runtime contract for the graph-visualization-v1 application pack.\n */\n\nimport { defineAppPackManifest } from \"../contracts\";\n\nexport const graphVisualizationV1Manifest = defineAppPackManifest({\n key: \"graph-visualization-v1\",\n name: \"Graph Visualization\",\n version: \"1.0.0\",\n lifecycle: \"active\",\n category: \"graph\",\n description:\n \"Interactive graph explorer for node/edge traversal, neighborhood inspection, and query rendering.\",\n dependencies: [\"chat-v1\"],\n capabilityFlags: [\n \"graph.rendering\",\n \"graph.query\",\n \"graph.highlighting\",\n \"graph.neighborhood\",\n ],\n routeNamespace: {\n web: [\"/(projects)/projects/[projectId]/graph\"],\n api: [\"/api/graph\", \"/api/graph-query\", \"/api/graph-suggestions\"],\n },\n surfaces: {\n components: [\n \"apps/web/app/lucern/tenant/_components/graph/*\",\n \"apps/web/app/lucern/tenant/graph/page.tsx\",\n ],\n convex: [\n \"packages/reasoning-kernel/src/adapters/edgesQueries.ts\",\n \"packages/reasoning-kernel/src/adapters/nodesQueries.ts\",\n \"packages/reasoning-kernel/src/adapters/neo4jQueries.ts\",\n ],\n tools: [\n \"packages/mcp/src/handlers/graph.ts\",\n \"packages/server-core/src/mcp-graph-tools.ts\",\n ],\n },\n policyProfile: {\n audiences: [\"internal\", \"lp\"],\n rules: [\n { resource: \"node\", actions: [\"read\", \"summarize\"] },\n { resource: \"edge\", actions: [\"read\", \"summarize\"] },\n { resource: \"tool_action\", actions: [\"read\"] },\n ],\n },\n dataContract: {\n requiredNodeTypes: [\n \"belief\",\n \"question\",\n \"evidence\",\n \"theme\",\n \"deal\",\n \"decision\",\n ],\n requiredEdgeTypes: [\"informs\", \"answers\", \"belongs_to\", \"depends_on\"],\n requiredTables: [\"epistemicNodes\", \"epistemicEdges\"],\n projectionBehavior: \"inherits_policy\",\n },\n templates: {\n workflows: [\"graph/query-and-traverse\"],\n prompts: [\n \"graph-intelligence/query\",\n \"graph-intelligence/suggestions-extraction\",\n ],\n reports: [],\n uiLabels: [\"graph\", \"nodes\", \"edges\", \"lineage\"],\n },\n testSuite: {\n parity: [\"graph-query-parity\", \"graph-render-parity\"],\n policy: [\"graph-node-visibility-filtering\"],\n contract: [\"graph-visualization-pack-contract-v1\"],\n },\n});\n"]}
1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IACT,MAAA,EAAQ,CAAC,oBAAA,EAAsB,qBAAqB,CAAA;AAAA,IACpD,MAAA,EAAQ,CAAC,iCAAiC,CAAA;AAAA,IAC1C,QAAA,EAAU,CAAC,sCAAsC;AAAA;AAErD,CAAC","file":"graph-visualization-v1.js","sourcesContent":["/**\n * App Pack Contracts\n *\n * Canonical type contracts for Lucern app-pack manifests and runtime metadata.\n */\n\nexport type PackLifecycle = \"active\" | \"beta\" | \"experimental\";\n\nexport type PackCategory =\n | \"conversation\"\n | \"research\"\n | \"graph\"\n | \"analytics\"\n | \"workflow\"\n | \"decision\"\n | \"news\"\n | \"documents\"\n | \"identity\"\n | \"operations\"\n | \"domain\";\n\nexport type PackAudience = string;\n\nexport type PolicyAction = \"read\" | \"summarize\" | \"export\" | \"mutate\" | \"admin\";\n\nexport type PolicyResource =\n | \"project\"\n | \"node\"\n | \"edge\"\n | \"artifact\"\n | \"report_section\"\n | \"tool_action\"\n | \"task\"\n | \"user_profile\"\n | \"team_analytics\";\n\nexport type ProjectionBehavior =\n | \"none\"\n | \"inherits_policy\"\n | \"projection_required\";\n\nexport type PackRuntimeStage =\n | \"registered\"\n | \"validated\"\n | \"installed\"\n | \"enabled\"\n | \"degraded\"\n | \"disabled\"\n | \"removed\";\n\nexport type SharedService =\n | \"decision-kernel\"\n | \"knowledge-compiler\"\n | \"learning-loop\";\n\nexport type SharedServiceMode = \"required\" | \"optional\";\n\nexport interface RouteNamespace {\n api: string[];\n web: string[];\n}\n\nexport interface SurfaceOwnership {\n components: string[];\n convex: string[];\n tools: string[];\n}\n\nexport interface PolicyRule {\n actions: PolicyAction[];\n notes?: string;\n resource: PolicyResource;\n}\n\nexport interface PolicyProfile {\n audiences: PackAudience[];\n rules: PolicyRule[];\n}\n\nexport interface DataContract {\n projectionBehavior: ProjectionBehavior;\n requiredEdgeTypes: string[];\n requiredNodeTypes: string[];\n requiredTables: string[];\n}\n\nexport interface TemplateAssets {\n prompts: string[];\n reports: string[];\n uiLabels: string[];\n workflows: string[];\n}\n\nexport interface PackTestSuite {\n contract: string[];\n parity: string[];\n policy: string[];\n}\n\nexport interface SharedServiceIntegration {\n contracts: string[];\n mode: SharedServiceMode;\n service: SharedService;\n}\n\nexport interface AppPackManifest {\n capabilityFlags: string[];\n category: PackCategory;\n dataContract: DataContract;\n dependencies: string[];\n description: string;\n key: string;\n lifecycle: PackLifecycle;\n name: string;\n policyProfile: PolicyProfile;\n routeNamespace: RouteNamespace;\n sharedServices: SharedServiceIntegration[];\n surfaces: SurfaceOwnership;\n templates: TemplateAssets;\n testSuite: PackTestSuite;\n version: string;\n}\n\ntype AppPackManifestInput = Omit<AppPackManifest, \"sharedServices\"> & {\n sharedServices?: SharedServiceIntegration[];\n};\n\nfunction normalizeStringArray(values: string[]): string[] {\n const normalized = values\n .map((value) => value.trim())\n .filter((value) => value.length > 0);\n return Array.from(new Set(normalized));\n}\n\nexport function defineAppPackManifest(\n manifest: AppPackManifestInput\n): AppPackManifest {\n const sharedServices = (manifest.sharedServices ?? []).map((integration) => ({\n ...integration,\n contracts: normalizeStringArray(integration.contracts),\n }));\n\n return {\n ...manifest,\n dependencies: normalizeStringArray(manifest.dependencies),\n capabilityFlags: normalizeStringArray(manifest.capabilityFlags),\n sharedServices,\n };\n}\n","/**\n * App Pack Manifest: graph-visualization-v1\n *\n * Declarative runtime contract for the graph-visualization-v1 application pack.\n */\n\nimport { defineAppPackManifest } from \"../contracts\";\n\nexport const graphVisualizationV1Manifest = defineAppPackManifest({\n key: \"graph-visualization-v1\",\n name: \"Graph Visualization\",\n version: \"1.0.0\",\n lifecycle: \"active\",\n category: \"graph\",\n description:\n \"Interactive graph explorer for node/edge traversal, neighborhood inspection, and query rendering.\",\n dependencies: [\"chat-v1\"],\n capabilityFlags: [\n \"graph.rendering\",\n \"graph.query\",\n \"graph.highlighting\",\n \"graph.neighborhood\",\n ],\n routeNamespace: {\n web: [\"/(projects)/projects/[projectId]/graph\"],\n api: [\"/api/graph\", \"/api/graph-query\", \"/api/graph-suggestions\"],\n },\n surfaces: {\n components: [\n \"apps/web/app/lucern/tenant/_components/graph/*\",\n \"apps/web/app/lucern/tenant/graph/page.tsx\",\n ],\n convex: [\n \"packages/reasoning-kernel/src/adapters/edgesQueries.ts\",\n \"packages/reasoning-kernel/src/adapters/nodesQueries.ts\",\n \"packages/reasoning-kernel/src/adapters/neo4jQueries.ts\",\n ],\n tools: [\n \"packages/mcp/src/handlers/graph.ts\",\n \"packages/server-core/src/mcp-graph-tools.ts\",\n ],\n },\n policyProfile: {\n audiences: [\"internal\", \"lp\"],\n rules: [\n { resource: \"node\", actions: [\"read\", \"summarize\"] },\n { resource: \"edge\", actions: [\"read\", \"summarize\"] },\n { resource: \"tool_action\", actions: [\"read\"] },\n ],\n },\n dataContract: {\n requiredNodeTypes: [\n \"belief\",\n \"question\",\n \"evidence\",\n \"theme\",\n \"deal\",\n \"decision\",\n ],\n requiredEdgeTypes: [\"informs\", \"answers\", \"belongs_to\", \"depends_on\"],\n requiredTables: [\"epistemicNodes\", \"epistemicEdges\"],\n projectionBehavior: \"inherits_policy\",\n },\n templates: {\n workflows: [\"graph/query-and-traverse\"],\n prompts: [\n \"graph-intelligence/query\",\n \"graph-intelligence/suggestions-extraction\",\n ],\n reports: [],\n uiLabels: [\"graph\", \"nodes\", \"edges\", \"lineage\"],\n },\n testSuite: {\n parity: [\"graph-query-parity\", \"graph-render-parity\"],\n policy: [\"graph-node-visibility-filtering\"],\n contract: [\"graph-visualization-pack-contract-v1\"],\n },\n});\n"]}
@@ -101,12 +101,7 @@ var dealsV1Manifest = defineAppPackManifest({
101
101
  lifecycle: "beta",
102
102
  category: "domain",
103
103
  description: "Deal diligence application using shared reasoning graph primitives with deal-calibrated workflows.",
104
- dependencies: [
105
- "chat-v1",
106
- "documents-v1",
107
- "news-v1",
108
- "decisions-v1"
109
- ],
104
+ dependencies: ["chat-v1", "documents-v1", "news-v1", "decisions-v1"],
110
105
  capabilityFlags: [
111
106
  "deal.lifecycle",
112
107
  "diligence.workflow",