oh-my-opencode 3.17.4 → 3.17.6
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.ja.md +3 -3
- package/README.ko.md +3 -3
- package/README.md +3 -3
- package/README.ru.md +3 -3
- package/README.zh-cn.md +3 -3
- package/dist/__tests__/perf/fixtures/in-tree/packages/pkg-one/src/file-16.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/packages/pkg-one/src/file-17.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/packages/pkg-one/src/file-18.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/packages/pkg-one/src/file-19.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/packages/pkg-one/src/file-20.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/src/app/file-01.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/src/app/file-02.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/src/app/file-03.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/src/app/file-04.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/src/app/file-05.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/src/app/file-06.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/src/app/file-07.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/src/app/file-08.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/src/app/file-09.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/src/app/file-10.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/src/lib/file-11.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/src/lib/file-12.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/src/lib/file-13.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/src/lib/file-14.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/src/lib/file-15.d.ts +1 -0
- package/dist/agents/agent-builder.d.ts +2 -3
- package/dist/agents/agent-skill-resolution.d.ts +7 -0
- package/dist/agents/atlas/default-prompt-sections.d.ts +2 -2
- package/dist/agents/atlas/gemini-prompt-sections.d.ts +1 -1
- package/dist/agents/atlas/gpt-prompt-sections.d.ts +1 -1
- package/dist/agents/frontier-tool-schema-guard.d.ts +3 -0
- package/dist/agents/hephaestus/agent.d.ts +1 -1
- package/dist/agents/hephaestus/gpt-5-5.d.ts +12 -0
- package/dist/agents/sisyphus/claude-opus-4-7.d.ts +20 -0
- package/dist/agents/sisyphus/gpt-5-5.d.ts +20 -0
- package/dist/agents/sisyphus/index.d.ts +5 -0
- package/dist/agents/sisyphus/kimi-k2-6.d.ts +32 -0
- package/dist/agents/sisyphus-junior/agent.d.ts +1 -1
- package/dist/agents/sisyphus-junior/gpt-5-5.d.ts +14 -0
- package/dist/agents/sisyphus-junior/index.d.ts +2 -0
- package/dist/agents/sisyphus-junior/kimi-k2-6.d.ts +13 -0
- package/dist/agents/types.d.ts +17 -1
- package/dist/cli/doctor/checks/model-resolution.d.ts +4 -0
- package/dist/cli/index.js +17471 -15372
- package/dist/config/schema/background-task.d.ts +0 -1
- package/dist/config/schema/oh-my-opencode-config.d.ts +0 -1
- package/dist/create-hooks.d.ts +2 -0
- package/dist/create-managers.d.ts +2 -0
- package/dist/create-tools.d.ts +1 -1
- package/dist/features/background-agent/process-cleanup.test-helpers.d.ts +4 -0
- package/dist/features/background-agent/subagent-spawn-limits.d.ts +0 -7
- package/dist/features/claude-code-command-loader/loader-cache.d.ts +6 -0
- package/dist/features/claude-code-command-loader/loader.d.ts +2 -0
- package/dist/features/team-mode/index.d.ts +2 -0
- package/dist/features/team-mode/team-layout-tmux/index.d.ts +1 -0
- package/dist/features/team-mode/team-layout-tmux/layout.d.ts +15 -0
- package/dist/features/team-mode/team-worktree/cleanup.d.ts +3 -0
- package/dist/features/team-mode/team-worktree/index.d.ts +2 -0
- package/dist/features/team-mode/team-worktree/manager.d.ts +15 -0
- package/dist/features/team-mode/types.d.ts +210 -0
- package/dist/features/tmux-subagent/event-handlers.d.ts +0 -4
- package/dist/features/tmux-subagent/index.d.ts +0 -3
- package/dist/features/tmux-subagent/manager.d.ts +4 -0
- package/dist/features/tmux-subagent/polling-manager.d.ts +2 -1
- package/dist/hooks/auto-update-checker/hook/deferred-startup-check.d.ts +1 -0
- package/dist/hooks/comment-checker/initialization-gate.d.ts +1 -0
- package/dist/hooks/directory-agents-injector/finder.d.ts +1 -1
- package/dist/hooks/directory-readme-injector/finder.d.ts +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/keyword-detector/ultrawork/default.d.ts +1 -1
- package/dist/hooks/keyword-detector/ultrawork/gemini.d.ts +1 -1
- package/dist/hooks/model-fallback/controller-accessor.d.ts +8 -0
- package/dist/hooks/model-fallback/fallback-state-controller.d.ts +26 -0
- package/dist/hooks/model-fallback/hook.d.ts +21 -16
- package/dist/hooks/model-fallback/index.d.ts +2 -0
- package/dist/hooks/preemptive-compaction-trigger.d.ts +13 -0
- package/dist/hooks/preemptive-compaction-types.d.ts +53 -0
- package/dist/hooks/preemptive-compaction.d.ts +3 -15
- package/dist/hooks/ralph-loop/ralph-loop-event-handler.d.ts +1 -6
- package/dist/hooks/ralph-loop/session-event-handler.d.ts +2 -6
- package/dist/hooks/ralph-loop/types.d.ts +5 -0
- package/dist/hooks/rules-injector/cache.d.ts +5 -0
- package/dist/hooks/rules-injector/injector.d.ts +2 -0
- package/dist/hooks/rules-injector/project-root-finder.d.ts +1 -0
- package/dist/hooks/rules-injector/rule-file-finder.d.ts +2 -19
- package/dist/hooks/rules-injector/rule-scan-cache.d.ts +6 -0
- package/dist/hooks/session-notification-event-properties.d.ts +5 -0
- package/dist/hooks/session-notification-init.d.ts +7 -0
- package/dist/hooks/todo-continuation-enforcer/session-state.d.ts +1 -0
- package/dist/hooks/write-existing-file-guard/tool-execute-before-handler.d.ts +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +52209 -73179
- package/dist/oh-my-opencode.schema.json +0 -5
- package/dist/plugin/hooks/create-core-hooks.d.ts +4 -0
- package/dist/plugin/hooks/create-session-hooks.d.ts +4 -0
- package/dist/plugin/tool-registry.d.ts +1 -1
- package/dist/shared/agent-display-names.d.ts +7 -2
- package/dist/shared/agent-sort-shim.d.ts +28 -0
- package/dist/shared/excluded-dirs.d.ts +1 -0
- package/dist/shared/file-reference-resolver.d.ts +1 -0
- package/dist/shared/index.d.ts +2 -0
- package/dist/shared/jsonc-parser.d.ts +8 -5
- package/dist/shared/load-opencode-plugins.d.ts +1 -0
- package/dist/shared/migration/migrations-sidecar.d.ts +1 -1
- package/dist/shared/model-capabilities/supplemental-entries.d.ts +2 -0
- package/dist/shared/permission-compat.d.ts +1 -1
- package/dist/shared/posthog-activity-state.d.ts +5 -2
- package/dist/shared/posthog.d.ts +5 -0
- package/dist/shared/project-discovery-dirs.d.ts +2 -0
- package/dist/shared/ripgrep-cli.d.ts +8 -0
- package/dist/shared/tmux/tmux-utils/index.d.ts +1 -0
- package/dist/shared/tmux/tmux-utils/session-kill.d.ts +1 -0
- package/dist/shared/tmux/tmux-utils/session-spawn.d.ts +1 -0
- package/dist/shared/tmux/tmux-utils/spawn-process.d.ts +1 -0
- package/dist/shared/tmux/tmux-utils/stale-session-sweep.d.ts +11 -0
- package/dist/shared/tmux/tmux-utils.d.ts +3 -1
- package/dist/tools/ast-grep/pattern-hints.d.ts +4 -0
- package/dist/tools/ast-grep/tool-descriptions.d.ts +3 -0
- package/dist/tools/call-omo-agent/sync-executor.d.ts +2 -3
- package/dist/tools/call-omo-agent/tools.d.ts +2 -1
- package/dist/tools/delegate-task/background-continuation.d.ts +1 -1
- package/dist/tools/delegate-task/executor-types.d.ts +2 -0
- package/dist/tools/delegate-task/resolve-metadata-model.d.ts +9 -0
- package/dist/tools/delegate-task/sync-continuation.d.ts +2 -2
- package/dist/tools/delegate-task/task-id.d.ts +2 -0
- package/dist/tools/delegate-task/tool-argument-preparation.d.ts +2 -0
- package/dist/tools/delegate-task/tool-description.d.ts +9 -0
- package/dist/tools/delegate-task/types.d.ts +4 -5
- package/dist/tools/glob/constants.d.ts +1 -1
- package/dist/tools/grep/cli.d.ts +1 -1
- package/dist/tools/grep/constants.d.ts +0 -8
- package/dist/tools/look-at/look-at-input-preparer.d.ts +22 -0
- package/dist/tools/look-at/look-at-prompt.d.ts +2 -0
- package/dist/tools/look-at/look-at-session-runner.d.ts +12 -0
- package/dist/tools/skill/description-formatter.d.ts +1 -1
- package/dist/tools/skill/session-skill-cache.d.ts +1 -0
- package/dist/tools/skill-mcp/parse-skill-mcp-arguments.d.ts +1 -0
- package/dist/tools/slashcommand/command-discovery-deps.d.ts +6 -0
- package/package.json +22 -18
- package/dist/features/tmux-subagent/cleanup.d.ts +0 -9
- package/dist/features/tmux-subagent/session-created-handler.d.ts +0 -22
- package/dist/features/tmux-subagent/session-deleted-handler.d.ts +0 -15
- package/dist/hooks/ralph-loop/loop-session-recovery.d.ts +0 -7
- package/dist/plugin-dispose.d.ts +0 -13
- /package/dist/{tools/delegate-task → shared}/model-string-parser.d.ts +0 -0
|
@@ -4,7 +4,6 @@ export declare const BackgroundTaskConfigSchema: z.ZodObject<{
|
|
|
4
4
|
providerConcurrency: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
5
5
|
modelConcurrency: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
6
6
|
maxDepth: z.ZodOptional<z.ZodNumber>;
|
|
7
|
-
maxDescendants: z.ZodOptional<z.ZodNumber>;
|
|
8
7
|
staleTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
9
8
|
messageStalenessTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
10
9
|
taskTtlMs: z.ZodOptional<z.ZodNumber>;
|
|
@@ -2004,7 +2004,6 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
2004
2004
|
providerConcurrency: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
2005
2005
|
modelConcurrency: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
2006
2006
|
maxDepth: z.ZodOptional<z.ZodNumber>;
|
|
2007
|
-
maxDescendants: z.ZodOptional<z.ZodNumber>;
|
|
2008
2007
|
staleTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
2009
2008
|
messageStalenessTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
2010
2009
|
taskTtlMs: z.ZodOptional<z.ZodNumber>;
|
package/dist/create-hooks.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { AvailableSkill } from "./agents/dynamic-agent-prompt-builder";
|
|
|
2
2
|
import type { HookName, OhMyOpenCodeConfig } from "./config";
|
|
3
3
|
import type { LoadedSkill } from "./features/opencode-skill-loader/types";
|
|
4
4
|
import type { BackgroundManager } from "./features/background-agent";
|
|
5
|
+
import type { ModelFallbackControllerAccessor } from "./hooks/model-fallback";
|
|
5
6
|
import type { PluginContext } from "./plugin/types";
|
|
6
7
|
import type { ModelCacheState } from "./plugin-state";
|
|
7
8
|
export type CreatedHooks = ReturnType<typeof createHooks>;
|
|
@@ -22,6 +23,7 @@ export declare function createHooks(args: {
|
|
|
22
23
|
pluginConfig: OhMyOpenCodeConfig;
|
|
23
24
|
modelCacheState: ModelCacheState;
|
|
24
25
|
backgroundManager: BackgroundManager;
|
|
26
|
+
modelFallbackControllerAccessor?: ModelFallbackControllerAccessor;
|
|
25
27
|
isHookEnabled: (hookName: HookName) => boolean;
|
|
26
28
|
safeHookEnabled: boolean;
|
|
27
29
|
mergedSkills: LoadedSkill[];
|
|
@@ -8,6 +8,7 @@ import { TmuxSessionManager } from "./features/tmux-subagent";
|
|
|
8
8
|
import { registerManagerForCleanup } from "./features/background-agent/process-cleanup";
|
|
9
9
|
import { createConfigHandler } from "./plugin-handlers";
|
|
10
10
|
import { markServerRunningInProcess } from "./shared/tmux/tmux-utils/server-health";
|
|
11
|
+
import type { ModelFallbackControllerAccessor } from "./hooks/model-fallback";
|
|
11
12
|
type CreateManagersDeps = {
|
|
12
13
|
BackgroundManagerClass: typeof BackgroundManager;
|
|
13
14
|
SkillMcpManagerClass: typeof SkillMcpManager;
|
|
@@ -22,6 +23,7 @@ export type Managers = {
|
|
|
22
23
|
backgroundManager: BackgroundManager;
|
|
23
24
|
skillMcpManager: SkillMcpManager;
|
|
24
25
|
configHandler: ReturnType<typeof createConfigHandler>;
|
|
26
|
+
modelFallbackControllerAccessor: ModelFallbackControllerAccessor;
|
|
25
27
|
};
|
|
26
28
|
export declare function createManagers(args: {
|
|
27
29
|
ctx: PluginContext;
|
package/dist/create-tools.d.ts
CHANGED
|
@@ -16,6 +16,6 @@ type CreateToolsResult = {
|
|
|
16
16
|
export declare function createTools(args: {
|
|
17
17
|
ctx: PluginContext;
|
|
18
18
|
pluginConfig: OhMyOpenCodeConfig;
|
|
19
|
-
managers: Pick<Managers, "backgroundManager" | "tmuxSessionManager" | "skillMcpManager">;
|
|
19
|
+
managers: Pick<Managers, "backgroundManager" | "tmuxSessionManager" | "skillMcpManager" | "modelFallbackControllerAccessor">;
|
|
20
20
|
}): Promise<CreateToolsResult>;
|
|
21
21
|
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
type ProcessCleanupEvent = NodeJS.Signals | "beforeExit" | "exit" | "uncaughtException" | "unhandledRejection";
|
|
2
|
+
export declare function getNewListener(signal: ProcessCleanupEvent, existingListeners: Function[]): () => void;
|
|
3
|
+
export declare function flushMicrotasks(): Promise<void>;
|
|
4
|
+
export {};
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import type { BackgroundTaskConfig } from "../../config/schema";
|
|
2
2
|
import type { OpencodeClient } from "./constants";
|
|
3
3
|
export declare const DEFAULT_MAX_SUBAGENT_DEPTH = 3;
|
|
4
|
-
export declare const DEFAULT_MAX_ROOT_SESSION_SPAWN_BUDGET = 50;
|
|
5
4
|
export interface SubagentSpawnContext {
|
|
6
5
|
rootSessionID: string;
|
|
7
6
|
parentDepth: number;
|
|
8
7
|
childDepth: number;
|
|
9
8
|
}
|
|
10
9
|
export declare function getMaxSubagentDepth(config?: BackgroundTaskConfig): number;
|
|
11
|
-
export declare function getMaxRootSessionSpawnBudget(config?: BackgroundTaskConfig): number;
|
|
12
10
|
export declare function resolveSubagentSpawnContext(client: OpencodeClient, parentSessionID: string, directory?: string): Promise<SubagentSpawnContext>;
|
|
13
11
|
export declare function createSubagentDepthLimitError(input: {
|
|
14
12
|
childDepth: number;
|
|
@@ -16,8 +14,3 @@ export declare function createSubagentDepthLimitError(input: {
|
|
|
16
14
|
parentSessionID: string;
|
|
17
15
|
rootSessionID: string;
|
|
18
16
|
}): Error;
|
|
19
|
-
export declare function createSubagentDescendantLimitError(input: {
|
|
20
|
-
rootSessionID: string;
|
|
21
|
-
descendantCount: number;
|
|
22
|
-
maxDescendants: number;
|
|
23
|
-
}): Error;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CommandDefinition } from "./types";
|
|
2
|
+
export declare function getCommandLoaderCacheKey(directory?: string): Promise<string>;
|
|
3
|
+
export declare function getCachedCommands(cacheKey: string): Promise<Record<string, CommandDefinition>> | undefined;
|
|
4
|
+
export declare function setCachedCommands(cacheKey: string, commands: Promise<Record<string, CommandDefinition>>): void;
|
|
5
|
+
export declare function deleteCachedCommands(cacheKey: string): void;
|
|
6
|
+
export declare function clearCommandLoaderCache(): void;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { clearCommandLoaderCache } from "./loader-cache";
|
|
1
2
|
import type { CommandDefinition } from "./types";
|
|
3
|
+
export { clearCommandLoaderCache };
|
|
2
4
|
export declare function loadUserCommands(): Promise<Record<string, CommandDefinition>>;
|
|
3
5
|
export declare function loadProjectCommands(directory?: string): Promise<Record<string, CommandDefinition>>;
|
|
4
6
|
export declare function loadOpencodeGlobalCommands(): Promise<Record<string, CommandDefinition>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { canVisualize, createTeamLayout, removeTeamLayout } from "./layout";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TmuxSessionManager } from "../../tmux-subagent/manager";
|
|
2
|
+
type TeamLayoutMember = {
|
|
3
|
+
name: string;
|
|
4
|
+
sessionId: string;
|
|
5
|
+
color?: string;
|
|
6
|
+
};
|
|
7
|
+
type TeamLayoutResult = {
|
|
8
|
+
focusWindowId: string;
|
|
9
|
+
gridWindowId: string;
|
|
10
|
+
panesByMember: Record<string, string>;
|
|
11
|
+
};
|
|
12
|
+
export declare function canVisualize(): boolean;
|
|
13
|
+
export declare function createTeamLayout(teamRunId: string, members: Array<TeamLayoutMember>, tmuxMgr: TmuxSessionManager): Promise<TeamLayoutResult | null>;
|
|
14
|
+
export declare function removeTeamLayout(teamRunId: string, tmuxMgr: TmuxSessionManager): Promise<void>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type TeamModeConfig = {
|
|
2
|
+
worktreeBaseDir?: string;
|
|
3
|
+
};
|
|
4
|
+
export declare class GitUnavailableError extends Error {
|
|
5
|
+
constructor();
|
|
6
|
+
}
|
|
7
|
+
declare function runGit(args: string[], cwd?: string): Promise<{
|
|
8
|
+
code: number;
|
|
9
|
+
stderr: string;
|
|
10
|
+
}>;
|
|
11
|
+
export declare function setGitCommandRunnerForTests(runner: typeof runGit): void;
|
|
12
|
+
export declare function isGitAvailable(): Promise<boolean>;
|
|
13
|
+
export declare function validateWorktreeSpec(spec: string): void;
|
|
14
|
+
export declare function createWorktree(repoRoot: string, _teamRunId: string, _memberName: string, worktreePath: string, _config: TeamModeConfig): Promise<string>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const MESSAGE_KINDS: readonly ["message", "shutdown_request", "shutdown_approved", "shutdown_rejected", "announcement"];
|
|
3
|
+
export declare const MEMBER_KINDS: readonly ["category", "subagent_type"];
|
|
4
|
+
export declare const TASK_STATUSES: readonly ["pending", "claimed", "in_progress", "completed", "deleted"];
|
|
5
|
+
export declare const RUNTIME_STATUSES: readonly ["creating", "active", "shutdown_requested", "deleting", "deleted", "failed", "orphaned"];
|
|
6
|
+
export declare const CategoryMemberSchema: z.ZodObject<{
|
|
7
|
+
name: z.ZodString;
|
|
8
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
9
|
+
worktreePath: z.ZodOptional<z.ZodString>;
|
|
10
|
+
subscriptions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
11
|
+
backendType: z.ZodDefault<z.ZodEnum<{
|
|
12
|
+
tmux: "tmux";
|
|
13
|
+
"in-process": "in-process";
|
|
14
|
+
}>>;
|
|
15
|
+
color: z.ZodOptional<z.ZodString>;
|
|
16
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
17
|
+
kind: z.ZodLiteral<"category">;
|
|
18
|
+
category: z.ZodString;
|
|
19
|
+
prompt: z.ZodString;
|
|
20
|
+
}, z.core.$strict>;
|
|
21
|
+
export declare const SubagentMemberSchema: z.ZodObject<{
|
|
22
|
+
name: z.ZodString;
|
|
23
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
24
|
+
worktreePath: z.ZodOptional<z.ZodString>;
|
|
25
|
+
subscriptions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
26
|
+
backendType: z.ZodDefault<z.ZodEnum<{
|
|
27
|
+
tmux: "tmux";
|
|
28
|
+
"in-process": "in-process";
|
|
29
|
+
}>>;
|
|
30
|
+
color: z.ZodOptional<z.ZodString>;
|
|
31
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
32
|
+
kind: z.ZodLiteral<"subagent_type">;
|
|
33
|
+
subagent_type: z.ZodString;
|
|
34
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
35
|
+
}, z.core.$strict>;
|
|
36
|
+
export declare const MemberSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
37
|
+
name: z.ZodString;
|
|
38
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
39
|
+
worktreePath: z.ZodOptional<z.ZodString>;
|
|
40
|
+
subscriptions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
41
|
+
backendType: z.ZodDefault<z.ZodEnum<{
|
|
42
|
+
tmux: "tmux";
|
|
43
|
+
"in-process": "in-process";
|
|
44
|
+
}>>;
|
|
45
|
+
color: z.ZodOptional<z.ZodString>;
|
|
46
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
47
|
+
kind: z.ZodLiteral<"category">;
|
|
48
|
+
category: z.ZodString;
|
|
49
|
+
prompt: z.ZodString;
|
|
50
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
51
|
+
name: z.ZodString;
|
|
52
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
53
|
+
worktreePath: z.ZodOptional<z.ZodString>;
|
|
54
|
+
subscriptions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
55
|
+
backendType: z.ZodDefault<z.ZodEnum<{
|
|
56
|
+
tmux: "tmux";
|
|
57
|
+
"in-process": "in-process";
|
|
58
|
+
}>>;
|
|
59
|
+
color: z.ZodOptional<z.ZodString>;
|
|
60
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
61
|
+
kind: z.ZodLiteral<"subagent_type">;
|
|
62
|
+
subagent_type: z.ZodString;
|
|
63
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
64
|
+
}, z.core.$strict>], "kind">;
|
|
65
|
+
export declare const TeamSpecSchema: z.ZodObject<{
|
|
66
|
+
version: z.ZodLiteral<1>;
|
|
67
|
+
name: z.ZodString;
|
|
68
|
+
description: z.ZodOptional<z.ZodString>;
|
|
69
|
+
createdAt: z.ZodNumber;
|
|
70
|
+
leadAgentId: z.ZodString;
|
|
71
|
+
teamAllowedPaths: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
72
|
+
sessionPermission: z.ZodOptional<z.ZodString>;
|
|
73
|
+
members: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
74
|
+
name: z.ZodString;
|
|
75
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
76
|
+
worktreePath: z.ZodOptional<z.ZodString>;
|
|
77
|
+
subscriptions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
78
|
+
backendType: z.ZodDefault<z.ZodEnum<{
|
|
79
|
+
tmux: "tmux";
|
|
80
|
+
"in-process": "in-process";
|
|
81
|
+
}>>;
|
|
82
|
+
color: z.ZodOptional<z.ZodString>;
|
|
83
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
84
|
+
kind: z.ZodLiteral<"category">;
|
|
85
|
+
category: z.ZodString;
|
|
86
|
+
prompt: z.ZodString;
|
|
87
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
88
|
+
name: z.ZodString;
|
|
89
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
90
|
+
worktreePath: z.ZodOptional<z.ZodString>;
|
|
91
|
+
subscriptions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
92
|
+
backendType: z.ZodDefault<z.ZodEnum<{
|
|
93
|
+
tmux: "tmux";
|
|
94
|
+
"in-process": "in-process";
|
|
95
|
+
}>>;
|
|
96
|
+
color: z.ZodOptional<z.ZodString>;
|
|
97
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
98
|
+
kind: z.ZodLiteral<"subagent_type">;
|
|
99
|
+
subagent_type: z.ZodString;
|
|
100
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
101
|
+
}, z.core.$strict>], "kind">>;
|
|
102
|
+
}, z.core.$strip>;
|
|
103
|
+
export declare const MessageSchema: z.ZodObject<{
|
|
104
|
+
version: z.ZodLiteral<1>;
|
|
105
|
+
messageId: z.ZodString;
|
|
106
|
+
from: z.ZodString;
|
|
107
|
+
to: z.ZodString;
|
|
108
|
+
kind: z.ZodEnum<{
|
|
109
|
+
message: "message";
|
|
110
|
+
shutdown_request: "shutdown_request";
|
|
111
|
+
shutdown_approved: "shutdown_approved";
|
|
112
|
+
shutdown_rejected: "shutdown_rejected";
|
|
113
|
+
announcement: "announcement";
|
|
114
|
+
}>;
|
|
115
|
+
body: z.ZodString;
|
|
116
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
117
|
+
references: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
118
|
+
path: z.ZodString;
|
|
119
|
+
description: z.ZodOptional<z.ZodString>;
|
|
120
|
+
}, z.core.$strict>>>;
|
|
121
|
+
timestamp: z.ZodNumber;
|
|
122
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
123
|
+
color: z.ZodOptional<z.ZodString>;
|
|
124
|
+
}, z.core.$strip>;
|
|
125
|
+
export declare const TaskSchema: z.ZodObject<{
|
|
126
|
+
version: z.ZodLiteral<1>;
|
|
127
|
+
id: z.ZodString;
|
|
128
|
+
subject: z.ZodString;
|
|
129
|
+
description: z.ZodString;
|
|
130
|
+
activeForm: z.ZodOptional<z.ZodString>;
|
|
131
|
+
status: z.ZodEnum<{
|
|
132
|
+
pending: "pending";
|
|
133
|
+
in_progress: "in_progress";
|
|
134
|
+
completed: "completed";
|
|
135
|
+
deleted: "deleted";
|
|
136
|
+
claimed: "claimed";
|
|
137
|
+
}>;
|
|
138
|
+
owner: z.ZodOptional<z.ZodString>;
|
|
139
|
+
blocks: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
140
|
+
blockedBy: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
141
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
142
|
+
createdAt: z.ZodNumber;
|
|
143
|
+
updatedAt: z.ZodNumber;
|
|
144
|
+
claimedAt: z.ZodOptional<z.ZodNumber>;
|
|
145
|
+
}, z.core.$strip>;
|
|
146
|
+
export declare const RuntimeStateSchema: z.ZodObject<{
|
|
147
|
+
version: z.ZodLiteral<1>;
|
|
148
|
+
teamRunId: z.ZodString;
|
|
149
|
+
teamName: z.ZodString;
|
|
150
|
+
specSource: z.ZodEnum<{
|
|
151
|
+
user: "user";
|
|
152
|
+
project: "project";
|
|
153
|
+
}>;
|
|
154
|
+
createdAt: z.ZodNumber;
|
|
155
|
+
status: z.ZodEnum<{
|
|
156
|
+
deleted: "deleted";
|
|
157
|
+
failed: "failed";
|
|
158
|
+
active: "active";
|
|
159
|
+
creating: "creating";
|
|
160
|
+
shutdown_requested: "shutdown_requested";
|
|
161
|
+
deleting: "deleting";
|
|
162
|
+
orphaned: "orphaned";
|
|
163
|
+
}>;
|
|
164
|
+
leadSessionId: z.ZodOptional<z.ZodString>;
|
|
165
|
+
members: z.ZodArray<z.ZodObject<{
|
|
166
|
+
name: z.ZodString;
|
|
167
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
168
|
+
tmuxPaneId: z.ZodOptional<z.ZodString>;
|
|
169
|
+
agentType: z.ZodEnum<{
|
|
170
|
+
leader: "leader";
|
|
171
|
+
"general-purpose": "general-purpose";
|
|
172
|
+
}>;
|
|
173
|
+
status: z.ZodEnum<{
|
|
174
|
+
pending: "pending";
|
|
175
|
+
completed: "completed";
|
|
176
|
+
running: "running";
|
|
177
|
+
idle: "idle";
|
|
178
|
+
errored: "errored";
|
|
179
|
+
shutdown_approved: "shutdown_approved";
|
|
180
|
+
}>;
|
|
181
|
+
color: z.ZodOptional<z.ZodString>;
|
|
182
|
+
worktreePath: z.ZodOptional<z.ZodString>;
|
|
183
|
+
lastInjectedTurnMarker: z.ZodOptional<z.ZodString>;
|
|
184
|
+
pendingInjectedMessageIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
185
|
+
}, z.core.$strict>>;
|
|
186
|
+
shutdownRequests: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
187
|
+
memberId: z.ZodString;
|
|
188
|
+
requestedAt: z.ZodNumber;
|
|
189
|
+
approvedAt: z.ZodOptional<z.ZodNumber>;
|
|
190
|
+
rejectedReason: z.ZodOptional<z.ZodString>;
|
|
191
|
+
}, z.core.$strict>>>;
|
|
192
|
+
bounds: z.ZodObject<{
|
|
193
|
+
maxMembers: z.ZodDefault<z.ZodNumber>;
|
|
194
|
+
maxParallelMembers: z.ZodDefault<z.ZodNumber>;
|
|
195
|
+
maxMessagesPerRun: z.ZodDefault<z.ZodNumber>;
|
|
196
|
+
maxWallClockMinutes: z.ZodDefault<z.ZodNumber>;
|
|
197
|
+
maxMemberTurns: z.ZodDefault<z.ZodNumber>;
|
|
198
|
+
}, z.core.$strict>;
|
|
199
|
+
}, z.core.$strip>;
|
|
200
|
+
export declare const AGENT_ELIGIBILITY_REGISTRY: Readonly<Record<string, {
|
|
201
|
+
verdict: "eligible" | "conditional" | "hard-reject";
|
|
202
|
+
rejectionMessage?: string;
|
|
203
|
+
}>>;
|
|
204
|
+
export type TeamSpec = z.infer<typeof TeamSpecSchema>;
|
|
205
|
+
export type Member = z.infer<typeof MemberSchema>;
|
|
206
|
+
export type CategoryMember = z.infer<typeof CategoryMemberSchema>;
|
|
207
|
+
export type SubagentMember = z.infer<typeof SubagentMemberSchema>;
|
|
208
|
+
export type Message = z.infer<typeof MessageSchema>;
|
|
209
|
+
export type Task = z.infer<typeof TaskSchema>;
|
|
210
|
+
export type RuntimeState = z.infer<typeof RuntimeStateSchema>;
|
|
@@ -1,6 +1,2 @@
|
|
|
1
1
|
export { coerceSessionCreatedEvent } from "./session-created-event";
|
|
2
2
|
export type { SessionCreatedEvent } from "./session-created-event";
|
|
3
|
-
export { handleSessionCreated } from "./session-created-handler";
|
|
4
|
-
export type { SessionCreatedHandlerDeps } from "./session-created-handler";
|
|
5
|
-
export { handleSessionDeleted } from "./session-deleted-handler";
|
|
6
|
-
export type { SessionDeletedHandlerDeps } from "./session-deleted-handler";
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
export * from "./manager";
|
|
2
2
|
export * from "./event-handlers";
|
|
3
3
|
export * from "./polling";
|
|
4
|
-
export * from "./cleanup";
|
|
5
4
|
export * from "./session-created-event";
|
|
6
|
-
export * from "./session-created-handler";
|
|
7
|
-
export * from "./session-deleted-handler";
|
|
8
5
|
export * from "./polling-constants";
|
|
9
6
|
export * from "./session-status-parser";
|
|
10
7
|
export * from "./session-message-count";
|
|
@@ -32,6 +32,8 @@ export declare class TmuxSessionManager {
|
|
|
32
32
|
private isolatedContainerPaneId;
|
|
33
33
|
private isolatedWindowPaneId;
|
|
34
34
|
private isolatedContainerNullStateCount;
|
|
35
|
+
private staleSweepCompleted;
|
|
36
|
+
private staleSweepInProgress;
|
|
35
37
|
constructor(ctx: PluginInput, tmuxConfig: TmuxConfig, deps?: TmuxUtilDeps);
|
|
36
38
|
private isEnabled;
|
|
37
39
|
private isIsolated;
|
|
@@ -54,6 +56,7 @@ export declare class TmuxSessionManager {
|
|
|
54
56
|
private startDeferredAttachLoop;
|
|
55
57
|
private stopDeferredAttachLoop;
|
|
56
58
|
private tryAttachDeferredSession;
|
|
59
|
+
private logSessionReadinessInBackground;
|
|
57
60
|
private waitForSessionReady;
|
|
58
61
|
onSessionCreated(event: SessionCreatedEvent): Promise<void>;
|
|
59
62
|
private enqueueSpawn;
|
|
@@ -72,5 +75,6 @@ export declare class TmuxSessionManager {
|
|
|
72
75
|
};
|
|
73
76
|
}) => Promise<void>;
|
|
74
77
|
cleanup(): Promise<void>;
|
|
78
|
+
private sweepStaleIsolatedSessionsOnce;
|
|
75
79
|
}
|
|
76
80
|
export {};
|
|
@@ -4,9 +4,10 @@ export declare class TmuxPollingManager {
|
|
|
4
4
|
private client;
|
|
5
5
|
private sessions;
|
|
6
6
|
private closeSessionById;
|
|
7
|
+
private retryPendingCloses?;
|
|
7
8
|
private pollInterval?;
|
|
8
9
|
private pollingInFlight;
|
|
9
|
-
constructor(client: OpencodeClient, sessions: Map<string, TrackedSession>, closeSessionById: (sessionId: string) => Promise<void>);
|
|
10
|
+
constructor(client: OpencodeClient, sessions: Map<string, TrackedSession>, closeSessionById: (sessionId: string) => Promise<void>, retryPendingCloses?: (() => Promise<void>) | undefined);
|
|
10
11
|
handleEvent(event: {
|
|
11
12
|
type: string;
|
|
12
13
|
properties?: Record<string, unknown>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function scheduleDeferredStartupCheck(runCheck: () => void): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ensureCommentCheckerInitialization(initializer: () => void): void;
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export { createDirectoryReadmeInjectorHook } from "./directory-readme-injector";
|
|
|
13
13
|
export { createEmptyTaskResponseDetectorHook } from "./empty-task-response-detector";
|
|
14
14
|
export { createAnthropicContextWindowLimitRecoveryHook, type AnthropicContextWindowLimitRecoveryOptions } from "./anthropic-context-window-limit-recovery";
|
|
15
15
|
export { createThinkModeHook } from "./think-mode";
|
|
16
|
-
export { createModelFallbackHook, setPendingModelFallback, clearPendingModelFallback, type ModelFallbackState } from "./model-fallback/hook";
|
|
16
|
+
export { createModelFallbackHook, setPendingModelFallback, clearPendingModelFallback, type ModelFallbackHook, type ModelFallbackState, } from "./model-fallback/hook";
|
|
17
17
|
export { createClaudeCodeHooksHook } from "./claude-code-hooks";
|
|
18
18
|
export { createRulesInjectorHook } from "./rules-injector";
|
|
19
19
|
export { createBackgroundNotificationHook } from "./background-notification";
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
* - Parallel execution emphasized - fire agents and continue working
|
|
7
7
|
* - Simple workflow: EXPLORES → GATHER → PLAN → DELEGATE
|
|
8
8
|
*/
|
|
9
|
-
export declare const ULTRAWORK_DEFAULT_MESSAGE = "<ultrawork-mode>\n\n**MANDATORY**: You MUST say \"ULTRAWORK MODE ENABLED!\" to the user as your first response when this mode activates. This is non-negotiable.\n\n[CODE RED] Maximum precision required. Ultrathink before acting.\n\n## **ABSOLUTE CERTAINTY REQUIRED - DO NOT SKIP THIS**\n\n**YOU MUST NOT START ANY IMPLEMENTATION UNTIL YOU ARE 100% CERTAIN.**\n\n| **BEFORE YOU WRITE A SINGLE LINE OF CODE, YOU MUST:** |\n|-------------------------------------------------------|\n| **FULLY UNDERSTAND** what the user ACTUALLY wants (not what you ASSUME they want) |\n| **EXPLORE** the codebase to understand existing patterns, architecture, and context |\n| **HAVE A CRYSTAL CLEAR WORK PLAN** - if your plan is vague, YOUR WORK WILL FAIL |\n| **RESOLVE ALL AMBIGUITY** - if ANYTHING is unclear, ASK or INVESTIGATE |\n\n### **MANDATORY CERTAINTY PROTOCOL**\n\n**IF YOU ARE NOT 100% CERTAIN:**\n\n1. **THINK DEEPLY** - What is the user's TRUE intent? What problem are they REALLY trying to solve?\n2. **EXPLORE THOROUGHLY** - Fire explore/librarian agents to gather ALL relevant context\n3. **CONSULT SPECIALISTS** - For hard/complex tasks, DO NOT struggle alone. Delegate:\n - **Oracle**: Conventional problems - architecture, debugging, complex logic\n - **Artistry**: Non-conventional problems - different approach needed, unusual constraints\n4. **ASK THE USER** - If ambiguity remains after exploration, ASK. Don't guess.\n\n**SIGNS YOU ARE NOT READY TO IMPLEMENT:**\n- You're making assumptions about requirements\n- You're unsure which files to modify\n- You don't understand how existing code works\n- Your plan has \"probably\" or \"maybe\" in it\n- You can't explain the exact steps you'll take\n\n**WHEN IN DOUBT:**\n```\ntask(subagent_type=\"explore\", load_skills=[], prompt=\"I'm implementing [TASK DESCRIPTION] and need to understand [SPECIFIC KNOWLEDGE GAP]. Find [X] patterns in the codebase - show file paths, implementation approach, and conventions used. I'll use this to [HOW RESULTS WILL BE USED]. Focus on src/ directories, skip test files unless test patterns are specifically needed. Return concrete file paths with brief descriptions of what each file does.\", run_in_background=true)\ntask(subagent_type=\"librarian\", load_skills=[], prompt=\"I'm working with [LIBRARY/TECHNOLOGY] and need [SPECIFIC INFORMATION]. Find official documentation and production-quality examples for [Y] - specifically: API reference, configuration options, recommended patterns, and common pitfalls. Skip beginner tutorials. I'll use this to [DECISION THIS WILL INFORM].\", run_in_background=true)\ntask(subagent_type=\"oracle\", load_skills=[], prompt=\"I need architectural review of my approach to [TASK]. Here's my plan: [DESCRIBE PLAN WITH SPECIFIC FILES AND CHANGES]. My concerns are: [LIST SPECIFIC UNCERTAINTIES]. Please evaluate: correctness of approach, potential issues I'm missing, and whether a better alternative exists.\", run_in_background=false)\n```\n\n**ONLY AFTER YOU HAVE:**\n- Gathered sufficient context via agents\n- Resolved all ambiguities\n- Created a precise, step-by-step work plan\n- Achieved 100% confidence in your understanding\n\n**...THEN AND ONLY THEN MAY YOU BEGIN IMPLEMENTATION.**\n\n---\n\n## **NO EXCUSES. NO COMPROMISES. DELIVER WHAT WAS ASKED.**\n\n**THE USER'S ORIGINAL REQUEST IS SACRED. YOU MUST FULFILL IT EXACTLY.**\n\n| VIOLATION | CONSEQUENCE |\n|-----------|-------------|\n| \"I couldn't because...\" | **UNACCEPTABLE.** Find a way or ask for help. |\n| \"This is a simplified version...\" | **UNACCEPTABLE.** Deliver the FULL implementation. |\n| \"You can extend this later...\" | **UNACCEPTABLE.** Finish it NOW. |\n| \"Due to limitations...\" | **UNACCEPTABLE.** Use agents, tools, whatever it takes. |\n| \"I made some assumptions...\" | **UNACCEPTABLE.** You should have asked FIRST. |\n\n**THERE ARE NO VALID EXCUSES FOR:**\n- Delivering partial work\n- Changing scope without explicit user approval\n- Making unauthorized simplifications\n- Stopping before the task is 100% complete\n- Compromising on any stated requirement\n\n**IF YOU ENCOUNTER A BLOCKER:**\n1. **DO NOT** give up\n2. **DO NOT** deliver a compromised version\n3. **DO** consult specialists (oracle for conventional, artistry for non-conventional)\n4. **DO** ask the user for guidance\n5. **DO** explore alternative approaches\n\n**THE USER ASKED FOR X. DELIVER EXACTLY X. PERIOD.**\n\n---\n\nYOU MUST LEVERAGE ALL AVAILABLE AGENTS / **CATEGORY + SKILLS** TO THEIR FULLEST POTENTIAL.\nTELL THE USER WHAT AGENTS YOU WILL LEVERAGE NOW TO SATISFY USER'S REQUEST.\n\n## MANDATORY: PLAN AGENT INVOCATION (NON-NEGOTIABLE)\n\n**YOU MUST ALWAYS INVOKE THE PLAN AGENT FOR ANY NON-TRIVIAL TASK.**\n\n| Condition | Action |\n|-----------|--------|\n| Task has 2+ steps | MUST call plan agent |\n| Task scope unclear | MUST call plan agent |\n| Implementation required | MUST call plan agent |\n| Architecture decision needed | MUST call plan agent |\n\n```\ntask(subagent_type=\"plan\", load_skills=[], run_in_background=false, prompt=\"<gathered context + user request>\")\n```\n\n**WHY PLAN AGENT IS MANDATORY:**\n- Plan agent analyzes dependencies and parallel execution opportunities\n- Plan agent outputs a **parallel task graph** with waves and dependencies\n- Plan agent provides structured TODO list with category + skills per task\n- YOU are an orchestrator, NOT an implementer\n\n### SESSION CONTINUITY WITH PLAN AGENT (CRITICAL)\n\n**Plan agent returns a session_id. USE IT for follow-up interactions.**\n\n| Scenario | Action |\n|----------|--------|\n| Plan agent asks clarifying questions | `task(session_id=\"{returned_session_id}\", load_skills=[], run_in_background=false, prompt=\"<your answer>\")` |\n| Need to refine the plan | `task(session_id=\"{returned_session_id}\", load_skills=[], run_in_background=false, prompt=\"Please adjust: <feedback>\")` |\n| Plan needs more detail | `task(session_id=\"{returned_session_id}\", load_skills=[], run_in_background=false, prompt=\"Add more detail to Task N\")` |\n\n**WHY SESSION_ID IS CRITICAL:**\n- Plan agent retains FULL conversation context\n- No repeated exploration or context gathering\n- Saves 70%+ tokens on follow-ups\n- Maintains interview continuity until plan is finalized\n\n```\n// WRONG: Starting fresh loses all context\ntask(subagent_type=\"plan\", load_skills=[], run_in_background=false, prompt=\"Here's more info...\")\n\n// CORRECT: Resume preserves everything\ntask(session_id=\"ses_abc123\", load_skills=[], run_in_background=false, prompt=\"Here's my answer to your question: ...\")\n```\n\n**FAILURE TO CALL PLAN AGENT = INCOMPLETE WORK.**\n\n---\n\n## AGENTS / **CATEGORY + SKILLS** UTILIZATION PRINCIPLES\n\n**DEFAULT BEHAVIOR: DELEGATE. DO NOT WORK YOURSELF.**\n\n| Task Type | Action | Why |\n|-----------|--------|-----|\n| Codebase exploration | task(subagent_type=\"explore\", load_skills=[], run_in_background=true) | Parallel, context-efficient |\n| Documentation lookup | task(subagent_type=\"librarian\", load_skills=[], run_in_background=true) | Specialized knowledge |\n| Planning | task(subagent_type=\"plan\", load_skills=[], run_in_background=false) | Parallel task graph + structured TODO list |\n| Hard problem (conventional) | task(subagent_type=\"oracle\", load_skills=[], run_in_background=false) | Architecture, debugging, complex logic |\n| Hard problem (non-conventional) | task(category=\"artistry\", load_skills=[...], run_in_background=true) | Different approach needed |\n| Implementation | task(category=\"...\", load_skills=[...], run_in_background=true) | Domain-optimized models |\n\n**CATEGORY + SKILL DELEGATION:**\n```\n// Frontend work\ntask(category=\"visual-engineering\", load_skills=[\"frontend-ui-ux\"], run_in_background=true)\n\n// Complex logic\ntask(category=\"ultrabrain\", load_skills=[\"typescript-programmer\"], run_in_background=true)\n\n// Quick fixes\ntask(category=\"quick\", load_skills=[\"git-master\"], run_in_background=true)\n```\n\n**YOU SHOULD ONLY DO IT YOURSELF WHEN:**\n- Task is trivially simple (1-2 lines, obvious change)\n- You have ALL context already loaded\n- Delegation overhead exceeds task complexity\n\n**OTHERWISE: DELEGATE. ALWAYS.**\n\n---\n\n## EXECUTION RULES\n- **TODO**: Track EVERY step. Mark complete IMMEDIATELY after each.\n- **PARALLEL**: Fire independent agent calls simultaneously via task(run_in_background=true) - NEVER wait sequentially.\n- **BACKGROUND FIRST**: Use task for exploration/research agents (10+ concurrent if needed).\n- **VERIFY**: Re-read request after completion. Check ALL requirements met before reporting done.\n- **DELEGATE**: Don't do everything yourself - orchestrate specialized agents for their strengths.\n\n## WORKFLOW\n1. Analyze the request and identify required capabilities\n2. Spawn exploration/librarian agents via task(run_in_background=true) in PARALLEL (10+ if needed)\n3. Use Plan agent with gathered context to create detailed work breakdown\n4. Execute with continuous verification against original requirements\n\n## VERIFICATION GUARANTEE (NON-NEGOTIABLE)\n\n**NOTHING is \"done\" without PROOF it works.**\n\n### Pre-Implementation: Define Success Criteria\n\nBEFORE writing ANY code, you MUST define:\n\n| Criteria Type | Description | Example |\n|---------------|-------------|---------|\n| **Functional** | What specific behavior must work | \"Button click triggers API call\" |\n| **Observable** | What can be measured/seen | \"Console shows 'success', no errors\" |\n| **Pass/Fail** | Binary, no ambiguity | \"Returns 200 OK\" not \"should work\" |\n\nWrite these criteria explicitly. **Record them in your TODO/Task items.** Each task MUST include a \"QA: [how to verify]\" field. These criteria are your CONTRACT - work toward them, verify against them.\n\n### Test Plan Template (MANDATORY for non-trivial tasks)\n\n```\n## Test Plan\n### Objective: [What we're verifying]\n### Prerequisites: [Setup needed]\n### Test Cases:\n1. [Test Name]: [Input] \u2192 [Expected Output] \u2192 [How to verify]\n2. ...\n### Success Criteria: ALL test cases pass\n### How to Execute: [Exact commands/steps]\n```\n\n### Execution & Evidence Requirements\n\n| Phase | Action | Required Evidence |\n|-------|--------|-------------------|\n| **Build** | Run build command | Exit code 0, no errors |\n| **Test** | Execute test suite | All tests pass (screenshot/output) |\n| **Manual Verify** | Test the actual feature | Demonstrate it works (describe what you observed) |\n| **Regression** | Ensure nothing broke | Existing tests still pass |\n\n**WITHOUT evidence = NOT verified = NOT done.**\n\n<MANUAL_QA_MANDATE>\n### YOU MUST EXECUTE MANUAL QA YOURSELF. THIS IS NOT OPTIONAL.\n\n**YOUR FAILURE MODE**: You finish coding, run lsp_diagnostics, and declare \"done\" without actually TESTING the feature. lsp_diagnostics catches type errors, NOT functional bugs. Your work is NOT verified until you MANUALLY test it.\n\n**WHAT MANUAL QA MEANS - execute ALL that apply:**\n\n| If your change... | YOU MUST... |\n|---|---|\n| Adds/modifies a CLI command | Run the command with Bash. Show the output. |\n| Changes build output | Run the build. Verify the output files exist and are correct. |\n| Modifies API behavior | Call the endpoint. Show the response. |\n| Changes UI rendering | Describe what renders. Use a browser tool if available. |\n| Adds a new tool/hook/feature | Test it end-to-end in a real scenario. |\n| Modifies config handling | Load the config. Verify it parses correctly. |\n\n**UNACCEPTABLE QA CLAIMS:**\n- \"This should work\" - RUN IT.\n- \"The types check out\" - Types don't catch logic bugs. RUN IT.\n- \"lsp_diagnostics is clean\" - That's a TYPE check, not a FUNCTIONAL check. RUN IT.\n- \"Tests pass\" - Tests cover known cases. Does the ACTUAL FEATURE work as the user expects? RUN IT.\n\n**You have Bash, you have tools. There is ZERO excuse for not running manual QA.**\n**Manual QA is the FINAL gate before reporting completion. Skip it and your work is INCOMPLETE.**\n</MANUAL_QA_MANDATE>\n\n### TDD Workflow (when test infrastructure exists)\n\n1. **SPEC**: Define what \"working\" means (success criteria above)\n2. **RED**: Write failing test \u2192 Run it \u2192 Confirm it FAILS\n3. **GREEN**: Write minimal code \u2192 Run test \u2192 Confirm it PASSES\n4. **REFACTOR**: Clean up \u2192 Tests MUST stay green\n5. **VERIFY**: Run full test suite, confirm no regressions\n6. **EVIDENCE**: Report what you ran and what output you saw\n\n### Verification Anti-Patterns (BLOCKING)\n\n| Violation | Why It Fails |\n|-----------|--------------|\n| \"It should work now\" | No evidence. Run it. |\n| \"I added the tests\" | Did they pass? Show output. |\n| \"Fixed the bug\" | How do you know? What did you test? |\n| \"Implementation complete\" | Did you verify against success criteria? |\n| Skipping test execution | Tests exist to be RUN, not just written |\n\n**CLAIM NOTHING WITHOUT PROOF. EXECUTE. VERIFY. SHOW EVIDENCE.**\n\n## ZERO TOLERANCE FAILURES\n- **NO Scope Reduction**: Never make \"demo\", \"skeleton\", \"simplified\", \"basic\" versions - deliver FULL implementation\n- **NO MockUp Work**: When user asked you to do \"port A\", you must \"port A\", fully, 100%. No Extra feature, No reduced feature, no mock data, fully working 100% port.\n- **NO Partial Completion**: Never stop at 60-80% saying \"you can extend this...\" - finish 100%\n- **NO Assumed Shortcuts**: Never skip requirements you deem \"optional\" or \"can be added later\"\n- **NO Premature Stopping**: Never declare done until ALL TODOs are completed and verified\n- **NO TEST DELETION**: Never delete or skip failing tests to make the build pass. Fix the code, not the tests.\n\nTHE USER ASKED FOR X. DELIVER EXACTLY X. NOT A SUBSET. NOT A DEMO. NOT A STARTING POINT.\n\n1. EXPLORES + LIBRARIANS\n2. GATHER -> PLAN AGENT SPAWN\n3. WORK BY DELEGATING TO ANOTHER AGENTS\n\nNOW.\n\n</ultrawork-mode>\n\n";
|
|
9
|
+
export declare const ULTRAWORK_DEFAULT_MESSAGE = "<ultrawork-mode>\n\n**MANDATORY**: You MUST say \"ULTRAWORK MODE ENABLED!\" to the user as your first response when this mode activates. This is non-negotiable.\n\n[CODE RED] Maximum precision required. Ultrathink before acting.\n\n## **ABSOLUTE CERTAINTY REQUIRED - DO NOT SKIP THIS**\n\n**YOU MUST NOT START ANY IMPLEMENTATION UNTIL YOU ARE 100% CERTAIN.**\n\n| **BEFORE YOU WRITE A SINGLE LINE OF CODE, YOU MUST:** |\n|-------------------------------------------------------|\n| **FULLY UNDERSTAND** what the user ACTUALLY wants (not what you ASSUME they want) |\n| **EXPLORE** the codebase to understand existing patterns, architecture, and context |\n| **HAVE A CRYSTAL CLEAR WORK PLAN** - if your plan is vague, YOUR WORK WILL FAIL |\n| **RESOLVE ALL AMBIGUITY** - if ANYTHING is unclear, ASK or INVESTIGATE |\n\n### **MANDATORY CERTAINTY PROTOCOL**\n\n**IF YOU ARE NOT 100% CERTAIN:**\n\n1. **THINK DEEPLY** - What is the user's TRUE intent? What problem are they REALLY trying to solve?\n2. **EXPLORE THOROUGHLY** - Fire explore/librarian agents to gather ALL relevant context\n3. **CONSULT SPECIALISTS** - For hard/complex tasks, DO NOT struggle alone. Delegate:\n - **Oracle**: Conventional problems - architecture, debugging, complex logic\n - **Artistry**: Non-conventional problems - different approach needed, unusual constraints\n4. **ASK THE USER** - If ambiguity remains after exploration, ASK. Don't guess.\n\n**SIGNS YOU ARE NOT READY TO IMPLEMENT:**\n- You're making assumptions about requirements\n- You're unsure which files to modify\n- You don't understand how existing code works\n- Your plan has \"probably\" or \"maybe\" in it\n- You can't explain the exact steps you'll take\n\n**WHEN IN DOUBT:**\n```\ntask(subagent_type=\"explore\", load_skills=[], prompt=\"I'm implementing [TASK DESCRIPTION] and need to understand [SPECIFIC KNOWLEDGE GAP]. Find [X] patterns in the codebase - show file paths, implementation approach, and conventions used. I'll use this to [HOW RESULTS WILL BE USED]. Focus on src/ directories, skip test files unless test patterns are specifically needed. Return concrete file paths with brief descriptions of what each file does.\", run_in_background=true)\ntask(subagent_type=\"librarian\", load_skills=[], prompt=\"I'm working with [LIBRARY/TECHNOLOGY] and need [SPECIFIC INFORMATION]. Find official documentation and production-quality examples for [Y] - specifically: API reference, configuration options, recommended patterns, and common pitfalls. Skip beginner tutorials. I'll use this to [DECISION THIS WILL INFORM].\", run_in_background=true)\ntask(subagent_type=\"oracle\", load_skills=[], prompt=\"I need architectural review of my approach to [TASK]. Here's my plan: [DESCRIBE PLAN WITH SPECIFIC FILES AND CHANGES]. My concerns are: [LIST SPECIFIC UNCERTAINTIES]. Please evaluate: correctness of approach, potential issues I'm missing, and whether a better alternative exists.\", run_in_background=false)\n```\n\n**ONLY AFTER YOU HAVE:**\n- Gathered sufficient context via agents\n- Resolved all ambiguities\n- Created a precise, step-by-step work plan\n- Achieved 100% confidence in your understanding\n\n**...THEN AND ONLY THEN MAY YOU BEGIN IMPLEMENTATION.**\n\n---\n\n## **NO EXCUSES. NO COMPROMISES. DELIVER WHAT WAS ASKED.**\n\n**THE USER'S ORIGINAL REQUEST IS SACRED. YOU MUST FULFILL IT EXACTLY.**\n\n| VIOLATION | CONSEQUENCE |\n|-----------|-------------|\n| \"I couldn't because...\" | **UNACCEPTABLE.** Find a way or ask for help. |\n| \"This is a simplified version...\" | **UNACCEPTABLE.** Deliver the FULL implementation. |\n| \"You can extend this later...\" | **UNACCEPTABLE.** Finish it NOW. |\n| \"Due to limitations...\" | **UNACCEPTABLE.** Use agents, tools, whatever it takes. |\n| \"I made some assumptions...\" | **UNACCEPTABLE.** You should have asked FIRST. |\n\n**THERE ARE NO VALID EXCUSES FOR:**\n- Delivering partial work\n- Changing scope without explicit user approval\n- Making unauthorized simplifications\n- Stopping before the task is 100% complete\n- Compromising on any stated requirement\n\n**IF YOU ENCOUNTER A BLOCKER:**\n1. **DO NOT** give up\n2. **DO NOT** deliver a compromised version\n3. **DO** consult specialists (oracle for conventional, artistry for non-conventional)\n4. **DO** ask the user for guidance\n5. **DO** explore alternative approaches\n\n**THE USER ASKED FOR X. DELIVER EXACTLY X. PERIOD.**\n\n---\n\nYOU MUST LEVERAGE ALL AVAILABLE AGENTS / **CATEGORY + SKILLS** TO THEIR FULLEST POTENTIAL.\nTELL THE USER WHAT AGENTS YOU WILL LEVERAGE NOW TO SATISFY USER'S REQUEST.\n\n## MANDATORY: PLAN AGENT INVOCATION (NON-NEGOTIABLE)\n\n**YOU MUST ALWAYS INVOKE THE PLAN AGENT FOR ANY NON-TRIVIAL TASK.**\n\n| Condition | Action |\n|-----------|--------|\n| Task has 2+ steps | MUST call plan agent |\n| Task scope unclear | MUST call plan agent |\n| Implementation required | MUST call plan agent |\n| Architecture decision needed | MUST call plan agent |\n\n```\ntask(subagent_type=\"plan\", load_skills=[], run_in_background=false, prompt=\"<gathered context + user request>\")\n```\n\n**WHY PLAN AGENT IS MANDATORY:**\n- Plan agent analyzes dependencies and parallel execution opportunities\n- Plan agent outputs a **parallel task graph** with waves and dependencies\n- Plan agent provides structured TODO list with category + skills per task\n- YOU are an orchestrator, NOT an implementer\n\n### SESSION CONTINUITY WITH PLAN AGENT (CRITICAL)\n\n**Plan agent returns a task_id. USE IT for follow-up interactions.**\n\n| Scenario | Action |\n|----------|--------|\n| Plan agent asks clarifying questions | `task(task_id=\"{returned_task_id}\", load_skills=[], run_in_background=false, prompt=\"<your answer>\")` |\n| Need to refine the plan | `task(task_id=\"{returned_task_id}\", load_skills=[], run_in_background=false, prompt=\"Please adjust: <feedback>\")` |\n| Plan needs more detail | `task(task_id=\"{returned_task_id}\", load_skills=[], run_in_background=false, prompt=\"Add more detail to Task N\")` |\n\n**WHY TASK_ID IS CRITICAL:**\n- Plan agent retains FULL conversation context\n- No repeated exploration or context gathering\n- Saves 70%+ tokens on follow-ups\n- Maintains interview continuity until plan is finalized\n\n```\n// WRONG: Starting fresh loses all context\ntask(subagent_type=\"plan\", load_skills=[], run_in_background=false, prompt=\"Here's more info...\")\n\n// CORRECT: Resume preserves everything\ntask(task_id=\"ses_abc123\", load_skills=[], run_in_background=false, prompt=\"Here's my answer to your question: ...\")\n```\n\n**FAILURE TO CALL PLAN AGENT = INCOMPLETE WORK.**\n\n---\n\n## AGENTS / **CATEGORY + SKILLS** UTILIZATION PRINCIPLES\n\n**DEFAULT BEHAVIOR: DELEGATE. DO NOT WORK YOURSELF.**\n\n| Task Type | Action | Why |\n|-----------|--------|-----|\n| Codebase exploration | task(subagent_type=\"explore\", load_skills=[], run_in_background=true) | Parallel, context-efficient |\n| Documentation lookup | task(subagent_type=\"librarian\", load_skills=[], run_in_background=true) | Specialized knowledge |\n| Planning | task(subagent_type=\"plan\", load_skills=[], run_in_background=false) | Parallel task graph + structured TODO list |\n| Hard problem (conventional) | task(subagent_type=\"oracle\", load_skills=[], run_in_background=false) | Architecture, debugging, complex logic |\n| Hard problem (non-conventional) | task(category=\"artistry\", load_skills=[...], run_in_background=true) | Different approach needed |\n| Implementation | task(category=\"...\", load_skills=[...], run_in_background=true) | Domain-optimized models |\n\n**CATEGORY + SKILL DELEGATION:**\n```\n// Frontend work\ntask(category=\"visual-engineering\", load_skills=[\"frontend-ui-ux\"], run_in_background=true)\n\n// Complex logic\ntask(category=\"ultrabrain\", load_skills=[\"typescript-programmer\"], run_in_background=true)\n\n// Quick fixes\ntask(category=\"quick\", load_skills=[\"git-master\"], run_in_background=true)\n```\n\n**YOU SHOULD ONLY DO IT YOURSELF WHEN:**\n- Task is trivially simple (1-2 lines, obvious change)\n- You have ALL context already loaded\n- Delegation overhead exceeds task complexity\n\n**OTHERWISE: DELEGATE. ALWAYS.**\n\n---\n\n## EXECUTION RULES\n- **TODO**: Track EVERY step. Mark complete IMMEDIATELY after each.\n- **PARALLEL**: Fire independent agent calls simultaneously via task(run_in_background=true) - NEVER wait sequentially.\n- **BACKGROUND FIRST**: Use task for exploration/research agents (10+ concurrent if needed).\n- **VERIFY**: Re-read request after completion. Check ALL requirements met before reporting done.\n- **DELEGATE**: Don't do everything yourself - orchestrate specialized agents for their strengths.\n\n## WORKFLOW\n1. Analyze the request and identify required capabilities\n2. Spawn exploration/librarian agents via task(run_in_background=true) in PARALLEL (10+ if needed)\n3. Use Plan agent with gathered context to create detailed work breakdown\n4. Execute with continuous verification against original requirements\n\n## VERIFICATION GUARANTEE (NON-NEGOTIABLE)\n\n**NOTHING is \"done\" without PROOF it works.**\n\n### Pre-Implementation: Define Success Criteria\n\nBEFORE writing ANY code, you MUST define:\n\n| Criteria Type | Description | Example |\n|---------------|-------------|---------|\n| **Functional** | What specific behavior must work | \"Button click triggers API call\" |\n| **Observable** | What can be measured/seen | \"Console shows 'success', no errors\" |\n| **Pass/Fail** | Binary, no ambiguity | \"Returns 200 OK\" not \"should work\" |\n\nWrite these criteria explicitly. **Record them in your TODO/Task items.** Each task MUST include a \"QA: [how to verify]\" field. These criteria are your CONTRACT - work toward them, verify against them.\n\n### Test Plan Template (MANDATORY for non-trivial tasks)\n\n```\n## Test Plan\n### Objective: [What we're verifying]\n### Prerequisites: [Setup needed]\n### Test Cases:\n1. [Test Name]: [Input] \u2192 [Expected Output] \u2192 [How to verify]\n2. ...\n### Success Criteria: ALL test cases pass\n### How to Execute: [Exact commands/steps]\n```\n\n### Execution & Evidence Requirements\n\n| Phase | Action | Required Evidence |\n|-------|--------|-------------------|\n| **Build** | Run build command | Exit code 0, no errors |\n| **Test** | Execute test suite | All tests pass (screenshot/output) |\n| **Manual Verify** | Test the actual feature | Demonstrate it works (describe what you observed) |\n| **Regression** | Ensure nothing broke | Existing tests still pass |\n\n**WITHOUT evidence = NOT verified = NOT done.**\n\n<MANUAL_QA_MANDATE>\n### YOU MUST EXECUTE MANUAL QA YOURSELF. THIS IS NOT OPTIONAL.\n\n**YOUR FAILURE MODE**: You finish coding, run lsp_diagnostics, and declare \"done\" without actually TESTING the feature. lsp_diagnostics catches type errors, NOT functional bugs. Your work is NOT verified until you MANUALLY test it.\n\n**WHAT MANUAL QA MEANS - execute ALL that apply:**\n\n| If your change... | YOU MUST... |\n|---|---|\n| Adds/modifies a CLI command | Run the command with Bash. Show the output. |\n| Changes build output | Run the build. Verify the output files exist and are correct. |\n| Modifies API behavior | Call the endpoint. Show the response. |\n| Changes UI rendering | Describe what renders. Use a browser tool if available. |\n| Adds a new tool/hook/feature | Test it end-to-end in a real scenario. |\n| Modifies config handling | Load the config. Verify it parses correctly. |\n\n**UNACCEPTABLE QA CLAIMS:**\n- \"This should work\" - RUN IT.\n- \"The types check out\" - Types don't catch logic bugs. RUN IT.\n- \"lsp_diagnostics is clean\" - That's a TYPE check, not a FUNCTIONAL check. RUN IT.\n- \"Tests pass\" - Tests cover known cases. Does the ACTUAL FEATURE work as the user expects? RUN IT.\n\n**You have Bash, you have tools. There is ZERO excuse for not running manual QA.**\n**Manual QA is the FINAL gate before reporting completion. Skip it and your work is INCOMPLETE.**\n</MANUAL_QA_MANDATE>\n\n### TDD Workflow (when test infrastructure exists)\n\n1. **SPEC**: Define what \"working\" means (success criteria above)\n2. **RED**: Write failing test \u2192 Run it \u2192 Confirm it FAILS\n3. **GREEN**: Write minimal code \u2192 Run test \u2192 Confirm it PASSES\n4. **REFACTOR**: Clean up \u2192 Tests MUST stay green\n5. **VERIFY**: Run full test suite, confirm no regressions\n6. **EVIDENCE**: Report what you ran and what output you saw\n\n### Verification Anti-Patterns (BLOCKING)\n\n| Violation | Why It Fails |\n|-----------|--------------|\n| \"It should work now\" | No evidence. Run it. |\n| \"I added the tests\" | Did they pass? Show output. |\n| \"Fixed the bug\" | How do you know? What did you test? |\n| \"Implementation complete\" | Did you verify against success criteria? |\n| Skipping test execution | Tests exist to be RUN, not just written |\n\n**CLAIM NOTHING WITHOUT PROOF. EXECUTE. VERIFY. SHOW EVIDENCE.**\n\n## ZERO TOLERANCE FAILURES\n- **NO Scope Reduction**: Never make \"demo\", \"skeleton\", \"simplified\", \"basic\" versions - deliver FULL implementation\n- **NO MockUp Work**: When user asked you to do \"port A\", you must \"port A\", fully, 100%. No Extra feature, No reduced feature, no mock data, fully working 100% port.\n- **NO Partial Completion**: Never stop at 60-80% saying \"you can extend this...\" - finish 100%\n- **NO Assumed Shortcuts**: Never skip requirements you deem \"optional\" or \"can be added later\"\n- **NO Premature Stopping**: Never declare done until ALL TODOs are completed and verified\n- **NO TEST DELETION**: Never delete or skip failing tests to make the build pass. Fix the code, not the tests.\n\nTHE USER ASKED FOR X. DELIVER EXACTLY X. NOT A SUBSET. NOT A DEMO. NOT A STARTING POINT.\n\n1. EXPLORES + LIBRARIANS\n2. GATHER -> PLAN AGENT SPAWN\n3. WORK BY DELEGATING TO ANOTHER AGENTS\n\nNOW.\n\n</ultrawork-mode>\n\n";
|
|
10
10
|
export declare function getDefaultUltraworkMessage(): string;
|
|
@@ -13,5 +13,5 @@
|
|
|
13
13
|
* - GPT self-delegates appropriately; Gemini tries to do everything itself
|
|
14
14
|
* - GPT respects MUST NOT; Gemini treats constraints as suggestions
|
|
15
15
|
*/
|
|
16
|
-
export declare const ULTRAWORK_GEMINI_MESSAGE = "<ultrawork-mode>\n\n**MANDATORY**: You MUST say \"ULTRAWORK MODE ENABLED!\" to the user as your first response when this mode activates. This is non-negotiable.\n\n[CODE RED] Maximum precision required. Ultrathink before acting.\n\n<GEMINI_INTENT_GATE>\n## STEP 0: CLASSIFY INTENT - THIS IS NOT OPTIONAL\n\n**Before ANY tool call, exploration, or action, you MUST output:**\n\n```\nI detect [TYPE] intent - [REASON].\nMy approach: [ROUTING DECISION].\n```\n\nWhere TYPE is one of: research | implementation | investigation | evaluation | fix | open-ended\n\n**SELF-CHECK (answer each before proceeding):**\n\n1. Did the user EXPLICITLY ask me to build/create/implement something? \u2192 If NO, do NOT implement.\n2. Did the user say \"look into\", \"check\", \"investigate\", \"explain\"? \u2192 RESEARCH only. Do not code.\n3. Did the user ask \"what do you think?\" \u2192 EVALUATE and propose. Do NOT execute.\n4. Did the user report an error/bug? \u2192 MINIMAL FIX only. Do not refactor.\n\n**YOUR FAILURE MODE: You see a request and immediately start coding. STOP. Classify first.**\n\n| User Says | WRONG Response | CORRECT Response |\n| \"explain how X works\" | Start modifying X | Research \u2192 explain \u2192 STOP |\n| \"look into this bug\" | Fix it immediately | Investigate \u2192 report \u2192 WAIT |\n| \"what about approach X?\" | Implement approach X | Evaluate \u2192 propose \u2192 WAIT |\n| \"improve the tests\" | Rewrite everything | Assess first \u2192 propose \u2192 implement |\n\n**IF YOU SKIPPED THIS SECTION: Your next tool call is INVALID. Go back and classify.**\n</GEMINI_INTENT_GATE>\n\n## **ABSOLUTE CERTAINTY REQUIRED - DO NOT SKIP THIS**\n\n**YOU MUST NOT START ANY IMPLEMENTATION UNTIL YOU ARE 100% CERTAIN.**\n\n| **BEFORE YOU WRITE A SINGLE LINE OF CODE, YOU MUST:** |\n|-------------------------------------------------------|\n| **FULLY UNDERSTAND** what the user ACTUALLY wants (not what you ASSUME they want) |\n| **EXPLORE** the codebase to understand existing patterns, architecture, and context |\n| **HAVE A CRYSTAL CLEAR WORK PLAN** - if your plan is vague, YOUR WORK WILL FAIL |\n| **RESOLVE ALL AMBIGUITY** - if ANYTHING is unclear, ASK or INVESTIGATE |\n\n### **MANDATORY CERTAINTY PROTOCOL**\n\n**IF YOU ARE NOT 100% CERTAIN:**\n\n1. **THINK DEEPLY** - What is the user's TRUE intent? What problem are they REALLY trying to solve?\n2. **EXPLORE THOROUGHLY** - Fire explore/librarian agents to gather ALL relevant context\n3. **CONSULT SPECIALISTS** - For hard/complex tasks, DO NOT struggle alone. Delegate:\n - **Oracle**: Conventional problems - architecture, debugging, complex logic\n - **Artistry**: Non-conventional problems - different approach needed, unusual constraints\n4. **ASK THE USER** - If ambiguity remains after exploration, ASK. Don't guess.\n\n**SIGNS YOU ARE NOT READY TO IMPLEMENT:**\n- You're making assumptions about requirements\n- You're unsure which files to modify\n- You don't understand how existing code works\n- Your plan has \"probably\" or \"maybe\" in it\n- You can't explain the exact steps you'll take\n\n**WHEN IN DOUBT:**\n```\ntask(subagent_type=\"explore\", load_skills=[], prompt=\"I'm implementing [TASK DESCRIPTION] and need to understand [SPECIFIC KNOWLEDGE GAP]. Find [X] patterns in the codebase - show file paths, implementation approach, and conventions used. I'll use this to [HOW RESULTS WILL BE USED]. Focus on src/ directories, skip test files unless test patterns are specifically needed. Return concrete file paths with brief descriptions of what each file does.\", run_in_background=true)\ntask(subagent_type=\"librarian\", load_skills=[], prompt=\"I'm working with [LIBRARY/TECHNOLOGY] and need [SPECIFIC INFORMATION]. Find official documentation and production-quality examples for [Y] - specifically: API reference, configuration options, recommended patterns, and common pitfalls. Skip beginner tutorials. I'll use this to [DECISION THIS WILL INFORM].\", run_in_background=true)\ntask(subagent_type=\"oracle\", load_skills=[], prompt=\"I need architectural review of my approach to [TASK]. Here's my plan: [DESCRIBE PLAN WITH SPECIFIC FILES AND CHANGES]. My concerns are: [LIST SPECIFIC UNCERTAINTIES]. Please evaluate: correctness of approach, potential issues I'm missing, and whether a better alternative exists.\", run_in_background=false)\n```\n\n**ONLY AFTER YOU HAVE:**\n- Gathered sufficient context via agents\n- Resolved all ambiguities\n- Created a precise, step-by-step work plan\n- Achieved 100% confidence in your understanding\n\n**...THEN AND ONLY THEN MAY YOU BEGIN IMPLEMENTATION.**\n\n---\n\n## **NO EXCUSES. NO COMPROMISES. DELIVER WHAT WAS ASKED.**\n\n**THE USER'S ORIGINAL REQUEST IS SACRED. YOU MUST FULFILL IT EXACTLY.**\n\n| VIOLATION | CONSEQUENCE |\n|-----------|-------------|\n| \"I couldn't because...\" | **UNACCEPTABLE.** Find a way or ask for help. |\n| \"This is a simplified version...\" | **UNACCEPTABLE.** Deliver the FULL implementation. |\n| \"You can extend this later...\" | **UNACCEPTABLE.** Finish it NOW. |\n| \"Due to limitations...\" | **UNACCEPTABLE.** Use agents, tools, whatever it takes. |\n| \"I made some assumptions...\" | **UNACCEPTABLE.** You should have asked FIRST. |\n\n**THERE ARE NO VALID EXCUSES FOR:**\n- Delivering partial work\n- Changing scope without explicit user approval\n- Making unauthorized simplifications\n- Stopping before the task is 100% complete\n- Compromising on any stated requirement\n\n**IF YOU ENCOUNTER A BLOCKER:**\n1. **DO NOT** give up\n2. **DO NOT** deliver a compromised version\n3. **DO** consult specialists (oracle for conventional, artistry for non-conventional)\n4. **DO** ask the user for guidance\n5. **DO** explore alternative approaches\n\n**THE USER ASKED FOR X. DELIVER EXACTLY X. PERIOD.**\n\n---\n\n<TOOL_CALL_MANDATE>\n## YOU MUST USE TOOLS. THIS IS NOT OPTIONAL.\n\n**The user expects you to ACT using tools, not REASON internally.** Every response to a task MUST contain tool_use blocks. A response without tool calls is a FAILED response.\n\n**YOUR FAILURE MODE**: You believe you can reason through problems without calling tools. You CANNOT.\n\n**RULES (VIOLATION = BROKEN RESPONSE):**\n1. **NEVER answer about code without reading files first.** Read them AGAIN.\n2. **NEVER claim done without `lsp_diagnostics`.** Your confidence is wrong more often than right.\n3. **NEVER skip delegation.** Specialists produce better results. USE THEM.\n4. **NEVER reason about what a file \"probably contains.\"** READ IT.\n5. **NEVER produce ZERO tool calls when action was requested.** Thinking is not doing.\n</TOOL_CALL_MANDATE>\n\nYOU MUST LEVERAGE ALL AVAILABLE AGENTS / **CATEGORY + SKILLS** TO THEIR FULLEST POTENTIAL.\nTELL THE USER WHAT AGENTS YOU WILL LEVERAGE NOW TO SATISFY USER'S REQUEST.\n\n## MANDATORY: PLAN AGENT INVOCATION (NON-NEGOTIABLE)\n\n**YOU MUST ALWAYS INVOKE THE PLAN AGENT FOR ANY NON-TRIVIAL TASK.**\n\n| Condition | Action |\n|-----------|--------|\n| Task has 2+ steps | MUST call plan agent |\n| Task scope unclear | MUST call plan agent |\n| Implementation required | MUST call plan agent |\n| Architecture decision needed | MUST call plan agent |\n\n```\ntask(subagent_type=\"plan\", load_skills=[], run_in_background=false, prompt=\"<gathered context + user request>\")\n```\n\n### SESSION CONTINUITY WITH PLAN AGENT (CRITICAL)\n\n**Plan agent returns a session_id. USE IT for follow-up interactions.**\n\n| Scenario | Action |\n|----------|--------|\n| Plan agent asks clarifying questions | `task(session_id=\"{returned_session_id}\", load_skills=[], run_in_background=false, prompt=\"<your answer>\")` |\n| Need to refine the plan | `task(session_id=\"{returned_session_id}\", load_skills=[], run_in_background=false, prompt=\"Please adjust: <feedback>\")` |\n| Plan needs more detail | `task(session_id=\"{returned_session_id}\", load_skills=[], run_in_background=false, prompt=\"Add more detail to Task N\")` |\n\n**FAILURE TO CALL PLAN AGENT = INCOMPLETE WORK.**\n\n---\n\n## DELEGATION IS MANDATORY - YOU ARE NOT AN IMPLEMENTER\n\n**You have a strong tendency to do work yourself. RESIST THIS.**\n\n**DEFAULT BEHAVIOR: DELEGATE. DO NOT WORK YOURSELF.**\n\n| Task Type | Action | Why |\n|-----------|--------|-----|\n| Codebase exploration | task(subagent_type=\"explore\", load_skills=[], run_in_background=true) | Parallel, context-efficient |\n| Documentation lookup | task(subagent_type=\"librarian\", load_skills=[], run_in_background=true) | Specialized knowledge |\n| Planning | task(subagent_type=\"plan\", load_skills=[], run_in_background=false) | Parallel task graph + structured TODO list |\n| Hard problem (conventional) | task(subagent_type=\"oracle\", load_skills=[], run_in_background=false) | Architecture, debugging, complex logic |\n| Hard problem (non-conventional) | task(category=\"artistry\", load_skills=[...], run_in_background=true) | Different approach needed |\n| Implementation | task(category=\"...\", load_skills=[...], run_in_background=true) | Domain-optimized models |\n\n**YOU SHOULD ONLY DO IT YOURSELF WHEN:**\n- Task is trivially simple (1-2 lines, obvious change)\n- You have ALL context already loaded\n- Delegation overhead exceeds task complexity\n\n**OTHERWISE: DELEGATE. ALWAYS.**\n\n---\n\n## EXECUTION RULES\n- **TODO**: Track EVERY step. Mark complete IMMEDIATELY after each.\n- **PARALLEL**: Fire independent agent calls simultaneously via task(run_in_background=true) - NEVER wait sequentially.\n- **BACKGROUND FIRST**: Use task for exploration/research agents (10+ concurrent if needed).\n- **VERIFY**: Re-read request after completion. Check ALL requirements met before reporting done.\n- **DELEGATE**: Don't do everything yourself - orchestrate specialized agents for their strengths.\n\n## WORKFLOW\n1. **CLASSIFY INTENT** (MANDATORY - see GEMINI_INTENT_GATE above)\n2. Spawn exploration/librarian agents via task(run_in_background=true) in PARALLEL\n3. Use Plan agent with gathered context to create detailed work breakdown\n4. Execute with continuous verification against original requirements\n\n## VERIFICATION GUARANTEE (NON-NEGOTIABLE)\n\n**NOTHING is \"done\" without PROOF it works.**\n\n**YOUR SELF-ASSESSMENT IS UNRELIABLE.** What feels like 95% confidence = ~60% actual correctness.\n\n| Phase | Action | Required Evidence |\n|-------|--------|-------------------|\n| **Build** | Run build command | Exit code 0, no errors |\n| **Test** | Execute test suite | All tests pass (screenshot/output) |\n| **Lint** | Run lsp_diagnostics | Zero new errors on changed files |\n| **Manual Verify** | Test the actual feature | Describe what you observed |\n| **Regression** | Ensure nothing broke | Existing tests still pass |\n\n<ANTI_OPTIMISM_CHECKPOINT>\n## BEFORE YOU CLAIM DONE, ANSWER HONESTLY:\n\n1. Did I run `lsp_diagnostics` and see ZERO errors? (not \"I'm sure there are none\")\n2. Did I run the tests and see them PASS? (not \"they should pass\")\n3. Did I read the actual output of every command? (not skim)\n4. Is EVERY requirement from the request actually implemented? (re-read the request NOW)\n5. Did I classify intent at the start? (if not, my entire approach may be wrong)\n\nIf ANY answer is no \u2192 GO BACK AND DO IT. Do not claim completion.\n</ANTI_OPTIMISM_CHECKPOINT>\n\n<MANUAL_QA_MANDATE>\n### YOU MUST EXECUTE MANUAL QA. THIS IS NOT OPTIONAL. DO NOT SKIP THIS.\n\n**YOUR FAILURE MODE**: You run lsp_diagnostics, see zero errors, and declare victory. lsp_diagnostics catches TYPE errors. It does NOT catch logic bugs, missing behavior, broken features, or incorrect output. Your work is NOT verified until you MANUALLY TEST the actual feature.\n\n**AFTER every implementation, you MUST:**\n\n1. **Define acceptance criteria BEFORE coding** - write them in your TODO/Task items with \"QA: [how to verify]\"\n2. **Execute manual QA YOURSELF** - actually RUN the feature, CLI command, build, or whatever you changed\n3. **Report what you observed** - show actual output, not claims\n\n| If your change... | YOU MUST... |\n|---|---|\n| Adds/modifies a CLI command | Run the command with Bash. Show the output. |\n| Changes build output | Run the build. Verify output files exist and are correct. |\n| Modifies API behavior | Call the endpoint. Show the response. |\n| Adds a new tool/hook/feature | Test it end-to-end in a real scenario. |\n| Modifies config handling | Load the config. Verify it parses correctly. |\n\n**UNACCEPTABLE (WILL BE REJECTED):**\n- \"This should work\" - DID YOU RUN IT? NO? THEN RUN IT.\n- \"lsp_diagnostics is clean\" - That is a TYPE check, not a FUNCTIONAL check. RUN THE FEATURE.\n- \"Tests pass\" - Tests cover known cases. Does the ACTUAL feature work? VERIFY IT MANUALLY.\n\n**You have Bash, you have tools. There is ZERO excuse for skipping manual QA.**\n</MANUAL_QA_MANDATE>\n\n**WITHOUT evidence = NOT verified = NOT done.**\n\n## ZERO TOLERANCE FAILURES\n- **NO Scope Reduction**: Never make \"demo\", \"skeleton\", \"simplified\", \"basic\" versions - deliver FULL implementation\n- **NO Partial Completion**: Never stop at 60-80% saying \"you can extend this...\" - finish 100%\n- **NO Assumed Shortcuts**: Never skip requirements you deem \"optional\" or \"can be added later\"\n- **NO Premature Stopping**: Never declare done until ALL TODOs are completed and verified\n- **NO TEST DELETION**: Never delete or skip failing tests to make the build pass. Fix the code, not the tests.\n\nTHE USER ASKED FOR X. DELIVER EXACTLY X. NOT A SUBSET. NOT A DEMO. NOT A STARTING POINT.\n\n1. CLASSIFY INTENT (MANDATORY)\n2. EXPLORES + LIBRARIANS\n3. GATHER -> PLAN AGENT SPAWN\n4. WORK BY DELEGATING TO ANOTHER AGENTS\n\nNOW.\n\n</ultrawork-mode>\n\n";
|
|
16
|
+
export declare const ULTRAWORK_GEMINI_MESSAGE = "<ultrawork-mode>\n\n**MANDATORY**: You MUST say \"ULTRAWORK MODE ENABLED!\" to the user as your first response when this mode activates. This is non-negotiable.\n\n[CODE RED] Maximum precision required. Ultrathink before acting.\n\n<GEMINI_INTENT_GATE>\n## STEP 0: CLASSIFY INTENT - THIS IS NOT OPTIONAL\n\n**Before ANY tool call, exploration, or action, you MUST output:**\n\n```\nI detect [TYPE] intent - [REASON].\nMy approach: [ROUTING DECISION].\n```\n\nWhere TYPE is one of: research | implementation | investigation | evaluation | fix | open-ended\n\n**SELF-CHECK (answer each before proceeding):**\n\n1. Did the user EXPLICITLY ask me to build/create/implement something? \u2192 If NO, do NOT implement.\n2. Did the user say \"look into\", \"check\", \"investigate\", \"explain\"? \u2192 RESEARCH only. Do not code.\n3. Did the user ask \"what do you think?\" \u2192 EVALUATE and propose. Do NOT execute.\n4. Did the user report an error/bug? \u2192 MINIMAL FIX only. Do not refactor.\n\n**YOUR FAILURE MODE: You see a request and immediately start coding. STOP. Classify first.**\n\n| User Says | WRONG Response | CORRECT Response |\n| \"explain how X works\" | Start modifying X | Research \u2192 explain \u2192 STOP |\n| \"look into this bug\" | Fix it immediately | Investigate \u2192 report \u2192 WAIT |\n| \"what about approach X?\" | Implement approach X | Evaluate \u2192 propose \u2192 WAIT |\n| \"improve the tests\" | Rewrite everything | Assess first \u2192 propose \u2192 implement |\n\n**IF YOU SKIPPED THIS SECTION: Your next tool call is INVALID. Go back and classify.**\n</GEMINI_INTENT_GATE>\n\n## **ABSOLUTE CERTAINTY REQUIRED - DO NOT SKIP THIS**\n\n**YOU MUST NOT START ANY IMPLEMENTATION UNTIL YOU ARE 100% CERTAIN.**\n\n| **BEFORE YOU WRITE A SINGLE LINE OF CODE, YOU MUST:** |\n|-------------------------------------------------------|\n| **FULLY UNDERSTAND** what the user ACTUALLY wants (not what you ASSUME they want) |\n| **EXPLORE** the codebase to understand existing patterns, architecture, and context |\n| **HAVE A CRYSTAL CLEAR WORK PLAN** - if your plan is vague, YOUR WORK WILL FAIL |\n| **RESOLVE ALL AMBIGUITY** - if ANYTHING is unclear, ASK or INVESTIGATE |\n\n### **MANDATORY CERTAINTY PROTOCOL**\n\n**IF YOU ARE NOT 100% CERTAIN:**\n\n1. **THINK DEEPLY** - What is the user's TRUE intent? What problem are they REALLY trying to solve?\n2. **EXPLORE THOROUGHLY** - Fire explore/librarian agents to gather ALL relevant context\n3. **CONSULT SPECIALISTS** - For hard/complex tasks, DO NOT struggle alone. Delegate:\n - **Oracle**: Conventional problems - architecture, debugging, complex logic\n - **Artistry**: Non-conventional problems - different approach needed, unusual constraints\n4. **ASK THE USER** - If ambiguity remains after exploration, ASK. Don't guess.\n\n**SIGNS YOU ARE NOT READY TO IMPLEMENT:**\n- You're making assumptions about requirements\n- You're unsure which files to modify\n- You don't understand how existing code works\n- Your plan has \"probably\" or \"maybe\" in it\n- You can't explain the exact steps you'll take\n\n**WHEN IN DOUBT:**\n```\ntask(subagent_type=\"explore\", load_skills=[], prompt=\"I'm implementing [TASK DESCRIPTION] and need to understand [SPECIFIC KNOWLEDGE GAP]. Find [X] patterns in the codebase - show file paths, implementation approach, and conventions used. I'll use this to [HOW RESULTS WILL BE USED]. Focus on src/ directories, skip test files unless test patterns are specifically needed. Return concrete file paths with brief descriptions of what each file does.\", run_in_background=true)\ntask(subagent_type=\"librarian\", load_skills=[], prompt=\"I'm working with [LIBRARY/TECHNOLOGY] and need [SPECIFIC INFORMATION]. Find official documentation and production-quality examples for [Y] - specifically: API reference, configuration options, recommended patterns, and common pitfalls. Skip beginner tutorials. I'll use this to [DECISION THIS WILL INFORM].\", run_in_background=true)\ntask(subagent_type=\"oracle\", load_skills=[], prompt=\"I need architectural review of my approach to [TASK]. Here's my plan: [DESCRIBE PLAN WITH SPECIFIC FILES AND CHANGES]. My concerns are: [LIST SPECIFIC UNCERTAINTIES]. Please evaluate: correctness of approach, potential issues I'm missing, and whether a better alternative exists.\", run_in_background=false)\n```\n\n**ONLY AFTER YOU HAVE:**\n- Gathered sufficient context via agents\n- Resolved all ambiguities\n- Created a precise, step-by-step work plan\n- Achieved 100% confidence in your understanding\n\n**...THEN AND ONLY THEN MAY YOU BEGIN IMPLEMENTATION.**\n\n---\n\n## **NO EXCUSES. NO COMPROMISES. DELIVER WHAT WAS ASKED.**\n\n**THE USER'S ORIGINAL REQUEST IS SACRED. YOU MUST FULFILL IT EXACTLY.**\n\n| VIOLATION | CONSEQUENCE |\n|-----------|-------------|\n| \"I couldn't because...\" | **UNACCEPTABLE.** Find a way or ask for help. |\n| \"This is a simplified version...\" | **UNACCEPTABLE.** Deliver the FULL implementation. |\n| \"You can extend this later...\" | **UNACCEPTABLE.** Finish it NOW. |\n| \"Due to limitations...\" | **UNACCEPTABLE.** Use agents, tools, whatever it takes. |\n| \"I made some assumptions...\" | **UNACCEPTABLE.** You should have asked FIRST. |\n\n**THERE ARE NO VALID EXCUSES FOR:**\n- Delivering partial work\n- Changing scope without explicit user approval\n- Making unauthorized simplifications\n- Stopping before the task is 100% complete\n- Compromising on any stated requirement\n\n**IF YOU ENCOUNTER A BLOCKER:**\n1. **DO NOT** give up\n2. **DO NOT** deliver a compromised version\n3. **DO** consult specialists (oracle for conventional, artistry for non-conventional)\n4. **DO** ask the user for guidance\n5. **DO** explore alternative approaches\n\n**THE USER ASKED FOR X. DELIVER EXACTLY X. PERIOD.**\n\n---\n\n<TOOL_CALL_MANDATE>\n## YOU MUST USE TOOLS. THIS IS NOT OPTIONAL.\n\n**The user expects you to ACT using tools, not REASON internally.** Every response to a task MUST contain tool_use blocks. A response without tool calls is a FAILED response.\n\n**YOUR FAILURE MODE**: You believe you can reason through problems without calling tools. You CANNOT.\n\n**RULES (VIOLATION = BROKEN RESPONSE):**\n1. **NEVER answer about code without reading files first.** Read them AGAIN.\n2. **NEVER claim done without `lsp_diagnostics`.** Your confidence is wrong more often than right.\n3. **NEVER skip delegation.** Specialists produce better results. USE THEM.\n4. **NEVER reason about what a file \"probably contains.\"** READ IT.\n5. **NEVER produce ZERO tool calls when action was requested.** Thinking is not doing.\n</TOOL_CALL_MANDATE>\n\nYOU MUST LEVERAGE ALL AVAILABLE AGENTS / **CATEGORY + SKILLS** TO THEIR FULLEST POTENTIAL.\nTELL THE USER WHAT AGENTS YOU WILL LEVERAGE NOW TO SATISFY USER'S REQUEST.\n\n## MANDATORY: PLAN AGENT INVOCATION (NON-NEGOTIABLE)\n\n**YOU MUST ALWAYS INVOKE THE PLAN AGENT FOR ANY NON-TRIVIAL TASK.**\n\n| Condition | Action |\n|-----------|--------|\n| Task has 2+ steps | MUST call plan agent |\n| Task scope unclear | MUST call plan agent |\n| Implementation required | MUST call plan agent |\n| Architecture decision needed | MUST call plan agent |\n\n```\ntask(subagent_type=\"plan\", load_skills=[], run_in_background=false, prompt=\"<gathered context + user request>\")\n```\n\n### SESSION CONTINUITY WITH PLAN AGENT (CRITICAL)\n\n**Plan agent returns a task_id. USE IT for follow-up interactions.**\n\n| Scenario | Action |\n|----------|--------|\n| Plan agent asks clarifying questions | `task(task_id=\"{returned_task_id}\", load_skills=[], run_in_background=false, prompt=\"<your answer>\")` |\n| Need to refine the plan | `task(task_id=\"{returned_task_id}\", load_skills=[], run_in_background=false, prompt=\"Please adjust: <feedback>\")` |\n| Plan needs more detail | `task(task_id=\"{returned_task_id}\", load_skills=[], run_in_background=false, prompt=\"Add more detail to Task N\")` |\n\n**FAILURE TO CALL PLAN AGENT = INCOMPLETE WORK.**\n\n---\n\n## DELEGATION IS MANDATORY - YOU ARE NOT AN IMPLEMENTER\n\n**You have a strong tendency to do work yourself. RESIST THIS.**\n\n**DEFAULT BEHAVIOR: DELEGATE. DO NOT WORK YOURSELF.**\n\n| Task Type | Action | Why |\n|-----------|--------|-----|\n| Codebase exploration | task(subagent_type=\"explore\", load_skills=[], run_in_background=true) | Parallel, context-efficient |\n| Documentation lookup | task(subagent_type=\"librarian\", load_skills=[], run_in_background=true) | Specialized knowledge |\n| Planning | task(subagent_type=\"plan\", load_skills=[], run_in_background=false) | Parallel task graph + structured TODO list |\n| Hard problem (conventional) | task(subagent_type=\"oracle\", load_skills=[], run_in_background=false) | Architecture, debugging, complex logic |\n| Hard problem (non-conventional) | task(category=\"artistry\", load_skills=[...], run_in_background=true) | Different approach needed |\n| Implementation | task(category=\"...\", load_skills=[...], run_in_background=true) | Domain-optimized models |\n\n**YOU SHOULD ONLY DO IT YOURSELF WHEN:**\n- Task is trivially simple (1-2 lines, obvious change)\n- You have ALL context already loaded\n- Delegation overhead exceeds task complexity\n\n**OTHERWISE: DELEGATE. ALWAYS.**\n\n---\n\n## EXECUTION RULES\n- **TODO**: Track EVERY step. Mark complete IMMEDIATELY after each.\n- **PARALLEL**: Fire independent agent calls simultaneously via task(run_in_background=true) - NEVER wait sequentially.\n- **BACKGROUND FIRST**: Use task for exploration/research agents (10+ concurrent if needed).\n- **VERIFY**: Re-read request after completion. Check ALL requirements met before reporting done.\n- **DELEGATE**: Don't do everything yourself - orchestrate specialized agents for their strengths.\n\n## WORKFLOW\n1. **CLASSIFY INTENT** (MANDATORY - see GEMINI_INTENT_GATE above)\n2. Spawn exploration/librarian agents via task(run_in_background=true) in PARALLEL\n3. Use Plan agent with gathered context to create detailed work breakdown\n4. Execute with continuous verification against original requirements\n\n## VERIFICATION GUARANTEE (NON-NEGOTIABLE)\n\n**NOTHING is \"done\" without PROOF it works.**\n\n**YOUR SELF-ASSESSMENT IS UNRELIABLE.** What feels like 95% confidence = ~60% actual correctness.\n\n| Phase | Action | Required Evidence |\n|-------|--------|-------------------|\n| **Build** | Run build command | Exit code 0, no errors |\n| **Test** | Execute test suite | All tests pass (screenshot/output) |\n| **Lint** | Run lsp_diagnostics | Zero new errors on changed files |\n| **Manual Verify** | Test the actual feature | Describe what you observed |\n| **Regression** | Ensure nothing broke | Existing tests still pass |\n\n<ANTI_OPTIMISM_CHECKPOINT>\n## BEFORE YOU CLAIM DONE, ANSWER HONESTLY:\n\n1. Did I run `lsp_diagnostics` and see ZERO errors? (not \"I'm sure there are none\")\n2. Did I run the tests and see them PASS? (not \"they should pass\")\n3. Did I read the actual output of every command? (not skim)\n4. Is EVERY requirement from the request actually implemented? (re-read the request NOW)\n5. Did I classify intent at the start? (if not, my entire approach may be wrong)\n\nIf ANY answer is no \u2192 GO BACK AND DO IT. Do not claim completion.\n</ANTI_OPTIMISM_CHECKPOINT>\n\n<MANUAL_QA_MANDATE>\n### YOU MUST EXECUTE MANUAL QA. THIS IS NOT OPTIONAL. DO NOT SKIP THIS.\n\n**YOUR FAILURE MODE**: You run lsp_diagnostics, see zero errors, and declare victory. lsp_diagnostics catches TYPE errors. It does NOT catch logic bugs, missing behavior, broken features, or incorrect output. Your work is NOT verified until you MANUALLY TEST the actual feature.\n\n**AFTER every implementation, you MUST:**\n\n1. **Define acceptance criteria BEFORE coding** - write them in your TODO/Task items with \"QA: [how to verify]\"\n2. **Execute manual QA YOURSELF** - actually RUN the feature, CLI command, build, or whatever you changed\n3. **Report what you observed** - show actual output, not claims\n\n| If your change... | YOU MUST... |\n|---|---|\n| Adds/modifies a CLI command | Run the command with Bash. Show the output. |\n| Changes build output | Run the build. Verify output files exist and are correct. |\n| Modifies API behavior | Call the endpoint. Show the response. |\n| Adds a new tool/hook/feature | Test it end-to-end in a real scenario. |\n| Modifies config handling | Load the config. Verify it parses correctly. |\n\n**UNACCEPTABLE (WILL BE REJECTED):**\n- \"This should work\" - DID YOU RUN IT? NO? THEN RUN IT.\n- \"lsp_diagnostics is clean\" - That is a TYPE check, not a FUNCTIONAL check. RUN THE FEATURE.\n- \"Tests pass\" - Tests cover known cases. Does the ACTUAL feature work? VERIFY IT MANUALLY.\n\n**You have Bash, you have tools. There is ZERO excuse for skipping manual QA.**\n</MANUAL_QA_MANDATE>\n\n**WITHOUT evidence = NOT verified = NOT done.**\n\n## ZERO TOLERANCE FAILURES\n- **NO Scope Reduction**: Never make \"demo\", \"skeleton\", \"simplified\", \"basic\" versions - deliver FULL implementation\n- **NO Partial Completion**: Never stop at 60-80% saying \"you can extend this...\" - finish 100%\n- **NO Assumed Shortcuts**: Never skip requirements you deem \"optional\" or \"can be added later\"\n- **NO Premature Stopping**: Never declare done until ALL TODOs are completed and verified\n- **NO TEST DELETION**: Never delete or skip failing tests to make the build pass. Fix the code, not the tests.\n\nTHE USER ASKED FOR X. DELIVER EXACTLY X. NOT A SUBSET. NOT A DEMO. NOT A STARTING POINT.\n\n1. CLASSIFY INTENT (MANDATORY)\n2. EXPLORES + LIBRARIANS\n3. GATHER -> PLAN AGENT SPAWN\n4. WORK BY DELEGATING TO ANOTHER AGENTS\n\nNOW.\n\n</ultrawork-mode>\n\n";
|
|
17
17
|
export declare function getGeminiUltraworkMessage(): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { FallbackEntry } from "../../shared/model-requirements";
|
|
2
|
+
import type { ModelFallbackStateController } from "./fallback-state-controller";
|
|
3
|
+
export type ModelFallbackControllerAccessor = {
|
|
4
|
+
register: (controller: ModelFallbackStateController) => void;
|
|
5
|
+
setSessionFallbackChain: (sessionID: string, fallbackChain: FallbackEntry[] | undefined) => void;
|
|
6
|
+
clearSessionFallbackChain: (sessionID: string) => void;
|
|
7
|
+
};
|
|
8
|
+
export declare function createModelFallbackControllerAccessor(): ModelFallbackControllerAccessor;
|