@pikku/inspector 0.12.55 → 0.12.58
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 +168 -0
- package/dist/add/add-ai-agent.js +25 -0
- package/dist/add/add-ai-scorer.d.ts +2 -0
- package/dist/add/add-ai-scorer.js +61 -0
- package/dist/add/add-wire-addon.js +16 -0
- package/dist/add/scenario-instrumentation.d.ts +6 -1
- package/dist/add/scenario-instrumentation.js +6 -0
- package/dist/error-codes.d.ts +2 -0
- package/dist/error-codes.js +3 -0
- package/dist/inspector.js +13 -4
- package/dist/types.d.ts +20 -0
- package/dist/utils/filter-inspector-state.js +8 -0
- package/dist/utils/post-process.d.ts +28 -3
- package/dist/utils/post-process.js +85 -15
- package/dist/utils/serialize-inspector-state.d.ts +9 -0
- package/dist/utils/serialize-inspector-state.js +8 -0
- package/dist/utils/workflow/dsl/extract-dsl-workflow.js +13 -4
- package/dist/utils/workflow/dsl/patterns.d.ts +2 -1
- package/dist/utils/workflow/dsl/patterns.js +8 -5
- package/dist/utils/workflow/graph/serialize-workflow-graph.js +2 -10
- package/dist/visit.js +2 -0
- package/package.json +3 -3
- package/src/add/add-ai-agent.ts +35 -0
- package/src/add/add-ai-scorer.test.ts +197 -0
- package/src/add/add-ai-scorer.ts +83 -0
- package/src/add/add-scenario-step.test.ts +19 -0
- package/src/add/add-wire-addon.test.ts +43 -0
- package/src/add/add-wire-addon.ts +14 -0
- package/src/add/scenario-instrumentation.ts +6 -0
- package/src/error-codes.ts +4 -0
- package/src/inspector.ts +15 -4
- package/src/types.ts +17 -0
- package/src/utils/filter-inspector-state.ts +8 -0
- package/src/utils/post-process.test.ts +71 -0
- package/src/utils/post-process.ts +98 -16
- package/src/utils/serialize-inspector-state.ts +14 -0
- package/src/utils/workflow/dsl/extract-approval-policy.test.ts +68 -0
- package/src/utils/workflow/dsl/extract-dsl-workflow.ts +12 -4
- package/src/utils/workflow/dsl/patterns.ts +8 -5
- package/src/utils/workflow/graph/serialize-workflow-graph.ts +2 -15
- package/src/visit.ts +2 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/src/utils/secret-brokers.test.ts +0 -53
- package/src/utils/secret-brokers.ts +0 -11
|
@@ -77,20 +77,23 @@ export function getScenarioStepPhase(
|
|
|
77
77
|
/**
|
|
78
78
|
* The expectation helpers that assert without being a `then`.
|
|
79
79
|
*
|
|
80
|
-
* `expectService` and `
|
|
81
|
-
* steps, so they carry no phase and never reach the step meta — but
|
|
82
|
-
* a witness: a recorded service call,
|
|
83
|
-
* a scenario whose only assertion is one of these
|
|
80
|
+
* `expectService`, `expectError` and `expectScore` are inline steps rather than
|
|
81
|
+
* scenario steps, so they carry no phase and never reach the step meta — but
|
|
82
|
+
* each one is a witness: a recorded service call, a refusal, or a graded run.
|
|
83
|
+
* PKU680 has to see them, or a scenario whose only assertion is one of these
|
|
84
|
+
* reads as asserting nothing.
|
|
84
85
|
*/
|
|
85
86
|
const SCENARIO_EXPECTATION_CALLS = [
|
|
86
87
|
'expectService',
|
|
87
88
|
'expectError',
|
|
88
89
|
'expectEventually',
|
|
90
|
+
'expectScore',
|
|
89
91
|
] as const
|
|
90
92
|
|
|
91
93
|
/**
|
|
92
94
|
* Check if a call expression is one of the scenario expectation helpers —
|
|
93
|
-
* `scenario.expectService()`, `.expectError()
|
|
95
|
+
* `scenario.expectService()`, `.expectError()`, `.expectEventually()` or
|
|
96
|
+
* `.expectScore()`.
|
|
94
97
|
*/
|
|
95
98
|
export function isScenarioExpectationCall(node: ts.CallExpression): boolean {
|
|
96
99
|
return (
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isRef } from '@pikku/core/workflow'
|
|
1
2
|
import type {
|
|
2
3
|
SerializedWorkflowGraph,
|
|
3
4
|
SerializedGraphNode,
|
|
@@ -16,20 +17,6 @@ function convertRef(ref: { nodeId: string; path?: string }): DataRef {
|
|
|
16
17
|
}
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
/**
|
|
20
|
-
* Check if a value is a runtime RefValue
|
|
21
|
-
*/
|
|
22
|
-
function isRefValue(
|
|
23
|
-
value: unknown
|
|
24
|
-
): value is { __isRef: true; nodeId: string; path?: string } {
|
|
25
|
-
return (
|
|
26
|
-
typeof value === 'object' &&
|
|
27
|
-
value !== null &&
|
|
28
|
-
'__isRef' in value &&
|
|
29
|
-
(value as any).__isRef === true
|
|
30
|
-
)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
20
|
/**
|
|
34
21
|
* Convert input mapping from runtime format to serialized format
|
|
35
22
|
*/
|
|
@@ -39,7 +26,7 @@ function serializeInputMapping(
|
|
|
39
26
|
const result: Record<string, unknown | DataRef> = {}
|
|
40
27
|
|
|
41
28
|
for (const [key, value] of Object.entries(input)) {
|
|
42
|
-
if (
|
|
29
|
+
if (isRef(value)) {
|
|
43
30
|
result[key] = convertRef(value)
|
|
44
31
|
} else {
|
|
45
32
|
result[key] = value
|
package/src/visit.ts
CHANGED
|
@@ -34,6 +34,7 @@ import { addVariable } from './add/add-variable.js'
|
|
|
34
34
|
import { addWorkflowGraph } from './add/add-workflow-graph.js'
|
|
35
35
|
import { addFeature } from './add/add-feature.js'
|
|
36
36
|
import { addAIAgent } from './add/add-ai-agent.js'
|
|
37
|
+
import { addAIScorer } from './add/add-ai-scorer.js'
|
|
37
38
|
import { addApprovalDescription } from './add/add-approval-description.js'
|
|
38
39
|
|
|
39
40
|
export const visitSetup = (
|
|
@@ -172,6 +173,7 @@ export const visitRoutes = (
|
|
|
172
173
|
addWorkflowGraph(logger, node, checker, state, nextOptions)
|
|
173
174
|
addFeature(logger, node, checker, state, nextOptions)
|
|
174
175
|
addAIAgent(logger, node, checker, state, nextOptions)
|
|
176
|
+
addAIScorer(logger, node, checker, state, nextOptions)
|
|
175
177
|
|
|
176
178
|
ts.forEachChild(node, (child) =>
|
|
177
179
|
visitRoutes(logger, checker, child, state, nextOptions)
|