@pikku/inspector 0.12.56 → 0.12.59
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 +185 -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 +26 -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 +7 -3
- package/dist/types.d.ts +24 -0
- package/dist/utils/filter-inspector-state.js +8 -0
- package/dist/utils/post-process.d.ts +13 -3
- package/dist/utils/post-process.js +51 -21
- package/dist/utils/serialize-inspector-state.d.ts +11 -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/workflow-graph.types.d.ts +2 -1
- 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-functions.ts +1 -1
- package/src/add/add-scenario-step.test.ts +21 -1
- package/src/add/add-wire-addon.test.ts +74 -0
- package/src/add/add-wire-addon.ts +22 -0
- package/src/add/scenario-instrumentation.ts +6 -0
- package/src/error-codes.ts +4 -0
- package/src/inspector.ts +7 -3
- package/src/types.ts +21 -0
- package/src/utils/filter-inspector-state.ts +8 -0
- package/src/utils/post-process.test.ts +138 -0
- package/src/utils/post-process.ts +69 -22
- package/src/utils/serialize-inspector-state.ts +16 -0
- package/src/utils/workflow/dsl/extract-approval-policy.test.ts +68 -0
- package/src/utils/workflow/dsl/extract-dsl-workflow.ts +13 -5
- package/src/utils/workflow/dsl/patterns.ts +8 -5
- package/src/utils/workflow/graph/workflow-graph.types.ts +1 -1
- 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
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { describe, test } from 'node:test'
|
|
2
|
-
import assert from 'node:assert/strict'
|
|
3
|
-
import { isSecretBrokerFunction } from './secret-brokers.js'
|
|
4
|
-
import { computeSecretBrokers } from './post-process.js'
|
|
5
|
-
import type { InspectorState } from '../types.js'
|
|
6
|
-
|
|
7
|
-
describe('isSecretBrokerFunction', () => {
|
|
8
|
-
test('admits the console secret-admin functions', () => {
|
|
9
|
-
assert.ok(isSecretBrokerFunction('pikkuConsoleGetSecret'))
|
|
10
|
-
assert.ok(isSecretBrokerFunction('pikkuConsoleSetSecret'))
|
|
11
|
-
assert.ok(isSecretBrokerFunction('pikkuConsoleHasSecret'))
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
test('admits them when namespaced by an addon', () => {
|
|
15
|
-
assert.ok(isSecretBrokerFunction('pikku:pikkuConsoleGetSecret'))
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
test('admits nothing else', () => {
|
|
19
|
-
assert.equal(isSecretBrokerFunction('pikkuConsoleGetVariable'), false)
|
|
20
|
-
assert.equal(isSecretBrokerFunction('httpRequest'), false)
|
|
21
|
-
assert.equal(isSecretBrokerFunction('myFunction'), false)
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
test('is not fooled by a name that merely contains a broker name', () => {
|
|
25
|
-
assert.equal(isSecretBrokerFunction('notPikkuConsoleGetSecret'), false)
|
|
26
|
-
assert.equal(isSecretBrokerFunction('pikkuConsoleGetSecretly'), false)
|
|
27
|
-
})
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
describe('computeSecretBrokers', () => {
|
|
31
|
-
const stateWith = (meta: Record<string, any>) =>
|
|
32
|
-
({ functions: { meta } }) as unknown as InspectorState
|
|
33
|
-
|
|
34
|
-
test('flags a broker so the runner keeps its secrets', () => {
|
|
35
|
-
const state = stateWith({
|
|
36
|
-
pikkuConsoleGetSecret: { pikkuFuncId: 'pikkuConsoleGetSecret' },
|
|
37
|
-
})
|
|
38
|
-
computeSecretBrokers(state)
|
|
39
|
-
assert.equal(state.functions.meta.pikkuConsoleGetSecret!.secretBroker, true)
|
|
40
|
-
})
|
|
41
|
-
|
|
42
|
-
test('leaves an ordinary function unflagged', () => {
|
|
43
|
-
const state = stateWith({ createTodo: { pikkuFuncId: 'createTodo' } })
|
|
44
|
-
computeSecretBrokers(state)
|
|
45
|
-
assert.equal(state.functions.meta.createTodo!.secretBroker, undefined)
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
test('falls back to the meta key when there is no pikkuFuncId', () => {
|
|
49
|
-
const state = stateWith({ pikkuConsoleSetSecret: {} })
|
|
50
|
-
computeSecretBrokers(state)
|
|
51
|
-
assert.equal(state.functions.meta.pikkuConsoleSetSecret!.secretBroker, true)
|
|
52
|
-
})
|
|
53
|
-
})
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/** The console's secret administration functions, and nothing else. */
|
|
2
|
-
const SECRET_BROKER_FUNCTIONS = new Set([
|
|
3
|
-
'pikkuConsoleSetSecret',
|
|
4
|
-
'pikkuConsoleGetSecret',
|
|
5
|
-
'pikkuConsoleHasSecret',
|
|
6
|
-
])
|
|
7
|
-
|
|
8
|
-
/** Whether this function keeps the full `SecretService`. */
|
|
9
|
-
export const isSecretBrokerFunction = (functionId: string): boolean =>
|
|
10
|
-
SECRET_BROKER_FUNCTIONS.has(functionId) ||
|
|
11
|
-
SECRET_BROKER_FUNCTIONS.has(functionId.split(':').pop() ?? '')
|