oh-my-opencode 3.11.2 → 3.12.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.
- package/README.ja.md +18 -12
- package/README.ko.md +18 -12
- package/README.md +16 -16
- package/README.ru.md +12 -6
- package/README.zh-cn.md +18 -12
- package/dist/agents/atlas/default.d.ts +1 -1
- package/dist/agents/atlas/gemini.d.ts +1 -1
- package/dist/agents/atlas/gpt.d.ts +1 -1
- package/dist/agents/builtin-agents/general-agents.d.ts +1 -0
- package/dist/agents/dynamic-agent-prompt-builder.d.ts +2 -0
- package/dist/agents/env-context.d.ts +1 -1
- package/dist/agents/index.d.ts +1 -0
- package/dist/agents/metis.d.ts +1 -1
- package/dist/agents/prometheus/gemini.d.ts +1 -1
- package/dist/agents/prometheus/gpt.d.ts +1 -1
- package/dist/agents/prometheus/interview-mode.d.ts +1 -1
- package/dist/agents/prometheus/plan-generation.d.ts +1 -1
- package/dist/agents/prometheus/plan-template.d.ts +1 -1
- package/dist/agents/prometheus/system-prompt.d.ts +1 -1
- package/dist/agents/types.d.ts +1 -1
- package/dist/cli/config-manager/bun-install.d.ts +8 -1
- package/dist/cli/config-manager/plugin-name-with-version.d.ts +1 -1
- package/dist/cli/doctor/checks/tools-lsp.d.ts +4 -6
- package/dist/cli/doctor/types.d.ts +4 -8
- package/dist/cli/index.js +953 -731
- package/dist/cli/install-validators.d.ts +1 -0
- package/dist/cli/model-fallback-requirements.d.ts +1 -1
- package/dist/cli/model-fallback-types.d.ts +1 -0
- package/dist/cli/openai-only-model-catalog.d.ts +3 -0
- package/dist/cli/run/index.d.ts +1 -0
- package/dist/cli/run/model-resolver.d.ts +4 -0
- package/dist/cli/run/types.d.ts +1 -0
- package/dist/cli/types.d.ts +3 -0
- package/dist/config/schema/agent-names.d.ts +3 -1
- package/dist/config/schema/background-task.d.ts +8 -0
- package/dist/config/schema/git-env-prefix.d.ts +5 -0
- package/dist/config/schema/git-master.d.ts +1 -0
- package/dist/config/schema/hooks.d.ts +1 -0
- package/dist/config/schema/oh-my-opencode-config.d.ts +9 -0
- package/dist/config/schema.d.ts +1 -0
- package/dist/create-hooks.d.ts +12 -0
- package/dist/features/background-agent/compaction-aware-message-resolver.d.ts +16 -1
- package/dist/features/background-agent/constants.d.ts +6 -2
- package/dist/features/background-agent/loop-detector.d.ts +17 -0
- package/dist/features/background-agent/manager.d.ts +20 -4
- package/dist/features/background-agent/process-cleanup.d.ts +1 -1
- package/dist/features/background-agent/remove-task-toast-tracking.d.ts +1 -0
- package/dist/features/background-agent/subagent-spawn-limits.d.ts +23 -0
- package/dist/features/background-agent/task-history.d.ts +1 -0
- package/dist/features/background-agent/task-poller.d.ts +1 -0
- package/dist/features/background-agent/types.d.ts +11 -0
- package/dist/features/claude-code-agent-loader/claude-model-mapper.d.ts +4 -0
- package/dist/features/claude-code-agent-loader/loader.d.ts +3 -3
- package/dist/features/claude-code-agent-loader/types.d.ts +8 -1
- package/dist/features/claude-code-plugin-loader/agent-loader.d.ts +2 -2
- package/dist/features/claude-code-plugin-loader/loader.d.ts +2 -2
- package/dist/features/claude-code-plugin-loader/types.d.ts +22 -3
- package/dist/features/opencode-skill-loader/git-master-template-injection.d.ts +1 -1
- package/dist/features/skill-mcp-manager/types.d.ts +4 -0
- package/dist/features/tmux-subagent/index.d.ts +1 -0
- package/dist/features/tmux-subagent/manager.d.ts +5 -0
- package/dist/features/tmux-subagent/pane-state-parser.d.ts +8 -0
- package/dist/features/tmux-subagent/tracked-session-state.d.ts +8 -0
- package/dist/features/tmux-subagent/types.d.ts +2 -0
- package/dist/hooks/atlas/boulder-session-lineage.d.ts +6 -0
- package/dist/hooks/atlas/final-wave-approval-gate.d.ts +6 -0
- package/dist/hooks/atlas/final-wave-plan-state.d.ts +5 -0
- package/dist/hooks/atlas/idle-event.d.ts +8 -0
- package/dist/hooks/atlas/resolve-active-boulder-session.d.ts +11 -0
- package/dist/hooks/atlas/tool-execute-after.d.ts +2 -0
- package/dist/hooks/atlas/types.d.ts +4 -0
- package/dist/hooks/atlas/verification-reminders.d.ts +4 -0
- package/dist/hooks/auto-slash-command/executor.d.ts +1 -0
- package/dist/hooks/auto-slash-command/hook.d.ts +7 -0
- package/dist/hooks/auto-slash-command/processed-command-store.d.ts +7 -0
- package/dist/hooks/auto-slash-command/types.d.ts +9 -0
- package/dist/hooks/auto-update-checker/checker/sync-package-json.d.ts +7 -0
- package/dist/hooks/auto-update-checker/checker.d.ts +3 -1
- package/dist/hooks/compaction-context-injector/compaction-context-prompt.d.ts +1 -0
- package/dist/hooks/compaction-context-injector/constants.d.ts +5 -0
- package/dist/hooks/compaction-context-injector/hook.d.ts +5 -1
- package/dist/hooks/compaction-context-injector/recovery-prompt-config.d.ts +6 -0
- package/dist/hooks/compaction-context-injector/recovery.d.ts +6 -0
- package/dist/hooks/compaction-context-injector/session-id.d.ts +2 -0
- package/dist/hooks/compaction-context-injector/session-prompt-config-resolver.d.ts +16 -0
- package/dist/hooks/compaction-context-injector/tail-monitor.d.ts +13 -0
- package/dist/hooks/compaction-context-injector/types.d.ts +43 -0
- package/dist/hooks/compaction-context-injector/validated-model.d.ts +13 -0
- package/dist/hooks/context-window-monitor.d.ts +2 -5
- package/dist/hooks/gpt-permission-continuation/assistant-message.d.ts +23 -0
- package/dist/hooks/gpt-permission-continuation/constants.d.ts +4 -0
- package/dist/hooks/gpt-permission-continuation/detector.d.ts +1 -0
- package/dist/hooks/gpt-permission-continuation/handler.d.ts +12 -0
- package/dist/hooks/gpt-permission-continuation/index.d.ts +13 -0
- package/dist/hooks/gpt-permission-continuation/session-state.d.ts +15 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/keyword-detector/hook.d.ts +1 -0
- package/dist/hooks/preemptive-compaction.d.ts +2 -5
- package/dist/hooks/ralph-loop/pending-verification-handler.d.ts +17 -0
- package/dist/hooks/runtime-fallback/fallback-bootstrap-model.d.ts +10 -0
- package/dist/hooks/runtime-fallback/fallback-retry-dispatcher.d.ts +11 -0
- package/dist/hooks/runtime-fallback/hook.d.ts +2 -3
- package/dist/hooks/runtime-fallback/last-user-retry-parts.d.ts +4 -0
- package/dist/hooks/runtime-fallback/message-update-handler.d.ts +1 -2
- package/dist/hooks/runtime-fallback/retry-model-payload.d.ts +7 -0
- package/dist/hooks/runtime-fallback/session-messages.d.ts +9 -0
- package/dist/hooks/runtime-fallback/session-status-handler.d.ts +3 -0
- package/dist/hooks/runtime-fallback/types.d.ts +57 -3
- package/dist/hooks/runtime-fallback/visible-assistant-response.d.ts +3 -0
- package/dist/hooks/session-notification-content.d.ts +30 -0
- package/dist/hooks/session-notification-scheduler.d.ts +1 -3
- package/dist/hooks/start-work/index.d.ts +1 -1
- package/dist/hooks/start-work/worktree-detector.d.ts +7 -0
- package/dist/hooks/todo-continuation-enforcer/compaction-guard.d.ts +2 -0
- package/dist/hooks/todo-continuation-enforcer/constants.d.ts +2 -0
- package/dist/hooks/todo-continuation-enforcer/handler.d.ts +1 -0
- package/dist/hooks/todo-continuation-enforcer/idle-event.d.ts +1 -0
- package/dist/hooks/todo-continuation-enforcer/resolve-message-info.d.ts +3 -0
- package/dist/hooks/todo-continuation-enforcer/session-state.d.ts +10 -1
- package/dist/hooks/todo-continuation-enforcer/stagnation-detection.d.ts +6 -0
- package/dist/hooks/todo-continuation-enforcer/types.d.ts +10 -0
- package/dist/hooks/tool-output-truncator.d.ts +1 -0
- package/dist/index.js +10452 -6721
- package/dist/oh-my-opencode.schema.json +43 -2
- package/dist/plugin/hooks/create-continuation-hooks.d.ts +2 -1
- package/dist/plugin/normalize-tool-arg-schemas.d.ts +2 -0
- package/dist/plugin/ultrawork-model-override.d.ts +1 -15
- package/dist/plugin/ultrawork-variant-availability.d.ts +6 -0
- package/dist/plugin-dispose.d.ts +10 -0
- package/dist/plugin-handlers/agent-override-protection.d.ts +3 -0
- package/dist/plugin-state.d.ts +5 -0
- package/dist/shared/compaction-agent-config-checkpoint.d.ts +11 -0
- package/dist/shared/context-limit-resolver.d.ts +5 -0
- package/dist/shared/dynamic-truncator.d.ts +4 -7
- package/dist/shared/fallback-chain-from-models.d.ts +3 -0
- package/dist/shared/index.d.ts +3 -0
- package/dist/shared/model-error-classifier.d.ts +2 -1
- package/dist/shared/opencode-command-dirs.d.ts +3 -0
- package/dist/shared/plugin-identity.d.ts +5 -0
- package/dist/shared/question-denied-session-permission.d.ts +6 -0
- package/dist/shared/retry-status-utils.d.ts +2 -0
- package/dist/shared/shell-env.d.ts +27 -0
- package/dist/shared/tmux/tmux-utils/environment.d.ts +1 -0
- package/dist/shared/vision-capable-models-cache.d.ts +4 -0
- package/dist/tools/call-omo-agent/background-executor.d.ts +2 -1
- package/dist/tools/call-omo-agent/constants.d.ts +1 -1
- package/dist/tools/call-omo-agent/sync-executor.d.ts +11 -3
- package/dist/tools/call-omo-agent/tools.d.ts +2 -1
- package/dist/tools/delegate-task/cancel-unstable-agent-task.d.ts +2 -0
- package/dist/tools/delegate-task/model-selection.d.ts +3 -0
- package/dist/tools/delegate-task/model-string-parser.d.ts +5 -3
- package/dist/tools/hashline-edit/hash-computation.d.ts +1 -0
- package/dist/tools/hashline-edit/tool-description.d.ts +1 -1
- package/dist/tools/look-at/constants.d.ts +1 -1
- package/dist/tools/look-at/multimodal-fallback-chain.d.ts +4 -0
- package/dist/tools/lsp/constants.d.ts +1 -0
- package/dist/tools/lsp/directory-diagnostics.d.ts +1 -0
- package/dist/tools/lsp/lsp-client-transport.d.ts +4 -2
- package/dist/tools/lsp/lsp-client-wrapper.d.ts +2 -1
- package/dist/tools/lsp/server-path-bases.d.ts +1 -0
- package/package.json +18 -18
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ModelRequirement } from "../shared/model-requirements";
|
|
2
2
|
export declare const CLI_AGENT_MODEL_REQUIREMENTS: Record<string, ModelRequirement>;
|
|
3
3
|
export declare const CLI_CATEGORY_MODEL_REQUIREMENTS: Record<string, ModelRequirement>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { GeneratedOmoConfig, ProviderAvailability } from "./model-fallback-types";
|
|
2
|
+
export declare function isOpenAiOnlyAvailability(availability: ProviderAvailability): boolean;
|
|
3
|
+
export declare function applyOpenAiOnlyModelCatalog(config: GeneratedOmoConfig): GeneratedOmoConfig;
|
package/dist/cli/run/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { run } from "./runner";
|
|
2
2
|
export { resolveRunAgent } from "./agent-resolver";
|
|
3
|
+
export { resolveRunModel } from "./model-resolver";
|
|
3
4
|
export { createServerConnection } from "./server-connection";
|
|
4
5
|
export { resolveSession } from "./session-resolver";
|
|
5
6
|
export { createJsonOutputManager } from "./json-output";
|
package/dist/cli/run/types.d.ts
CHANGED
package/dist/cli/types.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export interface InstallArgs {
|
|
|
9
9
|
opencodeZen?: BooleanArg;
|
|
10
10
|
zaiCodingPlan?: BooleanArg;
|
|
11
11
|
kimiForCoding?: BooleanArg;
|
|
12
|
+
opencodeGo?: BooleanArg;
|
|
12
13
|
skipAuth?: boolean;
|
|
13
14
|
}
|
|
14
15
|
export interface InstallConfig {
|
|
@@ -20,6 +21,7 @@ export interface InstallConfig {
|
|
|
20
21
|
hasOpencodeZen: boolean;
|
|
21
22
|
hasZaiCodingPlan: boolean;
|
|
22
23
|
hasKimiForCoding: boolean;
|
|
24
|
+
hasOpencodeGo: boolean;
|
|
23
25
|
}
|
|
24
26
|
export interface ConfigMergeResult {
|
|
25
27
|
success: boolean;
|
|
@@ -36,4 +38,5 @@ export interface DetectedConfig {
|
|
|
36
38
|
hasOpencodeZen: boolean;
|
|
37
39
|
hasZaiCodingPlan: boolean;
|
|
38
40
|
hasKimiForCoding: boolean;
|
|
41
|
+
hasOpencodeGo: boolean;
|
|
39
42
|
}
|
|
@@ -9,6 +9,7 @@ export declare const BuiltinAgentNameSchema: z.ZodEnum<{
|
|
|
9
9
|
metis: "metis";
|
|
10
10
|
momus: "momus";
|
|
11
11
|
atlas: "atlas";
|
|
12
|
+
"sisyphus-junior": "sisyphus-junior";
|
|
12
13
|
prometheus: "prometheus";
|
|
13
14
|
}>;
|
|
14
15
|
export declare const BuiltinSkillNameSchema: z.ZodEnum<{
|
|
@@ -28,10 +29,10 @@ export declare const OverridableAgentNameSchema: z.ZodEnum<{
|
|
|
28
29
|
metis: "metis";
|
|
29
30
|
momus: "momus";
|
|
30
31
|
atlas: "atlas";
|
|
32
|
+
"sisyphus-junior": "sisyphus-junior";
|
|
31
33
|
build: "build";
|
|
32
34
|
plan: "plan";
|
|
33
35
|
prometheus: "prometheus";
|
|
34
|
-
"sisyphus-junior": "sisyphus-junior";
|
|
35
36
|
"OpenCode-Builder": "OpenCode-Builder";
|
|
36
37
|
}>;
|
|
37
38
|
export declare const AgentNameSchema: z.ZodEnum<{
|
|
@@ -44,6 +45,7 @@ export declare const AgentNameSchema: z.ZodEnum<{
|
|
|
44
45
|
metis: "metis";
|
|
45
46
|
momus: "momus";
|
|
46
47
|
atlas: "atlas";
|
|
48
|
+
"sisyphus-junior": "sisyphus-junior";
|
|
47
49
|
prometheus: "prometheus";
|
|
48
50
|
}>;
|
|
49
51
|
export type AgentName = z.infer<typeof AgentNameSchema>;
|
|
@@ -3,8 +3,16 @@ export declare const BackgroundTaskConfigSchema: z.ZodObject<{
|
|
|
3
3
|
defaultConcurrency: z.ZodOptional<z.ZodNumber>;
|
|
4
4
|
providerConcurrency: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
5
5
|
modelConcurrency: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
6
|
+
maxDepth: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
maxDescendants: z.ZodOptional<z.ZodNumber>;
|
|
6
8
|
staleTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
7
9
|
messageStalenessTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
8
10
|
syncPollTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
11
|
+
maxToolCalls: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
circuitBreaker: z.ZodOptional<z.ZodObject<{
|
|
13
|
+
maxToolCalls: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
windowSize: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
repetitionThresholdPercent: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
}, z.core.$strip>>;
|
|
9
17
|
}, z.core.$strip>;
|
|
10
18
|
export type BackgroundTaskConfig = z.infer<typeof BackgroundTaskConfigSchema>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const GIT_ENV_PREFIX_VALIDATION_MESSAGE = "git_env_prefix must be empty or use shell-safe env assignments like \"GIT_MASTER=1\"";
|
|
3
|
+
export declare function isValidGitEnvPrefix(value: string): boolean;
|
|
4
|
+
export declare function assertValidGitEnvPrefix(value: string): string;
|
|
5
|
+
export declare const GitEnvPrefixSchema: z.ZodDefault<z.ZodString>;
|
|
@@ -2,5 +2,6 @@ import { z } from "zod";
|
|
|
2
2
|
export declare const GitMasterConfigSchema: z.ZodObject<{
|
|
3
3
|
commit_footer: z.ZodDefault<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
|
|
4
4
|
include_co_authored_by: z.ZodDefault<z.ZodBoolean>;
|
|
5
|
+
git_env_prefix: z.ZodDefault<z.ZodString>;
|
|
5
6
|
}, z.core.$strip>;
|
|
6
7
|
export type GitMasterConfig = z.infer<typeof GitMasterConfigSchema>;
|
|
@@ -3,6 +3,7 @@ export declare const HookNameSchema: z.ZodEnum<{
|
|
|
3
3
|
atlas: "atlas";
|
|
4
4
|
"ralph-loop": "ralph-loop";
|
|
5
5
|
"start-work": "start-work";
|
|
6
|
+
"gpt-permission-continuation": "gpt-permission-continuation";
|
|
6
7
|
"todo-continuation-enforcer": "todo-continuation-enforcer";
|
|
7
8
|
"context-window-monitor": "context-window-monitor";
|
|
8
9
|
"session-recovery": "session-recovery";
|
|
@@ -1336,9 +1336,17 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
1336
1336
|
defaultConcurrency: z.ZodOptional<z.ZodNumber>;
|
|
1337
1337
|
providerConcurrency: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
1338
1338
|
modelConcurrency: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
1339
|
+
maxDepth: z.ZodOptional<z.ZodNumber>;
|
|
1340
|
+
maxDescendants: z.ZodOptional<z.ZodNumber>;
|
|
1339
1341
|
staleTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
1340
1342
|
messageStalenessTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
1341
1343
|
syncPollTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
1344
|
+
maxToolCalls: z.ZodOptional<z.ZodNumber>;
|
|
1345
|
+
circuitBreaker: z.ZodOptional<z.ZodObject<{
|
|
1346
|
+
maxToolCalls: z.ZodOptional<z.ZodNumber>;
|
|
1347
|
+
windowSize: z.ZodOptional<z.ZodNumber>;
|
|
1348
|
+
repetitionThresholdPercent: z.ZodOptional<z.ZodNumber>;
|
|
1349
|
+
}, z.core.$strip>>;
|
|
1342
1350
|
}, z.core.$strip>>;
|
|
1343
1351
|
notification: z.ZodOptional<z.ZodObject<{
|
|
1344
1352
|
force_enable: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -1349,6 +1357,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
1349
1357
|
git_master: z.ZodOptional<z.ZodObject<{
|
|
1350
1358
|
commit_footer: z.ZodDefault<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
|
|
1351
1359
|
include_co_authored_by: z.ZodDefault<z.ZodBoolean>;
|
|
1360
|
+
git_env_prefix: z.ZodDefault<z.ZodString>;
|
|
1352
1361
|
}, z.core.$strip>>;
|
|
1353
1362
|
browser_automation_engine: z.ZodOptional<z.ZodObject<{
|
|
1354
1363
|
provider: z.ZodDefault<z.ZodEnum<{
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from "./schema/commands";
|
|
|
10
10
|
export * from "./schema/dynamic-context-pruning";
|
|
11
11
|
export * from "./schema/experimental";
|
|
12
12
|
export * from "./schema/fallback-models";
|
|
13
|
+
export * from "./schema/git-env-prefix";
|
|
13
14
|
export * from "./schema/git-master";
|
|
14
15
|
export * from "./schema/hooks";
|
|
15
16
|
export * from "./schema/notification";
|
package/dist/create-hooks.d.ts
CHANGED
|
@@ -5,6 +5,15 @@ import type { BackgroundManager } from "./features/background-agent";
|
|
|
5
5
|
import type { PluginContext } from "./plugin/types";
|
|
6
6
|
import type { ModelCacheState } from "./plugin-state";
|
|
7
7
|
export type CreatedHooks = ReturnType<typeof createHooks>;
|
|
8
|
+
type DisposableHook = {
|
|
9
|
+
dispose?: () => void;
|
|
10
|
+
} | null | undefined;
|
|
11
|
+
export type DisposableCreatedHooks = {
|
|
12
|
+
runtimeFallback?: DisposableHook;
|
|
13
|
+
todoContinuationEnforcer?: DisposableHook;
|
|
14
|
+
autoSlashCommand?: DisposableHook;
|
|
15
|
+
};
|
|
16
|
+
export declare function disposeCreatedHooks(hooks: DisposableCreatedHooks): void;
|
|
8
17
|
export declare function createHooks(args: {
|
|
9
18
|
ctx: PluginContext;
|
|
10
19
|
pluginConfig: OhMyOpenCodeConfig;
|
|
@@ -15,8 +24,10 @@ export declare function createHooks(args: {
|
|
|
15
24
|
mergedSkills: LoadedSkill[];
|
|
16
25
|
availableSkills: AvailableSkill[];
|
|
17
26
|
}): {
|
|
27
|
+
disposeHooks: () => void;
|
|
18
28
|
categorySkillReminder: ReturnType<typeof import("./hooks").createCategorySkillReminderHook> | null;
|
|
19
29
|
autoSlashCommand: ReturnType<typeof import("./hooks").createAutoSlashCommandHook> | null;
|
|
30
|
+
gptPermissionContinuation: ReturnType<typeof import("./hooks").createGptPermissionContinuationHook> | null;
|
|
20
31
|
stopContinuationGuard: ReturnType<typeof import("./hooks").createStopContinuationGuardHook> | null;
|
|
21
32
|
compactionContextInjector: ReturnType<typeof import("./hooks").createCompactionContextInjector> | null;
|
|
22
33
|
compactionTodoPreserver: ReturnType<typeof import("./hooks").createCompactionTodoPreserverHook> | null;
|
|
@@ -63,3 +74,4 @@ export declare function createHooks(args: {
|
|
|
63
74
|
anthropicEffort: ReturnType<typeof import("./hooks/anthropic-effort").createAnthropicEffortHook> | null;
|
|
64
75
|
runtimeFallback: ReturnType<typeof import("./hooks").createRuntimeFallbackHook> | null;
|
|
65
76
|
};
|
|
77
|
+
export {};
|
|
@@ -1,3 +1,18 @@
|
|
|
1
1
|
import type { StoredMessage } from "../hook-message-injector";
|
|
2
|
+
type SessionMessage = {
|
|
3
|
+
info?: {
|
|
4
|
+
agent?: string;
|
|
5
|
+
model?: {
|
|
6
|
+
providerID?: string;
|
|
7
|
+
modelID?: string;
|
|
8
|
+
variant?: string;
|
|
9
|
+
};
|
|
10
|
+
providerID?: string;
|
|
11
|
+
modelID?: string;
|
|
12
|
+
tools?: StoredMessage["tools"];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
2
15
|
export declare function isCompactionAgent(agent: string | undefined): boolean;
|
|
3
|
-
export declare function
|
|
16
|
+
export declare function resolvePromptContextFromSessionMessages(messages: SessionMessage[], sessionID?: string): StoredMessage | null;
|
|
17
|
+
export declare function findNearestMessageExcludingCompaction(messageDir: string, sessionID?: string): StoredMessage | null;
|
|
18
|
+
export {};
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
2
|
import type { BackgroundTask, LaunchInput } from "./types";
|
|
3
3
|
export declare const TASK_TTL_MS: number;
|
|
4
|
+
export declare const TERMINAL_TASK_TTL_MS: number;
|
|
4
5
|
export declare const MIN_STABILITY_TIME_MS: number;
|
|
5
|
-
export declare const DEFAULT_STALE_TIMEOUT_MS =
|
|
6
|
-
export declare const DEFAULT_MESSAGE_STALENESS_TIMEOUT_MS =
|
|
6
|
+
export declare const DEFAULT_STALE_TIMEOUT_MS = 1200000;
|
|
7
|
+
export declare const DEFAULT_MESSAGE_STALENESS_TIMEOUT_MS = 1800000;
|
|
8
|
+
export declare const DEFAULT_MAX_TOOL_CALLS = 200;
|
|
9
|
+
export declare const DEFAULT_CIRCUIT_BREAKER_WINDOW_SIZE = 20;
|
|
10
|
+
export declare const DEFAULT_CIRCUIT_BREAKER_REPETITION_THRESHOLD_PERCENT = 80;
|
|
7
11
|
export declare const MIN_RUNTIME_BEFORE_STALE_MS = 30000;
|
|
8
12
|
export declare const MIN_IDLE_TIME_MS = 5000;
|
|
9
13
|
export declare const POLLING_INTERVAL_MS = 3000;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { BackgroundTaskConfig } from "../../config/schema";
|
|
2
|
+
import type { ToolCallWindow } from "./types";
|
|
3
|
+
export interface CircuitBreakerSettings {
|
|
4
|
+
maxToolCalls: number;
|
|
5
|
+
windowSize: number;
|
|
6
|
+
repetitionThresholdPercent: number;
|
|
7
|
+
}
|
|
8
|
+
export interface ToolLoopDetectionResult {
|
|
9
|
+
triggered: boolean;
|
|
10
|
+
toolName?: string;
|
|
11
|
+
repeatedCount?: number;
|
|
12
|
+
sampleSize?: number;
|
|
13
|
+
thresholdPercent?: number;
|
|
14
|
+
}
|
|
15
|
+
export declare function resolveCircuitBreakerSettings(config?: BackgroundTaskConfig): CircuitBreakerSettings;
|
|
16
|
+
export declare function recordToolCall(window: ToolCallWindow | undefined, toolName: string, settings: CircuitBreakerSettings): ToolCallWindow;
|
|
17
|
+
export declare function detectRepetitiveToolUse(window: ToolCallWindow | undefined): ToolLoopDetectionResult;
|
|
@@ -2,6 +2,7 @@ import type { PluginInput } from "@opencode-ai/plugin";
|
|
|
2
2
|
import type { BackgroundTask, LaunchInput, ResumeInput } from "./types";
|
|
3
3
|
import { TaskHistory } from "./task-history";
|
|
4
4
|
import type { BackgroundTaskConfig, TmuxConfig } from "../../config/schema";
|
|
5
|
+
import { type SubagentSpawnContext } from "./subagent-spawn-limits";
|
|
5
6
|
interface EventProperties {
|
|
6
7
|
sessionID?: string;
|
|
7
8
|
info?: {
|
|
@@ -37,16 +38,31 @@ export declare class BackgroundManager {
|
|
|
37
38
|
private queuesByKey;
|
|
38
39
|
private processingKeys;
|
|
39
40
|
private completionTimers;
|
|
41
|
+
private completedTaskSummaries;
|
|
40
42
|
private idleDeferralTimers;
|
|
41
43
|
private notificationQueueByParent;
|
|
44
|
+
private rootDescendantCounts;
|
|
45
|
+
private preStartDescendantReservations;
|
|
42
46
|
private enableParentSessionNotifications;
|
|
43
47
|
readonly taskHistory: TaskHistory;
|
|
44
48
|
constructor(ctx: PluginInput, config?: BackgroundTaskConfig, options?: {
|
|
45
49
|
tmuxConfig?: TmuxConfig;
|
|
46
50
|
onSubagentSessionCreated?: OnSubagentSessionCreated;
|
|
47
|
-
onShutdown?: () => void
|
|
51
|
+
onShutdown?: () => void | Promise<void>;
|
|
48
52
|
enableParentSessionNotifications?: boolean;
|
|
49
53
|
});
|
|
54
|
+
assertCanSpawn(parentSessionID: string): Promise<SubagentSpawnContext>;
|
|
55
|
+
reserveSubagentSpawn(parentSessionID: string): Promise<{
|
|
56
|
+
spawnContext: SubagentSpawnContext;
|
|
57
|
+
descendantCount: number;
|
|
58
|
+
commit: () => number;
|
|
59
|
+
rollback: () => void;
|
|
60
|
+
}>;
|
|
61
|
+
private registerRootDescendant;
|
|
62
|
+
private unregisterRootDescendant;
|
|
63
|
+
private markPreStartDescendantReservation;
|
|
64
|
+
private settlePreStartDescendantReservation;
|
|
65
|
+
private rollbackPreStartDescendantReservation;
|
|
50
66
|
launch(input: LaunchInput): Promise<BackgroundTask>;
|
|
51
67
|
private processKey;
|
|
52
68
|
private startTask;
|
|
@@ -94,6 +110,8 @@ export declare class BackgroundManager {
|
|
|
94
110
|
* Cleans up the parent entry if no pending tasks remain.
|
|
95
111
|
*/
|
|
96
112
|
private cleanupPendingByParent;
|
|
113
|
+
private clearTaskHistoryWhenParentTasksGone;
|
|
114
|
+
private scheduleTaskRemoval;
|
|
97
115
|
cancelTask(taskId: string, options?: {
|
|
98
116
|
source?: string;
|
|
99
117
|
reason?: string;
|
|
@@ -123,8 +141,6 @@ export declare class BackgroundManager {
|
|
|
123
141
|
*/
|
|
124
142
|
private tryCompleteTask;
|
|
125
143
|
private notifyParentSession;
|
|
126
|
-
private formatDuration;
|
|
127
|
-
private isAbortedSessionError;
|
|
128
144
|
private hasRunningTasks;
|
|
129
145
|
private pruneStaleTasksAndNotifications;
|
|
130
146
|
private checkAndInterruptStaleTasks;
|
|
@@ -134,7 +150,7 @@ export declare class BackgroundManager {
|
|
|
134
150
|
* Cancels all pending concurrency waiters and clears timers.
|
|
135
151
|
* Should be called when the plugin is unloaded.
|
|
136
152
|
*/
|
|
137
|
-
shutdown(): void
|
|
153
|
+
shutdown(): Promise<void>;
|
|
138
154
|
private enqueueNotificationForParent;
|
|
139
155
|
}
|
|
140
156
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function removeTaskToastTracking(taskId: string): void;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { BackgroundTaskConfig } from "../../config/schema";
|
|
2
|
+
import type { OpencodeClient } from "./constants";
|
|
3
|
+
export declare const DEFAULT_MAX_SUBAGENT_DEPTH = 3;
|
|
4
|
+
export declare const DEFAULT_MAX_ROOT_SESSION_SPAWN_BUDGET = 50;
|
|
5
|
+
export interface SubagentSpawnContext {
|
|
6
|
+
rootSessionID: string;
|
|
7
|
+
parentDepth: number;
|
|
8
|
+
childDepth: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function getMaxSubagentDepth(config?: BackgroundTaskConfig): number;
|
|
11
|
+
export declare function getMaxRootSessionSpawnBudget(config?: BackgroundTaskConfig): number;
|
|
12
|
+
export declare function resolveSubagentSpawnContext(client: OpencodeClient, parentSessionID: string): Promise<SubagentSpawnContext>;
|
|
13
|
+
export declare function createSubagentDepthLimitError(input: {
|
|
14
|
+
childDepth: number;
|
|
15
|
+
maxDepth: number;
|
|
16
|
+
parentSessionID: string;
|
|
17
|
+
rootSessionID: string;
|
|
18
|
+
}): Error;
|
|
19
|
+
export declare function createSubagentDescendantLimitError(input: {
|
|
20
|
+
rootSessionID: string;
|
|
21
|
+
descendantCount: number;
|
|
22
|
+
maxDescendants: number;
|
|
23
|
+
}): Error;
|
|
@@ -14,5 +14,6 @@ export declare class TaskHistory {
|
|
|
14
14
|
record(parentSessionID: string | undefined, entry: TaskHistoryEntry): void;
|
|
15
15
|
getByParentSession(parentSessionID: string): TaskHistoryEntry[];
|
|
16
16
|
clearSession(parentSessionID: string): void;
|
|
17
|
+
clearAll(): void;
|
|
17
18
|
formatForCompaction(parentSessionID: string): string | null;
|
|
18
19
|
}
|
|
@@ -17,4 +17,5 @@ export declare function checkAndInterruptStaleTasks(args: {
|
|
|
17
17
|
concurrencyManager: ConcurrencyManager;
|
|
18
18
|
notifyParentSession: (task: BackgroundTask) => Promise<void>;
|
|
19
19
|
sessionStatuses?: SessionStatusMap;
|
|
20
|
+
onTaskInterrupted?: (task: BackgroundTask) => void;
|
|
20
21
|
}): Promise<void>;
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import type { FallbackEntry } from "../../shared/model-requirements";
|
|
2
|
+
import type { SessionPermissionRule } from "../../shared/question-denied-session-permission";
|
|
2
3
|
export type BackgroundTaskStatus = "pending" | "running" | "completed" | "error" | "cancelled" | "interrupt";
|
|
4
|
+
export interface ToolCallWindow {
|
|
5
|
+
toolNames: string[];
|
|
6
|
+
windowSize: number;
|
|
7
|
+
thresholdPercent: number;
|
|
8
|
+
}
|
|
3
9
|
export interface TaskProgress {
|
|
4
10
|
toolCalls: number;
|
|
5
11
|
lastTool?: string;
|
|
12
|
+
toolCallWindow?: ToolCallWindow;
|
|
13
|
+
countedToolPartIDs?: string[];
|
|
6
14
|
lastUpdate: Date;
|
|
7
15
|
lastMessage?: string;
|
|
8
16
|
lastMessageAt?: Date;
|
|
@@ -10,11 +18,13 @@ export interface TaskProgress {
|
|
|
10
18
|
export interface BackgroundTask {
|
|
11
19
|
id: string;
|
|
12
20
|
sessionID?: string;
|
|
21
|
+
rootSessionID?: string;
|
|
13
22
|
parentSessionID: string;
|
|
14
23
|
parentMessageID: string;
|
|
15
24
|
description: string;
|
|
16
25
|
prompt: string;
|
|
17
26
|
agent: string;
|
|
27
|
+
spawnDepth?: number;
|
|
18
28
|
status: BackgroundTaskStatus;
|
|
19
29
|
queuedAt?: Date;
|
|
20
30
|
startedAt?: Date;
|
|
@@ -75,6 +85,7 @@ export interface LaunchInput {
|
|
|
75
85
|
skills?: string[];
|
|
76
86
|
skillContent?: string;
|
|
77
87
|
category?: string;
|
|
88
|
+
sessionPermission?: SessionPermissionRule[];
|
|
78
89
|
}
|
|
79
90
|
export interface ResumeInput {
|
|
80
91
|
sessionId: string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function loadUserAgents(): Record<string,
|
|
3
|
-
export declare function loadProjectAgents(directory?: string): Record<string,
|
|
1
|
+
import type { ClaudeCodeAgentConfig } from "./types";
|
|
2
|
+
export declare function loadUserAgents(): Record<string, ClaudeCodeAgentConfig>;
|
|
3
|
+
export declare function loadProjectAgents(directory?: string): Record<string, ClaudeCodeAgentConfig>;
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import type { AgentConfig } from "@opencode-ai/sdk";
|
|
2
2
|
export type AgentScope = "user" | "project";
|
|
3
|
+
export type ClaudeCodeAgentConfig = Omit<AgentConfig, "model"> & {
|
|
4
|
+
model?: string | {
|
|
5
|
+
providerID: string;
|
|
6
|
+
modelID: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
3
9
|
export interface AgentFrontmatter {
|
|
4
10
|
name?: string;
|
|
5
11
|
description?: string;
|
|
6
12
|
model?: string;
|
|
7
13
|
tools?: string;
|
|
14
|
+
mode?: "subagent" | "primary" | "all";
|
|
8
15
|
}
|
|
9
16
|
export interface LoadedAgent {
|
|
10
17
|
name: string;
|
|
11
18
|
path: string;
|
|
12
|
-
config:
|
|
19
|
+
config: ClaudeCodeAgentConfig;
|
|
13
20
|
scope: AgentScope;
|
|
14
21
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ClaudeCodeAgentConfig } from "../claude-code-agent-loader/types";
|
|
2
2
|
import type { LoadedPlugin } from "./types";
|
|
3
|
-
export declare function loadPluginAgents(plugins: LoadedPlugin[]): Record<string,
|
|
3
|
+
export declare function loadPluginAgents(plugins: LoadedPlugin[]): Record<string, ClaudeCodeAgentConfig>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { AgentConfig } from "@opencode-ai/sdk";
|
|
2
1
|
import type { CommandDefinition } from "../claude-code-command-loader/types";
|
|
3
2
|
import type { McpServerConfig } from "../claude-code-mcp-loader/types";
|
|
3
|
+
import type { ClaudeCodeAgentConfig } from "../claude-code-agent-loader/types";
|
|
4
4
|
import type { HooksConfig, LoadedPlugin, PluginLoadError, PluginLoaderOptions } from "./types";
|
|
5
5
|
export { discoverInstalledPlugins } from "./discovery";
|
|
6
6
|
export { loadPluginCommands } from "./command-loader";
|
|
@@ -11,7 +11,7 @@ export { loadPluginHooksConfigs } from "./hook-loader";
|
|
|
11
11
|
export interface PluginComponentsResult {
|
|
12
12
|
commands: Record<string, CommandDefinition>;
|
|
13
13
|
skills: Record<string, CommandDefinition>;
|
|
14
|
-
agents: Record<string,
|
|
14
|
+
agents: Record<string, ClaudeCodeAgentConfig>;
|
|
15
15
|
mcpServers: Record<string, McpServerConfig>;
|
|
16
16
|
hooksConfigs: HooksConfig[];
|
|
17
17
|
plugins: LoadedPlugin[];
|
|
@@ -26,18 +26,37 @@ export interface InstalledPluginsDatabaseV1 {
|
|
|
26
26
|
plugins: Record<string, PluginInstallation>;
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
|
-
* Installed plugins database v2
|
|
30
|
-
* plugins stored as arrays
|
|
29
|
+
* Installed plugins database v2
|
|
30
|
+
* plugins stored as arrays keyed by plugin identifier
|
|
31
31
|
*/
|
|
32
32
|
export interface InstalledPluginsDatabaseV2 {
|
|
33
33
|
version: 2;
|
|
34
34
|
plugins: Record<string, PluginInstallation[]>;
|
|
35
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Installed plugins database v3 entry (current Claude Code format)
|
|
38
|
+
* A flat array of plugin entries, each containing name and marketplace fields
|
|
39
|
+
* used to construct the plugin key as "name@marketplace".
|
|
40
|
+
*/
|
|
41
|
+
export interface InstalledPluginEntryV3 {
|
|
42
|
+
name: string;
|
|
43
|
+
marketplace: string;
|
|
44
|
+
scope: PluginScope;
|
|
45
|
+
version: string;
|
|
46
|
+
installPath: string;
|
|
47
|
+
lastUpdated: string;
|
|
48
|
+
gitCommitSha?: string;
|
|
49
|
+
}
|
|
36
50
|
/**
|
|
37
51
|
* Installed plugins database structure
|
|
38
52
|
* Located at ~/.claude/plugins/installed_plugins.json
|
|
53
|
+
*
|
|
54
|
+
* Supports three formats:
|
|
55
|
+
* - v1: { version: 1, plugins: Record<string, PluginInstallation> }
|
|
56
|
+
* - v2: { version: 2, plugins: Record<string, PluginInstallation[]> }
|
|
57
|
+
* - v3: InstalledPluginEntryV3[] (flat array, current Claude Code format)
|
|
39
58
|
*/
|
|
40
|
-
export type InstalledPluginsDatabase = InstalledPluginsDatabaseV1 | InstalledPluginsDatabaseV2;
|
|
59
|
+
export type InstalledPluginsDatabase = InstalledPluginsDatabaseV1 | InstalledPluginsDatabaseV2 | InstalledPluginEntryV3[];
|
|
41
60
|
/**
|
|
42
61
|
* Plugin author information
|
|
43
62
|
*/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type GitMasterConfig } from "../../config/schema";
|
|
2
2
|
export declare function injectGitMasterConfig(template: string, config?: GitMasterConfig): string;
|
|
@@ -41,11 +41,15 @@ export interface ProcessCleanupHandler {
|
|
|
41
41
|
export interface SkillMcpManagerState {
|
|
42
42
|
clients: Map<string, ManagedClient>;
|
|
43
43
|
pendingConnections: Map<string, Promise<Client>>;
|
|
44
|
+
disconnectedSessions: Map<string, number>;
|
|
44
45
|
authProviders: Map<string, McpOAuthProvider>;
|
|
45
46
|
cleanupRegistered: boolean;
|
|
46
47
|
cleanupInterval: ReturnType<typeof setInterval> | null;
|
|
47
48
|
cleanupHandlers: ProcessCleanupHandler[];
|
|
48
49
|
idleTimeoutMs: number;
|
|
50
|
+
shutdownGeneration: number;
|
|
51
|
+
inFlightConnections: Map<string, number>;
|
|
52
|
+
disposed: boolean;
|
|
49
53
|
}
|
|
50
54
|
export interface SkillMcpClientConnectionParams {
|
|
51
55
|
state: SkillMcpManagerState;
|
|
@@ -10,6 +10,7 @@ export * from "./session-status-parser";
|
|
|
10
10
|
export * from "./session-message-count";
|
|
11
11
|
export * from "./session-ready-waiter";
|
|
12
12
|
export * from "./types";
|
|
13
|
+
export * from "./pane-state-parser";
|
|
13
14
|
export * from "./pane-state-querier";
|
|
14
15
|
export * from "./decision-engine";
|
|
15
16
|
export * from "./action-executor";
|
|
@@ -45,6 +45,11 @@ export declare class TmuxSessionManager {
|
|
|
45
45
|
private isEnabled;
|
|
46
46
|
private getCapacityConfig;
|
|
47
47
|
private getSessionMappings;
|
|
48
|
+
private removeTrackedSession;
|
|
49
|
+
private markSessionClosePending;
|
|
50
|
+
private queryWindowStateSafely;
|
|
51
|
+
private tryCloseTrackedSession;
|
|
52
|
+
private retryPendingCloses;
|
|
48
53
|
private enqueueDeferredSession;
|
|
49
54
|
private removeDeferredSession;
|
|
50
55
|
private startDeferredAttachLoop;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TrackedSession } from "./types";
|
|
2
|
+
export declare function createTrackedSession(params: {
|
|
3
|
+
sessionId: string;
|
|
4
|
+
paneId: string;
|
|
5
|
+
description: string;
|
|
6
|
+
now?: Date;
|
|
7
|
+
}): TrackedSession;
|
|
8
|
+
export declare function markTrackedSessionClosePending(tracked: TrackedSession): TrackedSession;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
import type { AtlasHookOptions, SessionState } from "./types";
|
|
3
|
+
export declare function handleAtlasSessionIdle(input: {
|
|
4
|
+
ctx: PluginInput;
|
|
5
|
+
options?: AtlasHookOptions;
|
|
6
|
+
getState: (sessionID: string) => SessionState;
|
|
7
|
+
sessionID: string;
|
|
8
|
+
}): Promise<void>;
|