@openapi-flow/langchain 0.3.18 → 0.4.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/README.md +21 -0
- package/dist/arguments/analyze-api-input-answers.js +3 -0
- package/dist/arguments/api-argument-planning-error.d.ts +11 -0
- package/dist/arguments/api-argument-planning-error.js +32 -0
- package/dist/arguments/create-api-argument-rejection.d.ts +3 -0
- package/dist/arguments/create-api-argument-rejection.js +31 -0
- package/dist/arguments/fingerprint-api-argument-source.d.ts +4 -0
- package/dist/arguments/fingerprint-api-argument-source.js +12 -0
- package/dist/arguments/generate-api-arguments.js +78 -32
- package/dist/arguments/interpret-api-argument-enums.js +1 -0
- package/dist/arguments/resolve-api-literal-generation-output.d.ts +3 -0
- package/dist/arguments/resolve-api-literal-generation-output.js +14 -0
- package/dist/bindings/plan-api-bindings-by-call.js +12 -3
- package/dist/model/invoke-structured-model.js +32 -6
- package/dist/prompts/api-arguments-prompt.d.ts +2 -1
- package/dist/prompts/api-arguments-prompt.js +2 -1
- package/dist/prompts/incremental-workflow-connections-prompt.d.ts +2 -2
- package/dist/prompts/incremental-workflow-connections-prompt.js +5 -4
- package/dist/prompts/native-instance-selection-review-prompt.d.ts +1 -0
- package/dist/prompts/native-instance-selection-review-prompt.js +8 -0
- package/dist/prompts/native-node-planning-prompt.d.ts +1 -1
- package/dist/prompts/native-node-planning-prompt.js +1 -0
- package/dist/prompts/workflow-connection-goal-recovery-prompt.d.ts +1 -0
- package/dist/prompts/workflow-connection-goal-recovery-prompt.js +8 -0
- package/dist/prompts/workflow-connection-goal-review-prompt.d.ts +1 -0
- package/dist/prompts/workflow-connection-goal-review-prompt.js +7 -0
- package/dist/prompts/workflow-connection-outline-prompt.d.ts +1 -0
- package/dist/prompts/workflow-connection-outline-prompt.js +6 -0
- package/dist/prompts/workflow-connection-revision-prompt.d.ts +1 -0
- package/dist/prompts/workflow-connection-revision-prompt.js +10 -0
- package/dist/public-api.d.ts +20 -0
- package/dist/public-api.js +15 -0
- package/dist/schemas/api-argument-rejection-schema.d.ts +28 -0
- package/dist/schemas/api-argument-rejection-schema.js +20 -0
- package/dist/schemas/api-literal-generation-output-schema.d.ts +53 -1
- package/dist/schemas/api-literal-generation-output-schema.js +37 -12
- package/dist/schemas/create-connection-material-repair-choice-schema.d.ts +4 -0
- package/dist/schemas/create-connection-material-repair-choice-schema.js +21 -0
- package/dist/schemas/model-signal-schema.d.ts +3 -0
- package/dist/schemas/model-signal-schema.js +3 -0
- package/dist/schemas/native-node-parameter-contract.js +2 -0
- package/dist/schemas/native-node-planning-contract.js +30 -23
- package/dist/schemas/workflow-connection-goal-recovery-schema.d.ts +4 -0
- package/dist/schemas/workflow-connection-goal-recovery-schema.js +16 -0
- package/dist/schemas/workflow-connection-goal-rejection-schema.d.ts +76 -0
- package/dist/schemas/workflow-connection-goal-rejection-schema.js +2 -1
- package/dist/schemas/workflow-connection-goal-review-schema.d.ts +4 -0
- package/dist/schemas/workflow-connection-goal-review-schema.js +26 -0
- package/dist/schemas/workflow-connection-goals-schema.d.ts +4 -2
- package/dist/schemas/workflow-connection-outline-rejection-schema.d.ts +25 -0
- package/dist/schemas/workflow-connection-outline-rejection-schema.js +21 -0
- package/dist/schemas/workflow-connection-outline-schema.d.ts +3 -0
- package/dist/schemas/workflow-connection-outline-schema.js +25 -0
- package/dist/schemas/workflow-connection-revision-rejection-schema.d.ts +113 -0
- package/dist/schemas/workflow-connection-revision-rejection-schema.js +23 -0
- package/dist/schemas/workflow-connection-revision-schema.d.ts +4 -0
- package/dist/schemas/workflow-connection-revision-schema.js +23 -0
- package/dist/schemas/workflow-connection-step-schema.d.ts +5 -3
- package/dist/schemas/workflow-connection-step-schema.js +62 -31
- package/dist/types/api-input-answers.d.ts +1 -0
- package/dist/types/argument-generation.d.ts +31 -11
- package/dist/types/incremental-connection-planning.d.ts +10 -3
- package/dist/types/native-instance-selection-review.d.ts +9 -0
- package/dist/types/native-instance-selection-review.js +1 -0
- package/dist/types/native-node-planning.d.ts +6 -2
- package/dist/types/workflow-connection-goal-recovery.d.ts +22 -0
- package/dist/types/workflow-connection-goal-recovery.js +1 -0
- package/dist/types/workflow-connection-goal-review.d.ts +13 -0
- package/dist/types/workflow-connection-goal-review.js +1 -0
- package/dist/types/workflow-connection-outline.d.ts +22 -0
- package/dist/types/workflow-connection-outline.js +1 -0
- package/dist/types/workflow-connection-revision.d.ts +34 -0
- package/dist/types/workflow-connection-revision.js +1 -0
- package/dist/workflow/connections/create-workflow-connection-goal-rejection.js +8 -2
- package/dist/workflow/connections/create-workflow-connection-outline-rejection.d.ts +3 -0
- package/dist/workflow/connections/create-workflow-connection-outline-rejection.js +28 -0
- package/dist/workflow/connections/create-workflow-connection-revision-rejection.d.ts +3 -0
- package/dist/workflow/connections/create-workflow-connection-revision-rejection.js +32 -0
- package/dist/workflow/connections/describe-workflow-connection-outline-request.d.ts +3 -0
- package/dist/workflow/connections/describe-workflow-connection-outline-request.js +30 -0
- package/dist/workflow/connections/invoke-connection-planning-model.js +3 -0
- package/dist/workflow/connections/plan-workflow-connection-goal-recovery.d.ts +3 -0
- package/dist/workflow/connections/plan-workflow-connection-goal-recovery.js +111 -0
- package/dist/workflow/connections/plan-workflow-connection-goals.js +35 -16
- package/dist/workflow/connections/plan-workflow-connection-outline.d.ts +4 -0
- package/dist/workflow/connections/plan-workflow-connection-outline.js +93 -0
- package/dist/workflow/connections/plan-workflow-connection-revision.d.ts +3 -0
- package/dist/workflow/connections/plan-workflow-connection-revision.js +163 -0
- package/dist/workflow/connections/plan-workflow-connection-step.js +75 -29
- package/dist/workflow/connections/resolve-connection-selections.d.ts +6 -0
- package/dist/workflow/connections/resolve-connection-selections.js +28 -0
- package/dist/workflow/connections/review-workflow-connection-goals.d.ts +4 -0
- package/dist/workflow/connections/review-workflow-connection-goals.js +64 -0
- package/dist/workflow/connections/validate-workflow-goal-review-feedback.d.ts +4 -0
- package/dist/workflow/connections/validate-workflow-goal-review-feedback.js +22 -0
- package/dist/workflow/connections/workflow-connection-planning-error.d.ts +1 -0
- package/dist/workflow/connections/workflow-connection-planning-error.js +2 -0
- package/dist/workflow/native-selection/native-instance-selection-review-error.d.ts +6 -0
- package/dist/workflow/native-selection/native-instance-selection-review-error.js +18 -0
- package/dist/workflow/native-selection/review-native-instance-selection.d.ts +4 -0
- package/dist/workflow/native-selection/review-native-instance-selection.js +81 -0
- package/dist/workflow/resolve-native-node-planning-output.js +3 -1
- package/dist/workflow/select-native-node-instances.js +11 -2
- package/package.json +2 -2
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { workflowConnectionStepExpectationSchema } from '@openapi-flow/core';
|
|
3
|
+
/** Exact private proposal feedback, never a public progress or error payload. */
|
|
4
|
+
export const workflowConnectionOutlineRejectionSchema = z.discriminatedUnion('stage', [
|
|
5
|
+
z.strictObject({
|
|
6
|
+
requestFingerprint: z.string().regex(/^[a-f0-9]{64}$/),
|
|
7
|
+
expected: workflowConnectionStepExpectationSchema,
|
|
8
|
+
stage: z.literal('model-output'),
|
|
9
|
+
code: z.literal('MODEL_OUTPUT_INVALID'),
|
|
10
|
+
output: z.json(),
|
|
11
|
+
reason: z.string().min(1),
|
|
12
|
+
}),
|
|
13
|
+
z.strictObject({
|
|
14
|
+
requestFingerprint: z.string().regex(/^[a-f0-9]{64}$/),
|
|
15
|
+
expected: workflowConnectionStepExpectationSchema,
|
|
16
|
+
stage: z.literal('contract-validation'),
|
|
17
|
+
code: z.literal('WORKFLOW_GRAPH_PLANNING_FAILED'),
|
|
18
|
+
output: z.json(),
|
|
19
|
+
reason: z.string().min(1),
|
|
20
|
+
}),
|
|
21
|
+
]);
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { WorkflowConnectionStepDescription, WorkflowConnectionOutlineProposal } from '@openapi-flow/core';
|
|
3
|
+
export declare function createWorkflowConnectionOutlineSchema(description: WorkflowConnectionStepDescription): z.ZodType<WorkflowConnectionOutlineProposal>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { workflowConnectionOutlineBundleProposalSchema, workflowConnectionOutlineProposalSchema, } from '@openapi-flow/core';
|
|
3
|
+
import { connectionIdListSchema } from './connection-planning-field-schemas.js';
|
|
4
|
+
export function createWorkflowConnectionOutlineSchema(description) {
|
|
5
|
+
const ids = description.context.nodes.map((node) => node.id);
|
|
6
|
+
if (!ids.length)
|
|
7
|
+
throw new Error('Outline planning requires actual supplied nodes');
|
|
8
|
+
const bundle = workflowConnectionOutlineBundleProposalSchema.extend({
|
|
9
|
+
nodeIds: z
|
|
10
|
+
.array(z.enum(ids))
|
|
11
|
+
.min(1)
|
|
12
|
+
.describe('Choose actual node anchors for a coherent planning task. Shared boundary nodes may appear in several tasks.'),
|
|
13
|
+
goalIds: connectionIdListSchema(description.goals.map((goal) => goal.id)).describe('Select actual current goals addressed by this task; all goals must appear somewhere in the outline.'),
|
|
14
|
+
factIds: z
|
|
15
|
+
.array(z.enum(description.requirements.map((fact) => fact.id)))
|
|
16
|
+
.min(1)
|
|
17
|
+
.describe('Select unchanged original requirement IDs supporting this task; never create replacement requirements.'),
|
|
18
|
+
});
|
|
19
|
+
return workflowConnectionOutlineProposalSchema.extend({
|
|
20
|
+
bundles: z
|
|
21
|
+
.array(bundle)
|
|
22
|
+
.min(1)
|
|
23
|
+
.describe('Cover all supplied node, goal and fact identities with planning tasks. Array order is not execution order.'),
|
|
24
|
+
});
|
|
25
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Private feedback for the exact two source epochs and original session, not user input or browser data. */
|
|
3
|
+
export declare const workflowConnectionRevisionRejectionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
4
|
+
stage: z.ZodLiteral<"model-output">;
|
|
5
|
+
code: z.ZodLiteral<"MODEL_OUTPUT_INVALID">;
|
|
6
|
+
sourceFingerprint: z.ZodString;
|
|
7
|
+
expected: z.ZodObject<{
|
|
8
|
+
sessionId: z.ZodUUID;
|
|
9
|
+
sourceFingerprint: z.ZodString;
|
|
10
|
+
revision: z.ZodNumber;
|
|
11
|
+
}, z.core.$strict>;
|
|
12
|
+
output: z.ZodJSONSchema;
|
|
13
|
+
reason: z.ZodString;
|
|
14
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
15
|
+
stage: z.ZodLiteral<"contract-validation">;
|
|
16
|
+
code: z.ZodLiteral<"WORKFLOW_GRAPH_PLANNING_FAILED">;
|
|
17
|
+
violations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
18
|
+
code: z.ZodEnum<{
|
|
19
|
+
INVALID_PROPOSAL: "INVALID_PROPOSAL";
|
|
20
|
+
INVALID_EDGE: "INVALID_EDGE";
|
|
21
|
+
CYCLE: "CYCLE";
|
|
22
|
+
INVALID_BOUNDARY: "INVALID_BOUNDARY";
|
|
23
|
+
CLOSED_REGION_INVALID: "CLOSED_REGION_INVALID";
|
|
24
|
+
PROTECTED_EDGE: "PROTECTED_EDGE";
|
|
25
|
+
NO_PROGRESS: "NO_PROGRESS";
|
|
26
|
+
}>;
|
|
27
|
+
message: z.ZodString;
|
|
28
|
+
}, z.core.$strict>>>;
|
|
29
|
+
constraints: z.ZodOptional<z.ZodObject<{
|
|
30
|
+
checkedScope: z.ZodLiteral<"necessary-node-order">;
|
|
31
|
+
dependencies: z.ZodArray<z.ZodObject<{
|
|
32
|
+
from: z.ZodString;
|
|
33
|
+
to: z.ZodString;
|
|
34
|
+
scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
35
|
+
kind: z.ZodLiteral<"node">;
|
|
36
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
37
|
+
kind: z.ZodLiteral<"input-port">;
|
|
38
|
+
port: z.ZodString;
|
|
39
|
+
}, z.core.$strict>], "kind">;
|
|
40
|
+
origin: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
41
|
+
kind: z.ZodLiteral<"value-reference">;
|
|
42
|
+
source: z.ZodEnum<{
|
|
43
|
+
response: "response";
|
|
44
|
+
"node-output": "node-output";
|
|
45
|
+
}>;
|
|
46
|
+
pointer: z.ZodString;
|
|
47
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
48
|
+
kind: z.ZodLiteral<"native-dependency">;
|
|
49
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
50
|
+
kind: z.ZodLiteral<"protected-connection">;
|
|
51
|
+
edgeId: z.ZodString;
|
|
52
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
53
|
+
kind: z.ZodLiteral<"goal">;
|
|
54
|
+
goalIndex: z.ZodNumber;
|
|
55
|
+
factIds: z.ZodArray<z.ZodString>;
|
|
56
|
+
goalKind: z.ZodEnum<{
|
|
57
|
+
join: "join";
|
|
58
|
+
precedence: "precedence";
|
|
59
|
+
route: "route";
|
|
60
|
+
}>;
|
|
61
|
+
}, z.core.$strict>], "kind">;
|
|
62
|
+
}, z.core.$strict>>;
|
|
63
|
+
conflicts: z.ZodArray<z.ZodObject<{
|
|
64
|
+
code: z.ZodEnum<{
|
|
65
|
+
DEPENDENCY_CYCLE: "DEPENDENCY_CYCLE";
|
|
66
|
+
INDEPENDENCE_CONFLICT: "INDEPENDENCE_CONFLICT";
|
|
67
|
+
}>;
|
|
68
|
+
message: z.ZodString;
|
|
69
|
+
nodeIds: z.ZodArray<z.ZodString>;
|
|
70
|
+
goalIndexes: z.ZodArray<z.ZodNumber>;
|
|
71
|
+
dependencies: z.ZodArray<z.ZodObject<{
|
|
72
|
+
from: z.ZodString;
|
|
73
|
+
to: z.ZodString;
|
|
74
|
+
scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
75
|
+
kind: z.ZodLiteral<"node">;
|
|
76
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
77
|
+
kind: z.ZodLiteral<"input-port">;
|
|
78
|
+
port: z.ZodString;
|
|
79
|
+
}, z.core.$strict>], "kind">;
|
|
80
|
+
origin: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
81
|
+
kind: z.ZodLiteral<"value-reference">;
|
|
82
|
+
source: z.ZodEnum<{
|
|
83
|
+
response: "response";
|
|
84
|
+
"node-output": "node-output";
|
|
85
|
+
}>;
|
|
86
|
+
pointer: z.ZodString;
|
|
87
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
88
|
+
kind: z.ZodLiteral<"native-dependency">;
|
|
89
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
90
|
+
kind: z.ZodLiteral<"protected-connection">;
|
|
91
|
+
edgeId: z.ZodString;
|
|
92
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
93
|
+
kind: z.ZodLiteral<"goal">;
|
|
94
|
+
goalIndex: z.ZodNumber;
|
|
95
|
+
factIds: z.ZodArray<z.ZodString>;
|
|
96
|
+
goalKind: z.ZodEnum<{
|
|
97
|
+
join: "join";
|
|
98
|
+
precedence: "precedence";
|
|
99
|
+
route: "route";
|
|
100
|
+
}>;
|
|
101
|
+
}, z.core.$strict>], "kind">;
|
|
102
|
+
}, z.core.$strict>>;
|
|
103
|
+
}, z.core.$strict>>;
|
|
104
|
+
}, z.core.$strict>>;
|
|
105
|
+
sourceFingerprint: z.ZodString;
|
|
106
|
+
expected: z.ZodObject<{
|
|
107
|
+
sessionId: z.ZodUUID;
|
|
108
|
+
sourceFingerprint: z.ZodString;
|
|
109
|
+
revision: z.ZodNumber;
|
|
110
|
+
}, z.core.$strict>;
|
|
111
|
+
output: z.ZodJSONSchema;
|
|
112
|
+
reason: z.ZodString;
|
|
113
|
+
}, z.core.$strict>], "stage">;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { workflowConnectionStepExpectationSchema, workflowConnectionRevisionViolationsSchema, workflowPlanningConstraintInspectionSchema, } from '@openapi-flow/core';
|
|
3
|
+
const source = {
|
|
4
|
+
sourceFingerprint: workflowConnectionStepExpectationSchema.shape.sourceFingerprint,
|
|
5
|
+
expected: workflowConnectionStepExpectationSchema,
|
|
6
|
+
output: z.json(),
|
|
7
|
+
reason: z.string().min(1),
|
|
8
|
+
};
|
|
9
|
+
/** Private feedback for the exact two source epochs and original session, not user input or browser data. */
|
|
10
|
+
export const workflowConnectionRevisionRejectionSchema = z.discriminatedUnion('stage', [
|
|
11
|
+
z.strictObject({
|
|
12
|
+
...source,
|
|
13
|
+
stage: z.literal('model-output'),
|
|
14
|
+
code: z.literal('MODEL_OUTPUT_INVALID'),
|
|
15
|
+
}),
|
|
16
|
+
z.strictObject({
|
|
17
|
+
...source,
|
|
18
|
+
stage: z.literal('contract-validation'),
|
|
19
|
+
code: z.literal('WORKFLOW_GRAPH_PLANNING_FAILED'),
|
|
20
|
+
violations: workflowConnectionRevisionViolationsSchema.optional(),
|
|
21
|
+
constraints: workflowPlanningConstraintInspectionSchema.optional(),
|
|
22
|
+
}),
|
|
23
|
+
]);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { WorkflowConnectionRevisionDescription } from '@openapi-flow/core';
|
|
3
|
+
import type { WorkflowConnectionRevisionModelOutput } from '../types/workflow-connection-revision.js';
|
|
4
|
+
export declare function createWorkflowConnectionRevisionSchema(description: WorkflowConnectionRevisionDescription): z.ZodType<WorkflowConnectionRevisionModelOutput>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createWorkflowConnectionGoalsSchema } from './workflow-connection-goals-schema.js';
|
|
3
|
+
import { createWorkflowConnectionPatchSelectionSchema } from './workflow-connection-step-schema.js';
|
|
4
|
+
import { connectionChoicesSchema } from './connection-planning-field-schemas.js';
|
|
5
|
+
import { createConnectionMaterialRepairChoiceSchema } from './create-connection-material-repair-choice-schema.js';
|
|
6
|
+
export function createWorkflowConnectionRevisionSchema(description) {
|
|
7
|
+
const context = {
|
|
8
|
+
...description.before,
|
|
9
|
+
context: description.after.context,
|
|
10
|
+
requirements: description.after.requirements,
|
|
11
|
+
};
|
|
12
|
+
const choices = [
|
|
13
|
+
z.strictObject({
|
|
14
|
+
kind: z.literal('revise-connections'),
|
|
15
|
+
goals: createWorkflowConnectionGoalsSchema(description.after).shape.goals,
|
|
16
|
+
graphChange: createWorkflowConnectionPatchSelectionSchema(context, description.before.context.nodes),
|
|
17
|
+
}),
|
|
18
|
+
];
|
|
19
|
+
const material = createConnectionMaterialRepairChoiceSchema(description.after.materialRepairStages, description.after.requirements.map((fact) => fact.id));
|
|
20
|
+
if (material)
|
|
21
|
+
choices.push(material);
|
|
22
|
+
return z.strictObject({ decision: connectionChoicesSchema(choices) });
|
|
23
|
+
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import type { WorkflowConnectionStepDescription, WorkflowCapability } from '@openapi-flow/core';
|
|
3
|
-
import type { WorkflowConnectionStepModelOutput } from '../types/incremental-connection-planning.js';
|
|
4
|
-
|
|
2
|
+
import type { WorkflowConnectionStepDescription, WorkflowCapability, WorkflowPlanNodeContract } from '@openapi-flow/core';
|
|
3
|
+
import type { WorkflowConnectionStepModelOutput, WorkflowConnectionPatchContext, WorkflowConnectionPatchSelection } from '../types/incremental-connection-planning.js';
|
|
4
|
+
import type { WorkflowConnectionOutlineBundleDescription } from '@openapi-flow/core';
|
|
5
|
+
export declare function createWorkflowConnectionPatchSelectionSchema(description: WorkflowConnectionPatchContext, removalNodes: WorkflowPlanNodeContract[], outline?: WorkflowConnectionOutlineBundleDescription): z.ZodType<WorkflowConnectionPatchSelection>;
|
|
6
|
+
export declare function createWorkflowConnectionStepSchema(description: WorkflowConnectionStepDescription, capabilities: WorkflowCapability[], outline?: WorkflowConnectionOutlineBundleDescription): z.ZodType<WorkflowConnectionStepModelOutput>;
|
|
@@ -1,33 +1,76 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { workflowConnectionAssessmentSchema, workflowConnectionMaterialRequestSchema, workflowConnectionUserDecisionSchema, } from '@openapi-flow/core';
|
|
3
3
|
import { connectionChoicesSchema, connectionDecisionTextSchema as text, connectionIdListSchema, connectionPortSelectionListSchema, } from './connection-planning-field-schemas.js';
|
|
4
|
-
export function
|
|
4
|
+
export function createWorkflowConnectionPatchSelectionSchema(description, removalNodes, outline) {
|
|
5
5
|
const nodes = description.context.nodes;
|
|
6
|
-
const ids = nodes.map((node) => node.id);
|
|
7
|
-
if (!ids.length)
|
|
8
|
-
throw new Error('Connection steps require supplied nodes');
|
|
9
|
-
const factIds = z
|
|
10
|
-
.array(z.enum(description.requirements.map((fact) => fact.id)))
|
|
11
|
-
.min(1);
|
|
12
|
-
const sources = connectionPortSelectionListSchema(nodes, 'outputs');
|
|
13
|
-
const targets = connectionPortSelectionListSchema(nodes, 'inputs');
|
|
14
|
-
const edge = z.strictObject({
|
|
15
|
-
source: sources.element,
|
|
16
|
-
target: targets.element,
|
|
17
|
-
});
|
|
18
6
|
const canConnect = nodes.some((node) => node.outputs.length) &&
|
|
19
7
|
nodes.some((node) => node.inputs.length);
|
|
20
|
-
const
|
|
21
|
-
|
|
8
|
+
const edge = z.strictObject({
|
|
9
|
+
source: connectionPortSelectionListSchema(nodes, 'outputs').element,
|
|
10
|
+
target: connectionPortSelectionListSchema(nodes, 'inputs').element,
|
|
11
|
+
});
|
|
12
|
+
const scoped = outline === undefined
|
|
13
|
+
? []
|
|
14
|
+
: [
|
|
15
|
+
{
|
|
16
|
+
sources: nodes.filter((node) => outline.bundle.nodeIds.includes(node.id)),
|
|
17
|
+
targets: nodes,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
sources: nodes,
|
|
21
|
+
targets: nodes.filter((node) => outline.bundle.nodeIds.includes(node.id)),
|
|
22
|
+
},
|
|
23
|
+
]
|
|
24
|
+
.filter(({ sources, targets }) => sources.some((node) => node.outputs.length) &&
|
|
25
|
+
targets.some((node) => node.inputs.length))
|
|
26
|
+
.map(({ sources, targets }) => z.strictObject({
|
|
27
|
+
source: connectionPortSelectionListSchema(sources, 'outputs')
|
|
28
|
+
.element,
|
|
29
|
+
target: connectionPortSelectionListSchema(targets, 'inputs')
|
|
30
|
+
.element,
|
|
31
|
+
}));
|
|
32
|
+
const roots = nodes.filter((node) => !node.waitsForAllInputs &&
|
|
22
33
|
node.rejoinsExclusiveOutputs === undefined &&
|
|
23
34
|
!node.references.length &&
|
|
24
35
|
!node.dependencyNodeIds.length &&
|
|
25
|
-
!Object.values(node.inputReferences ?? {}).some((references) => references.length))
|
|
26
|
-
|
|
27
|
-
const terminalNodes = nodes.map((node) => ({
|
|
36
|
+
!Object.values(node.inputReferences ?? {}).some((references) => references.length));
|
|
37
|
+
const currentTerminalNodes = removalNodes.map((node) => ({
|
|
28
38
|
...node,
|
|
29
39
|
outputs: node.outputs.filter((output) => description.terminals.some((terminal) => terminal.nodeId === node.id && terminal.output === output)),
|
|
30
40
|
}));
|
|
41
|
+
return z.strictObject({
|
|
42
|
+
kind: z.literal('patch'),
|
|
43
|
+
addEdges: (outline !== undefined
|
|
44
|
+
? scoped.length
|
|
45
|
+
? z.array(connectionChoicesSchema(scoped))
|
|
46
|
+
: z.array(edge).max(0)
|
|
47
|
+
: canConnect
|
|
48
|
+
? z.array(edge)
|
|
49
|
+
: z.array(edge).max(0)).describe('One atomic semantic bundle or repair, not a full graph replacement.'),
|
|
50
|
+
removeEdgeIds: connectionIdListSchema(description.edgeCatalog
|
|
51
|
+
.filter((item) => item.editable &&
|
|
52
|
+
(outline === undefined ||
|
|
53
|
+
outline.bundle.nodeIds.includes(item.edge.from) ||
|
|
54
|
+
outline.bundle.nodeIds.includes(item.edge.to)))
|
|
55
|
+
.map((item) => item.id)),
|
|
56
|
+
addRootNodeIds: connectionIdListSchema(roots.map((node) => node.id)).describe('Only explicitly intended independent starts in this patch. An unconnected node is not automatically a start.'),
|
|
57
|
+
removeRootNodeIds: connectionIdListSchema(description.rootNodeIds),
|
|
58
|
+
addTerminals: connectionPortSelectionListSchema(nodes, 'outputs').describe('Only outputs explicitly intended to finish here. Leave unfinished paths open.'),
|
|
59
|
+
removeTerminals: connectionPortSelectionListSchema(currentTerminalNodes, 'outputs').describe('Explicitly reopen a previously accepted terminal before continuing its path.'),
|
|
60
|
+
factIds: z
|
|
61
|
+
.array(z.enum(description.requirements.map((fact) => fact.id)))
|
|
62
|
+
.min(1),
|
|
63
|
+
reason: text,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
export function createWorkflowConnectionStepSchema(description, capabilities, outline) {
|
|
67
|
+
const nodes = description.context.nodes;
|
|
68
|
+
const ids = nodes.map((node) => node.id);
|
|
69
|
+
if (!ids.length)
|
|
70
|
+
throw new Error('Connection steps require supplied nodes');
|
|
71
|
+
const factIds = z
|
|
72
|
+
.array(z.enum(description.requirements.map((fact) => fact.id)))
|
|
73
|
+
.min(1);
|
|
31
74
|
const semanticGoalIds = description.goals
|
|
32
75
|
.filter((goal) => goal.decision.kind === 'semantic')
|
|
33
76
|
.map((goal) => goal.id);
|
|
@@ -38,19 +81,7 @@ export function createWorkflowConnectionStepSchema(description, capabilities) {
|
|
|
38
81
|
}))
|
|
39
82
|
: z.array(workflowConnectionAssessmentSchema).max(0);
|
|
40
83
|
const choices = [
|
|
41
|
-
|
|
42
|
-
kind: z.literal('patch'),
|
|
43
|
-
addEdges: (canConnect ? z.array(edge) : z.array(edge).max(0)).describe('One complete connection bundle, including both conditional branches or the intended fan-out/join where needed. Not a full graph replacement.'),
|
|
44
|
-
removeEdgeIds: connectionIdListSchema(description.edgeCatalog
|
|
45
|
-
.filter((item) => item.editable)
|
|
46
|
-
.map((item) => item.id)),
|
|
47
|
-
addRootNodeIds: connectionIdListSchema(roots).describe('Explicit independent roots. Unconnected nodes are not automatic roots.'),
|
|
48
|
-
removeRootNodeIds: connectionIdListSchema(description.rootNodeIds),
|
|
49
|
-
addTerminals: sources,
|
|
50
|
-
removeTerminals: connectionPortSelectionListSchema(terminalNodes, 'outputs'),
|
|
51
|
-
factIds,
|
|
52
|
-
reason: text,
|
|
53
|
-
}),
|
|
84
|
+
createWorkflowConnectionPatchSelectionSchema(description, nodes, outline),
|
|
54
85
|
z.strictObject({
|
|
55
86
|
kind: z.literal('request-completion'),
|
|
56
87
|
assessments,
|
|
@@ -8,6 +8,7 @@ export interface ExtractApiInputAnswersInput {
|
|
|
8
8
|
model: BaseChatModel;
|
|
9
9
|
selectOasEnums?: boolean;
|
|
10
10
|
purpose?: string;
|
|
11
|
+
signal?: AbortSignal;
|
|
11
12
|
}
|
|
12
13
|
export interface AnalyzeApiInputAnswersInput extends Omit<ExtractApiInputAnswersInput, 'model'> {
|
|
13
14
|
/** Required only when pending questions and a nonempty reply need interpretation. */
|
|
@@ -1,26 +1,46 @@
|
|
|
1
1
|
import type { BaseChatModel } from '@langchain/core/language_models/chat_models';
|
|
2
|
-
import type { ApiLiteralGenerationInput, ApiCallArguments, ApiArgumentProposal,
|
|
2
|
+
import type { ApiLiteralGenerationInput, ApiCallArguments, ApiArgumentProposal, ApiLiteralProposalSource, OpenApiFlowError } from '@openapi-flow/core';
|
|
3
3
|
import type { z } from 'zod';
|
|
4
|
-
import type { createApiLiteralGenerationOutputSchema } from '../schemas/api-literal-generation-output-schema.js';
|
|
5
4
|
import type { apiLiteralGenerationReasonSchema } from '../schemas/api-literal-generation-output-schema.js';
|
|
6
5
|
import type { apiLiteralGenerationSourcesSchema } from '../schemas/api-literal-generation-output-schema.js';
|
|
6
|
+
import type { apiLiteralNotProvidedSchema } from '../schemas/api-literal-generation-output-schema.js';
|
|
7
|
+
import type { createApiLiteralProvidedSchema, createApiTrackedLiteralGenerationSchema, createApiExplainedTrackedLiteralGenerationSchema } from '../schemas/api-literal-generation-output-schema.js';
|
|
8
|
+
import type { apiLiteralGenerationOptionsSchema } from '../schemas/api-literal-generation-output-schema.js';
|
|
9
|
+
import type { apiArgumentRejectionSchema } from '../schemas/api-argument-rejection-schema.js';
|
|
7
10
|
export interface GenerateApiArgumentsInput extends ApiLiteralGenerationInput {
|
|
8
11
|
model?: BaseChatModel;
|
|
9
12
|
includeExplanations?: boolean;
|
|
10
13
|
selectOasEnums?: boolean;
|
|
11
14
|
trackRequestedInputs?: boolean;
|
|
15
|
+
/** Exact, private rejection feedback for the same source; no library-owned retries. */
|
|
16
|
+
rejectedProposals?: ApiArgumentRejection[];
|
|
17
|
+
signal?: AbortSignal;
|
|
18
|
+
}
|
|
19
|
+
export type ApiArgumentRejection = z.infer<typeof apiArgumentRejectionSchema>;
|
|
20
|
+
export interface CreateApiArgumentRejectionInput extends Omit<GenerateApiArgumentsInput, 'model' | 'rejectedProposals' | 'signal'> {
|
|
21
|
+
error: unknown;
|
|
22
|
+
}
|
|
23
|
+
export type ApiLiteralGenerationOptions = z.infer<typeof apiLiteralGenerationOptionsSchema>;
|
|
24
|
+
export interface ApiArgumentPlanningFailure {
|
|
25
|
+
error: OpenApiFlowError;
|
|
26
|
+
sourceFingerprint: string;
|
|
27
|
+
output: unknown;
|
|
12
28
|
}
|
|
13
29
|
export interface InterpretApiArgumentEnumsInput extends GenerateApiArgumentsInput {
|
|
14
30
|
arguments: ApiCallArguments;
|
|
15
31
|
proposal: ApiArgumentProposal;
|
|
16
32
|
literalSources: ApiLiteralProposalSource[];
|
|
17
33
|
}
|
|
18
|
-
export type
|
|
19
|
-
export type
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
export
|
|
34
|
+
export type ApiLiteralProvidedDecision = z.infer<ReturnType<typeof createApiLiteralProvidedSchema>>;
|
|
35
|
+
export type ApiLiteralAvailabilityDecision = z.infer<typeof apiLiteralNotProvidedSchema> | ApiLiteralProvidedDecision;
|
|
36
|
+
export type ApiTrackedLiteralGenerationOutput = z.infer<ReturnType<typeof createApiTrackedLiteralGenerationSchema>> | z.infer<ReturnType<typeof createApiExplainedTrackedLiteralGenerationSchema>>;
|
|
37
|
+
export interface ApiExplainedLiteralGenerationOutput extends ApiArgumentProposal {
|
|
38
|
+
explanation: z.infer<typeof apiLiteralGenerationReasonSchema>;
|
|
39
|
+
}
|
|
40
|
+
export type ApiLiteralGenerationOutput = ApiArgumentProposal | ApiExplainedLiteralGenerationOutput | ApiTrackedLiteralGenerationOutput;
|
|
41
|
+
export type ApiLiteralGenerationOutputSchema = z.ZodType<ApiLiteralGenerationOutput>;
|
|
42
|
+
export interface ResolvedApiLiteralGenerationOutput extends ApiArgumentProposal {
|
|
43
|
+
requestedInputs?: string[];
|
|
44
|
+
literalSources?: z.infer<typeof apiLiteralGenerationSourcesSchema>;
|
|
45
|
+
explanation?: z.infer<typeof apiLiteralGenerationReasonSchema>;
|
|
46
|
+
}
|
|
@@ -2,11 +2,13 @@ import type { BaseChatModel } from '@langchain/core/language_models/chat_models'
|
|
|
2
2
|
import type { ZodType, z } from 'zod';
|
|
3
3
|
import type { workflowConnectionGoalRejectionSchema } from '../schemas/workflow-connection-goal-rejection-schema.js';
|
|
4
4
|
import type { BaseMessage } from '@langchain/core/messages';
|
|
5
|
-
import type { WorkflowConnectionSessionSource, WorkflowConnectionSessionInput, WorkflowConnectionGoalProposal, WorkflowConnectionStepProposal, WorkflowConnectionPatch, WorkflowConnectionPlanningDecision, WorkflowConnectionMaterialRequest, WorkflowConnectionUserDecision, WorkflowConnectionRejectedProposal, WorkflowConnectionStepExpectation } from '@openapi-flow/core';
|
|
5
|
+
import type { WorkflowConnectionSessionSource, WorkflowConnectionSessionInput, WorkflowConnectionGoalProposal, WorkflowConnectionStepProposal, WorkflowConnectionPatch, WorkflowConnectionPlanningDecision, WorkflowConnectionMaterialRequest, WorkflowConnectionUserDecision, WorkflowConnectionRejectedProposal, WorkflowConnectionStepExpectation, WorkflowConnectionStepDescription, WorkflowReviewedGoalCandidate, WorkflowConnectionOutline } from '@openapi-flow/core';
|
|
6
6
|
export interface PlanWorkflowConnectionGoalsInput extends WorkflowConnectionSessionSource {
|
|
7
7
|
model: BaseChatModel;
|
|
8
8
|
/** Exact rejected output and code-owned validation feedback for this unchanged source. */
|
|
9
9
|
rejectedProposals?: WorkflowConnectionGoalRejection[];
|
|
10
|
+
/** Private independent coverage judgments, not replacement requirements or code-proven semantics. */
|
|
11
|
+
rejectedGoalReviews?: WorkflowReviewedGoalCandidate[];
|
|
10
12
|
signal?: AbortSignal;
|
|
11
13
|
}
|
|
12
14
|
export type WorkflowConnectionGoalRejection = z.infer<typeof workflowConnectionGoalRejectionSchema>;
|
|
@@ -17,6 +19,8 @@ export interface PlanWorkflowConnectionStepInput extends WorkflowConnectionSessi
|
|
|
17
19
|
model: BaseChatModel;
|
|
18
20
|
rejectedProposals?: WorkflowConnectionRejectedProposal[];
|
|
19
21
|
signal?: AbortSignal;
|
|
22
|
+
outline?: WorkflowConnectionOutline;
|
|
23
|
+
bundleId?: string;
|
|
20
24
|
}
|
|
21
25
|
export type WorkflowConnectionRouteGoal = Extract<WorkflowConnectionGoalProposal, {
|
|
22
26
|
kind: 'route';
|
|
@@ -42,6 +46,7 @@ export interface WorkflowConnectionPatchSelection extends Omit<WorkflowConnectio
|
|
|
42
46
|
addTerminals: WorkflowConnectionEndpointSelection[];
|
|
43
47
|
removeTerminals: WorkflowConnectionEndpointSelection[];
|
|
44
48
|
}
|
|
49
|
+
export type WorkflowConnectionPatchContext = Pick<WorkflowConnectionStepDescription, 'context' | 'requirements' | 'edgeCatalog' | 'rootNodeIds' | 'terminals'>;
|
|
45
50
|
export type WorkflowConnectionCompletionRequest = Exclude<WorkflowConnectionStepProposal, WorkflowConnectionPatch>;
|
|
46
51
|
export type WorkflowConnectionStepModelDecision = WorkflowConnectionPatchSelection | WorkflowConnectionCompletionRequest | WorkflowConnectionMaterialRequest | WorkflowConnectionUserDecision;
|
|
47
52
|
export interface WorkflowConnectionStepModelOutput {
|
|
@@ -58,12 +63,14 @@ export interface InvokeConnectionPlanningModelInput<Output extends object> {
|
|
|
58
63
|
schema: ZodType<Output>;
|
|
59
64
|
messages: BaseMessage[];
|
|
60
65
|
sourceFingerprint?: string;
|
|
66
|
+
requestFingerprint?: string;
|
|
61
67
|
signal?: AbortSignal;
|
|
62
68
|
}
|
|
63
69
|
export interface WorkflowConnectionPlanningFailure {
|
|
64
70
|
operation: string;
|
|
65
|
-
stage: 'model-output' | 'contract-validation';
|
|
66
|
-
code: 'MODEL_OUTPUT_INVALID' | 'WORKFLOW_GRAPH_PLANNING_FAILED';
|
|
71
|
+
stage: 'input-validation' | 'model-output' | 'contract-validation';
|
|
72
|
+
code: 'PLANNING_INPUT_INVALID' | 'MODEL_OUTPUT_INVALID' | 'WORKFLOW_GRAPH_PLANNING_FAILED';
|
|
67
73
|
output: unknown;
|
|
68
74
|
sourceFingerprint?: string;
|
|
75
|
+
requestFingerprint?: string;
|
|
69
76
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { BaseChatModel } from '@langchain/core/language_models/chat_models';
|
|
2
|
+
import type { NativeSelectedPlanningInput } from '@openapi-flow/core';
|
|
3
|
+
export interface ReviewNativeInstanceSelectionInput extends NativeSelectedPlanningInput {
|
|
4
|
+
model?: BaseChatModel;
|
|
5
|
+
signal?: AbortSignal;
|
|
6
|
+
}
|
|
7
|
+
export interface NativeInstanceSelectionReviewFailure {
|
|
8
|
+
output: unknown;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BaseChatModel } from '@langchain/core/language_models/chat_models';
|
|
2
2
|
import type { z } from 'zod';
|
|
3
|
-
import type { JsonValueObject, NativeNodePlanningInput, NativePlanningProposal, NativePlanningResult, NativePlanningAssessment, NativePlanningCapabilityMaterial, NativeNodePlanningRecord, NativeInstanceSelectionInput, NativeNodeConfigurationInput, NativeSelectedPlanningInput } from '@openapi-flow/core';
|
|
3
|
+
import type { JsonValueObject, NativeNodePlanningInput, NativePlanningProposal, NativePlanningResult, NativePlanningAssessment, NativePlanningCapabilityMaterial, NativeNodePlanningRecord, NativeInstanceSelectionInput, NativeNodeConfigurationInput, NativeSelectedPlanningInput, NativeInstanceSelectionFeedback } from '@openapi-flow/core';
|
|
4
4
|
export interface PlanNativeNodesInput extends NativeNodePlanningInput {
|
|
5
5
|
model?: BaseChatModel;
|
|
6
6
|
includeExplanations?: boolean;
|
|
@@ -25,6 +25,8 @@ export interface NativeNodeModelProposal {
|
|
|
25
25
|
nativeNodes: NativeNodeModelInstance[];
|
|
26
26
|
gaps: NativePlanningProposal['gaps'];
|
|
27
27
|
}
|
|
28
|
+
/** Used only when code proves that no offered capability has a parameter choice in this call. */
|
|
29
|
+
export type NativeNodeGapOnlyOutput = Pick<NativePlanningProposal, 'gaps'>;
|
|
28
30
|
export interface ExplainedNativeNodeProposal {
|
|
29
31
|
node: NativeNodeModelInstance;
|
|
30
32
|
reason: string;
|
|
@@ -38,7 +40,7 @@ export interface ExplainedNativeNodePlanningOutput {
|
|
|
38
40
|
gaps: NativePlanningProposal['gaps'];
|
|
39
41
|
};
|
|
40
42
|
}
|
|
41
|
-
export type NativeNodePlanningOutput = NativeNodeModelProposal | ExplainedNativeNodePlanningOutput;
|
|
43
|
+
export type NativeNodePlanningOutput = NativeNodeModelProposal | ExplainedNativeNodePlanningOutput | NativeNodeGapOnlyOutput;
|
|
42
44
|
export interface ResolvedNativeNodePlanningOutput {
|
|
43
45
|
proposal: NativeNodeProposal;
|
|
44
46
|
assessment?: NativePlanningAssessment;
|
|
@@ -68,6 +70,8 @@ export type NativeNodePlanningFailure = {
|
|
|
68
70
|
export interface SelectNativeNodeInstancesInput extends NativeInstanceSelectionInput {
|
|
69
71
|
model?: BaseChatModel;
|
|
70
72
|
signal?: AbortSignal;
|
|
73
|
+
/** Explicit independently reviewed rejection. Never causes a hidden retry. */
|
|
74
|
+
feedback?: NativeInstanceSelectionFeedback;
|
|
71
75
|
}
|
|
72
76
|
export interface GenerateNativeNodeParametersInput extends NativeNodeConfigurationInput {
|
|
73
77
|
model?: BaseChatModel;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { WorkflowConnectionSession, WorkflowConnectionSourceRepairRequest, WorkflowConnectionMaterialRepairRequest, WorkflowConnectionGoalPlanningDescription, WorkflowConnectionConflictMaterials, WorkflowReviewedGoalCandidate } from '@openapi-flow/core';
|
|
2
|
+
import type { PlanWorkflowConnectionGoalsInput, WorkflowConnectionGoalRejection, WorkflowConnectionGoalSelection } from './incremental-connection-planning.js';
|
|
3
|
+
export interface PlanWorkflowConnectionGoalRecoveryInput extends PlanWorkflowConnectionGoalsInput {
|
|
4
|
+
rejectedProposals: WorkflowConnectionGoalRejection[];
|
|
5
|
+
}
|
|
6
|
+
export interface WorkflowConnectionGoalRecoveryDescription extends WorkflowConnectionGoalPlanningDescription {
|
|
7
|
+
conflictMaterials: WorkflowConnectionConflictMaterials;
|
|
8
|
+
rejectedProposals: WorkflowConnectionGoalRejection[];
|
|
9
|
+
rejectedGoalReviews?: WorkflowReviewedGoalCandidate[];
|
|
10
|
+
}
|
|
11
|
+
export interface WorkflowConnectionRecoveredGoalSelection {
|
|
12
|
+
kind: 'goals';
|
|
13
|
+
goals: WorkflowConnectionGoalSelection[];
|
|
14
|
+
}
|
|
15
|
+
export interface WorkflowConnectionGoalRecoveryModelOutput {
|
|
16
|
+
decision: WorkflowConnectionRecoveredGoalSelection | WorkflowConnectionMaterialRepairRequest;
|
|
17
|
+
}
|
|
18
|
+
export interface RecoveredWorkflowConnectionGoals {
|
|
19
|
+
kind: 'goals';
|
|
20
|
+
session: WorkflowConnectionSession;
|
|
21
|
+
}
|
|
22
|
+
export type PlanWorkflowConnectionGoalRecoveryResult = RecoveredWorkflowConnectionGoals | WorkflowConnectionSourceRepairRequest;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { BaseChatModel } from '@langchain/core/language_models/chat_models';
|
|
2
|
+
import type { WorkflowConnectionSessionInput, WorkflowConnectionGoalReviewProposal, WorkflowConnectionSessionSource, WorkflowReviewedGoalCandidate } from '@openapi-flow/core';
|
|
3
|
+
export interface ReviewWorkflowConnectionGoalsInput extends WorkflowConnectionSessionInput {
|
|
4
|
+
model: BaseChatModel;
|
|
5
|
+
signal?: AbortSignal;
|
|
6
|
+
}
|
|
7
|
+
export type WorkflowConnectionGoalReviewAssessment = Omit<WorkflowConnectionGoalReviewProposal['assessments'][number], 'factId'>;
|
|
8
|
+
export interface WorkflowConnectionGoalReviewModelOutput {
|
|
9
|
+
assessments: Record<string, WorkflowConnectionGoalReviewAssessment>;
|
|
10
|
+
}
|
|
11
|
+
export interface ValidateWorkflowGoalReviewFeedbackInput extends WorkflowConnectionSessionSource {
|
|
12
|
+
rejectedGoalReviews?: WorkflowReviewedGoalCandidate[];
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { BaseChatModel } from '@langchain/core/language_models/chat_models';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
|
+
import type { workflowConnectionOutlineRejectionSchema } from '../schemas/workflow-connection-outline-rejection-schema.js';
|
|
4
|
+
import type { WorkflowConnectionSessionInput, WorkflowConnectionOutline, WorkflowConnectionStepDescription } from '@openapi-flow/core';
|
|
5
|
+
export interface WorkflowConnectionOutlineRequestInput extends WorkflowConnectionSessionInput {
|
|
6
|
+
/** A revisable grouping hypothesis, never replacement user requirements or execution edges. */
|
|
7
|
+
previousOutline?: WorkflowConnectionOutline;
|
|
8
|
+
}
|
|
9
|
+
export interface WorkflowConnectionOutlineRequestDescription {
|
|
10
|
+
description: WorkflowConnectionStepDescription;
|
|
11
|
+
previousOutline?: WorkflowConnectionOutline;
|
|
12
|
+
requestFingerprint: string;
|
|
13
|
+
}
|
|
14
|
+
export type WorkflowConnectionOutlineRejection = z.infer<typeof workflowConnectionOutlineRejectionSchema>;
|
|
15
|
+
export interface CreateWorkflowConnectionOutlineRejectionInput extends WorkflowConnectionOutlineRequestInput {
|
|
16
|
+
error: unknown;
|
|
17
|
+
}
|
|
18
|
+
export interface PlanWorkflowConnectionOutlineInput extends WorkflowConnectionOutlineRequestInput {
|
|
19
|
+
model: BaseChatModel;
|
|
20
|
+
signal?: AbortSignal;
|
|
21
|
+
rejectedProposals?: WorkflowConnectionOutlineRejection[];
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { BaseChatModel } from '@langchain/core/language_models/chat_models';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
|
+
import type { workflowConnectionRevisionRejectionSchema } from '../schemas/workflow-connection-revision-rejection-schema.js';
|
|
4
|
+
import type { WorkflowConnectionRevisionInput, WorkflowConnectionRevision, WorkflowConnectionMaterialRepairRequest, WorkflowConnectionMaterialRepairReceipt, WorkflowConnectionRejectedProposal, WorkflowConnectionGoalReview } from '@openapi-flow/core';
|
|
5
|
+
import type { WorkflowConnectionGoalSelection, WorkflowConnectionPatchSelection } from './incremental-connection-planning.js';
|
|
6
|
+
export interface PlanWorkflowConnectionRevisionInput extends WorkflowConnectionRevisionInput {
|
|
7
|
+
model: BaseChatModel;
|
|
8
|
+
signal?: AbortSignal;
|
|
9
|
+
rejectedProposals?: WorkflowConnectionRevisionRejection[];
|
|
10
|
+
rejectedConnections?: WorkflowConnectionRejectedProposal[];
|
|
11
|
+
rejectedGoalReviews?: WorkflowReviewedConnectionRevision[];
|
|
12
|
+
}
|
|
13
|
+
export interface WorkflowReviewedConnectionRevision {
|
|
14
|
+
revision: WorkflowConnectionRevision;
|
|
15
|
+
review: WorkflowConnectionGoalReview;
|
|
16
|
+
}
|
|
17
|
+
export type WorkflowConnectionRevisionRejection = z.infer<typeof workflowConnectionRevisionRejectionSchema>;
|
|
18
|
+
export interface CreateWorkflowConnectionRevisionRejectionInput extends WorkflowConnectionRevisionInput {
|
|
19
|
+
error: unknown;
|
|
20
|
+
}
|
|
21
|
+
export interface WorkflowConnectionRevisionSelection {
|
|
22
|
+
kind: 'revise-connections';
|
|
23
|
+
goals: WorkflowConnectionGoalSelection[];
|
|
24
|
+
graphChange: WorkflowConnectionPatchSelection;
|
|
25
|
+
}
|
|
26
|
+
export type WorkflowConnectionRevisionModelDecision = WorkflowConnectionRevisionSelection | WorkflowConnectionMaterialRepairRequest;
|
|
27
|
+
export interface WorkflowConnectionRevisionModelOutput {
|
|
28
|
+
decision: WorkflowConnectionRevisionModelDecision;
|
|
29
|
+
}
|
|
30
|
+
export interface RevisedWorkflowConnections {
|
|
31
|
+
kind: 'revised-connections';
|
|
32
|
+
revision: WorkflowConnectionRevision;
|
|
33
|
+
}
|
|
34
|
+
export type PlanWorkflowConnectionRevisionResult = RevisedWorkflowConnections | WorkflowConnectionMaterialRepairReceipt;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|