@proposit/proposit-core 1.0.1 → 1.1.1

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 (114) hide show
  1. package/README.md +0 -1
  2. package/dist/cli/commands/parse.d.ts.map +1 -1
  3. package/dist/cli/commands/parse.js +62 -27
  4. package/dist/cli/commands/parse.js.map +1 -1
  5. package/dist/cli/llm/index.d.ts +5 -4
  6. package/dist/cli/llm/index.d.ts.map +1 -1
  7. package/dist/cli/llm/index.js +15 -3
  8. package/dist/cli/llm/index.js.map +1 -1
  9. package/dist/extensions/argument-ingestion/index.d.ts +9 -0
  10. package/dist/extensions/argument-ingestion/index.d.ts.map +1 -0
  11. package/dist/extensions/argument-ingestion/index.js +11 -0
  12. package/dist/extensions/argument-ingestion/index.js.map +1 -0
  13. package/dist/extensions/argument-ingestion/shared/basics-extension.d.ts +9 -0
  14. package/dist/extensions/argument-ingestion/shared/basics-extension.d.ts.map +1 -0
  15. package/dist/extensions/argument-ingestion/shared/basics-extension.js +25 -0
  16. package/dist/extensions/argument-ingestion/shared/basics-extension.js.map +1 -0
  17. package/dist/extensions/argument-ingestion/shared/finalize-response.d.ts +21 -0
  18. package/dist/extensions/argument-ingestion/shared/finalize-response.d.ts.map +1 -0
  19. package/dist/extensions/argument-ingestion/shared/finalize-response.js +33 -0
  20. package/dist/extensions/argument-ingestion/shared/finalize-response.js.map +1 -0
  21. package/dist/extensions/argument-ingestion/shared/role-derivation.d.ts +11 -0
  22. package/dist/extensions/argument-ingestion/shared/role-derivation.d.ts.map +1 -0
  23. package/dist/extensions/argument-ingestion/shared/role-derivation.js +26 -0
  24. package/dist/extensions/argument-ingestion/shared/role-derivation.js.map +1 -0
  25. package/dist/extensions/argument-ingestion/shared/types.d.ts +34 -0
  26. package/dist/extensions/argument-ingestion/shared/types.d.ts.map +1 -0
  27. package/dist/extensions/argument-ingestion/shared/types.js +16 -0
  28. package/dist/extensions/argument-ingestion/shared/types.js.map +1 -0
  29. package/dist/extensions/argument-ingestion/v1-single-shot.d.ts +18 -0
  30. package/dist/extensions/argument-ingestion/v1-single-shot.d.ts.map +1 -0
  31. package/dist/extensions/argument-ingestion/v1-single-shot.js +105 -0
  32. package/dist/extensions/argument-ingestion/v1-single-shot.js.map +1 -0
  33. package/dist/extensions/basics/schemata.d.ts +39 -0
  34. package/dist/extensions/basics/schemata.d.ts.map +1 -1
  35. package/dist/extensions/basics/schemata.js +21 -7
  36. package/dist/extensions/basics/schemata.js.map +1 -1
  37. package/dist/extensions/openai/errors.d.ts +49 -0
  38. package/dist/extensions/openai/errors.d.ts.map +1 -0
  39. package/dist/extensions/openai/errors.js +85 -0
  40. package/dist/extensions/openai/errors.js.map +1 -0
  41. package/dist/extensions/openai/index.d.ts +7 -0
  42. package/dist/extensions/openai/index.d.ts.map +1 -0
  43. package/dist/extensions/openai/index.js +10 -0
  44. package/dist/extensions/openai/index.js.map +1 -0
  45. package/dist/extensions/openai/provider.d.ts +22 -0
  46. package/dist/extensions/openai/provider.d.ts.map +1 -0
  47. package/dist/extensions/openai/provider.js +385 -0
  48. package/dist/extensions/openai/provider.js.map +1 -0
  49. package/dist/extensions/openai/structured-output.d.ts +18 -0
  50. package/dist/extensions/openai/structured-output.d.ts.map +1 -0
  51. package/dist/extensions/openai/structured-output.js +201 -0
  52. package/dist/extensions/openai/structured-output.js.map +1 -0
  53. package/dist/extensions/openai/types.d.ts +81 -0
  54. package/dist/extensions/openai/types.d.ts.map +1 -0
  55. package/dist/extensions/openai/types.js +21 -0
  56. package/dist/extensions/openai/types.js.map +1 -0
  57. package/dist/lib/core/argument-engine.d.ts.map +1 -1
  58. package/dist/lib/core/argument-engine.js +56 -1
  59. package/dist/lib/core/argument-engine.js.map +1 -1
  60. package/dist/lib/core/expression-manager.d.ts.map +1 -1
  61. package/dist/lib/core/expression-manager.js +16 -30
  62. package/dist/lib/core/expression-manager.js.map +1 -1
  63. package/dist/lib/core/interfaces/argument-engine.interfaces.d.ts +30 -2
  64. package/dist/lib/core/interfaces/argument-engine.interfaces.d.ts.map +1 -1
  65. package/dist/lib/core/premise-engine.d.ts.map +1 -1
  66. package/dist/lib/core/premise-engine.js +7 -13
  67. package/dist/lib/core/premise-engine.js.map +1 -1
  68. package/dist/lib/grammar/repair.js +17 -0
  69. package/dist/lib/grammar/repair.js.map +1 -1
  70. package/dist/lib/grammar/validators/evaluable.d.ts +10 -0
  71. package/dist/lib/grammar/validators/evaluable.d.ts.map +1 -1
  72. package/dist/lib/grammar/validators/evaluable.js +10 -0
  73. package/dist/lib/grammar/validators/evaluable.js.map +1 -1
  74. package/dist/lib/grammar/validators/structural.d.ts +12 -6
  75. package/dist/lib/grammar/validators/structural.d.ts.map +1 -1
  76. package/dist/lib/grammar/validators/structural.js +13 -19
  77. package/dist/lib/grammar/validators/structural.js.map +1 -1
  78. package/dist/lib/index.d.ts +8 -0
  79. package/dist/lib/index.d.ts.map +1 -1
  80. package/dist/lib/index.js +15 -0
  81. package/dist/lib/index.js.map +1 -1
  82. package/dist/lib/llm/index.d.ts +2 -0
  83. package/dist/lib/llm/index.d.ts.map +1 -0
  84. package/dist/lib/llm/index.js +3 -0
  85. package/dist/lib/llm/index.js.map +1 -0
  86. package/dist/lib/llm/types.d.ts +49 -0
  87. package/dist/lib/llm/types.d.ts.map +1 -0
  88. package/dist/lib/llm/types.js +15 -0
  89. package/dist/lib/llm/types.js.map +1 -0
  90. package/dist/lib/pipelines/execute.d.ts +23 -0
  91. package/dist/lib/pipelines/execute.d.ts.map +1 -0
  92. package/dist/lib/pipelines/execute.js +541 -0
  93. package/dist/lib/pipelines/execute.js.map +1 -0
  94. package/dist/lib/pipelines/index.d.ts +7 -0
  95. package/dist/lib/pipelines/index.d.ts.map +1 -0
  96. package/dist/lib/pipelines/index.js +5 -0
  97. package/dist/lib/pipelines/index.js.map +1 -0
  98. package/dist/lib/pipelines/stage-helpers.d.ts +94 -0
  99. package/dist/lib/pipelines/stage-helpers.d.ts.map +1 -0
  100. package/dist/lib/pipelines/stage-helpers.js +354 -0
  101. package/dist/lib/pipelines/stage-helpers.js.map +1 -0
  102. package/dist/lib/pipelines/types.d.ts +88 -0
  103. package/dist/lib/pipelines/types.d.ts.map +1 -0
  104. package/dist/lib/pipelines/types.js +36 -0
  105. package/dist/lib/pipelines/types.js.map +1 -0
  106. package/package.json +14 -1
  107. package/dist/cli/llm/openai.d.ts +0 -4
  108. package/dist/cli/llm/openai.d.ts.map +0 -1
  109. package/dist/cli/llm/openai.js +0 -44
  110. package/dist/cli/llm/openai.js.map +0 -1
  111. package/dist/cli/llm/types.d.ts +0 -14
  112. package/dist/cli/llm/types.d.ts.map +0 -1
  113. package/dist/cli/llm/types.js +0 -2
  114. package/dist/cli/llm/types.js.map +0 -1
@@ -0,0 +1,105 @@
1
+ // v1 single-shot ingestion pipeline.
2
+ //
3
+ // One `llmStage` (`parse-argument`) calls the configured LLM with the
4
+ // `buildParsingPrompt(extension.responseSchema)` system prompt + the
5
+ // raw input text as the user message; `outputSchema` is the extended
6
+ // `TParsedArgumentResponse` schema. The pipeline's `finalize` stage
7
+ // is required-dependent on `parse-argument` and merges the LLM
8
+ // response with an empty `processingFailures` slot via
9
+ // `finalizeResponse`.
10
+ //
11
+ // **Parity with the pre-1C CLI path.** Behaviorally equivalent to the
12
+ // pre-1C CLI path on schema-conformant LLM outputs (recorded-corpus
13
+ // parity). The new framework adds a single schema-validation retry
14
+ // per stage (default `RetryPolicy` from slice 1A — `maxAttempts: 2`,
15
+ // `retryOn: ["schema_validation", "transient"]`); the pre-1C
16
+ // direct-call path failed hard on the first schema-invalid response.
17
+ // This is a usability improvement, not a regression. The golden
18
+ // corpus exercises only the happy path, so the parity guarantee
19
+ // holds for any LLM response shape the corpus pins; off-corpus
20
+ // schema-invalid responses now retry once before the stage fails.
21
+ //
22
+ // v2 (Phase 2 / slice 2A) replaces the single stage with a graph of
23
+ // decomposed stages; the same `finalizeResponse` helper drives the
24
+ // merge, hence its placement under `shared/`.
25
+ import Type from "typebox";
26
+ import { llmStage } from "../../lib/pipelines/index.js";
27
+ import { buildParsingPrompt } from "../../lib/parsing/index.js";
28
+ import { finalizeResponse } from "./shared/finalize-response.js";
29
+ const PIPELINE_ID = "argument-ingestion-v1";
30
+ const PIPELINE_VERSION = "1.0.0";
31
+ const PARSE_STAGE_ID = "parse-argument";
32
+ const DEFAULT_PARSE_MODEL = "gpt-5.4";
33
+ const INGESTION_INPUT_SCHEMA = Type.Object({
34
+ text: Type.String({ minLength: 1 }),
35
+ });
36
+ /**
37
+ * Build the v1 ingestion pipeline for the supplied extension.
38
+ *
39
+ * The returned `TPipeline` accepts a `{ text }` input, calls one
40
+ * `llmStage` against `extension.responseSchema`, and finalizes into
41
+ * the parser-consumable `TParsedArgumentResponse` shape.
42
+ */
43
+ export function createIngestionV1Pipeline(extension, options) {
44
+ const model = options?.model ?? DEFAULT_PARSE_MODEL;
45
+ const systemPrompt = buildParsingPrompt(extension.responseSchema, {
46
+ customInstructions: options?.customInstructions,
47
+ });
48
+ // Embed a stage-id marker so the test mock (and any future
49
+ // RecordingLlmProvider) can key replays by stage. The OpenAI
50
+ // provider treats this as an inert HTML comment in the system
51
+ // message.
52
+ const markedSystemPrompt = `<!-- stage-id: ${PARSE_STAGE_ID} -->\n${systemPrompt}`;
53
+ const parseStage = llmStage({
54
+ id: PARSE_STAGE_ID,
55
+ dependsOn: [],
56
+ outputSchema: extension.responseSchema,
57
+ model,
58
+ buildPrompt: (ctx) => {
59
+ const input = ctx.input;
60
+ return {
61
+ system: markedSystemPrompt,
62
+ user: input.text,
63
+ };
64
+ },
65
+ });
66
+ return {
67
+ id: PIPELINE_ID,
68
+ version: PIPELINE_VERSION,
69
+ inputSchema: INGESTION_INPUT_SCHEMA,
70
+ // The pipeline's declared `outputSchema` is the extension's
71
+ // raw `responseSchema` — i.e., the LLM's structured output
72
+ // shape. The actual runtime output (post-finalize) is
73
+ // augmented with a `processingFailures: TProcessingFailure[]`
74
+ // slot by `finalizeResponse`, so the runtime payload declares
75
+ // one more field than this schema. The asymmetry is
76
+ // intentional for V1: `outputSchema` advertises the *core*
77
+ // output that downstream parsers (e.g. `ArgumentParser`)
78
+ // consume, while `processingFailures` is a side-channel for
79
+ // observability that consumers read separately. A future
80
+ // slice (1G / 2C server wiring) may stitch the failure slot
81
+ // into the schema via `Type.Intersect`; for now a docstring
82
+ // is the contract.
83
+ outputSchema: extension.responseSchema,
84
+ stages: [parseStage],
85
+ finalize: {
86
+ dependsOn: [PARSE_STAGE_ID],
87
+ run: (ctx) => {
88
+ const parsed = ctx.get(PARSE_STAGE_ID);
89
+ if (!parsed) {
90
+ // Defensive: finalize.dependsOn is required, so
91
+ // the executor only invokes us when the upstream
92
+ // stage completed. If we still got here without
93
+ // an output, the framework is misbehaving — throw
94
+ // rather than emit a half-built response.
95
+ throw new Error(`Pipeline "${PIPELINE_ID}" finalize invoked without a "${PARSE_STAGE_ID}" output.`);
96
+ }
97
+ return finalizeResponse({
98
+ parsedResponse: parsed,
99
+ failures: [],
100
+ });
101
+ },
102
+ },
103
+ };
104
+ }
105
+ //# sourceMappingURL=v1-single-shot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v1-single-shot.js","sourceRoot":"","sources":["../../../src/extensions/argument-ingestion/v1-single-shot.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,EAAE;AACF,sEAAsE;AACtE,qEAAqE;AACrE,qEAAqE;AACrE,oEAAoE;AACpE,+DAA+D;AAC/D,uDAAuD;AACvD,sBAAsB;AACtB,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,mEAAmE;AACnE,qEAAqE;AACrE,6DAA6D;AAC7D,qEAAqE;AACrE,gEAAgE;AAChE,gEAAgE;AAChE,+DAA+D;AAC/D,kEAAkE;AAClE,EAAE;AACF,oEAAoE;AACpE,mEAAmE;AACnE,8CAA8C;AAE9C,OAAO,IAAI,MAAM,SAAS,CAAA;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AAEv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QAC5D,2DAA2D;QAC3D,sDAAsD;QACtD,8DAA8D;QAC9D,8DAA8D;QAC9D,oDAAoD;QACpD,2DAA2D;QAC3D,yDAAyD;QACzD,4DAA4D;QAC5D,yDAAyD;QACzD,4DAA4D;QAC5D,4DAA4D;QAC5D,mBAAmB;QACnB,YAAY,EAAE,SAAS,CAAC,cAAc;QACtC,MAAM,EAAE,CAAC,UAAU,CAAC;QACpB,QAAQ,EAAE;YACN,SAAS,EAAE,CAAC,cAAc,CAAC;YAC3B,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE;gBACT,MAAM,MAAM,GAAG,GAAG,CAAC,GAAG,CAA0B,cAAc,CAAC,CAAA;gBAC/D,IAAI,CAAC,MAAM,EAAE,CAAC;oBACV,gDAAgD;oBAChD,iDAAiD;oBACjD,gDAAgD;oBAChD,kDAAkD;oBAClD,0CAA0C;oBAC1C,MAAM,IAAI,KAAK,CACX,aAAa,WAAW,iCAAiC,cAAc,WAAW,CACrF,CAAA;gBACL,CAAC;gBACD,OAAO,gBAAgB,CAAC;oBACpB,cAAc,EAAE,MAAM;oBACtB,QAAQ,EAAE,EAAE;iBACf,CAAC,CAAA;YACN,CAAC;SACJ;KACJ,CAAA;AACL,CAAC"}
@@ -1,4 +1,43 @@
1
1
  import Type, { type Static } from "typebox";
2
+ export declare const BasicsNormalClaimExtension: Type.TObject<{
3
+ title: Type.TString;
4
+ body: Type.TString;
5
+ type: Type.TLiteral<"normal">;
6
+ }>;
7
+ export declare const BasicsCitationClaimExtension: Type.TObject<{
8
+ title: Type.TString;
9
+ url: Type.TString;
10
+ type: Type.TLiteral<"citation">;
11
+ }>;
12
+ export declare const BasicsAxiomaticClaimExtension: Type.TObject<{
13
+ axiom: Type.TString;
14
+ type: Type.TLiteral<"axiomatic">;
15
+ }>;
16
+ export declare const BasicsClaimExtension: Type.TUnion<[Type.TObject<{
17
+ title: Type.TString;
18
+ body: Type.TString;
19
+ type: Type.TLiteral<"normal">;
20
+ }>, Type.TObject<{
21
+ title: Type.TString;
22
+ url: Type.TString;
23
+ type: Type.TLiteral<"citation">;
24
+ }>, Type.TObject<{
25
+ axiom: Type.TString;
26
+ type: Type.TLiteral<"axiomatic">;
27
+ }>]>;
28
+ /**
29
+ * Variable extension under the basics schema is empty — the core
30
+ * `ParsedVariableSchema` already carries everything the basics
31
+ * pipeline needs. Exported so the ingestion extension descriptor
32
+ * can compose against a single source of truth.
33
+ */
34
+ export declare const BasicsVariableExtension: Type.TObject<{}>;
35
+ export declare const BasicsPremiseExtension: Type.TObject<{
36
+ title: Type.TString;
37
+ }>;
38
+ export declare const BasicsArgumentExtension: Type.TObject<{
39
+ title: Type.TString;
40
+ }>;
2
41
  export declare const BasicsArgumentSchema: Type.TIntersect<[Type.TObject<{
3
42
  id: Type.TString;
4
43
  version: Type.TNumber;
@@ -1 +1 @@
1
- {"version":3,"file":"schemata.d.ts","sourceRoot":"","sources":["../../../src/extensions/basics/schemata.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAA;AAuE3C,eAAO,MAAM,oBAAoB;;;;;;;;IAG/B,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEjE,eAAO,MAAM,uBAAuB;;;;;;;;;;IAGlC,CAAA;AACF,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAEvE,eAAO,MAAM,yBAAyB;;;;;;;;;;IAGpC,CAAA;AACF,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAE3E,eAAO,MAAM,0BAA0B;;;;;;;;;IAGrC,CAAA;AACF,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAE7E,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAI5B,CAAA;AACF,MAAM,M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;;;;MAI5B,CAAA;AACF,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAE3D,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;IAG9B,CAAA;AACF,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAE/D,eAAO,MAAM,mBAAmB,cAI9B,CAAA"}
@@ -3,8 +3,15 @@ import { CoreArgumentSchema } from "../../lib/schemata/argument.js";
3
3
  import { CoreClaimAxiomaticTypeSchema, CoreClaimCitationTypeSchema, CoreClaimNormalTypeSchema, CoreClaimSchema, } from "../../lib/schemata/claim.js";
4
4
  import { CorePremiseSchema } from "../../lib/schemata/propositional.js";
5
5
  import { buildParsingResponseSchema } from "../../lib/parsing/schemata.js";
6
- // Parsing response extensions
7
- const BasicsNormalClaimExtension = Type.Object({
6
+ // Parsing response extensions.
7
+ //
8
+ // These per-entity extension shapes are exported so downstream
9
+ // consumers (e.g. `src/extensions/argument-ingestion/shared/
10
+ // basics-extension.ts`) can compose against the same definitions
11
+ // without duplication. The composite `BasicsParsingSchema` at the
12
+ // bottom of the file is the canonical response schema; the per-entity
13
+ // `Basics*Extension` consts are the building blocks.
14
+ export const BasicsNormalClaimExtension = Type.Object({
8
15
  title: Type.String({
9
16
  maxLength: 50,
10
17
  description: "A short title summarizing the claim",
@@ -15,7 +22,7 @@ const BasicsNormalClaimExtension = Type.Object({
15
22
  }),
16
23
  type: CoreClaimNormalTypeSchema,
17
24
  });
18
- const BasicsCitationClaimExtension = Type.Object({
25
+ export const BasicsCitationClaimExtension = Type.Object({
19
26
  title: Type.String({
20
27
  maxLength: 50,
21
28
  description: "A short title summarizing the claim",
@@ -26,27 +33,34 @@ const BasicsCitationClaimExtension = Type.Object({
26
33
  }),
27
34
  type: CoreClaimCitationTypeSchema,
28
35
  });
29
- const BasicsAxiomaticClaimExtension = Type.Object({
36
+ export const BasicsAxiomaticClaimExtension = Type.Object({
30
37
  axiom: Type.String({
31
38
  maxLength: 50,
32
39
  description: "The axiom supporting the claim",
33
40
  }),
34
41
  type: CoreClaimAxiomaticTypeSchema,
35
42
  });
36
- const BasicsClaimExtension = Type.Union([
43
+ export const BasicsClaimExtension = Type.Union([
37
44
  BasicsNormalClaimExtension,
38
45
  BasicsCitationClaimExtension,
39
46
  BasicsAxiomaticClaimExtension,
40
47
  ], {
41
48
  description: "Field extensions for all claim types. Each claim must conform to exactly one of the three extensions below, depending on its type.",
42
49
  });
43
- const BasicsPremiseExtension = Type.Object({
50
+ /**
51
+ * Variable extension under the basics schema is empty — the core
52
+ * `ParsedVariableSchema` already carries everything the basics
53
+ * pipeline needs. Exported so the ingestion extension descriptor
54
+ * can compose against a single source of truth.
55
+ */
56
+ export const BasicsVariableExtension = Type.Object({});
57
+ export const BasicsPremiseExtension = Type.Object({
44
58
  title: Type.String({
45
59
  maxLength: 50,
46
60
  description: "A short title for this premise",
47
61
  }),
48
62
  });
49
- const BasicsArgumentExtension = Type.Object({
63
+ export const BasicsArgumentExtension = Type.Object({
50
64
  title: Type.String({
51
65
  maxLength: 50,
52
66
  description: "A short title for the argument",
@@ -1 +1 @@
1
- {"version":3,"file":"schemata.js","sourceRoot":"","sources":["../../../src/extensions/basics/schemata.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAe,MAAM,SAAS,CAAA;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AACnE,OAAO,EACH,4BAA4B,EAC5B,2BAA2B,EAC3B,yBAAyB,EACzB,eAAe,GAClB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAA;AACvE,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAA;AAE1E,8BAA8B;AAC9B,MAAM,0BAA0B,GAAG,IAAI,CAAC,MAAM,CAAC;IAC3C,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC;QACf,SAAS,EAAE,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AC;QACf,SAAS,EAAE,EAAE;QACb,WAAW,EAAE,gCAAgC;KAChD,CAAC;CACL,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC,MAAM,CAAC;IAC/C,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC;QACf,SAAS,EAAE,EAAE;QACb,WAAW,EAAE,gCAAgC;KAChD,CAAC;CACL,CAAC,CAAA;AAEF,yBAAyB;AACzB,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC,SAAS,CAAC;IAC/C,kBAAkB;IAClB,uBAAuB;CAC1B,CAAC,CAAA;AAGF,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC,SAAS,CAAC;IAClD,eAAe;IACf,0BAA0B;CAC7B,CAAC,CAAA;AAGF,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,CAAC,SAAS,CAAC;IACpD,eAAe;IACf,4BAA4B;CAC/B,CAAC,CAAA;AAGF,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,CAAC,SAAS,CAAC;IACrD,eAAe;IACf,6BAA6B;CAChC,CAAC,CAAA;AAGF,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC;IACxC,uBAAuB;IACvB,yBAAyB;IACzB,0BAA0B;CAC7B,CAAC,CAAA;AAGF,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC,SAAS,CAAC;IAC9C,iBAAiB;IACjB,sBAAsB;CACzB,CAAC,CAAA;AAGF,MAAM,CAAC,MAAM,mBAAmB,GAAG,0BAA0B,CAAC;IAC1D,WAAW,EAAE,oBAAoB;IACjC,aAAa,EAAE,sBAAsB;IACrC,oBAAoB,EAAE,uBAAuB;CAChD,CAAC,CAAA"}
@@ -0,0 +1,49 @@
1
+ export declare class TransientLlmError extends Error {
2
+ readonly retryReason: "transient";
3
+ readonly status?: number;
4
+ constructor(args: {
5
+ message: string;
6
+ status?: number;
7
+ });
8
+ }
9
+ export declare class RateLimitLlmError extends Error {
10
+ readonly retryReason: "rate_limit";
11
+ readonly status?: number;
12
+ constructor(args: {
13
+ message: string;
14
+ status?: number;
15
+ });
16
+ }
17
+ /**
18
+ * Thrown when the OpenAI Responses API rejects our request because
19
+ * the model's output failed strict-mode JSON-Schema enforcement on
20
+ * the OpenAI side (typical 400/422 errors). Tagged `transient` so
21
+ * the framework's default retry policy retries — a single re-roll
22
+ * often produces conforming output. (The framework's separate
23
+ * `OUTPUT_SCHEMA_INVALID` path catches output that passes the
24
+ * provider but fails our local TypeBox check; this class is the
25
+ * provider-side analogue.)
26
+ */
27
+ export declare class SchemaValidationLlmError extends Error {
28
+ readonly retryReason: "transient";
29
+ readonly status?: number;
30
+ constructor(args: {
31
+ message: string;
32
+ status?: number;
33
+ });
34
+ }
35
+ export declare class NonRetryableLlmError extends Error {
36
+ readonly status?: number;
37
+ constructor(args: {
38
+ message: string;
39
+ status?: number;
40
+ });
41
+ }
42
+ export declare class ToolLoopExhaustedError extends Error {
43
+ readonly rounds: number;
44
+ constructor(args: {
45
+ message: string;
46
+ rounds: number;
47
+ });
48
+ }
49
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/extensions/openai/errors.ts"],"names":[],"mappings":"AAgCA,qBAAa,iBAAkB,SAAQ,KAAK;IACxC,SAAgB,WAAW,EAAG,WAAW,CAAS;IAClD,SAAgB,MAAM,CAAC,EAAE,MAAM,CAAA;gBAEnB,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;CAKzD;AAED,qBAAa,iBAAkB,SAAQ,KAAK;IACxC,SAAgB,WAAW,EAAG,YAAY,CAAS;IACnD,SAAgB,MAAM,CAAC,EAAE,MAAM,CAAA;gBAEnB,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;CAKzD;AAED;;;;;;;;;GASG;AACH,qBAAa,wBAAyB,SAAQ,KAAK;IAC/C,SAAgB,WAAW,EAAG,WAAW,CAAS;IAClD,SAAgB,MAAM,CAAC,EAAE,MAAM,CAAA;gBAEnB,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;CAKzD;AAED,qBAAa,oBAAqB,SAAQ,KAAK;IAC3C,SAAgB,MAAM,CAAC,EAAE,MAAM,CAAA;gBAEnB,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;CAKzD;AAED,qBAAa,sBAAuB,SAAQ,KAAK;IAC7C,SAAgB,MAAM,EAAE,MAAM,CAAA;gBAElB,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE;CAKxD"}
@@ -0,0 +1,85 @@
1
+ // OpenAI-provider error classes.
2
+ //
3
+ // The framework's `llmStage` retry policy classifies provider errors
4
+ // by inspecting a `retryReason` tag on the thrown object (see
5
+ // `src/lib/pipelines/stage-helpers.ts#classifyError`). To play
6
+ // cleanly with that mechanism, each provider-side error class carries
7
+ // the appropriate tag as an own property.
8
+ //
9
+ // Mapping for the framework's default retry policy
10
+ // (`retryOn: ["schema_validation", "transient"]`):
11
+ //
12
+ // * `TransientLlmError` — `retryReason: "transient"`. 5xx
13
+ // responses + low-level fetch failures. Retried under the
14
+ // default policy.
15
+ // * `RateLimitLlmError` — `retryReason: "rate_limit"`. 429
16
+ // responses. Not retried by default — callers can opt into
17
+ // `retryOn: ["..., "rate_limit"]`.
18
+ // * `SchemaValidationLlmError` — no `retryReason` tag; the
19
+ // framework's separate schema-validation retry path handles
20
+ // this. Thrown for 400/422 responses that signal strict-mode
21
+ // schema violations.
22
+ // * `NonRetryableLlmError` — no tag; framework classifies as
23
+ // `non_retryable` and surfaces it immediately as
24
+ // `LLM_NON_RETRYABLE_ERROR`. Used for 401/403 and other
25
+ // unrecoverable 4xx.
26
+ // * `ToolLoopExhaustedError` — surfaces from the agent loop when
27
+ // the round cap is hit. Non-retryable.
28
+ //
29
+ // Keeping these classes in `extensions/openai/` rather than promoting
30
+ // them into `src/lib/llm/` keeps the abstract interface clean — the
31
+ // framework consumes the `retryReason` tag, not the class identity.
32
+ export class TransientLlmError extends Error {
33
+ retryReason = "transient";
34
+ status;
35
+ constructor(args) {
36
+ super(args.message);
37
+ this.name = "TransientLlmError";
38
+ this.status = args.status;
39
+ }
40
+ }
41
+ export class RateLimitLlmError extends Error {
42
+ retryReason = "rate_limit";
43
+ status;
44
+ constructor(args) {
45
+ super(args.message);
46
+ this.name = "RateLimitLlmError";
47
+ this.status = args.status;
48
+ }
49
+ }
50
+ /**
51
+ * Thrown when the OpenAI Responses API rejects our request because
52
+ * the model's output failed strict-mode JSON-Schema enforcement on
53
+ * the OpenAI side (typical 400/422 errors). Tagged `transient` so
54
+ * the framework's default retry policy retries — a single re-roll
55
+ * often produces conforming output. (The framework's separate
56
+ * `OUTPUT_SCHEMA_INVALID` path catches output that passes the
57
+ * provider but fails our local TypeBox check; this class is the
58
+ * provider-side analogue.)
59
+ */
60
+ export class SchemaValidationLlmError extends Error {
61
+ retryReason = "transient";
62
+ status;
63
+ constructor(args) {
64
+ super(args.message);
65
+ this.name = "SchemaValidationLlmError";
66
+ this.status = args.status;
67
+ }
68
+ }
69
+ export class NonRetryableLlmError extends Error {
70
+ status;
71
+ constructor(args) {
72
+ super(args.message);
73
+ this.name = "NonRetryableLlmError";
74
+ this.status = args.status;
75
+ }
76
+ }
77
+ export class ToolLoopExhaustedError extends Error {
78
+ rounds;
79
+ constructor(args) {
80
+ super(args.message);
81
+ this.name = "ToolLoopExhaustedError";
82
+ this.rounds = args.rounds;
83
+ }
84
+ }
85
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","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B,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAA;QACtC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;IAC7B,CAAC;CACJ;AAED,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC3B,MAAM,CAAS;IAE/B,YAAY,IAA0C;QAClD,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QACnB,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAA;QAClC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;IAC7B,CAAC;CACJ;AAED,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IAC7B,MAAM,CAAQ;IAE9B,YAAY,IAAyC;QACjD,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QACnB,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAA;QACpC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;IAC7B,CAAC;CACJ"}
@@ -0,0 +1,7 @@
1
+ export { createOpenAiResponsesProvider } from "./provider.js";
2
+ export type { TCreateOpenAiResponsesProviderOptions } from "./provider.js";
3
+ export type { TOpenAiFetch } from "./types.js";
4
+ export { NonRetryableLlmError, RateLimitLlmError, SchemaValidationLlmError, ToolLoopExhaustedError, TransientLlmError, } from "./errors.js";
5
+ export { typeboxToOpenAiSchema } from "./structured-output.js";
6
+ export type { TOpenAiJsonSchema } from "./structured-output.js";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/extensions/openai/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAA;AAC7D,YAAY,EAAE,qCAAqC,EAAE,MAAM,eAAe,CAAA;AAC1E,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,EACH,oBAAoB,EACpB,iBAAiB,EACjB,wBAAwB,EACxB,sBAAsB,EACtB,iBAAiB,GACpB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AAC9D,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA"}
@@ -0,0 +1,10 @@
1
+ // Barrel for the OpenAI Responses-API provider extension.
2
+ //
3
+ // Public surface consumed by `proposit-server`, the CLI, and other
4
+ // callers: the provider constructor + caller-facing config types +
5
+ // the error classes that callers may want to `instanceof`-match for
6
+ // finer-grained observability.
7
+ export { createOpenAiResponsesProvider } from "./provider.js";
8
+ export { NonRetryableLlmError, RateLimitLlmError, SchemaValidationLlmError, ToolLoopExhaustedError, TransientLlmError, } from "./errors.js";
9
+ export { typeboxToOpenAiSchema } from "./structured-output.js";
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/extensions/openai/index.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,EAAE;AACF,mEAAmE;AACnE,mEAAmE;AACnE,oEAAoE;AACpE,+BAA+B;AAE/B,OAAO,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAA;AAG7D,OAAO,EACH,oBAAoB,EACpB,iBAAiB,EACjB,wBAAwB,EACxB,sBAAsB,EACtB,iBAAiB,GACpB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA"}
@@ -0,0 +1,22 @@
1
+ import type { TLlmProvider } from "../../lib/llm/types.js";
2
+ import type { TOpenAiFetch } from "./types.js";
3
+ export type TCreateOpenAiResponsesProviderOptions = {
4
+ apiKey: string;
5
+ /** Override the default `https://api.openai.com/v1/responses`. */
6
+ baseUrl?: string;
7
+ /**
8
+ * Injectable `fetch`. Defaults to `globalThis.fetch`. Tests inject
9
+ * mocks; runtimes without a global `fetch` (older Node) inject a
10
+ * polyfill.
11
+ */
12
+ fetch?: TOpenAiFetch;
13
+ /**
14
+ * Cap on the number of round-trips the function-tool agent loop
15
+ * can take before throwing `ToolLoopExhaustedError`. Defaults to
16
+ * 6. Built-in tools (`web_search` / `file_search` / `mcp`) don't
17
+ * count against this cap — they run server-side.
18
+ */
19
+ maxToolCallRounds?: number;
20
+ };
21
+ export declare function createOpenAiResponsesProvider(options: TCreateOpenAiResponsesProviderOptions): TLlmProvider;
22
+ //# sourceMappingURL=provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/extensions/openai/provider.ts"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EACR,YAAY,EAKf,MAAM,wBAAwB,CAAA;AAS/B,OAAO,KAAK,EACR,YAAY,EAMf,MAAM,YAAY,CAAA;AAKnB,MAAM,MAAM,qCAAqC,GAAG;IAChD,MAAM,EAAE,MAAM,CAAA;IACd,kEAAkE;IAClE,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;OAIG;IACH,KAAK,CAAC,EAAE,YAAY,CAAA;IACpB;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC7B,CAAA;AAED,wBAAgB,6BAA6B,CACzC,OAAO,EAAE,qCAAqC,GAC/C,YAAY,CAqJd"}