@qduc/term2 0.32.0 → 0.32.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/dist/agent.d.ts.map +1 -1
- package/dist/agent.js.map +1 -1
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +2 -2
- package/dist/app.js.map +1 -1
- package/dist/build-info.json +2 -2
- package/dist/components/InputBox.js +12 -3
- package/dist/components/InputBox.js.map +1 -1
- package/dist/components/layout/BackgroundTasksPanel.d.ts.map +1 -1
- package/dist/components/layout/BackgroundTasksPanel.js +6 -8
- package/dist/components/layout/BackgroundTasksPanel.js.map +1 -1
- package/dist/components/layout/BottomArea.d.ts +2 -0
- package/dist/components/layout/BottomArea.d.ts.map +1 -1
- package/dist/components/layout/BottomArea.js +37 -10
- package/dist/components/layout/BottomArea.js.map +1 -1
- package/dist/components/prompt/ApprovalPrompt.d.ts.map +1 -1
- package/dist/components/prompt/ApprovalPrompt.js +22 -1
- package/dist/components/prompt/ApprovalPrompt.js.map +1 -1
- package/dist/contracts/streamed-model-turn.d.ts +4 -0
- package/dist/contracts/streamed-model-turn.d.ts.map +1 -1
- package/dist/contracts/streamed-model-turn.js.map +1 -1
- package/dist/hooks/conversation-ui-reducer.d.ts +11 -0
- package/dist/hooks/conversation-ui-reducer.d.ts.map +1 -1
- package/dist/hooks/conversation-ui-reducer.js +11 -3
- package/dist/hooks/conversation-ui-reducer.js.map +1 -1
- package/dist/hooks/use-conversation.d.ts +1 -0
- package/dist/hooks/use-conversation.d.ts.map +1 -1
- package/dist/hooks/use-conversation.js +12 -2
- package/dist/hooks/use-conversation.js.map +1 -1
- package/dist/hooks/use-model-selection.d.ts.map +1 -1
- package/dist/hooks/use-model-selection.js +5 -7
- package/dist/hooks/use-model-selection.js.map +1 -1
- package/dist/hooks/use-standalone-model-picker.d.ts.map +1 -1
- package/dist/hooks/use-standalone-model-picker.js +3 -4
- package/dist/hooks/use-standalone-model-picker.js.map +1 -1
- package/dist/lib/agent-chat-service.js +2 -2
- package/dist/lib/agent-chat-service.js.map +1 -1
- package/dist/lib/agent-client.d.ts +2 -1
- package/dist/lib/agent-client.d.ts.map +1 -1
- package/dist/lib/agent-client.js +3 -3
- package/dist/lib/agent-client.js.map +1 -1
- package/dist/lib/agent-configuration.d.ts +5 -3
- package/dist/lib/agent-configuration.d.ts.map +1 -1
- package/dist/lib/agent-configuration.js +5 -4
- package/dist/lib/agent-configuration.js.map +1 -1
- package/dist/providers/ai-sdk-streamed-model.d.ts.map +1 -1
- package/dist/providers/ai-sdk-streamed-model.js +15 -3
- package/dist/providers/ai-sdk-streamed-model.js.map +1 -1
- package/dist/providers/codex.provider.d.ts +3 -2
- package/dist/providers/codex.provider.d.ts.map +1 -1
- package/dist/providers/codex.provider.js.map +1 -1
- package/dist/providers/registry.d.ts +2 -1
- package/dist/providers/registry.d.ts.map +1 -1
- package/dist/providers/registry.js.map +1 -1
- package/dist/providers/retrying-model.d.ts +8 -4
- package/dist/providers/retrying-model.d.ts.map +1 -1
- package/dist/providers/retrying-model.js +1 -1
- package/dist/providers/retrying-model.js.map +1 -1
- package/dist/services/agent-runtime/application-run-loop.d.ts.map +1 -1
- package/dist/services/agent-runtime/application-run-loop.js +3 -0
- package/dist/services/agent-runtime/application-run-loop.js.map +1 -1
- package/dist/services/agent-runtime/tool-call-execution.d.ts.map +1 -1
- package/dist/services/agent-runtime/tool-call-execution.js +7 -1
- package/dist/services/agent-runtime/tool-call-execution.js.map +1 -1
- package/dist/services/agent-runtime/workflow/workflow-evaluator.d.ts +5 -0
- package/dist/services/agent-runtime/workflow/workflow-evaluator.d.ts.map +1 -1
- package/dist/services/agent-runtime/workflow/workflow-evaluator.js +6 -1
- package/dist/services/agent-runtime/workflow/workflow-evaluator.js.map +1 -1
- package/dist/services/conversation/conversation-orchestrator.d.ts.map +1 -1
- package/dist/services/conversation/conversation-orchestrator.js +33 -0
- package/dist/services/conversation/conversation-orchestrator.js.map +1 -1
- package/dist/services/conversation/conversation-orchestrator.types.d.ts +6 -0
- package/dist/services/conversation/conversation-orchestrator.types.d.ts.map +1 -1
- package/dist/services/conversation/conversation-service.d.ts +2 -1
- package/dist/services/conversation/conversation-service.d.ts.map +1 -1
- package/dist/services/conversation/conversation-service.js.map +1 -1
- package/dist/services/conversation-agent-client.d.ts +2 -1
- package/dist/services/conversation-agent-client.d.ts.map +1 -1
- package/dist/services/memory/memory-capabilities.d.ts +2 -2
- package/dist/services/memory/memory-capabilities.d.ts.map +1 -1
- package/dist/services/models/unified-model-catalog.d.ts.map +1 -1
- package/dist/services/models/unified-model-catalog.js +26 -1
- package/dist/services/models/unified-model-catalog.js.map +1 -1
- package/dist/services/retry/retry-error-classification.d.ts.map +1 -1
- package/dist/services/retry/retry-error-classification.js +3 -0
- package/dist/services/retry/retry-error-classification.js.map +1 -1
- package/dist/services/retry/retry-event-presenter.d.ts.map +1 -1
- package/dist/services/retry/retry-event-presenter.js +1 -0
- package/dist/services/retry/retry-event-presenter.js.map +1 -1
- package/dist/services/retry/upstream-retry-policy.d.ts.map +1 -1
- package/dist/services/retry/upstream-retry-policy.js +49 -3
- package/dist/services/retry/upstream-retry-policy.js.map +1 -1
- package/dist/services/session/session-runtime-controller.d.ts +2 -1
- package/dist/services/session/session-runtime-controller.d.ts.map +1 -1
- package/dist/services/session/session-runtime-controller.js.map +1 -1
- package/dist/services/session/session-stream-processor.d.ts.map +1 -1
- package/dist/services/session/session-stream-processor.js +11 -0
- package/dist/services/session/session-stream-processor.js.map +1 -1
- package/dist/services/session/session-tool-tracker.d.ts +17 -1
- package/dist/services/session/session-tool-tracker.d.ts.map +1 -1
- package/dist/services/session/session-tool-tracker.js +30 -1
- package/dist/services/session/session-tool-tracker.js.map +1 -1
- package/dist/services/subagents/tool-policy.d.ts +10 -10
- package/dist/services/subagents/tool-policy.d.ts.map +1 -1
- package/dist/services/subagents/tool-policy.js.map +1 -1
- package/dist/skins/cards/live-region.d.ts.map +1 -1
- package/dist/skins/cards/live-region.js +6 -3
- package/dist/skins/cards/live-region.js.map +1 -1
- package/dist/skins/classic/live-region.d.ts.map +1 -1
- package/dist/skins/classic/live-region.js +9 -2
- package/dist/skins/classic/live-region.js.map +1 -1
- package/dist/skins/ledger/live-region.d.ts.map +1 -1
- package/dist/skins/ledger/live-region.js +6 -3
- package/dist/skins/ledger/live-region.js.map +1 -1
- package/dist/skins/rail/live-region.d.ts.map +1 -1
- package/dist/skins/rail/live-region.js +8 -2
- package/dist/skins/rail/live-region.js.map +1 -1
- package/dist/skins/testing/scenes.d.ts.map +1 -1
- package/dist/skins/testing/scenes.js +17 -0
- package/dist/skins/testing/scenes.js.map +1 -1
- package/dist/skins/types.d.ts +8 -1
- package/dist/skins/types.d.ts.map +1 -1
- package/dist/skins/types.js.map +1 -1
- package/dist/skins/zen/live-region.d.ts.map +1 -1
- package/dist/skins/zen/live-region.js +7 -3
- package/dist/skins/zen/live-region.js.map +1 -1
- package/dist/test-helpers/vitest-cache-global-setup.d.ts +3 -0
- package/dist/test-helpers/vitest-cache-global-setup.d.ts.map +1 -0
- package/dist/test-helpers/vitest-cache-global-setup.js +12 -0
- package/dist/test-helpers/vitest-cache-global-setup.js.map +1 -0
- package/dist/test-helpers/vitest-cache-isolation.d.ts +5 -0
- package/dist/test-helpers/vitest-cache-isolation.d.ts.map +1 -1
- package/dist/test-helpers/vitest-cache-isolation.js +7 -2
- package/dist/test-helpers/vitest-cache-isolation.js.map +1 -1
- package/dist/tools/agent/activate-skill.d.ts +2 -2
- package/dist/tools/agent/activate-skill.d.ts.map +1 -1
- package/dist/tools/agent/activate-skill.js +1 -0
- package/dist/tools/agent/activate-skill.js.map +1 -1
- package/dist/tools/agent/ask-mentor.d.ts +1 -1
- package/dist/tools/agent/ask-mentor.d.ts.map +1 -1
- package/dist/tools/agent/ask-mentor.js.map +1 -1
- package/dist/tools/agent/ask-orchestrator.d.ts +2 -2
- package/dist/tools/agent/ask-orchestrator.d.ts.map +1 -1
- package/dist/tools/agent/ask-orchestrator.js +1 -0
- package/dist/tools/agent/ask-orchestrator.js.map +1 -1
- package/dist/tools/agent/ask-user.d.ts +2 -1
- package/dist/tools/agent/ask-user.d.ts.map +1 -1
- package/dist/tools/agent/ask-user.js.map +1 -1
- package/dist/tools/agent/configure-task-check-in.d.ts +2 -2
- package/dist/tools/agent/configure-task-check-in.d.ts.map +1 -1
- package/dist/tools/agent/goal-check.d.ts +2 -1
- package/dist/tools/agent/goal-check.d.ts.map +1 -1
- package/dist/tools/agent/propose-goal.d.ts +2 -2
- package/dist/tools/agent/propose-goal.d.ts.map +1 -1
- package/dist/tools/agent/propose-goal.js +1 -0
- package/dist/tools/agent/propose-goal.js.map +1 -1
- package/dist/tools/agent/run-explorer.d.ts +2 -2
- package/dist/tools/agent/run-explorer.d.ts.map +1 -1
- package/dist/tools/agent/run-explorer.js +1 -0
- package/dist/tools/agent/run-explorer.js.map +1 -1
- package/dist/tools/agent/run-subagent-async.d.ts +5 -5
- package/dist/tools/agent/run-subagent-async.d.ts.map +1 -1
- package/dist/tools/agent/run-subagent-async.js +4 -0
- package/dist/tools/agent/run-subagent-async.js.map +1 -1
- package/dist/tools/agent/run-subagent.d.ts +2 -2
- package/dist/tools/agent/run-subagent.d.ts.map +1 -1
- package/dist/tools/file/apply-patch.d.ts +2 -2
- package/dist/tools/file/apply-patch.d.ts.map +1 -1
- package/dist/tools/file/code-context.d.ts +3 -3
- package/dist/tools/file/code-context.d.ts.map +1 -1
- package/dist/tools/file/code-context.js +59 -0
- package/dist/tools/file/code-context.js.map +1 -1
- package/dist/tools/file/create-file.d.ts +2 -2
- package/dist/tools/file/create-file.d.ts.map +1 -1
- package/dist/tools/file/create-file.js +1 -0
- package/dist/tools/file/create-file.js.map +1 -1
- package/dist/tools/file/glob.d.ts +2 -2
- package/dist/tools/file/glob.d.ts.map +1 -1
- package/dist/tools/file/glob.js.map +1 -1
- package/dist/tools/file/grep.d.ts +2 -2
- package/dist/tools/file/grep.d.ts.map +1 -1
- package/dist/tools/file/grep.js +1 -0
- package/dist/tools/file/grep.js.map +1 -1
- package/dist/tools/file/read-file.d.ts +2 -2
- package/dist/tools/file/read-file.d.ts.map +1 -1
- package/dist/tools/file/read-file.js +27 -0
- package/dist/tools/file/read-file.js.map +1 -1
- package/dist/tools/file/search-replace.d.ts +2 -2
- package/dist/tools/file/search-replace.d.ts.map +1 -1
- package/dist/tools/file/search-replace.js +1 -0
- package/dist/tools/file/search-replace.js.map +1 -1
- package/dist/tools/memory/memory-tools.d.ts +2 -2
- package/dist/tools/memory/memory-tools.d.ts.map +1 -1
- package/dist/tools/memory/memory-tools.js +4 -0
- package/dist/tools/memory/memory-tools.js.map +1 -1
- package/dist/tools/run-agent-workflow.d.ts +1 -1
- package/dist/tools/run-agent-workflow.d.ts.map +1 -1
- package/dist/tools/session-browser/session-browser-tools.d.ts +2 -2
- package/dist/tools/session-browser/session-browser-tools.d.ts.map +1 -1
- package/dist/tools/session-browser/session-browser-tools.js +106 -4
- package/dist/tools/session-browser/session-browser-tools.js.map +1 -1
- package/dist/tools/session-rollover/session-rollover-tool.d.ts +1 -1
- package/dist/tools/session-rollover/session-rollover-tool.d.ts.map +1 -1
- package/dist/tools/system/run-code/run-code-runtime.d.ts.map +1 -1
- package/dist/tools/system/run-code/run-code-runtime.js +11 -5
- package/dist/tools/system/run-code/run-code-runtime.js.map +1 -1
- package/dist/tools/system/run-code/run-code.d.ts +1 -1
- package/dist/tools/system/run-code/run-code.d.ts.map +1 -1
- package/dist/tools/system/run-code/run-code.js.map +1 -1
- package/dist/tools/system/run-code/tools-header.d.ts +2 -1
- package/dist/tools/system/run-code/tools-header.d.ts.map +1 -1
- package/dist/tools/system/run-code/tools-header.js +9 -3
- package/dist/tools/system/run-code/tools-header.js.map +1 -1
- package/dist/tools/system/shell.d.ts +6 -6
- package/dist/tools/system/shell.d.ts.map +1 -1
- package/dist/tools/system/shell.js +4 -0
- package/dist/tools/system/shell.js.map +1 -1
- package/dist/tools/system/worktree.d.ts +3 -9
- package/dist/tools/system/worktree.d.ts.map +1 -1
- package/dist/tools/system/worktree.js.map +1 -1
- package/dist/tools/tool-names.d.ts +11 -0
- package/dist/tools/tool-names.d.ts.map +1 -1
- package/dist/tools/types.d.ts +38 -3
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/tools/types.js.map +1 -1
- package/dist/tools/web/web-fetch.d.ts +2 -2
- package/dist/tools/web/web-fetch.d.ts.map +1 -1
- package/dist/tools/web/web-fetch.js +1 -0
- package/dist/tools/web/web-fetch.js.map +1 -1
- package/dist/tools/web/web-search.d.ts +2 -2
- package/dist/tools/web/web-search.d.ts.map +1 -1
- package/dist/tools/web/web-search.js +1 -0
- package/dist/tools/web/web-search.js.map +1 -1
- package/dist/utils/conversation/conversation-event-handler.d.ts.map +1 -1
- package/dist/utils/conversation/conversation-event-handler.js +3 -1
- package/dist/utils/conversation/conversation-event-handler.js.map +1 -1
- package/dist/utils/streaming/extract-command-messages.d.ts +2 -0
- package/dist/utils/streaming/extract-command-messages.d.ts.map +1 -1
- package/dist/utils/streaming/extract-command-messages.js +4 -0
- package/dist/utils/streaming/extract-command-messages.js.map +1 -1
- package/dist/utils/streaming/streaming-session-factory.d.ts.map +1 -1
- package/dist/utils/streaming/streaming-session-factory.js +3 -0
- package/dist/utils/streaming/streaming-session-factory.js.map +1 -1
- package/package.json +4 -6
- package/dist/prompts/durable-goal-context.test.ts +0 -67
- package/dist/prompts/explorer-delegation-contract.test.ts +0 -44
- package/dist/prompts/memory-recall-notice.test.ts +0 -50
- package/dist/prompts/orchestrator-prompt.test.ts +0 -111
- package/dist/prompts/prefix-quality.test.ts +0 -115
- package/dist/prompts/prompt-constructor.test.ts +0 -423
- package/dist/prompts/prompt-profiles.test.ts +0 -22
- package/dist/prompts/reasoning-efficiency.test.ts +0 -12
- package/dist/prompts/search-via-shell.test.ts +0 -69
- package/dist/prompts/steering-notice.test.ts +0 -36
- package/dist/prompts/subagent-delegation.test.ts +0 -112
- package/dist/prompts/subagents/worker-prompt.test.ts +0 -54
- package/dist/prompts/unified-gpt-prompt.test.ts +0 -53
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { expect, it } from 'vitest';
|
|
2
|
-
import { stripSteeringNotice, withSteeringNotice } from './steering-notice.js';
|
|
3
|
-
|
|
4
|
-
it('steering distinguishes side questions, added constraints, replacement, and queued tasks', () => {
|
|
5
|
-
const text = withSteeringNotice('How far along are you?');
|
|
6
|
-
expect(text).toContain('before your next tool call');
|
|
7
|
-
expect(text).toContain('continue the pending work in the same response');
|
|
8
|
-
expect(text).toContain('Incorporate corrections and new constraints');
|
|
9
|
-
expect(text).toContain('pauses, cancels, or replaces');
|
|
10
|
-
expect(text).toContain('unrelated task');
|
|
11
|
-
expect(text).toContain('How far along are you?');
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
it.each(['How far along are you?', 'Keep the API compatible.\nAlso update the docs.', 'Stop.'])(
|
|
15
|
-
'steering round-trips user text: %s',
|
|
16
|
-
(text) => expect(stripSteeringNotice(withSteeringNotice(text))).toBe(text),
|
|
17
|
-
);
|
|
18
|
-
|
|
19
|
-
it('still strips the original notice from saved conversation messages', () => {
|
|
20
|
-
const legacy = `[Steering message: the user sent this while you were working, so it arrives mid-turn rather than as a new turn.
|
|
21
|
-
- If it changes what you should be doing, change direction now and drop the superseded plan.
|
|
22
|
-
- If it does not bear on the work in progress, treat it as the next task rather than an interruption: acknowledge it, finish what you are doing, and handle it after.]`;
|
|
23
|
-
expect(stripSteeringNotice(`${legacy}\n\nKeep the API compatible.`)).toBe('Keep the API compatible.');
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
it('leaves ordinary user messages unchanged', () => {
|
|
27
|
-
expect(stripSteeringNotice('No steering notice here.')).toBe('No steering notice here.');
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
it('strips the previous status-aware notice from saved conversation messages', () => {
|
|
31
|
-
const previous = `[Steering message: the user sent this while you were working, so it arrives mid-turn rather than as a new turn.
|
|
32
|
-
- For status or side questions, answer briefly, then resume the active task.
|
|
33
|
-
- Incorporate corrections and new constraints while preserving the active objective, unless the user explicitly pauses, cancels, or replaces it. Drop only superseded work.
|
|
34
|
-
- For an unrelated task, acknowledge it, finish the active task, then handle it unless the user explicitly changes priority.]`;
|
|
35
|
-
expect(stripSteeringNotice(`${previous}\n\nWhat is done so far?`)).toBe('What is done so far?');
|
|
36
|
-
});
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { it, expect } from 'vitest';
|
|
2
|
-
import { getSubagentDelegationAddendum } from './subagent-delegation.js';
|
|
3
|
-
import { getAsyncSubagentDelegationAddendum } from './async-subagent-delegation.js';
|
|
4
|
-
|
|
5
|
-
it('getSubagentDelegationAddendum returns non-empty delegation guidance', () => {
|
|
6
|
-
const result = getSubagentDelegationAddendum();
|
|
7
|
-
|
|
8
|
-
expect(typeof result).toBe('string');
|
|
9
|
-
expect(result.length > 0).toBe(true);
|
|
10
|
-
expect(result.includes('Delegating to subagents')).toBe(true);
|
|
11
|
-
expect(result.includes('run_subagent')).toBe(true);
|
|
12
|
-
expect(result).toContain('agent.run({ spec, worktree? })');
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
it('getSubagentDelegationAddendum does not encourage orchestrators to keep working directly', () => {
|
|
16
|
-
const result = getSubagentDelegationAddendum({ orchestratorMode: true });
|
|
17
|
-
|
|
18
|
-
expect(result.includes('Orchestrator mode')).toBe(true);
|
|
19
|
-
expect(result).toContain('Delegate when it provides meaningful leverage');
|
|
20
|
-
expect(result).not.toContain('directly inspect, edit, run commands, and test small or clear work');
|
|
21
|
-
expect(result).not.toContain('Delegate workspace inspection');
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
it('async delegation guidance does not tell the parent to find other work before yielding', () => {
|
|
25
|
-
const result = getAsyncSubagentDelegationAddendum({ orchestratorMode: true });
|
|
26
|
-
|
|
27
|
-
expect(result).not.toContain('other useful work to do first');
|
|
28
|
-
expect(result.toLowerCase()).toContain('end the current turn and wait for the completion notification');
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
it('getSubagentDelegationAddendum includes self-service fallback when orchestratorMode is false', () => {
|
|
32
|
-
const result = getSubagentDelegationAddendum({ orchestratorMode: false });
|
|
33
|
-
|
|
34
|
-
expect(result.includes('just do it yourself')).toBe(true);
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it('keeps diagnosis and recommendations with the parent when delegating evidence collection', () => {
|
|
38
|
-
const result = getSubagentDelegationAddendum({ orchestratorMode: false });
|
|
39
|
-
|
|
40
|
-
expect(result).toContain('Explorer is an evidence collector, not a reasoning delegate');
|
|
41
|
-
expect(result).toContain(
|
|
42
|
-
"Do not pass the user's entire investigation, diagnosis, review, or planning task to explorer",
|
|
43
|
-
);
|
|
44
|
-
expect(result).toContain('You retain responsibility for hypotheses, causal analysis, judgments, and recommendations');
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it('orchestrator mode protects outcome ownership and safe coordination', () => {
|
|
48
|
-
const result = getSubagentDelegationAddendum({ orchestratorMode: true });
|
|
49
|
-
expect(result).toContain('Delegation transfers execution, never outcome ownership');
|
|
50
|
-
expect(result).toContain('Avoid concurrent overlapping edits');
|
|
51
|
-
expect(result).not.toContain('Coordination checklist');
|
|
52
|
-
expect(result).not.toContain('First delegate investigation');
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it('includes task framing guidance about autonomous workers', () => {
|
|
56
|
-
const result = getSubagentDelegationAddendum();
|
|
57
|
-
expect(result.includes('Task framing')).toBe(true);
|
|
58
|
-
expect(result.includes('autonomous agents')).toBe(true);
|
|
59
|
-
expect(result.includes('goal, relevant context, and constraints')).toBe(true);
|
|
60
|
-
expect(result.includes('not implementation steps')).toBe(true);
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
it('requires task-specific context without repeating automatically supplied context', () => {
|
|
64
|
-
const result = getSubagentDelegationAddendum();
|
|
65
|
-
|
|
66
|
-
expect(result).toContain(
|
|
67
|
-
'Do not repeat automatically supplied context: role instructions, generic tool guidance, worktree hygiene, environment metadata, root `AGENTS.md`, or skills catalog.',
|
|
68
|
-
);
|
|
69
|
-
expect(result).toContain(
|
|
70
|
-
'objective, task-specific scope, non-discoverable parent findings or decisions, constraints',
|
|
71
|
-
);
|
|
72
|
-
expect(result).toContain('deliverable or acceptance criteria, and validation when applicable');
|
|
73
|
-
expect(result).toContain('The subagent does not see your conversation or reasoning');
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
it('retains worker autonomy without mandatory pre-delegation ceremony', () => {
|
|
77
|
-
const result = getSubagentDelegationAddendum({ orchestratorMode: true });
|
|
78
|
-
expect(result.includes('one cohesive unit that can be understood, implemented, and verified')).toBe(true);
|
|
79
|
-
expect(result.includes('The orchestrator decides where execution units begin and end')).toBe(true);
|
|
80
|
-
expect(result).not.toContain('Before any `run_subagent` call, plan silently');
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
it('routes prior-session history digging to the librarian when session tools exist', () => {
|
|
84
|
-
const result = getSubagentDelegationAddendum({ memoryEnabled: true, sessionsEnabled: true });
|
|
85
|
-
expect(result).toContain('from prior sessions or several memories → `librarian`');
|
|
86
|
-
expect(result).toContain('- `librarian`:');
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
it('routes memory-only history to the librarian without promising transcripts', () => {
|
|
90
|
-
const result = getSubagentDelegationAddendum({ memoryEnabled: true, sessionsEnabled: false });
|
|
91
|
-
expect(result).toContain('several memories, or memory maintenance → `librarian`');
|
|
92
|
-
expect(result).not.toContain('prior-session transcripts');
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
it('does not advertise the librarian when persistent memory is disabled', () => {
|
|
96
|
-
const result = getSubagentDelegationAddendum({ memoryEnabled: false });
|
|
97
|
-
expect(result.includes('librarian')).toBe(false);
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
it('async control guidance distinguishes steering, cancellation, answers, and fresh-turn limits honestly', () => {
|
|
101
|
-
const result = getAsyncSubagentDelegationAddendum({ orchestratorMode: true, controlsEnabled: true });
|
|
102
|
-
|
|
103
|
-
expect(result).toContain('`tools.send_message(...)`');
|
|
104
|
-
expect(result).toContain('`tools.cancel_run(...)`');
|
|
105
|
-
expect(result).toContain('name or runId');
|
|
106
|
-
expect(result).toContain('`reply_to`');
|
|
107
|
-
expect(result).toContain('fresh session turn');
|
|
108
|
-
expect(result).toContain('maximum of three continuation segments');
|
|
109
|
-
expect(result).toContain('not SDK live injection');
|
|
110
|
-
expect(result).toContain('single point of contact');
|
|
111
|
-
expect(result).toContain('do NOT call `tools.get_subagent_result(...)` immediately');
|
|
112
|
-
});
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import { it, expect } from 'vitest';
|
|
4
|
-
|
|
5
|
-
const workerPrompt = fs.readFileSync(path.join(import.meta.dirname, 'worker.md'), 'utf-8');
|
|
6
|
-
const explorerPrompt = fs.readFileSync(path.join(import.meta.dirname, 'explorer.md'), 'utf-8');
|
|
7
|
-
|
|
8
|
-
it('worker prompt scales validation to behavioral impact while retaining required checks', () => {
|
|
9
|
-
const lower = workerPrompt.toLowerCase();
|
|
10
|
-
expect(lower).toContain('validation command');
|
|
11
|
-
expect(lower).toContain('project-required checks');
|
|
12
|
-
expect(lower).toContain('for inert changes such as docs or comments');
|
|
13
|
-
expect(lower).toContain('diff review is sufficient');
|
|
14
|
-
expect(lower).toContain('why no command was needed');
|
|
15
|
-
expect(lower).not.toContain('you still need to run a validation command');
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('worker prompt notes that validation and diff stat are auto-captured', () => {
|
|
19
|
-
const lower = workerPrompt.toLowerCase();
|
|
20
|
-
expect(lower).toContain('automatically captures');
|
|
21
|
-
expect(lower).toContain('diff stat');
|
|
22
|
-
expect(lower).toContain('do not need to paste the full output');
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it('worker report distinguishes recorded checks before and after the edit', () => {
|
|
26
|
-
expect(workerPrompt).toContain('Before-edit validation:');
|
|
27
|
-
expect(workerPrompt).toContain('After-edit validation:');
|
|
28
|
-
expect(workerPrompt).toContain('tool-result history');
|
|
29
|
-
expect(workerPrompt).toContain('even if they were not required');
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
it('worker prompt mentions that shell-driven edits may not appear in diff stat', () => {
|
|
33
|
-
const lower = workerPrompt.toLowerCase();
|
|
34
|
-
expect(lower).toContain('shell-driven edits');
|
|
35
|
-
expect(lower).toContain('may not appear');
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it('execution role prompts reserve ask_orchestrator for genuine blockers and never direct user contact', () => {
|
|
39
|
-
for (const prompt of [workerPrompt, explorerPrompt]) {
|
|
40
|
-
const lower = prompt.toLowerCase();
|
|
41
|
-
expect(lower).toContain('ask_orchestrator');
|
|
42
|
-
expect(lower).toContain('genuine blocker');
|
|
43
|
-
expect(lower).toContain('decision needed');
|
|
44
|
-
expect(lower).toContain('continue after');
|
|
45
|
-
expect(lower).toContain('do not contact the user');
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
it('explorer prompt names web tools directly instead of routing through unregistered run_code', () => {
|
|
50
|
-
expect(explorerPrompt).toContain('Use `web_search` to find relevant external documentation');
|
|
51
|
-
expect(explorerPrompt).toContain('Use `web_fetch` to retrieve the content of specific URLs');
|
|
52
|
-
expect(explorerPrompt).not.toContain('Inside `run_code`, use `tools.web_search`');
|
|
53
|
-
expect(explorerPrompt).not.toContain('Inside `run_code`, use `tools.web_fetch`');
|
|
54
|
-
});
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { readFileSync } from 'node:fs';
|
|
2
|
-
import { join } from 'node:path';
|
|
3
|
-
import { describe, expect, it } from 'vitest';
|
|
4
|
-
import { buildPromptSpec } from './prompt-constructor.js';
|
|
5
|
-
import { resolveProfile } from '../services/profiles/index.js';
|
|
6
|
-
|
|
7
|
-
const standard = resolveProfile('builtin:standard');
|
|
8
|
-
|
|
9
|
-
describe('unified main-agent GPT prompt', () => {
|
|
10
|
-
it.each([
|
|
11
|
-
'gpt-5.2',
|
|
12
|
-
'gpt-5.3-codex',
|
|
13
|
-
'gpt-5.4',
|
|
14
|
-
'gpt-5.4-mini',
|
|
15
|
-
'gpt-5.5',
|
|
16
|
-
'gpt-5.6-luna',
|
|
17
|
-
'gpt-6-astra',
|
|
18
|
-
'gpt-6-sol',
|
|
19
|
-
'gpt-6-luna',
|
|
20
|
-
'gpt-6-luna-codex',
|
|
21
|
-
])('selects one base without GPT-only fragments for %s', (model) => {
|
|
22
|
-
const spec = buildPromptSpec({ model, profile: standard });
|
|
23
|
-
expect(spec.basePromptFile).toBe('gpt.md');
|
|
24
|
-
expect(spec.fragmentFiles).not.toContain('fragments/gpt-6.md');
|
|
25
|
-
expect(spec.fragmentFiles).not.toContain('fragments/skill-instruction-conflicts.md');
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it.each(['gpt-4o', 'glm-5.3-flash', 'deepseek-flash', 'unknown-model'])(
|
|
29
|
-
'keeps the simpler generic base for %s',
|
|
30
|
-
(model) => {
|
|
31
|
-
const spec = buildPromptSpec({ model, profile: standard });
|
|
32
|
-
expect(spec.basePromptFile).toBe('simple_v4.md');
|
|
33
|
-
expect(spec.fragmentFiles).toContain('approval-model.md');
|
|
34
|
-
},
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
it('keeps the action, approval, verification, and skill-conflict rules in the base', () => {
|
|
38
|
-
const text = readFileSync(join(import.meta.dirname, 'gpt.md'), 'utf8');
|
|
39
|
-
expect(text).toContain('Default to action');
|
|
40
|
-
expect(text).toContain('approval layer');
|
|
41
|
-
expect(text).toContain('Run the checks appropriate to the change');
|
|
42
|
-
expect(text).toContain('Explicit user instructions override conflicting skill instructions');
|
|
43
|
-
expect(buildPromptSpec({ model: 'gpt-6-luna', profile: standard }).fragmentFiles).toContain('approval-model.md');
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
it('leaves non-GPT and lite profile routing unchanged', () => {
|
|
47
|
-
expect(buildPromptSpec({ model: 'claude-sonnet-4', profile: standard }).basePromptFile).toBe('anthropic.md');
|
|
48
|
-
expect(buildPromptSpec({ model: 'kimi-k2', profile: standard }).basePromptFile).toBe('kimi.md');
|
|
49
|
-
const lite = buildPromptSpec({ model: 'gpt-6-luna', profile: resolveProfile('builtin:lite') });
|
|
50
|
-
expect(lite.basePromptContent).toBeDefined();
|
|
51
|
-
expect(lite.fragmentFiles).toEqual([]);
|
|
52
|
-
});
|
|
53
|
-
});
|