@proposit/proposit-core 1.1.1 → 1.3.0

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 (78) hide show
  1. package/dist/extensions/argument-ingestion/index.d.ts +4 -0
  2. package/dist/extensions/argument-ingestion/index.d.ts.map +1 -1
  3. package/dist/extensions/argument-ingestion/index.js +9 -4
  4. package/dist/extensions/argument-ingestion/index.js.map +1 -1
  5. package/dist/extensions/argument-ingestion/shared/finalize-response-v2.d.ts +17 -0
  6. package/dist/extensions/argument-ingestion/shared/finalize-response-v2.d.ts.map +1 -0
  7. package/dist/extensions/argument-ingestion/shared/finalize-response-v2.js +185 -0
  8. package/dist/extensions/argument-ingestion/shared/finalize-response-v2.js.map +1 -0
  9. package/dist/extensions/argument-ingestion/stages/axiom-indicator-detection.d.ts +6 -0
  10. package/dist/extensions/argument-ingestion/stages/axiom-indicator-detection.d.ts.map +1 -0
  11. package/dist/extensions/argument-ingestion/stages/axiom-indicator-detection.js +42 -0
  12. package/dist/extensions/argument-ingestion/stages/axiom-indicator-detection.js.map +1 -0
  13. package/dist/extensions/argument-ingestion/stages/citation-source-detection.d.ts +6 -0
  14. package/dist/extensions/argument-ingestion/stages/citation-source-detection.d.ts.map +1 -0
  15. package/dist/extensions/argument-ingestion/stages/citation-source-detection.js +42 -0
  16. package/dist/extensions/argument-ingestion/stages/citation-source-detection.js.map +1 -0
  17. package/dist/extensions/argument-ingestion/stages/claim-canonicalization.d.ts +15 -0
  18. package/dist/extensions/argument-ingestion/stages/claim-canonicalization.d.ts.map +1 -0
  19. package/dist/extensions/argument-ingestion/stages/claim-canonicalization.js +148 -0
  20. package/dist/extensions/argument-ingestion/stages/claim-canonicalization.js.map +1 -0
  21. package/dist/extensions/argument-ingestion/stages/claim-mention-extraction.d.ts +6 -0
  22. package/dist/extensions/argument-ingestion/stages/claim-mention-extraction.d.ts.map +1 -0
  23. package/dist/extensions/argument-ingestion/stages/claim-mention-extraction.js +38 -0
  24. package/dist/extensions/argument-ingestion/stages/claim-mention-extraction.js.map +1 -0
  25. package/dist/extensions/argument-ingestion/stages/claim-reference-validation.d.ts +37 -0
  26. package/dist/extensions/argument-ingestion/stages/claim-reference-validation.d.ts.map +1 -0
  27. package/dist/extensions/argument-ingestion/stages/claim-reference-validation.js +108 -0
  28. package/dist/extensions/argument-ingestion/stages/claim-reference-validation.js.map +1 -0
  29. package/dist/extensions/argument-ingestion/stages/claim-type-classification.d.ts +6 -0
  30. package/dist/extensions/argument-ingestion/stages/claim-type-classification.d.ts.map +1 -0
  31. package/dist/extensions/argument-ingestion/stages/claim-type-classification.js +67 -0
  32. package/dist/extensions/argument-ingestion/stages/claim-type-classification.js.map +1 -0
  33. package/dist/extensions/argument-ingestion/stages/conclusion-selection.d.ts +20 -0
  34. package/dist/extensions/argument-ingestion/stages/conclusion-selection.d.ts.map +1 -0
  35. package/dist/extensions/argument-ingestion/stages/conclusion-selection.js +94 -0
  36. package/dist/extensions/argument-ingestion/stages/conclusion-selection.js.map +1 -0
  37. package/dist/extensions/argument-ingestion/stages/formula-compilation.d.ts +27 -0
  38. package/dist/extensions/argument-ingestion/stages/formula-compilation.d.ts.map +1 -0
  39. package/dist/extensions/argument-ingestion/stages/formula-compilation.js +175 -0
  40. package/dist/extensions/argument-ingestion/stages/formula-compilation.js.map +1 -0
  41. package/dist/extensions/argument-ingestion/stages/formula-validation.d.ts +19 -0
  42. package/dist/extensions/argument-ingestion/stages/formula-validation.d.ts.map +1 -0
  43. package/dist/extensions/argument-ingestion/stages/formula-validation.js +101 -0
  44. package/dist/extensions/argument-ingestion/stages/formula-validation.js.map +1 -0
  45. package/dist/extensions/argument-ingestion/stages/index.d.ts +15 -0
  46. package/dist/extensions/argument-ingestion/stages/index.d.ts.map +1 -0
  47. package/dist/extensions/argument-ingestion/stages/index.js +16 -0
  48. package/dist/extensions/argument-ingestion/stages/index.js.map +1 -0
  49. package/dist/extensions/argument-ingestion/stages/relation-extraction.d.ts +7 -0
  50. package/dist/extensions/argument-ingestion/stages/relation-extraction.d.ts.map +1 -0
  51. package/dist/extensions/argument-ingestion/stages/relation-extraction.js +77 -0
  52. package/dist/extensions/argument-ingestion/stages/relation-extraction.js.map +1 -0
  53. package/dist/extensions/argument-ingestion/stages/schemas.d.ts +161 -0
  54. package/dist/extensions/argument-ingestion/stages/schemas.d.ts.map +1 -0
  55. package/dist/extensions/argument-ingestion/stages/schemas.js +218 -0
  56. package/dist/extensions/argument-ingestion/stages/schemas.js.map +1 -0
  57. package/dist/extensions/argument-ingestion/stages/segmentation.d.ts +6 -0
  58. package/dist/extensions/argument-ingestion/stages/segmentation.d.ts.map +1 -0
  59. package/dist/extensions/argument-ingestion/stages/segmentation.js +37 -0
  60. package/dist/extensions/argument-ingestion/stages/segmentation.js.map +1 -0
  61. package/dist/extensions/argument-ingestion/stages/variable-assignment.d.ts +15 -0
  62. package/dist/extensions/argument-ingestion/stages/variable-assignment.d.ts.map +1 -0
  63. package/dist/extensions/argument-ingestion/stages/variable-assignment.js +84 -0
  64. package/dist/extensions/argument-ingestion/stages/variable-assignment.js.map +1 -0
  65. package/dist/extensions/argument-ingestion/v2-multi-stage.d.ts +15 -0
  66. package/dist/extensions/argument-ingestion/v2-multi-stage.d.ts.map +1 -0
  67. package/dist/extensions/argument-ingestion/v2-multi-stage.js +91 -0
  68. package/dist/extensions/argument-ingestion/v2-multi-stage.js.map +1 -0
  69. package/dist/lib/index.d.ts +2 -2
  70. package/dist/lib/index.d.ts.map +1 -1
  71. package/dist/lib/index.js +1 -1
  72. package/dist/lib/index.js.map +1 -1
  73. package/dist/lib/pipelines/stage-helpers.d.ts.map +1 -1
  74. package/dist/lib/pipelines/stage-helpers.js +32 -2
  75. package/dist/lib/pipelines/stage-helpers.js.map +1 -1
  76. package/dist/lib/pipelines/types.d.ts +20 -0
  77. package/dist/lib/pipelines/types.d.ts.map +1 -1
  78. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formula-compilation.js","sourceRoot":"","sources":["../../../../src/extensions/argument-ingestion/stages/formula-compilation.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,gEAAgE;AAChE,qEAAqE;AACrE,0DAA0D;AAC1D,EAAE;AACF,iCAAiC;AACjC,mEAAmE;AACnE,8EAA8E;AAC9E,mEAAmE;AACnE,EAAE;AACF,uCAAuC;AACvC,gEAAgE;AAChE,sEAAsE;AACtE,uDAAuD;AACvD,kEAAkE;AAClE,0DAA0D;AAC1D,sEAAsE;AACtE,4DAA4D;AAC5D,EAAE;AACF,qEAAqE;AACrE,qEAAqE;AACrE,kEAAkE;AAClE,+BAA+B;AAE/B,OAAO,EACH,SAAS,EACT,8BAA8B,GAMjC,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAA;AAG5E,MAAM,CAAC,MAAM,iCAAiC,GAAG;IAC7C,gBAAgB,EAAE,uCAAuC;IACzD,gBAAgB,EAAE,uCAAuC;IACzD,oBAAoB,EAAE,2CAA2C;IACjE,YAAY,EAAE,mCAAmC;CAC3C,CAAA;AAgBV,SAAS,kBAAkB,CACvB,SAAoC;IAEpC,MAAM,CAAC,GAAG,IAAI,GAAG,EAAkB,CAAA;IACnC,KAAK,MAAM,CAAC,IAAI,SAAS,EAAE,CAAC;QACxB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,CAAA;IAClC,CAAC;IACD,OAAO,CAAC,CAAA;AACZ,CAAC;AAED,SAAS,kBAAkB,CACvB,IAAwD;IAExD,QAAQ,IAAI,EAAE,CAAC;QACX,KAAK,SAAS;YACV,OAAO,SAAS,CAAA;QACpB,KAAK,eAAe;YAChB,OAAO,eAAe,CAAA;QAC1B,KAAK,oBAAoB;YACrB,OAAO,YAAY,CAAA;IAC3B,CAAC;AACL,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAC3B,KAA4B;IAE5B,MAAM,aAAa,GAAG,kB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,MAAM,UAAU,GAAG,GAAG,CAAC,GAAG,CACtB,SAAS,CAAC,mBAAmB,CAChC,CAAA;QACD,MAAM,SAAS,GACX,GAAG,CAAC,GAAG,CACH,SAAS,CAAC,kBAAkB,CAC/B,IAAI,EAAE,CAAA;QACX,OAAO,eAAe,CAAC;YACnB,SAAS;YACT,UAAU;YACV,SAAS;YACT,UAAU,EAAE,GAAG,CAAC,UAAU;YAC1B,UAAU,EAAE,GAAG,CAAC,UAAU;SAC7B,CAAC,CAAA;IACN,CAAC;CACJ,CAAC,CAAA"}
@@ -0,0 +1,19 @@
1
+ import { type TFormulaCompilationOutput, type TValidationStageOutput, type TVariableAssignmentOutput } from "./schemas.js";
2
+ import type { TStage } from "../../../lib/pipelines/types.js";
3
+ export declare const FORMULA_VALIDATION_FAILURE_CODES: {
4
+ readonly parseError: "FORMULA_PARSE_ERROR";
5
+ readonly symbolUnresolved: "FORMULA_SYMBOL_UNRESOLVED";
6
+ };
7
+ export type TValidateFormulasInput = {
8
+ compilation: TFormulaCompilationOutput | undefined;
9
+ variables: TVariableAssignmentOutput;
10
+ };
11
+ export declare function validateFormulas(input: TValidateFormulasInput): {
12
+ failures: {
13
+ code: string;
14
+ message: string;
15
+ context: Record<string, unknown>;
16
+ }[];
17
+ };
18
+ export declare const formulaValidationStage: TStage<TValidationStageOutput>;
19
+ //# sourceMappingURL=formula-validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formula-validation.d.ts","sourceRoot":"","sources":["../../../../src/extensions/argument-ingestion/stages/formula-validation.ts"],"names":[],"mappings":"AAcA,OAAO,EAGH,KAAK,yBAAyB,EAC9B,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EACjC,MAAM,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AAE7D,eAAO,MAAM,gCAAgC;;;CAGnC,CAAA;AAsBV,MAAM,MAAM,sBAAsB,GAAG;IACjC,WAAW,EAAE,yBAAyB,GAAG,SAAS,CAAA;IAClD,SAAS,EAAE,yBAAyB,CAAA;CACvC,CAAA;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,sBAAsB,GAAG;IAC7D,QAAQ,EAAE;QACN,IAAI,EAAE,MAAM,CAAA;QACZ,OAAO,EAAE,MAAM,CAAA;QACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KACnC,EAAE,CAAA;CACN,CA2CA;AAED,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,sBAAsB,CA4B5D,CAAA"}
@@ -0,0 +1,101 @@
1
+ // `formula-validation` — deterministic stage that re-parses every
2
+ // compiled formula via `parseFormula` and verifies each referenced atom
3
+ // resolves to a known variable symbol (from `variable-assignment`).
4
+ //
5
+ // Emits:
6
+ // - FORMULA_PARSE_ERROR — `parseFormula(formula)` threw.
7
+ // - FORMULA_SYMBOL_UNRESOLVED — a parsed atom is not among the known
8
+ // variable symbols.
9
+ //
10
+ // Doesn't gate downstream — `finalize` consumes `formula-compilation`'s
11
+ // premises directly. This stage is observational.
12
+ import { parseFormula } from "../../../lib/core/parser/formula.js";
13
+ import { STAGE_IDS, ValidationStageOutputSchema, } from "./schemas.js";
14
+ import { deterministicStage } from "../../../lib/pipelines/stage-helpers.js";
15
+ export const FORMULA_VALIDATION_FAILURE_CODES = {
16
+ parseError: "FORMULA_PARSE_ERROR",
17
+ symbolUnresolved: "FORMULA_SYMBOL_UNRESOLVED",
18
+ };
19
+ function collectAtoms(ast, out) {
20
+ switch (ast.type) {
21
+ case "variable":
22
+ out.add(ast.name);
23
+ return;
24
+ case "not":
25
+ collectAtoms(ast.operand, out);
26
+ return;
27
+ case "and":
28
+ case "or":
29
+ for (const child of ast.operands)
30
+ collectAtoms(child, out);
31
+ return;
32
+ case "implies":
33
+ case "iff":
34
+ collectAtoms(ast.left, out);
35
+ collectAtoms(ast.right, out);
36
+ return;
37
+ }
38
+ }
39
+ export function validateFormulas(input) {
40
+ const failures = [];
41
+ const knownSymbols = new Set(input.variables.map((v) => v.symbol));
42
+ if (!input.compilation)
43
+ return { failures };
44
+ for (const premise of input.compilation.premises) {
45
+ let ast;
46
+ try {
47
+ ast = parseFormula(premise.formula);
48
+ }
49
+ catch (err) {
50
+ failures.push({
51
+ code: FORMULA_VALIDATION_FAILURE_CODES.parseError,
52
+ message: `parseFormula failed on premise "${premise.premiseMiniId}": ${err instanceof Error ? err.message : String(err)}`,
53
+ context: {
54
+ premiseMiniId: premise.premiseMiniId,
55
+ formula: premise.formula,
56
+ },
57
+ });
58
+ continue;
59
+ }
60
+ const atoms = new Set();
61
+ collectAtoms(ast, atoms);
62
+ for (const atom of atoms) {
63
+ if (!knownSymbols.has(atom)) {
64
+ failures.push({
65
+ code: FORMULA_VALIDATION_FAILURE_CODES.symbolUnresolved,
66
+ message: `Premise "${premise.premiseMiniId}" references symbol "${atom}" which is not in variable-assignment.`,
67
+ context: {
68
+ premiseMiniId: premise.premiseMiniId,
69
+ formula: premise.formula,
70
+ unresolvedSymbol: atom,
71
+ },
72
+ });
73
+ }
74
+ }
75
+ }
76
+ return { failures };
77
+ }
78
+ export const formulaValidationStage = deterministicStage({
79
+ id: STAGE_IDS.formulaValidation,
80
+ dependsOn: [STAGE_IDS.formulaCompilation, STAGE_IDS.variableAssignment],
81
+ outputSchema: ValidationStageOutputSchema,
82
+ fn: (ctx) => {
83
+ const compilation = ctx.get(STAGE_IDS.formulaCompilation);
84
+ const variables = ctx.get(STAGE_IDS.variableAssignment) ?? [];
85
+ const { failures } = validateFormulas({ compilation, variables });
86
+ for (const f of failures) {
87
+ ctx.addFailure({
88
+ code: f.code,
89
+ message: f.message,
90
+ severity: "warning",
91
+ context: f.context,
92
+ });
93
+ }
94
+ return failures.map((f) => ({
95
+ code: f.code,
96
+ message: f.message,
97
+ context: f.context,
98
+ }));
99
+ },
100
+ });
101
+ //# sourceMappingURL=formula-validation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formula-validation.js","source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AAC,CAAA;YACN,CAAC;QACL,CAAC;IACL,CAAC;IACD,OAAO,EAAE,QAAQ,EAAE,CAAA;AACvB,CAAC;AAED,MAAM,CAAC,MAAM,sBAAsB,GAC/B,kBAAkB,CAAyB;IACvC,EAAE,EAAE,SAAS,CAAC,iBAAiB;IAC/B,SAAS,EAAE,CAAC,SAAS,CAAC,kBAAkB,EAAE,SAAS,CAAC,kBAAkB,CAAC;IACvE,YAAY,EAAE,2BAA2B;IACzC,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE;QACR,MAAM,WAAW,GAAG,GAAG,CAAC,GAAG,CACvB,SAAS,CAAC,kBAAkB,CAC/B,CAAA;QACD,MAAM,SAAS,GACX,GAAG,CAAC,GAAG,CACH,SAAS,CAAC,kBAAkB,CAC/B,IAAI,EAAE,CAAA;QACX,MAAM,EAAE,QAAQ,EAAE,GAAG,gBAAgB,CAAC,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC,CAAA;QACjE,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;YACvB,GAAG,CAAC,UAAU,CAAC;gBACX,IAAI,EAAE,CAAC,CAAC,IAAI;gBACZ,OAAO,EAAE,CAAC,CAAC,OAAO;gBAClB,QAAQ,EAAE,SAAS;gBACnB,OAAO,EAAE,CAAC,CAAC,OAAO;aACrB,CAAC,CAAA;QACN,CAAC;QACD,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACxB,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,OAAO,EAAE,CAAC,CAAC,OAAO;YAClB,OAAO,EAAE,CAAC,CAAC,OAAO;SACrB,CAAC,CAAC,CAAA;IACP,CAAC;CACJ,CAAC,CAAA"}
@@ -0,0 +1,15 @@
1
+ export { STAGE_IDS } from "./schemas.js";
2
+ export * from "./schemas.js";
3
+ export { segmentationStage } from "./segmentation.js";
4
+ export { claimMentionExtractionStage } from "./claim-mention-extraction.js";
5
+ export { citationSourceDetectionStage } from "./citation-source-detection.js";
6
+ export { axiomIndicatorDetectionStage } from "./axiom-indicator-detection.js";
7
+ export { createClaimCanonicalizationStage } from "./claim-canonicalization.js";
8
+ export { claimTypeClassificationStage } from "./claim-type-classification.js";
9
+ export { claimReferenceValidationStage, validateClaimReferences, CLAIM_REFERENCE_FAILURE_CODES, } from "./claim-reference-validation.js";
10
+ export { variableAssignmentStage, assignVariables, isValidVariableSymbol, } from "./variable-assignment.js";
11
+ export { relationExtractionStage } from "./relation-extraction.js";
12
+ export { conclusionSelectionStage } from "./conclusion-selection.js";
13
+ export { formulaCompilationStage, compileFormulas, FORMULA_COMPILATION_FAILURE_CODES, } from "./formula-compilation.js";
14
+ export { formulaValidationStage, validateFormulas, FORMULA_VALIDATION_FAILURE_CODES, } from "./formula-validation.js";
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/extensions/argument-ingestion/stages/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,cAAc,cAAc,CAAA;AAE5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAA;AAC3E,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAA;AAC7E,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAA;AAC7E,OAAO,EAAE,gCAAgC,EAAE,MAAM,6BAA6B,CAAA;AAC9E,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAA;AAC7E,OAAO,EACH,6BAA6B,EAC7B,uBAAuB,EACvB,6BAA6B,GAChC,MAAM,iCAAiC,CAAA;AACxC,OAAO,EACH,uBAAuB,EACvB,eAAe,EACf,qBAAqB,GACxB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAA;AAClE,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAA;AACpE,OAAO,EACH,uBAAuB,EACvB,eAAe,EACf,iCAAiC,GACpC,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACH,sBAAsB,EACtB,gBAAgB,EAChB,gCAAgC,GACnC,MAAM,yBAAyB,CAAA"}
@@ -0,0 +1,16 @@
1
+ // Barrel for the 12 v2-multi-stage ingestion stages.
2
+ export { STAGE_IDS } from "./schemas.js";
3
+ export * from "./schemas.js";
4
+ export { segmentationStage } from "./segmentation.js";
5
+ export { claimMentionExtractionStage } from "./claim-mention-extraction.js";
6
+ export { citationSourceDetectionStage } from "./citation-source-detection.js";
7
+ export { axiomIndicatorDetectionStage } from "./axiom-indicator-detection.js";
8
+ export { createClaimCanonicalizationStage } from "./claim-canonicalization.js";
9
+ export { claimTypeClassificationStage } from "./claim-type-classification.js";
10
+ export { claimReferenceValidationStage, validateClaimReferences, CLAIM_REFERENCE_FAILURE_CODES, } from "./claim-reference-validation.js";
11
+ export { variableAssignmentStage, assignVariables, isValidVariableSymbol, } from "./variable-assignment.js";
12
+ export { relationExtractionStage } from "./relation-extraction.js";
13
+ export { conclusionSelectionStage } from "./conclusion-selection.js";
14
+ export { formulaCompilationStage, compileFormulas, FORMULA_COMPILATION_FAILURE_CODES, } from "./formula-compilation.js";
15
+ export { formulaValidationStage, validateFormulas, FORMULA_VALIDATION_FAILURE_CODES, } from "./formula-validation.js";
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/extensions/argument-ingestion/stages/index.ts"],"names":[],"mappings":"AAAA,qDAAqD;AAErD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,cAAc,cAAc,CAAA;AAE5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAA;AAC3E,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAA;AAC7E,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAA;AAC7E,OAAO,EAAE,gCAAgC,EAAE,MAAM,6BAA6B,CAAA;AAC9E,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAA;AAC7E,OAAO,EACH,6BAA6B,EAC7B,uBAAuB,EACvB,6BAA6B,GAChC,MAAM,iCAAiC,CAAA;AACxC,OAAO,EACH,uBAAuB,EACvB,eAAe,EACf,qBAAqB,GACxB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAA;AAClE,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAA;AACpE,OAAO,EACH,uBAAuB,EACvB,eAAe,EACf,iCAAiC,GACpC,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACH,sBAAsB,EACtB,gBAAgB,EAChB,gCAAgC,GACnC,MAAM,yBAAyB,CAAA"}
@@ -0,0 +1,7 @@
1
+ import { type TRelationExtractionOutput } from "./schemas.js";
2
+ import type { TStage } from "../../../lib/pipelines/types.js";
3
+ export declare const RELATION_EXTRACTION_MODEL = "gpt-5.5";
4
+ export declare const RELATION_EXTRACTION_REASONING: "minimal" | "low" | "medium" | "high";
5
+ export declare const RELATION_EXTRACTION_SYSTEM_PROMPT = "You identify support relationships between canonical claims in an argument.\n\nGiven the canonical claim set, the per-claim type map, and the original segments, emit one entry per supporting relationship. Return an object with a single key `relations` whose value is the array. There are three relation kinds:\n\n- `\"support\"` \u2014 a single claim S supports another claim T. Use this for ordinary \"P, therefore Q\" support edges where the supporting evidence is a single normal-typed proposition.\n- `\"joint-support\"` \u2014 multiple claims S1, S2, ... jointly support T. Use this when the author commits to a syllogistic step that requires ALL of the sources to hold (e.g. major premise + minor premise \u2192 conclusion).\n- `\"derivation-support\"` \u2014 a citation-typed or axiomatic-typed claim S supports a normal-typed claim T. Use this exclusively for relations whose source is \"citation\" or \"axiomatic\". The shape is otherwise identical to `\"support\"`.\n\nFor each relation emit:\n- a fresh `relationId` (r1, r2, ...)\n- the `type`\n- `sources` \u2014 an array of supporting claim miniIds (length 1 for support and derivation-support; length \u2265 2 for joint-support)\n- `target` \u2014 the supported claim's miniId\n- `evidence.segmentIds` \u2014 the segments that ground the relation (often a single segment containing a \"therefore\", \"so\", \"because\")\n- `evidence.quote` \u2014 a short verbatim quote from the input that justifies the relation\n\n## Conservatism rules\n\n- Do not invent relations. If the author doesn't actually argue from S to T, don't emit a relation between them.\n- Do not double-count. If two claims share an axiomatic backing, that's one derivation-support relation per claim, not a joint-support pair.\n- The conclusion of the argument is identified in a separate stage; do NOT emit a special \"conclusion\" relation here. Just emit the support edges you see; the conclusion stage selects from your output.\n- Avoid attack/rebuttal relations entirely in this MVP \u2014 the pipeline does not yet handle them.\n\nIf there are no relations to emit, return `{ \"relations\": [] }`.";
6
+ export declare const relationExtractionStage: TStage<TRelationExtractionOutput>;
7
+ //# sourceMappingURL=relation-extraction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relation-extraction.d.ts","sourceRoot":"","sources":["../../../../src/extensions/argument-ingestion/stages/relation-extraction.ts"],"names":[],"mappings":"AASA,OAAO,EAMH,KAAK,yBAAyB,EAEjC,MAAM,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,iCAAiC,CAAA;AAE5E,eAAO,MAAM,yBAAyB,YAAY,CAAA;AAClD,eAAO,MAAM,6BAA6B,EACpC,SAAS,GACT,KAAK,GACL,QAAQ,GACR,MAAe,CAAA;AAErB,eAAO,MAAM,iCAAiC,6lEAuBqB,CAAA;AAuCnE,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,yBAAyB,CAYhE,CAAA"}
@@ -0,0 +1,77 @@
1
+ // `relation-extraction` — strong-reasoning stage that identifies the
2
+ // supporting relationships between canonical claims. MVP relation
3
+ // types: support, joint-support, derivation-support.
4
+ //
5
+ // Per spec §6.4 this stage uses gpt-5.5 with reasoning_effort=high —
6
+ // it's the most subtle judgement call in the pipeline. The output is
7
+ // a graph; the conclusion + the support graph drive the
8
+ // formula-compilation stage that comes next.
9
+ import { STAGE_IDS, RelationExtractionOutputSchema, } from "./schemas.js";
10
+ import { llmStage } from "../../../lib/pipelines/stage-helpers.js";
11
+ export const RELATION_EXTRACTION_MODEL = "gpt-5.5";
12
+ export const RELATION_EXTRACTION_REASONING = "high";
13
+ export const RELATION_EXTRACTION_SYSTEM_PROMPT = `You identify support relationships between canonical claims in an argument.
14
+
15
+ Given the canonical claim set, the per-claim type map, and the original segments, emit one entry per supporting relationship. Return an object with a single key \`relations\` whose value is the array. There are three relation kinds:
16
+
17
+ - \`"support"\` — a single claim S supports another claim T. Use this for ordinary "P, therefore Q" support edges where the supporting evidence is a single normal-typed proposition.
18
+ - \`"joint-support"\` — multiple claims S1, S2, ... jointly support T. Use this when the author commits to a syllogistic step that requires ALL of the sources to hold (e.g. major premise + minor premise → conclusion).
19
+ - \`"derivation-support"\` — a citation-typed or axiomatic-typed claim S supports a normal-typed claim T. Use this exclusively for relations whose source is "citation" or "axiomatic". The shape is otherwise identical to \`"support"\`.
20
+
21
+ For each relation emit:
22
+ - a fresh \`relationId\` (r1, r2, ...)
23
+ - the \`type\`
24
+ - \`sources\` — an array of supporting claim miniIds (length 1 for support and derivation-support; length ≥ 2 for joint-support)
25
+ - \`target\` — the supported claim's miniId
26
+ - \`evidence.segmentIds\` — the segments that ground the relation (often a single segment containing a "therefore", "so", "because")
27
+ - \`evidence.quote\` — a short verbatim quote from the input that justifies the relation
28
+
29
+ ## Conservatism rules
30
+
31
+ - Do not invent relations. If the author doesn't actually argue from S to T, don't emit a relation between them.
32
+ - Do not double-count. If two claims share an axiomatic backing, that's one derivation-support relation per claim, not a joint-support pair.
33
+ - The conclusion of the argument is identified in a separate stage; do NOT emit a special "conclusion" relation here. Just emit the support edges you see; the conclusion stage selects from your output.
34
+ - Avoid attack/rebuttal relations entirely in this MVP — the pipeline does not yet handle them.
35
+
36
+ If there are no relations to emit, return \`{ "relations": [] }\`.`;
37
+ function buildPrompt(ctx) {
38
+ const canon = ctx.get(STAGE_IDS.claimCanonicalization);
39
+ const typeEnvelope = ctx.get(STAGE_IDS.claimTypeClassification);
40
+ const typeByMiniId = new Map();
41
+ for (const entry of typeEnvelope?.classifications ?? []) {
42
+ typeByMiniId.set(entry.miniId, entry);
43
+ }
44
+ const segmentEnvelope = ctx.get(STAGE_IDS.segmentation);
45
+ const segments = segmentEnvelope?.segments ?? [];
46
+ const claimLines = (canon?.canonicalClaims ?? [])
47
+ .map((c) => {
48
+ const refinedType = typeByMiniId.get(c.miniId)?.type ?? c.type;
49
+ return ` [${c.miniId}] type=${refinedType} symbol=${c.suggestedSymbol} fields=${JSON.stringify({
50
+ ...c,
51
+ miniId: undefined,
52
+ mentionIds: undefined,
53
+ suggestedSymbol: undefined,
54
+ type: undefined,
55
+ })}`;
56
+ })
57
+ .join("\n");
58
+ const segmentLines = segments
59
+ .map((s) => ` [${s.segmentId}] ${JSON.stringify(s.text)}`)
60
+ .join("\n");
61
+ const markedSystem = `<!-- stage-id: ${STAGE_IDS.relationExtraction} -->\n${RELATION_EXTRACTION_SYSTEM_PROMPT}`;
62
+ const user = `Canonical claims (with refined types):\n${claimLines}\n\nSegments:\n${segmentLines}\n\nEmit every support relationship as a relations array.`;
63
+ return { system: markedSystem, user };
64
+ }
65
+ export const relationExtractionStage = llmStage({
66
+ id: STAGE_IDS.relationExtraction,
67
+ dependsOn: [
68
+ STAGE_IDS.claimCanonicalization,
69
+ STAGE_IDS.claimTypeClassification,
70
+ STAGE_IDS.segmentation,
71
+ ],
72
+ outputSchema: RelationExtractionOutputSchema,
73
+ model: RELATION_EXTRACTION_MODEL,
74
+ reasoningEffort: RELATION_EXTRACTION_REASONING,
75
+ buildPrompt,
76
+ });
77
+ //# sourceMappingURL=relation-extraction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relation-extraction.js","sourceRoot":"","sources":["../../../../src/extensions/argument-ingestion/stages/relation-extraction.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,kEAAkE;AAClE,qDAAqD;AACrD,EAAE;AACF,qEAAqE;AACrE,qEAAqE;AACrE,wDAAwD;AACxD,6CAA6C;AAE7C,OAAO,EACH,SAAS,EACT,8BAA8B,GAMjC,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,yCAAyC,CAAA;AAGlE,MAAM,CAAC,MAAM,yBAAyB,GAAG,SAAS,CAAA;AAClD,MAAM,CAAC,MAAM,6BAA6B,GAI3B,MAAM,CAAA;AAErB,MAAM,CAAC,MAAM,iCAAiC,GAAG;;;;;;;;;;;;;;;;;;;;;;;mEAuBkB,CAAA;AAEnE,SAAS,WAAW,CAAC,GAAkB;IACnC,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CACjB,SAAS,CAAC,qBAAqB,CAClC,CAAA;IACD,MAAM,YAAY,GAAG,GAAG,CAAC,GAAG,CACxB,SAAS,CAAC,uBAAuB,CACpC,CAAA;IACD,MAAM,YAAY,GAAG,IAAI,GAAG,EAAyC,CAAA;IACrE,KAAK,MAAM,KAAK,IAAI,YAAY,EAAE,eAAe,IAAI,EAAE,EAAE,CAAC;QACtD,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;IACzC,CAAC;IACD,MAAM,eAAe,GAAG,GAAG,CAAC,GAAG,CAAsB,SAAS,CAAC,YAAY,CAAC,CAAA;IAC5E,MAAM,QAAQ,GAAG,eAAe,EAAE,QAAQ,IAAI,EAAE,CAAA;IAEhD,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,eAAe,IAAI,EAAE,CAAC;SAC5C,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QACP,MAAM,WAAW,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,IAAI,CAAC,CAAC,IAAI,CAAA;QAC9D,OAAO,MAAM,CAAC,CAAC,MAAM,UAAU,WAAW,WAAW,CAAC,CAAC,eAAe,WAAW,IAAI,CAAC,SAAS,CAC3F;YACI,GAAG,CAAC;YACJ,MAAM,EAAE,SAAS;YACjB,UAAU,EAAE,SAAS;YACrB,eAAe,EAAE,SAAS;YAC1B,IAAI,EAAE,SAAS;SAClB,CACJ,EAAE,CAAA;IACP,CAAC,CAAC;SACD,IAAI,CAAC,IAAI,CAAC,CAAA;IACf,MAAM,YAAY,GAAG,QAAQ;SACxB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,SAAS,KAAK,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;SAC1D,IAAI,CAAC,IAAI,CAAC,CAAA;IAEf,MAAM,YAAY,GAAG,kBAAkB,SAAS,CAAC,kBAAkB,SAAS,iCAAiC,EAAE,CAAA;IAC/G,MAAM,IAAI,GAAG,2CAA2C,UAAU,kBAAkB,YAAY,2DAA2D,CAAA;IAC3J,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,CAAA;AACzC,CAAC;AAED,MAAM,CAAC,MAAM,uBAAuB,GAChC,QAAQ,CAA4B;IAChC,EAAE,EAAE,SAAS,CAAC,kBAAkB;IAChC,SAAS,EAAE;QACP,SAAS,CAAC,qBAAqB;QAC/B,SAAS,CAAC,uBAAuB;QACjC,SAAS,CAAC,YAAY;KACzB;IACD,YAAY,EAAE,8BAA8B;IAC5C,KAAK,EAAE,yBAAyB;IAChC,eAAe,EAAE,6BAA6B;IAC9C,WAAW;CACd,CAAC,CAAA"}
@@ -0,0 +1,161 @@
1
+ import Type, { type Static } from "typebox";
2
+ export declare const SpanSchema: Type.TObject<{
3
+ start: Type.TNumber;
4
+ end: Type.TNumber;
5
+ }>;
6
+ export type TSpan = Static<typeof SpanSchema>;
7
+ export declare const SegmentationOutputSchema: Type.TObject<{
8
+ segments: Type.TArray<Type.TObject<{
9
+ segmentId: Type.TString;
10
+ text: Type.TString;
11
+ span: Type.TObject<{
12
+ start: Type.TNumber;
13
+ end: Type.TNumber;
14
+ }>;
15
+ }>>;
16
+ }>;
17
+ export type TSegmentationOutput = Static<typeof SegmentationOutputSchema>;
18
+ export type TSegment = TSegmentationOutput["segments"][number];
19
+ export declare const ClaimMentionExtractionOutputSchema: Type.TObject<{
20
+ mentions: Type.TArray<Type.TObject<{
21
+ mentionId: Type.TString;
22
+ segmentId: Type.TString;
23
+ text: Type.TString;
24
+ span: Type.TObject<{
25
+ start: Type.TNumber;
26
+ end: Type.TNumber;
27
+ }>;
28
+ }>>;
29
+ }>;
30
+ export type TClaimMentionExtractionOutput = Static<typeof ClaimMentionExtractionOutputSchema>;
31
+ export type TClaimMention = TClaimMentionExtractionOutput["mentions"][number];
32
+ export declare const CitationSourceDetectionOutputSchema: Type.TObject<{
33
+ sources: Type.TArray<Type.TObject<{
34
+ sourceId: Type.TString;
35
+ segmentIds: Type.TArray<Type.TString>;
36
+ sourceString: Type.TString;
37
+ url: Type.TUnion<[Type.TString, Type.TNull]>;
38
+ spans: Type.TArray<Type.TObject<{
39
+ start: Type.TNumber;
40
+ end: Type.TNumber;
41
+ }>>;
42
+ }>>;
43
+ }>;
44
+ export type TCitationSourceDetectionOutput = Static<typeof CitationSourceDetectionOutputSchema>;
45
+ export type TCitationSource = TCitationSourceDetectionOutput["sources"][number];
46
+ export declare const AxiomIndicatorDetectionOutputSchema: Type.TObject<{
47
+ axioms: Type.TArray<Type.TObject<{
48
+ axiomId: Type.TString;
49
+ segmentIds: Type.TArray<Type.TString>;
50
+ indicator: Type.TString;
51
+ spans: Type.TArray<Type.TObject<{
52
+ start: Type.TNumber;
53
+ end: Type.TNumber;
54
+ }>>;
55
+ }>>;
56
+ }>;
57
+ export type TAxiomIndicatorDetectionOutput = Static<typeof AxiomIndicatorDetectionOutputSchema>;
58
+ export type TAxiomIndicator = TAxiomIndicatorDetectionOutput["axioms"][number];
59
+ export declare const BaseCanonicalClaimSchema: Type.TObject<{
60
+ miniId: Type.TString;
61
+ mentionIds: Type.TArray<Type.TString>;
62
+ suggestedSymbol: Type.TString;
63
+ type: Type.TUnion<[Type.TLiteral<"normal">, Type.TLiteral<"citation">, Type.TLiteral<"axiomatic">]>;
64
+ }>;
65
+ export type TBaseCanonicalClaim = Static<typeof BaseCanonicalClaimSchema>;
66
+ export declare const MentionToClaimEntrySchema: Type.TObject<{
67
+ mentionId: Type.TString;
68
+ claimMiniId: Type.TString;
69
+ }>;
70
+ export type TMentionToClaimEntry = Static<typeof MentionToClaimEntrySchema>;
71
+ export declare const ClaimCanonicalizationOutputSchema: Type.TObject<{
72
+ canonicalClaims: Type.TArray<Type.TObject<{
73
+ miniId: Type.TString;
74
+ mentionIds: Type.TArray<Type.TString>;
75
+ suggestedSymbol: Type.TString;
76
+ type: Type.TUnion<[Type.TLiteral<"normal">, Type.TLiteral<"citation">, Type.TLiteral<"axiomatic">]>;
77
+ }>>;
78
+ mentionToClaim: Type.TArray<Type.TObject<{
79
+ mentionId: Type.TString;
80
+ claimMiniId: Type.TString;
81
+ }>>;
82
+ }>;
83
+ export type TClaimCanonicalizationOutput = Static<typeof ClaimCanonicalizationOutputSchema>;
84
+ /** Per-claim record including the extension-injected fields. */
85
+ export type TCanonicalClaim = TBaseCanonicalClaim & Record<string, unknown>;
86
+ export declare const ClaimTypeClassificationEntrySchema: Type.TObject<{
87
+ miniId: Type.TString;
88
+ type: Type.TUnion<[Type.TLiteral<"normal">, Type.TLiteral<"citation">, Type.TLiteral<"axiomatic">]>;
89
+ sourceString: Type.TUnion<[Type.TString, Type.TNull]>;
90
+ }>;
91
+ export type TClaimTypeClassificationEntry = Static<typeof ClaimTypeClassificationEntrySchema>;
92
+ export declare const ClaimTypeClassificationOutputSchema: Type.TObject<{
93
+ classifications: Type.TArray<Type.TObject<{
94
+ miniId: Type.TString;
95
+ type: Type.TUnion<[Type.TLiteral<"normal">, Type.TLiteral<"citation">, Type.TLiteral<"axiomatic">]>;
96
+ sourceString: Type.TUnion<[Type.TString, Type.TNull]>;
97
+ }>>;
98
+ }>;
99
+ export type TClaimTypeClassificationOutput = Static<typeof ClaimTypeClassificationOutputSchema>;
100
+ export declare const VariableAssignmentOutputSchema: Type.TArray<Type.TObject<{
101
+ miniId: Type.TString;
102
+ symbol: Type.TString;
103
+ claimMiniId: Type.TString;
104
+ }>>;
105
+ export type TVariableAssignmentOutput = Static<typeof VariableAssignmentOutputSchema>;
106
+ export type TAssignedVariable = TVariableAssignmentOutput[number];
107
+ export declare const RelationKindSchema: Type.TUnion<[Type.TLiteral<"support">, Type.TLiteral<"joint-support">, Type.TLiteral<"derivation-support">]>;
108
+ export type TRelationKind = Static<typeof RelationKindSchema>;
109
+ export declare const RelationExtractionOutputSchema: Type.TObject<{
110
+ relations: Type.TArray<Type.TObject<{
111
+ relationId: Type.TString;
112
+ type: Type.TUnion<[Type.TLiteral<"support">, Type.TLiteral<"joint-support">, Type.TLiteral<"derivation-support">]>;
113
+ sources: Type.TArray<Type.TString>;
114
+ target: Type.TString;
115
+ evidence: Type.TObject<{
116
+ segmentIds: Type.TArray<Type.TString>;
117
+ quote: Type.TString;
118
+ }>;
119
+ }>>;
120
+ }>;
121
+ export type TRelationExtractionOutput = Static<typeof RelationExtractionOutputSchema>;
122
+ export type TRelation = TRelationExtractionOutput["relations"][number];
123
+ export declare const ConclusionSelectionOutputSchema: Type.TObject<{
124
+ conclusionMiniId: Type.TUnion<[Type.TString, Type.TNull]>;
125
+ rationale: Type.TString;
126
+ }>;
127
+ export type TConclusionSelectionOutput = Static<typeof ConclusionSelectionOutputSchema>;
128
+ export declare const FormulaPremiseRoleHintSchema: Type.TUnion<[Type.TLiteral<"support">, Type.TLiteral<"joint-support">, Type.TLiteral<"derivation">, Type.TLiteral<"conclusion">]>;
129
+ export type TFormulaPremiseRoleHint = Static<typeof FormulaPremiseRoleHintSchema>;
130
+ export declare const FormulaCompilationOutputSchema: Type.TObject<{
131
+ premises: Type.TArray<Type.TObject<{
132
+ premiseMiniId: Type.TString;
133
+ formula: Type.TString;
134
+ roleHint: Type.TUnion<[Type.TLiteral<"support">, Type.TLiteral<"joint-support">, Type.TLiteral<"derivation">, Type.TLiteral<"conclusion">]>;
135
+ sourceRelationId: Type.TUnion<[Type.TString, Type.TNull]>;
136
+ }>>;
137
+ conclusionPremiseMiniId: Type.TUnion<[Type.TString, Type.TNull]>;
138
+ }>;
139
+ export type TFormulaCompilationOutput = Static<typeof FormulaCompilationOutputSchema>;
140
+ export type TCompiledPremise = TFormulaCompilationOutput["premises"][number];
141
+ export declare const ValidationStageOutputSchema: Type.TArray<Type.TObject<{
142
+ code: Type.TString;
143
+ message: Type.TString;
144
+ context: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
145
+ }>>;
146
+ export type TValidationStageOutput = Static<typeof ValidationStageOutputSchema>;
147
+ export declare const STAGE_IDS: {
148
+ readonly segmentation: "segmentation";
149
+ readonly claimMentionExtraction: "claim-mention-extraction";
150
+ readonly citationSourceDetection: "citation-source-detection";
151
+ readonly axiomIndicatorDetection: "axiom-indicator-detection";
152
+ readonly claimCanonicalization: "claim-canonicalization";
153
+ readonly claimTypeClassification: "claim-type-classification";
154
+ readonly claimReferenceValidation: "claim-reference-validation";
155
+ readonly variableAssignment: "variable-assignment";
156
+ readonly relationExtraction: "relation-extraction";
157
+ readonly conclusionSelection: "conclusion-selection";
158
+ readonly formulaCompilation: "formula-compilation";
159
+ readonly formulaValidation: "formula-validation";
160
+ };
161
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/extensions/argument-ingestion/stages/schemas.ts"],"names":[],"mappings":"AAOA,OAAO,IAAI,EAAE,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAA;AAiB3C,eAAO,MAAM,UAAU;;;EASrB,CAAA;AACF,MAAM,MAAM,KAAK,GAAG,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