@openapi-flow/langchain 0.3.15 → 0.3.17
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 +14 -0
- package/dist/arguments/analyze-api-input-answers.js +118 -84
- package/dist/arguments/generate-api-arguments.js +105 -81
- package/dist/bindings/plan-api-bindings.js +1 -0
- package/dist/bindings/plan-api-call-bindings.js +1 -0
- package/dist/bindings/select-api-binding-sources.js +1 -0
- package/dist/model/invoke-structured-model.js +1 -1
- package/dist/prompts/incremental-workflow-connections-prompt.d.ts +2 -0
- package/dist/prompts/incremental-workflow-connections-prompt.js +11 -0
- package/dist/prompts/workflow-requirements-prompt.d.ts +1 -1
- package/dist/prompts/workflow-requirements-prompt.js +2 -0
- package/dist/public-api.d.ts +6 -0
- package/dist/public-api.js +5 -0
- package/dist/requirements/clarify-workflow-requirements.js +17 -3
- package/dist/schemas/connection-planning-field-schemas.d.ts +8 -0
- package/dist/schemas/connection-planning-field-schemas.js +27 -0
- package/dist/schemas/workflow-connection-goal-rejection-schema.d.ts +14 -0
- package/dist/schemas/workflow-connection-goal-rejection-schema.js +20 -0
- package/dist/schemas/workflow-connection-goals-schema.d.ts +4 -0
- package/dist/schemas/workflow-connection-goals-schema.js +53 -0
- package/dist/schemas/workflow-connection-step-schema.d.ts +4 -0
- package/dist/schemas/workflow-connection-step-schema.js +69 -0
- package/dist/selection/select-api-operations.js +1 -0
- package/dist/types/incremental-connection-planning.d.ts +69 -0
- package/dist/types/incremental-connection-planning.js +1 -0
- package/dist/types/native-node-planning.d.ts +3 -0
- package/dist/types/structured-model.d.ts +3 -1
- package/dist/workflow/connections/create-workflow-connection-goal-rejection.d.ts +3 -0
- package/dist/workflow/connections/create-workflow-connection-goal-rejection.js +27 -0
- package/dist/workflow/connections/invoke-connection-planning-model.d.ts +3 -0
- package/dist/workflow/connections/invoke-connection-planning-model.js +38 -0
- package/dist/workflow/connections/plan-workflow-connection-goals.d.ts +4 -0
- package/dist/workflow/connections/plan-workflow-connection-goals.js +72 -0
- package/dist/workflow/connections/plan-workflow-connection-step.d.ts +2 -0
- package/dist/workflow/connections/plan-workflow-connection-step.js +98 -0
- package/dist/workflow/connections/resolve-connection-port-selection.d.ts +4 -0
- package/dist/workflow/connections/resolve-connection-port-selection.js +15 -0
- package/dist/workflow/connections/workflow-connection-planning-error.d.ts +9 -0
- package/dist/workflow/connections/workflow-connection-planning-error.js +28 -0
- package/dist/workflow/generate-native-node-parameters.js +3 -1
- package/dist/workflow/plan-native-instance-dependencies.js +3 -1
- package/dist/workflow/select-native-node-instances.js +3 -1
- package/package.json +2 -2
|
@@ -5,6 +5,7 @@ import { nativeNodeParametersPrompt } from '../prompts/native-node-planning-prom
|
|
|
5
5
|
import { NativeNodePlanningError } from './native-node-planning-error.js';
|
|
6
6
|
/** Zero or one value call for one selected instance; no hidden ownership or connection planning. */
|
|
7
7
|
export async function generateNativeNodeParameters(input) {
|
|
8
|
+
input.signal?.throwIfAborted();
|
|
8
9
|
if (input.model !== undefined &&
|
|
9
10
|
(!input.model || typeof input.model.withStructuredOutput !== 'function'))
|
|
10
11
|
throw new Error('generateNativeNodeParameters.model must support structured output when supplied');
|
|
@@ -62,7 +63,8 @@ export async function generateNativeNodeParameters(input) {
|
|
|
62
63
|
? {}
|
|
63
64
|
: { replies: description.replies }),
|
|
64
65
|
})),
|
|
65
|
-
]);
|
|
66
|
+
], input.signal === undefined ? undefined : { signal: input.signal });
|
|
67
|
+
input.signal?.throwIfAborted();
|
|
66
68
|
try {
|
|
67
69
|
// Validate output separately so callers can distinguish a malformed reply from stale source material.
|
|
68
70
|
schema.parse(output);
|
|
@@ -6,6 +6,7 @@ import { serializeStructuredOutputSchema } from '../schemas/serialize-structured
|
|
|
6
6
|
import { NativeNodePlanningError } from './native-node-planning-error.js';
|
|
7
7
|
/** Zero or one producer-choice call; no parameters, output contracts or runtime DAG edges. */
|
|
8
8
|
export async function planNativeInstanceDependencies(input) {
|
|
9
|
+
input.signal?.throwIfAborted();
|
|
9
10
|
if (input.model !== undefined &&
|
|
10
11
|
(!input.model || typeof input.model.withStructuredOutput !== 'function'))
|
|
11
12
|
throw new Error('planNativeInstanceDependencies.model must support structured output when supplied');
|
|
@@ -30,7 +31,8 @@ export async function planNativeInstanceDependencies(input) {
|
|
|
30
31
|
.invoke([
|
|
31
32
|
new SystemMessage(nativeInstanceDependenciesPrompt),
|
|
32
33
|
new HumanMessage(JSON.stringify(context)),
|
|
33
|
-
]);
|
|
34
|
+
], input.signal === undefined ? undefined : { signal: input.signal });
|
|
35
|
+
input.signal?.throwIfAborted();
|
|
34
36
|
try {
|
|
35
37
|
if (!isDeepStrictEqual(describeNativeInstanceDependencies(input), context) ||
|
|
36
38
|
explanations !== input.includeExplanations)
|
|
@@ -6,6 +6,7 @@ import { nativeInstanceSelectionPrompt } from '../prompts/native-node-planning-p
|
|
|
6
6
|
import { NativeNodePlanningError } from './native-node-planning-error.js';
|
|
7
7
|
/** One checkpointable role/ownership selection; parameter values are a separate public stage. */
|
|
8
8
|
export async function selectNativeNodeInstances(input) {
|
|
9
|
+
input.signal?.throwIfAborted();
|
|
9
10
|
if (input.model !== undefined &&
|
|
10
11
|
(!input.model || typeof input.model.withStructuredOutput !== 'function'))
|
|
11
12
|
throw new Error('selectNativeNodeInstances.model must support structured output when supplied');
|
|
@@ -38,7 +39,8 @@ export async function selectNativeNodeInstances(input) {
|
|
|
38
39
|
.invoke([
|
|
39
40
|
new SystemMessage(nativeInstanceSelectionPrompt),
|
|
40
41
|
new HumanMessage(JSON.stringify(context)),
|
|
41
|
-
]);
|
|
42
|
+
], input.signal === undefined ? undefined : { signal: input.signal });
|
|
43
|
+
input.signal?.throwIfAborted();
|
|
42
44
|
try {
|
|
43
45
|
if (!isDeepStrictEqual(describeNativeInstanceSelection(input).context, context) ||
|
|
44
46
|
JSON.stringify([
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openapi-flow/langchain",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.17",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Composable LangChain planning for OpenAPI workflows",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@openapi-flow/core": "0.3.
|
|
31
|
+
"@openapi-flow/core": "0.3.17"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"@langchain/core": "^1.0.0",
|