oh-my-opencode-slim 0.7.0 → 0.8.1
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.md +9 -1
- package/dist/agents/index.d.ts +1 -1
- package/dist/agents/orchestrator.d.ts +1 -1
- package/dist/background/background-manager.d.ts +42 -0
- package/dist/background/tmux-session-manager.d.ts +5 -0
- package/dist/cli/config-manager.d.ts +3 -0
- package/dist/cli/dynamic-model-selection.d.ts +14 -2
- package/dist/cli/external-rankings.d.ts +8 -0
- package/dist/cli/index.js +1897 -272
- package/dist/cli/model-key-normalization.d.ts +1 -0
- package/dist/cli/opencode-models.d.ts +4 -0
- package/dist/cli/paths.d.ts +2 -0
- package/dist/cli/precedence-resolver.d.ts +16 -0
- package/dist/cli/providers.d.ts +1 -1
- package/dist/cli/scoring-v2/engine.d.ts +4 -0
- package/dist/cli/scoring-v2/features.d.ts +3 -0
- package/dist/cli/scoring-v2/index.d.ts +4 -0
- package/dist/cli/scoring-v2/types.d.ts +17 -0
- package/dist/cli/scoring-v2/weights.d.ts +2 -0
- package/dist/cli/skills.d.ts +17 -0
- package/dist/cli/system.d.ts +2 -0
- package/dist/cli/types.d.ts +45 -1
- package/dist/config/constants.d.ts +1 -0
- package/dist/config/schema.d.ts +94 -2
- package/dist/hooks/autopilot/index.d.ts +43 -0
- package/dist/hooks/delegate-task-retry/guidance.d.ts +2 -0
- package/dist/hooks/delegate-task-retry/hook.d.ts +8 -0
- package/dist/hooks/delegate-task-retry/index.d.ts +4 -0
- package/dist/hooks/delegate-task-retry/patterns.d.ts +11 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/json-error-recovery/hook.d.ts +18 -0
- package/dist/hooks/json-error-recovery/index.d.ts +1 -0
- package/dist/index.js +356 -16
- package/dist/utils/env.d.ts +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/package.json +8 -8
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function buildModelKeyAliases(input: string): string[];
|
|
@@ -12,3 +12,7 @@ export declare function discoverProviderFreeModels(providerID: string): Promise<
|
|
|
12
12
|
models: OpenCodeFreeModel[];
|
|
13
13
|
error?: string;
|
|
14
14
|
}>;
|
|
15
|
+
export declare function discoverProviderModels(providerID: string): Promise<{
|
|
16
|
+
models: DiscoveredModel[];
|
|
17
|
+
error?: string;
|
|
18
|
+
}>;
|
package/dist/cli/paths.d.ts
CHANGED
|
@@ -3,5 +3,7 @@ export declare function getOpenCodeConfigPaths(): string[];
|
|
|
3
3
|
export declare function getConfigJson(): string;
|
|
4
4
|
export declare function getConfigJsonc(): string;
|
|
5
5
|
export declare function getLiteConfig(): string;
|
|
6
|
+
export declare function getLiteConfigJsonc(): string;
|
|
7
|
+
export declare function getExistingLiteConfigPath(): string;
|
|
6
8
|
export declare function getExistingConfigPath(): string;
|
|
7
9
|
export declare function ensureConfigDir(): void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AgentResolutionProvenance } from './types';
|
|
2
|
+
export interface AgentLayerInput {
|
|
3
|
+
agentName: string;
|
|
4
|
+
openCodeDirectOverride?: string;
|
|
5
|
+
manualUserPlan?: string[];
|
|
6
|
+
pinnedModel?: string;
|
|
7
|
+
dynamicRecommendation?: string[];
|
|
8
|
+
providerFallbackPolicy?: string[];
|
|
9
|
+
systemDefault: string[];
|
|
10
|
+
}
|
|
11
|
+
export interface ResolvedAgentLayerResult {
|
|
12
|
+
model: string;
|
|
13
|
+
chain: string[];
|
|
14
|
+
provenance: AgentResolutionProvenance;
|
|
15
|
+
}
|
|
16
|
+
export declare function resolveAgentWithPrecedence(input: AgentLayerInput): ResolvedAgentLayerResult;
|
package/dist/cli/providers.d.ts
CHANGED
|
@@ -130,7 +130,7 @@ export declare const MODEL_MAPPINGS: {
|
|
|
130
130
|
readonly model: "google/antigravity-gemini-3-flash";
|
|
131
131
|
};
|
|
132
132
|
readonly oracle: {
|
|
133
|
-
readonly model: "google/antigravity-gemini-3-pro";
|
|
133
|
+
readonly model: "google/antigravity-gemini-3.1-pro";
|
|
134
134
|
};
|
|
135
135
|
readonly librarian: {
|
|
136
136
|
readonly model: "google/antigravity-gemini-3-flash";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DiscoveredModel, ExternalSignalMap } from '../types';
|
|
2
|
+
import type { ScoredCandidate, ScoringAgentName } from './types';
|
|
3
|
+
export declare function scoreCandidateV2(model: DiscoveredModel, agent: ScoringAgentName, externalSignals?: ExternalSignalMap): ScoredCandidate;
|
|
4
|
+
export declare function rankModelsV2(models: DiscoveredModel[], agent: ScoringAgentName, externalSignals?: ExternalSignalMap): ScoredCandidate[];
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { DiscoveredModel, ExternalSignalMap } from '../types';
|
|
2
|
+
import type { FeatureVector, ScoringAgentName } from './types';
|
|
3
|
+
export declare function extractFeatureVector(model: DiscoveredModel, agent: ScoringAgentName, externalSignals?: ExternalSignalMap): FeatureVector;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { DiscoveredModel, ExternalSignalMap } from '../types';
|
|
2
|
+
export type ScoreFeatureName = 'status' | 'context' | 'output' | 'versionBonus' | 'reasoning' | 'toolcall' | 'attachment' | 'quality' | 'coding' | 'latencyPenalty' | 'pricePenalty';
|
|
3
|
+
export type FeatureVector = Record<ScoreFeatureName, number>;
|
|
4
|
+
export type FeatureWeights = Record<ScoreFeatureName, number>;
|
|
5
|
+
export type ScoringAgentName = 'orchestrator' | 'oracle' | 'designer' | 'explorer' | 'librarian' | 'fixer';
|
|
6
|
+
export interface ScoringContext {
|
|
7
|
+
agent: ScoringAgentName;
|
|
8
|
+
externalSignals?: ExternalSignalMap;
|
|
9
|
+
}
|
|
10
|
+
export interface ScoredCandidate {
|
|
11
|
+
model: DiscoveredModel;
|
|
12
|
+
totalScore: number;
|
|
13
|
+
scoreBreakdown: {
|
|
14
|
+
features: FeatureVector;
|
|
15
|
+
weighted: FeatureVector;
|
|
16
|
+
};
|
|
17
|
+
}
|
package/dist/cli/skills.d.ts
CHANGED
|
@@ -15,11 +15,28 @@ export interface RecommendedSkill {
|
|
|
15
15
|
/** Optional commands to run after the skill is added */
|
|
16
16
|
postInstallCommands?: string[];
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* A skill that is managed externally (e.g. user-installed) and needs
|
|
20
|
+
* permission grants but is NOT installed by this plugin's CLI.
|
|
21
|
+
*/
|
|
22
|
+
export interface PermissionOnlySkill {
|
|
23
|
+
/** Skill name — must match the name OpenCode uses for permission checks */
|
|
24
|
+
name: string;
|
|
25
|
+
/** List of agents that should auto-allow this skill */
|
|
26
|
+
allowedAgents: string[];
|
|
27
|
+
/** Human-readable description (for documentation only) */
|
|
28
|
+
description: string;
|
|
29
|
+
}
|
|
18
30
|
/**
|
|
19
31
|
* List of recommended skills.
|
|
20
32
|
* Add new skills here to include them in the installation flow.
|
|
21
33
|
*/
|
|
22
34
|
export declare const RECOMMENDED_SKILLS: RecommendedSkill[];
|
|
35
|
+
/**
|
|
36
|
+
* Skills managed externally (not installed by this plugin's CLI).
|
|
37
|
+
* Entries here only affect agent permission grants — nothing is installed.
|
|
38
|
+
*/
|
|
39
|
+
export declare const PERMISSION_ONLY_SKILLS: PermissionOnlySkill[];
|
|
23
40
|
/**
|
|
24
41
|
* Install a skill using `npx skills add`.
|
|
25
42
|
* @param skill - The skill to install
|
package/dist/cli/system.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
export declare function resolveOpenCodePath(): string;
|
|
1
2
|
export declare function isOpenCodeInstalled(): Promise<boolean>;
|
|
2
3
|
export declare function isTmuxInstalled(): Promise<boolean>;
|
|
3
4
|
export declare function getOpenCodeVersion(): Promise<string | null>;
|
|
5
|
+
export declare function getOpenCodePath(): string | null;
|
|
4
6
|
export declare function fetchLatestVersion(packageName: string): Promise<string | null>;
|
package/dist/cli/types.d.ts
CHANGED
|
@@ -11,7 +11,12 @@ export interface InstallArgs {
|
|
|
11
11
|
tmux?: BooleanArg;
|
|
12
12
|
skills?: BooleanArg;
|
|
13
13
|
opencodeFree?: BooleanArg;
|
|
14
|
+
balancedSpend?: BooleanArg;
|
|
14
15
|
opencodeFreeModel?: string;
|
|
16
|
+
aaKey?: string;
|
|
17
|
+
openrouterKey?: string;
|
|
18
|
+
dryRun?: boolean;
|
|
19
|
+
modelsOnly?: boolean;
|
|
15
20
|
}
|
|
16
21
|
export interface OpenCodeFreeModel {
|
|
17
22
|
providerID: string;
|
|
@@ -43,10 +48,41 @@ export interface DynamicAgentAssignment {
|
|
|
43
48
|
model: string;
|
|
44
49
|
variant?: string;
|
|
45
50
|
}
|
|
51
|
+
export type ScoringEngineVersion = 'v1' | 'v2-shadow' | 'v2';
|
|
52
|
+
export type ResolutionLayerName = 'opencode-direct-override' | 'manual-user-plan' | 'pinned-model' | 'dynamic-recommendation' | 'provider-fallback-policy' | 'system-default';
|
|
53
|
+
export interface AgentResolutionProvenance {
|
|
54
|
+
winnerLayer: ResolutionLayerName;
|
|
55
|
+
winnerModel: string;
|
|
56
|
+
}
|
|
57
|
+
export interface DynamicPlanScoringMeta {
|
|
58
|
+
engineVersionApplied: 'v1' | 'v2';
|
|
59
|
+
shadowCompared: boolean;
|
|
60
|
+
diffs?: Record<string, {
|
|
61
|
+
v1TopModel?: string;
|
|
62
|
+
v2TopModel?: string;
|
|
63
|
+
}>;
|
|
64
|
+
}
|
|
46
65
|
export interface DynamicModelPlan {
|
|
47
66
|
agents: Record<string, DynamicAgentAssignment>;
|
|
48
67
|
chains: Record<string, string[]>;
|
|
68
|
+
provenance?: Record<string, AgentResolutionProvenance>;
|
|
69
|
+
scoring?: DynamicPlanScoringMeta;
|
|
70
|
+
}
|
|
71
|
+
export interface ExternalModelSignal {
|
|
72
|
+
qualityScore?: number;
|
|
73
|
+
codingScore?: number;
|
|
74
|
+
latencySeconds?: number;
|
|
75
|
+
inputPricePer1M?: number;
|
|
76
|
+
outputPricePer1M?: number;
|
|
77
|
+
source: 'artificial-analysis' | 'openrouter' | 'merged';
|
|
49
78
|
}
|
|
79
|
+
export type ExternalSignalMap = Record<string, ExternalModelSignal>;
|
|
80
|
+
export type ManualAgentConfig = {
|
|
81
|
+
primary: string;
|
|
82
|
+
fallback1: string;
|
|
83
|
+
fallback2: string;
|
|
84
|
+
fallback3: string;
|
|
85
|
+
};
|
|
50
86
|
export interface OpenCodeConfig {
|
|
51
87
|
plugin?: string[];
|
|
52
88
|
provider?: Record<string, unknown>;
|
|
@@ -69,11 +105,19 @@ export interface InstallConfig {
|
|
|
69
105
|
availableOpenCodeFreeModels?: OpenCodeFreeModel[];
|
|
70
106
|
selectedChutesPrimaryModel?: string;
|
|
71
107
|
selectedChutesSecondaryModel?: string;
|
|
72
|
-
|
|
108
|
+
availableChutesModels?: DiscoveredModel[];
|
|
73
109
|
dynamicModelPlan?: DynamicModelPlan;
|
|
110
|
+
scoringEngineVersion?: ScoringEngineVersion;
|
|
111
|
+
artificialAnalysisApiKey?: string;
|
|
112
|
+
openRouterApiKey?: string;
|
|
113
|
+
balanceProviderUsage?: boolean;
|
|
74
114
|
hasTmux: boolean;
|
|
75
115
|
installSkills: boolean;
|
|
76
116
|
installCustomSkills: boolean;
|
|
117
|
+
setupMode: 'quick' | 'manual';
|
|
118
|
+
manualAgentConfigs?: Record<string, ManualAgentConfig>;
|
|
119
|
+
dryRun?: boolean;
|
|
120
|
+
modelsOnly?: boolean;
|
|
77
121
|
}
|
|
78
122
|
export interface ConfigMergeResult {
|
|
79
123
|
success: boolean;
|
|
@@ -3,6 +3,7 @@ export declare const SUBAGENT_NAMES: readonly ["explorer", "librarian", "oracle"
|
|
|
3
3
|
export declare const ORCHESTRATOR_NAME: "orchestrator";
|
|
4
4
|
export declare const ALL_AGENT_NAMES: readonly ["orchestrator", "explorer", "librarian", "oracle", "designer", "fixer"];
|
|
5
5
|
export type AgentName = (typeof ALL_AGENT_NAMES)[number];
|
|
6
|
+
export declare const SUBAGENT_DELEGATION_RULES: Record<AgentName, readonly string[]>;
|
|
6
7
|
export declare const DEFAULT_MODELS: Record<AgentName, string>;
|
|
7
8
|
export declare const POLL_INTERVAL_MS = 500;
|
|
8
9
|
export declare const POLL_INTERVAL_SLOW_MS = 1000;
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -1,5 +1,53 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
declare const FALLBACK_AGENT_NAMES: readonly ["orchestrator", "oracle", "designer", "explorer", "librarian", "fixer"];
|
|
3
|
+
declare const MANUAL_AGENT_NAMES: readonly ["orchestrator", "oracle", "designer", "explorer", "librarian", "fixer"];
|
|
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
|
+
fixer: z.ZodObject<{
|
|
42
|
+
primary: z.ZodString;
|
|
43
|
+
fallback1: z.ZodString;
|
|
44
|
+
fallback2: z.ZodString;
|
|
45
|
+
fallback3: z.ZodString;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
}, z.core.$strict>;
|
|
48
|
+
export type ManualAgentName = (typeof MANUAL_AGENT_NAMES)[number];
|
|
49
|
+
export type ManualAgentPlan = z.infer<typeof ManualAgentPlanSchema>;
|
|
50
|
+
export type ManualPlan = z.infer<typeof ManualPlanSchema>;
|
|
3
51
|
export type FallbackAgentName = (typeof FALLBACK_AGENT_NAMES)[number];
|
|
4
52
|
export declare const AgentOverrideConfigSchema: z.ZodObject<{
|
|
5
53
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -57,11 +105,55 @@ export declare const FailoverConfigSchema: z.ZodObject<{
|
|
|
57
105
|
explorer: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
58
106
|
librarian: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
59
107
|
fixer: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
60
|
-
}, z.core.$
|
|
108
|
+
}, z.core.$catchall<z.ZodArray<z.ZodString>>>>;
|
|
61
109
|
}, z.core.$strip>;
|
|
62
110
|
export type FailoverConfig = z.infer<typeof FailoverConfigSchema>;
|
|
63
111
|
export declare const PluginConfigSchema: z.ZodObject<{
|
|
64
112
|
preset: z.ZodOptional<z.ZodString>;
|
|
113
|
+
scoringEngineVersion: z.ZodOptional<z.ZodEnum<{
|
|
114
|
+
v1: "v1";
|
|
115
|
+
"v2-shadow": "v2-shadow";
|
|
116
|
+
v2: "v2";
|
|
117
|
+
}>>;
|
|
118
|
+
balanceProviderUsage: z.ZodOptional<z.ZodBoolean>;
|
|
119
|
+
manualPlan: z.ZodOptional<z.ZodObject<{
|
|
120
|
+
orchestrator: z.ZodObject<{
|
|
121
|
+
primary: z.ZodString;
|
|
122
|
+
fallback1: z.ZodString;
|
|
123
|
+
fallback2: z.ZodString;
|
|
124
|
+
fallback3: z.ZodString;
|
|
125
|
+
}, z.core.$strip>;
|
|
126
|
+
oracle: z.ZodObject<{
|
|
127
|
+
primary: z.ZodString;
|
|
128
|
+
fallback1: z.ZodString;
|
|
129
|
+
fallback2: z.ZodString;
|
|
130
|
+
fallback3: z.ZodString;
|
|
131
|
+
}, z.core.$strip>;
|
|
132
|
+
designer: z.ZodObject<{
|
|
133
|
+
primary: z.ZodString;
|
|
134
|
+
fallback1: z.ZodString;
|
|
135
|
+
fallback2: z.ZodString;
|
|
136
|
+
fallback3: z.ZodString;
|
|
137
|
+
}, z.core.$strip>;
|
|
138
|
+
explorer: z.ZodObject<{
|
|
139
|
+
primary: z.ZodString;
|
|
140
|
+
fallback1: z.ZodString;
|
|
141
|
+
fallback2: z.ZodString;
|
|
142
|
+
fallback3: z.ZodString;
|
|
143
|
+
}, z.core.$strip>;
|
|
144
|
+
librarian: z.ZodObject<{
|
|
145
|
+
primary: z.ZodString;
|
|
146
|
+
fallback1: z.ZodString;
|
|
147
|
+
fallback2: z.ZodString;
|
|
148
|
+
fallback3: z.ZodString;
|
|
149
|
+
}, z.core.$strip>;
|
|
150
|
+
fixer: z.ZodObject<{
|
|
151
|
+
primary: z.ZodString;
|
|
152
|
+
fallback1: z.ZodString;
|
|
153
|
+
fallback2: z.ZodString;
|
|
154
|
+
fallback3: z.ZodString;
|
|
155
|
+
}, z.core.$strip>;
|
|
156
|
+
}, z.core.$strict>>;
|
|
65
157
|
presets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
66
158
|
model: z.ZodOptional<z.ZodString>;
|
|
67
159
|
temperature: z.ZodOptional<z.ZodNumber>;
|
|
@@ -101,7 +193,7 @@ export declare const PluginConfigSchema: z.ZodObject<{
|
|
|
101
193
|
explorer: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
102
194
|
librarian: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
103
195
|
fixer: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
104
|
-
}, z.core.$
|
|
196
|
+
}, z.core.$catchall<z.ZodArray<z.ZodString>>>>;
|
|
105
197
|
}, z.core.$strip>>;
|
|
106
198
|
}, z.core.$strip>;
|
|
107
199
|
export type PluginConfig = z.infer<typeof PluginConfigSchema>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { PluginInput } from '@opencode-ai/plugin';
|
|
2
|
+
import type { PluginConfig } from '../../config';
|
|
3
|
+
declare const AUTOPILOT_CONTINUE_PROMPT = "[AUTOPILOT] Continue executing work in this same session now. Do not acknowledge autopilot, do not ask for confirmation, and do not stop after a status message. Perform the next concrete action immediately (run a tool/command, edit files, or advance the active todo). Only stop when all todos are completed/cancelled or the user explicitly disables autopilot.";
|
|
4
|
+
interface MessagePart {
|
|
5
|
+
type: string;
|
|
6
|
+
text?: string;
|
|
7
|
+
}
|
|
8
|
+
interface TodoEntry {
|
|
9
|
+
status?: string;
|
|
10
|
+
}
|
|
11
|
+
type AutopilotCommand = 'enable' | 'disable' | 'status' | null;
|
|
12
|
+
declare function parseAutopilotCommand(text: string, keyword: string, disableKeyword: string): AutopilotCommand;
|
|
13
|
+
declare function extractTodoList(data: unknown): TodoEntry[];
|
|
14
|
+
declare function isActiveTodo(todo: TodoEntry): boolean;
|
|
15
|
+
export declare function createAutopilotHook(ctx: PluginInput, config: PluginConfig): {
|
|
16
|
+
'chat.message': (input: {
|
|
17
|
+
sessionID: string;
|
|
18
|
+
agent?: string;
|
|
19
|
+
messageID?: string;
|
|
20
|
+
}, output: {
|
|
21
|
+
parts: MessagePart[];
|
|
22
|
+
}) => Promise<void>;
|
|
23
|
+
event: (input: {
|
|
24
|
+
event: {
|
|
25
|
+
type: string;
|
|
26
|
+
properties?: {
|
|
27
|
+
sessionID?: string;
|
|
28
|
+
status?: {
|
|
29
|
+
type?: string;
|
|
30
|
+
};
|
|
31
|
+
info?: {
|
|
32
|
+
id?: string;
|
|
33
|
+
role?: string;
|
|
34
|
+
sessionID?: string;
|
|
35
|
+
time?: {
|
|
36
|
+
completed?: number;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
}) => Promise<void>;
|
|
42
|
+
};
|
|
43
|
+
export { AUTOPILOT_CONTINUE_PROMPT, extractTodoList, isActiveTodo, parseAutopilotCommand, };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface DelegateTaskErrorPattern {
|
|
2
|
+
pattern: string;
|
|
3
|
+
errorType: string;
|
|
4
|
+
fixHint: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const DELEGATE_TASK_ERROR_PATTERNS: DelegateTaskErrorPattern[];
|
|
7
|
+
export interface DetectedError {
|
|
8
|
+
errorType: string;
|
|
9
|
+
originalOutput: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function detectDelegateTaskError(output: string): DetectedError | null;
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export type { AutoUpdateCheckerOptions } from './auto-update-checker';
|
|
2
2
|
export { createAutoUpdateCheckerHook } from './auto-update-checker';
|
|
3
|
+
export { createDelegateTaskRetryHook } from './delegate-task-retry';
|
|
4
|
+
export { createJsonErrorRecoveryHook } from './json-error-recovery';
|
|
3
5
|
export { createPhaseReminderHook } from './phase-reminder';
|
|
4
6
|
export { createPostReadNudgeHook } from './post-read-nudge';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { PluginInput } from '@opencode-ai/plugin';
|
|
2
|
+
export declare const JSON_ERROR_TOOL_EXCLUDE_LIST: readonly ["bash", "read", "glob", "grep", "webfetch", "grep_app_searchgithub", "websearch_web_search_exa"];
|
|
3
|
+
export declare const JSON_ERROR_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
|
|
4
|
+
export declare const JSON_ERROR_REMINDER = "\n[JSON PARSE ERROR - IMMEDIATE ACTION REQUIRED]\n\nYou sent invalid JSON arguments. The system could not parse your tool call.\nSTOP and do this NOW:\n\n1. LOOK at the error message above to see what was expected vs what you sent.\n2. CORRECT your JSON syntax (missing braces, unescaped quotes, trailing commas, etc).\n3. RETRY the tool call with valid JSON.\n\nDO NOT repeat the exact same invalid call.\n";
|
|
5
|
+
interface ToolExecuteAfterInput {
|
|
6
|
+
tool: string;
|
|
7
|
+
sessionID: string;
|
|
8
|
+
callID: string;
|
|
9
|
+
}
|
|
10
|
+
interface ToolExecuteAfterOutput {
|
|
11
|
+
title: string;
|
|
12
|
+
output: unknown;
|
|
13
|
+
metadata: unknown;
|
|
14
|
+
}
|
|
15
|
+
export declare function createJsonErrorRecoveryHook(_ctx: PluginInput): {
|
|
16
|
+
'tool.execute.after': (input: ToolExecuteAfterInput, output: ToolExecuteAfterOutput) => Promise<void>;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createJsonErrorRecoveryHook, JSON_ERROR_PATTERNS, JSON_ERROR_REMINDER, JSON_ERROR_TOOL_EXCLUDE_LIST, } from './hook';
|