@openapi-flow/core 0.3.10 → 0.3.12
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/dist/arguments/clarification/api-input-requirement-dialect.d.ts +4 -0
- package/dist/arguments/clarification/api-input-requirement-dialect.js +8 -0
- package/dist/arguments/clarification/extraction/capture-api-input-answer-context.js +2 -3
- package/dist/arguments/clarification/extraction/create-api-input-answer-extraction-record.js +9 -2
- package/dist/arguments/clarification/extraction/resolve-api-input-answer-interpretations.d.ts +3 -0
- package/dist/arguments/clarification/extraction/resolve-api-input-answer-interpretations.js +52 -0
- package/dist/arguments/clarification/extraction/resolve-api-input-answer-sources.js +3 -3
- package/dist/arguments/clarification/extraction/resolve-api-input-source-selections.js +1 -0
- package/dist/arguments/clarification/extraction/validate-api-input-answer-analysis.d.ts +3 -0
- package/dist/arguments/clarification/extraction/validate-api-input-answer-analysis.js +56 -0
- package/dist/arguments/clarification/extraction/validate-api-input-answer-extraction-record.js +4 -0
- package/dist/arguments/enum/describe-api-argument-enum-context.d.ts +4 -0
- package/dist/arguments/enum/describe-api-argument-enum-context.js +41 -0
- package/dist/arguments/enum/describe-api-input-enum-answer-choices.d.ts +4 -0
- package/dist/arguments/enum/describe-api-input-enum-answer-choices.js +23 -0
- package/dist/arguments/enum/expand-requested-enum-requirements.d.ts +4 -0
- package/dist/arguments/enum/expand-requested-enum-requirements.js +45 -0
- package/dist/arguments/enum/list-api-input-enum-candidates.d.ts +3 -0
- package/dist/arguments/enum/list-api-input-enum-candidates.js +73 -0
- package/dist/arguments/enum/resolve-api-argument-enum-interpretation.d.ts +3 -0
- package/dist/arguments/enum/resolve-api-argument-enum-interpretation.js +26 -0
- package/dist/arguments/sources/resolve-api-literal-proposal-sources.d.ts +3 -0
- package/dist/arguments/sources/resolve-api-literal-proposal-sources.js +58 -0
- package/dist/draft/edits/api/describe-workflow-draft-api-enum-choices.d.ts +3 -0
- package/dist/draft/edits/api/describe-workflow-draft-api-enum-choices.js +70 -0
- package/dist/draft/edits/api/resolve-workflow-draft-api-call-arguments.js +9 -5
- package/dist/draft/edits/api/resolve-workflow-draft-api-enum-selections.d.ts +4 -0
- package/dist/draft/edits/api/resolve-workflow-draft-api-enum-selections.js +38 -0
- package/dist/draft/edits/api/resolve-workflow-draft-api-literal-sources.js +9 -56
- package/dist/draft/edits/enum/verify-workflow-draft-api-enum-selection.d.ts +3 -0
- package/dist/draft/edits/enum/verify-workflow-draft-api-enum-selection.js +23 -0
- package/dist/draft/edits/inputs/describe-workflow-draft-api-input-edit-answer-requirements.d.ts +4 -0
- package/dist/draft/edits/inputs/describe-workflow-draft-api-input-edit-answer-requirements.js +30 -0
- package/dist/draft/edits/inputs/describe-workflow-draft-api-input-edit-enum-choices.d.ts +4 -0
- package/dist/draft/edits/inputs/describe-workflow-draft-api-input-edit-enum-choices.js +42 -0
- package/dist/draft/edits/inputs/resolve-workflow-draft-api-input-edit-reply.d.ts +3 -0
- package/dist/draft/edits/inputs/resolve-workflow-draft-api-input-edit-reply.js +24 -0
- package/dist/draft/edits/inputs/resolve-workflow-draft-api-input-edits.js +20 -0
- package/dist/public-api.d.ts +18 -0
- package/dist/public-api.js +13 -0
- package/dist/schemas/api-input-answer-extraction-schema.d.ts +16 -0
- package/dist/schemas/api-input-answer-extraction-schema.js +9 -0
- package/dist/schemas/api-input-enum-answer-selection-schema.d.ts +25 -0
- package/dist/schemas/api-input-enum-answer-selection-schema.js +11 -0
- package/dist/schemas/create-workflow-draft-api-input-edit-values-schema.js +11 -2
- package/dist/schemas/workflow-draft-api-enum-choice-schema.d.ts +5 -0
- package/dist/schemas/workflow-draft-api-enum-choice-schema.js +25 -0
- package/dist/schemas/workflow-draft-api-enum-selection-schema.d.ts +4 -0
- package/dist/schemas/workflow-draft-api-enum-selection-schema.js +14 -0
- package/dist/schemas/workflow-draft-api-input-edit-proposal-schema.js +3 -1
- package/dist/types/api-argument-enum.d.ts +23 -0
- package/dist/types/api-argument-enum.js +1 -0
- package/dist/types/api-arguments.d.ts +6 -0
- package/dist/types/api-clarification.d.ts +2 -0
- package/dist/types/api-input-answer-extraction.d.ts +11 -2
- package/dist/types/api-input-enum-answers.d.ts +25 -0
- package/dist/types/api-input-enum-answers.js +1 -0
- package/dist/types/api-input-enum.d.ts +26 -0
- package/dist/types/api-input-enum.js +1 -0
- package/dist/types/api-input-literal-source.d.ts +15 -0
- package/dist/types/workflow-draft-api-call-planning.d.ts +4 -0
- package/dist/types/workflow-draft-api-enum-selection.d.ts +39 -0
- package/dist/types/workflow-draft-api-enum-selection.js +1 -0
- package/dist/types/workflow-draft-api-input-edit.d.ts +15 -2
- package/dist/types/workflow-draft-api-literal-sources.d.ts +3 -9
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { describeWorkflowDraftApiEnumChoices } from '../draft/edits/api/describe-workflow-draft-api-enum-choices.js';
|
|
3
|
+
import { createWorkflowDraftApiEnumChoiceSchema } from './workflow-draft-api-enum-choice-schema.js';
|
|
4
|
+
/** The model selects IDs and explains intent; there is deliberately no value field. */
|
|
5
|
+
export function createWorkflowDraftApiEnumSelectionSchema(input) {
|
|
6
|
+
const { candidates } = describeWorkflowDraftApiEnumChoices(input);
|
|
7
|
+
if (!candidates.length)
|
|
8
|
+
return z.strictObject({ selections: z.array(z.never()).max(0) });
|
|
9
|
+
return z.strictObject({
|
|
10
|
+
selections: z
|
|
11
|
+
.array(createWorkflowDraftApiEnumChoiceSchema(candidates, input.context.messages.map((message) => message.id)))
|
|
12
|
+
.describe('Select only when the human request identifies the meaning. Empty means no supported interpretation; keep the existing input question. Never select a default just because it exists.'),
|
|
13
|
+
});
|
|
14
|
+
}
|
|
@@ -6,7 +6,9 @@ export function createWorkflowDraftApiInputEditProposalSchema(messageIds, includ
|
|
|
6
6
|
return z.strictObject({
|
|
7
7
|
targets: z
|
|
8
8
|
.array(z.strictObject({
|
|
9
|
-
kind: z
|
|
9
|
+
kind: z
|
|
10
|
+
.enum(['set', 'remove'])
|
|
11
|
+
.describe('set replaces a requested field, even when its new value is unknown and must be asked later. remove requires explicit withdrawal/deletion; asking which replacement to use is not removal.'),
|
|
10
12
|
pointer: z
|
|
11
13
|
.string()
|
|
12
14
|
.min(1)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ApiLiteralGenerationInput } from './api-literal-generation.js';
|
|
2
|
+
import type { ApiArgumentValues, ApiArgumentProposal } from './api-arguments.js';
|
|
3
|
+
import type { ApiInputAnswerAnalysis, ValidateApiInputAnswerAnalysisInput } from './api-input-answer-extraction.js';
|
|
4
|
+
import type { ApiLiteralProposalSource } from './api-input-literal-source.js';
|
|
5
|
+
import type { ApiInputRequirement } from './api-clarification.js';
|
|
6
|
+
export interface ApiArgumentEnumRequirementsInput extends ApiArgumentEnumContextInput {
|
|
7
|
+
requirements: ApiInputRequirement[];
|
|
8
|
+
values: ApiArgumentValues;
|
|
9
|
+
}
|
|
10
|
+
export interface ApiArgumentEnumContextInput extends ApiLiteralGenerationInput {
|
|
11
|
+
/** Original literal proposal, before confirmed inputs or semantic OAS values are merged. */
|
|
12
|
+
proposal: ApiArgumentProposal;
|
|
13
|
+
literalSources: ApiLiteralProposalSource[];
|
|
14
|
+
requestedInputs?: string[];
|
|
15
|
+
}
|
|
16
|
+
export interface ResolveApiArgumentEnumInterpretationInput extends ApiArgumentEnumContextInput {
|
|
17
|
+
analysis: ApiInputAnswerAnalysis;
|
|
18
|
+
}
|
|
19
|
+
export interface ApiArgumentEnumResolution {
|
|
20
|
+
values: ApiArgumentValues;
|
|
21
|
+
unresolvedInputs: string[];
|
|
22
|
+
interpretation: ValidateApiInputAnswerAnalysisInput;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ApiOperationContract } from './api-operation.js';
|
|
2
2
|
import type { ApiLiteralGenerationRecord } from './api-literal-generation.js';
|
|
3
|
+
import type { ValidateApiInputAnswerAnalysisInput } from './api-input-answer-extraction.js';
|
|
4
|
+
import type { VerifiedApiLiteralProposalSource } from './api-input-literal-source.js';
|
|
3
5
|
export type JsonValue = string | number | boolean | null | JsonValue[] | JsonValueObject;
|
|
4
6
|
export interface JsonValueObject {
|
|
5
7
|
[key: string]: JsonValue;
|
|
@@ -35,6 +37,10 @@ export interface ApiCallArguments extends ApiArgumentProposal {
|
|
|
35
37
|
requestMediaType?: string;
|
|
36
38
|
/** Optional immutable attribution of the original literal proposal, not final merged values. */
|
|
37
39
|
literalGeneration?: ApiLiteralGenerationRecord;
|
|
40
|
+
/** Opt-in interpretation of unresolved OAS enum inputs; never verbatim literal attribution. */
|
|
41
|
+
enumInterpretation?: ValidateApiInputAnswerAnalysisInput;
|
|
42
|
+
/** Code-verified coverage of the original literal proposal, excluding copied OAS values. */
|
|
43
|
+
literalSources?: VerifiedApiLiteralProposalSource[];
|
|
38
44
|
}
|
|
39
45
|
export interface ValidateApiArgumentsInput extends ApiArgumentsSchemaInput {
|
|
40
46
|
values: ApiArgumentValues;
|
|
@@ -23,6 +23,8 @@ export interface ApiInputRequirement {
|
|
|
23
23
|
targetPointer: string;
|
|
24
24
|
schema: JsonObject | boolean;
|
|
25
25
|
openapiVersion: string;
|
|
26
|
+
/** Present only when schema is an already-normalized OAS projection. Omission means raw source-version rules. */
|
|
27
|
+
schemaDialect?: 'draft-2020-12';
|
|
26
28
|
operationSummary?: string;
|
|
27
29
|
parameterDescription?: string;
|
|
28
30
|
message: string;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import type { ApiInputAnswer, ApiInputRequirement } from './api-clarification.js';
|
|
2
|
+
import type { ApiInputEnumAnswerSelection, ResolvedApiInputAnswerInterpretations } from './api-input-enum-answers.js';
|
|
2
3
|
export interface ApiInputAnswerContext {
|
|
3
4
|
reply: string;
|
|
4
5
|
requirements: ApiInputRequirement[];
|
|
6
|
+
/** Caller-supplied call role, separate from the quoted answer/value source. */
|
|
7
|
+
purpose?: string;
|
|
8
|
+
/** Allow semantic selection of original OAS enum values, never arbitrary generation. */
|
|
9
|
+
selectOasEnums?: boolean;
|
|
5
10
|
}
|
|
6
11
|
export interface ApiInputAnswerSource {
|
|
7
12
|
requirementId: string;
|
|
@@ -30,12 +35,13 @@ export interface ResolvedApiInputAnswerSources {
|
|
|
30
35
|
export interface ApiInputAnswerExtractionDecision {
|
|
31
36
|
reason: string;
|
|
32
37
|
answers: ExplainedApiInputAnswerSource[];
|
|
38
|
+
enumSelections?: ApiInputEnumAnswerSelection[];
|
|
33
39
|
}
|
|
34
40
|
export interface ApiInputAnswerExtractionRecord {
|
|
35
41
|
kind: 'model-extracted-api-input-answers';
|
|
36
42
|
decision: ApiInputAnswerExtractionDecision;
|
|
37
43
|
evidence: ApiInputAnswerContext;
|
|
38
|
-
verification:
|
|
44
|
+
verification: ResolvedApiInputAnswerInterpretations;
|
|
39
45
|
}
|
|
40
46
|
export interface CreateApiInputAnswerExtractionRecordInput extends ApiInputAnswerContext {
|
|
41
47
|
decision: ApiInputAnswerExtractionDecision;
|
|
@@ -43,7 +49,10 @@ export interface CreateApiInputAnswerExtractionRecordInput extends ApiInputAnswe
|
|
|
43
49
|
export interface ValidateApiInputAnswerExtractionRecordInput extends ApiInputAnswerContext {
|
|
44
50
|
record: ApiInputAnswerExtractionRecord;
|
|
45
51
|
}
|
|
46
|
-
export interface ApiInputAnswerAnalysis extends
|
|
52
|
+
export interface ApiInputAnswerAnalysis extends ResolvedApiInputAnswerInterpretations {
|
|
47
53
|
status: 'extracted' | 'no-pending-inputs' | 'empty-reply';
|
|
48
54
|
extraction?: ApiInputAnswerExtractionRecord;
|
|
49
55
|
}
|
|
56
|
+
export interface ValidateApiInputAnswerAnalysisInput extends ApiInputAnswerContext {
|
|
57
|
+
analysis: ApiInputAnswerAnalysis;
|
|
58
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ApiInputAnswerContext, ApiInputAnswerSource, ApiInputAnswerSourceLocation, ResolvedApiInputAnswerSources } from './api-input-answer-extraction.js';
|
|
2
|
+
import type { ApiInputEnumCandidate } from './api-input-enum.js';
|
|
3
|
+
import type { ApiInputLiteralSource } from './api-input-literal-source.js';
|
|
4
|
+
export interface ApiInputEnumAnswerChoice {
|
|
5
|
+
requirementId: string;
|
|
6
|
+
candidates: ApiInputEnumCandidate[];
|
|
7
|
+
}
|
|
8
|
+
/** Intent is a human quotation, not the value copied from the OAS. */
|
|
9
|
+
export interface ApiInputEnumAnswerSelection {
|
|
10
|
+
requirementId: string;
|
|
11
|
+
candidateId: string;
|
|
12
|
+
intent: ApiInputLiteralSource;
|
|
13
|
+
reason: string;
|
|
14
|
+
}
|
|
15
|
+
export interface VerifiedApiInputEnumAnswerSelection extends ApiInputEnumAnswerSelection {
|
|
16
|
+
candidate: ApiInputEnumCandidate;
|
|
17
|
+
occurrences: ApiInputAnswerSourceLocation[];
|
|
18
|
+
}
|
|
19
|
+
export interface ResolveApiInputAnswerInterpretationsInput extends ApiInputAnswerContext {
|
|
20
|
+
selections: ApiInputAnswerSource[];
|
|
21
|
+
enumSelections?: ApiInputEnumAnswerSelection[];
|
|
22
|
+
}
|
|
23
|
+
export interface ResolvedApiInputAnswerInterpretations extends ResolvedApiInputAnswerSources {
|
|
24
|
+
enumSelections?: VerifiedApiInputEnumAnswerSelection[];
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ApiOperationKey } from './api-catalog.js';
|
|
2
|
+
import type { JsonValue } from './api-arguments.js';
|
|
3
|
+
import type { ApiBindingMaterial, BindingSchema } from './api-bindings.js';
|
|
4
|
+
import type { ApiInputRequirement } from './api-clarification.js';
|
|
5
|
+
import type { SchemaResourceContext } from './schema-resource.js';
|
|
6
|
+
export interface ApiInputEnumCandidate {
|
|
7
|
+
id: string;
|
|
8
|
+
callId: string;
|
|
9
|
+
operation: ApiOperationKey;
|
|
10
|
+
targetPointer: string;
|
|
11
|
+
/** Location in the original target schema, never a human quotation. */
|
|
12
|
+
schemaPointer: string;
|
|
13
|
+
value: JsonValue;
|
|
14
|
+
}
|
|
15
|
+
export type ApiInputEnumSource = (ApiBindingMaterial & {
|
|
16
|
+
kind: 'operation';
|
|
17
|
+
targetPointer: string;
|
|
18
|
+
}) | {
|
|
19
|
+
kind: 'requirement';
|
|
20
|
+
requirement: ApiInputRequirement;
|
|
21
|
+
};
|
|
22
|
+
export interface ApiInputEnumCandidatesInput {
|
|
23
|
+
source: ApiInputEnumSource;
|
|
24
|
+
schemas: BindingSchema[];
|
|
25
|
+
resources: SchemaResourceContext;
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
import type { JsonValue } from './api-arguments.js';
|
|
2
2
|
import type { ApiInputAnswerSourceLocation } from './api-input-answer-extraction.js';
|
|
3
|
+
import type { ApiArgumentValues } from './api-arguments.js';
|
|
4
|
+
import type { WorkflowSourceMessage } from './workflow-draft.js';
|
|
5
|
+
export interface ApiLiteralProposalSource extends ApiInputLiteralSource {
|
|
6
|
+
targetPointer: string;
|
|
7
|
+
messageId: string;
|
|
8
|
+
}
|
|
9
|
+
export interface VerifiedApiLiteralProposalSource extends ApiLiteralProposalSource {
|
|
10
|
+
occurrences: ApiInputAnswerSourceLocation[];
|
|
11
|
+
}
|
|
12
|
+
export interface ResolveApiLiteralProposalSourcesInput {
|
|
13
|
+
callId: string;
|
|
14
|
+
values: ApiArgumentValues;
|
|
15
|
+
sources: ApiLiteralProposalSource[];
|
|
16
|
+
messages: WorkflowSourceMessage[];
|
|
17
|
+
}
|
|
3
18
|
export interface ApiInputLiteralSource {
|
|
4
19
|
sourceFormat: 'text' | 'json';
|
|
5
20
|
sourceText: string;
|
|
@@ -9,6 +9,7 @@ import type { ProposedWorkflowDraftSourceEvidence, ResolvedWorkflowDraftSourceEv
|
|
|
9
9
|
import type { ProposedWorkflowDraftApiBindingQuestion, WorkflowDraftApiBindingAnswer, WorkflowDraftApiCallPlanningQuestion } from './workflow-draft-api-binding-clarification.js';
|
|
10
10
|
import type { WorkflowDraftApiBindingIntent } from './workflow-draft-api-binding-intent.js';
|
|
11
11
|
import type { BindingSchema } from './api-bindings.js';
|
|
12
|
+
import type { WorkflowDraftApiEnumSelection, VerifiedWorkflowDraftApiEnumSelection } from './workflow-draft-api-enum-selection.js';
|
|
12
13
|
/** One operation already selected by an add-api-call or replace-api-operation decision. */
|
|
13
14
|
export interface WorkflowDraftApiCallPlanningInput extends PrepareWorkflowDraftEditInput {
|
|
14
15
|
stepId: string;
|
|
@@ -108,11 +109,14 @@ export interface WorkflowDraftApiCallArgumentsDescription extends WorkflowDraftA
|
|
|
108
109
|
export interface ResolveWorkflowDraftApiCallArgumentsInput extends WorkflowDraftApiCallArgumentsInput {
|
|
109
110
|
fingerprint: string;
|
|
110
111
|
proposal: WorkflowDraftApiCallArgumentsProposal;
|
|
112
|
+
/** Semantic OAS choices, never raw user literal provenance or confirmed user answers. */
|
|
113
|
+
enumSelections?: WorkflowDraftApiEnumSelection[];
|
|
111
114
|
}
|
|
112
115
|
export interface WorkflowDraftApiCallArgumentsResultFields extends ResolvedWorkflowDraftSourceEvidence {
|
|
113
116
|
fingerprint: string;
|
|
114
117
|
proposal: WorkflowDraftApiCallArgumentsProposal;
|
|
115
118
|
literalSources: VerifiedWorkflowDraftApiLiteralSource[];
|
|
119
|
+
enumSelections?: VerifiedWorkflowDraftApiEnumSelection[];
|
|
116
120
|
arguments: ApiCallArguments;
|
|
117
121
|
requirements: ApiInputRequirement[];
|
|
118
122
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ApiInputAnswerSourceLocation } from './api-input-answer-extraction.js';
|
|
2
|
+
import type { JsonObject } from './openapi.js';
|
|
3
|
+
import type { ApiArgumentValues } from './api-arguments.js';
|
|
4
|
+
import type { ApiInputEnumCandidate } from './api-input-enum.js';
|
|
5
|
+
import type { WorkflowSourceMessage } from './workflow-draft.js';
|
|
6
|
+
import type { WorkflowDraftApiCallArgumentsInput, WorkflowDraftApiCallArgumentsProposal } from './workflow-draft-api-call-planning.js';
|
|
7
|
+
export interface WorkflowDraftApiEnumSelection {
|
|
8
|
+
candidateId: string;
|
|
9
|
+
messageId: string;
|
|
10
|
+
sourceText: string;
|
|
11
|
+
reason: string;
|
|
12
|
+
}
|
|
13
|
+
export interface VerifiedWorkflowDraftApiEnumSelection extends ApiInputEnumCandidate, WorkflowDraftApiEnumSelection {
|
|
14
|
+
occurrences: ApiInputAnswerSourceLocation[];
|
|
15
|
+
}
|
|
16
|
+
export interface WorkflowDraftApiEnumChoicesInput extends WorkflowDraftApiCallArgumentsInput {
|
|
17
|
+
proposal: WorkflowDraftApiCallArgumentsProposal;
|
|
18
|
+
}
|
|
19
|
+
export interface WorkflowDraftApiEnumChoicesDescription {
|
|
20
|
+
candidates: ApiInputEnumCandidate[];
|
|
21
|
+
targets: WorkflowDraftApiEnumTarget[];
|
|
22
|
+
}
|
|
23
|
+
export interface WorkflowDraftApiEnumTarget {
|
|
24
|
+
targetPointer: string;
|
|
25
|
+
schema: JsonObject | boolean;
|
|
26
|
+
description?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface WorkflowDraftApiEnumResolution {
|
|
29
|
+
values: ApiArgumentValues;
|
|
30
|
+
selections: VerifiedWorkflowDraftApiEnumSelection[];
|
|
31
|
+
}
|
|
32
|
+
export interface WorkflowDraftApiEnumSelectionProposal {
|
|
33
|
+
selections: WorkflowDraftApiEnumSelection[];
|
|
34
|
+
}
|
|
35
|
+
export interface VerifyWorkflowDraftApiEnumSelectionInput {
|
|
36
|
+
selection: WorkflowDraftApiEnumSelection;
|
|
37
|
+
candidates: ApiInputEnumCandidate[];
|
|
38
|
+
messages: WorkflowSourceMessage[];
|
|
39
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -9,6 +9,8 @@ import type { ApiOperationContract } from './api-operation.js';
|
|
|
9
9
|
import type { WorkflowDraftApiCall, WorkflowSourceMessage } from './workflow-draft.js';
|
|
10
10
|
import type { JsonObject } from './openapi.js';
|
|
11
11
|
import type { ApiInputLiteralSource } from './api-input-literal-source.js';
|
|
12
|
+
import type { ApiInputAnswerAnalysis } from './api-input-answer-extraction.js';
|
|
13
|
+
import type { WorkflowDraftApiEnumSelection, VerifiedWorkflowDraftApiEnumSelection } from './workflow-draft-api-enum-selection.js';
|
|
12
14
|
import type { workflowDraftApiInputEditAnswerSchema, workflowDraftApiInputEditAnswersSchema } from '../schemas/workflow-draft-api-input-edit-answers-schema.js';
|
|
13
15
|
export interface WorkflowDraftApiInputEditMaterial extends ApiBindingMaterial {
|
|
14
16
|
requestedInputs?: string[];
|
|
@@ -63,6 +65,8 @@ export interface WorkflowDraftApiInputEditContract {
|
|
|
63
65
|
}
|
|
64
66
|
export interface WorkflowDraftApiInputEditContractInput extends WorkflowDraftApiInputEditInput {
|
|
65
67
|
contract: WorkflowDraftApiInputEditContract;
|
|
68
|
+
/** Enable ID-only interpretation of declared OAS enum choices, with separate provenance. */
|
|
69
|
+
selectOasEnums?: boolean;
|
|
66
70
|
}
|
|
67
71
|
export interface WorkflowDraftApiInputEditValueSource extends ApiInputLiteralSource {
|
|
68
72
|
messageId: string;
|
|
@@ -73,6 +77,9 @@ export type WorkflowDraftApiInputEditValue = ({
|
|
|
73
77
|
source: WorkflowDraftApiInputEditValueSource;
|
|
74
78
|
} | {
|
|
75
79
|
status: 'needs-input';
|
|
80
|
+
} | {
|
|
81
|
+
status: 'oas-enum';
|
|
82
|
+
selection: WorkflowDraftApiEnumSelection;
|
|
76
83
|
}) & {
|
|
77
84
|
explanation?: WorkflowDecisionExplanation<WorkflowMessageEvidence>;
|
|
78
85
|
};
|
|
@@ -85,9 +92,13 @@ export interface WorkflowDraftApiInputEditAnswerSchemaInput extends WorkflowDraf
|
|
|
85
92
|
output: WorkflowDraftApiInputEditValues;
|
|
86
93
|
}
|
|
87
94
|
export interface ResolveWorkflowDraftApiInputEditsInput extends WorkflowDraftApiInputEditAnswerSchemaInput {
|
|
88
|
-
/**
|
|
95
|
+
/** Validated user answer values, separate from the unchanged model output. Retain natural-answer analysis independently. */
|
|
89
96
|
confirmedAnswers?: WorkflowDraftApiInputEditAnswers;
|
|
90
97
|
}
|
|
98
|
+
export interface ResolveWorkflowDraftApiInputEditReplyInput extends ResolveWorkflowDraftApiInputEditsInput {
|
|
99
|
+
reply: string;
|
|
100
|
+
analysis: ApiInputAnswerAnalysis;
|
|
101
|
+
}
|
|
91
102
|
export type WorkflowDraftApiInputEditResult = ({
|
|
92
103
|
status: 'ready';
|
|
93
104
|
contractId: string;
|
|
@@ -101,8 +112,10 @@ export type WorkflowDraftApiInputEditResult = ({
|
|
|
101
112
|
values: WorkflowDraftApiInputEditValues;
|
|
102
113
|
pendingTargets: WorkflowDraftApiInputEditTarget[];
|
|
103
114
|
}) & {
|
|
104
|
-
/** Present
|
|
115
|
+
/** Present when validated user answer values were supplied; natural provenance belongs to the separate answer analysis. */
|
|
105
116
|
confirmedAnswers?: WorkflowDraftApiInputEditAnswers;
|
|
117
|
+
/** Original OAS values and human intent, not user-provided literal attribution. */
|
|
118
|
+
enumSelections?: VerifiedWorkflowDraftApiEnumSelection[];
|
|
106
119
|
};
|
|
107
120
|
export type WorkflowDraftApiInputEditValuesSchema = z.ZodType<WorkflowDraftApiInputEditValues>;
|
|
108
121
|
export type WorkflowDraftApiInputEditAnswersSchema = z.ZodType<WorkflowDraftApiInputEditAnswers>;
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { ApiInputAnswerSourceLocation } from './api-input-answer-extraction.js';
|
|
1
|
+
import type { ApiLiteralProposalSource, VerifiedApiLiteralProposalSource } from './api-input-literal-source.js';
|
|
3
2
|
import type { WorkflowDraftApiCallPlanningDescription, WorkflowDraftApiCallArgumentsProposal } from './workflow-draft-api-call-planning.js';
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
messageId: string;
|
|
7
|
-
}
|
|
8
|
-
export interface VerifiedWorkflowDraftApiLiteralSource extends WorkflowDraftApiLiteralSource {
|
|
9
|
-
occurrences: ApiInputAnswerSourceLocation[];
|
|
10
|
-
}
|
|
3
|
+
export type WorkflowDraftApiLiteralSource = ApiLiteralProposalSource;
|
|
4
|
+
export type VerifiedWorkflowDraftApiLiteralSource = VerifiedApiLiteralProposalSource;
|
|
11
5
|
export interface ResolveWorkflowDraftApiLiteralSourcesInput {
|
|
12
6
|
description: WorkflowDraftApiCallPlanningDescription;
|
|
13
7
|
proposal: WorkflowDraftApiCallArgumentsProposal;
|