@polintpro/proposit-core 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/README.md +47 -47
  2. package/dist/cli/commands/analysis.d.ts.map +1 -1
  3. package/dist/cli/commands/analysis.js +87 -13
  4. package/dist/cli/commands/analysis.js.map +1 -1
  5. package/dist/cli/commands/arguments.d.ts.map +1 -1
  6. package/dist/cli/commands/arguments.js +27 -4
  7. package/dist/cli/commands/arguments.js.map +1 -1
  8. package/dist/cli/commands/diff.d.ts +3 -0
  9. package/dist/cli/commands/diff.d.ts.map +1 -0
  10. package/dist/cli/commands/diff.js +46 -0
  11. package/dist/cli/commands/diff.js.map +1 -0
  12. package/dist/cli/commands/expressions.js.map +1 -1
  13. package/dist/cli/commands/premises.d.ts.map +1 -1
  14. package/dist/cli/commands/premises.js +36 -17
  15. package/dist/cli/commands/premises.js.map +1 -1
  16. package/dist/cli/commands/variables.d.ts.map +1 -1
  17. package/dist/cli/commands/variables.js +1 -0
  18. package/dist/cli/commands/variables.js.map +1 -1
  19. package/dist/cli/commands/versionShow.js +2 -2
  20. package/dist/cli/commands/versionShow.js.map +1 -1
  21. package/dist/cli/engine.d.ts +6 -0
  22. package/dist/cli/engine.d.ts.map +1 -1
  23. package/dist/cli/engine.js +41 -8
  24. package/dist/cli/engine.js.map +1 -1
  25. package/dist/cli/output/diffRenderer.d.ts +4 -0
  26. package/dist/cli/output/diffRenderer.d.ts.map +1 -0
  27. package/dist/cli/output/diffRenderer.js +102 -0
  28. package/dist/cli/output/diffRenderer.js.map +1 -0
  29. package/dist/cli/router.d.ts.map +1 -1
  30. package/dist/cli/router.js +1 -0
  31. package/dist/cli/router.js.map +1 -1
  32. package/dist/cli/storage/analysis.d.ts +3 -3
  33. package/dist/cli/storage/analysis.d.ts.map +1 -1
  34. package/dist/cli/storage/analysis.js +3 -3
  35. package/dist/cli/storage/analysis.js.map +1 -1
  36. package/dist/cli/storage/arguments.d.ts +5 -5
  37. package/dist/cli/storage/arguments.d.ts.map +1 -1
  38. package/dist/cli/storage/arguments.js +3 -3
  39. package/dist/cli/storage/arguments.js.map +1 -1
  40. package/dist/cli/storage/premises.d.ts +5 -5
  41. package/dist/cli/storage/premises.d.ts.map +1 -1
  42. package/dist/cli/storage/premises.js +3 -3
  43. package/dist/cli/storage/premises.js.map +1 -1
  44. package/dist/cli/storage/roles.d.ts +3 -3
  45. package/dist/cli/storage/roles.d.ts.map +1 -1
  46. package/dist/cli/storage/roles.js +2 -2
  47. package/dist/cli/storage/roles.js.map +1 -1
  48. package/dist/cli/storage/variables.d.ts +3 -3
  49. package/dist/cli/storage/variables.d.ts.map +1 -1
  50. package/dist/cli/storage/variables.js +2 -2
  51. package/dist/cli/storage/variables.js.map +1 -1
  52. package/dist/cli.js +7 -5
  53. package/dist/cli.js.map +1 -1
  54. package/dist/index.d.ts +13 -0
  55. package/dist/index.d.ts.map +1 -1
  56. package/dist/index.js +12 -0
  57. package/dist/index.js.map +1 -1
  58. package/dist/lib/core/ArgumentEngine.d.ts +90 -12
  59. package/dist/lib/core/ArgumentEngine.d.ts.map +1 -1
  60. package/dist/lib/core/ArgumentEngine.js +104 -20
  61. package/dist/lib/core/ArgumentEngine.js.map +1 -1
  62. package/dist/lib/core/ExpressionManager.d.ts +60 -8
  63. package/dist/lib/core/ExpressionManager.d.ts.map +1 -1
  64. package/dist/lib/core/ExpressionManager.js +52 -3
  65. package/dist/lib/core/ExpressionManager.js.map +1 -1
  66. package/dist/lib/core/PremiseManager.d.ts +43 -23
  67. package/dist/lib/core/PremiseManager.d.ts.map +1 -1
  68. package/dist/lib/core/PremiseManager.js +65 -37
  69. package/dist/lib/core/PremiseManager.js.map +1 -1
  70. package/dist/lib/core/VariableManager.d.ts +39 -6
  71. package/dist/lib/core/VariableManager.d.ts.map +1 -1
  72. package/dist/lib/core/VariableManager.js +26 -0
  73. package/dist/lib/core/VariableManager.js.map +1 -1
  74. package/dist/lib/core/diff.d.ts +20 -0
  75. package/dist/lib/core/diff.d.ts.map +1 -0
  76. package/dist/lib/core/diff.js +213 -0
  77. package/dist/lib/core/diff.js.map +1 -0
  78. package/dist/lib/core/evaluation/shared.d.ts +19 -5
  79. package/dist/lib/core/evaluation/shared.d.ts.map +1 -1
  80. package/dist/lib/core/evaluation/shared.js +34 -2
  81. package/dist/lib/core/evaluation/shared.js.map +1 -1
  82. package/dist/lib/core/import.d.ts +14 -0
  83. package/dist/lib/core/import.d.ts.map +1 -0
  84. package/dist/lib/core/import.js +217 -0
  85. package/dist/lib/core/import.js.map +1 -0
  86. package/dist/lib/core/parser/formula-gen.js +850 -0
  87. package/dist/lib/core/parser/formula.d.ts +23 -0
  88. package/dist/lib/core/parser/formula.d.ts.map +1 -0
  89. package/dist/lib/core/parser/formula.js +7 -0
  90. package/dist/lib/core/parser/formula.js.map +1 -0
  91. package/dist/lib/index.d.ts +9 -0
  92. package/dist/lib/index.d.ts.map +1 -1
  93. package/dist/lib/index.js +8 -0
  94. package/dist/lib/index.js.map +1 -1
  95. package/dist/lib/schemata/analysis.d.ts +4 -3
  96. package/dist/lib/schemata/analysis.d.ts.map +1 -1
  97. package/dist/lib/schemata/analysis.js +6 -3
  98. package/dist/lib/schemata/analysis.js.map +1 -1
  99. package/dist/lib/schemata/argument.d.ts +25 -16
  100. package/dist/lib/schemata/argument.d.ts.map +1 -1
  101. package/dist/lib/schemata/argument.js +21 -13
  102. package/dist/lib/schemata/argument.js.map +1 -1
  103. package/dist/lib/schemata/import.d.ts +33 -0
  104. package/dist/lib/schemata/import.d.ts.map +1 -0
  105. package/dist/lib/schemata/import.js +18 -0
  106. package/dist/lib/schemata/import.js.map +1 -0
  107. package/dist/lib/schemata/index.d.ts +1 -0
  108. package/dist/lib/schemata/index.d.ts.map +1 -1
  109. package/dist/lib/schemata/index.js +1 -0
  110. package/dist/lib/schemata/index.js.map +1 -1
  111. package/dist/lib/schemata/propositional.d.ts +34 -25
  112. package/dist/lib/schemata/propositional.d.ts.map +1 -1
  113. package/dist/lib/schemata/propositional.js +41 -33
  114. package/dist/lib/schemata/propositional.js.map +1 -1
  115. package/dist/lib/types/diff.d.ts +56 -0
  116. package/dist/lib/types/diff.d.ts.map +1 -0
  117. package/dist/lib/types/diff.js +2 -0
  118. package/dist/lib/types/diff.js.map +1 -0
  119. package/dist/lib/types/evaluation.d.ts +128 -61
  120. package/dist/lib/types/evaluation.d.ts.map +1 -1
  121. package/dist/lib/utils/collections.d.ts +6 -0
  122. package/dist/lib/utils/collections.d.ts.map +1 -1
  123. package/dist/lib/utils/collections.js +6 -0
  124. package/dist/lib/utils/collections.js.map +1 -1
  125. package/dist/lib/utils.d.ts +7 -0
  126. package/dist/lib/utils.d.ts.map +1 -1
  127. package/dist/lib/utils.js +7 -5
  128. package/dist/lib/utils.js.map +1 -1
  129. package/package.json +15 -3
@@ -0,0 +1,23 @@
1
+ export type FormulaAST = {
2
+ type: "variable";
3
+ name: string;
4
+ } | {
5
+ type: "not";
6
+ operand: FormulaAST;
7
+ } | {
8
+ type: "and";
9
+ operands: FormulaAST[];
10
+ } | {
11
+ type: "or";
12
+ operands: FormulaAST[];
13
+ } | {
14
+ type: "implies";
15
+ left: FormulaAST;
16
+ right: FormulaAST;
17
+ } | {
18
+ type: "iff";
19
+ left: FormulaAST;
20
+ right: FormulaAST;
21
+ };
22
+ export declare function parseFormula(input: string): FormulaAST;
23
+ //# sourceMappingURL=formula.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formula.d.ts","sourceRoot":"","sources":["../../../../src/lib/core/parser/formula.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,UAAU,GAChB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,UAAU,CAAA;CAAE,GACpC;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,EAAE,UAAU,EAAE,CAAA;CAAE,GACvC;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,UAAU,EAAE,CAAA;CAAE,GACtC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,UAAU,CAAA;CAAE,GACxD;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,UAAU,CAAA;CAAE,CAAA;AAE1D,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAGtD"}
@@ -0,0 +1,7 @@
1
+ // @ts-expect-error — generated parser has no type declarations
2
+ import { parse as pegParse } from "./formula-gen.js";
3
+ export function parseFormula(input) {
4
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call -- generated parser has no type declarations
5
+ return pegParse(input);
6
+ }
7
+ //# sourceMappingURL=formula.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formula.js","sourceRoot":"","sources":["../../../../src/lib/core/parser/formula.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAUpD,MAAM,UAAU,YAAY,CAAC,KAAa;IACtC,0GAA0G;IAC1G,OAAO,QAAQ,CAAC,KAAK,CAAe,CAAA;AACxC,CAAC"}
@@ -1,4 +1,13 @@
1
+ /**
2
+ * Library barrel export. Re-exports core classes, evaluation types, diff
3
+ * types, and the diff function.
4
+ */
1
5
  export { ArgumentEngine } from "./core/ArgumentEngine.js";
2
6
  export { PremiseManager } from "./core/PremiseManager.js";
3
7
  export * from "./types/evaluation.js";
8
+ export * from "./types/diff.js";
9
+ export { diffArguments, defaultCompareArgument, defaultCompareVariable, defaultComparePremise, defaultCompareExpression, } from "./core/diff.js";
10
+ export { importArgumentFromYaml } from "./core/import.js";
11
+ export { parseFormula } from "./core/parser/formula.js";
12
+ export type { FormulaAST } from "./core/parser/formula.js";
4
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,cAAc,uBAAuB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,OAAO,EACH,aAAa,EACb,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,wBAAwB,GAC3B,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,YAAY,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA"}
package/dist/lib/index.js CHANGED
@@ -1,4 +1,12 @@
1
+ /**
2
+ * Library barrel export. Re-exports core classes, evaluation types, diff
3
+ * types, and the diff function.
4
+ */
1
5
  export { ArgumentEngine } from "./core/ArgumentEngine.js";
2
6
  export { PremiseManager } from "./core/PremiseManager.js";
3
7
  export * from "./types/evaluation.js";
8
+ export * from "./types/diff.js";
9
+ export { diffArguments, defaultCompareArgument, defaultCompareVariable, defaultComparePremise, defaultCompareExpression, } from "./core/diff.js";
10
+ export { importArgumentFromYaml } from "./core/import.js";
11
+ export { parseFormula } from "./core/parser/formula.js";
4
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,cAAc,uBAAuB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,OAAO,EACH,aAAa,EACb,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,wBAAwB,GAC3B,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA"}
@@ -1,8 +1,9 @@
1
1
  import Type, { type Static } from "typebox";
2
- export declare const AnalysisFileSchema: Type.TObject<{
2
+ export declare const CoreAnalysisFileSchema: Type.TObject<{
3
3
  argumentId: Type.TString;
4
4
  argumentVersion: Type.TNumber;
5
- assignments: Type.TRecord<"^.*$", Type.TBoolean>;
5
+ assignments: Type.TRecord<"^.*$", Type.TUnion<[Type.TBoolean, Type.TNull]>>;
6
+ rejectedExpressionIds: Type.TArray<Type.TString>;
6
7
  }>;
7
- export type TAnalysisFile = Static<typeof AnalysisFileSchema>;
8
+ export type TCoreAnalysisFile = Static<typeof CoreAnalysisFileSchema>;
8
9
  //# sourceMappingURL=analysis.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"analysis.d.ts","sourceRoot":"","sources":["../../../src/lib/schemata/analysis.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAA;AAG3C,eAAO,MAAM,kBAAkB;;;;EAM7B,CAAA;AACF,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAA"}
1
+ {"version":3,"file":"analysis.d.ts","sourceRoot":"","sources":["../../../src/lib/schemata/analysis.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAA;AAG3C,eAAO,MAAM,sBAAsB;;;;;EAajC,CAAA;AACF,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAA"}
@@ -1,10 +1,13 @@
1
1
  import Type, {} from "typebox";
2
2
  import { UUID } from "./shared.js";
3
- export const AnalysisFileSchema = Type.Object({
3
+ export const CoreAnalysisFileSchema = Type.Object({
4
4
  argumentId: UUID,
5
5
  argumentVersion: Type.Number(),
6
- assignments: Type.Record(Type.String(), Type.Boolean(), {
7
- description: "Variable symbol → truth-value mapping.",
6
+ assignments: Type.Record(Type.String(), Type.Union([Type.Boolean(), Type.Null()]), {
7
+ description: "Variable symbol → true/false/null (unset).",
8
+ }),
9
+ rejectedExpressionIds: Type.Array(Type.String(), {
10
+ description: "Expression IDs rejected by the user.",
8
11
  }),
9
12
  });
10
13
  //# sourceMappingURL=analysis.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"analysis.js","sourceRoot":"","sources":["../../../src/lib/schemata/analysis.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAe,MAAM,SAAS,CAAA;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAElC,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC,MAAM,CAAC;IAC1C,UAAU,EAAE,IAAI;IAChB,eAAe,EAAE,IAAI,CAAC,MAAM,EAAE;IAC9B,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE;QACpD,WAAW,EAAE,wCAAwC;KACxD,CAAC;CACL,CAAC,CAAA"}
1
+ {"version":3,"file":"analysis.js","sourceRoot":"","sources":["../../../src/lib/schemata/analysis.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAe,MAAM,SAAS,CAAA;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAElC,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC,MAAM,CAAC;IAC9C,UAAU,EAAE,IAAI;IAChB,eAAe,EAAE,IAAI,CAAC,MAAM,EAAE;IAC9B,WAAW,EAAE,IAAI,CAAC,MAAM,CACpB,IAAI,CAAC,MAAM,EAAE,EACb,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,EACzC;QACI,WAAW,EAAE,4CAA4C;KAC5D,CACJ;IACD,qBAAqB,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE;QAC7C,WAAW,EAAE,sCAAsC;KACtD,CAAC;CACL,CAAC,CAAA"}
@@ -1,24 +1,33 @@
1
1
  import Type, { type Static } from "typebox";
2
- export declare const ArgumentMetaSchema: Type.TObject<{
3
- id: Type.TString;
2
+ export declare const CoreArgumentMetadataSchema: Type.TObject<{
4
3
  title: Type.TString;
5
- description: Type.TString;
4
+ description: Type.TOptional<Type.TString>;
5
+ }>;
6
+ export type TCoreArgumentMetadata = Static<typeof CoreArgumentMetadataSchema>;
7
+ export declare const CoreArgumentMetaSchema: Type.TObject<{
8
+ id: Type.TString;
9
+ metadata: Type.TObject<{
10
+ title: Type.TString;
11
+ description: Type.TOptional<Type.TString>;
12
+ }>;
6
13
  }>;
7
- export type TArgumentMeta = Static<typeof ArgumentMetaSchema>;
8
- export declare const ArgumentVersionedSchema: Type.TObject<{
14
+ export type TCoreArgumentMeta = Static<typeof CoreArgumentMetaSchema>;
15
+ export declare const CoreArgumentVersionedSchema: Type.TObject<{
9
16
  version: Type.TNumber;
10
17
  createdAt: Type.TNumber;
11
18
  }>;
12
- export type TArgumentVersioned = Static<typeof ArgumentVersionedSchema>;
13
- export declare const ArgumentMutableDataSchema: Type.TObject<{
19
+ export type TCoreArgumentVersioned = Static<typeof CoreArgumentVersionedSchema>;
20
+ export declare const CoreArgumentMutableDataSchema: Type.TObject<{
14
21
  published: Type.TBoolean;
15
22
  publishedAt: Type.TOptional<Type.TNumber>;
16
23
  }>;
17
- export type TArgumentMutableData = Static<typeof ArgumentMutableDataSchema>;
18
- export declare const ArgumentSchema: Type.TIntersect<[Type.TObject<{
24
+ export type TCoreArgumentMutableData = Static<typeof CoreArgumentMutableDataSchema>;
25
+ export declare const CoreArgumentSchema: Type.TIntersect<[Type.TObject<{
19
26
  id: Type.TString;
20
- title: Type.TString;
21
- description: Type.TString;
27
+ metadata: Type.TObject<{
28
+ title: Type.TString;
29
+ description: Type.TOptional<Type.TString>;
30
+ }>;
22
31
  }>, Type.TObject<{
23
32
  version: Type.TNumber;
24
33
  createdAt: Type.TNumber;
@@ -26,18 +35,18 @@ export declare const ArgumentSchema: Type.TIntersect<[Type.TObject<{
26
35
  published: Type.TBoolean;
27
36
  publishedAt: Type.TOptional<Type.TNumber>;
28
37
  }>]>;
29
- export type TArgument = Static<typeof ArgumentSchema>;
30
- export declare const ArgumentVersionMetaSchema: Type.TIntersect<[Type.TObject<{
38
+ export type TCoreArgument = Static<typeof CoreArgumentSchema>;
39
+ export declare const CoreArgumentVersionMetaSchema: Type.TIntersect<[Type.TObject<{
31
40
  version: Type.TNumber;
32
41
  createdAt: Type.TNumber;
33
42
  }>, Type.TObject<{
34
43
  published: Type.TBoolean;
35
44
  publishedAt: Type.TOptional<Type.TNumber>;
36
45
  }>]>;
37
- export type TArgumentVersionMeta = Static<typeof ArgumentVersionMetaSchema>;
38
- export declare const ArgumentRoleStateSchema: Type.TObject<{
46
+ export type TCoreArgumentVersionMeta = Static<typeof CoreArgumentVersionMetaSchema>;
47
+ export declare const CoreArgumentRoleStateSchema: Type.TObject<{
39
48
  conclusionPremiseId: Type.TOptional<Type.TString>;
40
49
  supportingPremiseIds: Type.TArray<Type.TString>;
41
50
  }>;
42
- export type TArgumentRoleState = Static<typeof ArgumentRoleStateSchema>;
51
+ export type TCoreArgumentRoleState = Static<typeof CoreArgumentRoleStateSchema>;
43
52
  //# sourceMappingURL=argument.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"argument.d.ts","sourceRoot":"","sources":["../../../src/lib/schemata/argument.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAA;AAG3C,eAAO,MAAM,kBAAkB;;;;EAU9B,CAAA;AACD,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAE7D,eAAO,MAAM,uBAAuB;;;EAanC,CAAA;AACD,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAEvE,eAAO,MAAM,yBAAyB;;;EAcrC,CAAA;AACD,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAE3E,eAAO,MAAM,cAAc;;;;;;;;;;IAIzB,CAAA;AACF,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,cAAc,CAAC,CAAA;AAErD,eAAO,MAAM,yBAAyB;;;;;;IAGpC,CAAA;AACF,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAE3E,eAAO,MAAM,uBAAuB;;;EAGlC,CAAA;AACF,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAA"}
1
+ {"version":3,"file":"argument.d.ts","sourceRoot":"","sources":["../../../src/lib/schemata/argument.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAA;AAG3C,eAAO,MAAM,0BAA0B;;;EAStC,CAAA;AACD,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAE7E,eAAO,MAAM,sBAAsB;;;;;;EASlC,CAAA;AACD,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAErE,eAAO,MAAM,2BAA2B;;;EAavC,CAAA;AACD,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,OAAO,2BAA2B,CAAC,CAAA;AAE/E,eAAO,MAAM,6BAA6B;;;EAczC,CAAA;AACD,MAAM,MAAM,wBAAwB,GAAG,MAAM,CACzC,OAAO,6BAA6B,CACvC,CAAA;AAED,eAAO,MAAM,kBAAkB;;;;;;;;;;;;IAI7B,CAAA;AACF,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAE7D,eAAO,MAAM,6BAA6B;;;;;;IAGxC,CAAA;AACF,MAAM,MAAM,wBAAwB,GAAG,MAAM,CACzC,OAAO,6BAA6B,CACvC,CAAA;AAED,eAAO,MAAM,2BAA2B;;;EASvC,CAAA;AACD,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,OAAO,2BAA2B,CAAC,CAAA"}
@@ -1,13 +1,19 @@
1
1
  import Type, {} from "typebox";
2
2
  import { UUID } from "./shared.js";
3
- export const ArgumentMetaSchema = Type.Object({
4
- id: UUID,
3
+ export const CoreArgumentMetadataSchema = Type.Object({
5
4
  title: Type.String(),
6
- description: Type.String(),
5
+ description: Type.Optional(Type.String()),
6
+ }, {
7
+ additionalProperties: Type.String(),
8
+ description: "User-facing descriptive metadata for an argument.",
9
+ });
10
+ export const CoreArgumentMetaSchema = Type.Object({
11
+ id: UUID,
12
+ metadata: CoreArgumentMetadataSchema,
7
13
  }, {
8
14
  description: "Metadata for an argument that does not change for different versions of the same argument.",
9
15
  });
10
- export const ArgumentVersionedSchema = Type.Object({
16
+ export const CoreArgumentVersionedSchema = Type.Object({
11
17
  version: Type.Number(),
12
18
  createdAt: Type.Number({
13
19
  description: "Unix timestamp in milliseconds of when the argument was created.",
@@ -16,7 +22,7 @@ export const ArgumentVersionedSchema = Type.Object({
16
22
  }, {
17
23
  description: "Data for an argument that will differ between different versions of the same argument",
18
24
  });
19
- export const ArgumentMutableDataSchema = Type.Object({
25
+ export const CoreArgumentMutableDataSchema = Type.Object({
20
26
  published: Type.Boolean(),
21
27
  publishedAt: Type.Optional(Type.Number({
22
28
  description: "Unix timestamp in milliseconds of when the argument was published.",
@@ -24,17 +30,19 @@ export const ArgumentMutableDataSchema = Type.Object({
24
30
  }, {
25
31
  description: "Data for an argument that can be changed (e.g. published status).",
26
32
  });
27
- export const ArgumentSchema = Type.Intersect([
28
- ArgumentMetaSchema,
29
- ArgumentVersionedSchema,
30
- ArgumentMutableDataSchema,
33
+ export const CoreArgumentSchema = Type.Intersect([
34
+ CoreArgumentMetaSchema,
35
+ CoreArgumentVersionedSchema,
36
+ CoreArgumentMutableDataSchema,
31
37
  ]);
32
- export const ArgumentVersionMetaSchema = Type.Intersect([
33
- ArgumentVersionedSchema,
34
- ArgumentMutableDataSchema,
38
+ export const CoreArgumentVersionMetaSchema = Type.Intersect([
39
+ CoreArgumentVersionedSchema,
40
+ CoreArgumentMutableDataSchema,
35
41
  ]);
36
- export const ArgumentRoleStateSchema = Type.Object({
42
+ export const CoreArgumentRoleStateSchema = Type.Object({
37
43
  conclusionPremiseId: Type.Optional(UUID),
38
44
  supportingPremiseIds: Type.Array(UUID),
45
+ }, {
46
+ description: "Tracks which premises serve as the conclusion and which are supporting.",
39
47
  });
40
48
  //# sourceMappingURL=argument.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"argument.js","sourceRoot":"","sources":["../../../src/lib/schemata/argument.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAe,MAAM,SAAS,CAAA;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAElC,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC,M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AC,CAAA;AAGF,MAAM,CAAC,MAAM,6BAA6B,GAAG,IAAI,CAAC,SAAS,CAAC;IACxD,2BAA2B;IAC3B,6BAA6B;CAChC,CAAC,CAAA;AAKF,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI,CAAC,MAAM,CAClD;IACI,mBAAmB,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;IACxC,oBAAoB,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;CACzC,EACD;IACI,WAAW,EACP,yEAAyE;CAChF,CACJ,CAAA"}
@@ -0,0 +1,33 @@
1
+ import Type, { type Static } from "typebox";
2
+ export declare const CoreYamlPremiseMetadataSchema: Type.TObject<{
3
+ title: Type.TOptional<Type.TString>;
4
+ }>;
5
+ export type TCoreYamlPremiseMetadata = Static<typeof CoreYamlPremiseMetadataSchema>;
6
+ export declare const CoreYamlPremiseSchema: Type.TObject<{
7
+ metadata: Type.TOptional<Type.TObject<{
8
+ title: Type.TOptional<Type.TString>;
9
+ }>>;
10
+ role: Type.TOptional<Type.TUnion<[Type.TLiteral<"conclusion">, Type.TLiteral<"supporting">]>>;
11
+ formula: Type.TString;
12
+ }>;
13
+ export type TCoreYamlPremise = Static<typeof CoreYamlPremiseSchema>;
14
+ export declare const CoreYamlArgumentMetadataSchema: Type.TObject<{
15
+ title: Type.TString;
16
+ description: Type.TOptional<Type.TString>;
17
+ }>;
18
+ export type TCoreYamlArgumentMetadata = Static<typeof CoreYamlArgumentMetadataSchema>;
19
+ export declare const CoreYamlArgumentSchema: Type.TObject<{
20
+ metadata: Type.TObject<{
21
+ title: Type.TString;
22
+ description: Type.TOptional<Type.TString>;
23
+ }>;
24
+ premises: Type.TArray<Type.TObject<{
25
+ metadata: Type.TOptional<Type.TObject<{
26
+ title: Type.TOptional<Type.TString>;
27
+ }>>;
28
+ role: Type.TOptional<Type.TUnion<[Type.TLiteral<"conclusion">, Type.TLiteral<"supporting">]>>;
29
+ formula: Type.TString;
30
+ }>>;
31
+ }>;
32
+ export type TCoreYamlArgument = Static<typeof CoreYamlArgumentSchema>;
33
+ //# sourceMappingURL=import.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"import.d.ts","sourceRoot":"","sources":["../../../src/lib/schemata/import.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAA;AAE3C,eAAO,MAAM,6BAA6B;;EAKzC,CAAA;AACD,MAAM,MAAM,wBAAwB,GAAG,MAAM,CACzC,OAAO,6BAA6B,CACvC,CAAA;AAED,eAAO,MAAM,qBAAqB;;;;;;EAMhC,CAAA;AAEF,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEnE,eAAO,MAAM,8BAA8B;;;EAM1C,CAAA;AACD,MAAM,MAAM,yBAAyB,GAAG,MAAM,CAC1C,OAAO,8BAA8B,CACxC,CAAA;AAED,eAAO,MAAM,sBAAsB;;;;;;;;;;;;EAGjC,CAAA;AAEF,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAA"}
@@ -0,0 +1,18 @@
1
+ import Type, {} from "typebox";
2
+ export const CoreYamlPremiseMetadataSchema = Type.Object({
3
+ title: Type.Optional(Type.String()),
4
+ }, { additionalProperties: Type.String() });
5
+ export const CoreYamlPremiseSchema = Type.Object({
6
+ metadata: Type.Optional(CoreYamlPremiseMetadataSchema),
7
+ role: Type.Optional(Type.Union([Type.Literal("conclusion"), Type.Literal("supporting")])),
8
+ formula: Type.String(),
9
+ });
10
+ export const CoreYamlArgumentMetadataSchema = Type.Object({
11
+ title: Type.String(),
12
+ description: Type.Optional(Type.String({ default: "" })),
13
+ }, { additionalProperties: Type.String() });
14
+ export const CoreYamlArgumentSchema = Type.Object({
15
+ metadata: CoreYamlArgumentMetadataSchema,
16
+ premises: Type.Array(CoreYamlPremiseSchema, { minItems: 1 }),
17
+ });
18
+ //# sourceMapping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* from "./analysis.js";
2
2
  export * from "./argument.js";
3
+ export * from "./import.js";
3
4
  export * from "./propositional.js";
4
5
  export * from "./shared.js";
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/schemata/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/schemata/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA"}
@@ -1,5 +1,6 @@
1
1
  export * from "./analysis.js";
2
2
  export * from "./argument.js";
3
+ export * from "./import.js";
3
4
  export * from "./propositional.js";
4
5
  export * from "./shared.js";
5
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/schemata/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/schemata/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import Type, { type Static } from "typebox";
2
- export declare const PropositionalExpressionTypes: Type.TUnion<[Type.TLiteral<"variable">, Type.TLiteral<"operator">, Type.TLiteral<"formula">]>;
3
- export type TPropositionalExpressionTypes = Static<typeof PropositionalExpressionTypes>;
4
- export declare const PropositionalVariableExpressionSchema: Type.TObject<{
2
+ export declare const CorePropositionalExpressionTypes: Type.TUnion<[Type.TLiteral<"variable">, Type.TLiteral<"operator">, Type.TLiteral<"formula">]>;
3
+ export type TCorePropositionalExpressionTypes = Static<typeof CorePropositionalExpressionTypes>;
4
+ export declare const CorePropositionalVariableExpressionSchema: Type.TObject<{
5
5
  id: Type.TString;
6
6
  argumentId: Type.TString;
7
7
  argumentVersion: Type.TNumber;
@@ -10,10 +10,10 @@ export declare const PropositionalVariableExpressionSchema: Type.TObject<{
10
10
  type: Type.TLiteral<"variable">;
11
11
  variableId: Type.TString;
12
12
  }>;
13
- export type TPropositionalVariableExpression = Static<typeof PropositionalVariableExpressionSchema>;
14
- export declare const LogicalOperatorType: Type.TUnion<[Type.TLiteral<"not">, Type.TLiteral<"and">, Type.TLiteral<"or">, Type.TLiteral<"implies">, Type.TLiteral<"iff">]>;
15
- export type TLogicalOperatorType = Static<typeof LogicalOperatorType>;
16
- export declare const OperatorExpressionSchema: Type.TObject<{
13
+ export type TCorePropositionalVariableExpression = Static<typeof CorePropositionalVariableExpressionSchema>;
14
+ export declare const CoreLogicalOperatorType: Type.TUnion<[Type.TLiteral<"not">, Type.TLiteral<"and">, Type.TLiteral<"or">, Type.TLiteral<"implies">, Type.TLiteral<"iff">]>;
15
+ export type TCoreLogicalOperatorType = Static<typeof CoreLogicalOperatorType>;
16
+ export declare const CoreOperatorExpressionSchema: Type.TObject<{
17
17
  id: Type.TString;
18
18
  argumentId: Type.TString;
19
19
  argumentVersion: Type.TNumber;
@@ -22,8 +22,8 @@ export declare const OperatorExpressionSchema: Type.TObject<{
22
22
  type: Type.TLiteral<"operator">;
23
23
  operator: Type.TUnion<[Type.TLiteral<"not">, Type.TLiteral<"and">, Type.TLiteral<"or">, Type.TLiteral<"implies">, Type.TLiteral<"iff">]>;
24
24
  }>;
25
- export type TOperatorExpression = Static<typeof OperatorExpressionSchema>;
26
- export declare const FormulaExpressionSchema: Type.TObject<{
25
+ export type TCoreOperatorExpression = Static<typeof CoreOperatorExpressionSchema>;
26
+ export declare const CoreFormulaExpressionSchema: Type.TObject<{
27
27
  id: Type.TString;
28
28
  argumentId: Type.TString;
29
29
  argumentVersion: Type.TNumber;
@@ -31,8 +31,8 @@ export declare const FormulaExpressionSchema: Type.TObject<{
31
31
  position: Type.TUnion<[Type.TInteger, Type.TNull]>;
32
32
  type: Type.TLiteral<"formula">;
33
33
  }>;
34
- export type TFormulaExpression = Static<typeof FormulaExpressionSchema>;
35
- export declare const PropositionalExpressionSchema: Type.TUnion<[Type.TObject<{
34
+ export type TCoreFormulaExpression = Static<typeof CoreFormulaExpressionSchema>;
35
+ export declare const CorePropositionalExpressionSchema: Type.TUnion<[Type.TObject<{
36
36
  id: Type.TString;
37
37
  argumentId: Type.TString;
38
38
  argumentVersion: Type.TNumber;
@@ -56,23 +56,32 @@ export declare const PropositionalExpressionSchema: Type.TUnion<[Type.TObject<{
56
56
  position: Type.TUnion<[Type.TInteger, Type.TNull]>;
57
57
  type: Type.TLiteral<"formula">;
58
58
  }>]>;
59
- export type TPropositionalExpressionCombined = Static<typeof PropositionalExpressionSchema>;
60
- export type TPropositionalExpression<T extends TPropositionalExpressionTypes = TPropositionalExpressionTypes> = Extract<TPropositionalExpressionCombined, {
59
+ export type TCorePropositionalExpressionCombined = Static<typeof CorePropositionalExpressionSchema>;
60
+ export type TCorePropositionalExpression<T extends TCorePropositionalExpressionTypes = TCorePropositionalExpressionTypes> = Extract<TCorePropositionalExpressionCombined, {
61
61
  type: T;
62
62
  }>;
63
- export declare const PropositionalVariableSchema: Type.TObject<{
63
+ export declare const CoreVariableMetadataSchema: Type.TRecord<"^.*$", Type.TString>;
64
+ export type TCoreVariableMetadata = Static<typeof CoreVariableMetadataSchema>;
65
+ export declare const CorePropositionalVariableSchema: Type.TObject<{
64
66
  id: Type.TString;
65
67
  argumentId: Type.TString;
66
68
  argumentVersion: Type.TNumber;
67
69
  symbol: Type.TString;
70
+ metadata: Type.TRecord<"^.*$", Type.TString>;
68
71
  }>;
69
- export type TPropositionalVariable = Static<typeof PropositionalVariableSchema>;
70
- export declare const PremiseMetaSchema: Type.TObject<{
71
- id: Type.TString;
72
+ export type TCorePropositionalVariable = Static<typeof CorePropositionalVariableSchema>;
73
+ export declare const CorePremiseMetadataSchema: Type.TObject<{
72
74
  title: Type.TOptional<Type.TString>;
73
75
  }>;
74
- export type TPremiseMeta = Static<typeof PremiseMetaSchema>;
75
- export declare const PremiseDataSchema: Type.TObject<{
76
+ export type TCorePremiseMetadata = Static<typeof CorePremiseMetadataSchema>;
77
+ export declare const CorePremiseMetaSchema: Type.TObject<{
78
+ id: Type.TString;
79
+ metadata: Type.TObject<{
80
+ title: Type.TOptional<Type.TString>;
81
+ }>;
82
+ }>;
83
+ export type TCorePremiseMeta = Static<typeof CorePremiseMetaSchema>;
84
+ export declare const CorePremiseDataSchema: Type.TObject<{
76
85
  rootExpressionId: Type.TOptional<Type.TString>;
77
86
  variables: Type.TArray<Type.TString>;
78
87
  expressions: Type.TArray<Type.TUnion<[Type.TObject<{
@@ -99,12 +108,13 @@ export declare const PremiseDataSchema: Type.TObject<{
99
108
  position: Type.TUnion<[Type.TInteger, Type.TNull]>;
100
109
  type: Type.TLiteral<"formula">;
101
110
  }>]>>;
102
- type: Type.TUnion<[Type.TLiteral<"inference">, Type.TLiteral<"constraint">]>;
103
111
  }>;
104
- export type TPremiseData = Static<typeof PremiseDataSchema>;
105
- export declare const PremiseSchema: Type.TIntersect<[Type.TObject<{
112
+ export type TCorePremiseData = Static<typeof CorePremiseDataSchema>;
113
+ export declare const CorePremiseSchema: Type.TIntersect<[Type.TObject<{
106
114
  id: Type.TString;
107
- title: Type.TOptional<Type.TString>;
115
+ metadata: Type.TObject<{
116
+ title: Type.TOptional<Type.TString>;
117
+ }>;
108
118
  }>, Type.TObject<{
109
119
  rootExpressionId: Type.TOptional<Type.TString>;
110
120
  variables: Type.TArray<Type.TString>;
@@ -132,7 +142,6 @@ export declare const PremiseSchema: Type.TIntersect<[Type.TObject<{
132
142
  position: Type.TUnion<[Type.TInteger, Type.TNull]>;
133
143
  type: Type.TLiteral<"formula">;
134
144
  }>]>>;
135
- type: Type.TUnion<[Type.TLiteral<"inference">, Type.TLiteral<"constraint">]>;
136
145
  }>]>;
137
- export type TPremise = Static<typeof PremiseSchema>;
146
+ export type TCorePremise = Static<typeof CorePremiseSchema>;
138
147
  //# sourceMappingURL=propositional.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"propositional.d.ts","sourceRoot":"","sources":["../../../src/lib/schemata/propositional.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAA;AAO3C,eAAO,MAAM,4BAA4B,+FAIvC,CAAA;AACF,MAAM,MAAM,6BAA6B,GAAG,MAAM,CAC9C,OAAO,4BAA4B,CACtC,CAAA;AAoBD,eAAO,MAAM,qCAAqC;;;;;;;;EAMjD,CAAA;AAED,MAAM,MAAM,gCAAgC,GAAG,MAAM,CACjD,OAAO,qCAAqC,CAC/C,CAAA;AAED,eAAO,MAAM,mBAAmB,gIAM9B,CAAA;AAEF,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAErE,eAAO,MAAM,wBAAwB;;;;;;;;EAMpC,CAAA;AACD,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAEzE,eAAO,MAAM,uBAAuB;;;;;;;EAKnC,CAAA;AACD,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAEvE,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;IAIxC,CAAA;AAEF,MAAM,MAAM,gCAAgC,GAAG,MAAM,CACjD,OAAO,6BAA6B,CACvC,CAAA;AAED,MAAM,MAAM,wBAAwB,CAChC,CAAC,SAAS,6BAA6B,GAAG,6BAA6B,IACv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EAKvC,CAAA;AACD,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,OAAO,2BAA2B,CAAC,CAAA;AAE/E,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;IAI5C,CAAA;AAEF,MAAM,MAAM,oCAAoC,GAAG,MAAM,CACrD,OAAO,iCAAiC,CAC3C,CAAA;AAED,MAAM,MAAM,4BAA4B,CACpC,CAAC,SAAS,iCAAiC,GACvC,iCAAiC,IACrC,OAAO,CAAC,oCAAoC,EAAE;IAAE,IAAI,EAAE,CAAC,CAAA;CAAE,CAAC,CAAA;AAE9D,eAAO,MAAM,0BAA0B,oCAMtC,CAAA;AACD,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAE7E,eAAO,MAAM,+BAA+B;;;;;;EAe3C,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG,MAAM,CAC3C,OAAO,+BAA+B,CACzC,CAAA;AAED,eAAO,MAAM,yBAAyB;;EAarC,CAAA;AACD,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAE3E,eAAO,MAAM,qBAAqB;;;;;EAQjC,CAAA;AACD,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEnE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmBjC,CAAA;AACD,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEnE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAG5B,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAA"}
@@ -3,7 +3,7 @@ import { UUID, Nullable } from "./shared.js";
3
3
  const VariableType = Type.Literal("variable");
4
4
  const OperatorType = Type.Literal("operator");
5
5
  const FormulaType = Type.Literal("formula");
6
- export const PropositionalExpressionTypes = Type.Union([
6
+ export const CorePropositionalExpressionTypes = Type.Union([
7
7
  VariableType,
8
8
  OperatorType,
9
9
  FormulaType,
@@ -20,64 +20,72 @@ const BasePropositionalExpressionSchema = Type.Object({
20
20
  description: "The ordering of this expression among its siblings under the same parent. Must be unique within (parentId, argumentId, argumentVersion).",
21
21
  })),
22
22
  });
23
- export const PropositionalVariableExpressionSchema = Type.Interface([BasePropositionalExpressionSchema], {
23
+ export const CorePropositionalVariableExpressionSchema = Type.Interface([BasePropositionalExpressionSchema], {
24
24
  type: VariableType,
25
25
  variableId: UUID,
26
26
  });
27
- export const LogicalOperatorType = Type.Union([
27
+ export const CoreLogicalOperatorType = Type.Union([
28
28
  Type.Literal("not"), // unary
29
29
  Type.Literal("and"), // variadic (≥2)
30
30
  Type.Literal("or"), // variadic (≥2)
31
31
  Type.Literal("implies"), // binary (ordered)
32
32
  Type.Literal("iff"), // binary (unordered but fixed 2)
33
33
  ]);
34
- export const OperatorExpressionSchema = Type.Interface([BasePropositionalExpressionSchema], {
34
+ export const CoreOperatorExpressionSchema = Type.Interface([BasePropositionalExpressionSchema], {
35
35
  type: OperatorType,
36
- operator: LogicalOperatorType,
36
+ operator: CoreLogicalOperatorType,
37
37
  });
38
- export const FormulaExpressionSchema = Type.Interface([BasePropositionalExpressionSchema], {
38
+ export const CoreFormulaExpressionSchema = Type.Interface([BasePropositionalExpressionSchema], {
39
39
  type: FormulaType,
40
40
  });
41
- export const PropositionalExpressionSchema = Type.Union([
42
- PropositionalVariableExpressionSchema,
43
- OperatorExpressionSchema,
44
- FormulaExpressionSchema,
41
+ export const CorePropositionalExpressionSchema = Type.Union([
42
+ CorePropositionalVariableExpressionSchema,
43
+ CoreOperatorExpressionSchema,
44
+ CoreFormulaExpressionSchema,
45
45
  ]);
46
- export const PropositionalVariableSchema = Type.Object({
46
+ export const CoreVariableMetadataSchema = Type.Record(Type.String(), Type.String(), {
47
+ description: "User-facing descriptive metadata for a variable.",
48
+ });
49
+ export const CorePropositionalVariableSchema = Type.Object({
47
50
  id: UUID,
48
51
  argumentId: UUID,
49
52
  argumentVersion: Type.Number(),
50
- symbol: Type.String(),
53
+ symbol: Type.String({
54
+ description: 'Human-readable symbol for this variable (e.g. "P", "Q").',
55
+ }),
56
+ metadata: CoreVariableMetadataSchema,
57
+ }, {
58
+ description: "A named propositional variable belonging to a specific argument version.",
51
59
  });
52
- export const PremiseMetaSchema = Type.Object({
53
- // Auto-generated UUID
54
- id: UUID,
60
+ export const CorePremiseMetadataSchema = Type.Object({
55
61
  title: Type.Optional(Type.String({
56
62
  description: "An optional title for this premise, for display purposes.",
57
63
  })),
64
+ }, {
65
+ additionalProperties: Type.String(),
66
+ description: "User-facing descriptive metadata for a premise.",
58
67
  });
59
- export const PremiseDataSchema = Type.Object({
60
- // If the premise has expressions in it, this is the ID of the root expression
61
- // which must be a relation operator if the type is "inference", else. it can
62
- // be any type of expression.
63
- rootExpressionId: Type.Optional(UUID),
68
+ export const CorePremiseMetaSchema = Type.Object({
69
+ id: UUID,
70
+ metadata: CorePremiseMetadataSchema,
71
+ }, {
72
+ description: "Identity and display metadata for a premise.",
73
+ });
74
+ export const CorePremiseDataSchema = Type.Object({
75
+ rootExpressionId: Type.Optional(Type.String({
76
+ description: "ID of the root expression, if the premise has expressions.",
77
+ })),
64
78
  variables: Type.Array(UUID, {
65
79
  description: "IDs of all variables referenced in this premise.",
66
80
  }),
67
- expressions: Type.Array(PropositionalExpressionSchema, {
68
- description: "All expressions that are part of this premise, including sub-expressions. The root of the premise will have a null parentId.",
81
+ expressions: Type.Array(CorePropositionalExpressionSchema, {
82
+ description: "All expressions in this premise. The root has a null parentId.",
69
83
  }),
70
- type: Type.Union([
71
- Type.Literal("inference", {
72
- description: "A premise whose core operator is one of inference like implies or iff",
73
- }),
74
- Type.Literal("constraint", {
75
- description: "A premise without an inference operator, it restricts the possible valuations of variables but is not part of the chain of logical reasoning.",
76
- }),
77
- ]),
84
+ }, {
85
+ description: "Expression tree and variable references for a premise.",
78
86
  });
79
- export const PremiseSchema = Type.Intersect([
80
- PremiseMetaSchema,
81
- PremiseDataSchema,
87
+ export const CorePremiseSchema = Type.Intersect([
88
+ CorePremiseMetaSchema,
89
+ CorePremiseDataSchema,
82
90
  ]);
83
91
  //# sourceMappingURL=propositional.js.map