@openapi-flow/langchain 0.0.0-stage → 0.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.
- package/LICENSE +21 -0
- package/README.md +152 -2
- package/THIRD_PARTY_NOTICES.md +3 -0
- package/dist/arguments/analyze-api-input-answers.d.ts +3 -0
- package/dist/arguments/analyze-api-input-answers.js +87 -0
- package/dist/arguments/analyze-api-request-media-type.d.ts +4 -0
- package/dist/arguments/analyze-api-request-media-type.js +50 -0
- package/dist/arguments/extract-api-input-answers.d.ts +3 -0
- package/dist/arguments/extract-api-input-answers.js +4 -0
- package/dist/arguments/generate-api-arguments.d.ts +3 -0
- package/dist/arguments/generate-api-arguments.js +60 -0
- package/dist/arguments/select-api-request-media-type.d.ts +2 -0
- package/dist/arguments/select-api-request-media-type.js +10 -0
- package/dist/bindings/plan-api-bindings.d.ts +3 -0
- package/dist/bindings/plan-api-bindings.js +50 -0
- package/dist/draft/analyze-workflow-draft-edit.d.ts +4 -0
- package/dist/draft/analyze-workflow-draft-edit.js +84 -0
- package/dist/draft/generate-workflow-draft-api-call-arguments.d.ts +3 -0
- package/dist/draft/generate-workflow-draft-api-call-arguments.js +88 -0
- package/dist/draft/generate-workflow-draft-api-input-edits.d.ts +4 -0
- package/dist/draft/generate-workflow-draft-api-input-edits.js +58 -0
- package/dist/draft/generate-workflow-draft-native-node-addition.d.ts +4 -0
- package/dist/draft/generate-workflow-draft-native-node-addition.js +137 -0
- package/dist/draft/generate-workflow-draft-native-parameter-edits.d.ts +3 -0
- package/dist/draft/generate-workflow-draft-native-parameter-edits.js +71 -0
- package/dist/draft/plan-workflow-draft-api-binding-edit.d.ts +4 -0
- package/dist/draft/plan-workflow-draft-api-binding-edit.js +103 -0
- package/dist/draft/plan-workflow-draft-api-call-bindings.d.ts +3 -0
- package/dist/draft/plan-workflow-draft-api-call-bindings.js +114 -0
- package/dist/draft/plan-workflow-draft-clarification-scopes.d.ts +4 -0
- package/dist/draft/plan-workflow-draft-clarification-scopes.js +77 -0
- package/dist/draft/plan-workflow-draft-connection-edit.d.ts +4 -0
- package/dist/draft/plan-workflow-draft-connection-edit.js +79 -0
- package/dist/draft/plan-workflow-draft-native-dependencies.d.ts +4 -0
- package/dist/draft/plan-workflow-draft-native-dependencies.js +45 -0
- package/dist/draft/plan-workflow-draft-native-reference-repair.d.ts +4 -0
- package/dist/draft/plan-workflow-draft-native-reference-repair.js +68 -0
- package/dist/draft/resolve-workflow-draft-edit-proposal.d.ts +3 -0
- package/dist/draft/resolve-workflow-draft-edit-proposal.js +39 -0
- package/dist/draft/select-workflow-draft-api-binding-inputs.d.ts +4 -0
- package/dist/draft/select-workflow-draft-api-binding-inputs.js +83 -0
- package/dist/draft/select-workflow-draft-api-input-edit-targets.d.ts +4 -0
- package/dist/draft/select-workflow-draft-api-input-edit-targets.js +55 -0
- package/dist/draft/select-workflow-draft-native-node-parameter-ownership.d.ts +4 -0
- package/dist/draft/select-workflow-draft-native-node-parameter-ownership.js +81 -0
- package/dist/draft/select-workflow-draft-native-parameter-edit-targets.d.ts +3 -0
- package/dist/draft/select-workflow-draft-native-parameter-edit-targets.js +51 -0
- package/dist/draft/workflow-draft-api-binding-edit-planning-error.d.ts +5 -0
- package/dist/draft/workflow-draft-api-binding-edit-planning-error.js +10 -0
- package/dist/draft/workflow-draft-api-call-planning-error.d.ts +5 -0
- package/dist/draft/workflow-draft-api-call-planning-error.js +10 -0
- package/dist/draft/workflow-draft-api-input-edit-planning-error.d.ts +5 -0
- package/dist/draft/workflow-draft-api-input-edit-planning-error.js +10 -0
- package/dist/draft/workflow-draft-clarification-scope-planning-error.d.ts +5 -0
- package/dist/draft/workflow-draft-clarification-scope-planning-error.js +8 -0
- package/dist/draft/workflow-draft-connection-edit-planning-error.d.ts +5 -0
- package/dist/draft/workflow-draft-connection-edit-planning-error.js +10 -0
- package/dist/draft/workflow-draft-edit-planning-error.d.ts +5 -0
- package/dist/draft/workflow-draft-edit-planning-error.js +8 -0
- package/dist/draft/workflow-draft-native-node-addition-planning-error.d.ts +5 -0
- package/dist/draft/workflow-draft-native-node-addition-planning-error.js +10 -0
- package/dist/draft/workflow-draft-native-parameter-edit-planning-error.d.ts +5 -0
- package/dist/draft/workflow-draft-native-parameter-edit-planning-error.js +8 -0
- package/dist/draft/workflow-draft-native-reference-repair-planning-error.d.ts +5 -0
- package/dist/draft/workflow-draft-native-reference-repair-planning-error.js +8 -0
- package/dist/legacy/planning/operation-plan-inputs.d.ts +3 -0
- package/dist/legacy/planning/operation-plan-inputs.js +17 -0
- package/dist/legacy/planning/parse-structured-output.d.ts +2 -0
- package/dist/legacy/planning/parse-structured-output.js +9 -0
- package/dist/legacy/planning/propose-catalog-scenario.d.ts +3 -0
- package/dist/legacy/planning/propose-catalog-scenario.js +136 -0
- package/dist/legacy/planning/select-operation.d.ts +4 -0
- package/dist/legacy/planning/select-operation.js +43 -0
- package/dist/legacy/schemas/catalog-selection-schema.d.ts +19 -0
- package/dist/legacy/schemas/catalog-selection-schema.js +39 -0
- package/dist/legacy/schemas/catalog-step-schema.d.ts +16 -0
- package/dist/legacy/schemas/catalog-step-schema.js +39 -0
- package/dist/legacy/schemas/operation-selection-schema.d.ts +6 -0
- package/dist/legacy/schemas/operation-selection-schema.js +14 -0
- package/dist/legacy-api.d.ts +9 -0
- package/dist/legacy-api.js +7 -0
- package/dist/prompts/api-arguments-prompt.d.ts +1 -0
- package/dist/prompts/api-arguments-prompt.js +1 -0
- package/dist/prompts/api-bindings-prompt.d.ts +1 -0
- package/dist/prompts/api-bindings-prompt.js +13 -0
- package/dist/prompts/api-input-answers-prompt.d.ts +1 -0
- package/dist/prompts/api-input-answers-prompt.js +7 -0
- package/dist/prompts/api-request-media-type-prompt.d.ts +1 -0
- package/dist/prompts/api-request-media-type-prompt.js +1 -0
- package/dist/prompts/api-selection-analysis-prompt.d.ts +1 -0
- package/dist/prompts/api-selection-analysis-prompt.js +5 -0
- package/dist/prompts/api-selection-explanation-prompt.d.ts +1 -0
- package/dist/prompts/api-selection-explanation-prompt.js +1 -0
- package/dist/prompts/native-instance-dependencies-prompt.d.ts +1 -0
- package/dist/prompts/native-instance-dependencies-prompt.js +8 -0
- package/dist/prompts/native-node-planning-prompt.d.ts +3 -0
- package/dist/prompts/native-node-planning-prompt.js +22 -0
- package/dist/prompts/operation-selection-prompt.d.ts +1 -0
- package/dist/prompts/operation-selection-prompt.js +1 -0
- package/dist/prompts/reviewable-workflow-graph-prompt.d.ts +1 -0
- package/dist/prompts/reviewable-workflow-graph-prompt.js +7 -0
- package/dist/prompts/workflow-connections-prompt.d.ts +1 -0
- package/dist/prompts/workflow-connections-prompt.js +11 -0
- package/dist/prompts/workflow-draft-api-binding-edit-prompt.d.ts +1 -0
- package/dist/prompts/workflow-draft-api-binding-edit-prompt.js +9 -0
- package/dist/prompts/workflow-draft-api-call-planning-prompt.d.ts +3 -0
- package/dist/prompts/workflow-draft-api-call-planning-prompt.js +39 -0
- package/dist/prompts/workflow-draft-api-input-edit-prompt.d.ts +2 -0
- package/dist/prompts/workflow-draft-api-input-edit-prompt.js +14 -0
- package/dist/prompts/workflow-draft-clarification-scope-prompt.d.ts +1 -0
- package/dist/prompts/workflow-draft-clarification-scope-prompt.js +10 -0
- package/dist/prompts/workflow-draft-connection-edit-prompt.d.ts +1 -0
- package/dist/prompts/workflow-draft-connection-edit-prompt.js +7 -0
- package/dist/prompts/workflow-draft-edit-prompt.d.ts +1 -0
- package/dist/prompts/workflow-draft-edit-prompt.js +15 -0
- package/dist/prompts/workflow-draft-native-dependencies-prompt.d.ts +1 -0
- package/dist/prompts/workflow-draft-native-dependencies-prompt.js +5 -0
- package/dist/prompts/workflow-draft-native-node-addition-prompt.d.ts +2 -0
- package/dist/prompts/workflow-draft-native-node-addition-prompt.js +6 -0
- package/dist/prompts/workflow-draft-native-parameter-edit-prompt.d.ts +2 -0
- package/dist/prompts/workflow-draft-native-parameter-edit-prompt.js +2 -0
- package/dist/prompts/workflow-draft-native-reference-repair-prompt.d.ts +1 -0
- package/dist/prompts/workflow-draft-native-reference-repair-prompt.js +7 -0
- package/dist/prompts/workflow-graph-prompt.d.ts +1 -0
- package/dist/prompts/workflow-graph-prompt.js +15 -0
- package/dist/prompts/workflow-requirements-prompt.d.ts +1 -0
- package/dist/prompts/workflow-requirements-prompt.js +14 -0
- package/dist/prompts/workflow-review-suggestions-prompt.d.ts +1 -0
- package/dist/prompts/workflow-review-suggestions-prompt.js +4 -0
- package/dist/prompts/workflow-user-action-evidence-prompt.d.ts +1 -0
- package/dist/prompts/workflow-user-action-evidence-prompt.js +1 -0
- package/dist/public-api.d.ts +67 -0
- package/dist/public-api.js +46 -0
- package/dist/requirements/clarify-workflow-requirements.d.ts +4 -0
- package/dist/requirements/clarify-workflow-requirements.js +53 -0
- package/dist/requirements/resolve-workflow-requirements-evidence.d.ts +4 -0
- package/dist/requirements/resolve-workflow-requirements-evidence.js +58 -0
- package/dist/review/suggest-workflow-review-follow-ups.d.ts +4 -0
- package/dist/review/suggest-workflow-review-follow-ups.js +87 -0
- package/dist/review/workflow-review-suggestion-planning-error.d.ts +5 -0
- package/dist/review/workflow-review-suggestion-planning-error.js +8 -0
- package/dist/schemas/api-binding-plan-schema.d.ts +8 -0
- package/dist/schemas/api-binding-plan-schema.js +59 -0
- package/dist/schemas/api-input-answer-source-schema.d.ts +16 -0
- package/dist/schemas/api-input-answer-source-schema.js +28 -0
- package/dist/schemas/api-literal-generation-output-schema.d.ts +11 -0
- package/dist/schemas/api-literal-generation-output-schema.js +20 -0
- package/dist/schemas/api-request-media-type-schema.d.ts +6 -0
- package/dist/schemas/api-request-media-type-schema.js +23 -0
- package/dist/schemas/api-selection-analysis-schema.d.ts +41 -0
- package/dist/schemas/api-selection-analysis-schema.js +23 -0
- package/dist/schemas/api-selection-options-schema.d.ts +4 -0
- package/dist/schemas/api-selection-options-schema.js +4 -0
- package/dist/schemas/api-selection-schema.d.ts +25 -0
- package/dist/schemas/api-selection-schema.js +31 -0
- package/dist/schemas/create-workflow-message-evidence-selection-schema.d.ts +16 -0
- package/dist/schemas/create-workflow-message-evidence-selection-schema.js +22 -0
- package/dist/schemas/native-node-explanation-schema.d.ts +5 -0
- package/dist/schemas/native-node-explanation-schema.js +9 -0
- package/dist/schemas/native-node-parameter-contract.d.ts +3 -0
- package/dist/schemas/native-node-parameter-contract.js +30 -0
- package/dist/schemas/native-node-planning-contract.d.ts +3 -0
- package/dist/schemas/native-node-planning-contract.js +44 -0
- package/dist/schemas/request-media-selection-options-schema.d.ts +4 -0
- package/dist/schemas/request-media-selection-options-schema.js +4 -0
- package/dist/schemas/reviewable-workflow-graph-schema.d.ts +6 -0
- package/dist/schemas/reviewable-workflow-graph-schema.js +75 -0
- package/dist/schemas/serialize-structured-output-schema.d.ts +5 -0
- package/dist/schemas/serialize-structured-output-schema.js +10 -0
- package/dist/schemas/serialize-workflow-requirements-schema.d.ts +4 -0
- package/dist/schemas/serialize-workflow-requirements-schema.js +5 -0
- package/dist/schemas/with-api-selection-explanation.d.ts +10 -0
- package/dist/schemas/with-api-selection-explanation.js +15 -0
- package/dist/schemas/workflow-connection-explanation-schema.d.ts +5 -0
- package/dist/schemas/workflow-connection-explanation-schema.js +9 -0
- package/dist/schemas/workflow-draft-edit-schema.d.ts +3 -0
- package/dist/schemas/workflow-draft-edit-schema.js +17 -0
- package/dist/schemas/workflow-graph-explanation-schema.d.ts +5 -0
- package/dist/schemas/workflow-graph-explanation-schema.js +9 -0
- package/dist/schemas/workflow-graph-proposal-schema.d.ts +4 -0
- package/dist/schemas/workflow-graph-proposal-schema.js +45 -0
- package/dist/schemas/workflow-planning-evidence-schemas.d.ts +20 -0
- package/dist/schemas/workflow-planning-evidence-schemas.js +44 -0
- package/dist/schemas/workflow-requirements-schema.d.ts +3 -0
- package/dist/schemas/workflow-requirements-schema.js +6 -0
- package/dist/schemas/workflow-review-suggestions-schema.d.ts +4 -0
- package/dist/schemas/workflow-review-suggestions-schema.js +18 -0
- package/dist/selection/analyze-api-selection.d.ts +4 -0
- package/dist/selection/analyze-api-selection.js +117 -0
- package/dist/selection/resolve-api-selection-options.d.ts +3 -0
- package/dist/selection/resolve-api-selection-options.js +6 -0
- package/dist/selection/select-api-operations.d.ts +3 -0
- package/dist/selection/select-api-operations.js +84 -0
- package/dist/types/api-input-answers.d.ts +16 -0
- package/dist/types/api-input-answers.js +1 -0
- package/dist/types/api-selection-analysis.d.ts +3 -0
- package/dist/types/api-selection-analysis.js +1 -0
- package/dist/types/argument-generation.d.ts +13 -0
- package/dist/types/argument-generation.js +1 -0
- package/dist/types/binding-planning.d.ts +10 -0
- package/dist/types/binding-planning.js +1 -0
- package/dist/types/legacy/catalog-planning.d.ts +16 -0
- package/dist/types/legacy/catalog-planning.js +1 -0
- package/dist/types/legacy/planning.d.ts +5 -0
- package/dist/types/legacy/planning.js +1 -0
- package/dist/types/native-node-planning.d.ts +76 -0
- package/dist/types/native-node-planning.js +1 -0
- package/dist/types/operation-selection.d.ts +14 -0
- package/dist/types/operation-selection.js +1 -0
- package/dist/types/request-media-selection.d.ts +15 -0
- package/dist/types/request-media-selection.js +1 -0
- package/dist/types/reviewable-workflow-planning.d.ts +28 -0
- package/dist/types/reviewable-workflow-planning.js +1 -0
- package/dist/types/structured-output-schema.d.ts +3 -0
- package/dist/types/structured-output-schema.js +1 -0
- package/dist/types/workflow-clarification.d.ts +23 -0
- package/dist/types/workflow-clarification.js +1 -0
- package/dist/types/workflow-draft-api-binding-edit.d.ts +9 -0
- package/dist/types/workflow-draft-api-binding-edit.js +1 -0
- package/dist/types/workflow-draft-api-call-planning.d.ts +15 -0
- package/dist/types/workflow-draft-api-call-planning.js +1 -0
- package/dist/types/workflow-draft-api-input-edit.d.ts +13 -0
- package/dist/types/workflow-draft-api-input-edit.js +1 -0
- package/dist/types/workflow-draft-clarification.d.ts +9 -0
- package/dist/types/workflow-draft-clarification.js +1 -0
- package/dist/types/workflow-draft-connection-edit.d.ts +9 -0
- package/dist/types/workflow-draft-connection-edit.js +1 -0
- package/dist/types/workflow-draft-edit.d.ts +16 -0
- package/dist/types/workflow-draft-edit.js +1 -0
- package/dist/types/workflow-draft-native-node-addition.d.ts +18 -0
- package/dist/types/workflow-draft-native-node-addition.js +1 -0
- package/dist/types/workflow-draft-native-parameter-edit.d.ts +13 -0
- package/dist/types/workflow-draft-native-parameter-edit.js +1 -0
- package/dist/types/workflow-draft-native-reference-repair.d.ts +9 -0
- package/dist/types/workflow-draft-native-reference-repair.js +1 -0
- package/dist/types/workflow-message-evidence-selection.d.ts +6 -0
- package/dist/types/workflow-message-evidence-selection.js +1 -0
- package/dist/types/workflow-orchestration.d.ts +21 -0
- package/dist/types/workflow-orchestration.js +1 -0
- package/dist/types/workflow-planning.d.ts +35 -0
- package/dist/types/workflow-planning.js +1 -0
- package/dist/types/workflow-review-suggestions.d.ts +12 -0
- package/dist/types/workflow-review-suggestions.js +1 -0
- package/dist/workflow/complete-reviewable-workflow-graph-proposal.d.ts +4 -0
- package/dist/workflow/complete-reviewable-workflow-graph-proposal.js +13 -0
- package/dist/workflow/generate-native-node-parameters.d.ts +4 -0
- package/dist/workflow/generate-native-node-parameters.js +87 -0
- package/dist/workflow/native-node-planning-error.d.ts +5 -0
- package/dist/workflow/native-node-planning-error.js +10 -0
- package/dist/workflow/orchestrate-workflow.d.ts +4 -0
- package/dist/workflow/orchestrate-workflow.js +31 -0
- package/dist/workflow/plan-native-instance-dependencies.d.ts +4 -0
- package/dist/workflow/plan-native-instance-dependencies.js +45 -0
- package/dist/workflow/plan-native-nodes.d.ts +2 -0
- package/dist/workflow/plan-native-nodes.js +96 -0
- package/dist/workflow/plan-reviewable-workflow-graph.d.ts +3 -0
- package/dist/workflow/plan-reviewable-workflow-graph.js +70 -0
- package/dist/workflow/plan-workflow-connections.d.ts +3 -0
- package/dist/workflow/plan-workflow-connections.js +67 -0
- package/dist/workflow/plan-workflow-graph.d.ts +3 -0
- package/dist/workflow/plan-workflow-graph.js +80 -0
- package/dist/workflow/resolve-native-node-parameter-source.d.ts +4 -0
- package/dist/workflow/resolve-native-node-parameter-source.js +7 -0
- package/dist/workflow/resolve-native-node-planning-output.d.ts +3 -0
- package/dist/workflow/resolve-native-node-planning-output.js +33 -0
- package/dist/workflow/resolve-workflow-connection-output.d.ts +3 -0
- package/dist/workflow/resolve-workflow-connection-output.js +22 -0
- package/dist/workflow/resolve-workflow-graph-output.d.ts +5 -0
- package/dist/workflow/resolve-workflow-graph-output.js +69 -0
- package/dist/workflow/reviewable-workflow-graph-planning-error.d.ts +5 -0
- package/dist/workflow/reviewable-workflow-graph-planning-error.js +8 -0
- package/dist/workflow/select-native-node-instances.d.ts +4 -0
- package/dist/workflow/select-native-node-instances.js +57 -0
- package/dist/workflow/workflow-graph-planning-error.d.ts +5 -0
- package/dist/workflow/workflow-graph-planning-error.js +10 -0
- package/package.json +47 -4
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export { selectApiOperations } from './selection/select-api-operations.js';
|
|
2
|
+
export { analyzeApiSelection } from './selection/analyze-api-selection.js';
|
|
3
|
+
export { clarifyWorkflowRequirements } from './requirements/clarify-workflow-requirements.js';
|
|
4
|
+
export { analyzeWorkflowDraftEdit } from './draft/analyze-workflow-draft-edit.js';
|
|
5
|
+
export { WorkflowDraftEditPlanningError } from './draft/workflow-draft-edit-planning-error.js';
|
|
6
|
+
export type * from './types/workflow-draft-edit.js';
|
|
7
|
+
export { selectWorkflowDraftApiInputEditTargets } from './draft/select-workflow-draft-api-input-edit-targets.js';
|
|
8
|
+
export { generateWorkflowDraftApiInputEdits } from './draft/generate-workflow-draft-api-input-edits.js';
|
|
9
|
+
export { WorkflowDraftApiInputEditPlanningError } from './draft/workflow-draft-api-input-edit-planning-error.js';
|
|
10
|
+
export type * from './types/workflow-draft-api-input-edit.js';
|
|
11
|
+
export { planWorkflowDraftApiBindingEdit } from './draft/plan-workflow-draft-api-binding-edit.js';
|
|
12
|
+
export { WorkflowDraftApiBindingEditPlanningError } from './draft/workflow-draft-api-binding-edit-planning-error.js';
|
|
13
|
+
export type * from './types/workflow-draft-api-binding-edit.js';
|
|
14
|
+
export { planWorkflowDraftConnectionEdit } from './draft/plan-workflow-draft-connection-edit.js';
|
|
15
|
+
export { WorkflowDraftConnectionEditPlanningError } from './draft/workflow-draft-connection-edit-planning-error.js';
|
|
16
|
+
export type * from './types/workflow-draft-connection-edit.js';
|
|
17
|
+
export { selectWorkflowDraftNativeParameterEditTargets } from './draft/select-workflow-draft-native-parameter-edit-targets.js';
|
|
18
|
+
export { generateWorkflowDraftNativeParameterEdits } from './draft/generate-workflow-draft-native-parameter-edits.js';
|
|
19
|
+
export { WorkflowDraftNativeParameterEditPlanningError } from './draft/workflow-draft-native-parameter-edit-planning-error.js';
|
|
20
|
+
export type * from './types/workflow-draft-native-parameter-edit.js';
|
|
21
|
+
export { planWorkflowDraftNativeReferenceRepair } from './draft/plan-workflow-draft-native-reference-repair.js';
|
|
22
|
+
export { WorkflowDraftNativeReferenceRepairPlanningError } from './draft/workflow-draft-native-reference-repair-planning-error.js';
|
|
23
|
+
export type * from './types/workflow-draft-native-reference-repair.js';
|
|
24
|
+
export { generateWorkflowDraftNativeNodeAddition } from './draft/generate-workflow-draft-native-node-addition.js';
|
|
25
|
+
export { planWorkflowDraftNativeDependencies } from './draft/plan-workflow-draft-native-dependencies.js';
|
|
26
|
+
export { selectWorkflowDraftNativeNodeParameterOwnership } from './draft/select-workflow-draft-native-node-parameter-ownership.js';
|
|
27
|
+
export { WorkflowDraftNativeNodeAdditionPlanningError } from './draft/workflow-draft-native-node-addition-planning-error.js';
|
|
28
|
+
export type * from './types/workflow-draft-native-node-addition.js';
|
|
29
|
+
export type * from './types/workflow-draft-api-call-planning.js';
|
|
30
|
+
export { selectWorkflowDraftApiBindingInputs } from './draft/select-workflow-draft-api-binding-inputs.js';
|
|
31
|
+
export { planWorkflowDraftApiCallBindings } from './draft/plan-workflow-draft-api-call-bindings.js';
|
|
32
|
+
export { generateWorkflowDraftApiCallArguments } from './draft/generate-workflow-draft-api-call-arguments.js';
|
|
33
|
+
export { WorkflowDraftApiCallPlanningError } from './draft/workflow-draft-api-call-planning-error.js';
|
|
34
|
+
export type { ClarifyWorkflowRequirementsInput } from './types/workflow-clarification.js';
|
|
35
|
+
export { generateApiArguments } from './arguments/generate-api-arguments.js';
|
|
36
|
+
export { extractApiInputAnswers } from './arguments/extract-api-input-answers.js';
|
|
37
|
+
export { analyzeApiInputAnswers } from './arguments/analyze-api-input-answers.js';
|
|
38
|
+
export type * from './types/api-input-answers.js';
|
|
39
|
+
export { selectApiRequestMediaType } from './arguments/select-api-request-media-type.js';
|
|
40
|
+
export { analyzeApiRequestMediaType } from './arguments/analyze-api-request-media-type.js';
|
|
41
|
+
export type * from './types/request-media-selection.js';
|
|
42
|
+
export type * from './types/operation-selection.js';
|
|
43
|
+
export type * from './types/argument-generation.js';
|
|
44
|
+
export { planWorkflowGraph } from './workflow/plan-workflow-graph.js';
|
|
45
|
+
export { WorkflowGraphPlanningError } from './workflow/workflow-graph-planning-error.js';
|
|
46
|
+
export type * from './types/workflow-planning.js';
|
|
47
|
+
export { planApiBindings } from './bindings/plan-api-bindings.js';
|
|
48
|
+
export type * from './types/binding-planning.js';
|
|
49
|
+
export { planReviewableWorkflowGraph } from './workflow/plan-reviewable-workflow-graph.js';
|
|
50
|
+
export { ReviewableWorkflowGraphPlanningError } from './workflow/reviewable-workflow-graph-planning-error.js';
|
|
51
|
+
export type * from './types/reviewable-workflow-planning.js';
|
|
52
|
+
export { planNativeNodes } from './workflow/plan-native-nodes.js';
|
|
53
|
+
export { selectNativeNodeInstances } from './workflow/select-native-node-instances.js';
|
|
54
|
+
export { generateNativeNodeParameters } from './workflow/generate-native-node-parameters.js';
|
|
55
|
+
export { NativeNodePlanningError } from './workflow/native-node-planning-error.js';
|
|
56
|
+
export { planWorkflowConnections } from './workflow/plan-workflow-connections.js';
|
|
57
|
+
export { orchestrateWorkflow } from './workflow/orchestrate-workflow.js';
|
|
58
|
+
export type * from './types/native-node-planning.js';
|
|
59
|
+
export type * from './types/workflow-orchestration.js';
|
|
60
|
+
export type * from './types/workflow-draft-clarification.js';
|
|
61
|
+
export { planWorkflowDraftClarificationScopes } from './draft/plan-workflow-draft-clarification-scopes.js';
|
|
62
|
+
export { WorkflowDraftClarificationScopePlanningError } from './draft/workflow-draft-clarification-scope-planning-error.js';
|
|
63
|
+
export type * from './types/workflow-review-suggestions.js';
|
|
64
|
+
export { suggestWorkflowReviewFollowUps } from './review/suggest-workflow-review-follow-ups.js';
|
|
65
|
+
export { WorkflowReviewSuggestionPlanningError } from './review/workflow-review-suggestion-planning-error.js';
|
|
66
|
+
export { planNativeInstanceDependencies } from './workflow/plan-native-instance-dependencies.js';
|
|
67
|
+
export type { PlanNativeInstanceDependenciesInput } from './types/native-node-planning.js';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export { selectApiOperations } from './selection/select-api-operations.js';
|
|
2
|
+
export { analyzeApiSelection } from './selection/analyze-api-selection.js';
|
|
3
|
+
export { clarifyWorkflowRequirements } from './requirements/clarify-workflow-requirements.js';
|
|
4
|
+
export { analyzeWorkflowDraftEdit } from './draft/analyze-workflow-draft-edit.js';
|
|
5
|
+
export { WorkflowDraftEditPlanningError } from './draft/workflow-draft-edit-planning-error.js';
|
|
6
|
+
export { selectWorkflowDraftApiInputEditTargets } from './draft/select-workflow-draft-api-input-edit-targets.js';
|
|
7
|
+
export { generateWorkflowDraftApiInputEdits } from './draft/generate-workflow-draft-api-input-edits.js';
|
|
8
|
+
export { WorkflowDraftApiInputEditPlanningError } from './draft/workflow-draft-api-input-edit-planning-error.js';
|
|
9
|
+
export { planWorkflowDraftApiBindingEdit } from './draft/plan-workflow-draft-api-binding-edit.js';
|
|
10
|
+
export { WorkflowDraftApiBindingEditPlanningError } from './draft/workflow-draft-api-binding-edit-planning-error.js';
|
|
11
|
+
export { planWorkflowDraftConnectionEdit } from './draft/plan-workflow-draft-connection-edit.js';
|
|
12
|
+
export { WorkflowDraftConnectionEditPlanningError } from './draft/workflow-draft-connection-edit-planning-error.js';
|
|
13
|
+
export { selectWorkflowDraftNativeParameterEditTargets } from './draft/select-workflow-draft-native-parameter-edit-targets.js';
|
|
14
|
+
export { generateWorkflowDraftNativeParameterEdits } from './draft/generate-workflow-draft-native-parameter-edits.js';
|
|
15
|
+
export { WorkflowDraftNativeParameterEditPlanningError } from './draft/workflow-draft-native-parameter-edit-planning-error.js';
|
|
16
|
+
export { planWorkflowDraftNativeReferenceRepair } from './draft/plan-workflow-draft-native-reference-repair.js';
|
|
17
|
+
export { WorkflowDraftNativeReferenceRepairPlanningError } from './draft/workflow-draft-native-reference-repair-planning-error.js';
|
|
18
|
+
export { generateWorkflowDraftNativeNodeAddition } from './draft/generate-workflow-draft-native-node-addition.js';
|
|
19
|
+
export { planWorkflowDraftNativeDependencies } from './draft/plan-workflow-draft-native-dependencies.js';
|
|
20
|
+
export { selectWorkflowDraftNativeNodeParameterOwnership } from './draft/select-workflow-draft-native-node-parameter-ownership.js';
|
|
21
|
+
export { WorkflowDraftNativeNodeAdditionPlanningError } from './draft/workflow-draft-native-node-addition-planning-error.js';
|
|
22
|
+
export { selectWorkflowDraftApiBindingInputs } from './draft/select-workflow-draft-api-binding-inputs.js';
|
|
23
|
+
export { planWorkflowDraftApiCallBindings } from './draft/plan-workflow-draft-api-call-bindings.js';
|
|
24
|
+
export { generateWorkflowDraftApiCallArguments } from './draft/generate-workflow-draft-api-call-arguments.js';
|
|
25
|
+
export { WorkflowDraftApiCallPlanningError } from './draft/workflow-draft-api-call-planning-error.js';
|
|
26
|
+
export { generateApiArguments } from './arguments/generate-api-arguments.js';
|
|
27
|
+
export { extractApiInputAnswers } from './arguments/extract-api-input-answers.js';
|
|
28
|
+
export { analyzeApiInputAnswers } from './arguments/analyze-api-input-answers.js';
|
|
29
|
+
export { selectApiRequestMediaType } from './arguments/select-api-request-media-type.js';
|
|
30
|
+
export { analyzeApiRequestMediaType } from './arguments/analyze-api-request-media-type.js';
|
|
31
|
+
export { planWorkflowGraph } from './workflow/plan-workflow-graph.js';
|
|
32
|
+
export { WorkflowGraphPlanningError } from './workflow/workflow-graph-planning-error.js';
|
|
33
|
+
export { planApiBindings } from './bindings/plan-api-bindings.js';
|
|
34
|
+
export { planReviewableWorkflowGraph } from './workflow/plan-reviewable-workflow-graph.js';
|
|
35
|
+
export { ReviewableWorkflowGraphPlanningError } from './workflow/reviewable-workflow-graph-planning-error.js';
|
|
36
|
+
export { planNativeNodes } from './workflow/plan-native-nodes.js';
|
|
37
|
+
export { selectNativeNodeInstances } from './workflow/select-native-node-instances.js';
|
|
38
|
+
export { generateNativeNodeParameters } from './workflow/generate-native-node-parameters.js';
|
|
39
|
+
export { NativeNodePlanningError } from './workflow/native-node-planning-error.js';
|
|
40
|
+
export { planWorkflowConnections } from './workflow/plan-workflow-connections.js';
|
|
41
|
+
export { orchestrateWorkflow } from './workflow/orchestrate-workflow.js';
|
|
42
|
+
export { planWorkflowDraftClarificationScopes } from './draft/plan-workflow-draft-clarification-scopes.js';
|
|
43
|
+
export { WorkflowDraftClarificationScopePlanningError } from './draft/workflow-draft-clarification-scope-planning-error.js';
|
|
44
|
+
export { suggestWorkflowReviewFollowUps } from './review/suggest-workflow-review-follow-ups.js';
|
|
45
|
+
export { WorkflowReviewSuggestionPlanningError } from './review/workflow-review-suggestion-planning-error.js';
|
|
46
|
+
export { planNativeInstanceDependencies } from './workflow/plan-native-instance-dependencies.js';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { WorkflowClarificationRound } from '@openapi-flow/core';
|
|
2
|
+
import type { ClarifyWorkflowRequirementsInput } from '../types/workflow-clarification.js';
|
|
3
|
+
/** One bounded proposal call. Question IDs, sources and reply handling belong to core. */
|
|
4
|
+
export declare function clarifyWorkflowRequirements(input: ClarifyWorkflowRequirementsInput): Promise<WorkflowClarificationRound>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { HumanMessage, SystemMessage } from '@langchain/core/messages';
|
|
2
|
+
import { createWorkflowClarificationRound, describeWorkflowPlanningContext, resolveWorkflowClarificationOptions, } from '@openapi-flow/core';
|
|
3
|
+
import { createWorkflowRequirementsSchema } from '../schemas/workflow-requirements-schema.js';
|
|
4
|
+
import { serializeWorkflowRequirementsSchema } from '../schemas/serialize-workflow-requirements-schema.js';
|
|
5
|
+
import { workflowRequirementsPrompt } from '../prompts/workflow-requirements-prompt.js';
|
|
6
|
+
import { workflowUserActionEvidencePrompt } from '../prompts/workflow-user-action-evidence-prompt.js';
|
|
7
|
+
import { parseStructuredOutput } from '../legacy/planning/parse-structured-output.js';
|
|
8
|
+
import { resolveWorkflowRequirementsEvidence } from './resolve-workflow-requirements-evidence.js';
|
|
9
|
+
/** One bounded proposal call. Question IDs, sources and reply handling belong to core. */
|
|
10
|
+
export async function clarifyWorkflowRequirements(input) {
|
|
11
|
+
if (!input.model || typeof input.model.withStructuredOutput !== 'function')
|
|
12
|
+
throw new Error('clarifyWorkflowRequirements.model must support structured output');
|
|
13
|
+
const context = describeWorkflowPlanningContext(input.context);
|
|
14
|
+
if (input.backgroundMessages !== undefined) {
|
|
15
|
+
if (!Array.isArray(input.backgroundMessages))
|
|
16
|
+
throw new Error('clarifyWorkflowRequirements.backgroundMessages must be an array');
|
|
17
|
+
if (input.backgroundMessages.length)
|
|
18
|
+
describeWorkflowPlanningContext({ messages: input.backgroundMessages });
|
|
19
|
+
}
|
|
20
|
+
const options = resolveWorkflowClarificationOptions(input.options);
|
|
21
|
+
const candidates = context.operations.map((operation, index) => ({
|
|
22
|
+
candidateId: `candidate-${index + 1}`,
|
|
23
|
+
operation,
|
|
24
|
+
}));
|
|
25
|
+
const schema = createWorkflowRequirementsSchema(input.limits, options, context, candidates);
|
|
26
|
+
const output = await input.model
|
|
27
|
+
.withStructuredOutput(serializeWorkflowRequirementsSchema(schema), {
|
|
28
|
+
name: 'clarify_workflow_requirements',
|
|
29
|
+
method: 'jsonSchema',
|
|
30
|
+
strict: true,
|
|
31
|
+
})
|
|
32
|
+
.invoke([
|
|
33
|
+
new SystemMessage(workflowRequirementsPrompt + '\n' + workflowUserActionEvidencePrompt),
|
|
34
|
+
new HumanMessage(JSON.stringify({
|
|
35
|
+
messages: context.messages,
|
|
36
|
+
...(input.backgroundMessages === undefined
|
|
37
|
+
? {}
|
|
38
|
+
: { backgroundMessages: input.backgroundMessages }),
|
|
39
|
+
entrypoint: context.entrypoint,
|
|
40
|
+
candidates,
|
|
41
|
+
capabilities: context.capabilities,
|
|
42
|
+
limits: input.limits,
|
|
43
|
+
options,
|
|
44
|
+
})),
|
|
45
|
+
]);
|
|
46
|
+
const proposed = parseStructuredOutput(schema, output, 'model workflow requirements');
|
|
47
|
+
return createWorkflowClarificationRound({
|
|
48
|
+
context: input.context,
|
|
49
|
+
limits: input.limits,
|
|
50
|
+
options,
|
|
51
|
+
proposal: resolveWorkflowRequirementsEvidence(proposed, candidates),
|
|
52
|
+
});
|
|
53
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { WorkflowRequirementsProposal } from '@openapi-flow/core';
|
|
2
|
+
import type { WorkflowClarificationOasCandidate, WorkflowRequirementsModelOutput } from '../types/workflow-clarification.js';
|
|
3
|
+
/** Candidate identity is code-owned, never copied from model-supplied OAS keys. */
|
|
4
|
+
export declare function resolveWorkflowRequirementsEvidence(proposal: WorkflowRequirementsModelOutput, candidates: WorkflowClarificationOasCandidate[]): WorkflowRequirementsProposal;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/** Candidate identity is code-owned, never copied from model-supplied OAS keys. */
|
|
2
|
+
export function resolveWorkflowRequirementsEvidence(proposal, candidates) {
|
|
3
|
+
function evidence(item) {
|
|
4
|
+
if (item.kind !== 'oas')
|
|
5
|
+
return structuredClone(item);
|
|
6
|
+
const candidate = candidates.find((candidate) => candidate.candidateId === item.candidateId);
|
|
7
|
+
if (!candidate)
|
|
8
|
+
throw new Error(`Unknown clarification OAS candidate ${item.candidateId}`);
|
|
9
|
+
return {
|
|
10
|
+
kind: 'oas',
|
|
11
|
+
operation: structuredClone(candidate.operation.key),
|
|
12
|
+
// This stage cites a complete supplied operation, not a model-built path.
|
|
13
|
+
pointer: '',
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function explanation(value) {
|
|
17
|
+
return value === undefined
|
|
18
|
+
? {}
|
|
19
|
+
: {
|
|
20
|
+
explanation: {
|
|
21
|
+
reason: value.reason,
|
|
22
|
+
evidence: value.evidence.map(evidence),
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
statements: proposal.statements.map((statement) => ({
|
|
28
|
+
text: statement.text,
|
|
29
|
+
sources: structuredClone(statement.sources),
|
|
30
|
+
...explanation(statement.explanation),
|
|
31
|
+
})),
|
|
32
|
+
categories: proposal.categories.map((category) => ({
|
|
33
|
+
title: category.title,
|
|
34
|
+
...explanation(category.explanation),
|
|
35
|
+
questions: category.questions.map((question) => ({
|
|
36
|
+
message: question.message,
|
|
37
|
+
...explanation(question.explanation),
|
|
38
|
+
answer: question.answer.kind === 'text'
|
|
39
|
+
? question.answer
|
|
40
|
+
: {
|
|
41
|
+
kind: question.answer.kind,
|
|
42
|
+
choices: question.answer.choices.map((choice) => ({
|
|
43
|
+
label: choice.label,
|
|
44
|
+
...explanation(choice.explanation),
|
|
45
|
+
})),
|
|
46
|
+
},
|
|
47
|
+
})),
|
|
48
|
+
})),
|
|
49
|
+
...(proposal.suggestions === undefined
|
|
50
|
+
? {}
|
|
51
|
+
: {
|
|
52
|
+
suggestions: proposal.suggestions.map((suggestion) => ({
|
|
53
|
+
text: suggestion.text,
|
|
54
|
+
...explanation(suggestion.explanation),
|
|
55
|
+
})),
|
|
56
|
+
}),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { WorkflowReviewSuggestions } from '@openapi-flow/core';
|
|
2
|
+
import type { SuggestWorkflowReviewFollowUpsInput } from '../types/workflow-review-suggestions.js';
|
|
3
|
+
/** One fresh bounded call. An unselected suggestion never becomes intent or an executable edit. */
|
|
4
|
+
export declare function suggestWorkflowReviewFollowUps(input: SuggestWorkflowReviewFollowUpsInput): Promise<WorkflowReviewSuggestions>;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { HumanMessage, SystemMessage } from '@langchain/core/messages';
|
|
2
|
+
import { createWorkflowReviewSuggestions, describeWorkflowReviewSuggestions, } from '@openapi-flow/core';
|
|
3
|
+
import { workflowReviewSuggestionsPrompt } from '../prompts/workflow-review-suggestions-prompt.js';
|
|
4
|
+
import { createWorkflowReviewSuggestionsSchema } from '../schemas/workflow-review-suggestions-schema.js';
|
|
5
|
+
import { serializeStructuredOutputSchema } from '../schemas/serialize-structured-output-schema.js';
|
|
6
|
+
import { parseStructuredOutput } from '../legacy/planning/parse-structured-output.js';
|
|
7
|
+
import { WorkflowReviewSuggestionPlanningError } from './workflow-review-suggestion-planning-error.js';
|
|
8
|
+
/** One fresh bounded call. An unselected suggestion never becomes intent or an executable edit. */
|
|
9
|
+
export async function suggestWorkflowReviewFollowUps(input) {
|
|
10
|
+
const description = describeWorkflowReviewSuggestions(input);
|
|
11
|
+
if (!input.model || typeof input.model.withStructuredOutput !== 'function')
|
|
12
|
+
throw new Error('suggestWorkflowReviewFollowUps.model must support structured output');
|
|
13
|
+
const candidates = description.context.operations.map((operation, index) => ({
|
|
14
|
+
candidateId: `candidate-${index + 1}`,
|
|
15
|
+
operation,
|
|
16
|
+
}));
|
|
17
|
+
const schema = createWorkflowReviewSuggestionsSchema(description, candidates.map((candidate) => candidate.candidateId));
|
|
18
|
+
const output = await input.model
|
|
19
|
+
.withStructuredOutput(serializeStructuredOutputSchema(schema, 'draft-7', 'input'), {
|
|
20
|
+
name: 'suggest_workflow_review_follow_ups',
|
|
21
|
+
method: 'jsonSchema',
|
|
22
|
+
strict: true,
|
|
23
|
+
})
|
|
24
|
+
.invoke([
|
|
25
|
+
new SystemMessage(workflowReviewSuggestionsPrompt),
|
|
26
|
+
new HumanMessage(JSON.stringify({
|
|
27
|
+
boundary: {
|
|
28
|
+
kind: description.boundary.kind,
|
|
29
|
+
questions: description.boundary.questions,
|
|
30
|
+
data: description.boundary.data,
|
|
31
|
+
},
|
|
32
|
+
messages: description.context.messages,
|
|
33
|
+
candidates: candidates.map((candidate) => ({
|
|
34
|
+
candidateId: candidate.candidateId,
|
|
35
|
+
method: candidate.operation.method,
|
|
36
|
+
path: candidate.operation.path,
|
|
37
|
+
summary: candidate.operation.operation.summary,
|
|
38
|
+
description: candidate.operation.operation.description,
|
|
39
|
+
tags: candidate.operation.operation.tags,
|
|
40
|
+
})),
|
|
41
|
+
capabilities: description.context.capabilities,
|
|
42
|
+
entrypoint: description.context.entrypoint,
|
|
43
|
+
limits: description.limits,
|
|
44
|
+
options: description.options,
|
|
45
|
+
})),
|
|
46
|
+
]);
|
|
47
|
+
let proposal;
|
|
48
|
+
try {
|
|
49
|
+
proposal = parseStructuredOutput(schema, output, 'workflow review follow-ups');
|
|
50
|
+
}
|
|
51
|
+
catch (cause) {
|
|
52
|
+
if (!(cause instanceof Error))
|
|
53
|
+
throw cause;
|
|
54
|
+
throw new WorkflowReviewSuggestionPlanningError({ stage: 'proposal-schema', output }, cause);
|
|
55
|
+
}
|
|
56
|
+
try {
|
|
57
|
+
if (description.fingerprint !==
|
|
58
|
+
describeWorkflowReviewSuggestions(input).fingerprint)
|
|
59
|
+
throw new Error('Review sources changed during model invocation; no automatic rebase');
|
|
60
|
+
const resolve = (source) => {
|
|
61
|
+
if (source.kind !== 'oas')
|
|
62
|
+
return structuredClone(source);
|
|
63
|
+
const candidate = candidates.find((item) => item.candidateId === source.candidateId);
|
|
64
|
+
if (!candidate)
|
|
65
|
+
throw new Error(`Unknown review OAS candidate ${source.candidateId}`);
|
|
66
|
+
return {
|
|
67
|
+
kind: 'oas',
|
|
68
|
+
operation: structuredClone(candidate.operation.key),
|
|
69
|
+
pointer: '',
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
return createWorkflowReviewSuggestions({
|
|
73
|
+
...input,
|
|
74
|
+
proposal: {
|
|
75
|
+
suggestions: proposal.suggestions.map((suggestion) => ({
|
|
76
|
+
...suggestion,
|
|
77
|
+
sources: suggestion.sources.map(resolve),
|
|
78
|
+
})),
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
catch (cause) {
|
|
83
|
+
if (!(cause instanceof Error))
|
|
84
|
+
throw cause;
|
|
85
|
+
throw new WorkflowReviewSuggestionPlanningError({ stage: 'source-validation', output }, cause);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { WorkflowReviewSuggestionPlanningFailure } from '../types/workflow-review-suggestions.js';
|
|
2
|
+
export declare class WorkflowReviewSuggestionPlanningError extends Error {
|
|
3
|
+
readonly failure: WorkflowReviewSuggestionPlanningFailure;
|
|
4
|
+
constructor(failure: WorkflowReviewSuggestionPlanningFailure, cause: Error);
|
|
5
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export class WorkflowReviewSuggestionPlanningError extends Error {
|
|
2
|
+
failure;
|
|
3
|
+
constructor(failure, cause) {
|
|
4
|
+
super(`Workflow review suggestions failed at ${failure.stage}: ${cause.message}`, { cause });
|
|
5
|
+
this.name = 'WorkflowReviewSuggestionPlanningError';
|
|
6
|
+
this.failure = failure;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { ApiBindingMaterial, NativeOutputContract } from '@openapi-flow/core';
|
|
3
|
+
import type { ApiBindingPlanOutput } from '../types/binding-planning.js';
|
|
4
|
+
export declare const apiBindingPlanningOptionsSchema: z.ZodObject<{
|
|
5
|
+
includeExplanations: z.ZodOptional<z.ZodBoolean>;
|
|
6
|
+
}, z.core.$strict>;
|
|
7
|
+
export declare const apiBindingCallReasonSchema: z.ZodString;
|
|
8
|
+
export declare function createApiBindingPlanSchema(materials: ApiBindingMaterial[], nativeOutputs?: NativeOutputContract[], includeExplanations?: boolean): z.ZodType<ApiBindingPlanOutput>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const apiBindingPlanningOptionsSchema = z.strictObject({
|
|
3
|
+
includeExplanations: z.boolean().optional(),
|
|
4
|
+
});
|
|
5
|
+
export const apiBindingCallReasonSchema = z
|
|
6
|
+
.string()
|
|
7
|
+
.min(1)
|
|
8
|
+
.refine((value) => value.trim().length > 0)
|
|
9
|
+
.describe("Brief user-facing reason in the scenario language for this call's selected data bindings or decision that no binding is requested. Acknowledge any declared binding gaps for this call. This is not a value-generation, status-expectation or control-flow decision. Code attaches the exact supplied scenario, roles, OAS and native source contracts. Do not generate evidence, quotes, schemas or private chain-of-thought.");
|
|
10
|
+
export function createApiBindingPlanSchema(materials, nativeOutputs = [], includeExplanations = false) {
|
|
11
|
+
z.boolean().parse(includeExplanations);
|
|
12
|
+
if (!materials.length)
|
|
13
|
+
throw new Error('binding materials must not be empty');
|
|
14
|
+
const ids = materials.map((item) => item.callId);
|
|
15
|
+
const sourceIds = [...ids, ...nativeOutputs.map((item) => item.nodeId)];
|
|
16
|
+
if (new Set(sourceIds).size !== sourceIds.length ||
|
|
17
|
+
sourceIds.some((id) => !id.trim()))
|
|
18
|
+
throw new Error('binding sources require unique non-empty node IDs');
|
|
19
|
+
if (new Set(ids).size !== ids.length || ids.some((id) => !id.trim()))
|
|
20
|
+
throw new Error('binding materials require unique non-empty callIds');
|
|
21
|
+
return z.strictObject({
|
|
22
|
+
calls: z.array(z.strictObject({
|
|
23
|
+
...(includeExplanations ? { reason: apiBindingCallReasonSchema } : {}),
|
|
24
|
+
callId: z
|
|
25
|
+
.enum(ids)
|
|
26
|
+
.describe('Exact API call identity. Include each call once, including calls without bindings.'),
|
|
27
|
+
bindings: z
|
|
28
|
+
.array(z.strictObject({
|
|
29
|
+
kind: z.literal('node-output'),
|
|
30
|
+
targetPointer: z
|
|
31
|
+
.string()
|
|
32
|
+
.min(1)
|
|
33
|
+
.describe('RFC 6901 request pointer: /path/id, /query/name, /body or a nested body field. Never a JavaScript expression.'),
|
|
34
|
+
sourceNodeId: z
|
|
35
|
+
.enum(sourceIds)
|
|
36
|
+
.describe('Declared API or native node producing the actual value, not merely the previous array element.'),
|
|
37
|
+
sourcePointer: z
|
|
38
|
+
.string()
|
|
39
|
+
.describe('RFC 6901 pointer into an API response BODY or a declared native JSON output. Empty string means the entire value. Use exact schema-declared responsePointerCatalog paths where applicable, without transport-envelope prefixes. Dynamic paths require scenario and contract evidence; the catalog is not a whitelist or a runtime existence guarantee.'),
|
|
40
|
+
}))
|
|
41
|
+
.describe('Only scenario-requested response-to-request dependencies. Return [] when no dependency is requested. Independent literals, supplied or missing, are handled by the later argument-generation stage and are not binding gaps.'),
|
|
42
|
+
})),
|
|
43
|
+
gaps: z
|
|
44
|
+
.array(z.strictObject({
|
|
45
|
+
callId: z
|
|
46
|
+
.enum(ids)
|
|
47
|
+
.describe('Exact selected API whose explicitly requested data dependency cannot be represented. An independent literal input does not make this call blocked.'),
|
|
48
|
+
targetPointer: z
|
|
49
|
+
.string()
|
|
50
|
+
.min(1)
|
|
51
|
+
.describe('RFC 6901 pointer to the affected request input declared by this API OAS.'),
|
|
52
|
+
description: z
|
|
53
|
+
.string()
|
|
54
|
+
.min(1)
|
|
55
|
+
.describe('Explain the requested dependency and why its producer, source contract or required transformation prevents a binding. Never describe a successful no-binding decision or a missing independent literal here.'),
|
|
56
|
+
}))
|
|
57
|
+
.describe('Blocking failures of explicitly requested response-to-request dependencies only. Return [] if there are no such failures, including when all inputs are independent literals. Not informational notes, missing independent literals, missing API capabilities, control flow or response assertions. Those belong to other planning stages. Do not invent values or APIs.'),
|
|
58
|
+
});
|
|
59
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { ApiInputRequirement, ApiInputSourceCatalog } from '@openapi-flow/core';
|
|
3
|
+
export declare const apiInputAnswerExplanationOptionsSchema: z.ZodObject<{
|
|
4
|
+
includeExplanations: z.ZodOptional<z.ZodBoolean>;
|
|
5
|
+
}, z.core.$strict>;
|
|
6
|
+
/** Values and unanswered IDs are deliberately not model-owned output fields. */
|
|
7
|
+
export declare function createApiInputAnswerSourceSchema(requirements: ApiInputRequirement[], catalog: ApiInputSourceCatalog, includeExplanations?: boolean): z.ZodObject<{
|
|
8
|
+
reason?: z.ZodString | undefined;
|
|
9
|
+
answers: z.ZodArray<z.ZodObject<{
|
|
10
|
+
reason?: z.ZodString | undefined;
|
|
11
|
+
requirementId: z.ZodEnum<{
|
|
12
|
+
[x: string]: string;
|
|
13
|
+
}>;
|
|
14
|
+
source: z.ZodUnion<z.ZodType<import("@openapi-flow/core").ApiInputJsonSourceSelection | import("@openapi-flow/core").ApiInputTextSourceSelection, unknown, z.core.$ZodTypeInternals<import("@openapi-flow/core").ApiInputJsonSourceSelection | import("@openapi-flow/core").ApiInputTextSourceSelection, unknown>>[]>;
|
|
15
|
+
}, z.core.$strict>>;
|
|
16
|
+
}, z.core.$strict>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createApiInputSourceSelectionSchema } from '@openapi-flow/core';
|
|
3
|
+
export const apiInputAnswerExplanationOptionsSchema = z.strictObject({
|
|
4
|
+
includeExplanations: z.boolean().optional(),
|
|
5
|
+
});
|
|
6
|
+
/** Values and unanswered IDs are deliberately not model-owned output fields. */
|
|
7
|
+
export function createApiInputAnswerSourceSchema(requirements, catalog, includeExplanations = false) {
|
|
8
|
+
const ids = requirements.map((item) => item.id);
|
|
9
|
+
if (!ids.length || new Set(ids).size !== ids.length)
|
|
10
|
+
throw new Error('Answer source schema requires distinct pending requirements');
|
|
11
|
+
const reason = z
|
|
12
|
+
.string()
|
|
13
|
+
.min(1)
|
|
14
|
+
.describe("A brief user-facing reason in the user's language, grounded only in this reply and the supplied pending questions. Instruction/schema language does not set the user's language. Never translate input values, identifiers or original source spans. Not a hidden reasoning trace or a claim that code validation passed.");
|
|
15
|
+
const answer = z.strictObject({
|
|
16
|
+
requirementId: z
|
|
17
|
+
.enum(ids)
|
|
18
|
+
.describe('The offered pending question answered by this exact source span.'),
|
|
19
|
+
source: createApiInputSourceSelectionSchema(catalog),
|
|
20
|
+
...(includeExplanations ? { reason } : {}),
|
|
21
|
+
});
|
|
22
|
+
return z.strictObject({
|
|
23
|
+
answers: z
|
|
24
|
+
.array(answer)
|
|
25
|
+
.describe('Select each answered pending question at most once. Return [] when the reply gives no complete requested value. Do not return a value field or fabricate missing inputs.'),
|
|
26
|
+
...(includeExplanations ? { reason } : {}),
|
|
27
|
+
});
|
|
28
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { ApiArgumentGenerationContract } from '@openapi-flow/core';
|
|
3
|
+
import type { ApiLiteralGenerationOutputSchema } from '../types/argument-generation.js';
|
|
4
|
+
export declare const apiLiteralGenerationOptionsSchema: z.ZodObject<{
|
|
5
|
+
includeExplanations: z.ZodOptional<z.ZodBoolean>;
|
|
6
|
+
}, z.core.$strict>;
|
|
7
|
+
export declare const apiLiteralGenerationReasonSchema: z.ZodObject<{
|
|
8
|
+
reason: z.ZodString;
|
|
9
|
+
}, z.core.$strict>;
|
|
10
|
+
/** The core values schema is unchanged; only optional human-readable attribution is added. */
|
|
11
|
+
export declare function createApiLiteralGenerationOutputSchema(contract: ApiArgumentGenerationContract, includeExplanations: boolean): ApiLiteralGenerationOutputSchema;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const apiLiteralGenerationOptionsSchema = z.strictObject({
|
|
3
|
+
includeExplanations: z.boolean().optional(),
|
|
4
|
+
});
|
|
5
|
+
export const apiLiteralGenerationReasonSchema = z.strictObject({
|
|
6
|
+
reason: z
|
|
7
|
+
.string()
|
|
8
|
+
.min(1)
|
|
9
|
+
.refine((value) => value.trim().length > 0)
|
|
10
|
+
.describe('Brief user-facing reason in the scenario language for these proposed literals or their deliberate omission. It applies only to values in this proposal, not confirmed inputs or preceding-node bindings. Code attaches the original scenario, optional call role and the actual projected literal input contract. Do not generate evidence, source quotes, OAS schemas, metadata, missing-input reports or private chain-of-thought.'),
|
|
11
|
+
});
|
|
12
|
+
/** The core values schema is unchanged; only optional human-readable attribution is added. */
|
|
13
|
+
export function createApiLiteralGenerationOutputSchema(contract, includeExplanations) {
|
|
14
|
+
z.boolean().parse(includeExplanations);
|
|
15
|
+
return includeExplanations && contract.hasLiteralInputs
|
|
16
|
+
? contract.schema.extend({
|
|
17
|
+
explanation: apiLiteralGenerationReasonSchema,
|
|
18
|
+
})
|
|
19
|
+
: contract.schema;
|
|
20
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export function createApiRequestMediaTypeSchema(mediaTypes, includeExplanations = false) {
|
|
3
|
+
z.boolean().parse(includeExplanations);
|
|
4
|
+
if (mediaTypes.length < 2)
|
|
5
|
+
throw new Error('request media selection requires multiple declared media types');
|
|
6
|
+
const schema = z.strictObject({
|
|
7
|
+
requestMediaType: z
|
|
8
|
+
.enum(mediaTypes)
|
|
9
|
+
.nullable()
|
|
10
|
+
.describe('Exact OAS requestBody.content key matching an explicitly requested format, or null when the scenario leaves the format unspecified or ambiguous so code can apply the documented default. This is the request Content-Type, not the response format.'),
|
|
11
|
+
});
|
|
12
|
+
return includeExplanations
|
|
13
|
+
? schema.extend({
|
|
14
|
+
explanation: z.strictObject({
|
|
15
|
+
reason: z
|
|
16
|
+
.string()
|
|
17
|
+
.min(1)
|
|
18
|
+
.refine((value) => value.trim().length > 0)
|
|
19
|
+
.describe('Short user-facing reason in the scenario language for the explicit format match, or for returning null because the format is unspecified/ambiguous. Explain the assessment only; code chooses any documented default and attaches the exact scenario and OAS requestBody. Do not generate quotations, source identities, expected responses or private chain-of-thought.'),
|
|
20
|
+
}),
|
|
21
|
+
})
|
|
22
|
+
: schema;
|
|
23
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare function createApiSelectionAnalysisSchema(candidateIds: string[], includeExplanations?: boolean): z.ZodObject<{
|
|
3
|
+
operations: z.ZodArray<z.ZodObject<{
|
|
4
|
+
candidateId: z.ZodEnum<{
|
|
5
|
+
[x: string]: string;
|
|
6
|
+
}>;
|
|
7
|
+
purpose: z.ZodString;
|
|
8
|
+
}, z.core.$strict> | z.ZodObject<{
|
|
9
|
+
candidateId: z.ZodEnum<{
|
|
10
|
+
[x: string]: string;
|
|
11
|
+
}>;
|
|
12
|
+
purpose: z.ZodString;
|
|
13
|
+
explanation: z.ZodObject<{
|
|
14
|
+
reason: z.ZodString;
|
|
15
|
+
}, z.core.$strict>;
|
|
16
|
+
}, z.core.$strict>>;
|
|
17
|
+
gaps: z.ZodArray<z.ZodObject<{
|
|
18
|
+
description: z.ZodString;
|
|
19
|
+
}, z.core.$strict> | z.ZodObject<{
|
|
20
|
+
description: z.ZodString;
|
|
21
|
+
explanation: z.ZodObject<{
|
|
22
|
+
reason: z.ZodString;
|
|
23
|
+
}, z.core.$strict>;
|
|
24
|
+
}, z.core.$strict>>;
|
|
25
|
+
questions: z.ZodArray<z.ZodObject<{
|
|
26
|
+
message: z.ZodString;
|
|
27
|
+
purpose: z.ZodString;
|
|
28
|
+
candidateIds: z.ZodArray<z.ZodEnum<{
|
|
29
|
+
[x: string]: string;
|
|
30
|
+
}>>;
|
|
31
|
+
}, z.core.$strict> | z.ZodObject<{
|
|
32
|
+
message: z.ZodString;
|
|
33
|
+
purpose: z.ZodString;
|
|
34
|
+
candidateIds: z.ZodArray<z.ZodEnum<{
|
|
35
|
+
[x: string]: string;
|
|
36
|
+
}>>;
|
|
37
|
+
explanation: z.ZodObject<{
|
|
38
|
+
reason: z.ZodString;
|
|
39
|
+
}, z.core.$strict>;
|
|
40
|
+
}, z.core.$strict>>;
|
|
41
|
+
}, z.core.$strict>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createApiSelectionSchema } from './api-selection-schema.js';
|
|
3
|
+
import { withApiSelectionExplanation } from './with-api-selection-explanation.js';
|
|
4
|
+
export function createApiSelectionAnalysisSchema(candidateIds, includeExplanations = false) {
|
|
5
|
+
return createApiSelectionSchema(candidateIds, includeExplanations).extend({
|
|
6
|
+
questions: z
|
|
7
|
+
.array(withApiSelectionExplanation(z.strictObject({
|
|
8
|
+
message: z
|
|
9
|
+
.string()
|
|
10
|
+
.min(1)
|
|
11
|
+
.describe('Ask only a consequential unresolved API-role choice. Do not ask for request values before reading full contracts.'),
|
|
12
|
+
purpose: z
|
|
13
|
+
.string()
|
|
14
|
+
.min(1)
|
|
15
|
+
.describe('The one user-requested role that will be fulfilled by exactly one offered candidate.'),
|
|
16
|
+
candidateIds: z
|
|
17
|
+
.array(z.enum(candidateIds))
|
|
18
|
+
.min(2)
|
|
19
|
+
.describe('Distinct supplied alternatives for this role, not API calls that should all run.'),
|
|
20
|
+
}), includeExplanations))
|
|
21
|
+
.describe('Empty when the requested API scope is clear. Multiple available APIs alone is not ambiguity. Never expand a short request into unrelated actions.'),
|
|
22
|
+
});
|
|
23
|
+
}
|