wave-agent-sdk 0.17.0 → 0.17.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/builtin/skills/deep-research/SKILL.md +90 -0
- package/builtin/skills/settings/ENV.md +6 -3
- package/dist/agent.d.ts +28 -1
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +128 -34
- package/dist/constants/goalPrompts.d.ts +2 -0
- package/dist/constants/goalPrompts.d.ts.map +1 -0
- package/dist/constants/goalPrompts.js +10 -0
- package/dist/constants/tools.d.ts +1 -0
- package/dist/constants/tools.d.ts.map +1 -1
- package/dist/constants/tools.js +1 -0
- package/dist/managers/aiManager.d.ts +7 -0
- package/dist/managers/aiManager.d.ts.map +1 -1
- package/dist/managers/aiManager.js +77 -41
- package/dist/managers/backgroundTaskManager.d.ts.map +1 -1
- package/dist/managers/backgroundTaskManager.js +10 -2
- package/dist/managers/goalManager.d.ts +43 -0
- package/dist/managers/goalManager.d.ts.map +1 -0
- package/dist/managers/goalManager.js +177 -0
- package/dist/managers/messageManager.d.ts +2 -2
- package/dist/managers/messageManager.d.ts.map +1 -1
- package/dist/managers/messageQueue.d.ts +10 -0
- package/dist/managers/messageQueue.d.ts.map +1 -1
- package/dist/managers/messageQueue.js +53 -1
- package/dist/managers/pluginManager.d.ts.map +1 -1
- package/dist/managers/pluginManager.js +7 -1
- package/dist/managers/skillManager.d.ts +2 -0
- package/dist/managers/skillManager.d.ts.map +1 -1
- package/dist/managers/skillManager.js +19 -9
- package/dist/managers/slashCommandManager.d.ts +6 -0
- package/dist/managers/slashCommandManager.d.ts.map +1 -1
- package/dist/managers/slashCommandManager.js +105 -0
- package/dist/managers/toolManager.d.ts.map +1 -1
- package/dist/managers/toolManager.js +5 -0
- package/dist/managers/workflowManager.d.ts +65 -0
- package/dist/managers/workflowManager.d.ts.map +1 -0
- package/dist/managers/workflowManager.js +380 -0
- package/dist/prompts/index.d.ts +2 -1
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +3 -3
- package/dist/services/aiService.d.ts +23 -0
- package/dist/services/aiService.d.ts.map +1 -1
- package/dist/services/aiService.js +102 -9
- package/dist/services/configurationService.d.ts +1 -1
- package/dist/services/configurationService.d.ts.map +1 -1
- package/dist/services/configurationService.js +3 -16
- package/dist/services/hook.d.ts.map +1 -1
- package/dist/services/hook.js +4 -0
- package/dist/services/session.d.ts +9 -1
- package/dist/services/session.d.ts.map +1 -1
- package/dist/services/session.js +28 -1
- package/dist/tools/bashTool.d.ts.map +1 -1
- package/dist/tools/bashTool.js +49 -7
- package/dist/tools/readTool.d.ts.map +1 -1
- package/dist/tools/readTool.js +1 -1
- package/dist/tools/taskManagementTools.d.ts.map +1 -1
- package/dist/tools/taskManagementTools.js +103 -157
- package/dist/tools/types.d.ts +2 -0
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/tools/webFetchTool.d.ts.map +1 -1
- package/dist/tools/webFetchTool.js +0 -9
- package/dist/tools/workflowTool.d.ts +11 -0
- package/dist/tools/workflowTool.d.ts.map +1 -0
- package/dist/tools/workflowTool.js +190 -0
- package/dist/types/agent.d.ts +2 -0
- package/dist/types/agent.d.ts.map +1 -1
- package/dist/types/commands.d.ts +4 -0
- package/dist/types/commands.d.ts.map +1 -1
- package/dist/types/config.d.ts +2 -2
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/core.d.ts +1 -1
- package/dist/types/core.d.ts.map +1 -1
- package/dist/types/hooks.d.ts +2 -0
- package/dist/types/hooks.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -0
- package/dist/types/messaging.d.ts +2 -2
- package/dist/types/messaging.d.ts.map +1 -1
- package/dist/types/processes.d.ts +6 -2
- package/dist/types/processes.d.ts.map +1 -1
- package/dist/types/workflow.d.ts +2 -0
- package/dist/types/workflow.d.ts.map +1 -0
- package/dist/types/workflow.js +1 -0
- package/dist/utils/cacheControlUtils.d.ts +13 -8
- package/dist/utils/cacheControlUtils.d.ts.map +1 -1
- package/dist/utils/cacheControlUtils.js +73 -102
- package/dist/utils/containerSetup.d.ts.map +1 -1
- package/dist/utils/containerSetup.js +7 -0
- package/dist/utils/markdownParser.d.ts.map +1 -1
- package/dist/utils/markdownParser.js +21 -6
- package/dist/utils/messageOperations.d.ts +2 -2
- package/dist/utils/messageOperations.d.ts.map +1 -1
- package/dist/utils/notificationXml.d.ts.map +1 -1
- package/dist/workflow/budgetTracker.d.ts +12 -0
- package/dist/workflow/budgetTracker.d.ts.map +1 -0
- package/dist/workflow/budgetTracker.js +30 -0
- package/dist/workflow/concurrencyLimiter.d.ts +14 -0
- package/dist/workflow/concurrencyLimiter.d.ts.map +1 -0
- package/dist/workflow/concurrencyLimiter.js +39 -0
- package/dist/workflow/journal.d.ts +19 -0
- package/dist/workflow/journal.d.ts.map +1 -0
- package/dist/workflow/journal.js +74 -0
- package/dist/workflow/progressReporter.d.ts +21 -0
- package/dist/workflow/progressReporter.d.ts.map +1 -0
- package/dist/workflow/progressReporter.js +118 -0
- package/dist/workflow/runState.d.ts +16 -0
- package/dist/workflow/runState.d.ts.map +1 -0
- package/dist/workflow/runState.js +57 -0
- package/dist/workflow/scriptRuntime.d.ts +35 -0
- package/dist/workflow/scriptRuntime.d.ts.map +1 -0
- package/dist/workflow/scriptRuntime.js +196 -0
- package/dist/workflow/structuredOutput.d.ts +27 -0
- package/dist/workflow/structuredOutput.d.ts.map +1 -0
- package/dist/workflow/structuredOutput.js +106 -0
- package/dist/workflow/types.d.ts +81 -0
- package/dist/workflow/types.d.ts.map +1 -0
- package/dist/workflow/types.js +1 -0
- package/dist/workflow/workflowApis.d.ts +46 -0
- package/dist/workflow/workflowApis.d.ts.map +1 -0
- package/dist/workflow/workflowApis.js +280 -0
- package/package.json +1 -1
- package/src/agent.ts +144 -34
- package/src/constants/goalPrompts.ts +10 -0
- package/src/constants/tools.ts +1 -0
- package/src/managers/aiManager.ts +91 -47
- package/src/managers/backgroundTaskManager.ts +16 -4
- package/src/managers/goalManager.ts +232 -0
- package/src/managers/messageManager.ts +2 -2
- package/src/managers/messageQueue.ts +59 -1
- package/src/managers/pluginManager.ts +8 -1
- package/src/managers/skillManager.ts +20 -9
- package/src/managers/slashCommandManager.ts +119 -0
- package/src/managers/toolManager.ts +7 -0
- package/src/managers/workflowManager.ts +491 -0
- package/src/prompts/index.ts +4 -2
- package/src/services/aiService.ts +166 -12
- package/src/services/configurationService.ts +2 -22
- package/src/services/hook.ts +5 -0
- package/src/services/session.ts +42 -2
- package/src/tools/bashTool.ts +64 -9
- package/src/tools/readTool.ts +1 -2
- package/src/tools/taskManagementTools.ts +146 -195
- package/src/tools/types.ts +2 -0
- package/src/tools/webFetchTool.ts +0 -12
- package/src/tools/workflowTool.ts +205 -0
- package/src/types/agent.ts +6 -0
- package/src/types/commands.ts +4 -0
- package/src/types/config.ts +2 -2
- package/src/types/core.ts +3 -3
- package/src/types/hooks.ts +2 -0
- package/src/types/index.ts +1 -0
- package/src/types/messaging.ts +2 -2
- package/src/types/processes.ts +10 -2
- package/src/types/workflow.ts +5 -0
- package/src/utils/cacheControlUtils.ts +106 -131
- package/src/utils/containerSetup.ts +9 -0
- package/src/utils/markdownParser.ts +26 -8
- package/src/utils/messageOperations.ts +2 -2
- package/src/utils/notificationXml.ts +6 -1
- package/src/workflow/budgetTracker.ts +34 -0
- package/src/workflow/concurrencyLimiter.ts +47 -0
- package/src/workflow/journal.ts +95 -0
- package/src/workflow/progressReporter.ts +141 -0
- package/src/workflow/runState.ts +65 -0
- package/src/workflow/scriptRuntime.ts +274 -0
- package/src/workflow/structuredOutput.ts +123 -0
- package/src/workflow/types.ts +95 -0
- package/src/workflow/workflowApis.ts +412 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: deep-research
|
|
3
|
+
description: Deep research harness — fan-out web searches, fetch sources, adversarially verify claims, synthesize a cited report
|
|
4
|
+
context: fork
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Deep research harness — fan-out web searches, fetch sources, adversarially verify claims, synthesize a cited report.
|
|
8
|
+
|
|
9
|
+
BEFORE invoking the workflow, check if the question is specific enough to research directly — if underspecified (e.g., "what car to buy" without budget/use-case/region), ask 2-3 clarifying questions to narrow scope. Then pass the refined question as args, weaving the answers in.
|
|
10
|
+
|
|
11
|
+
1. Call the Workflow tool with the following script, passing the user's question as the `args` parameter:
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
export const meta = {
|
|
15
|
+
name: 'deep-research',
|
|
16
|
+
description: 'Deep research harness — fan-out web searches, fetch sources, adversarially verify claims, synthesize a cited report',
|
|
17
|
+
phases: [
|
|
18
|
+
{ title: 'Scope', detail: 'decompose question into 5 search angles' },
|
|
19
|
+
{ title: 'Search', detail: '5 parallel web searches, one per angle' },
|
|
20
|
+
{ title: 'Fetch', detail: 'URL-dedup, fetch top 15 sources, extract falsifiable claims' },
|
|
21
|
+
{ title: 'Verify', detail: '3-vote adversarial verification per claim' },
|
|
22
|
+
{ title: 'Synthesize', detail: 'merge semantic dupes, rank by confidence, cite sources' },
|
|
23
|
+
],
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const question = args
|
|
27
|
+
|
|
28
|
+
phase('Scope')
|
|
29
|
+
const angles = await agent(
|
|
30
|
+
'Decompose this research question into exactly 5 distinct search angles that together provide comprehensive coverage: "' + question + '"\n\nReturn a JSON array of 5 short angle labels. Example: ["overview and background", "technical details and specifications", "recent developments and news", "alternative perspectives and criticisms", "practical implications and case studies"]',
|
|
31
|
+
{ label: 'scope', phase: 'Scope' }
|
|
32
|
+
)
|
|
33
|
+
const angleList = (() => {
|
|
34
|
+
try {
|
|
35
|
+
const match = String(angles).match(/\[[\s\S]*\]/)
|
|
36
|
+
return match ? JSON.parse(match[0]) : ['overview', 'technical details', 'recent developments', 'alternative perspectives', 'practical implications']
|
|
37
|
+
} catch { return ['overview', 'technical details', 'recent developments', 'alternative perspectives', 'practical implications'] }
|
|
38
|
+
})()
|
|
39
|
+
|
|
40
|
+
phase('Search')
|
|
41
|
+
const searches = await parallel(angleList.map(angle => () =>
|
|
42
|
+
agent('Web search for: "' + question + '" — focus on ' + angle + '. Return all relevant URLs and key findings.', {
|
|
43
|
+
label: 'search:' + angle,
|
|
44
|
+
phase: 'Search'
|
|
45
|
+
})
|
|
46
|
+
))
|
|
47
|
+
|
|
48
|
+
phase('Fetch')
|
|
49
|
+
const allUrls = searches.filter(Boolean).flatMap(r => {
|
|
50
|
+
if (typeof r !== 'string') return []
|
|
51
|
+
return r.split('\n').filter(l => l.trim().startsWith('http') || l.trim().startsWith('- http'))
|
|
52
|
+
}).map(u => u.replace(/^-\s*/, '').trim())
|
|
53
|
+
const sources = [...new Set(allUrls)].slice(0, 15)
|
|
54
|
+
const fetched = await pipeline(sources.length > 0 ? sources : ['No specific URLs found — synthesize from search results'], source =>
|
|
55
|
+
agent('Fetch and extract key falsifiable claims from: ' + source + '. For each claim, note the source URL and whether it is supported by evidence. Return each claim as a separate bullet.', {
|
|
56
|
+
label: 'fetch:' + String(source).slice(0, 30),
|
|
57
|
+
phase: 'Fetch'
|
|
58
|
+
})
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
phase('Verify')
|
|
62
|
+
const claimsText = fetched.filter(Boolean).join('\n')
|
|
63
|
+
const claimLines = claimsText.split('\n').filter(l => l.trim().startsWith('-') || l.trim().startsWith('•') || l.trim().startsWith('*'))
|
|
64
|
+
const claimsToVerify = claimLines.length > 0 ? claimLines : [claimsText]
|
|
65
|
+
const verified = await parallel(claimsToVerify.slice(0, 12).map((claim, i) => () =>
|
|
66
|
+
parallel([0, 1, 2].map(voteIdx => () =>
|
|
67
|
+
agent('You are a skeptical fact-checker (vote ' + (voteIdx + 1) + '/3). For the following claim, search for evidence that REFUTES it. Claim: "' + claim + '"\n\nIf you find strong evidence against it, respond REFUTED with the counter-evidence. If the claim holds up, respond CONFIRMED. Be rigorous — only refute if you find direct contradictory evidence.', {
|
|
68
|
+
label: 'verify:claim' + i + ':vote' + voteIdx,
|
|
69
|
+
phase: 'Verify'
|
|
70
|
+
})
|
|
71
|
+
))
|
|
72
|
+
))
|
|
73
|
+
const verifiedClaims = verified.flatMap((votes, i) => {
|
|
74
|
+
if (!Array.isArray(votes)) return []
|
|
75
|
+
const refutes = votes.filter(v => String(v).toUpperCase().includes('REFUTED')).length
|
|
76
|
+
return refutes >= 2 ? [] : [{ claim: claimsToVerify[i], status: refutes === 0 ? 'confirmed' : 'contested', votes }]
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
phase('Synthesize')
|
|
80
|
+
const confirmedClaims = verifiedClaims.filter(c => c.status === 'confirmed').map(c => c.claim).join('\n')
|
|
81
|
+
const contestedClaims = verifiedClaims.filter(c => c.status === 'contested').map(c => c.claim + ' (contested)').join('\n')
|
|
82
|
+
const report = await agent(
|
|
83
|
+
'Synthesize a comprehensive cited report answering: "' + question + '".\n\nConfirmed claims:\n' + (confirmedClaims || 'None') + '\n\nContested claims (include with caveat):\n' + (contestedClaims || 'None') + '\n\nMerge semantic duplicates. Rank findings by confidence level. Include: 1) Executive summary 2) Key findings with citations, ranked by confidence 3) Contested findings (with caveats) 4) Areas of uncertainty 5) Conclusion.',
|
|
84
|
+
{ label: 'synthesize', phase: 'Synthesize' }
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
return report
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
2. After the workflow starts, inform the user that deep research is running and they can use /workflows to monitor progress.
|
|
@@ -23,14 +23,17 @@ Wave uses several environment variables to control its core functionality.
|
|
|
23
23
|
| :--- | :--- | :--- |
|
|
24
24
|
| `WAVE_API_KEY` | API key for the AI gateway. | - |
|
|
25
25
|
| `WAVE_BASE_URL` | Base URL for the AI gateway. | - |
|
|
26
|
-
| `
|
|
26
|
+
| `WAVE_SERVER_URL` | Server URL for SSO authentication. | - |
|
|
27
|
+
| `WAVE_CUSTOM_HEADERS` | Custom HTTP headers for the AI gateway. Newline-separated `Key: Value` pairs (e.g., `"X-Foo: bar\nAuthorization: Bearer xxx"`). | - |
|
|
27
28
|
| `WAVE_MODEL` | The primary AI model to use for the agent. | `gemini-3-flash` |
|
|
28
29
|
| `WAVE_FAST_MODEL` | The fast AI model to use for quick tasks. | `gemini-2.5-flash` |
|
|
29
|
-
| `WAVE_MAX_INPUT_TOKENS` | Maximum number of input tokens allowed. | `
|
|
30
|
-
| `WAVE_MAX_OUTPUT_TOKENS` | Maximum number of output tokens allowed. | `
|
|
30
|
+
| `WAVE_MAX_INPUT_TOKENS` | Maximum number of input tokens allowed. | `128000` |
|
|
31
|
+
| `WAVE_MAX_OUTPUT_TOKENS` | Maximum number of output tokens allowed. | `16384` |
|
|
31
32
|
| `WAVE_DISABLE_AUTO_MEMORY` | Set to `1` or `true` to disable the auto-memory feature. | `false` |
|
|
33
|
+
| `WAVE_AUTO_MEMORY_FREQUENCY` | Auto memory update frequency. `1` = every turn, `2` = every 2 turns, etc. | `1` |
|
|
32
34
|
| `WAVE_TASK_LIST_ID` | Explicitly set the task list ID for the session. | (Session ID) |
|
|
33
35
|
| `WAVE_PROMPT_CACHE_REGEX` | Regex pattern to match model names that support prompt caching. Models matching this pattern will have cache control markers applied. | `claude` |
|
|
36
|
+
| `WAVE_PLUGIN_GIT_TIMEOUT_MS` | Timeout in milliseconds for git operations when installing plugins. | `300000` |
|
|
34
37
|
|
|
35
38
|
## Configuration Scopes
|
|
36
39
|
|
package/dist/agent.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export declare class Agent {
|
|
|
18
18
|
private pluginManager;
|
|
19
19
|
private skillManager;
|
|
20
20
|
private cronManager;
|
|
21
|
+
private goalManager;
|
|
21
22
|
private hookManager;
|
|
22
23
|
private reversionManager;
|
|
23
24
|
private notificationQueue;
|
|
@@ -84,15 +85,35 @@ export declare class Agent {
|
|
|
84
85
|
get isCommandRunning(): boolean;
|
|
85
86
|
/** Get queued messages */
|
|
86
87
|
get queuedMessages(): QueuedMessage[];
|
|
88
|
+
/** Get goal status string */
|
|
89
|
+
get goalStatus(): string;
|
|
90
|
+
/** Check if a goal is active */
|
|
91
|
+
get isGoalActive(): boolean;
|
|
87
92
|
/**
|
|
88
93
|
* Remove a queued message by index
|
|
89
94
|
* @param index - The index of the message to remove
|
|
90
95
|
* @returns true if the message was removed, false if the index was out of bounds
|
|
91
96
|
*/
|
|
92
97
|
removeQueuedMessage(index: number): boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Recall the last editable queued message (for inline editing)
|
|
100
|
+
* @returns The recalled message, or null if no editable message exists
|
|
101
|
+
*/
|
|
102
|
+
recallQueuedMessage(): QueuedMessage | null;
|
|
103
|
+
/**
|
|
104
|
+
* Remove a queued message by its ID
|
|
105
|
+
* @param id - The ID of the message to remove
|
|
106
|
+
* @returns true if the message was removed, false if not found
|
|
107
|
+
*/
|
|
108
|
+
removeQueuedMessageById(id: string): boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Unified dequeue trigger — checks state machine before processing.
|
|
111
|
+
* Called from onMessageEnqueued, onLoadingChange(false), and
|
|
112
|
+
* onCommandRunningChange(false).
|
|
113
|
+
*/
|
|
114
|
+
private tryDequeue;
|
|
93
115
|
/**
|
|
94
116
|
* Process the next queued message when the agent becomes idle.
|
|
95
|
-
* Dequeues the next message and handles it based on type.
|
|
96
117
|
*/
|
|
97
118
|
private processQueuedMessage;
|
|
98
119
|
/** Get background bash shell output */
|
|
@@ -117,6 +138,12 @@ export declare class Agent {
|
|
|
117
138
|
} | null;
|
|
118
139
|
/** Stop background task */
|
|
119
140
|
stopBackgroundTask(id: string): boolean;
|
|
141
|
+
/** Get all workflow runs */
|
|
142
|
+
getWorkflowRuns(): Promise<import("./workflow/types.js").WorkflowRun[]>;
|
|
143
|
+
/** Get a specific workflow run by ID */
|
|
144
|
+
getWorkflowRun(runId: string): import("./workflow/types.js").WorkflowRun | undefined;
|
|
145
|
+
/** Stop a workflow run */
|
|
146
|
+
stopWorkflowRun(runId: string): void;
|
|
120
147
|
/**
|
|
121
148
|
* Static async factory method for creating Agent instances
|
|
122
149
|
*
|
package/dist/agent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAaA,OAAO,EAAgB,KAAK,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAO9E,OAAO,EACL,YAAY,EACZ,kBAAkB,EAElB,YAAY,EACb,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EACV,OAAO,EAEP,eAAe,EACf,aAAa,EACb,WAAW,EACX,KAAK,EACL,cAAc,EACd,cAAc,EACf,MAAM,kBAAkB,CAAC;AAqB1B,qBAAa,KAAK;IAChB,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,SAAS,CAAY;IAE7B,OAAO,CAAC,WAAW,CAA4B;IAC/C,OAAO,CAAC,qBAAqB,CAAwB;IACrD,OAAO,CAAC,MAAM,CAAC,CAAS;IACxB,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,UAAU,CAAc;IAChC,OAAO,CAAC,iBAAiB,CAAoB;IAC7C,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,kBAAkB,CAAqB;IAC/C,OAAO,CAAC,mBAAmB,CAAsB;IACjD,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,gBAAgB,CAAmB;IAC3C,OAAO,CAAC,iBAAiB,CAAoB;IAC7C,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,2BAA2B,CA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AE;IAItC;;OAEG;IACU,eAAe,CAC1B,OAAO,EAAE,OAAO,wBAAwB,EAAE,qBAAqB,GAC9D,OAAO,CAAC,OAAO,wBAAwB,EAAE,kBAAkB,CAAC;IAI/D;;;OAGG;IACU,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3D;;;;OAIG;IACI,mBAAmB,CACxB,UAAU,EAAE,MAAM,GACjB,OAAO,+BAA+B,EAAE,gBAAgB,GAAG,IAAI;IAIlE;;OAEG;IACH,IAAW,UAAU,IAAI,MAAM,CAE9B;IAED;;OAEG;IACH,IAAW,wBAAwB,IAAI,OAAO,CAO7C;CACF"}
|
package/dist/agent.js
CHANGED
|
@@ -109,6 +109,7 @@ export class Agent {
|
|
|
109
109
|
this.pluginManager = this.container.get("PluginManager");
|
|
110
110
|
this.bangManager = this.container.get("BangManager");
|
|
111
111
|
this.cronManager = this.container.get("CronManager");
|
|
112
|
+
this.goalManager = this.container.get("GoalManager");
|
|
112
113
|
this.notificationQueue = this.container.get("NotificationQueue");
|
|
113
114
|
this.messageQueue = this.container.get("MessageQueue");
|
|
114
115
|
// Wire up notification queue to trigger AI when notifications arrive while idle
|
|
@@ -128,36 +129,30 @@ export class Agent {
|
|
|
128
129
|
this.options.callbacks?.onWorkdirChange?.(newCwd);
|
|
129
130
|
});
|
|
130
131
|
// Wire up message queue to process when agent becomes idle
|
|
131
|
-
this.messageQueue.onMessageEnqueued = () =>
|
|
132
|
-
// If the AI is NOT loading and command is not running, trigger dequeue
|
|
133
|
-
if (!this.aiManager.isLoading && !this.isCommandRunning) {
|
|
134
|
-
this.processQueuedMessage().catch((error) => {
|
|
135
|
-
this.logger?.error("Failed to process queued message:", error);
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
};
|
|
132
|
+
this.messageQueue.onMessageEnqueued = () => this.tryDequeue();
|
|
139
133
|
// Wire up AI loading changes to process queue when AI becomes idle
|
|
140
134
|
this.aiManager.onLoadingChange = (loading) => {
|
|
141
|
-
if (!loading
|
|
142
|
-
this.
|
|
143
|
-
this.logger?.error("Failed to process queued message:", error);
|
|
144
|
-
});
|
|
145
|
-
}
|
|
135
|
+
if (!loading)
|
|
136
|
+
this.tryDequeue();
|
|
146
137
|
};
|
|
147
138
|
// Wire up bang manager callback for command running changes
|
|
148
139
|
this.bangManager.onCommandRunningChange = (running) => {
|
|
149
140
|
this.options.callbacks?.onCommandRunningChange?.(running);
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
this.processQueuedMessage().catch((error) => {
|
|
153
|
-
this.logger?.error("Failed to process queued message:", error);
|
|
154
|
-
});
|
|
155
|
-
}
|
|
141
|
+
if (!running)
|
|
142
|
+
this.tryDequeue();
|
|
156
143
|
};
|
|
157
144
|
// Set initial permission mode if provided
|
|
158
145
|
if (options.permissionMode) {
|
|
159
146
|
this.setPermissionMode(options.permissionMode);
|
|
160
147
|
}
|
|
148
|
+
// Wire up goal state change callback
|
|
149
|
+
this.goalManager.setOnGoalStateChange((active, condition, elapsed) => {
|
|
150
|
+
this.options.callbacks?.onGoalStateChange?.(active, condition, elapsed);
|
|
151
|
+
});
|
|
152
|
+
// Wire up goal evaluating callback
|
|
153
|
+
this.goalManager.setOnGoalEvaluating((evaluating) => {
|
|
154
|
+
this.options.callbacks?.onGoalEvaluating?.(evaluating);
|
|
155
|
+
});
|
|
161
156
|
}
|
|
162
157
|
// Public getter methods
|
|
163
158
|
get sessionId() {
|
|
@@ -218,6 +213,14 @@ export class Agent {
|
|
|
218
213
|
get queuedMessages() {
|
|
219
214
|
return this.messageQueue.getQueue();
|
|
220
215
|
}
|
|
216
|
+
/** Get goal status string */
|
|
217
|
+
get goalStatus() {
|
|
218
|
+
return this.goalManager.getStatusString();
|
|
219
|
+
}
|
|
220
|
+
/** Check if a goal is active */
|
|
221
|
+
get isGoalActive() {
|
|
222
|
+
return this.goalManager.isGoalActive();
|
|
223
|
+
}
|
|
221
224
|
/**
|
|
222
225
|
* Remove a queued message by index
|
|
223
226
|
* @param index - The index of the message to remove
|
|
@@ -230,14 +233,59 @@ export class Agent {
|
|
|
230
233
|
}
|
|
231
234
|
return removed;
|
|
232
235
|
}
|
|
236
|
+
/**
|
|
237
|
+
* Recall the last editable queued message (for inline editing)
|
|
238
|
+
* @returns The recalled message, or null if no editable message exists
|
|
239
|
+
*/
|
|
240
|
+
recallQueuedMessage() {
|
|
241
|
+
const msg = this.messageQueue.popLastEditable();
|
|
242
|
+
if (msg) {
|
|
243
|
+
this.options.callbacks?.onQueuedMessagesChange?.(this.queuedMessages);
|
|
244
|
+
}
|
|
245
|
+
return msg;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Remove a queued message by its ID
|
|
249
|
+
* @param id - The ID of the message to remove
|
|
250
|
+
* @returns true if the message was removed, false if not found
|
|
251
|
+
*/
|
|
252
|
+
removeQueuedMessageById(id) {
|
|
253
|
+
const removed = this.messageQueue.removeById(id);
|
|
254
|
+
if (removed) {
|
|
255
|
+
this.options.callbacks?.onQueuedMessagesChange?.(this.queuedMessages);
|
|
256
|
+
}
|
|
257
|
+
return removed;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Unified dequeue trigger — checks state machine before processing.
|
|
261
|
+
* Called from onMessageEnqueued, onLoadingChange(false), and
|
|
262
|
+
* onCommandRunningChange(false).
|
|
263
|
+
*/
|
|
264
|
+
tryDequeue() {
|
|
265
|
+
if (this.messageQueue.state !== "idle")
|
|
266
|
+
return;
|
|
267
|
+
if (!this.messageQueue.hasPending())
|
|
268
|
+
return;
|
|
269
|
+
if (this.aiManager.isLoading || this.isCommandRunning)
|
|
270
|
+
return;
|
|
271
|
+
this.messageQueue.transitionTo("dispatching");
|
|
272
|
+
this.processQueuedMessage()
|
|
273
|
+
.catch((error) => {
|
|
274
|
+
this.logger?.error("Failed to process queued message:", error);
|
|
275
|
+
})
|
|
276
|
+
.finally(() => {
|
|
277
|
+
this.messageQueue.transitionTo("idle");
|
|
278
|
+
this.tryDequeue(); // Re-check after processing
|
|
279
|
+
});
|
|
280
|
+
}
|
|
233
281
|
/**
|
|
234
282
|
* Process the next queued message when the agent becomes idle.
|
|
235
|
-
* Dequeues the next message and handles it based on type.
|
|
236
283
|
*/
|
|
237
284
|
async processQueuedMessage() {
|
|
238
285
|
const next = this.messageQueue.dequeue();
|
|
239
286
|
if (!next)
|
|
240
287
|
return;
|
|
288
|
+
this.messageQueue.transitionTo("running");
|
|
241
289
|
this.options.callbacks?.onQueuedMessagesChange?.(this.queuedMessages);
|
|
242
290
|
if (next.type === "bang") {
|
|
243
291
|
await this.bangManager?.executeCommand(next.content);
|
|
@@ -263,6 +311,30 @@ export class Agent {
|
|
|
263
311
|
stopBackgroundTask(id) {
|
|
264
312
|
return this.backgroundTaskManager.stopTask(id);
|
|
265
313
|
}
|
|
314
|
+
/** Get all workflow runs */
|
|
315
|
+
async getWorkflowRuns() {
|
|
316
|
+
if (!this.container.has("WorkflowManager"))
|
|
317
|
+
return [];
|
|
318
|
+
return this.container
|
|
319
|
+
.get("WorkflowManager")
|
|
320
|
+
.listRuns();
|
|
321
|
+
}
|
|
322
|
+
/** Get a specific workflow run by ID */
|
|
323
|
+
getWorkflowRun(runId) {
|
|
324
|
+
if (!this.container.has("WorkflowManager"))
|
|
325
|
+
return undefined;
|
|
326
|
+
return this.container
|
|
327
|
+
.get("WorkflowManager")
|
|
328
|
+
.getRun(runId);
|
|
329
|
+
}
|
|
330
|
+
/** Stop a workflow run */
|
|
331
|
+
stopWorkflowRun(runId) {
|
|
332
|
+
if (!this.container.has("WorkflowManager"))
|
|
333
|
+
return;
|
|
334
|
+
this.container
|
|
335
|
+
.get("WorkflowManager")
|
|
336
|
+
.stopRun(runId);
|
|
337
|
+
}
|
|
266
338
|
/**
|
|
267
339
|
* Static async factory method for creating Agent instances
|
|
268
340
|
*
|
|
@@ -355,12 +427,19 @@ export class Agent {
|
|
|
355
427
|
this.logger?.warn("Telemetry initialization failed:", error);
|
|
356
428
|
});
|
|
357
429
|
// Log session_start event
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
430
|
+
try {
|
|
431
|
+
const modelConfig = this.getModelConfig();
|
|
432
|
+
if (modelConfig.model) {
|
|
433
|
+
logOTelEvent("session_start", {
|
|
434
|
+
sessionId: this.messageManager.getSessionId(),
|
|
435
|
+
model: modelConfig.model,
|
|
436
|
+
workdir: this.workdir,
|
|
437
|
+
}).catch(() => { }); // Non-blocking
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
catch {
|
|
441
|
+
// Model not configured yet - will be available after SSO login
|
|
442
|
+
}
|
|
364
443
|
}
|
|
365
444
|
/**
|
|
366
445
|
* Restore a session by ID, switching to the target session without destroying the Agent instance
|
|
@@ -423,10 +502,13 @@ export class Agent {
|
|
|
423
502
|
}
|
|
424
503
|
/** Unified interrupt method, interrupts both AI messages and command execution */
|
|
425
504
|
abortMessage() {
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
505
|
+
if (this.aiManager.isLoading || this.isCommandRunning) {
|
|
506
|
+
// Clear queue first to prevent processQueuedMessage from dequeuing
|
|
507
|
+
// when abortAIMessage triggers onLoadingChange(false)
|
|
508
|
+
this.messageQueue.clear();
|
|
509
|
+
this.options.callbacks?.onQueuedMessagesChange?.(this.queuedMessages);
|
|
510
|
+
}
|
|
511
|
+
this.messageQueue.transitionTo("idle"); // Reset state on abort
|
|
430
512
|
this.abortAIMessage(); // This will abort tools including Agent tool (subagents)
|
|
431
513
|
this.abortBashCommand();
|
|
432
514
|
this.abortSlashCommand();
|
|
@@ -592,11 +674,23 @@ export class Agent {
|
|
|
592
674
|
* ```
|
|
593
675
|
*/
|
|
594
676
|
async sendMessage(content, images) {
|
|
595
|
-
// If the agent is busy, enqueue the message
|
|
677
|
+
// If the agent is busy, enqueue the message — unless it's an immediate
|
|
678
|
+
// slash command (e.g., /goal clear, /clear, /compact) that should execute
|
|
679
|
+
// right away even while AI is processing
|
|
596
680
|
if (this.aiManager.isLoading || this.isCommandRunning) {
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
681
|
+
const trimmed = content.trim();
|
|
682
|
+
const isImmediate = trimmed.startsWith("/") &&
|
|
683
|
+
trimmed !== "/" &&
|
|
684
|
+
this.slashCommandManager.isImmediateCommand(trimmed);
|
|
685
|
+
if (!isImmediate) {
|
|
686
|
+
this.messageQueue.enqueue({
|
|
687
|
+
content,
|
|
688
|
+
images,
|
|
689
|
+
});
|
|
690
|
+
this.options.callbacks?.onQueuedMessagesChange?.(this.queuedMessages);
|
|
691
|
+
return;
|
|
692
|
+
}
|
|
693
|
+
// Immediate slash command: fall through to InteractionService
|
|
600
694
|
}
|
|
601
695
|
await InteractionService.sendMessage({
|
|
602
696
|
messageManager: this.messageManager,
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const GOAL_EVALUATION_SYSTEM_PROMPT = "You are a goal evaluator. Given a goal condition and a conversation, determine whether the goal has been achieved.\n\nRules:\n- Judge ONLY based on what the conversation shows \u2014 tool outputs, test results, file contents, etc.\n- Do NOT assume work is done without evidence in the conversation.\n- Be strict and conservative: when uncertain, return met: false.\n- Be concise: your reason should be 1-2 sentences.\n\nRespond with JSON only, no other text:\n{\"met\": boolean, \"reason\": \"short explanation\"}";
|
|
2
|
+
//# sourceMappingURL=goalPrompts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"goalPrompts.d.ts","sourceRoot":"","sources":["../../src/constants/goalPrompts.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B,sgBASM,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const GOAL_EVALUATION_SYSTEM_PROMPT = `You are a goal evaluator. Given a goal condition and a conversation, determine whether the goal has been achieved.
|
|
2
|
+
|
|
3
|
+
Rules:
|
|
4
|
+
- Judge ONLY based on what the conversation shows — tool outputs, test results, file contents, etc.
|
|
5
|
+
- Do NOT assume work is done without evidence in the conversation.
|
|
6
|
+
- Be strict and conservative: when uncertain, return met: false.
|
|
7
|
+
- Be concise: your reason should be 1-2 sentences.
|
|
8
|
+
|
|
9
|
+
Respond with JSON only, no other text:
|
|
10
|
+
{"met": boolean, "reason": "short explanation"}`;
|
|
@@ -21,4 +21,5 @@ export declare const CRON_LIST_TOOL_NAME = "CronList";
|
|
|
21
21
|
export declare const WEB_FETCH_TOOL_NAME = "WebFetch";
|
|
22
22
|
export declare const ENTER_WORKTREE_TOOL_NAME = "EnterWorktree";
|
|
23
23
|
export declare const EXIT_WORKTREE_TOOL_NAME = "ExitWorktree";
|
|
24
|
+
export declare const WORKFLOW_TOOL_NAME = "Workflow";
|
|
24
25
|
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/constants/tools.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,oBAAoB,CAAC;AAC7D,eAAO,MAAM,cAAc,SAAS,CAAC;AACrC,eAAO,MAAM,mBAAmB,aAAa,CAAC;AAC9C,eAAO,MAAM,cAAc,SAAS,CAAC;AACrC,eAAO,MAAM,yBAAyB,kBAAkB,CAAC;AACzD,eAAO,MAAM,wBAAwB,iBAAiB,CAAC;AACvD,eAAO,MAAM,cAAc,SAAS,CAAC;AACrC,eAAO,MAAM,cAAc,SAAS,CAAC;AACrC,eAAO,MAAM,aAAa,QAAQ,CAAC;AACnC,eAAO,MAAM,cAAc,SAAS,CAAC;AACrC,eAAO,MAAM,eAAe,UAAU,CAAC;AACvC,eAAO,MAAM,eAAe,UAAU,CAAC;AACvC,eAAO,MAAM,qBAAqB,eAAe,CAAC;AAClD,eAAO,MAAM,kBAAkB,YAAY,CAAC;AAC5C,eAAO,MAAM,qBAAqB,eAAe,CAAC;AAClD,eAAO,MAAM,mBAAmB,aAAa,CAAC;AAC9C,eAAO,MAAM,eAAe,UAAU,CAA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,aAAa,CAAC"}
|
package/dist/constants/tools.js
CHANGED
|
@@ -31,6 +31,13 @@ export declare class AIManager {
|
|
|
31
31
|
private originalWorkdir;
|
|
32
32
|
private consecutiveCompactionFailures;
|
|
33
33
|
private readonly maxTurns?;
|
|
34
|
+
/** Override tool_choice for this AI manager (e.g. for structured output) */
|
|
35
|
+
toolChoiceOverride?: "auto" | "none" | "required" | {
|
|
36
|
+
type: "function";
|
|
37
|
+
function: {
|
|
38
|
+
name: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
34
41
|
constructor(container: Container, options: AIManagerOptions);
|
|
35
42
|
private get toolManager();
|
|
36
43
|
private get messageManager();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aiManager.d.ts","sourceRoot":"","sources":["../../src/managers/aiManager.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,aAAa,EACb,WAAW,EACX,KAAK,EAGN,MAAM,mBAAmB,CAAC;AAkB3B,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAclD,MAAM,WAAW,kBAAkB;IACjC,uBAAuB,CAAC,EAAE,CAAC,YAAY,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1D,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACtC,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uEAAuE;IACvE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,kDAAkD;IAClD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,6FAA6F;IAC7F,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,SAAS;
|
|
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