@pikku/inspector 0.12.14 → 0.12.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/CHANGELOG.md +33 -0
- package/dist/add/add-ai-agent.js +1 -1
- package/dist/add/add-channel.js +25 -7
- package/dist/add/add-functions.js +31 -13
- package/dist/add/add-gateway.js +1 -1
- package/dist/add/add-http-route.js +23 -1
- package/dist/add/add-mcp-prompt.js +1 -1
- package/dist/add/add-mcp-resource.js +1 -1
- package/dist/add/add-queue-worker.js +1 -1
- package/dist/add/add-schedule.js +1 -1
- package/dist/add/add-trigger.js +1 -1
- package/dist/add/add-workflow.js +1 -1
- package/dist/utils/check-pii-output.d.ts +9 -4
- package/dist/utils/check-pii-output.js +17 -7
- package/dist/utils/custom-types-generator.js +55 -4
- package/dist/utils/ensure-function-metadata.js +1 -1
- package/dist/utils/extract-node-value.d.ts +1 -1
- package/dist/utils/extract-node-value.js +10 -1
- package/dist/utils/get-property-value.d.ts +1 -1
- package/dist/utils/get-property-value.js +35 -9
- package/dist/utils/schema-generator.js +4 -2
- package/dist/utils/workflow/dsl/extract-dsl-workflow.js +43 -9
- package/package.json +2 -2
- package/src/add/add-ai-agent.ts +1 -1
- package/src/add/add-channel.ts +37 -7
- package/src/add/add-functions.ts +47 -13
- package/src/add/add-gateway.ts +1 -1
- package/src/add/add-http-route.ts +26 -1
- package/src/add/add-mcp-prompt.ts +1 -1
- package/src/add/add-mcp-resource.ts +1 -1
- package/src/add/add-queue-worker.ts +1 -1
- package/src/add/add-schedule.ts +1 -1
- package/src/add/add-trigger.ts +1 -1
- package/src/add/add-workflow.test.ts +152 -0
- package/src/add/add-workflow.ts +2 -1
- package/src/add/pii-check.test.ts +70 -28
- package/src/utils/check-pii-output.ts +27 -11
- package/src/utils/custom-types-generator.test.ts +99 -0
- package/src/utils/custom-types-generator.ts +64 -4
- package/src/utils/ensure-function-metadata.ts +3 -1
- package/src/utils/extract-node-value.test.ts +12 -10
- package/src/utils/extract-node-value.ts +15 -1
- package/src/utils/get-property-value.ts +33 -13
- package/src/utils/schema-generator.ts +4 -2
- package/src/utils/workflow/dsl/extract-dsl-workflow.ts +50 -11
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -6,7 +6,6 @@ import type {
|
|
|
6
6
|
BranchStepMeta,
|
|
7
7
|
ParallelGroupStepMeta,
|
|
8
8
|
FanoutStepMeta,
|
|
9
|
-
ReturnStepMeta,
|
|
10
9
|
CancelStepMeta,
|
|
11
10
|
SetStepMeta,
|
|
12
11
|
SwitchStepMeta,
|
|
@@ -436,21 +435,34 @@ function extractExpressionStatement(
|
|
|
436
435
|
outputVar = expr.left.text
|
|
437
436
|
|
|
438
437
|
// Check if this is an assignment to a context variable (set step)
|
|
438
|
+
// But if the RHS is a workflow.do() call, fall through to RPC extraction —
|
|
439
|
+
// reassigning a pre-declared variable with a workflow step is valid and common.
|
|
439
440
|
if (context.contextVars.has(outputVar)) {
|
|
440
|
-
const
|
|
441
|
-
|
|
441
|
+
const rhs = expr.right
|
|
442
|
+
const rhsCall =
|
|
443
|
+
ts.isAwaitExpression(rhs) && ts.isCallExpression(rhs.expression)
|
|
444
|
+
? rhs.expression
|
|
445
|
+
: null
|
|
446
|
+
const isWorkflowCall = rhsCall
|
|
447
|
+
? isWorkflowDoCall(rhsCall, context.checker)
|
|
448
|
+
: false
|
|
449
|
+
|
|
450
|
+
if (!isWorkflowCall) {
|
|
451
|
+
const literalValue = extractLiteralValue(expr.right)
|
|
452
|
+
if (literalValue !== undefined) {
|
|
453
|
+
return {
|
|
454
|
+
type: 'set',
|
|
455
|
+
variable: outputVar,
|
|
456
|
+
value: literalValue,
|
|
457
|
+
} as SetStepMeta
|
|
458
|
+
}
|
|
459
|
+
// Non-literal assignment to context var - use expression as string
|
|
442
460
|
return {
|
|
443
461
|
type: 'set',
|
|
444
462
|
variable: outputVar,
|
|
445
|
-
value:
|
|
463
|
+
value: getSourceText(expr.right),
|
|
446
464
|
} as SetStepMeta
|
|
447
465
|
}
|
|
448
|
-
// Non-literal assignment to context var - use expression as string
|
|
449
|
-
return {
|
|
450
|
-
type: 'set',
|
|
451
|
-
variable: outputVar,
|
|
452
|
-
value: getSourceText(expr.right),
|
|
453
|
-
} as SetStepMeta
|
|
454
466
|
}
|
|
455
467
|
}
|
|
456
468
|
// Use right side as the expression to extract from
|
|
@@ -1327,11 +1339,38 @@ function extractOutputBinding(
|
|
|
1327
1339
|
function extractReturn(
|
|
1328
1340
|
statement: ts.ReturnStatement,
|
|
1329
1341
|
context: ExtractionContext
|
|
1330
|
-
):
|
|
1342
|
+
): WorkflowStepMeta | null {
|
|
1331
1343
|
if (!statement.expression) {
|
|
1332
1344
|
return null
|
|
1333
1345
|
}
|
|
1334
1346
|
|
|
1347
|
+
if (
|
|
1348
|
+
ts.isAwaitExpression(statement.expression) &&
|
|
1349
|
+
ts.isCallExpression(statement.expression.expression)
|
|
1350
|
+
) {
|
|
1351
|
+
const call = statement.expression.expression
|
|
1352
|
+
if (isWorkflowDoCall(call, context.checker)) {
|
|
1353
|
+
return isInlineDoCall(call)
|
|
1354
|
+
? extractInlineStep(call, context)
|
|
1355
|
+
: extractRpcStep(call, context)
|
|
1356
|
+
}
|
|
1357
|
+
if (isWorkflowSleepCall(call, context.checker)) {
|
|
1358
|
+
return extractSleepStep(call, context)
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
if (ts.isCallExpression(statement.expression)) {
|
|
1363
|
+
const call = statement.expression
|
|
1364
|
+
if (isWorkflowDoCall(call, context.checker)) {
|
|
1365
|
+
return isInlineDoCall(call)
|
|
1366
|
+
? extractInlineStep(call, context)
|
|
1367
|
+
: extractRpcStep(call, context)
|
|
1368
|
+
}
|
|
1369
|
+
if (isWorkflowSleepCall(call, context.checker)) {
|
|
1370
|
+
return extractSleepStep(call, context)
|
|
1371
|
+
}
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1335
1374
|
if (!ts.isObjectLiteralExpression(statement.expression)) {
|
|
1336
1375
|
return null
|
|
1337
1376
|
}
|