oh-my-opencode-lite 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +365 -0
  3. package/dist/agents/deep.d.ts +2 -0
  4. package/dist/agents/designer.d.ts +2 -0
  5. package/dist/agents/explorer.d.ts +2 -0
  6. package/dist/agents/index.d.ts +8 -0
  7. package/dist/agents/librarian.d.ts +2 -0
  8. package/dist/agents/oracle.d.ts +2 -0
  9. package/dist/agents/orchestrator.d.ts +15 -0
  10. package/dist/agents/prompt-utils.d.ts +10 -0
  11. package/dist/agents/quick.d.ts +2 -0
  12. package/dist/background/background-manager.d.ts +196 -0
  13. package/dist/background/index.d.ts +2 -0
  14. package/dist/background/tmux-session-manager.d.ts +63 -0
  15. package/dist/cli/config-io.d.ts +22 -0
  16. package/dist/cli/config-manager.d.ts +4 -0
  17. package/dist/cli/custom-skills.d.ts +48 -0
  18. package/dist/cli/index.d.ts +2 -0
  19. package/dist/cli/index.js +1178 -0
  20. package/dist/cli/install.d.ts +3 -0
  21. package/dist/cli/model-key-normalization.d.ts +1 -0
  22. package/dist/cli/paths.d.ts +21 -0
  23. package/dist/cli/providers.d.ts +120 -0
  24. package/dist/cli/skill-manifest.d.ts +32 -0
  25. package/dist/cli/skills.d.ts +26 -0
  26. package/dist/cli/system.d.ts +6 -0
  27. package/dist/cli/types.d.ts +38 -0
  28. package/dist/config/constants.d.ts +19 -0
  29. package/dist/config/index.d.ts +5 -0
  30. package/dist/config/loader.d.ts +33 -0
  31. package/dist/config/schema.d.ts +313 -0
  32. package/dist/config/utils.d.ts +10 -0
  33. package/dist/delegation/delegation-manager.d.ts +25 -0
  34. package/dist/delegation/index.d.ts +4 -0
  35. package/dist/delegation/paths.d.ts +15 -0
  36. package/dist/delegation/project-id.d.ts +1 -0
  37. package/dist/delegation/types.d.ts +39 -0
  38. package/dist/hooks/auto-update-checker/cache.d.ts +6 -0
  39. package/dist/hooks/auto-update-checker/checker.d.ts +28 -0
  40. package/dist/hooks/auto-update-checker/constants.d.ts +11 -0
  41. package/dist/hooks/auto-update-checker/index.d.ts +17 -0
  42. package/dist/hooks/auto-update-checker/types.d.ts +23 -0
  43. package/dist/hooks/chat-headers.d.ts +16 -0
  44. package/dist/hooks/clarification-gate/index.d.ts +30 -0
  45. package/dist/hooks/delegate-task-retry/guidance.d.ts +2 -0
  46. package/dist/hooks/delegate-task-retry/hook.d.ts +8 -0
  47. package/dist/hooks/delegate-task-retry/index.d.ts +4 -0
  48. package/dist/hooks/delegate-task-retry/patterns.d.ts +11 -0
  49. package/dist/hooks/foreground-fallback/index.d.ts +72 -0
  50. package/dist/hooks/index.d.ts +11 -0
  51. package/dist/hooks/json-error-recovery/hook.d.ts +18 -0
  52. package/dist/hooks/json-error-recovery/index.d.ts +1 -0
  53. package/dist/hooks/phase-reminder/index.d.ts +26 -0
  54. package/dist/hooks/post-read-nudge/index.d.ts +18 -0
  55. package/dist/hooks/skill-sync.d.ts +10 -0
  56. package/dist/hooks/thoth-mem/index.d.ts +46 -0
  57. package/dist/hooks/thoth-mem/protocol.d.ts +6 -0
  58. package/dist/index.d.ts +5 -0
  59. package/dist/index.js +36210 -0
  60. package/dist/mcp/context7.d.ts +6 -0
  61. package/dist/mcp/grep-app.d.ts +6 -0
  62. package/dist/mcp/index.d.ts +7 -0
  63. package/dist/mcp/thoth.d.ts +3 -0
  64. package/dist/mcp/types.d.ts +12 -0
  65. package/dist/mcp/websearch.d.ts +6 -0
  66. package/dist/thoth/client.d.ts +14 -0
  67. package/dist/thoth/index.d.ts +2 -0
  68. package/dist/tools/ast-grep/cli.d.ts +15 -0
  69. package/dist/tools/ast-grep/constants.d.ts +25 -0
  70. package/dist/tools/ast-grep/downloader.d.ts +5 -0
  71. package/dist/tools/ast-grep/index.d.ts +10 -0
  72. package/dist/tools/ast-grep/tools.d.ts +3 -0
  73. package/dist/tools/ast-grep/types.d.ts +30 -0
  74. package/dist/tools/ast-grep/utils.d.ts +4 -0
  75. package/dist/tools/background.d.ts +13 -0
  76. package/dist/tools/index.d.ts +3 -0
  77. package/dist/tools/lsp/client.d.ts +42 -0
  78. package/dist/tools/lsp/config-store.d.ts +29 -0
  79. package/dist/tools/lsp/config.d.ts +4 -0
  80. package/dist/tools/lsp/constants.d.ts +24 -0
  81. package/dist/tools/lsp/index.d.ts +4 -0
  82. package/dist/tools/lsp/tools.d.ts +5 -0
  83. package/dist/tools/lsp/types.d.ts +35 -0
  84. package/dist/tools/lsp/utils.d.ts +34 -0
  85. package/dist/utils/agent-variant.d.ts +47 -0
  86. package/dist/utils/env.d.ts +1 -0
  87. package/dist/utils/index.d.ts +7 -0
  88. package/dist/utils/internal-initiator.d.ts +6 -0
  89. package/dist/utils/logger.d.ts +1 -0
  90. package/dist/utils/polling.d.ts +21 -0
  91. package/dist/utils/tmux.d.ts +32 -0
  92. package/dist/utils/zip-extractor.d.ts +1 -0
  93. package/oh-my-opencode-lite.schema.json +556 -0
  94. package/package.json +74 -0
  95. package/src/skills/_shared/openspec-convention.md +92 -0
  96. package/src/skills/_shared/persistence-contract.md +78 -0
  97. package/src/skills/_shared/thoth-mem-convention.md +80 -0
  98. package/src/skills/brainstorming/SKILL.md +120 -0
  99. package/src/skills/cartography/README.md +57 -0
  100. package/src/skills/cartography/SKILL.md +160 -0
  101. package/src/skills/cartography/scripts/cartographer.py +460 -0
  102. package/src/skills/cartography/scripts/test_cartographer.py +87 -0
  103. package/src/skills/executing-plans/SKILL.md +211 -0
  104. package/src/skills/plan-reviewer/SKILL.md +100 -0
  105. package/src/skills/sdd-apply/SKILL.md +101 -0
  106. package/src/skills/sdd-archive/SKILL.md +94 -0
  107. package/src/skills/sdd-design/SKILL.md +104 -0
  108. package/src/skills/sdd-propose/SKILL.md +99 -0
  109. package/src/skills/sdd-spec/SKILL.md +105 -0
  110. package/src/skills/sdd-tasks/SKILL.md +116 -0
  111. package/src/skills/sdd-verify/SKILL.md +102 -0
@@ -0,0 +1,3 @@
1
+ import type { InstallArgs, InstallConfig } from './types';
2
+ export declare function createInstallConfig(args: InstallArgs): InstallConfig;
3
+ export declare function install(args: InstallArgs): Promise<number>;
@@ -0,0 +1 @@
1
+ export declare function buildModelKeyAliases(input: string): string[];
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Get the OpenCode plugin config directory.
3
+ *
4
+ * Resolution order:
5
+ * 1. OPENCODE_CONFIG_DIR (custom OpenCode directory)
6
+ * 2. XDG_CONFIG_HOME/opencode
7
+ * 3. ~/.config/opencode
8
+ */
9
+ export declare function getConfigDir(): string;
10
+ export declare function getOpenCodeConfigPaths(): string[];
11
+ export declare function getConfigJson(): string;
12
+ export declare function getConfigJsonc(): string;
13
+ export declare function getLiteConfig(): string;
14
+ export declare function getLiteConfigJsonc(): string;
15
+ export declare function getExistingLiteConfigPath(): string;
16
+ export declare function getExistingConfigPath(): string;
17
+ export declare function ensureConfigDir(): void;
18
+ /**
19
+ * Ensure the directory for OpenCode's main config file exists.
20
+ */
21
+ export declare function ensureOpenCodeConfigDir(): void;
@@ -0,0 +1,120 @@
1
+ import type { InstallConfig } from './types';
2
+ export declare const MODEL_MAPPINGS: {
3
+ readonly openai: {
4
+ readonly orchestrator: {
5
+ readonly model: "openai/gpt-5.4";
6
+ };
7
+ readonly oracle: {
8
+ readonly model: "openai/gpt-5.4";
9
+ readonly variant: "high";
10
+ };
11
+ readonly librarian: {
12
+ readonly model: "openai/gpt-5.4-mini";
13
+ readonly variant: "low";
14
+ };
15
+ readonly explorer: {
16
+ readonly model: "openai/gpt-5.4-mini";
17
+ readonly variant: "low";
18
+ };
19
+ readonly designer: {
20
+ readonly model: "openai/gpt-5.4-mini";
21
+ readonly variant: "medium";
22
+ };
23
+ readonly quick: {
24
+ readonly model: "openai/gpt-5.4-mini";
25
+ readonly variant: "low";
26
+ };
27
+ readonly deep: {
28
+ readonly model: "openai/gpt-5.4";
29
+ readonly variant: "high";
30
+ };
31
+ };
32
+ readonly kimi: {
33
+ readonly orchestrator: {
34
+ readonly model: "kimi-for-coding/k2p5";
35
+ };
36
+ readonly oracle: {
37
+ readonly model: "kimi-for-coding/k2p5";
38
+ readonly variant: "high";
39
+ };
40
+ readonly librarian: {
41
+ readonly model: "kimi-for-coding/k2p5";
42
+ readonly variant: "low";
43
+ };
44
+ readonly explorer: {
45
+ readonly model: "kimi-for-coding/k2p5";
46
+ readonly variant: "low";
47
+ };
48
+ readonly designer: {
49
+ readonly model: "kimi-for-coding/k2p5";
50
+ readonly variant: "medium";
51
+ };
52
+ readonly quick: {
53
+ readonly model: "kimi-for-coding/k2p5";
54
+ readonly variant: "low";
55
+ };
56
+ readonly deep: {
57
+ readonly model: "kimi-for-coding/k2p5";
58
+ readonly variant: "high";
59
+ };
60
+ };
61
+ readonly copilot: {
62
+ readonly orchestrator: {
63
+ readonly model: "github-copilot/claude-opus-4.6";
64
+ };
65
+ readonly oracle: {
66
+ readonly model: "github-copilot/claude-opus-4.6";
67
+ readonly variant: "high";
68
+ };
69
+ readonly librarian: {
70
+ readonly model: "github-copilot/grok-code-fast-1";
71
+ readonly variant: "low";
72
+ };
73
+ readonly explorer: {
74
+ readonly model: "github-copilot/grok-code-fast-1";
75
+ readonly variant: "low";
76
+ };
77
+ readonly designer: {
78
+ readonly model: "github-copilot/gemini-3.1-pro-preview";
79
+ readonly variant: "medium";
80
+ };
81
+ readonly quick: {
82
+ readonly model: "github-copilot/claude-sonnet-4.6";
83
+ readonly variant: "low";
84
+ };
85
+ readonly deep: {
86
+ readonly model: "github-copilot/claude-opus-4.6";
87
+ readonly variant: "high";
88
+ };
89
+ };
90
+ readonly 'zai-plan': {
91
+ readonly orchestrator: {
92
+ readonly model: "zai-coding-plan/glm-5";
93
+ };
94
+ readonly oracle: {
95
+ readonly model: "zai-coding-plan/glm-5";
96
+ readonly variant: "high";
97
+ };
98
+ readonly librarian: {
99
+ readonly model: "zai-coding-plan/glm-5";
100
+ readonly variant: "low";
101
+ };
102
+ readonly explorer: {
103
+ readonly model: "zai-coding-plan/glm-5";
104
+ readonly variant: "low";
105
+ };
106
+ readonly designer: {
107
+ readonly model: "zai-coding-plan/glm-5";
108
+ readonly variant: "medium";
109
+ };
110
+ readonly quick: {
111
+ readonly model: "zai-coding-plan/glm-5";
112
+ readonly variant: "low";
113
+ };
114
+ readonly deep: {
115
+ readonly model: "zai-coding-plan/glm-5";
116
+ readonly variant: "high";
117
+ };
118
+ };
119
+ };
120
+ export declare function generateLiteConfig(installConfig: InstallConfig): Record<string, unknown>;
@@ -0,0 +1,32 @@
1
+ import type { CustomSkill } from './custom-skills';
2
+ export interface SkillManifestEntry {
3
+ hash: string;
4
+ installedAt: string;
5
+ }
6
+ export interface SkillManifest {
7
+ pluginVersion: string;
8
+ skills: Record<string, SkillManifestEntry>;
9
+ sharedHash: string;
10
+ }
11
+ export type SkillUpdateReason = 'manifest-missing' | 'version-change' | 'shared-hash-mismatch' | 'new-skill' | 'hash-mismatch' | 'missing-install';
12
+ export interface SkillUpdateEntry {
13
+ skill: CustomSkill;
14
+ sourceHash: string;
15
+ targetPath: string;
16
+ reasons: SkillUpdateReason[];
17
+ }
18
+ export interface SkillUpdateCheck {
19
+ pluginVersion: string;
20
+ sharedHash: string;
21
+ manifest: SkillManifest | null;
22
+ versionChanged: boolean;
23
+ sharedChanged: boolean;
24
+ needsUpdate: boolean;
25
+ skillsNeedingUpdate: SkillUpdateEntry[];
26
+ removedSkills: string[];
27
+ }
28
+ export declare function readManifest(): SkillManifest | null;
29
+ export declare function writeManifest(manifest: SkillManifest): void;
30
+ export declare function computeSkillHash(skillDirPath: string): string;
31
+ export declare function findRemovedSkills(manifest: SkillManifest): string[];
32
+ export declare function checkSkillsNeedUpdate(packageRoot: string): SkillUpdateCheck;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * A recommended skill to install via `npx skills add`.
3
+ */
4
+ export interface RecommendedSkill {
5
+ /** Human-readable name for prompts */
6
+ name: string;
7
+ /** GitHub repo URL for `npx skills add` */
8
+ repo: string;
9
+ /** Skill name within the repo (--skill flag) */
10
+ skillName: string;
11
+ /** Description shown to user during install */
12
+ description: string;
13
+ /** Optional commands to run after the skill is added */
14
+ postInstallCommands?: string[];
15
+ }
16
+ /**
17
+ * List of recommended skills.
18
+ * Add new skills here to include them in the installation flow.
19
+ */
20
+ export declare const RECOMMENDED_SKILLS: RecommendedSkill[];
21
+ /**
22
+ * Install a skill using `npx skills add`.
23
+ * @param skill - The skill to install
24
+ * @returns True if installation succeeded, false otherwise
25
+ */
26
+ export declare function installSkill(skill: RecommendedSkill): boolean;
@@ -0,0 +1,6 @@
1
+ export declare function resolveOpenCodePath(): string;
2
+ export declare function isOpenCodeInstalled(): Promise<boolean>;
3
+ export declare function isTmuxInstalled(): Promise<boolean>;
4
+ export declare function getOpenCodeVersion(): Promise<string | null>;
5
+ export declare function getOpenCodePath(): string | null;
6
+ export declare function fetchLatestVersion(packageName: string): Promise<string | null>;
@@ -0,0 +1,38 @@
1
+ export type BooleanArg = 'yes' | 'no';
2
+ export interface InstallArgs {
3
+ tui: boolean;
4
+ tmux?: BooleanArg;
5
+ skills?: BooleanArg;
6
+ dryRun?: boolean;
7
+ reset?: boolean;
8
+ }
9
+ export interface OpenCodeConfig {
10
+ plugin?: string[];
11
+ provider?: Record<string, unknown>;
12
+ agent?: Record<string, unknown>;
13
+ [key: string]: unknown;
14
+ }
15
+ export interface InstallConfig {
16
+ hasTmux: boolean;
17
+ installSkills: boolean;
18
+ installCustomSkills: boolean;
19
+ dryRun?: boolean;
20
+ reset: boolean;
21
+ }
22
+ export interface ConfigMergeResult {
23
+ success: boolean;
24
+ configPath: string;
25
+ error?: string;
26
+ }
27
+ export interface DetectedConfig {
28
+ isInstalled: boolean;
29
+ hasKimi: boolean;
30
+ hasOpenAI: boolean;
31
+ hasAnthropic?: boolean;
32
+ hasCopilot?: boolean;
33
+ hasZaiPlan?: boolean;
34
+ hasAntigravity: boolean;
35
+ hasChutes?: boolean;
36
+ hasOpencodeZen: boolean;
37
+ hasTmux: boolean;
38
+ }
@@ -0,0 +1,19 @@
1
+ export declare const AGENT_ALIASES: Record<string, string>;
2
+ type BuiltinAgentName = 'orchestrator' | 'explorer' | 'librarian' | 'oracle' | 'designer' | 'quick' | 'deep';
3
+ export type AgentName = BuiltinAgentName | (string & {});
4
+ export declare const SUBAGENT_NAMES: readonly string[];
5
+ export declare const ORCHESTRATOR_NAME: "orchestrator";
6
+ export declare const ALL_AGENT_NAMES: readonly BuiltinAgentName[];
7
+ export declare const SUBAGENT_DELEGATION_RULES: Record<AgentName, readonly string[]>;
8
+ export declare const DEFAULT_MODELS: Record<AgentName, string | undefined>;
9
+ export declare const POLL_INTERVAL_MS = 500;
10
+ export declare const POLL_INTERVAL_SLOW_MS = 1000;
11
+ export declare const POLL_INTERVAL_BACKGROUND_MS = 2000;
12
+ export declare const DEFAULT_TIMEOUT_MS: number;
13
+ export declare const MAX_POLL_TIME_MS: number;
14
+ export declare const BACKGROUND_TASK_TIMEOUT_MS = 300000;
15
+ export declare const FALLBACK_FAILOVER_TIMEOUT_MS = 15000;
16
+ export declare const DEFAULT_DELEGATION_TIMEOUT = 900000;
17
+ export declare const DEFAULT_THOTH_COMMAND: string[];
18
+ export declare const STABLE_POLLS_THRESHOLD = 3;
19
+ export {};
@@ -0,0 +1,5 @@
1
+ export * from './constants';
2
+ export { loadAgentPrompt, loadPluginConfig } from './loader';
3
+ export type { DelegationConfig, ThothConfig } from './schema';
4
+ export * from './schema';
5
+ export { getAgentOverride } from './utils';
@@ -0,0 +1,33 @@
1
+ import { type PluginConfig } from './schema';
2
+ /**
3
+ * Load plugin configuration from user and project config files, merging them appropriately.
4
+ *
5
+ * Configuration is loaded from two locations:
6
+ * 1. User config: $OPENCODE_CONFIG_DIR/oh-my-opencode-lite.jsonc or .json,
7
+ * or ~/.config/opencode/oh-my-opencode-lite.jsonc or .json (or $XDG_CONFIG_HOME)
8
+ * 2. Project config: <directory>/.opencode/oh-my-opencode-lite.jsonc or .json
9
+ *
10
+ * JSONC format is preferred over JSON (allows comments and trailing commas).
11
+ * Project config takes precedence over user config. Nested objects (agents,
12
+ * tmux, background, fallback, thoth, delegation, clarificationGate,
13
+ * artifactStore) are deep-merged, while top-level arrays are replaced entirely
14
+ * by project config.
15
+ *
16
+ * @param directory - Project directory to search for .opencode config
17
+ * @returns Merged plugin configuration (empty object if no configs found)
18
+ */
19
+ export declare function loadPluginConfig(directory: string): PluginConfig;
20
+ /**
21
+ * Load custom prompt for an agent from the prompts directory.
22
+ * Checks for {agent}.md (replaces default) and {agent}_append.md (appends to default).
23
+ * If preset is provided and safe for paths, it first checks {preset}/ subdirectory,
24
+ * then falls back to the root prompts directory.
25
+ *
26
+ * @param agentName - Name of the agent (e.g., "orchestrator", "explorer")
27
+ * @param preset - Optional preset name for preset-scoped prompt lookup
28
+ * @returns Object with prompt and/or appendPrompt if files exist
29
+ */
30
+ export declare function loadAgentPrompt(agentName: string, preset?: string): {
31
+ prompt?: string;
32
+ appendPrompt?: string;
33
+ };
@@ -0,0 +1,313 @@
1
+ import { z } from 'zod';
2
+ declare const FALLBACK_AGENT_NAMES: readonly ["orchestrator", "oracle", "designer", "explorer", "librarian", "quick", "deep"];
3
+ declare const MANUAL_AGENT_NAMES: readonly ["orchestrator", "oracle", "designer", "explorer", "librarian", "quick", "deep"];
4
+ export declare const ManualAgentPlanSchema: z.ZodObject<{
5
+ primary: z.ZodString;
6
+ fallback1: z.ZodString;
7
+ fallback2: z.ZodString;
8
+ fallback3: z.ZodString;
9
+ }, z.core.$strip>;
10
+ export declare const ManualPlanSchema: z.ZodObject<{
11
+ orchestrator: z.ZodObject<{
12
+ primary: z.ZodString;
13
+ fallback1: z.ZodString;
14
+ fallback2: z.ZodString;
15
+ fallback3: z.ZodString;
16
+ }, z.core.$strip>;
17
+ oracle: z.ZodObject<{
18
+ primary: z.ZodString;
19
+ fallback1: z.ZodString;
20
+ fallback2: z.ZodString;
21
+ fallback3: z.ZodString;
22
+ }, z.core.$strip>;
23
+ designer: z.ZodObject<{
24
+ primary: z.ZodString;
25
+ fallback1: z.ZodString;
26
+ fallback2: z.ZodString;
27
+ fallback3: z.ZodString;
28
+ }, z.core.$strip>;
29
+ explorer: z.ZodObject<{
30
+ primary: z.ZodString;
31
+ fallback1: z.ZodString;
32
+ fallback2: z.ZodString;
33
+ fallback3: z.ZodString;
34
+ }, z.core.$strip>;
35
+ librarian: z.ZodObject<{
36
+ primary: z.ZodString;
37
+ fallback1: z.ZodString;
38
+ fallback2: z.ZodString;
39
+ fallback3: z.ZodString;
40
+ }, z.core.$strip>;
41
+ quick: z.ZodObject<{
42
+ primary: z.ZodString;
43
+ fallback1: z.ZodString;
44
+ fallback2: z.ZodString;
45
+ fallback3: z.ZodString;
46
+ }, z.core.$strip>;
47
+ deep: z.ZodObject<{
48
+ primary: z.ZodString;
49
+ fallback1: z.ZodString;
50
+ fallback2: z.ZodString;
51
+ fallback3: z.ZodString;
52
+ }, z.core.$strip>;
53
+ }, z.core.$strict>;
54
+ export type ManualAgentName = (typeof MANUAL_AGENT_NAMES)[number];
55
+ export type ManualAgentPlan = z.infer<typeof ManualAgentPlanSchema>;
56
+ export type ManualPlan = z.infer<typeof ManualPlanSchema>;
57
+ export type FallbackAgentName = (typeof FALLBACK_AGENT_NAMES)[number];
58
+ export declare const AgentOverrideConfigSchema: z.ZodObject<{
59
+ model: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
60
+ id: z.ZodString;
61
+ variant: z.ZodOptional<z.ZodString>;
62
+ }, z.core.$strip>]>>]>>;
63
+ temperature: z.ZodOptional<z.ZodNumber>;
64
+ variant: z.ZodCatch<z.ZodOptional<z.ZodString>>;
65
+ }, z.core.$strip>;
66
+ export declare const TmuxLayoutSchema: z.ZodEnum<{
67
+ "main-vertical": "main-vertical";
68
+ "main-horizontal": "main-horizontal";
69
+ tiled: "tiled";
70
+ "even-horizontal": "even-horizontal";
71
+ "even-vertical": "even-vertical";
72
+ }>;
73
+ export type TmuxLayout = z.infer<typeof TmuxLayoutSchema>;
74
+ export declare const TmuxConfigSchema: z.ZodObject<{
75
+ enabled: z.ZodDefault<z.ZodBoolean>;
76
+ layout: z.ZodDefault<z.ZodEnum<{
77
+ "main-vertical": "main-vertical";
78
+ "main-horizontal": "main-horizontal";
79
+ tiled: "tiled";
80
+ "even-horizontal": "even-horizontal";
81
+ "even-vertical": "even-vertical";
82
+ }>>;
83
+ main_pane_size: z.ZodDefault<z.ZodNumber>;
84
+ }, z.core.$strip>;
85
+ export type TmuxConfig = z.infer<typeof TmuxConfigSchema>;
86
+ export type AgentOverrideConfig = z.infer<typeof AgentOverrideConfigSchema>;
87
+ /** Normalized model entry with optional per-model variant. */
88
+ export type ModelEntry = {
89
+ id: string;
90
+ variant?: string;
91
+ };
92
+ export declare const PresetSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
93
+ model: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
94
+ id: z.ZodString;
95
+ variant: z.ZodOptional<z.ZodString>;
96
+ }, z.core.$strip>]>>]>>;
97
+ temperature: z.ZodOptional<z.ZodNumber>;
98
+ variant: z.ZodCatch<z.ZodOptional<z.ZodString>>;
99
+ }, z.core.$strip>>;
100
+ export type Preset = z.infer<typeof PresetSchema>;
101
+ export declare const AgentNameSchema: z.ZodEnum<{
102
+ explorer: "explorer";
103
+ designer: "designer";
104
+ orchestrator: "orchestrator";
105
+ librarian: "librarian";
106
+ oracle: "oracle";
107
+ quick: "quick";
108
+ deep: "deep";
109
+ }>;
110
+ export declare const McpNameSchema: z.ZodEnum<{
111
+ websearch: "websearch";
112
+ context7: "context7";
113
+ grep_app: "grep_app";
114
+ thoth_mem: "thoth_mem";
115
+ }>;
116
+ export type McpName = string;
117
+ export declare const ThothConfigSchema: z.ZodObject<{
118
+ command: z.ZodOptional<z.ZodArray<z.ZodString>>;
119
+ data_dir: z.ZodOptional<z.ZodString>;
120
+ environment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
121
+ timeout: z.ZodOptional<z.ZodNumber>;
122
+ http_port: z.ZodOptional<z.ZodNumber>;
123
+ }, z.core.$strip>;
124
+ export type ThothConfig = z.infer<typeof ThothConfigSchema>;
125
+ export declare const DelegationConfigSchema: z.ZodObject<{
126
+ storage_dir: z.ZodOptional<z.ZodString>;
127
+ timeout: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
128
+ }, z.core.$strip>;
129
+ export type DelegationConfig = z.infer<typeof DelegationConfigSchema>;
130
+ export declare const ClarificationGateModeSchema: z.ZodEnum<{
131
+ off: "off";
132
+ "explicit-only": "explicit-only";
133
+ auto: "auto";
134
+ "auto-for-planning": "auto-for-planning";
135
+ }>;
136
+ export declare const ClarificationGateConfigSchema: z.ZodObject<{
137
+ mode: z.ZodDefault<z.ZodEnum<{
138
+ off: "off";
139
+ "explicit-only": "explicit-only";
140
+ auto: "auto";
141
+ "auto-for-planning": "auto-for-planning";
142
+ }>>;
143
+ min_scope_signals: z.ZodDefault<z.ZodNumber>;
144
+ hard_complex_signal_threshold: z.ZodDefault<z.ZodNumber>;
145
+ explicit_keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
146
+ planning_keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
147
+ }, z.core.$strip>;
148
+ export type ClarificationGateConfig = z.infer<typeof ClarificationGateConfigSchema>;
149
+ export declare const ArtifactStoreModeSchema: z.ZodEnum<{
150
+ "thoth-mem": "thoth-mem";
151
+ openspec: "openspec";
152
+ hybrid: "hybrid";
153
+ }>;
154
+ export declare const ArtifactStoreConfigSchema: z.ZodObject<{
155
+ mode: z.ZodDefault<z.ZodEnum<{
156
+ "thoth-mem": "thoth-mem";
157
+ openspec: "openspec";
158
+ hybrid: "hybrid";
159
+ }>>;
160
+ }, z.core.$strip>;
161
+ export type ArtifactStoreConfig = z.infer<typeof ArtifactStoreConfigSchema>;
162
+ export declare const BackgroundTaskConfigSchema: z.ZodObject<{
163
+ maxConcurrentStarts: z.ZodDefault<z.ZodNumber>;
164
+ timeoutMs: z.ZodDefault<z.ZodNumber>;
165
+ }, z.core.$strip>;
166
+ export type BackgroundTaskConfig = z.infer<typeof BackgroundTaskConfigSchema>;
167
+ export declare const FailoverConfigSchema: z.ZodObject<{
168
+ enabled: z.ZodDefault<z.ZodBoolean>;
169
+ timeoutMs: z.ZodDefault<z.ZodNumber>;
170
+ retryDelayMs: z.ZodDefault<z.ZodNumber>;
171
+ chains: z.ZodDefault<z.ZodObject<{
172
+ orchestrator: z.ZodOptional<z.ZodArray<z.ZodString>>;
173
+ oracle: z.ZodOptional<z.ZodArray<z.ZodString>>;
174
+ designer: z.ZodOptional<z.ZodArray<z.ZodString>>;
175
+ explorer: z.ZodOptional<z.ZodArray<z.ZodString>>;
176
+ librarian: z.ZodOptional<z.ZodArray<z.ZodString>>;
177
+ quick: z.ZodOptional<z.ZodArray<z.ZodString>>;
178
+ deep: z.ZodOptional<z.ZodArray<z.ZodString>>;
179
+ }, z.core.$catchall<z.ZodArray<z.ZodString>>>>;
180
+ }, z.core.$strip>;
181
+ export type FailoverConfig = z.infer<typeof FailoverConfigSchema>;
182
+ export declare const PluginConfigSchema: z.ZodObject<{
183
+ preset: z.ZodOptional<z.ZodString>;
184
+ setDefaultAgent: z.ZodOptional<z.ZodBoolean>;
185
+ scoringEngineVersion: z.ZodOptional<z.ZodEnum<{
186
+ v1: "v1";
187
+ "v2-shadow": "v2-shadow";
188
+ v2: "v2";
189
+ }>>;
190
+ balanceProviderUsage: z.ZodOptional<z.ZodBoolean>;
191
+ manualPlan: z.ZodOptional<z.ZodObject<{
192
+ orchestrator: z.ZodObject<{
193
+ primary: z.ZodString;
194
+ fallback1: z.ZodString;
195
+ fallback2: z.ZodString;
196
+ fallback3: z.ZodString;
197
+ }, z.core.$strip>;
198
+ oracle: z.ZodObject<{
199
+ primary: z.ZodString;
200
+ fallback1: z.ZodString;
201
+ fallback2: z.ZodString;
202
+ fallback3: z.ZodString;
203
+ }, z.core.$strip>;
204
+ designer: z.ZodObject<{
205
+ primary: z.ZodString;
206
+ fallback1: z.ZodString;
207
+ fallback2: z.ZodString;
208
+ fallback3: z.ZodString;
209
+ }, z.core.$strip>;
210
+ explorer: z.ZodObject<{
211
+ primary: z.ZodString;
212
+ fallback1: z.ZodString;
213
+ fallback2: z.ZodString;
214
+ fallback3: z.ZodString;
215
+ }, z.core.$strip>;
216
+ librarian: z.ZodObject<{
217
+ primary: z.ZodString;
218
+ fallback1: z.ZodString;
219
+ fallback2: z.ZodString;
220
+ fallback3: z.ZodString;
221
+ }, z.core.$strip>;
222
+ quick: z.ZodObject<{
223
+ primary: z.ZodString;
224
+ fallback1: z.ZodString;
225
+ fallback2: z.ZodString;
226
+ fallback3: z.ZodString;
227
+ }, z.core.$strip>;
228
+ deep: z.ZodObject<{
229
+ primary: z.ZodString;
230
+ fallback1: z.ZodString;
231
+ fallback2: z.ZodString;
232
+ fallback3: z.ZodString;
233
+ }, z.core.$strip>;
234
+ }, z.core.$strict>>;
235
+ presets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodObject<{
236
+ model: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
237
+ id: z.ZodString;
238
+ variant: z.ZodOptional<z.ZodString>;
239
+ }, z.core.$strip>]>>]>>;
240
+ temperature: z.ZodOptional<z.ZodNumber>;
241
+ variant: z.ZodCatch<z.ZodOptional<z.ZodString>>;
242
+ }, z.core.$strip>>>>;
243
+ agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
244
+ model: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
245
+ id: z.ZodString;
246
+ variant: z.ZodOptional<z.ZodString>;
247
+ }, z.core.$strip>]>>]>>;
248
+ temperature: z.ZodOptional<z.ZodNumber>;
249
+ variant: z.ZodCatch<z.ZodOptional<z.ZodString>>;
250
+ }, z.core.$strip>>>;
251
+ disabled_mcps: z.ZodOptional<z.ZodArray<z.ZodString>>;
252
+ tmux: z.ZodOptional<z.ZodObject<{
253
+ enabled: z.ZodDefault<z.ZodBoolean>;
254
+ layout: z.ZodDefault<z.ZodEnum<{
255
+ "main-vertical": "main-vertical";
256
+ "main-horizontal": "main-horizontal";
257
+ tiled: "tiled";
258
+ "even-horizontal": "even-horizontal";
259
+ "even-vertical": "even-vertical";
260
+ }>>;
261
+ main_pane_size: z.ZodDefault<z.ZodNumber>;
262
+ }, z.core.$strip>>;
263
+ background: z.ZodOptional<z.ZodObject<{
264
+ maxConcurrentStarts: z.ZodDefault<z.ZodNumber>;
265
+ timeoutMs: z.ZodDefault<z.ZodNumber>;
266
+ }, z.core.$strip>>;
267
+ fallback: z.ZodOptional<z.ZodObject<{
268
+ enabled: z.ZodDefault<z.ZodBoolean>;
269
+ timeoutMs: z.ZodDefault<z.ZodNumber>;
270
+ retryDelayMs: z.ZodDefault<z.ZodNumber>;
271
+ chains: z.ZodDefault<z.ZodObject<{
272
+ orchestrator: z.ZodOptional<z.ZodArray<z.ZodString>>;
273
+ oracle: z.ZodOptional<z.ZodArray<z.ZodString>>;
274
+ designer: z.ZodOptional<z.ZodArray<z.ZodString>>;
275
+ explorer: z.ZodOptional<z.ZodArray<z.ZodString>>;
276
+ librarian: z.ZodOptional<z.ZodArray<z.ZodString>>;
277
+ quick: z.ZodOptional<z.ZodArray<z.ZodString>>;
278
+ deep: z.ZodOptional<z.ZodArray<z.ZodString>>;
279
+ }, z.core.$catchall<z.ZodArray<z.ZodString>>>>;
280
+ }, z.core.$strip>>;
281
+ thoth: z.ZodOptional<z.ZodObject<{
282
+ command: z.ZodOptional<z.ZodArray<z.ZodString>>;
283
+ data_dir: z.ZodOptional<z.ZodString>;
284
+ environment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
285
+ timeout: z.ZodOptional<z.ZodNumber>;
286
+ http_port: z.ZodOptional<z.ZodNumber>;
287
+ }, z.core.$strip>>;
288
+ delegation: z.ZodOptional<z.ZodObject<{
289
+ storage_dir: z.ZodOptional<z.ZodString>;
290
+ timeout: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
291
+ }, z.core.$strip>>;
292
+ clarificationGate: z.ZodOptional<z.ZodObject<{
293
+ mode: z.ZodDefault<z.ZodEnum<{
294
+ off: "off";
295
+ "explicit-only": "explicit-only";
296
+ auto: "auto";
297
+ "auto-for-planning": "auto-for-planning";
298
+ }>>;
299
+ min_scope_signals: z.ZodDefault<z.ZodNumber>;
300
+ hard_complex_signal_threshold: z.ZodDefault<z.ZodNumber>;
301
+ explicit_keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
302
+ planning_keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
303
+ }, z.core.$strip>>;
304
+ artifactStore: z.ZodOptional<z.ZodObject<{
305
+ mode: z.ZodDefault<z.ZodEnum<{
306
+ "thoth-mem": "thoth-mem";
307
+ openspec: "openspec";
308
+ hybrid: "hybrid";
309
+ }>>;
310
+ }, z.core.$strip>>;
311
+ }, z.core.$strip>;
312
+ export type PluginConfig = z.infer<typeof PluginConfigSchema>;
313
+ export type { AgentName } from './constants';
@@ -0,0 +1,10 @@
1
+ import type { AgentOverrideConfig, PluginConfig } from './schema';
2
+ /**
3
+ * Get agent override config by name, supporting backward-compatible aliases.
4
+ * Checks both the current name and any legacy alias names.
5
+ *
6
+ * @param config - The plugin configuration
7
+ * @param name - The current agent name
8
+ * @returns The agent-specific override configuration if found
9
+ */
10
+ export declare function getAgentOverride(config: PluginConfig | undefined, name: string): AgentOverrideConfig | undefined;
@@ -0,0 +1,25 @@
1
+ import type { DelegationConfig } from '../config';
2
+ import { type DelegationListEntry, type DelegationRecord, type PersistedDelegationRecord } from './types';
3
+ export interface DelegationManagerOptions {
4
+ directory: string;
5
+ config?: DelegationConfig;
6
+ getActiveTaskIds?: (rootSessionId: string) => Iterable<string>;
7
+ }
8
+ export interface PersistDelegationInput {
9
+ rootSessionId: string;
10
+ record: DelegationRecord;
11
+ }
12
+ export declare class DelegationManager {
13
+ private readonly directory;
14
+ private readonly config?;
15
+ private readonly getActiveTaskIds?;
16
+ constructor(options: DelegationManagerOptions);
17
+ resolveProjectId(directory?: string): Promise<string | null>;
18
+ createTaskId(rootSessionId: string): Promise<string>;
19
+ persist(input: PersistDelegationInput): Promise<PersistedDelegationRecord | null>;
20
+ read(taskId: string, rootSessionId: string): Promise<PersistedDelegationRecord | null>;
21
+ list(rootSessionId: string): Promise<DelegationListEntry[]>;
22
+ listCompleted(rootSessionId: string): Promise<DelegationListEntry[]>;
23
+ summarizeForInjection(rootSessionId: string, limit?: number): Promise<string | null>;
24
+ private getReservedTaskIds;
25
+ }
@@ -0,0 +1,4 @@
1
+ export { DelegationManager, type DelegationManagerOptions, } from './delegation-manager';
2
+ export { resolvePaths, resolveStorageDir } from './paths';
3
+ export { getProjectId } from './project-id';
4
+ export * from './types';