thoth-agents 0.12.0 → 0.13.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.md +11 -2
- package/dist/{chunk-SEF6PFM6.js → chunk-5MYXVRZZ.js} +132 -157
- package/dist/chunk-6O4GKDS7.js +207 -0
- package/dist/{chunk-QOA2AETX.js → chunk-NOLDFT7O.js} +3 -3
- package/dist/{chunk-7F33WUSD.js → chunk-VVYAQTYE.js} +2 -2
- package/dist/{chunk-NY2IPJ7V.js → chunk-YCWGTDFE.js} +531 -233
- package/dist/cli/index.js +6 -6
- package/dist/cli/opencode-profiles.d.ts +10 -0
- package/dist/cli/tui/index.js +3 -3
- package/dist/config/loader.d.ts +1 -4
- package/dist/config/schema.d.ts +0 -22
- package/dist/index.js +824 -30
- package/dist/opencode/context.d.ts +16 -0
- package/dist/opencode/profile-rpc-handlers.d.ts +3 -0
- package/dist/opencode/profile-rpc.d.ts +688 -0
- package/dist/opencode/profile-runtime.d.ts +3 -0
- package/dist/opencode/profile-sessions.d.ts +18 -0
- package/dist/opencode/profiles/editor.d.ts +44 -0
- package/dist/opencode/profiles/index.d.ts +18 -0
- package/dist/opencode/profiles/resolver.d.ts +12 -0
- package/dist/opencode/profiles/store.d.ts +63 -0
- package/dist/opencode/profiles/types.d.ts +26 -0
- package/dist/opencode/tool-overrides/evaluator.d.ts +13 -0
- package/dist/opencode/tool-overrides/index.d.ts +5 -0
- package/dist/opencode/tool-overrides/store.d.ts +38 -0
- package/dist/opencode/tool-overrides/types.d.ts +32 -0
- package/dist/opencode/tool-overrides/validation.d.ts +5 -0
- package/dist/opencode/tool-overrides/wildcard.d.ts +3 -0
- package/dist/opencode/tool-rpc-handlers.d.ts +3 -0
- package/dist/opencode/tool-rpc.d.ts +428 -0
- package/dist/pi.js +2 -2
- package/dist/tui/fixtures.d.ts +2 -0
- package/dist/tui/flow.d.ts +16 -0
- package/dist/tui/index.d.ts +7 -0
- package/dist/tui/index.js +1384 -0
- package/dist/tui/model.d.ts +84 -0
- package/dist/tui/tools/fixtures.d.ts +3 -0
- package/dist/tui/tools/flow.d.ts +11 -0
- package/dist/tui/tools/model.d.ts +97 -0
- package/package.json +5 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/.codex-plugin/plugin.json +1 -1
- package/thoth-agents.schema.json +0 -70
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/** Pure view-model for the `/subagents-model` panel: no dialogs, no RPC. */
|
|
2
|
+
import type { ProfileRpcInput, ProfileState } from '../opencode/profile-rpc';
|
|
3
|
+
export declare const DEFAULT_PROFILE = "default";
|
|
4
|
+
export type Profile = ProfileRpcInput<'create'>['profile'];
|
|
5
|
+
export type RoleModel = Profile['agents'][keyof Profile['agents'] & string];
|
|
6
|
+
export type Role = ProfileState['roles'][number];
|
|
7
|
+
export type Scope = 'global' | 'project';
|
|
8
|
+
export type SelectionScope = 'session' | 'project' | 'global';
|
|
9
|
+
export type ProfileKey = 'default' | `${Scope}:${string}`;
|
|
10
|
+
export interface ProfileRow {
|
|
11
|
+
key: ProfileKey;
|
|
12
|
+
name: string;
|
|
13
|
+
/** Undefined for the virtual `default`. */
|
|
14
|
+
scope?: Scope;
|
|
15
|
+
shadowed: boolean;
|
|
16
|
+
profile: Profile;
|
|
17
|
+
revision?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface Markers {
|
|
20
|
+
effective: boolean;
|
|
21
|
+
session: boolean;
|
|
22
|
+
project: boolean;
|
|
23
|
+
global: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare const profileKey: (name: string, scope?: Scope) => ProfileKey;
|
|
26
|
+
export declare function profileRows(state: ProfileState): ProfileRow[];
|
|
27
|
+
export declare function markersFor(state: ProfileState, row: ProfileRow): Markers;
|
|
28
|
+
export declare const markerLetters: (markers: Markers) => string;
|
|
29
|
+
/** `● SPG name` — ● marks the profile runs currently use. */
|
|
30
|
+
export declare function profileTitle(row: ProfileRow, markers: Markers): string;
|
|
31
|
+
export declare function profileDescription(row: ProfileRow): string;
|
|
32
|
+
export declare const PROFILE_LEGEND = "\u25CF effective \u00B7 S session \u00B7 P project pin \u00B7 G global \u00B7 ~ shadowed";
|
|
33
|
+
export interface RoleView {
|
|
34
|
+
role: Role;
|
|
35
|
+
/** True when the row has no own model and shows a fallback. */
|
|
36
|
+
inherited: boolean;
|
|
37
|
+
model?: string;
|
|
38
|
+
variant?: string;
|
|
39
|
+
/** Where an inherited value comes from. */
|
|
40
|
+
inheritedFrom?: 'default' | 'session';
|
|
41
|
+
/** False when an own variant-only entry overrides the inherited variant. */
|
|
42
|
+
variantInherited?: boolean;
|
|
43
|
+
}
|
|
44
|
+
/** model + variant are a pair: an entry with a model owns its variant. */
|
|
45
|
+
export declare function roleViews(state: ProfileState, profile: Profile, isDefault: boolean): RoleView[];
|
|
46
|
+
export declare function roleLabel(view: RoleView): string;
|
|
47
|
+
export declare function roleDescription(view: RoleView): string;
|
|
48
|
+
export interface ModelChoice {
|
|
49
|
+
id: string;
|
|
50
|
+
name: string;
|
|
51
|
+
variants: string[];
|
|
52
|
+
}
|
|
53
|
+
export declare function providerModels(state: ProfileState, providerID: string): {
|
|
54
|
+
id: string;
|
|
55
|
+
name: string;
|
|
56
|
+
models: ModelChoice[];
|
|
57
|
+
} | undefined;
|
|
58
|
+
export declare function variantsOf(state: ProfileState, modelId: string): string[];
|
|
59
|
+
/** Case-insensitive search over title, id and description. */
|
|
60
|
+
export declare function searchOptions<T extends {
|
|
61
|
+
title: string;
|
|
62
|
+
description?: string;
|
|
63
|
+
value: unknown;
|
|
64
|
+
}>(query: string, options: readonly T[]): T[];
|
|
65
|
+
export declare function validateProfileName(raw: string, scope: Scope, state: ProfileState): string | undefined;
|
|
66
|
+
/** Draft-until-save working copy of one persisted or new profile. */
|
|
67
|
+
export interface Draft {
|
|
68
|
+
scope: Scope;
|
|
69
|
+
name: string;
|
|
70
|
+
isNew: boolean;
|
|
71
|
+
/** Last persisted profile, for dirty detection. */
|
|
72
|
+
base: Profile;
|
|
73
|
+
/** Opaque token from the server; undefined until a new draft is created. */
|
|
74
|
+
revision?: string;
|
|
75
|
+
profile: Profile;
|
|
76
|
+
}
|
|
77
|
+
export declare const isDirty: (draft: Draft) => boolean;
|
|
78
|
+
export declare function withRole(profile: Profile, role: Role, value: RoleModel | undefined): Profile;
|
|
79
|
+
export declare function cloneProfile(profile: Profile): Profile;
|
|
80
|
+
export declare function openDraft(row: ProfileRow): Draft | undefined;
|
|
81
|
+
export declare function newDraft(scope: Scope, name: string, from: Profile): Draft;
|
|
82
|
+
export declare function activationMessage(scope: SelectionScope, name: string, state: ProfileState): string;
|
|
83
|
+
export declare function clearMessage(scope: SelectionScope, state: ProfileState): string;
|
|
84
|
+
export declare function selectionClearable(state: ProfileState, sessionAvailable: boolean): SelectionScope[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** `/subagents-tools` flow. Talks only to injected UI and RPC ports. */
|
|
2
|
+
import type { ToolRpcInput, ToolRpcMethod, ToolRpcOutput } from '../../opencode/tool-rpc';
|
|
3
|
+
import type { Ui } from '../flow';
|
|
4
|
+
export type ToolsRpcPort = {
|
|
5
|
+
[M in ToolRpcMethod]: (input: ToolRpcInput<M>) => Promise<ToolRpcOutput<M>>;
|
|
6
|
+
};
|
|
7
|
+
export interface ToolsFlowPorts {
|
|
8
|
+
ui: Ui;
|
|
9
|
+
rpc: ToolsRpcPort;
|
|
10
|
+
}
|
|
11
|
+
export declare function runToolsFlow(ports: ToolsFlowPorts): Promise<void>;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/** Pure view-model for the `/subagents-tools` panel: no dialogs, no RPC. */
|
|
2
|
+
import type { ToolState } from '../../opencode/tool-rpc';
|
|
3
|
+
export type ToolRole = ToolState['specialists'][number];
|
|
4
|
+
export type RoleState = ToolState['roles'][number];
|
|
5
|
+
export type Scope = 'global' | 'project';
|
|
6
|
+
export type Effect = 'allow' | 'ask' | 'deny';
|
|
7
|
+
export interface Override {
|
|
8
|
+
action: string;
|
|
9
|
+
effect: Effect;
|
|
10
|
+
}
|
|
11
|
+
export declare const LOCKED_ACTION = "subagent";
|
|
12
|
+
export declare const LOCKED_MESSAGE = "subagent is locked: specialists can never delegate, so it cannot be changed.";
|
|
13
|
+
/** Mirrors OpenCode wildcard semantics (`src/opencode/tool-overrides/wildcard.ts`) without pulling in fs code. */
|
|
14
|
+
export declare function matchAction(input: string, pattern: string, platform?: string): boolean;
|
|
15
|
+
/** Inherit removes every exact entry, leaving broader patterns intact. */
|
|
16
|
+
export declare const removeOverride: (overrides: readonly Override[], action: string) => Override[];
|
|
17
|
+
/** Explicit choices go last so broader patterns cannot supersede the edit. */
|
|
18
|
+
export declare const setOverride: (overrides: readonly Override[], value: Override) => Override[];
|
|
19
|
+
export declare const hasWildcard: (pattern: string) => boolean;
|
|
20
|
+
export declare const roleOf: (state: ToolState, role: ToolRole) => RoleState;
|
|
21
|
+
export interface ToolDraft {
|
|
22
|
+
role: ToolRole;
|
|
23
|
+
scope: Scope;
|
|
24
|
+
/** Overrides as last saved/loaded, for dirty detection. */
|
|
25
|
+
base: Override[];
|
|
26
|
+
overrides: Override[];
|
|
27
|
+
/** Whether the scope has an entry for the role (absent differs from an explicit empty list). */
|
|
28
|
+
present: boolean;
|
|
29
|
+
basePresent: boolean;
|
|
30
|
+
revision: string;
|
|
31
|
+
}
|
|
32
|
+
/** Overrides of the given scope; used when opening a draft. */
|
|
33
|
+
export declare function openDraft(state: ToolState, role: ToolRole, scope: Scope): ToolDraft;
|
|
34
|
+
export declare const isDirty: (draft: ToolDraft) => boolean;
|
|
35
|
+
/** Replaces the draft overrides; a changed project list makes the project entry present. */
|
|
36
|
+
export declare function applyOverrides(draft: ToolDraft, next: Override[]): void;
|
|
37
|
+
/** Makes an absent project entry an explicit empty list that masks global overrides. */
|
|
38
|
+
export declare function maskGlobal(draft: ToolDraft): void;
|
|
39
|
+
export interface EffectiveLayer {
|
|
40
|
+
/** Scope whose overrides apply after saving the draft. */
|
|
41
|
+
scope: 'default' | Scope;
|
|
42
|
+
overrides: Override[];
|
|
43
|
+
/** False when the edited scope would be shadowed by a project entry. */
|
|
44
|
+
controls: boolean;
|
|
45
|
+
}
|
|
46
|
+
/** Layering: a present project entry (even empty) replaces global entirely. */
|
|
47
|
+
export declare function effectiveLayer(state: ToolState, draft: ToolDraft): EffectiveLayer;
|
|
48
|
+
/** True when the edited scope is shadowed by a present project entry. */
|
|
49
|
+
export declare const isInactiveScope: (state: ToolState, draft: ToolDraft) => boolean;
|
|
50
|
+
/** Status line for the role view title. */
|
|
51
|
+
export declare function scopeStatus(state: ToolState, draft: ToolDraft): string;
|
|
52
|
+
/** Scope to preselect: the role's effective scope, else global. */
|
|
53
|
+
export declare const defaultScope: (role: RoleState) => Scope;
|
|
54
|
+
/** `2 denied, 1 ask` over the overrides in force for a role. */
|
|
55
|
+
export declare function roleSummary(role: RoleState): string;
|
|
56
|
+
export declare const scopeMarker: (role: RoleState) => string;
|
|
57
|
+
export declare function overviewTitle(role: RoleState): string;
|
|
58
|
+
export declare const OVERVIEW_LEGEND = "G global \u00B7 P project \u00B7 project replaces global";
|
|
59
|
+
export interface ActionRow {
|
|
60
|
+
action: string;
|
|
61
|
+
tools: string[];
|
|
62
|
+
locked: boolean;
|
|
63
|
+
effect: Effect;
|
|
64
|
+
/** `default` for untouched values, `entry` for exact entries, `pattern` for wildcard matches. */
|
|
65
|
+
source: 'default' | 'entry' | 'pattern';
|
|
66
|
+
via?: string;
|
|
67
|
+
/** Scope that supplies the shown effect after save. */
|
|
68
|
+
origin: 'default' | Scope;
|
|
69
|
+
/** Scope being edited. */
|
|
70
|
+
editScope: Scope;
|
|
71
|
+
/** True when a project entry shadows the edited global scope. */
|
|
72
|
+
inactive: boolean;
|
|
73
|
+
/** Effect the edited scope would give on its own while it is inactive. */
|
|
74
|
+
scopeEffect?: Effect;
|
|
75
|
+
/** True when the value differs from what state reports as saved. */
|
|
76
|
+
changed: boolean;
|
|
77
|
+
}
|
|
78
|
+
/** Preview the effective layer after save, over shipped effects, last-match-wins. */
|
|
79
|
+
export declare function previewRows(state: ToolState, draft: ToolDraft): ActionRow[];
|
|
80
|
+
export declare function rowTitle(row: ActionRow): string;
|
|
81
|
+
export declare function rowDescription(row: ActionRow): string;
|
|
82
|
+
export declare const ROLE_LEGEND = "\u25CF override \u00B7 \u25CB via pattern \u00B7 \u00B7 default \u00B7 \uD83D\uDD12 locked";
|
|
83
|
+
export interface ManualEntry extends Override {
|
|
84
|
+
matchCount: number;
|
|
85
|
+
}
|
|
86
|
+
/** Number of inventory actions an entry matches. */
|
|
87
|
+
export declare const countMatches: (state: ToolState, pattern: string) => number;
|
|
88
|
+
/** Entries that are wildcards or name no registered action (e.g. disconnected MCP servers). */
|
|
89
|
+
export declare function manualEntries(state: ToolState, draft: ToolDraft): ManualEntry[];
|
|
90
|
+
export declare const entryDescription: (entry: ManualEntry) => string;
|
|
91
|
+
export declare function validatePattern(raw: string): string | undefined;
|
|
92
|
+
/** Case-insensitive search over title and description. */
|
|
93
|
+
export declare function searchOptions<T extends {
|
|
94
|
+
title: string;
|
|
95
|
+
description?: string;
|
|
96
|
+
value: unknown;
|
|
97
|
+
}>(query: string, options: readonly T[]): T[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "thoth-agents",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Adaptive multi-harness orchestration with six roles, runtime-autonomous AI-first execution routes, and external provider boundaries.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
"types": "./dist/index.d.ts",
|
|
10
10
|
"default": "./dist/index.js"
|
|
11
11
|
},
|
|
12
|
+
"./tui": {
|
|
13
|
+
"types": "./dist/tui/index.d.ts",
|
|
14
|
+
"default": "./dist/tui/index.js"
|
|
15
|
+
},
|
|
12
16
|
"./package.json": "./package.json",
|
|
13
17
|
"./dist/*": "./dist/*",
|
|
14
18
|
"./skills/*": "./skills/*",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "thoth-agents",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Bundled AI-first work skills and MCP configuration; the six-role global Codex layer requires thoth-agents CLI setup.",
|
|
5
5
|
"skills": "./skills/",
|
|
6
6
|
"mcpServers": "./codex.mcp.json",
|
package/thoth-agents.schema.json
CHANGED
|
@@ -5,9 +5,6 @@
|
|
|
5
5
|
"$schema": {
|
|
6
6
|
"type": "string"
|
|
7
7
|
},
|
|
8
|
-
"preset": {
|
|
9
|
-
"type": "string"
|
|
10
|
-
},
|
|
11
8
|
"setDefaultAgent": {
|
|
12
9
|
"type": "boolean"
|
|
13
10
|
},
|
|
@@ -164,73 +161,6 @@
|
|
|
164
161
|
],
|
|
165
162
|
"additionalProperties": false
|
|
166
163
|
},
|
|
167
|
-
"presets": {
|
|
168
|
-
"type": "object",
|
|
169
|
-
"propertyNames": {
|
|
170
|
-
"type": "string"
|
|
171
|
-
},
|
|
172
|
-
"additionalProperties": {
|
|
173
|
-
"type": "object",
|
|
174
|
-
"propertyNames": {
|
|
175
|
-
"type": "string",
|
|
176
|
-
"pattern": "^(?!quick$|deep$).+$"
|
|
177
|
-
},
|
|
178
|
-
"additionalProperties": {
|
|
179
|
-
"type": "object",
|
|
180
|
-
"properties": {
|
|
181
|
-
"model": {
|
|
182
|
-
"anyOf": [
|
|
183
|
-
{
|
|
184
|
-
"type": "string"
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
"type": "array",
|
|
188
|
-
"items": {
|
|
189
|
-
"anyOf": [
|
|
190
|
-
{
|
|
191
|
-
"type": "string"
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
"type": "object",
|
|
195
|
-
"properties": {
|
|
196
|
-
"id": {
|
|
197
|
-
"type": "string"
|
|
198
|
-
},
|
|
199
|
-
"variant": {
|
|
200
|
-
"type": "string"
|
|
201
|
-
}
|
|
202
|
-
},
|
|
203
|
-
"required": ["id"]
|
|
204
|
-
}
|
|
205
|
-
]
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
]
|
|
209
|
-
},
|
|
210
|
-
"skills": {
|
|
211
|
-
"type": "array",
|
|
212
|
-
"items": {
|
|
213
|
-
"type": "string",
|
|
214
|
-
"minLength": 1
|
|
215
|
-
}
|
|
216
|
-
},
|
|
217
|
-
"temperature": {
|
|
218
|
-
"type": "number",
|
|
219
|
-
"minimum": 0,
|
|
220
|
-
"maximum": 2
|
|
221
|
-
},
|
|
222
|
-
"steps": {
|
|
223
|
-
"type": "integer",
|
|
224
|
-
"minimum": 1,
|
|
225
|
-
"maximum": 9007199254740991
|
|
226
|
-
},
|
|
227
|
-
"variant": {
|
|
228
|
-
"type": "string"
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
},
|
|
234
164
|
"agents": {
|
|
235
165
|
"type": "object",
|
|
236
166
|
"propertyNames": {
|