@pikku/inspector 0.11.2 → 0.12.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/CHANGELOG.md +11 -1
- package/OPTIMIZATION-PLAN.md +195 -0
- package/dist/add/add-ai-agent.d.ts +2 -0
- package/dist/add/add-ai-agent.js +314 -0
- package/dist/add/add-channel.js +69 -61
- package/dist/add/add-cli.js +36 -18
- package/dist/add/add-file-with-factory.js +2 -0
- package/dist/add/add-functions.js +250 -75
- package/dist/add/add-http-route.d.ts +19 -10
- package/dist/add/add-http-route.js +152 -66
- package/dist/add/add-http-routes.d.ts +5 -0
- package/dist/add/add-http-routes.js +159 -0
- package/dist/add/add-keyed-wiring.d.ts +12 -0
- package/dist/add/add-keyed-wiring.js +97 -0
- package/dist/add/add-mcp-prompt.js +14 -9
- package/dist/add/add-mcp-resource.js +14 -9
- package/dist/add/add-middleware.d.ts +1 -4
- package/dist/add/add-middleware.js +364 -79
- package/dist/add/add-permission.d.ts +1 -1
- package/dist/add/add-permission.js +152 -40
- package/dist/add/add-queue-worker.js +18 -12
- package/dist/add/add-rpc-invocations.js +14 -0
- package/dist/add/add-schedule.js +11 -5
- package/dist/add/add-secret.d.ts +3 -0
- package/dist/add/add-secret.js +82 -0
- package/dist/add/add-trigger.d.ts +2 -0
- package/dist/add/add-trigger.js +87 -0
- package/dist/add/add-variable.d.ts +1 -0
- package/dist/add/add-variable.js +8 -0
- package/dist/add/add-workflow-graph.d.ts +3 -2
- package/dist/add/add-workflow-graph.js +143 -406
- package/dist/add/add-workflow.js +6 -4
- package/dist/error-codes.d.ts +14 -1
- package/dist/error-codes.js +19 -1
- package/dist/index.d.ts +9 -8
- package/dist/index.js +5 -4
- package/dist/inspector.d.ts +1 -1
- package/dist/inspector.js +91 -14
- package/dist/schema-generator.d.ts +1 -0
- package/dist/schema-generator.js +1 -0
- package/dist/types-map.js +10 -1
- package/dist/types.d.ts +163 -39
- package/dist/utils/compute-required-schemas.d.ts +4 -0
- package/dist/utils/compute-required-schemas.js +41 -0
- package/dist/utils/contract-hashes.d.ts +35 -0
- package/dist/utils/contract-hashes.js +202 -0
- package/dist/utils/custom-types-generator.d.ts +9 -0
- package/dist/utils/custom-types-generator.js +71 -0
- package/dist/utils/detect-schema-vendor.d.ts +22 -0
- package/dist/utils/detect-schema-vendor.js +76 -0
- package/dist/utils/ensure-function-metadata.d.ts +5 -2
- package/dist/utils/ensure-function-metadata.js +220 -6
- package/dist/utils/extract-function-name.d.ts +5 -16
- package/dist/utils/extract-function-name.js +86 -291
- package/dist/utils/extract-services.d.ts +2 -1
- package/dist/utils/extract-services.js +25 -1
- package/dist/utils/filter-inspector-state.js +107 -23
- package/dist/utils/get-property-value.d.ts +6 -1
- package/dist/utils/get-property-value.js +28 -3
- package/dist/utils/hash.d.ts +2 -0
- package/dist/utils/hash.js +23 -0
- package/dist/utils/middleware.d.ts +7 -30
- package/dist/utils/middleware.js +80 -66
- package/dist/utils/permissions.d.ts +2 -2
- package/dist/utils/permissions.js +10 -10
- package/dist/utils/post-process.d.ts +9 -10
- package/dist/utils/post-process.js +231 -24
- package/dist/utils/resolve-external-package.d.ts +12 -0
- package/dist/utils/resolve-external-package.js +34 -0
- package/dist/utils/resolve-function-types.d.ts +6 -0
- package/dist/utils/resolve-function-types.js +29 -0
- package/dist/utils/resolve-identifier.d.ts +10 -0
- package/dist/utils/resolve-identifier.js +36 -0
- package/dist/utils/resolve-versions.d.ts +2 -0
- package/dist/utils/resolve-versions.js +78 -0
- package/dist/utils/schema-generator.d.ts +9 -0
- package/dist/utils/schema-generator.js +209 -0
- package/dist/utils/serialize-inspector-state.d.ts +59 -22
- package/dist/utils/serialize-inspector-state.js +92 -20
- package/dist/utils/serialize-mcp-json.d.ts +2 -0
- package/dist/utils/serialize-mcp-json.js +99 -0
- package/dist/utils/serialize-middleware-groups-meta.d.ts +12 -0
- package/dist/utils/serialize-middleware-groups-meta.js +28 -0
- package/dist/utils/serialize-openapi-json.d.ts +85 -0
- package/dist/utils/serialize-openapi-json.js +151 -0
- package/dist/utils/serialize-permissions-groups-meta.d.ts +6 -0
- package/dist/utils/serialize-permissions-groups-meta.js +31 -0
- package/dist/utils/workflow/dsl/deserialize-dsl-workflow.js +34 -102
- package/dist/utils/workflow/dsl/extract-dsl-workflow.js +23 -4
- package/dist/utils/workflow/graph/convert-dsl-to-graph.js +12 -10
- package/dist/utils/workflow/graph/finalize-workflow-wires.d.ts +3 -0
- package/dist/utils/workflow/graph/finalize-workflow-wires.js +276 -0
- package/dist/utils/workflow/graph/finalize-workflows.d.ts +2 -0
- package/dist/utils/workflow/graph/finalize-workflows.js +75 -0
- package/dist/utils/workflow/graph/index.d.ts +2 -0
- package/dist/utils/workflow/graph/index.js +2 -0
- package/dist/utils/workflow/graph/serialize-workflow-graph.d.ts +0 -8
- package/dist/utils/workflow/graph/serialize-workflow-graph.js +1 -3
- package/dist/utils/workflow/graph/workflow-graph.types.d.ts +53 -79
- package/dist/utils/workflow/graph/workflow-graph.types.js +1 -1
- package/dist/visit.js +11 -6
- package/package.json +14 -4
- package/src/add/add-ai-agent.ts +468 -0
- package/src/add/add-channel.ts +82 -79
- package/src/add/add-cli.ts +49 -20
- package/src/add/add-file-with-factory.ts +2 -0
- package/src/add/add-functions.ts +330 -86
- package/src/add/add-http-route.ts +245 -88
- package/src/add/add-http-routes.ts +228 -0
- package/src/add/add-keyed-wiring.ts +151 -0
- package/src/add/add-mcp-prompt.ts +26 -15
- package/src/add/add-mcp-resource.ts +27 -15
- package/src/add/add-middleware.ts +482 -80
- package/src/add/add-permission.ts +199 -40
- package/src/add/add-queue-worker.ts +24 -19
- package/src/add/add-rpc-invocations.ts +17 -0
- package/src/add/add-schedule.ts +16 -11
- package/src/add/add-secret.ts +140 -0
- package/src/add/add-trigger.ts +154 -0
- package/src/add/add-variable.ts +9 -0
- package/src/add/add-workflow-graph.ts +180 -522
- package/src/add/add-workflow.ts +5 -4
- package/src/error-codes.ts +24 -1
- package/src/index.ts +22 -13
- package/src/inspector.ts +129 -17
- package/src/schema-generator.ts +1 -0
- package/src/types-map.ts +12 -1
- package/src/types.ts +175 -58
- package/src/utils/compute-required-schemas.ts +49 -0
- package/src/utils/contract-hashes.test.ts +528 -0
- package/src/utils/contract-hashes.ts +290 -0
- package/src/utils/custom-types-generator.ts +88 -0
- package/src/utils/detect-schema-vendor.ts +90 -0
- package/src/utils/ensure-function-metadata.ts +324 -7
- package/src/utils/extract-function-name.ts +101 -351
- package/src/utils/extract-services.ts +35 -2
- package/src/utils/filter-inspector-state.test.ts +34 -20
- package/src/utils/filter-inspector-state.ts +140 -31
- package/src/utils/get-property-value.ts +42 -4
- package/src/utils/hash.ts +26 -0
- package/src/utils/middleware.test.ts +204 -0
- package/src/utils/middleware.ts +129 -67
- package/src/utils/permissions.test.ts +35 -12
- package/src/utils/permissions.ts +10 -10
- package/src/utils/post-process.ts +283 -43
- package/src/utils/resolve-external-package.ts +42 -0
- package/src/utils/resolve-function-types.ts +42 -0
- package/src/utils/resolve-identifier.ts +46 -0
- package/src/utils/resolve-versions.test.ts +249 -0
- package/src/utils/resolve-versions.ts +105 -0
- package/src/utils/schema-generator.ts +329 -0
- package/src/utils/serialize-inspector-state.ts +163 -40
- package/src/utils/serialize-mcp-json.ts +145 -0
- package/src/utils/serialize-middleware-groups-meta.ts +33 -0
- package/src/utils/serialize-openapi-json.ts +277 -0
- package/src/utils/serialize-permissions-groups-meta.ts +35 -0
- package/src/utils/test-data/inspector-state.json +69 -66
- package/src/utils/workflow/dsl/deserialize-dsl-workflow.ts +43 -119
- package/src/utils/workflow/dsl/extract-dsl-workflow.ts +24 -4
- package/src/utils/workflow/graph/convert-dsl-to-graph.ts +17 -10
- package/src/utils/workflow/graph/finalize-workflow-wires.ts +310 -0
- package/src/utils/workflow/graph/finalize-workflows.ts +100 -0
- package/src/utils/workflow/graph/index.ts +5 -0
- package/src/utils/workflow/graph/serialize-workflow-graph.ts +1 -8
- package/src/utils/workflow/graph/workflow-graph.types.ts +29 -78
- package/src/visit.ts +12 -6
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/add/add-forge-credential.d.ts +0 -8
- package/dist/add/add-forge-credential.js +0 -77
- package/dist/add/add-forge-node.d.ts +0 -7
- package/dist/add/add-forge-node.js +0 -77
- package/dist/add/add-mcp-tool.d.ts +0 -2
- package/dist/add/add-mcp-tool.js +0 -81
- package/dist/utils/extract-service-metadata.d.ts +0 -19
- package/dist/utils/extract-service-metadata.js +0 -244
- package/dist/utils/write-service-metadata.d.ts +0 -13
- package/dist/utils/write-service-metadata.js +0 -37
- package/src/add/add-forge-credential.ts +0 -119
- package/src/add/add-forge-node.ts +0 -132
- package/src/add/add-mcp-tool.ts +0 -141
- package/src/utils/extract-service-metadata.ts +0 -353
- package/src/utils/write-service-metadata.ts +0 -51
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import type { FunctionsMeta } from '@pikku/core'
|
|
2
|
+
import { isVersionedId, formatVersionedId, parseVersionedId } from '@pikku/core'
|
|
3
|
+
import type { SerializedWorkflowGraph } from './workflow-graph.types.js'
|
|
4
|
+
import { canonicalJSON, hashString } from '../../hash.js'
|
|
5
|
+
import { convertDslToGraph } from './convert-dsl-to-graph.js'
|
|
6
|
+
import type { InspectorState } from '../../../types.js'
|
|
7
|
+
|
|
8
|
+
export function finalizeWorkflows(state: InspectorState): void {
|
|
9
|
+
const { workflows, functions } = state
|
|
10
|
+
const functionsMeta = functions.meta
|
|
11
|
+
|
|
12
|
+
for (const [name, meta] of Object.entries(workflows.meta)) {
|
|
13
|
+
const graph = convertDslToGraph(name, meta)
|
|
14
|
+
stampVersionsOnGraph(graph, functionsMeta)
|
|
15
|
+
computeStepHashes(graph, functionsMeta)
|
|
16
|
+
graph.graphHash = computeGraphHash(graph)
|
|
17
|
+
workflows.graphMeta[name] = graph
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
for (const graph of Object.values(workflows.graphMeta)) {
|
|
21
|
+
if (graph.graphHash) {
|
|
22
|
+
continue
|
|
23
|
+
}
|
|
24
|
+
stampVersionsOnGraph(graph, functionsMeta)
|
|
25
|
+
computeStepHashes(graph, functionsMeta)
|
|
26
|
+
graph.graphHash = computeGraphHash(graph)
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function stampVersionsOnGraph(
|
|
31
|
+
graph: SerializedWorkflowGraph,
|
|
32
|
+
functionsMeta: FunctionsMeta
|
|
33
|
+
): void {
|
|
34
|
+
for (const node of Object.values(graph.nodes)) {
|
|
35
|
+
if (!('rpcName' in node) || typeof node.rpcName !== 'string') {
|
|
36
|
+
continue
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (isVersionedId(node.rpcName)) {
|
|
40
|
+
continue
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const meta = functionsMeta[node.rpcName]
|
|
44
|
+
if (meta?.version !== undefined) {
|
|
45
|
+
node.rpcName = formatVersionedId(node.rpcName, meta.version)
|
|
46
|
+
} else {
|
|
47
|
+
const latestVersion = findLatestVersion(node.rpcName, functionsMeta)
|
|
48
|
+
if (latestVersion > 0) {
|
|
49
|
+
node.rpcName = formatVersionedId(node.rpcName, latestVersion)
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function findLatestVersion(
|
|
56
|
+
baseName: string,
|
|
57
|
+
functionsMeta: FunctionsMeta
|
|
58
|
+
): number {
|
|
59
|
+
let max = 0
|
|
60
|
+
for (const id of Object.keys(functionsMeta)) {
|
|
61
|
+
const parsed = parseVersionedId(id)
|
|
62
|
+
if (parsed.baseName === baseName && parsed.version !== null) {
|
|
63
|
+
max = Math.max(max, parsed.version)
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return max
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function computeStepHashes(
|
|
70
|
+
graph: SerializedWorkflowGraph,
|
|
71
|
+
functionsMeta: FunctionsMeta
|
|
72
|
+
): void {
|
|
73
|
+
for (const node of Object.values(graph.nodes)) {
|
|
74
|
+
if (!('rpcName' in node) || typeof node.rpcName !== 'string') {
|
|
75
|
+
continue
|
|
76
|
+
}
|
|
77
|
+
const rpcName: string = node.rpcName
|
|
78
|
+
let meta = functionsMeta[rpcName]
|
|
79
|
+
if (!meta) {
|
|
80
|
+
const { baseName } = parseVersionedId(rpcName)
|
|
81
|
+
meta = functionsMeta[baseName]
|
|
82
|
+
}
|
|
83
|
+
;(node as Record<string, unknown>).stepHash = hashString(
|
|
84
|
+
`${node.nodeId}:${meta?.contractHash ?? ''}`,
|
|
85
|
+
12
|
|
86
|
+
)
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function computeGraphHash(graph: SerializedWorkflowGraph): string {
|
|
91
|
+
return hashString(
|
|
92
|
+
canonicalJSON({
|
|
93
|
+
source: graph.source,
|
|
94
|
+
context: graph.context,
|
|
95
|
+
nodes: graph.nodes,
|
|
96
|
+
entryNodeIds: graph.entryNodeIds,
|
|
97
|
+
}),
|
|
98
|
+
12
|
|
99
|
+
)
|
|
100
|
+
}
|
|
@@ -4,3 +4,8 @@
|
|
|
4
4
|
export * from './workflow-graph.types.js'
|
|
5
5
|
export { serializeWorkflowGraph } from './serialize-workflow-graph.js'
|
|
6
6
|
export { convertDslToGraph } from './convert-dsl-to-graph.js'
|
|
7
|
+
export { finalizeWorkflows } from './finalize-workflows.js'
|
|
8
|
+
export {
|
|
9
|
+
finalizeWorkflowHelperTypes,
|
|
10
|
+
finalizeWorkflowWires,
|
|
11
|
+
} from './finalize-workflow-wires.js'
|
|
@@ -82,10 +82,6 @@ function serializeNext(
|
|
|
82
82
|
export function serializeWorkflowGraph(
|
|
83
83
|
definition: {
|
|
84
84
|
name: string
|
|
85
|
-
wires: {
|
|
86
|
-
http?: { route: string; method: string }
|
|
87
|
-
queue?: string
|
|
88
|
-
}
|
|
89
85
|
graph: Record<
|
|
90
86
|
string,
|
|
91
87
|
{
|
|
@@ -163,11 +159,10 @@ export function serializeWorkflowGraph(
|
|
|
163
159
|
|
|
164
160
|
return {
|
|
165
161
|
name: definition.name,
|
|
166
|
-
|
|
162
|
+
pikkuFuncId: definition.name, // For graph workflows, pikkuFuncId is the workflow name
|
|
167
163
|
source: 'graph' as const,
|
|
168
164
|
description: options?.description,
|
|
169
165
|
tags: options?.tags,
|
|
170
|
-
wires: definition.wires as SerializedWorkflowGraph['wires'],
|
|
171
166
|
nodes,
|
|
172
167
|
entryNodeIds,
|
|
173
168
|
}
|
|
@@ -179,7 +174,6 @@ export function serializeWorkflowGraph(
|
|
|
179
174
|
*/
|
|
180
175
|
export function deserializeWorkflowGraph(serialized: SerializedWorkflowGraph): {
|
|
181
176
|
name: string
|
|
182
|
-
wires: SerializedWorkflowGraph['wires']
|
|
183
177
|
graph: Record<
|
|
184
178
|
string,
|
|
185
179
|
{
|
|
@@ -216,7 +210,6 @@ export function deserializeWorkflowGraph(serialized: SerializedWorkflowGraph): {
|
|
|
216
210
|
|
|
217
211
|
return {
|
|
218
212
|
name: serialized.name,
|
|
219
|
-
wires: serialized.wires,
|
|
220
213
|
graph,
|
|
221
214
|
entryNodeIds: serialized.entryNodeIds,
|
|
222
215
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Serialized types for workflow graphs
|
|
3
3
|
* These are extracted by the inspector and stored as JSON
|
|
4
|
-
* Can be created from code (
|
|
4
|
+
* Can be created from code (pikkuWorkflowGraph) or UI
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -138,6 +138,8 @@ export interface FunctionNode extends BaseNode {
|
|
|
138
138
|
input?: Record<string, unknown | DataRef>
|
|
139
139
|
/** Output variable name for storing result */
|
|
140
140
|
outputVar?: string
|
|
141
|
+
/** Hash of nodeId + RPC input/output schemas for version detection */
|
|
142
|
+
stepHash?: string
|
|
141
143
|
}
|
|
142
144
|
|
|
143
145
|
/**
|
|
@@ -168,80 +170,6 @@ export const isFunctionNode = (
|
|
|
168
170
|
export const isFlowNode = (node: SerializedGraphNode): node is FlowNode =>
|
|
169
171
|
'flow' in node
|
|
170
172
|
|
|
171
|
-
/**
|
|
172
|
-
* HTTP wire configuration with startNode
|
|
173
|
-
*/
|
|
174
|
-
export interface HttpWire {
|
|
175
|
-
route: string
|
|
176
|
-
method: 'get' | 'post' | 'put' | 'patch' | 'delete'
|
|
177
|
-
startNode: string
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* Channel wire configuration
|
|
182
|
-
*/
|
|
183
|
-
export interface ChannelWire {
|
|
184
|
-
name: string
|
|
185
|
-
onConnect?: string
|
|
186
|
-
onDisconnect?: string
|
|
187
|
-
onMessage?: string
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* Queue wire configuration
|
|
192
|
-
*/
|
|
193
|
-
export interface QueueWire {
|
|
194
|
-
name: string
|
|
195
|
-
startNode: string
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
/**
|
|
199
|
-
* CLI wire configuration
|
|
200
|
-
*/
|
|
201
|
-
export interface CliWire {
|
|
202
|
-
command: string
|
|
203
|
-
startNode: string
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* MCP wire configurations
|
|
208
|
-
*/
|
|
209
|
-
export interface McpWires {
|
|
210
|
-
tool?: Array<{ name: string; startNode: string }>
|
|
211
|
-
prompt?: Array<{ name: string; startNode: string }>
|
|
212
|
-
resource?: Array<{ uri: string; startNode: string }>
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
* Schedule wire configuration
|
|
217
|
-
*/
|
|
218
|
-
export interface ScheduleWire {
|
|
219
|
-
cron?: string
|
|
220
|
-
interval?: string
|
|
221
|
-
startNode: string
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
/**
|
|
225
|
-
* Trigger wire configuration
|
|
226
|
-
*/
|
|
227
|
-
export interface TriggerWire {
|
|
228
|
-
name: string
|
|
229
|
-
startNode: string
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
/**
|
|
233
|
-
* All wire configurations for workflows
|
|
234
|
-
*/
|
|
235
|
-
export interface WorkflowWiresConfig {
|
|
236
|
-
http?: HttpWire[]
|
|
237
|
-
channel?: ChannelWire[]
|
|
238
|
-
queue?: QueueWire[]
|
|
239
|
-
cli?: CliWire[]
|
|
240
|
-
mcp?: McpWires
|
|
241
|
-
schedule?: ScheduleWire[]
|
|
242
|
-
trigger?: TriggerWire[]
|
|
243
|
-
}
|
|
244
|
-
|
|
245
173
|
/**
|
|
246
174
|
* Workflow source type
|
|
247
175
|
* - 'dsl': Pure DSL workflow (pikkuWorkflowFunc) - can be round-tripped to code
|
|
@@ -257,7 +185,7 @@ export interface SerializedWorkflowGraph {
|
|
|
257
185
|
/** Workflow name */
|
|
258
186
|
name: string
|
|
259
187
|
/** Pikku function name (for runtime registration) */
|
|
260
|
-
|
|
188
|
+
pikkuFuncId: string
|
|
261
189
|
/** Source type: 'dsl' for pikkuWorkflowFunc, 'graph' for pikkuWorkflowGraph */
|
|
262
190
|
source: WorkflowSourceType
|
|
263
191
|
/** Optional description */
|
|
@@ -266,12 +194,35 @@ export interface SerializedWorkflowGraph {
|
|
|
266
194
|
tags?: string[]
|
|
267
195
|
/** Workflow context/state variables (from Zod schema) */
|
|
268
196
|
context?: WorkflowContext
|
|
269
|
-
/** Wires - how the workflow is triggered */
|
|
270
|
-
wires: WorkflowWiresConfig
|
|
271
197
|
/** Serialized nodes */
|
|
272
198
|
nodes: Record<string, SerializedGraphNode>
|
|
273
199
|
/** Entry node(s) - first nodes to execute */
|
|
274
200
|
entryNodeIds: string[]
|
|
201
|
+
/** Hash of graph topology (nodes, edges, input mappings) */
|
|
202
|
+
graphHash?: string
|
|
203
|
+
/** Wire entry points (HTTP, channel, queue, etc.) that trigger this workflow */
|
|
204
|
+
wires?: WorkflowWires
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export interface WorkflowWires {
|
|
208
|
+
http?: Array<{ route: string; method: string; startNode: string }>
|
|
209
|
+
channel?: Array<{
|
|
210
|
+
name: string
|
|
211
|
+
route: string
|
|
212
|
+
onConnect?: string
|
|
213
|
+
onMessage?: string
|
|
214
|
+
onDisconnect?: string
|
|
215
|
+
onMessageRoute?: Record<string, string>
|
|
216
|
+
}>
|
|
217
|
+
queue?: Array<{ name: string; startNode: string }>
|
|
218
|
+
cli?: Array<{ command: string; startNode: string }>
|
|
219
|
+
mcp?: {
|
|
220
|
+
tool?: Array<{ name: string; startNode: string }>
|
|
221
|
+
prompt?: Array<{ name: string; startNode: string }>
|
|
222
|
+
resource?: Array<{ uri: string; startNode: string }>
|
|
223
|
+
}
|
|
224
|
+
schedule?: Array<{ cron: string; startNode: string }>
|
|
225
|
+
trigger?: Array<{ name: string; startNode: string }>
|
|
275
226
|
}
|
|
276
227
|
|
|
277
228
|
/**
|
package/src/visit.ts
CHANGED
|
@@ -2,11 +2,12 @@ import * as ts from 'typescript'
|
|
|
2
2
|
import { addFileWithFactory } from './add/add-file-with-factory.js'
|
|
3
3
|
import { addFileExtendsCoreType } from './add/add-file-extends-core-type.js'
|
|
4
4
|
import { addHTTPRoute } from './add/add-http-route.js'
|
|
5
|
+
import { addHTTPRoutes } from './add/add-http-routes.js'
|
|
5
6
|
import { addSchedule } from './add/add-schedule.js'
|
|
7
|
+
import { addTrigger } from './add/add-trigger.js'
|
|
6
8
|
import { addQueueWorker } from './add/add-queue-worker.js'
|
|
7
9
|
import { addWorkflow } from './add/add-workflow.js'
|
|
8
10
|
import { addMCPResource } from './add/add-mcp-resource.js'
|
|
9
|
-
import { addMCPTool } from './add/add-mcp-tool.js'
|
|
10
11
|
import { addMCPPrompt } from './add/add-mcp-prompt.js'
|
|
11
12
|
import { InspectorState, InspectorLogger, InspectorOptions } from './types.js'
|
|
12
13
|
import { addFunctions } from './add/add-functions.js'
|
|
@@ -15,9 +16,10 @@ import { addRPCInvocations } from './add/add-rpc-invocations.js'
|
|
|
15
16
|
import { addMiddleware } from './add/add-middleware.js'
|
|
16
17
|
import { addPermission } from './add/add-permission.js'
|
|
17
18
|
import { addCLI, addCLIRenderers } from './add/add-cli.js'
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
19
|
+
import { addSecret, addOAuth2Credential } from './add/add-secret.js'
|
|
20
|
+
import { addVariable } from './add/add-variable.js'
|
|
20
21
|
import { addWorkflowGraph } from './add/add-workflow-graph.js'
|
|
22
|
+
import { addAIAgent } from './add/add-ai-agent.js'
|
|
21
23
|
|
|
22
24
|
export const visitSetup = (
|
|
23
25
|
logger: InspectorLogger,
|
|
@@ -93,18 +95,22 @@ export const visitRoutes = (
|
|
|
93
95
|
options: InspectorOptions
|
|
94
96
|
) => {
|
|
95
97
|
addFunctions(logger, node, checker, state, options)
|
|
98
|
+
addSecret(logger, node, checker, state, options)
|
|
99
|
+
addOAuth2Credential(logger, node, checker, state, options)
|
|
100
|
+
addVariable(logger, node, checker, state, options)
|
|
101
|
+
|
|
96
102
|
addHTTPRoute(logger, node, checker, state, options)
|
|
103
|
+
addHTTPRoutes(logger, node, checker, state, options)
|
|
97
104
|
addSchedule(logger, node, checker, state, options)
|
|
105
|
+
addTrigger(logger, node, checker, state, options)
|
|
98
106
|
addQueueWorker(logger, node, checker, state, options)
|
|
99
107
|
addChannel(logger, node, checker, state, options)
|
|
100
108
|
addCLI(logger, node, checker, state, options)
|
|
101
109
|
addCLIRenderers(logger, node, checker, state, options)
|
|
102
110
|
addMCPResource(logger, node, checker, state, options)
|
|
103
|
-
addMCPTool(logger, node, checker, state, options)
|
|
104
111
|
addMCPPrompt(logger, node, checker, state, options)
|
|
105
|
-
addForgeNode(logger, node, checker, state, options)
|
|
106
|
-
addForgeCredential(logger, node, checker, state, options)
|
|
107
112
|
addWorkflowGraph(logger, node, checker, state, options)
|
|
113
|
+
addAIAgent(logger, node, checker, state, options)
|
|
108
114
|
|
|
109
115
|
ts.forEachChild(node, (child) =>
|
|
110
116
|
visitRoutes(logger, checker, child, state, options)
|