thoth-agents 0.7.0 → 0.8.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/dist/agents/prompt-dialects.d.ts +2 -1
- package/dist/{chunk-QOIZYJ5C.js → chunk-4DZSWTUM.js} +17 -6
- package/dist/{chunk-W5TSNGEE.js → chunk-5LW4CNA5.js} +4030 -3022
- package/dist/{chunk-P3GDM5RH.js → chunk-P7R4GDSO.js} +1 -1
- package/dist/{chunk-3MHJGWS4.js → chunk-ZLEMG37R.js} +1 -1
- package/dist/cli/codex-config-io.d.ts +34 -2
- package/dist/cli/codex-hook-consent.d.ts +5 -0
- package/dist/cli/codex-hook-trust.d.ts +23 -0
- package/dist/cli/codex-install.d.ts +21 -6
- package/dist/cli/codex-lifecycle.d.ts +13 -0
- package/dist/cli/codex-plugin-install.d.ts +21 -0
- package/dist/cli/index.js +538 -43
- package/dist/cli/managed-state-io.d.ts +19 -0
- package/dist/cli/operations/codex.d.ts +2 -0
- package/dist/cli/operations/types.d.ts +1 -1
- package/dist/cli/safe-atomic-write.d.ts +2 -0
- package/dist/cli/tui/index.js +56 -5
- package/dist/cli/tui/operations.d.ts +3 -1
- package/dist/cli/types.d.ts +4 -1
- package/dist/harness/adapters/codex-legacy-agents.d.ts +31 -0
- package/dist/harness/adapters/codex-surfaces.d.ts +1 -1
- package/dist/harness/adapters/codex.d.ts +3 -1
- package/dist/harness/codex-hook-script.d.ts +2 -0
- package/dist/harness/core/agent-pack.d.ts +2 -0
- package/dist/harness/writers/codex-plugin-package.d.ts +7 -0
- package/dist/index.js +2 -2
- package/dist/pi.js +2 -2
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/.codex-plugin/.thoth-agents-plugin-assets.json +48 -0
- package/plugin/.codex-plugin/plugin.json +3 -2
- package/plugin/codex-hooks/context.cjs +22 -0
- package/plugin/codex-hooks/hooks.json +32 -0
- package/plugin/codex-hooks/payloads/designer.md +72 -0
- package/plugin/codex-hooks/payloads/explorer.md +76 -0
- package/plugin/codex-hooks/payloads/librarian.md +76 -0
- package/plugin/codex-hooks/payloads/oracle.md +83 -0
- package/plugin/codex-hooks/payloads/root.md +105 -0
- package/plugin/codex-hooks/payloads/worker.md +72 -0
|
@@ -15,6 +15,8 @@ export interface CodexConfigMergeResult {
|
|
|
15
15
|
changed: boolean;
|
|
16
16
|
diffSummary: string[];
|
|
17
17
|
warnings: string[];
|
|
18
|
+
/** Raw prior TOML integer, or null when originally absent. */
|
|
19
|
+
priorThreadsValue?: string | null;
|
|
18
20
|
error?: string;
|
|
19
21
|
}
|
|
20
22
|
export declare function parseCodexToml(content: string): CodexTomlDocument;
|
|
@@ -26,10 +28,40 @@ export declare function mergeCodexManagedConfig(document: CodexTomlDocument, opt
|
|
|
26
28
|
diffSummary: string[];
|
|
27
29
|
warnings: string[];
|
|
28
30
|
};
|
|
31
|
+
interface TomlLine {
|
|
32
|
+
text: string;
|
|
33
|
+
eol: string;
|
|
34
|
+
}
|
|
29
35
|
export declare function patchCodexDefaultModeUserInputFeature(content: string): string;
|
|
30
|
-
export
|
|
36
|
+
export interface CodexManagedConfigOptions {
|
|
37
|
+
pluginId?: string;
|
|
38
|
+
manageThreads?: boolean;
|
|
39
|
+
priorThreadsValue?: string | null;
|
|
40
|
+
trustedHooks?: Record<string, string>;
|
|
41
|
+
}
|
|
42
|
+
/** Locate a scalar by its semantic TOML path, accepting quoted and dotted keys.
|
|
43
|
+
* Never serialize the document: all bytes outside the selected value survive.
|
|
44
|
+
*/
|
|
45
|
+
export declare function scalarLocation(content: string, path: string[]): {
|
|
46
|
+
lines: TomlLine[];
|
|
47
|
+
match: {
|
|
48
|
+
index: number;
|
|
49
|
+
prefix: string;
|
|
50
|
+
value: string;
|
|
51
|
+
suffix: string;
|
|
52
|
+
};
|
|
53
|
+
sectionStart: number;
|
|
54
|
+
sectionEnd: number;
|
|
55
|
+
insertionSection: {
|
|
56
|
+
path: string[];
|
|
57
|
+
start: number;
|
|
58
|
+
end: number;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
export declare function readCodexThreadsValue(content: string): string | null;
|
|
62
|
+
export declare function patchScalar(content: string, path: string[], value: string): string;
|
|
63
|
+
export declare function writeCodexConfigMerge(options: CodexManagedConfigOptions & {
|
|
31
64
|
configPath: string;
|
|
32
65
|
dryRun?: boolean;
|
|
33
|
-
pluginId?: string;
|
|
34
66
|
}): CodexConfigMergeResult;
|
|
35
67
|
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const CODEX_HOOK_CONSENT_PROMPT = "Trust thoth-agents SessionStart and SubagentStart hooks? Trusted hooks can run outside the sandbox. [y/N] ";
|
|
2
|
+
export declare function requestCodexHookConsent(options: {
|
|
3
|
+
trustHooks?: boolean;
|
|
4
|
+
dryRun?: boolean;
|
|
5
|
+
}): Promise<boolean>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
interface CommandHandler {
|
|
2
|
+
type: string;
|
|
3
|
+
command: string;
|
|
4
|
+
commandWindows?: string | null;
|
|
5
|
+
timeout?: number | null;
|
|
6
|
+
async?: boolean;
|
|
7
|
+
statusMessage?: string | null;
|
|
8
|
+
additionalContextLimit?: number | null;
|
|
9
|
+
}
|
|
10
|
+
interface HookGroup {
|
|
11
|
+
matcher?: string | null;
|
|
12
|
+
hooks: CommandHandler[];
|
|
13
|
+
}
|
|
14
|
+
export interface CodexHookDeclarations {
|
|
15
|
+
hooks: Record<string, HookGroup[]>;
|
|
16
|
+
}
|
|
17
|
+
/** Version-coupled to rust-v0.162.1 discovery.rs / fingerprint.rs.
|
|
18
|
+
* Identity is flattened, includes one handler, and omits TOML None values.
|
|
19
|
+
* Commands are hashed before PLUGIN_ROOT substitution, after platform selection.
|
|
20
|
+
*/
|
|
21
|
+
export declare function codexHookTrustEntries(declarations: CodexHookDeclarations, source: string, platform: NodeJS.Platform): Record<string, string>;
|
|
22
|
+
export declare function codexHookSource(pluginId?: string): string;
|
|
23
|
+
export {};
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import type { CodexInstallScope, CodexRoleName } from './codex-paths';
|
|
2
|
+
import { type CodexHookCapabilityConfig } from './codex-plugin-install';
|
|
2
3
|
import { type ManagedModelState } from './managed-state-io';
|
|
3
4
|
export { CODEX_ROLE_NAMES } from './codex-paths';
|
|
4
|
-
export type CodexSetupAction = '
|
|
5
|
+
export type CodexSetupAction = 'remove-legacy-root-block' | 'write-role-toml' | 'preserve-role-toml' | 'retire-obsolete-role-toml' | 'write-install-recovery' | 'write-managed-model-state' | 'merge-toml' | 'diagnose-only';
|
|
5
6
|
export type CodexTargetKind = 'root-instructions' | 'role-subagent-toml' | 'managed-model-state' | 'install-recovery' | 'user-config' | 'diagnostic';
|
|
6
|
-
export interface CodexInstallConfig {
|
|
7
|
+
export interface CodexInstallConfig extends CodexHookCapabilityConfig {
|
|
7
8
|
dryRun?: boolean;
|
|
8
9
|
reset: boolean;
|
|
9
10
|
scope: CodexInstallScope;
|
|
10
|
-
projectRoot: string;
|
|
11
|
-
homeDir?: string;
|
|
12
|
-
codexHome?: string;
|
|
13
11
|
packageRoot?: string;
|
|
14
|
-
|
|
12
|
+
trustHooks?: boolean;
|
|
13
|
+
replaceLegacyAgents?: boolean;
|
|
15
14
|
}
|
|
16
15
|
export interface CodexSetupPlanItem {
|
|
17
16
|
kind: CodexTargetKind;
|
|
@@ -25,8 +24,12 @@ export interface CodexSetupPlanItem {
|
|
|
25
24
|
/** Apply-time guard captured while planning. */
|
|
26
25
|
expectedContent?: string;
|
|
27
26
|
expectedAbsent?: boolean;
|
|
27
|
+
/** Raw legacy file bytes: never decode/re-encode operator content. */
|
|
28
|
+
legacyRootBytes?: Buffer;
|
|
29
|
+
remainingRootBytes?: Buffer;
|
|
28
30
|
}
|
|
29
31
|
export interface CodexSetupPlan {
|
|
32
|
+
hookCapabilityConfig: CodexHookCapabilityConfig;
|
|
30
33
|
dryRun: boolean;
|
|
31
34
|
reset: boolean;
|
|
32
35
|
items: CodexSetupPlanItem[];
|
|
@@ -34,6 +37,8 @@ export interface CodexSetupPlan {
|
|
|
34
37
|
disclaimers: string[];
|
|
35
38
|
configPath: string;
|
|
36
39
|
pluginId?: string;
|
|
40
|
+
trustHooks?: boolean;
|
|
41
|
+
priorThreadsValue?: string | null;
|
|
37
42
|
}
|
|
38
43
|
export interface CodexApplyResult {
|
|
39
44
|
success: boolean;
|
|
@@ -42,6 +47,12 @@ export interface CodexApplyResult {
|
|
|
42
47
|
error?: string;
|
|
43
48
|
}
|
|
44
49
|
export declare const MANAGED_MODEL_STATE_VERSION = 1;
|
|
50
|
+
export declare function roleStructureFingerprint(content: string): string;
|
|
51
|
+
/** A recovery candidate, NOT proof of ownership. Only an explicit opt-in may replace it.
|
|
52
|
+
* Historical descriptions/routing changed: match the stable responsibility prefix,
|
|
53
|
+
* role envelope and Codex operational marker rather than a whole prompt digest.
|
|
54
|
+
*/
|
|
55
|
+
export declare function isMigratableLegacyRole(content: string, role: CodexRoleName): boolean;
|
|
45
56
|
export declare function readManagedModelState(path: string): ManagedModelState;
|
|
46
57
|
export declare function parseRoleTomlModel(content: string): string | undefined;
|
|
47
58
|
export declare function replaceRoleTomlModel(content: string, model: string): string;
|
|
@@ -56,6 +67,10 @@ export interface CodexManagedModelOverride {
|
|
|
56
67
|
clearEffort?: boolean;
|
|
57
68
|
}
|
|
58
69
|
export declare function applyCodexManagedModelOverrides(config: CodexInstallConfig, overrides: CodexManagedModelOverride[]): CodexApplyResult;
|
|
70
|
+
export declare function planLegacyRootRemoval(path: string): {
|
|
71
|
+
items: CodexSetupPlanItem[];
|
|
72
|
+
diagnostics: string[];
|
|
73
|
+
};
|
|
59
74
|
export declare function buildCodexSetupPlan(config: CodexInstallConfig): CodexSetupPlan;
|
|
60
75
|
export declare function formatCodexSetupPlan(plan: CodexSetupPlan): string;
|
|
61
76
|
export declare function applyCodexSetup(plan: CodexSetupPlan): CodexApplyResult;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type CodexHookCapabilityConfig } from './codex-plugin-install';
|
|
2
|
+
import type { CodexOperationContext } from './operations/codex';
|
|
3
|
+
export interface CodexLifecycleContext extends CodexOperationContext {
|
|
4
|
+
pluginId?: string;
|
|
5
|
+
localPluginBundlePath?: CodexHookCapabilityConfig['localPluginBundlePath'];
|
|
6
|
+
nodeAvailable?: () => boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface CodexLifecycleResult {
|
|
9
|
+
success: boolean;
|
|
10
|
+
messages: string[];
|
|
11
|
+
}
|
|
12
|
+
export declare function uninstallCodex(context: CodexLifecycleContext, dryRun?: boolean): CodexLifecycleResult;
|
|
13
|
+
export declare function doctorCodex(context: CodexLifecycleContext): CodexLifecycleResult;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare const CODEX_PLUGIN_ID = "thoth-agents@thoth-plugins";
|
|
1
2
|
export type CodexPluginSetupAction = 'register-marketplace' | 'install-plugin';
|
|
2
3
|
export type CodexPluginCleanupAction = 'remove-legacy-plugin' | 'remove-legacy-marketplace' | 'remove-legacy-root';
|
|
3
4
|
export interface CodexLegacyCleanupRoot {
|
|
@@ -60,6 +61,26 @@ export interface CodexPluginApplyResult {
|
|
|
60
61
|
error?: string;
|
|
61
62
|
}
|
|
62
63
|
export declare function getCodexCommand(args: readonly string[], options?: CodexCommandInvocationOptions): CodexCommandInvocation;
|
|
64
|
+
export declare function defaultCommandExecutor(command: string, args: readonly string[], options: CodexCommandOptions): CodexCommandResult;
|
|
65
|
+
export interface CodexHookCapabilityConfig {
|
|
66
|
+
pluginId?: string;
|
|
67
|
+
/** Local development only: verify the synchronized bundle, not manager selection.
|
|
68
|
+
* Selection remains a separately reported warning in setup-codex-local.
|
|
69
|
+
*/
|
|
70
|
+
localPluginBundlePath?: string;
|
|
71
|
+
codexHome?: string;
|
|
72
|
+
homeDir?: string;
|
|
73
|
+
projectRoot: string;
|
|
74
|
+
commandExecutor?: CodexCommandExecutor;
|
|
75
|
+
}
|
|
76
|
+
export interface CodexHookCapabilityResult {
|
|
77
|
+
success: boolean;
|
|
78
|
+
diagnostics: string[];
|
|
79
|
+
error?: string;
|
|
80
|
+
bundlePath?: string;
|
|
81
|
+
}
|
|
82
|
+
/** Shared migration prerequisite; hook trust is deliberately not inspected. */
|
|
83
|
+
export declare function checkCodexHookCapability(config: CodexHookCapabilityConfig): CodexHookCapabilityResult;
|
|
63
84
|
export declare function buildCodexPluginSetupPlan(config: CodexPluginInstallConfig): CodexPluginSetupPlan;
|
|
64
85
|
export declare function applyCodexPluginSetup(plan: CodexPluginSetupPlan): CodexPluginApplyResult;
|
|
65
86
|
export declare function formatCodexPluginSetupPlan(plan: CodexPluginSetupPlan): string;
|