@agwab/pi-workflow 0.2.0 → 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 (79) hide show
  1. package/README.md +2 -0
  2. package/dist/compiler.d.ts +4 -6
  3. package/dist/compiler.js +70 -39
  4. package/dist/dynamic-decision.d.ts +0 -1
  5. package/dist/dynamic-decision.js +0 -7
  6. package/dist/dynamic-generated-task-runtime.d.ts +2 -0
  7. package/dist/dynamic-generated-task-runtime.js +21 -8
  8. package/dist/dynamic-profiles.d.ts +0 -1
  9. package/dist/dynamic-profiles.js +0 -3
  10. package/dist/engine-run-graph.d.ts +1 -0
  11. package/dist/engine-run-graph.js +142 -2
  12. package/dist/engine.d.ts +10 -6
  13. package/dist/engine.js +146 -77
  14. package/dist/extension.d.ts +2 -1
  15. package/dist/extension.js +38 -15
  16. package/dist/index.d.ts +3 -3
  17. package/dist/index.js +2 -1
  18. package/dist/store.d.ts +3 -1
  19. package/dist/store.js +189 -49
  20. package/dist/subagent-backend.d.ts +4 -0
  21. package/dist/subagent-backend.js +281 -31
  22. package/dist/types.d.ts +9 -1
  23. package/dist/workflow-runtime.d.ts +2 -0
  24. package/dist/workflow-runtime.js +40 -1
  25. package/dist/workflow-view.js +3 -1
  26. package/dist/workflow-web-source-extension.js +167 -48
  27. package/dist/workflow-web-source.d.ts +2 -1
  28. package/dist/workflow-web-source.js +84 -19
  29. package/docs/usage.md +11 -0
  30. package/node_modules/@agwab/pi-subagent/README.md +3 -3
  31. package/node_modules/@agwab/pi-subagent/api.mjs +1 -0
  32. package/node_modules/@agwab/pi-subagent/docs/usage.md +63 -12
  33. package/node_modules/@agwab/pi-subagent/package.json +2 -2
  34. package/node_modules/@agwab/pi-subagent/src/api.ts +54 -1
  35. package/node_modules/@agwab/pi-subagent/src/artifacts/registry.ts +9 -4
  36. package/node_modules/@agwab/pi-subagent/src/artifacts/result.ts +8 -0
  37. package/node_modules/@agwab/pi-subagent/src/core/constants.ts +9 -0
  38. package/node_modules/@agwab/pi-subagent/src/core/validation.ts +21 -0
  39. package/node_modules/@agwab/pi-subagent/src/index.ts +995 -573
  40. package/node_modules/@agwab/pi-subagent/src/orchestrate/async.ts +279 -156
  41. package/node_modules/@agwab/pi-subagent/src/orchestrate/interrupt.ts +165 -89
  42. package/node_modules/@agwab/pi-subagent/src/orchestrate/reconcile.ts +111 -65
  43. package/node_modules/@agwab/pi-subagent/src/orchestrate/run-ref.ts +219 -0
  44. package/node_modules/@agwab/pi-subagent/src/orchestrate/run.ts +88 -8
  45. package/node_modules/@agwab/pi-subagent/src/orchestrate/status.ts +614 -298
  46. package/node_modules/@agwab/pi-subagent/src/panel.ts +1352 -560
  47. package/node_modules/@agwab/pi-subagent/src/runners/headless-model.ts +53 -5
  48. package/node_modules/@agwab/pi-subagent/src/runners/tmux.ts +13 -6
  49. package/package.json +2 -2
  50. package/src/compiler.ts +127 -66
  51. package/src/dynamic-decision.ts +0 -11
  52. package/src/dynamic-generated-task-runtime.ts +47 -12
  53. package/src/dynamic-profiles.ts +0 -4
  54. package/src/engine-run-graph.ts +185 -2
  55. package/src/engine.ts +192 -107
  56. package/src/extension.ts +50 -17
  57. package/src/index.ts +3 -1
  58. package/src/store.ts +253 -55
  59. package/src/subagent-backend.ts +369 -32
  60. package/src/types.ts +13 -1
  61. package/src/workflow-runtime.ts +53 -2
  62. package/src/workflow-view.ts +2 -1
  63. package/src/workflow-web-source-extension.ts +621 -228
  64. package/src/workflow-web-source.ts +118 -28
  65. package/workflows/deep-research/helpers/claim-evidence-gate.mjs +56 -16
  66. package/workflows/deep-research/helpers/final-audit-packet.mjs +1 -4
  67. package/workflows/deep-research/helpers/normalize-input-packet.mjs +1 -1
  68. package/workflows/deep-research/helpers/render-executive.mjs +8 -21
  69. package/workflows/deep-research/helpers/sanitize-verification-candidates.mjs +89 -15
  70. package/workflows/deep-research/schemas/deep-research-executive-render-control.schema.json +0 -1
  71. package/workflows/deep-research/schemas/deep-research-verify-claims-control.schema.json +4 -1
  72. package/workflows/impact-review/spec.json +3 -3
  73. package/workflows/spec-review/helpers/spec-review-pipeline.mjs +1 -8
  74. package/dist/dynamic-loader.d.ts +0 -25
  75. package/dist/dynamic-loader.js +0 -13
  76. package/src/dynamic-loader.ts +0 -49
  77. package/workflows/impact-review/schemas/docs-release-impact-control.schema.json +0 -42
  78. package/workflows/impact-review/schemas/security-performance-impact-control.schema.json +0 -42
  79. 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
- }