@agwab/pi-workflow 0.2.1 → 0.3.0

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 (70) hide show
  1. package/dist/compiler.js +6 -8
  2. package/dist/dynamic-decision.d.ts +0 -1
  3. package/dist/dynamic-decision.js +0 -7
  4. package/dist/dynamic-profiles.d.ts +0 -1
  5. package/dist/dynamic-profiles.js +0 -3
  6. package/dist/engine-run-graph.d.ts +1 -0
  7. package/dist/engine-run-graph.js +142 -2
  8. package/dist/engine.d.ts +5 -0
  9. package/dist/engine.js +112 -27
  10. package/dist/extension.d.ts +2 -1
  11. package/dist/extension.js +27 -6
  12. package/dist/index.d.ts +3 -3
  13. package/dist/index.js +2 -1
  14. package/dist/store.js +55 -11
  15. package/dist/subagent-backend.js +155 -29
  16. package/dist/types.d.ts +6 -0
  17. package/dist/workflow-runtime.js +10 -1
  18. package/dist/workflow-view.js +3 -1
  19. package/dist/workflow-web-source-extension.js +167 -48
  20. package/dist/workflow-web-source.d.ts +2 -1
  21. package/dist/workflow-web-source.js +84 -19
  22. package/node_modules/@agwab/pi-subagent/README.md +3 -3
  23. package/node_modules/@agwab/pi-subagent/api.mjs +1 -0
  24. package/node_modules/@agwab/pi-subagent/docs/usage.md +63 -12
  25. package/node_modules/@agwab/pi-subagent/package.json +2 -2
  26. package/node_modules/@agwab/pi-subagent/src/api.ts +54 -1
  27. package/node_modules/@agwab/pi-subagent/src/artifacts/registry.ts +9 -4
  28. package/node_modules/@agwab/pi-subagent/src/artifacts/result.ts +8 -0
  29. package/node_modules/@agwab/pi-subagent/src/core/constants.ts +9 -0
  30. package/node_modules/@agwab/pi-subagent/src/core/validation.ts +21 -0
  31. package/node_modules/@agwab/pi-subagent/src/index.ts +995 -573
  32. package/node_modules/@agwab/pi-subagent/src/orchestrate/async.ts +279 -156
  33. package/node_modules/@agwab/pi-subagent/src/orchestrate/interrupt.ts +165 -89
  34. package/node_modules/@agwab/pi-subagent/src/orchestrate/reconcile.ts +111 -65
  35. package/node_modules/@agwab/pi-subagent/src/orchestrate/run-ref.ts +219 -0
  36. package/node_modules/@agwab/pi-subagent/src/orchestrate/run.ts +88 -8
  37. package/node_modules/@agwab/pi-subagent/src/orchestrate/status.ts +614 -298
  38. package/node_modules/@agwab/pi-subagent/src/panel.ts +1352 -560
  39. package/node_modules/@agwab/pi-subagent/src/runners/headless-model.ts +53 -5
  40. package/node_modules/@agwab/pi-subagent/src/runners/tmux.ts +13 -6
  41. package/package.json +2 -2
  42. package/src/compiler.ts +14 -9
  43. package/src/dynamic-decision.ts +0 -11
  44. package/src/dynamic-profiles.ts +0 -4
  45. package/src/engine-run-graph.ts +185 -2
  46. package/src/engine.ts +145 -24
  47. package/src/extension.ts +33 -4
  48. package/src/index.ts +3 -1
  49. package/src/store.ts +74 -11
  50. package/src/subagent-backend.ts +201 -28
  51. package/src/types.ts +6 -0
  52. package/src/workflow-runtime.ts +18 -2
  53. package/src/workflow-view.ts +2 -1
  54. package/src/workflow-web-source-extension.ts +621 -228
  55. package/src/workflow-web-source.ts +118 -28
  56. package/workflows/deep-research/helpers/claim-evidence-gate.mjs +56 -16
  57. package/workflows/deep-research/helpers/final-audit-packet.mjs +1 -4
  58. package/workflows/deep-research/helpers/normalize-input-packet.mjs +1 -1
  59. package/workflows/deep-research/helpers/render-executive.mjs +8 -21
  60. package/workflows/deep-research/helpers/sanitize-verification-candidates.mjs +89 -15
  61. package/workflows/deep-research/schemas/deep-research-executive-render-control.schema.json +0 -1
  62. package/workflows/deep-research/schemas/deep-research-verify-claims-control.schema.json +4 -1
  63. package/workflows/impact-review/spec.json +3 -3
  64. package/workflows/spec-review/helpers/spec-review-pipeline.mjs +1 -8
  65. package/dist/dynamic-loader.d.ts +0 -25
  66. package/dist/dynamic-loader.js +0 -13
  67. package/src/dynamic-loader.ts +0 -49
  68. package/workflows/impact-review/schemas/docs-release-impact-control.schema.json +0 -42
  69. package/workflows/impact-review/schemas/security-performance-impact-control.schema.json +0 -42
  70. package/workflows/impact-review/schemas/state-data-impact-control.schema.json +0 -42
@@ -1,25 +0,0 @@
1
- export interface DynamicArtifactRef {
2
- kind: "workflow-artifact-ref";
3
- name: string;
4
- options?: Record<string, unknown>;
5
- }
6
- export interface DynamicControllerContext {
7
- task: string;
8
- sources: Record<string, unknown>;
9
- phase: (name: string) => void;
10
- log: (...args: unknown[]) => void;
11
- artifact: (name: string, options?: Record<string, unknown>) => DynamicArtifactRef;
12
- graph: {
13
- generatedTaskIds: () => string[];
14
- };
15
- budget: {
16
- remaining: () => Record<string, number>;
17
- check: () => boolean;
18
- };
19
- helper: (name: string, input?: unknown) => Promise<unknown>;
20
- workflow: (name: string, input?: unknown) => Promise<unknown>;
21
- agent: (request: unknown) => Promise<unknown>;
22
- parallel: <T>(thunks: Array<() => T | Promise<T>>) => Promise<Array<PromiseSettledResult<T>>>;
23
- }
24
- export type DynamicController = (ctx: DynamicControllerContext) => unknown | Promise<unknown>;
25
- export declare function loadDynamicController(ref: string, specPath: string): Promise<DynamicController>;
@@ -1,13 +0,0 @@
1
- import { pathToFileURL } from "node:url";
2
- import { resolveWorkflowHelperRef } from "./workflow-helpers.js";
3
- import { WorkflowValidationError } from "./types.js";
4
- export async function loadDynamicController(ref, specPath) {
5
- const resolved = await resolveWorkflowHelperRef(ref, specPath);
6
- const imported = await import(pathToFileURL(resolved.path).href);
7
- if (typeof imported.default !== "function") {
8
- throw new WorkflowValidationError([
9
- { path: ref, message: "dynamic controller must default-export a function" },
10
- ]);
11
- }
12
- return imported.default;
13
- }
@@ -1,49 +0,0 @@
1
- import { pathToFileURL } from "node:url";
2
-
3
- import { resolveWorkflowHelperRef } from "./workflow-helpers.js";
4
- import { WorkflowValidationError } from "./types.js";
5
-
6
- export interface DynamicArtifactRef {
7
- kind: "workflow-artifact-ref";
8
- name: string;
9
- options?: Record<string, unknown>;
10
- }
11
-
12
- export interface DynamicControllerContext {
13
- task: string;
14
- sources: Record<string, unknown>;
15
- phase: (name: string) => void;
16
- log: (...args: unknown[]) => void;
17
- artifact: (name: string, options?: Record<string, unknown>) => DynamicArtifactRef;
18
- graph: {
19
- generatedTaskIds: () => string[];
20
- };
21
- budget: {
22
- remaining: () => Record<string, number>;
23
- check: () => boolean;
24
- };
25
- helper: (name: string, input?: unknown) => Promise<unknown>;
26
- workflow: (name: string, input?: unknown) => Promise<unknown>;
27
- agent: (request: unknown) => Promise<unknown>;
28
- parallel: <T>(
29
- thunks: Array<() => T | Promise<T>>,
30
- ) => Promise<Array<PromiseSettledResult<T>>>;
31
- }
32
-
33
- export type DynamicController = (
34
- ctx: DynamicControllerContext,
35
- ) => unknown | Promise<unknown>;
36
-
37
- export async function loadDynamicController(
38
- ref: string,
39
- specPath: string,
40
- ): Promise<DynamicController> {
41
- const resolved = await resolveWorkflowHelperRef(ref, specPath);
42
- const imported = await import(pathToFileURL(resolved.path).href);
43
- if (typeof imported.default !== "function") {
44
- throw new WorkflowValidationError([
45
- { path: ref, message: "dynamic controller must default-export a function" },
46
- ]);
47
- }
48
- return imported.default as DynamicController;
49
- }
@@ -1,42 +0,0 @@
1
- {
2
- "type": "object",
3
- "required": [
4
- "schema",
5
- "digest",
6
- "status",
7
- "impacts",
8
- "assumptions"
9
- ],
10
- "properties": {
11
- "schema": {
12
- "type": "string",
13
- "minLength": 1
14
- },
15
- "digest": {
16
- "type": "string",
17
- "minLength": 1
18
- },
19
- "status": {
20
- "type": "string",
21
- "enum": [
22
- "none",
23
- "low",
24
- "medium",
25
- "high",
26
- "unknown"
27
- ]
28
- },
29
- "impacts": {
30
- "type": "array",
31
- "items": {
32
- "type": "object"
33
- }
34
- },
35
- "assumptions": {
36
- "type": "array",
37
- "items": {
38
- "type": "object"
39
- }
40
- }
41
- }
42
- }
@@ -1,42 +0,0 @@
1
- {
2
- "type": "object",
3
- "required": [
4
- "schema",
5
- "digest",
6
- "status",
7
- "impacts",
8
- "assumptions"
9
- ],
10
- "properties": {
11
- "schema": {
12
- "type": "string",
13
- "minLength": 1
14
- },
15
- "digest": {
16
- "type": "string",
17
- "minLength": 1
18
- },
19
- "status": {
20
- "type": "string",
21
- "enum": [
22
- "none",
23
- "low",
24
- "medium",
25
- "high",
26
- "unknown"
27
- ]
28
- },
29
- "impacts": {
30
- "type": "array",
31
- "items": {
32
- "type": "object"
33
- }
34
- },
35
- "assumptions": {
36
- "type": "array",
37
- "items": {
38
- "type": "object"
39
- }
40
- }
41
- }
42
- }
@@ -1,42 +0,0 @@
1
- {
2
- "type": "object",
3
- "required": [
4
- "schema",
5
- "digest",
6
- "status",
7
- "impacts",
8
- "assumptions"
9
- ],
10
- "properties": {
11
- "schema": {
12
- "type": "string",
13
- "minLength": 1
14
- },
15
- "digest": {
16
- "type": "string",
17
- "minLength": 1
18
- },
19
- "status": {
20
- "type": "string",
21
- "enum": [
22
- "none",
23
- "low",
24
- "medium",
25
- "high",
26
- "unknown"
27
- ]
28
- },
29
- "impacts": {
30
- "type": "array",
31
- "items": {
32
- "type": "object"
33
- }
34
- },
35
- "assumptions": {
36
- "type": "array",
37
- "items": {
38
- "type": "object"
39
- }
40
- }
41
- }
42
- }