@pikku/inspector 0.12.103 → 0.12.107

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 (74) hide show
  1. package/dist/add/add-auth.d.ts +1 -9
  2. package/dist/add/add-auth.js +64 -17
  3. package/dist/add/add-cli.js +25 -11
  4. package/dist/add/add-functions.js +35 -39
  5. package/dist/add/add-keyed-wiring.js +22 -2
  6. package/dist/add/add-middleware.js +17 -16
  7. package/dist/add/add-permission.d.ts +0 -3
  8. package/dist/add/add-permission.js +213 -22
  9. package/dist/add/add-scope.d.ts +1 -7
  10. package/dist/add/add-scope.js +1 -21
  11. package/dist/add/add-virtual-users.d.ts +13 -0
  12. package/dist/add/{add-personas.js → add-virtual-users.js} +33 -33
  13. package/dist/add/add-workflow.js +14 -10
  14. package/dist/add/check-indirect-registrations.d.ts +9 -0
  15. package/dist/add/check-indirect-registrations.js +114 -0
  16. package/dist/error-codes.d.ts +5 -3
  17. package/dist/error-codes.js +5 -3
  18. package/dist/finalize.d.ts +10 -0
  19. package/dist/finalize.js +102 -0
  20. package/dist/index.d.ts +8 -6
  21. package/dist/index.js +6 -5
  22. package/dist/initial-state.d.ts +7 -0
  23. package/dist/initial-state.js +216 -0
  24. package/dist/inspector.d.ts +6 -4
  25. package/dist/inspector.js +28 -300
  26. package/dist/lite.d.ts +26 -0
  27. package/dist/lite.js +25 -0
  28. package/dist/source-file-cache.d.ts +11 -0
  29. package/dist/source-file-cache.js +34 -10
  30. package/dist/types-map.js +2 -1
  31. package/dist/types.d.ts +35 -3
  32. package/dist/utils/apply-declared-scopes.d.ts +8 -0
  33. package/dist/utils/apply-declared-scopes.js +21 -0
  34. package/dist/utils/canonical-type-string.d.ts +14 -0
  35. package/dist/utils/canonical-type-string.js +162 -0
  36. package/dist/utils/context-based-id.d.ts +7 -0
  37. package/dist/utils/context-based-id.js +9 -0
  38. package/dist/utils/custom-types-generator.d.ts +15 -1
  39. package/dist/utils/custom-types-generator.js +17 -5
  40. package/dist/utils/ensure-function-metadata.d.ts +0 -14
  41. package/dist/utils/ensure-function-metadata.js +4 -1
  42. package/dist/utils/extract-function-name.d.ts +1 -1
  43. package/dist/utils/extract-function-name.js +2 -4
  44. package/dist/utils/filter-inspector-state.js +31 -1
  45. package/dist/utils/get-property-value.d.ts +5 -0
  46. package/dist/utils/get-property-value.js +15 -1
  47. package/dist/utils/inspector-constants.d.ts +16 -0
  48. package/dist/utils/inspector-constants.js +16 -0
  49. package/dist/utils/load-addon-functions-meta.js +1 -0
  50. package/dist/utils/post-process.d.ts +35 -36
  51. package/dist/utils/post-process.js +218 -193
  52. package/dist/utils/resolve-callee-name.d.ts +27 -0
  53. package/dist/utils/resolve-callee-name.js +147 -0
  54. package/dist/utils/resolve-service-types.d.ts +8 -0
  55. package/dist/utils/resolve-service-types.js +21 -0
  56. package/dist/utils/schema-generator.js +29 -2
  57. package/dist/utils/serialize-inspector-state.d.ts +9 -3
  58. package/dist/utils/serialize-inspector-state.js +22 -7
  59. package/dist/utils/single-declaration.d.ts +3 -3
  60. package/dist/utils/single-declaration.js +3 -3
  61. package/dist/utils/validate-single-step-workflows.d.ts +3 -0
  62. package/dist/utils/validate-single-step-workflows.js +32 -0
  63. package/dist/utils/workflow/dsl/extract-dsl-workflow.js +3 -3
  64. package/dist/utils/workflow/dsl/patterns.d.ts +4 -11
  65. package/dist/utils/workflow/dsl/patterns.js +5 -11
  66. package/dist/utils/workflow/graph/convert-dsl-to-graph.js +6 -6
  67. package/dist/utils/workflow/graph/workflow-graph.types.d.ts +5 -5
  68. package/dist/visit.js +4 -2
  69. package/package.json +25 -9
  70. package/CHANGELOG.md +0 -4318
  71. package/OPTIMIZATION-PLAN.md +0 -201
  72. package/dist/add/add-personas.d.ts +0 -13
  73. package/run-tests.sh +0 -68
  74. package/src/utils/test-data/inspector-state.json +0 -1687
@@ -59,8 +59,8 @@ function convertStepToNode(step, index, steps, nodeIdPrefix = 'step') {
59
59
  stepName: step.stepName,
60
60
  next: nextNodeId,
61
61
  };
62
- if (step.actor) {
63
- node.actor = step.actor;
62
+ if (step.virtualUser) {
63
+ node.virtualUser = step.virtualUser;
64
64
  }
65
65
  if (step.expectEventually) {
66
66
  node.expectEventually = true;
@@ -101,8 +101,8 @@ function convertStepToNode(step, index, steps, nodeIdPrefix = 'step') {
101
101
  scenarioStepPhase: step.phase,
102
102
  next: nextNodeId,
103
103
  };
104
- if (step.actor) {
105
- node.actor = step.actor;
104
+ if (step.virtualUser) {
105
+ node.virtualUser = step.virtualUser;
106
106
  }
107
107
  if (step.inputs) {
108
108
  if (step.inputs === 'passthrough') {
@@ -401,7 +401,7 @@ export function convertDslToGraph(workflowName, meta) {
401
401
  }
402
402
  const entryNodeIds = nodes.length > 0 ? [nodes[0].nodeId] : [];
403
403
  // Determine source type:
404
- // - scenario: complex workflow whose steps run as actors (scenario)
404
+ // - scenario: complex workflow whose steps run as virtual users (scenario)
405
405
  // - dsl === true: pure DSL workflow, can be serialized
406
406
  // - dsl === false: complex workflow with inline steps, not serializable
407
407
  const source = meta.scenario
@@ -417,7 +417,7 @@ export function convertDslToGraph(workflowName, meta) {
417
417
  description: meta.description,
418
418
  tags: meta.tags,
419
419
  skip: meta.skip,
420
- actors: meta.actors,
420
+ virtualUsers: meta.virtualUsers,
421
421
  context: meta.context,
422
422
  nodes: nodesRecord,
423
423
  entryNodeIds,
@@ -110,8 +110,8 @@ export interface FunctionNode extends BaseNode {
110
110
  outputVar?: string;
111
111
  /** Hash of nodeId + RPC input/output schemas for version detection */
112
112
  stepHash?: string;
113
- /** Scenario actor name this step runs as (workflow.do {actor: actors.x}) */
114
- actor?: string;
113
+ /** Scenario virtual user name this step runs as (workflow.do {virtualUser: virtualUsers.x}) */
114
+ virtualUser?: string;
115
115
  /** True for workflow.expectEventually polling steps (scenarios) */
116
116
  expectEventually?: boolean;
117
117
  /** Gherkin-style phase for a declared scenario step (scenario.given/when/then) */
@@ -143,7 +143,7 @@ export declare const isFlowNode: (node: SerializedGraphNode) => node is FlowNode
143
143
  * - 'dsl': Pure DSL workflow (pikkuWorkflowFunc) - can be round-tripped to code
144
144
  * - 'complex': Complex workflow (pikkuWorkflowComplexFunc) - contains inline steps, not serializable
145
145
  * - 'graph': Graph-based workflow (pikkuWorkflowGraph)
146
- * - 'scenario': Scenario (pikkuScenario) - complex workflow whose steps run as actors
146
+ * - 'scenario': Scenario (pikkuScenario) - complex workflow whose steps run as virtual users
147
147
  */
148
148
  export type WorkflowSourceType = 'dsl' | 'complex' | 'graph' | 'scenario';
149
149
  /**
@@ -162,8 +162,8 @@ export interface SerializedWorkflowGraph {
162
162
  description?: string;
163
163
  /** Tags for organization */
164
164
  tags?: string[];
165
- /** Actor names a scenario's steps run as */
166
- actors?: string[];
165
+ /** Virtual user names a scenario's steps run as */
166
+ virtualUsers?: string[];
167
167
  /** Why a scenario is held out of a default run, stated where it is declared */
168
168
  skip?: string;
169
169
  /** If true, workflow always executes inline without queues */
package/dist/visit.js CHANGED
@@ -26,7 +26,7 @@ import { addCredential } from './add/add-credential.js';
26
26
  import { addScope } from './add/add-scope.js';
27
27
  import { addSystemRole } from './add/add-system-role.js';
28
28
  import { addFeatureFlag } from './add/add-feature-flag.js';
29
- import { addPersonas } from './add/add-personas.js';
29
+ import { addVirtualUsers } from './add/add-virtual-users.js';
30
30
  import { addVariable } from './add/add-variable.js';
31
31
  import { addWorkflowGraph } from './add/add-workflow-graph.js';
32
32
  import { addFeature } from './add/add-feature.js';
@@ -35,6 +35,7 @@ import { addAnalytics } from './add/add-analytics.js';
35
35
  import { addOutgoingWebhook } from './add/add-outgoing-webhook.js';
36
36
  import { addAgentScorer } from './add/add-agent-scorer.js';
37
37
  import { addApprovalDescription } from './add/add-approval-description.js';
38
+ import { checkIndirectRegistrations } from './add/check-indirect-registrations.js';
38
39
  export const visitSetup = (logger, checker, node, state, options) => {
39
40
  addFileExtendsCoreType(node, checker, state.singletonServicesTypeImportMap, 'CoreSingletonServices', state);
40
41
  addFileExtendsCoreType(node, checker, state.wireServicesTypeImportMap, 'CoreServices', state);
@@ -52,6 +53,7 @@ export const visitSetup = (logger, checker, node, state, options) => {
52
53
  addWireRemoteAddon(node, state, logger);
53
54
  addMiddleware(logger, node, checker, state, options);
54
55
  addPermission(logger, node, checker, state, options);
56
+ checkIndirectRegistrations(logger, node, checker, state, options);
55
57
  addApprovalDescription(logger, node, checker, state, options);
56
58
  addWorkflow(logger, node, checker, state, options);
57
59
  ts.forEachChild(node, (child) => visitSetup(logger, checker, child, state, options));
@@ -81,7 +83,7 @@ export const visitRoutes = (logger, checker, node, state, options) => {
81
83
  addScope(logger, node, checker, state, nextOptions);
82
84
  addSystemRole(logger, node, checker, state, nextOptions);
83
85
  addFeatureFlag(logger, node, checker, state, nextOptions);
84
- addPersonas(logger, node, checker, state, nextOptions);
86
+ addVirtualUsers(logger, node, checker, state, nextOptions);
85
87
  addVariable(logger, node, checker, state, nextOptions);
86
88
  addHTTPRoute(logger, node, checker, state, nextOptions);
87
89
  addHTTPRoutes(logger, node, checker, state, nextOptions);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pikku/inspector",
3
- "version": "0.12.103",
3
+ "version": "0.12.107",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/pikkujs/pikku.git",
@@ -18,11 +18,21 @@
18
18
  "import": "./dist/index.js",
19
19
  "default": "./dist/index.js"
20
20
  },
21
+ "./lite": {
22
+ "types": "./dist/lite.d.ts",
23
+ "import": "./dist/lite.js",
24
+ "default": "./dist/lite.js"
25
+ },
21
26
  "./schema-generator": {
22
27
  "types": "./dist/schema-generator.d.ts",
23
28
  "import": "./dist/schema-generator.js",
24
29
  "default": "./dist/schema-generator.js"
25
30
  },
31
+ "./finalize": {
32
+ "types": "./dist/finalize.d.ts",
33
+ "import": "./dist/finalize.js",
34
+ "default": "./dist/finalize.js"
35
+ },
26
36
  "./surface": {
27
37
  "types": "./dist/surface/collect-surface.d.ts",
28
38
  "import": "./dist/surface/collect-surface.js",
@@ -32,33 +42,39 @@
32
42
  "types": "./dist/utils/workflow/graph/index.d.ts",
33
43
  "import": "./dist/utils/workflow/graph/index.js",
34
44
  "default": "./dist/utils/workflow/graph/index.js"
35
- }
45
+ },
46
+ "./package.json": "./package.json"
36
47
  },
48
+ "files": [
49
+ "dist",
50
+ "!dist/**/*.tsbuildinfo"
51
+ ],
37
52
  "scripts": {
38
53
  "tsc": "tsc",
39
- "build": "tsc -b",
54
+ "build": "bun run clean && tsc -b",
40
55
  "ncu": "npx npm-check-updates -x '/.*glob.*/'",
41
56
  "release": "bun run build && npm test",
42
57
  "test": "bash run-tests.sh",
43
58
  "test:watch": "bash run-tests.sh --watch",
44
59
  "test:coverage": "bash run-tests.sh --coverage",
45
- "prepublishOnly": "bun run build"
60
+ "prepublishOnly": "bun run build",
61
+ "clean": "rm -rf dist tsconfig.tsbuildinfo"
46
62
  },
47
63
  "dependencies": {
48
64
  "@openapi-contrib/json-schema-to-openapi-schema": "^4.3.4",
49
65
  "openapi-types": "^12.1.3",
50
66
  "path-to-regexp": "^8.4.2",
51
67
  "ts-json-schema-generator": "2.9.1-next.18",
52
- "tsx": "^4.23.12",
68
+ "tsx": "^4.23.15",
53
69
  "typescript": "^6.0.3",
54
- "zod": "^4.4.3"
70
+ "zod": "^4.6.7"
55
71
  },
56
72
  "peerDependencies": {
57
- "@pikku/core": "^0.12.139"
73
+ "@pikku/core": "^0.12.144"
58
74
  },
59
75
  "devDependencies": {
60
- "@pikku/core": "^0.12.139",
61
- "@types/node": "^24.13.3"
76
+ "@pikku/core": "^0.12.144",
77
+ "@types/node": "^26.6.5"
62
78
  },
63
79
  "engines": {
64
80
  "node": ">=24"