oh-my-opencode-slim 0.9.13 → 0.9.15
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 +116 -56
- package/dist/agents/orchestrator.d.ts +2 -1
- package/dist/background/background-manager.d.ts +9 -1
- package/dist/background/multiplexer-session-manager.d.ts +2 -0
- package/dist/cli/index.js +49 -50
- package/dist/cli/types.d.ts +0 -1
- package/dist/config/schema.d.ts +5 -0
- package/dist/index.js +1090 -125694
- package/dist/multiplexer/factory.d.ts +5 -1
- package/dist/multiplexer/tmux/index.d.ts +3 -1
- package/dist/multiplexer/types.d.ts +2 -2
- package/dist/multiplexer/zellij/index.d.ts +1 -1
- package/dist/tools/smartfetch/utils.d.ts +1 -1
- package/dist/utils/agent-variant.d.ts +15 -1
- package/oh-my-opencode-slim.schema.json +12 -0
- package/package.json +5 -3
- package/src/skills/simplify/README.md +19 -0
- package/src/skills/simplify/SKILL.md +138 -0
- package/dist/background/tmux-session-manager.d.ts +0 -63
- package/dist/cli/chutes-selection.d.ts +0 -3
- package/dist/cli/dynamic-model-selection.d.ts +0 -14
- package/dist/cli/external-rankings.d.ts +0 -8
- package/dist/cli/model-selection.d.ts +0 -30
- package/dist/cli/opencode-models.d.ts +0 -18
- package/dist/cli/opencode-selection.d.ts +0 -3
- package/dist/cli/precedence-resolver.d.ts +0 -16
- package/dist/cli/scoring-v2/engine.d.ts +0 -4
- package/dist/cli/scoring-v2/features.d.ts +0 -3
- package/dist/cli/scoring-v2/index.d.ts +0 -4
- package/dist/cli/scoring-v2/types.d.ts +0 -17
- package/dist/cli/scoring-v2/weights.d.ts +0 -2
- package/dist/hooks/autopilot/index.d.ts +0 -43
- package/dist/hooks/post-read-nudge/index.d.ts +0 -18
- package/dist/interview/repository.d.ts +0 -12
- package/dist/interview/schemas.d.ts +0 -27
- package/dist/tools/grep/cli.d.ts +0 -3
- package/dist/tools/grep/constants.d.ts +0 -18
- package/dist/tools/grep/downloader.d.ts +0 -3
- package/dist/tools/grep/index.d.ts +0 -5
- package/dist/tools/grep/tools.d.ts +0 -2
- package/dist/tools/grep/types.d.ts +0 -35
- package/dist/tools/grep/utils.d.ts +0 -2
- package/dist/utils/tmux.d.ts +0 -32
|
@@ -4,7 +4,11 @@
|
|
|
4
4
|
import type { MultiplexerConfig } from '../config/schema';
|
|
5
5
|
import type { Multiplexer } from './types';
|
|
6
6
|
/**
|
|
7
|
-
* Create
|
|
7
|
+
* Create a multiplexer instance based on config.
|
|
8
|
+
*
|
|
9
|
+
* Do not cache instances: tmux/zellij integrations may depend on
|
|
10
|
+
* per-process environment like TMUX_PANE/ZELLIJ, which should be captured
|
|
11
|
+
* fresh for each plugin context.
|
|
8
12
|
*/
|
|
9
13
|
export declare function getMultiplexer(config: MultiplexerConfig): Multiplexer | null;
|
|
10
14
|
/**
|
|
@@ -9,12 +9,14 @@ export declare class TmuxMultiplexer implements Multiplexer {
|
|
|
9
9
|
private hasChecked;
|
|
10
10
|
private storedLayout;
|
|
11
11
|
private storedMainPaneSize;
|
|
12
|
+
private targetPane;
|
|
12
13
|
constructor(layout?: MultiplexerLayout, mainPaneSize?: number);
|
|
13
14
|
isAvailable(): Promise<boolean>;
|
|
14
15
|
isInsideSession(): boolean;
|
|
15
|
-
spawnPane(sessionId: string, description: string, serverUrl: string): Promise<PaneResult>;
|
|
16
|
+
spawnPane(sessionId: string, description: string, serverUrl: string, directory: string): Promise<PaneResult>;
|
|
16
17
|
closePane(paneId: string): Promise<boolean>;
|
|
17
18
|
applyLayout(layout: MultiplexerLayout, mainPaneSize: number): Promise<void>;
|
|
18
19
|
private getBinary;
|
|
20
|
+
private targetArgs;
|
|
19
21
|
private findBinary;
|
|
20
22
|
}
|
|
@@ -28,9 +28,9 @@ export interface Multiplexer {
|
|
|
28
28
|
* @param sessionId - The OpenCode session ID to attach to
|
|
29
29
|
* @param description - Human-readable description for the pane
|
|
30
30
|
* @param serverUrl - The OpenCode server URL to attach to
|
|
31
|
-
* @
|
|
31
|
+
* @param directory - The project directory to attach from
|
|
32
32
|
*/
|
|
33
|
-
spawnPane(sessionId: string, description: string, serverUrl: string): Promise<PaneResult>;
|
|
33
|
+
spawnPane(sessionId: string, description: string, serverUrl: string, directory: string): Promise<PaneResult>;
|
|
34
34
|
/**
|
|
35
35
|
* Close a pane by its ID
|
|
36
36
|
* @param paneId - The pane ID returned by spawnPane
|
|
@@ -18,7 +18,7 @@ export declare class ZellijMultiplexer implements Multiplexer {
|
|
|
18
18
|
constructor(layout?: MultiplexerLayout, mainPaneSize?: number);
|
|
19
19
|
isAvailable(): Promise<boolean>;
|
|
20
20
|
isInsideSession(): boolean;
|
|
21
|
-
spawnPane(sessionId: string, description: string, serverUrl: string): Promise<PaneResult>;
|
|
21
|
+
spawnPane(sessionId: string, description: string, serverUrl: string, directory: string): Promise<PaneResult>;
|
|
22
22
|
private createPaneInAgentTab;
|
|
23
23
|
private runInPane;
|
|
24
24
|
private ensureAgentTab;
|
|
@@ -11,7 +11,7 @@ export declare function joinRenderedContent(metadata: string, content: string, f
|
|
|
11
11
|
export declare function renderMessageForFormat(content: string, format: 'text' | 'markdown' | 'html'): string;
|
|
12
12
|
export declare function buildRedirectResultMessage(originalUrl: string, redirectUrl: string, statusCode: number): string;
|
|
13
13
|
export declare function buildLlmsRequiredMessage(originalUrl: string, reason?: string): string;
|
|
14
|
-
export declare function extractFromHtml(html: string, finalUrl: string, extractMain: boolean): ExtractedContent
|
|
14
|
+
export declare function extractFromHtml(html: string, finalUrl: string, extractMain: boolean): Promise<ExtractedContent>;
|
|
15
15
|
export declare function inferCanonicalUrlFromText(content: string, finalUrl: string): string | undefined;
|
|
16
16
|
export declare function extractHeadingsFromMarkdown(content: string): string[] | undefined;
|
|
17
17
|
export declare function detectQualitySignals(fetchResult: Pick<CachedFetch, 'text' | 'markdown' | 'rawContent' | 'wordCount' | 'sourceKind' | 'extractedMain'>): string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type PluginConfig } from '../config';
|
|
2
2
|
/**
|
|
3
3
|
* Normalizes an agent name by trimming whitespace and removing the optional @ prefix.
|
|
4
4
|
*
|
|
@@ -27,6 +27,20 @@ export declare function normalizeAgentName(agentName: string): string;
|
|
|
27
27
|
* resolveAgentVariant(config, "@oracle") // returns "high" if configured
|
|
28
28
|
*/
|
|
29
29
|
export declare function resolveAgentVariant(config: PluginConfig | undefined, agentName: string): string | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Resolve a runtime-provided agent name to an internal agent name.
|
|
32
|
+
*
|
|
33
|
+
* Supports:
|
|
34
|
+
* - internal names (e.g. "oracle")
|
|
35
|
+
* - @-prefixed names (e.g. "@oracle")
|
|
36
|
+
* - displayName aliases (e.g. "advisor" -> "oracle")
|
|
37
|
+
*/
|
|
38
|
+
export declare function resolveRuntimeAgentName(config: PluginConfig | undefined, agentName: string): string;
|
|
39
|
+
/**
|
|
40
|
+
* Rewrites user-facing display-name mentions (e.g. @advisor) into internal
|
|
41
|
+
* agent mentions (e.g. @oracle) for runtime routing.
|
|
42
|
+
*/
|
|
43
|
+
export declare function rewriteDisplayNameMentions(config: PluginConfig | undefined, text: string): string;
|
|
30
44
|
/**
|
|
31
45
|
* Applies a variant to a request body if the body doesn't already have one.
|
|
32
46
|
*
|
|
@@ -19,6 +19,10 @@
|
|
|
19
19
|
"balanceProviderUsage": {
|
|
20
20
|
"type": "boolean"
|
|
21
21
|
},
|
|
22
|
+
"showStartupToast": {
|
|
23
|
+
"description": "Show the startup activation toast when OpenCode starts. Defaults to true.",
|
|
24
|
+
"type": "boolean"
|
|
25
|
+
},
|
|
22
26
|
"manualPlan": {
|
|
23
27
|
"type": "object",
|
|
24
28
|
"properties": {
|
|
@@ -265,6 +269,10 @@
|
|
|
265
269
|
"type": "string"
|
|
266
270
|
},
|
|
267
271
|
"additionalProperties": {}
|
|
272
|
+
},
|
|
273
|
+
"displayName": {
|
|
274
|
+
"type": "string",
|
|
275
|
+
"minLength": 1
|
|
268
276
|
}
|
|
269
277
|
}
|
|
270
278
|
}
|
|
@@ -335,6 +343,10 @@
|
|
|
335
343
|
"type": "string"
|
|
336
344
|
},
|
|
337
345
|
"additionalProperties": {}
|
|
346
|
+
},
|
|
347
|
+
"displayName": {
|
|
348
|
+
"type": "string",
|
|
349
|
+
"minLength": 1
|
|
338
350
|
}
|
|
339
351
|
}
|
|
340
352
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oh-my-opencode-slim",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.15",
|
|
4
4
|
"description": "Lightweight agent orchestration plugin for OpenCode - a slimmed-down fork of oh-my-opencode",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -36,14 +36,16 @@
|
|
|
36
36
|
"LICENSE"
|
|
37
37
|
],
|
|
38
38
|
"scripts": {
|
|
39
|
-
"build:plugin": "bun build src/index.ts --outdir dist --target node --format esm --external @ast-grep/napi --external @opencode-ai/plugin --external @opencode-ai/sdk",
|
|
40
|
-
"build:cli": "bun build src/cli/index.ts --outdir dist/cli --target node --format esm --external @ast-grep/napi --external @opencode-ai/plugin --external @opencode-ai/sdk",
|
|
39
|
+
"build:plugin": "bun build src/index.ts --outdir dist --target node --format esm --external @ast-grep/napi --external @opencode-ai/plugin --external @opencode-ai/sdk --external jsdom",
|
|
40
|
+
"build:cli": "bun build src/cli/index.ts --outdir dist/cli --target node --format esm --external @ast-grep/napi --external @opencode-ai/plugin --external @opencode-ai/sdk --external jsdom",
|
|
41
41
|
"build": "bun run build:plugin && bun run build:cli && tsc --emitDeclarationOnly && bun run generate-schema",
|
|
42
42
|
"prepare": "bun run build",
|
|
43
43
|
"contributors:add": "all-contributors add",
|
|
44
44
|
"contributors:check": "all-contributors check",
|
|
45
45
|
"contributors:generate": "all-contributors generate",
|
|
46
46
|
"generate-schema": "bun run scripts/generate-schema.ts",
|
|
47
|
+
"verify:release": "bun run scripts/verify-release-artifact.ts",
|
|
48
|
+
"verify:host-smoke": "bun run scripts/verify-opencode-host-smoke.ts",
|
|
47
49
|
"typecheck": "tsc --noEmit",
|
|
48
50
|
"test": "bun test",
|
|
49
51
|
"lint": "biome lint .",
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Simplify Skill
|
|
2
|
+
|
|
3
|
+
Behavior-preserving code simplification and readability-focused refactoring.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This bundled skill helps the `oracle` agent review and simplify code without
|
|
8
|
+
changing behavior. It focuses on readability, maintainability, and reducing
|
|
9
|
+
unnecessary complexity.
|
|
10
|
+
|
|
11
|
+
## Source
|
|
12
|
+
|
|
13
|
+
Adapted from Addy Osmani's
|
|
14
|
+
[`code-simplification` skill](https://github.com/addyosmani/agent-skills/blob/main/skills/code-simplification/SKILL.md).
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
Bundled with `oh-my-opencode-slim` and installed automatically when bundled
|
|
19
|
+
skills are enabled via the installer.
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: simplify
|
|
3
|
+
description: Simplifies code for clarity without changing behavior. Use for readability, maintainability, and complexity reduction after behavior is understood.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Code Simplification
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Simplify code by reducing complexity while preserving exact behavior. The goal is not fewer lines — it's code that is easier to read, understand, modify, and debug. Every simplification must pass a simple test: "Would a new team member understand this faster than the original?"
|
|
11
|
+
|
|
12
|
+
## When to Use
|
|
13
|
+
|
|
14
|
+
- After a feature is working and tests pass, but the implementation feels heavier than it needs to be
|
|
15
|
+
- During code review when readability or complexity issues are flagged
|
|
16
|
+
- When you encounter deeply nested logic, long functions, or unclear names
|
|
17
|
+
- When refactoring code written under time pressure
|
|
18
|
+
- When consolidating related logic scattered across files
|
|
19
|
+
- After merging changes that introduced duplication or inconsistency
|
|
20
|
+
|
|
21
|
+
**When NOT to use:**
|
|
22
|
+
|
|
23
|
+
- Code is already clean and readable — don't simplify for the sake of it
|
|
24
|
+
- You don't understand what the code does yet — comprehend before you simplify
|
|
25
|
+
- The code is performance-critical and the "simpler" version would be measurably slower
|
|
26
|
+
- You're about to rewrite the module entirely — simplifying throwaway code wastes effort
|
|
27
|
+
|
|
28
|
+
## The Five Principles
|
|
29
|
+
|
|
30
|
+
### 1. Preserve Behavior Exactly
|
|
31
|
+
|
|
32
|
+
Don't change what the code does — only how it expresses it. All inputs, outputs, side effects, error behavior, and edge cases must remain identical. If you're not sure a simplification preserves behavior, don't make it.
|
|
33
|
+
|
|
34
|
+
Before every change, ask:
|
|
35
|
+
|
|
36
|
+
- Does this produce the same output for every input?
|
|
37
|
+
- Does this maintain the same error behavior?
|
|
38
|
+
- Does this preserve the same side effects and ordering?
|
|
39
|
+
- Do all existing tests still pass without modification?
|
|
40
|
+
|
|
41
|
+
### 2. Follow Project Conventions
|
|
42
|
+
|
|
43
|
+
Simplification means making code more consistent with the codebase, not imposing external preferences.
|
|
44
|
+
|
|
45
|
+
Before simplifying:
|
|
46
|
+
|
|
47
|
+
1. Read `AGENTS.md` / project conventions
|
|
48
|
+
2. Study how neighboring code handles similar patterns
|
|
49
|
+
3. Match the project's style for imports, naming, function style, error handling, and type annotations
|
|
50
|
+
|
|
51
|
+
Simplification that breaks project consistency is not simplification — it's churn.
|
|
52
|
+
|
|
53
|
+
### 3. Prefer Clarity Over Cleverness
|
|
54
|
+
|
|
55
|
+
Explicit code is better than compact code when the compact version requires a mental pause to parse.
|
|
56
|
+
|
|
57
|
+
- Replace nested ternaries with readable control flow
|
|
58
|
+
- Replace dense inline transforms with named intermediate steps when they clarify intent
|
|
59
|
+
- Keep helpful names even if they cost a few extra lines
|
|
60
|
+
|
|
61
|
+
### 4. Maintain Balance
|
|
62
|
+
|
|
63
|
+
Watch for over-simplification:
|
|
64
|
+
|
|
65
|
+
- Don't inline away names that carry meaning
|
|
66
|
+
- Don't merge unrelated logic into one larger function
|
|
67
|
+
- Don't remove abstractions that serve testability or extensibility
|
|
68
|
+
- Don't optimize for line count over comprehension
|
|
69
|
+
|
|
70
|
+
### 5. Scope to What Changed
|
|
71
|
+
|
|
72
|
+
Default to simplifying recently modified code. Avoid unrelated drive-by refactors unless explicitly asked.
|
|
73
|
+
|
|
74
|
+
## Process
|
|
75
|
+
|
|
76
|
+
### Step 1: Understand Before Touching
|
|
77
|
+
|
|
78
|
+
Before changing or removing anything, understand why it exists.
|
|
79
|
+
|
|
80
|
+
Answer:
|
|
81
|
+
|
|
82
|
+
- What is this code's responsibility?
|
|
83
|
+
- What calls it? What does it call?
|
|
84
|
+
- What are the edge cases and error paths?
|
|
85
|
+
- Are there tests that define expected behavior?
|
|
86
|
+
- Why might it have been written this way?
|
|
87
|
+
|
|
88
|
+
If you can't answer these, read more context first.
|
|
89
|
+
|
|
90
|
+
### Step 2: Look for Simplification Opportunities
|
|
91
|
+
|
|
92
|
+
Signals:
|
|
93
|
+
|
|
94
|
+
- Deep nesting
|
|
95
|
+
- Long functions with mixed responsibilities
|
|
96
|
+
- Nested ternaries
|
|
97
|
+
- Boolean flag arguments
|
|
98
|
+
- Repeated conditionals
|
|
99
|
+
- Generic or misleading names
|
|
100
|
+
- Duplicated logic
|
|
101
|
+
- Dead code
|
|
102
|
+
- Wrappers or abstractions that add no value
|
|
103
|
+
|
|
104
|
+
### Step 3: Apply Changes Incrementally
|
|
105
|
+
|
|
106
|
+
Make one simplification at a time.
|
|
107
|
+
|
|
108
|
+
For each simplification:
|
|
109
|
+
|
|
110
|
+
1. Make the change
|
|
111
|
+
2. Run relevant tests
|
|
112
|
+
3. Keep it only if behavior is preserved
|
|
113
|
+
|
|
114
|
+
Separate refactoring from feature work whenever possible.
|
|
115
|
+
|
|
116
|
+
### Step 4: Verify the Result
|
|
117
|
+
|
|
118
|
+
After simplifying, confirm:
|
|
119
|
+
|
|
120
|
+
- The code is genuinely easier to understand
|
|
121
|
+
- The diff is clean and reviewable
|
|
122
|
+
- Project conventions still match
|
|
123
|
+
- No behavior, error handling, or side effects changed
|
|
124
|
+
|
|
125
|
+
## Guidance for This Repository
|
|
126
|
+
|
|
127
|
+
- Prefer straightforward TypeScript over clever compression
|
|
128
|
+
- Preserve existing runtime behavior, tests, and hooks
|
|
129
|
+
- Favor explicit names and smaller focused helpers when they improve readability
|
|
130
|
+
- Keep refactors tightly scoped to the task or review feedback
|
|
131
|
+
|
|
132
|
+
## Verification Checklist
|
|
133
|
+
|
|
134
|
+
- [ ] Existing tests pass without modification
|
|
135
|
+
- [ ] Build/typecheck/lint still pass
|
|
136
|
+
- [ ] No unrelated files were refactored
|
|
137
|
+
- [ ] No error handling was weakened or removed
|
|
138
|
+
- [ ] The result is simpler to review than the original
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import type { PluginInput } from '@opencode-ai/plugin';
|
|
2
|
-
import type { TmuxConfig } from '../config/schema';
|
|
3
|
-
/**
|
|
4
|
-
* Event shape for session events
|
|
5
|
-
*/
|
|
6
|
-
interface SessionEvent {
|
|
7
|
-
type: string;
|
|
8
|
-
properties?: {
|
|
9
|
-
info?: {
|
|
10
|
-
id?: string;
|
|
11
|
-
parentID?: string;
|
|
12
|
-
title?: string;
|
|
13
|
-
};
|
|
14
|
-
sessionID?: string;
|
|
15
|
-
status?: {
|
|
16
|
-
type: string;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* TmuxSessionManager tracks child sessions and spawns/closes tmux panes for them.
|
|
22
|
-
*
|
|
23
|
-
* Uses session.status events for completion detection instead of polling.
|
|
24
|
-
*/
|
|
25
|
-
export declare class TmuxSessionManager {
|
|
26
|
-
private client;
|
|
27
|
-
private tmuxConfig;
|
|
28
|
-
private serverUrl;
|
|
29
|
-
private sessions;
|
|
30
|
-
private pollInterval?;
|
|
31
|
-
private enabled;
|
|
32
|
-
constructor(ctx: PluginInput, tmuxConfig: TmuxConfig);
|
|
33
|
-
/**
|
|
34
|
-
* Handle session.created events.
|
|
35
|
-
* Spawns a tmux pane for child sessions (those with parentID).
|
|
36
|
-
*/
|
|
37
|
-
onSessionCreated(event: SessionEvent): Promise<void>;
|
|
38
|
-
/**
|
|
39
|
-
* Handle session.status events for completion detection.
|
|
40
|
-
* Uses session.status instead of deprecated session.idle.
|
|
41
|
-
*
|
|
42
|
-
* When a session becomes idle (completed), close its pane.
|
|
43
|
-
*/
|
|
44
|
-
onSessionStatus(event: SessionEvent): Promise<void>;
|
|
45
|
-
/**
|
|
46
|
-
* Handle session.deleted events.
|
|
47
|
-
* When a session is deleted, close its tmux pane immediately.
|
|
48
|
-
*/
|
|
49
|
-
onSessionDeleted(event: SessionEvent): Promise<void>;
|
|
50
|
-
private startPolling;
|
|
51
|
-
private stopPolling;
|
|
52
|
-
/**
|
|
53
|
-
* Poll sessions for status updates (fallback for reliability).
|
|
54
|
-
* Also handles timeout and missing session detection.
|
|
55
|
-
*/
|
|
56
|
-
private pollSessions;
|
|
57
|
-
private closeSession;
|
|
58
|
-
/**
|
|
59
|
-
* Clean up all tracked sessions.
|
|
60
|
-
*/
|
|
61
|
-
cleanup(): Promise<void>;
|
|
62
|
-
}
|
|
63
|
-
export {};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { OpenCodeFreeModel } from './types';
|
|
2
|
-
export declare function pickBestCodingChutesModel(models: OpenCodeFreeModel[]): OpenCodeFreeModel | null;
|
|
3
|
-
export declare function pickSupportChutesModel(models: OpenCodeFreeModel[], primaryModel?: string): OpenCodeFreeModel | null;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { DiscoveredModel, DynamicModelPlan, ExternalSignalMap, InstallConfig, ScoringEngineVersion } from './types';
|
|
2
|
-
declare const AGENTS: readonly ["orchestrator", "oracle", "designer", "explorer", "librarian", "fixer"];
|
|
3
|
-
type AgentName = (typeof AGENTS)[number];
|
|
4
|
-
export type V1RankedScore = {
|
|
5
|
-
model: string;
|
|
6
|
-
totalScore: number;
|
|
7
|
-
baseScore: number;
|
|
8
|
-
externalSignalBoost: number;
|
|
9
|
-
};
|
|
10
|
-
export declare function rankModelsV1WithBreakdown(models: DiscoveredModel[], agent: AgentName, externalSignals?: ExternalSignalMap): V1RankedScore[];
|
|
11
|
-
export declare function buildDynamicModelPlan(catalog: DiscoveredModel[], config: InstallConfig, externalSignals?: ExternalSignalMap, options?: {
|
|
12
|
-
scoringEngineVersion?: ScoringEngineVersion;
|
|
13
|
-
}): DynamicModelPlan | null;
|
|
14
|
-
export {};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export interface ModelSelectionCandidate {
|
|
2
|
-
model: string;
|
|
3
|
-
status?: 'alpha' | 'beta' | 'deprecated' | 'active';
|
|
4
|
-
contextLimit?: number;
|
|
5
|
-
outputLimit?: number;
|
|
6
|
-
reasoning?: boolean;
|
|
7
|
-
toolcall?: boolean;
|
|
8
|
-
attachment?: boolean;
|
|
9
|
-
tags?: string[];
|
|
10
|
-
meta?: Record<string, unknown>;
|
|
11
|
-
}
|
|
12
|
-
export interface RankedModel<T extends ModelSelectionCandidate> {
|
|
13
|
-
candidate: T;
|
|
14
|
-
score: number;
|
|
15
|
-
}
|
|
16
|
-
export interface SelectionOptions<T extends ModelSelectionCandidate> {
|
|
17
|
-
excludeModels?: string[];
|
|
18
|
-
tieBreaker?: (left: T, right: T) => number;
|
|
19
|
-
}
|
|
20
|
-
export type ScoreFunction<T extends ModelSelectionCandidate> = (candidate: T) => number;
|
|
21
|
-
export interface RoleScoring<T extends ModelSelectionCandidate> {
|
|
22
|
-
primary: ScoreFunction<T>;
|
|
23
|
-
support: ScoreFunction<T>;
|
|
24
|
-
}
|
|
25
|
-
export declare function rankModels<T extends ModelSelectionCandidate>(models: T[], scoreFn: ScoreFunction<T>, options?: SelectionOptions<T>): RankedModel<T>[];
|
|
26
|
-
export declare function pickBestModel<T extends ModelSelectionCandidate>(models: T[], scoreFn: ScoreFunction<T>, options?: SelectionOptions<T>): T | null;
|
|
27
|
-
export declare function pickPrimaryAndSupport<T extends ModelSelectionCandidate>(models: T[], scoring: RoleScoring<T>, preferredPrimaryModel?: string): {
|
|
28
|
-
primary: T | null;
|
|
29
|
-
support: T | null;
|
|
30
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { DiscoveredModel, OpenCodeFreeModel } from './types';
|
|
2
|
-
export declare function parseOpenCodeModelsVerboseOutput(output: string, providerFilter?: string, freeOnly?: boolean): DiscoveredModel[];
|
|
3
|
-
export declare function discoverModelCatalog(): Promise<{
|
|
4
|
-
models: DiscoveredModel[];
|
|
5
|
-
error?: string;
|
|
6
|
-
}>;
|
|
7
|
-
export declare function discoverOpenCodeFreeModels(): Promise<{
|
|
8
|
-
models: OpenCodeFreeModel[];
|
|
9
|
-
error?: string;
|
|
10
|
-
}>;
|
|
11
|
-
export declare function discoverProviderFreeModels(providerID: string): Promise<{
|
|
12
|
-
models: OpenCodeFreeModel[];
|
|
13
|
-
error?: string;
|
|
14
|
-
}>;
|
|
15
|
-
export declare function discoverProviderModels(providerID: string): Promise<{
|
|
16
|
-
models: DiscoveredModel[];
|
|
17
|
-
error?: string;
|
|
18
|
-
}>;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { OpenCodeFreeModel } from './types';
|
|
2
|
-
export declare function pickBestCodingOpenCodeModel(models: OpenCodeFreeModel[]): OpenCodeFreeModel | null;
|
|
3
|
-
export declare function pickSupportOpenCodeModel(models: OpenCodeFreeModel[], primaryModel?: string): OpenCodeFreeModel | null;
|
|
@@ -1,16 +0,0 @@
|
|
|
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;
|
|
@@ -1,4 +0,0 @@
|
|
|
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[];
|
|
@@ -1,3 +0,0 @@
|
|
|
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;
|
|
@@ -1,17 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
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, };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Post-Read nudge - appends a delegation reminder after file reads.
|
|
3
|
-
* Catches the "read files → implement myself" anti-pattern.
|
|
4
|
-
*/
|
|
5
|
-
interface ToolExecuteAfterInput {
|
|
6
|
-
tool: string;
|
|
7
|
-
sessionID?: string;
|
|
8
|
-
callID?: string;
|
|
9
|
-
}
|
|
10
|
-
interface ToolExecuteAfterOutput {
|
|
11
|
-
title: string;
|
|
12
|
-
output: string;
|
|
13
|
-
metadata: Record<string, unknown>;
|
|
14
|
-
}
|
|
15
|
-
export declare function createPostReadNudgeHook(): {
|
|
16
|
-
'tool.execute.after': (input: ToolExecuteAfterInput, output: ToolExecuteAfterOutput) => Promise<void>;
|
|
17
|
-
};
|
|
18
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { InterviewAssistantState, InterviewMessage, InterviewRecord, InterviewSnapshot } from './types';
|
|
2
|
-
export declare function transcriptPath(directory: string, id: string): string;
|
|
3
|
-
export declare function summaryPath(directory: string, id: string): string;
|
|
4
|
-
export declare function snapshotPath(directory: string, id: string): string;
|
|
5
|
-
export declare function ensureInterviewDirectory(directory: string): Promise<void>;
|
|
6
|
-
export declare function writeInterviewRecord(record: InterviewRecord): Promise<void>;
|
|
7
|
-
export declare function readInterviewRecord(directory: string, id: string): Promise<InterviewRecord | null>;
|
|
8
|
-
export declare function writeInterviewSnapshot(record: InterviewRecord, snapshot: InterviewSnapshot): Promise<void>;
|
|
9
|
-
export declare function readInterviewSnapshot(directory: string, id: string): Promise<InterviewSnapshot | null>;
|
|
10
|
-
export declare function findActiveInterviewBySession(directory: string, sessionID: string): Promise<InterviewRecord | null>;
|
|
11
|
-
export declare function writeTranscript(record: InterviewRecord, messages: InterviewMessage[]): Promise<void>;
|
|
12
|
-
export declare function writeSummary(record: InterviewRecord, state: InterviewAssistantState, answerCount: number): Promise<void>;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const interviewQuestionSchema: z.ZodObject<{
|
|
3
|
-
id: z.ZodOptional<z.ZodString>;
|
|
4
|
-
question: z.ZodString;
|
|
5
|
-
options: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
6
|
-
suggested: z.ZodOptional<z.ZodString>;
|
|
7
|
-
area: z.ZodOptional<z.ZodString>;
|
|
8
|
-
}, z.core.$strip>;
|
|
9
|
-
export declare const interviewAssistantStateSchema: z.ZodObject<{
|
|
10
|
-
summary: z.ZodDefault<z.ZodString>;
|
|
11
|
-
clarity: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
12
|
-
criticalAreas: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
13
|
-
questions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
14
|
-
id: z.ZodOptional<z.ZodString>;
|
|
15
|
-
question: z.ZodString;
|
|
16
|
-
options: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
17
|
-
suggested: z.ZodOptional<z.ZodString>;
|
|
18
|
-
area: z.ZodOptional<z.ZodString>;
|
|
19
|
-
}, z.core.$strip>>>;
|
|
20
|
-
readyToExport: z.ZodDefault<z.ZodBoolean>;
|
|
21
|
-
}, z.core.$strip>;
|
|
22
|
-
export declare const interviewAnswersPayloadSchema: z.ZodObject<{
|
|
23
|
-
answers: z.ZodArray<z.ZodObject<{
|
|
24
|
-
questionId: z.ZodString;
|
|
25
|
-
answer: z.ZodString;
|
|
26
|
-
}, z.core.$strip>>;
|
|
27
|
-
}, z.core.$strip>;
|
package/dist/tools/grep/cli.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export type GrepBackend = 'rg' | 'grep';
|
|
2
|
-
interface ResolvedCli {
|
|
3
|
-
path: string;
|
|
4
|
-
backend: GrepBackend;
|
|
5
|
-
}
|
|
6
|
-
export declare function getDataDir(): string;
|
|
7
|
-
export declare function resolveGrepCli(): ResolvedCli;
|
|
8
|
-
export declare function resolveGrepCliWithAutoInstall(): Promise<ResolvedCli>;
|
|
9
|
-
export declare const DEFAULT_MAX_DEPTH = 20;
|
|
10
|
-
export declare const DEFAULT_MAX_FILESIZE = "10M";
|
|
11
|
-
export declare const DEFAULT_MAX_COUNT = 500;
|
|
12
|
-
export declare const DEFAULT_MAX_COLUMNS = 1000;
|
|
13
|
-
export declare const DEFAULT_CONTEXT = 2;
|
|
14
|
-
export declare const DEFAULT_TIMEOUT_MS = 300000;
|
|
15
|
-
export declare const DEFAULT_MAX_OUTPUT_BYTES: number;
|
|
16
|
-
export declare const RG_SAFETY_FLAGS: readonly ["--no-follow", "--color=never", "--no-heading", "--line-number", "--with-filename"];
|
|
17
|
-
export declare const GREP_SAFETY_FLAGS: readonly ["-n", "-H", "--color=never"];
|
|
18
|
-
export {};
|