@pikku/inspector 0.12.59 → 0.12.60

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.
Files changed (97) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/dist/add/add-agent-scorer.d.ts +2 -0
  3. package/dist/add/add-agent-scorer.js +61 -0
  4. package/dist/add/add-agent.d.ts +4 -0
  5. package/dist/add/add-agent.js +442 -0
  6. package/dist/add/add-channel.d.ts +1 -1
  7. package/dist/add/add-functions.js +1 -1
  8. package/dist/add/add-keyed-wiring.js +1 -1
  9. package/dist/add/add-middleware.js +5 -5
  10. package/dist/add/add-personas.js +1 -1
  11. package/dist/add/add-workflow.d.ts +1 -1
  12. package/dist/inspector.js +1 -1
  13. package/dist/types.d.ts +23 -22
  14. package/dist/utils/compute-required-schemas.d.ts +1 -1
  15. package/dist/utils/contract-hashes.d.ts +2 -1
  16. package/dist/utils/contract-hashes.js +1 -1
  17. package/dist/utils/extract-function-name.js +1 -1
  18. package/dist/utils/extract-services.d.ts +1 -1
  19. package/dist/utils/filter-inspector-state.js +1 -1
  20. package/dist/utils/filter-utils.d.ts +1 -1
  21. package/dist/utils/middleware.d.ts +2 -2
  22. package/dist/utils/middleware.js +5 -5
  23. package/dist/utils/permissions.d.ts +1 -1
  24. package/dist/utils/post-process.d.ts +2 -2
  25. package/dist/utils/post-process.js +6 -6
  26. package/dist/utils/resolve-deploy-target.d.ts +1 -1
  27. package/dist/utils/resolve-function-meta.d.ts +1 -1
  28. package/dist/utils/resolve-function-types.d.ts +1 -1
  29. package/dist/utils/resolve-versions.js +1 -1
  30. package/dist/utils/schema-generator.d.ts +1 -1
  31. package/dist/utils/serialize-inspector-state.d.ts +3 -3
  32. package/dist/utils/serialize-inspector-state.js +4 -4
  33. package/dist/utils/serialize-openapi-json.d.ts +2 -2
  34. package/dist/utils/workflow/derive-workflow-plan.d.ts +1 -1
  35. package/dist/utils/workflow/dsl/extract-dsl-workflow.d.ts +1 -1
  36. package/dist/utils/workflow/graph/convert-dsl-to-graph.d.ts +1 -1
  37. package/dist/utils/workflow/graph/finalize-workflows.js +1 -1
  38. package/dist/utils/workflow/graph/serialize-workflow-graph.js +1 -1
  39. package/dist/utils/workflow/graph/workflow-graph.types.d.ts +2 -2
  40. package/dist/visit.js +4 -4
  41. package/package.json +3 -3
  42. package/src/add/{add-ai-scorer.test.ts → add-agent-scorer.test.ts} +11 -11
  43. package/src/add/{add-ai-scorer.ts → add-agent-scorer.ts} +4 -4
  44. package/src/add/{add-ai-agent.test.ts → add-agent.test.ts} +1 -1
  45. package/src/add/{add-ai-agent.ts → add-agent.ts} +11 -17
  46. package/src/add/add-auth.ts +1 -1
  47. package/src/add/add-channel.ts +4 -1
  48. package/src/add/add-cli.ts +1 -1
  49. package/src/add/add-functions.ts +9 -4
  50. package/src/add/add-gateway.ts +1 -1
  51. package/src/add/add-http-route.ts +1 -1
  52. package/src/add/add-keyed-wiring.ts +1 -1
  53. package/src/add/add-middleware.ts +7 -5
  54. package/src/add/add-permission.ts +1 -1
  55. package/src/add/add-personas.test.ts +2 -2
  56. package/src/add/add-personas.ts +3 -2
  57. package/src/add/add-scenario-step.test.ts +2 -2
  58. package/src/add/add-scope.test.ts +19 -19
  59. package/src/add/add-scope.ts +1 -1
  60. package/src/add/add-system-role.test.ts +12 -12
  61. package/src/add/add-workflow-graph-input.test.ts +1 -1
  62. package/src/add/add-workflow.ts +4 -1
  63. package/src/add/addon-contracts.test.ts +1 -1
  64. package/src/inspector.ts +1 -1
  65. package/src/types.ts +29 -23
  66. package/src/utils/compute-required-schemas.ts +1 -1
  67. package/src/utils/contract-hashes.test.ts +1 -1
  68. package/src/utils/contract-hashes.ts +3 -2
  69. package/src/utils/extract-function-name.ts +1 -1
  70. package/src/utils/extract-services.ts +4 -1
  71. package/src/utils/filter-inspector-state.ts +2 -2
  72. package/src/utils/filter-utils.ts +1 -1
  73. package/src/utils/middleware.test.ts +23 -23
  74. package/src/utils/middleware.ts +6 -6
  75. package/src/utils/permissions.ts +1 -1
  76. package/src/utils/post-process.test.ts +9 -9
  77. package/src/utils/post-process.ts +8 -8
  78. package/src/utils/resolve-deploy-target.ts +1 -1
  79. package/src/utils/resolve-function-meta.ts +4 -1
  80. package/src/utils/resolve-function-types.ts +1 -1
  81. package/src/utils/resolve-versions.ts +5 -2
  82. package/src/utils/schema-generator.ts +3 -2
  83. package/src/utils/serialize-inspector-state.ts +7 -7
  84. package/src/utils/serialize-mcp-json.ts +1 -1
  85. package/src/utils/serialize-openapi-json.ts +2 -2
  86. package/src/utils/workflow/derive-workflow-plan.test.ts +1 -1
  87. package/src/utils/workflow/derive-workflow-plan.ts +1 -1
  88. package/src/utils/workflow/dsl/extract-approval-policy.test.ts +5 -2
  89. package/src/utils/workflow/dsl/extract-dsl-workflow.ts +2 -2
  90. package/src/utils/workflow/graph/convert-dsl-to-graph-skip.test.ts +1 -1
  91. package/src/utils/workflow/graph/convert-dsl-to-graph.ts +4 -1
  92. package/src/utils/workflow/graph/finalize-workflow-wires.ts +1 -1
  93. package/src/utils/workflow/graph/finalize-workflows.ts +6 -2
  94. package/src/utils/workflow/graph/serialize-workflow-graph.ts +1 -1
  95. package/src/utils/workflow/graph/workflow-graph.types.ts +2 -2
  96. package/src/visit.ts +4 -4
  97. package/tsconfig.tsbuildinfo +1 -1
@@ -1,6 +1,6 @@
1
1
  import { describe, test } from 'node:test'
2
2
  import assert from 'node:assert'
3
- import { resolveAIMiddleware } from './middleware.js'
3
+ import { resolveAgentMiddleware } from './middleware.js'
4
4
  import { getInitialInspectorState } from '../inspector.js'
5
5
  import * as ts from 'typescript'
6
6
 
@@ -26,39 +26,39 @@ function createMockChecker(): ts.TypeChecker {
26
26
  return {} as any
27
27
  }
28
28
 
29
- describe('resolveAIMiddleware', () => {
30
- test('should return undefined when no aiMiddleware property exists', () => {
29
+ describe('resolveAgentMiddleware', () => {
30
+ test('should return undefined when no agentMiddleware property exists', () => {
31
31
  const state = getInitialInspectorState('/test')
32
32
  const src = createSourceFile('const x = { name: "test" }')
33
33
  const obj = getObjectLiteral(src)
34
34
  const checker = createMockChecker()
35
35
 
36
- const result = resolveAIMiddleware(state, obj, checker)
36
+ const result = resolveAgentMiddleware(state, obj, checker)
37
37
 
38
38
  assert.strictEqual(result, undefined)
39
39
  })
40
40
 
41
- test('should return undefined when aiMiddleware array is empty', () => {
41
+ test('should return undefined when agentMiddleware array is empty', () => {
42
42
  const state = getInitialInspectorState('/test')
43
- const src = createSourceFile('const x = { aiMiddleware: [] }')
43
+ const src = createSourceFile('const x = { agentMiddleware: [] }')
44
44
  const obj = getObjectLiteral(src)
45
45
  const checker = createMockChecker()
46
46
 
47
- const result = resolveAIMiddleware(state, obj, checker)
47
+ const result = resolveAgentMiddleware(state, obj, checker)
48
48
 
49
49
  assert.strictEqual(result, undefined)
50
50
  })
51
51
 
52
- test('should resolve aiMiddleware identifiers as wire metadata', () => {
52
+ test('should resolve agentMiddleware identifiers as wire metadata', () => {
53
53
  const state = getInitialInspectorState('/test')
54
- state.aiMiddleware.definitions['myAIMW'] = {
54
+ state.agentMiddleware.definitions['myAIMW'] = {
55
55
  services: { optimized: true, services: ['logger'] },
56
56
  sourceFile: '/test/middleware.ts',
57
57
  position: 0,
58
58
  exportedName: 'myAIMW',
59
59
  }
60
60
 
61
- const code = 'const x = { aiMiddleware: [myAIMW] }'
61
+ const code = 'const x = { agentMiddleware: [myAIMW] }'
62
62
  const program = ts.createProgram({
63
63
  rootNames: ['test.ts'],
64
64
  options: { target: ts.ScriptTarget.ESNext },
@@ -77,7 +77,7 @@ describe('resolveAIMiddleware', () => {
77
77
  const sourceFile = program.getSourceFile('test.ts')!
78
78
  const obj = getObjectLiteral(sourceFile)
79
79
 
80
- const result = resolveAIMiddleware(state, obj, checker)
80
+ const result = resolveAgentMiddleware(state, obj, checker)
81
81
 
82
82
  assert.ok(result)
83
83
  assert.strictEqual(result.length, 1)
@@ -88,22 +88,22 @@ describe('resolveAIMiddleware', () => {
88
88
  })
89
89
  })
90
90
 
91
- test('should resolve multiple aiMiddleware entries', () => {
91
+ test('should resolve multiple agentMiddleware entries', () => {
92
92
  const state = getInitialInspectorState('/test')
93
- state.aiMiddleware.definitions['firstMW'] = {
93
+ state.agentMiddleware.definitions['firstMW'] = {
94
94
  services: { optimized: true, services: ['logger'] },
95
95
  sourceFile: '/test/middleware.ts',
96
96
  position: 0,
97
97
  exportedName: 'firstMW',
98
98
  }
99
- state.aiMiddleware.definitions['secondMW'] = {
99
+ state.agentMiddleware.definitions['secondMW'] = {
100
100
  services: { optimized: true, services: [] },
101
101
  sourceFile: '/test/middleware.ts',
102
102
  position: 100,
103
103
  exportedName: 'secondMW',
104
104
  }
105
105
 
106
- const code = 'const x = { aiMiddleware: [firstMW, secondMW] }'
106
+ const code = 'const x = { agentMiddleware: [firstMW, secondMW] }'
107
107
  const program = ts.createProgram({
108
108
  rootNames: ['test.ts'],
109
109
  options: { target: ts.ScriptTarget.ESNext },
@@ -122,7 +122,7 @@ describe('resolveAIMiddleware', () => {
122
122
  const sourceFile = program.getSourceFile('test.ts')!
123
123
  const obj = getObjectLiteral(sourceFile)
124
124
 
125
- const result = resolveAIMiddleware(state, obj, checker)
125
+ const result = resolveAgentMiddleware(state, obj, checker)
126
126
 
127
127
  assert.ok(result)
128
128
  assert.strictEqual(result.length, 2)
@@ -132,16 +132,16 @@ describe('resolveAIMiddleware', () => {
132
132
  assert.strictEqual((result[1] as any).name, 'secondMW')
133
133
  })
134
134
 
135
- test('should mark inline aiMiddleware (null exportedName)', () => {
135
+ test('should mark inline agentMiddleware (null exportedName)', () => {
136
136
  const state = getInitialInspectorState('/test')
137
- state.aiMiddleware.definitions['inlineMW'] = {
137
+ state.agentMiddleware.definitions['inlineMW'] = {
138
138
  services: { optimized: true, services: [] },
139
139
  sourceFile: '/test/middleware.ts',
140
140
  position: 0,
141
141
  exportedName: null,
142
142
  }
143
143
 
144
- const code = 'const x = { aiMiddleware: [inlineMW] }'
144
+ const code = 'const x = { agentMiddleware: [inlineMW] }'
145
145
  const program = ts.createProgram({
146
146
  rootNames: ['test.ts'],
147
147
  options: { target: ts.ScriptTarget.ESNext },
@@ -160,7 +160,7 @@ describe('resolveAIMiddleware', () => {
160
160
  const sourceFile = program.getSourceFile('test.ts')!
161
161
  const obj = getObjectLiteral(sourceFile)
162
162
 
163
- const result = resolveAIMiddleware(state, obj, checker)
163
+ const result = resolveAgentMiddleware(state, obj, checker)
164
164
 
165
165
  assert.ok(result)
166
166
  assert.strictEqual(result.length, 1)
@@ -171,10 +171,10 @@ describe('resolveAIMiddleware', () => {
171
171
  })
172
172
  })
173
173
 
174
- test('should handle aiMiddleware referencing unknown definitions', () => {
174
+ test('should handle agentMiddleware referencing unknown definitions', () => {
175
175
  const state = getInitialInspectorState('/test')
176
176
 
177
- const code = 'const x = { aiMiddleware: [unknownMW] }'
177
+ const code = 'const x = { agentMiddleware: [unknownMW] }'
178
178
  const program = ts.createProgram({
179
179
  rootNames: ['test.ts'],
180
180
  options: { target: ts.ScriptTarget.ESNext },
@@ -193,7 +193,7 @@ describe('resolveAIMiddleware', () => {
193
193
  const sourceFile = program.getSourceFile('test.ts')!
194
194
  const obj = getObjectLiteral(sourceFile)
195
195
 
196
- const result = resolveAIMiddleware(state, obj, checker)
196
+ const result = resolveAgentMiddleware(state, obj, checker)
197
197
 
198
198
  assert.ok(result)
199
199
  assert.strictEqual(result.length, 1)
@@ -1,5 +1,5 @@
1
1
  import * as ts from 'typescript'
2
- import type { MiddlewareMetadata } from '@pikku/core'
2
+ import type { MiddlewareMetadata } from '@pikku/core/ecosystem/types'
3
3
  import { extractFunctionName } from './extract-function-name.js'
4
4
  import type { InspectorState } from '../types.js'
5
5
 
@@ -214,24 +214,24 @@ export function resolveHTTPMiddlewareFromObject(
214
214
  )
215
215
  }
216
216
 
217
- function getAIMiddlewareNode(
217
+ function getAgentMiddlewareNode(
218
218
  obj: ts.ObjectLiteralExpression
219
219
  ): ts.Expression | undefined {
220
220
  const prop = obj.properties.find(
221
221
  (p) =>
222
222
  ts.isPropertyAssignment(p) &&
223
223
  ts.isIdentifier(p.name) &&
224
- p.name.text === 'aiMiddleware'
224
+ p.name.text === 'agentMiddleware'
225
225
  ) as ts.PropertyAssignment | undefined
226
226
  return prop?.initializer
227
227
  }
228
228
 
229
- export function resolveAIMiddleware(
229
+ export function resolveAgentMiddleware(
230
230
  state: InspectorState,
231
231
  obj: ts.ObjectLiteralExpression,
232
232
  checker: ts.TypeChecker
233
233
  ): MiddlewareMetadata[] | undefined {
234
- const explicitNode = getAIMiddlewareNode(obj)
234
+ const explicitNode = getAgentMiddlewareNode(obj)
235
235
  if (!explicitNode) return undefined
236
236
 
237
237
  const names = extractMiddlewarePikkuNames(
@@ -240,7 +240,7 @@ export function resolveAIMiddleware(
240
240
  state.rootDir
241
241
  )
242
242
  const resolved: MiddlewareMetadata[] = names.map((name) => {
243
- const def = state.aiMiddleware.definitions[name]
243
+ const def = state.agentMiddleware.definitions[name]
244
244
  return {
245
245
  type: 'wire' as const,
246
246
  name,
@@ -1,5 +1,5 @@
1
1
  import * as ts from 'typescript'
2
- import type { PermissionMetadata } from '@pikku/core'
2
+ import type { PermissionMetadata } from '@pikku/core/ecosystem/types'
3
3
  import { extractFunctionName } from './extract-function-name.js'
4
4
  import type { InspectorState } from '../types.js'
5
5
 
@@ -142,7 +142,7 @@ function makeState(
142
142
 
143
143
  const CONSOLE_PARENT_SERVICES = [
144
144
  'metaService',
145
- 'aiAgentRunner',
145
+ 'agentRunner',
146
146
  'deploymentService',
147
147
  'credentialService',
148
148
  ]
@@ -187,7 +187,7 @@ describe('aggregateRequiredServices — per-function addon services', () => {
187
187
  runAgent: {
188
188
  services: {
189
189
  optimized: true,
190
- services: ['aiAgentRunner', 'deploymentService'],
190
+ services: ['agentRunner', 'deploymentService'],
191
191
  },
192
192
  },
193
193
  },
@@ -197,7 +197,7 @@ describe('aggregateRequiredServices — per-function addon services', () => {
197
197
  aggregateRequiredServices(state)
198
198
  const required = state.serviceAggregation.requiredServices
199
199
  assert.ok(required.has('metaService'))
200
- assert.ok(!required.has('aiAgentRunner'))
200
+ assert.ok(!required.has('agentRunner'))
201
201
  assert.ok(!required.has('deploymentService'))
202
202
  assert.ok(!required.has('credentialService'))
203
203
  })
@@ -258,7 +258,7 @@ describe('aggregateRequiredServices — per-function addon services', () => {
258
258
  const required = state.serviceAggregation.requiredServices
259
259
  assert.ok(required.has('kysely'))
260
260
  assert.ok(!required.has('metaService'))
261
- assert.ok(!required.has('aiAgentRunner'))
261
+ assert.ok(!required.has('agentRunner'))
262
262
  })
263
263
 
264
264
  test('no used addon functions adds no parent services', () => {
@@ -279,7 +279,7 @@ describe('aggregateRequiredServices — per-function addon services', () => {
279
279
  aggregateRequiredServices(state)
280
280
  const required = state.serviceAggregation.requiredServices
281
281
  assert.ok(!required.has('metaService'))
282
- assert.ok(!required.has('aiAgentRunner'))
282
+ assert.ok(!required.has('agentRunner'))
283
283
  })
284
284
 
285
285
  test('internal services in addon function meta never force the blanket', () => {
@@ -300,7 +300,7 @@ describe('aggregateRequiredServices — per-function addon services', () => {
300
300
  aggregateRequiredServices(state)
301
301
  const required = state.serviceAggregation.requiredServices
302
302
  assert.ok(required.has('metaService'))
303
- assert.ok(!required.has('aiAgentRunner'))
303
+ assert.ok(!required.has('agentRunner'))
304
304
  assert.ok(!required.has('rpc'))
305
305
  })
306
306
 
@@ -345,7 +345,7 @@ describe('aggregateRequiredServices — per-function addon services', () => {
345
345
  aggregateRequiredServices(state)
346
346
  const required = state.serviceAggregation.requiredServices
347
347
  assert.ok(required.has('metaService'))
348
- assert.ok(!required.has('aiAgentRunner'))
348
+ assert.ok(!required.has('agentRunner'))
349
349
  })
350
350
 
351
351
  test('multiple used addon functions union their parent services', () => {
@@ -357,7 +357,7 @@ describe('aggregateRequiredServices — per-function addon services', () => {
357
357
  services: { optimized: true, services: ['metaService'] },
358
358
  },
359
359
  runAgent: {
360
- services: { optimized: true, services: ['aiAgentRunner'] },
360
+ services: { optimized: true, services: ['agentRunner'] },
361
361
  },
362
362
  },
363
363
  },
@@ -366,7 +366,7 @@ describe('aggregateRequiredServices — per-function addon services', () => {
366
366
  aggregateRequiredServices(state)
367
367
  const required = state.serviceAggregation.requiredServices
368
368
  assert.ok(required.has('metaService'))
369
- assert.ok(required.has('aiAgentRunner'))
369
+ assert.ok(required.has('agentRunner'))
370
370
  assert.ok(!required.has('deploymentService'))
371
371
  assert.ok(!required.has('credentialService'))
372
372
  })
@@ -9,7 +9,7 @@ import type {
9
9
  FunctionServicesMeta,
10
10
  MiddlewareMetadata,
11
11
  PermissionMetadata,
12
- } from '@pikku/core'
12
+ } from '@pikku/core/ecosystem/types'
13
13
  import type ts from 'typescript'
14
14
  import { existsSync, readFileSync } from 'node:fs'
15
15
  import { join } from 'node:path'
@@ -18,8 +18,8 @@ import { ErrorCode } from '../error-codes.js'
18
18
  import { findSecretAliasServices } from './secret-alias-services.js'
19
19
  import { relative } from 'node:path'
20
20
  import { AUTH_HANDLER_FUNC_ID } from '../add/add-auth.js'
21
- import { flattenScopeDefinitions } from '@pikku/core/scope'
22
- import type { WorkflowStepMeta } from '@pikku/core/workflow'
21
+ import { flattenScopeDefinitions } from '@pikku/core/ecosystem/scope'
22
+ import type { WorkflowStepMeta } from '@pikku/core/ecosystem/workflow'
23
23
  import { DYNAMIC_SCENARIO_STEP_TARGET } from './workflow/dsl/patterns.js'
24
24
 
25
25
  /**
@@ -308,12 +308,12 @@ export function aggregateRequiredServices(
308
308
  }
309
309
  }
310
310
 
311
- // AI agents need aiStorage + aiRunState + agentRunService + aiAgentRunner
311
+ // AI agents need agentStorage + agentRunState + agentRunService + agentRunner
312
312
  if (Object.keys(state.agents.agentsMeta).length > 0) {
313
- requiredServices.add('aiStorage')
314
- requiredServices.add('aiRunState')
313
+ requiredServices.add('agentStorage')
314
+ requiredServices.add('agentRunState')
315
315
  requiredServices.add('agentRunService')
316
- requiredServices.add('aiAgentRunner')
316
+ requiredServices.add('agentRunner')
317
317
  }
318
318
 
319
319
  // Channels need eventHub for pub/sub
@@ -1230,7 +1230,7 @@ export function validateScopeReferences(
1230
1230
  *
1231
1231
  * The description check is separate and opt-in (`--strict-meta`), because the
1232
1232
  * description is what the model is told the tool does: without one, the tool is
1233
- * offered to it under its own name (`ai-agent-prepare.ts`), which is a silent
1233
+ * offered to it under its own name (`agent-prepare.ts`), which is a silent
1234
1234
  * quality loss rather than a failure. A title deliberately does not satisfy it —
1235
1235
  * a title labels a tool in a UI, it does not tell a model when to reach for it.
1236
1236
  */
@@ -1,4 +1,4 @@
1
- import type { FunctionMeta } from '@pikku/core'
1
+ import type { FunctionMeta } from '@pikku/core/ecosystem/services'
2
2
 
3
3
  /**
4
4
  * Thrown when a function's explicit `deploy: 'serverless'` conflicts
@@ -1,4 +1,7 @@
1
- import type { FunctionMeta, FunctionsMeta } from '@pikku/core'
1
+ import type {
2
+ FunctionMeta,
3
+ FunctionsMeta,
4
+ } from '@pikku/core/ecosystem/services'
2
5
 
3
6
  /**
4
7
  * Look up function metadata by pikkuFuncId, checking both local functions
@@ -1,5 +1,5 @@
1
1
  import type { TypesMap } from '../types-map.js'
2
- import type { FunctionsMeta } from '@pikku/core'
2
+ import type { FunctionsMeta } from '@pikku/core/ecosystem/services'
3
3
 
4
4
  export function resolveFunctionIOTypes(
5
5
  pikkuFuncId: string,
@@ -1,5 +1,8 @@
1
- import { parseVersionedId, formatVersionedId } from '@pikku/core'
2
- import type { CLICommandMeta } from '@pikku/core/cli'
1
+ import {
2
+ parseVersionedId,
3
+ formatVersionedId,
4
+ } from '@pikku/core/ecosystem/types'
5
+ import type { CLICommandMeta } from '@pikku/core/ecosystem/cli'
3
6
  import type { InspectorState, InspectorLogger } from '../types.js'
4
7
  import { ErrorCode } from '../error-codes.js'
5
8
 
@@ -12,8 +12,9 @@ import { createGenerator, RootlessError } from 'ts-json-schema-generator'
12
12
  import { register } from 'tsx/esm/api'
13
13
  import * as z from 'zod'
14
14
  import { zodToTs, createAuxiliaryTypeStore } from 'zod-to-ts'
15
- import type { FunctionsMeta, JSONValue } from '@pikku/core'
16
- import type { HTTPWiringsMeta } from '@pikku/core/http'
15
+ import type { FunctionsMeta } from '@pikku/core/ecosystem/services'
16
+ import type { JSONValue } from '@pikku/core/ecosystem/types'
17
+ import type { HTTPWiringsMeta } from '@pikku/core/ecosystem/http'
17
18
  import type { TypesMap } from '../types-map.js'
18
19
  import { ErrorCode } from '../error-codes.js'
19
20
  import type { InspectorLogger, InspectorState, SchemaRef } from '../types.js'
@@ -1,5 +1,5 @@
1
1
  import type { SecretUsage } from './extract-secret-usage.js'
2
- import type { JSONValue } from '@pikku/core'
2
+ import type { JSONValue } from '@pikku/core/ecosystem/types'
3
3
  import type {
4
4
  InspectorDiagnostic,
5
5
  InspectorFeature,
@@ -263,8 +263,8 @@ export interface SerializableInspectorState {
263
263
  ]
264
264
  >
265
265
  }
266
- aiMiddleware: {
267
- definitions: InspectorState['aiMiddleware']['definitions']
266
+ agentMiddleware: {
267
+ definitions: InspectorState['agentMiddleware']['definitions']
268
268
  }
269
269
  permissions: {
270
270
  definitions: InspectorState['permissions']['definitions']
@@ -473,8 +473,8 @@ export function serializeInspectorState(
473
473
  state.channelMiddleware.tagMiddleware.entries()
474
474
  ),
475
475
  },
476
- aiMiddleware: {
477
- definitions: state.aiMiddleware.definitions,
476
+ agentMiddleware: {
477
+ definitions: state.agentMiddleware.definitions,
478
478
  },
479
479
  permissions: {
480
480
  definitions: state.permissions.definitions,
@@ -679,8 +679,8 @@ export function deserializeInspectorState(
679
679
  instances: data.channelMiddleware?.instances || {},
680
680
  tagMiddleware: new Map(data.channelMiddleware?.tagMiddleware || []),
681
681
  },
682
- aiMiddleware: {
683
- definitions: data.aiMiddleware?.definitions || {},
682
+ agentMiddleware: {
683
+ definitions: data.agentMiddleware?.definitions || {},
684
684
  },
685
685
  permissions: {
686
686
  definitions: data.permissions.definitions,
@@ -1,5 +1,5 @@
1
1
  import type { InspectorLogger, InspectorState } from '../types.js'
2
- import type { JSONValue } from '@pikku/core'
2
+ import type { JSONValue } from '@pikku/core/ecosystem/types'
3
3
  import { resolveFunctionMeta } from './resolve-function-meta.js'
4
4
 
5
5
  interface MCPEndpoint {
@@ -1,5 +1,5 @@
1
- import type { FunctionsMeta } from '@pikku/core'
2
- import type { HTTPWiringsMeta } from '@pikku/core/http'
1
+ import type { FunctionsMeta } from '@pikku/core/ecosystem/services'
2
+ import type { HTTPWiringsMeta } from '@pikku/core/ecosystem/http'
3
3
  import type { InspectorLogger } from '../types.js'
4
4
  import _convertSchema from '@openapi-contrib/json-schema-to-openapi-schema'
5
5
  const convertSchema =
@@ -1,6 +1,6 @@
1
1
  import { strict as assert } from 'assert'
2
2
  import { describe, test } from 'node:test'
3
- import type { WorkflowStepMeta } from '@pikku/core/workflow'
3
+ import type { WorkflowStepMeta } from '@pikku/core/ecosystem/workflow'
4
4
  import { deriveWorkflowPlan } from './derive-workflow-plan.js'
5
5
 
6
6
  const rpc = (stepName: string, rpcName = 'rpc.fn'): WorkflowStepMeta =>
@@ -1,7 +1,7 @@
1
1
  import type {
2
2
  WorkflowStepMeta,
3
3
  WorkflowPlannedStep,
4
- } from '@pikku/core/workflow'
4
+ } from '@pikku/core/ecosystem/workflow'
5
5
 
6
6
  /**
7
7
  * Derive the static UI plan for a DSL workflow from its extracted step tree.
@@ -2,7 +2,7 @@ import { describe, test } from 'node:test'
2
2
  import assert from 'node:assert/strict'
3
3
  import * as ts from 'typescript'
4
4
  import { extractDSLWorkflow } from './extract-dsl-workflow.js'
5
- import type { ApprovalStepMeta } from '@pikku/core/workflow'
5
+ import type { ApprovalStepMeta } from '@pikku/core/ecosystem/workflow'
6
6
 
7
7
  const checker = {
8
8
  getSymbolAtLocation: () => undefined,
@@ -26,7 +26,10 @@ const approvalStepFor = (options: string): ApprovalStepMeta => {
26
26
 
27
27
  let node: ts.Node | undefined
28
28
  const visit = (n: ts.Node) => {
29
- if (ts.isCallExpression(n) && n.expression.getText() === 'pikkuWorkflowFunc') {
29
+ if (
30
+ ts.isCallExpression(n) &&
31
+ n.expression.getText() === 'pikkuWorkflowFunc'
32
+ ) {
30
33
  node = n
31
34
  }
32
35
  ts.forEachChild(n, visit)
@@ -20,8 +20,8 @@ import type {
20
20
  Condition,
21
21
  WorkflowContext,
22
22
  ContextVariable,
23
- } from '@pikku/core/workflow'
24
- import type { ScenarioStepMeta } from '@pikku/core/scenario'
23
+ } from '@pikku/core/ecosystem/workflow'
24
+ import type { ScenarioStepMeta } from '@pikku/core/ecosystem/scenario'
25
25
  import {
26
26
  isWorkflowDoCall,
27
27
  isWorkflowExpectEventuallyCall,
@@ -1,7 +1,7 @@
1
1
  import { test } from 'node:test'
2
2
  import assert from 'node:assert'
3
3
  import { convertDslToGraph } from './convert-dsl-to-graph.js'
4
- import type { WorkflowsMeta } from '@pikku/core'
4
+ import type { WorkflowsMeta } from '@pikku/core/ecosystem/workflow'
5
5
 
6
6
  const scenarioMeta = (
7
7
  overrides: Partial<WorkflowsMeta[string]> = {}
@@ -1,7 +1,10 @@
1
1
  /**
2
2
  * Converts DSL (Domain Specific Language) step-based format to graph node format
3
3
  */
4
- import type { WorkflowStepMeta, WorkflowsMeta } from '@pikku/core/workflow'
4
+ import type {
5
+ WorkflowStepMeta,
6
+ WorkflowsMeta,
7
+ } from '@pikku/core/ecosystem/workflow'
5
8
  import type {
6
9
  SerializedGraphNode,
7
10
  SerializedWorkflowGraph,
@@ -3,7 +3,7 @@ import type {
3
3
  SerializedWorkflowGraph,
4
4
  WorkflowWires,
5
5
  } from './workflow-graph.types.js'
6
- import type { CLICommandMeta } from '@pikku/core/cli'
6
+ import type { CLICommandMeta } from '@pikku/core/ecosystem/cli'
7
7
 
8
8
  function parseWorkflowFuncId(
9
9
  pikkuFuncId: string
@@ -1,5 +1,9 @@
1
- import type { FunctionsMeta } from '@pikku/core'
2
- import { isVersionedId, formatVersionedId, parseVersionedId } from '@pikku/core'
1
+ import type { FunctionsMeta } from '@pikku/core/ecosystem/services'
2
+ import {
3
+ isVersionedId,
4
+ formatVersionedId,
5
+ parseVersionedId,
6
+ } from '@pikku/core/ecosystem/types'
3
7
  import type { SerializedWorkflowGraph } from './workflow-graph.types.js'
4
8
  import { canonicalJSON, hashString } from '../../hash.js'
5
9
  import { convertDslToGraph } from './convert-dsl-to-graph.js'
@@ -1,4 +1,4 @@
1
- import { isRef } from '@pikku/core/workflow'
1
+ import { isRef } from '@pikku/core/ecosystem/workflow'
2
2
  import type {
3
3
  SerializedWorkflowGraph,
4
4
  SerializedGraphNode,
@@ -115,8 +115,8 @@ import type {
115
115
  ContextVariable,
116
116
  WorkflowContext,
117
117
  WorkflowPlannedStep,
118
- } from '@pikku/core/workflow'
119
- import type { ScenarioStepPhase } from '@pikku/core/scenario'
118
+ } from '@pikku/core/ecosystem/workflow'
119
+ import type { ScenarioStepPhase } from '@pikku/core/ecosystem/scenario'
120
120
 
121
121
  export type { ContextVariable, WorkflowContext }
122
122
 
package/src/visit.ts CHANGED
@@ -33,8 +33,8 @@ import { addPersonas } from './add/add-personas.js'
33
33
  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
- import { addAIAgent } from './add/add-ai-agent.js'
37
- import { addAIScorer } from './add/add-ai-scorer.js'
36
+ import { addAgent } from './add/add-agent.js'
37
+ import { addAgentScorer } from './add/add-agent-scorer.js'
38
38
  import { addApprovalDescription } from './add/add-approval-description.js'
39
39
 
40
40
  export const visitSetup = (
@@ -172,8 +172,8 @@ export const visitRoutes = (
172
172
  addMCPPrompt(logger, node, checker, state, nextOptions)
173
173
  addWorkflowGraph(logger, node, checker, state, nextOptions)
174
174
  addFeature(logger, node, checker, state, nextOptions)
175
- addAIAgent(logger, node, checker, state, nextOptions)
176
- addAIScorer(logger, node, checker, state, nextOptions)
175
+ addAgent(logger, node, checker, state, nextOptions)
176
+ addAgentScorer(logger, node, checker, state, nextOptions)
177
177
 
178
178
  ts.forEachChild(node, (child) =>
179
179
  visitRoutes(logger, checker, child, state, nextOptions)