@agwab/pi-workflow 0.1.0 → 0.1.2
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/README.md +14 -3
- package/agents/researcher.md +17 -7
- package/dist/artifact-graph-runtime.js +1 -0
- package/dist/compiler.js +2 -2
- package/dist/dynamic-generated-task-runtime.js +4 -3
- package/dist/dynamic-runtime-bundle.js +3 -2
- package/dist/extension.js +40 -1
- package/dist/subagent-backend.js +82 -27
- package/dist/tool-metadata.d.ts +1 -0
- package/dist/tool-metadata.js +13 -1
- package/dist/workflow-artifact-extension.js +3 -2
- package/dist/workflow-artifact-tool.js +84 -4
- package/dist/workflow-web-source-extension.d.ts +43 -0
- package/dist/workflow-web-source-extension.js +1194 -0
- package/dist/workflow-web-source.d.ts +171 -0
- package/dist/workflow-web-source.js +897 -0
- package/docs/usage.md +32 -45
- package/node_modules/@agwab/pi-subagent/package.json +1 -1
- package/node_modules/@agwab/pi-subagent/src/api.ts +245 -132
- package/node_modules/@agwab/pi-subagent/src/artifacts/result.ts +243 -163
- package/node_modules/@agwab/pi-subagent/src/core/constants.ts +117 -90
- package/node_modules/@agwab/pi-subagent/src/core/validation.ts +728 -475
- package/node_modules/@agwab/pi-subagent/src/orchestrate/run.ts +305 -209
- package/node_modules/@agwab/pi-subagent/src/runners/headless-model.ts +750 -439
- package/node_modules/@agwab/pi-subagent/src/runners/tmux.ts +422 -268
- package/package.json +3 -4
- package/skills/workflow-guide/scaffolds/object-tool-fallback/schemas/fetch-control.schema.json +1 -1
- package/skills/workflow-guide/scaffolds/object-tool-fallback/spec.json +4 -3
- package/src/artifact-graph-runtime.ts +1 -0
- package/src/compiler.ts +2 -1
- package/src/dynamic-generated-task-runtime.ts +4 -2
- package/src/dynamic-runtime-bundle.ts +3 -2
- package/src/extension.ts +46 -1
- package/src/subagent-backend.ts +121 -37
- package/src/tool-metadata.ts +22 -1
- package/src/workflow-artifact-extension.ts +3 -2
- package/src/workflow-artifact-tool.ts +96 -4
- package/src/workflow-web-source-extension.ts +1411 -0
- package/src/workflow-web-source.ts +1171 -0
- package/workflows/README.md +1 -1
- package/workflows/deep-research/helpers/claim-evidence-gate.mjs +474 -40
- package/workflows/deep-research/helpers/final-audit-packet.mjs +219 -0
- package/workflows/deep-research/helpers/normalize-input-packet.mjs +436 -0
- package/workflows/deep-research/helpers/render-executive.mjs +571 -198
- package/workflows/deep-research/schemas/deep-research-executive-render-control.schema.json +35 -8
- package/workflows/deep-research/schemas/deep-research-normalize-claims-control.schema.json +45 -4
- package/workflows/deep-research/schemas/deep-research-verify-claims-control.schema.json +0 -2
- package/workflows/deep-research/spec.json +36 -21
- package/workflows/deep-review/helpers/render-review-report.mjs +502 -0
- package/workflows/deep-review/schemas/deep-review-render-control.schema.json +50 -0
- package/workflows/deep-review/spec.json +22 -1
- package/docs/release.md +0 -89
- package/node_modules/@pondwader/socks5-server/.DS_Store +0 -0
- package/node_modules/commander/.DS_Store +0 -0
- package/node_modules/jiti/.DS_Store +0 -0
- package/node_modules/node-forge/.DS_Store +0 -0
- package/node_modules/shell-quote/.DS_Store +0 -0
- package/node_modules/zod/.DS_Store +0 -0
|
@@ -1,28 +1,45 @@
|
|
|
1
1
|
export const BACKENDS = ["inline", "headless", "tmux", "auto"] as const;
|
|
2
2
|
export const RESOLVED_BACKENDS = ["inline", "headless", "tmux"] as const;
|
|
3
|
-
export const STATUSES = [
|
|
3
|
+
export const STATUSES = [
|
|
4
|
+
"pending",
|
|
5
|
+
"running",
|
|
6
|
+
"completed",
|
|
7
|
+
"failed",
|
|
8
|
+
"cancelled",
|
|
9
|
+
] as const;
|
|
4
10
|
export const FAILURE_KINDS = [
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
"validation",
|
|
12
|
+
"spawn",
|
|
13
|
+
"timeout",
|
|
14
|
+
"abort",
|
|
15
|
+
"cancelled",
|
|
16
|
+
"sandbox",
|
|
17
|
+
"rpc",
|
|
18
|
+
"model",
|
|
19
|
+
"tool",
|
|
20
|
+
"exit",
|
|
21
|
+
"parse",
|
|
22
|
+
"internal",
|
|
23
|
+
"stale",
|
|
18
24
|
] as const;
|
|
19
25
|
export const EXECUTION_MODES = ["single", "parallel"] as const;
|
|
20
|
-
export const ASYNC_DEPENDENCIES = [
|
|
26
|
+
export const ASYNC_DEPENDENCIES = [
|
|
27
|
+
"needed-before-final",
|
|
28
|
+
"background",
|
|
29
|
+
"unclassified",
|
|
30
|
+
] as const;
|
|
21
31
|
export const AGENT_SCOPES = ["auto", "global", "project"] as const;
|
|
22
32
|
export const WORKSPACE_MODES = ["shared", "worktree", "auto"] as const;
|
|
23
33
|
export const WORKTREE_POLICIES = ["auto", "required", "never"] as const;
|
|
24
34
|
export const ON_COMPLETE_ACTIONS = ["return", "notify", "detach"] as const;
|
|
25
|
-
export const THINKING_LEVELS = [
|
|
35
|
+
export const THINKING_LEVELS = [
|
|
36
|
+
"off",
|
|
37
|
+
"minimal",
|
|
38
|
+
"low",
|
|
39
|
+
"medium",
|
|
40
|
+
"high",
|
|
41
|
+
"xhigh",
|
|
42
|
+
] as const;
|
|
26
43
|
|
|
27
44
|
export type Backend = (typeof BACKENDS)[number];
|
|
28
45
|
export type ResolvedBackend = (typeof RESOLVED_BACKENDS)[number];
|
|
@@ -37,125 +54,135 @@ export type OnCompleteAction = (typeof ON_COMPLETE_ACTIONS)[number];
|
|
|
37
54
|
export type ThinkingLevel = (typeof THINKING_LEVELS)[number];
|
|
38
55
|
|
|
39
56
|
export interface SandboxOptionsInput {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
57
|
+
/**
|
|
58
|
+
* Network domains the sandboxed child process may reach (e.g. "api.anthropic.com",
|
|
59
|
+
* "*.npmjs.org"). The whole child Pi runs inside the sandbox boundary, so the model
|
|
60
|
+
* provider endpoint must be listed here for model-backed runs to work. Omitted or
|
|
61
|
+
* empty means no network access (deny-all), matching `sandbox: true`.
|
|
62
|
+
*/
|
|
63
|
+
allowedDomains?: string[];
|
|
47
64
|
}
|
|
48
65
|
|
|
49
66
|
export type SandboxInput = true | SandboxOptionsInput;
|
|
50
67
|
|
|
51
|
-
export function sandboxAllowedDomains(
|
|
52
|
-
|
|
53
|
-
|
|
68
|
+
export function sandboxAllowedDomains(
|
|
69
|
+
sandbox: SandboxInput | null | undefined,
|
|
70
|
+
): string[] {
|
|
71
|
+
if (sandbox === undefined || sandbox === null || sandbox === true) return [];
|
|
72
|
+
return sandbox.allowedDomains ?? [];
|
|
54
73
|
}
|
|
55
74
|
|
|
56
75
|
export interface WorkspaceInput {
|
|
57
|
-
|
|
58
|
-
|
|
76
|
+
mode?: WorkspaceMode;
|
|
77
|
+
path?: string;
|
|
59
78
|
}
|
|
60
79
|
|
|
61
80
|
export interface SubagentTaskInput {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
81
|
+
agent?: string;
|
|
82
|
+
task?: string;
|
|
83
|
+
roleContext?: string;
|
|
84
|
+
agentScope?: AgentScope;
|
|
85
|
+
confirmProjectAgents?: boolean;
|
|
86
|
+
sandbox?: SandboxInput | null;
|
|
87
|
+
visible?: boolean;
|
|
88
|
+
cwd?: string;
|
|
89
|
+
timeoutMs?: number;
|
|
90
|
+
model?: string;
|
|
91
|
+
sessionId?: string;
|
|
92
|
+
thinking?: ThinkingLevel;
|
|
93
|
+
tools?: string[];
|
|
94
|
+
systemPrompt?: string;
|
|
95
|
+
skills?: string[];
|
|
96
|
+
extensions?: string[];
|
|
97
|
+
captureToolCalls?: boolean;
|
|
78
98
|
}
|
|
79
99
|
|
|
80
100
|
export interface ResolveInput {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
101
|
+
backend?: Backend;
|
|
102
|
+
sandbox?: SandboxInput | null;
|
|
103
|
+
visible?: boolean;
|
|
104
|
+
agent?: string;
|
|
105
|
+
task?: string;
|
|
106
|
+
roleContext?: string;
|
|
107
|
+
agentScope?: AgentScope;
|
|
108
|
+
confirmProjectAgents?: boolean;
|
|
109
|
+
mode?: ExecutionMode;
|
|
110
|
+
tasks?: SubagentTaskInput[];
|
|
111
|
+
concurrency?: number;
|
|
112
|
+
asyncDependency?: AsyncDependency;
|
|
113
|
+
workspace?: WorkspaceInput | WorkspaceMode;
|
|
114
|
+
worktree?: boolean | string;
|
|
115
|
+
worktreePolicy?: WorktreePolicy;
|
|
116
|
+
cwd?: string;
|
|
117
|
+
async?: boolean;
|
|
118
|
+
onComplete?: OnCompleteAction;
|
|
119
|
+
timeoutMs?: number;
|
|
120
|
+
model?: string;
|
|
121
|
+
thinking?: ThinkingLevel;
|
|
122
|
+
tools?: string[];
|
|
123
|
+
systemPrompt?: string;
|
|
124
|
+
skills?: string[];
|
|
125
|
+
extensions?: string[];
|
|
126
|
+
captureToolCalls?: boolean;
|
|
127
|
+
runsDir?: string;
|
|
128
|
+
correlationId?: string;
|
|
129
|
+
/** Pi session id to attach a child headless run to when explicitly set by code API. */
|
|
130
|
+
sessionId?: string;
|
|
131
|
+
/** Pi session id of the parent that launched this run. Injected from ctx, not a model-settable tool arg. */
|
|
132
|
+
parentSessionId?: string;
|
|
111
133
|
}
|
|
112
134
|
|
|
113
135
|
export interface ResolveSuccess {
|
|
114
|
-
|
|
115
|
-
|
|
136
|
+
backend: ResolvedBackend;
|
|
137
|
+
status: "completed";
|
|
116
138
|
}
|
|
117
139
|
|
|
118
140
|
export interface ResolveValidationFailure {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
141
|
+
backend?: ResolvedBackend;
|
|
142
|
+
status: "failed";
|
|
143
|
+
failureKind: "validation";
|
|
144
|
+
error: string;
|
|
123
145
|
}
|
|
124
146
|
|
|
125
147
|
export type ResolveOutput = ResolveSuccess | ResolveValidationFailure;
|
|
126
148
|
|
|
127
|
-
function isOneOf<T extends string>(
|
|
128
|
-
|
|
149
|
+
function isOneOf<T extends string>(
|
|
150
|
+
values: readonly T[],
|
|
151
|
+
value: unknown,
|
|
152
|
+
): value is T {
|
|
153
|
+
return (
|
|
154
|
+
typeof value === "string" && (values as readonly string[]).includes(value)
|
|
155
|
+
);
|
|
129
156
|
}
|
|
130
157
|
|
|
131
158
|
export function isBackend(value: unknown): value is Backend {
|
|
132
|
-
|
|
159
|
+
return isOneOf(BACKENDS, value);
|
|
133
160
|
}
|
|
134
161
|
|
|
135
162
|
export function isExecutionMode(value: unknown): value is ExecutionMode {
|
|
136
|
-
|
|
163
|
+
return isOneOf(EXECUTION_MODES, value);
|
|
137
164
|
}
|
|
138
165
|
|
|
139
166
|
export function isAsyncDependency(value: unknown): value is AsyncDependency {
|
|
140
|
-
|
|
167
|
+
return isOneOf(ASYNC_DEPENDENCIES, value);
|
|
141
168
|
}
|
|
142
169
|
|
|
143
170
|
export function isAgentScope(value: unknown): value is AgentScope {
|
|
144
|
-
|
|
171
|
+
return isOneOf(AGENT_SCOPES, value);
|
|
145
172
|
}
|
|
146
173
|
|
|
147
174
|
export function isWorkspaceMode(value: unknown): value is WorkspaceMode {
|
|
148
|
-
|
|
175
|
+
return isOneOf(WORKSPACE_MODES, value);
|
|
149
176
|
}
|
|
150
177
|
|
|
151
178
|
export function isWorktreePolicy(value: unknown): value is WorktreePolicy {
|
|
152
|
-
|
|
179
|
+
return isOneOf(WORKTREE_POLICIES, value);
|
|
153
180
|
}
|
|
154
181
|
|
|
155
182
|
export function isOnCompleteAction(value: unknown): value is OnCompleteAction {
|
|
156
|
-
|
|
183
|
+
return isOneOf(ON_COMPLETE_ACTIONS, value);
|
|
157
184
|
}
|
|
158
185
|
|
|
159
186
|
export function isThinkingLevel(value: unknown): value is ThinkingLevel {
|
|
160
|
-
|
|
187
|
+
return isOneOf(THINKING_LEVELS, value);
|
|
161
188
|
}
|