thoth-agents 0.1.18 → 0.2.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.
Files changed (37) hide show
  1. package/README.md +55 -12
  2. package/dist/agents/prompt-dialects.d.ts +9 -0
  3. package/dist/{chunk-6K3ZXIMC.js → chunk-3NOVCFN7.js} +88 -29
  4. package/dist/chunk-4WYCZ5Z7.js +698 -0
  5. package/dist/{chunk-SOT5ZY53.js → chunk-WH3F3GWE.js} +1498 -350
  6. package/dist/cli/claude-code-install.d.ts +53 -0
  7. package/dist/cli/claude-code-paths.d.ts +31 -0
  8. package/dist/cli/codex-install.d.ts +1 -5
  9. package/dist/cli/commands.d.ts +1 -1
  10. package/dist/cli/index.js +85 -27
  11. package/dist/cli/managed-state-io.d.ts +16 -0
  12. package/dist/cli/operations/claude-code.d.ts +21 -0
  13. package/dist/cli/tui/index.js +87 -9
  14. package/dist/cli/tui/operations.d.ts +2 -0
  15. package/dist/cli/types.d.ts +3 -3
  16. package/dist/config/index.d.ts +1 -1
  17. package/dist/config/schema.d.ts +11 -0
  18. package/dist/config/utils.d.ts +5 -0
  19. package/dist/harness/adapters/claude-code.d.ts +24 -0
  20. package/dist/harness/core/memory-governance.d.ts +39 -4
  21. package/dist/harness/core/package-version.d.ts +7 -0
  22. package/dist/harness/types.d.ts +1 -1
  23. package/dist/harness/writers/claude-code-plugin-package.d.ts +32 -0
  24. package/dist/harness/writers/claude-code-skill-layout.d.ts +16 -0
  25. package/dist/harness/writers/claude-code-subagent.d.ts +26 -0
  26. package/dist/harness/writers/fs-skill-collect.d.ts +7 -0
  27. package/dist/hooks/phase-reminder/index.d.ts +2 -0
  28. package/dist/hooks/thoth-mem/protocol.d.ts +2 -2
  29. package/dist/index.js +54 -512
  30. package/package.json +1 -1
  31. package/src/skills/_shared/persistence-contract.md +18 -14
  32. package/src/skills/_shared/thoth-mem-convention.md +18 -18
  33. package/src/skills/executing-plans/SKILL.md +6 -4
  34. package/src/skills/plan-reviewer/SKILL.md +4 -2
  35. package/src/skills/thoth-mem-agents/SKILL.md +3 -0
  36. package/thoth-agents.schema.json +16 -0
  37. package/dist/chunk-DYGVRAMS.js +0 -182
@@ -8,3 +8,8 @@ import type { AgentOverrideConfig, PluginConfig } from './schema';
8
8
  * @returns The agent-specific override configuration if found
9
9
  */
10
10
  export declare function getAgentOverride(config: PluginConfig | undefined, name: string): AgentOverrideConfig | undefined;
11
+ /**
12
+ * Resolve the primary model id from an agent override `model` value, which may
13
+ * be a single id, an object with an `id`, or a failover array of either.
14
+ */
15
+ export declare function getPrimaryModelId(model: AgentOverrideConfig['model']): string | undefined;
@@ -0,0 +1,24 @@
1
+ import { type PluginConfig } from '../../config';
2
+ import type { HarnessAdapter, HarnessCapabilities, HarnessRenderContext } from '../types';
3
+ export interface ClaudeCodeRenderContext extends HarnessRenderContext {
4
+ config?: PluginConfig;
5
+ packageRoot?: string;
6
+ }
7
+ export declare const CLAUDE_CODE_CAPABILITIES: HarnessCapabilities;
8
+ export declare const CLAUDE_CODE_SUBAGENT_DEFAULT_MODELS: {
9
+ readonly explorer: "haiku";
10
+ readonly librarian: "sonnet";
11
+ readonly oracle: "opus";
12
+ readonly designer: "sonnet";
13
+ readonly quick: "haiku";
14
+ readonly deep: "sonnet";
15
+ };
16
+ /**
17
+ * The orchestrator system prompt body. This is the system prompt of the
18
+ * `orchestrator` plugin agent, which the plugin `settings.json` activates as the
19
+ * Claude Code main thread (`{"agent":"orchestrator"}`) — replacing the default
20
+ * system prompt entirely, which is far stronger than a SessionStart
21
+ * additionalContext injection.
22
+ */
23
+ export declare function renderClaudeCodeRootInstructions(config?: PluginConfig): string;
24
+ export declare const claudeCodeAdapter: HarnessAdapter;
@@ -1,11 +1,41 @@
1
1
  import type { HarnessPromptDialect } from '../../agents/prompt-dialects';
2
2
  import type { HarnessCapabilityStatus, HarnessDiagnostic } from '../types';
3
3
  import type { AgentRoleContract, AgentRoleName } from './agent-pack';
4
- export type MemoryToolName = 'mem_session_start' | 'mem_session_summary' | 'mem_save_prompt' | 'mem_search' | 'mem_timeline' | 'mem_get_observation' | 'mem_context' | 'mem_project_summary' | 'mem_project_graph' | 'mem_topic_keys' | 'mem_suggest_topic_key' | 'mem_save';
4
+ export type MemoryToolName = 'mem_save' | 'mem_recall' | 'mem_context' | 'mem_get' | 'mem_project' | 'mem_session';
5
+ export type MemSaveKind = 'observation' | 'prompt' | 'session_summary' | 'passive_learnings';
6
+ export type MemSessionAction = 'start' | 'checkpoint' | 'summary';
7
+ export type MemRecallMode = 'compact' | 'context';
8
+ export type MemProjectAction = 'list' | 'summary' | 'graph' | 'topics' | 'topic';
9
+ export type MemoryOperation = {
10
+ tool: 'mem_session';
11
+ action: MemSessionAction;
12
+ } | {
13
+ tool: 'mem_save';
14
+ kind: MemSaveKind;
15
+ } | {
16
+ tool: 'mem_recall';
17
+ mode: MemRecallMode;
18
+ } | {
19
+ tool: 'mem_get';
20
+ includeTimeline?: boolean;
21
+ } | {
22
+ tool: 'mem_context';
23
+ recallQuery?: boolean;
24
+ } | {
25
+ tool: 'mem_project';
26
+ action: MemProjectAction;
27
+ };
28
+ export type RootOwnedMemoryOperation = {
29
+ tool: 'mem_session';
30
+ action: MemSessionAction;
31
+ } | {
32
+ tool: 'mem_save';
33
+ kind: 'prompt' | 'session_summary';
34
+ };
5
35
  export type MemoryRuntimeEnforcement = 'runtime' | 'instruction-only';
6
36
  export interface RoleMemoryGovernance {
7
37
  role: AgentRoleName;
8
- rootOwnedTools: MemoryToolName[];
38
+ rootOwnedOperations: RootOwnedMemoryOperation[];
9
39
  allowedTools: MemoryToolName[];
10
40
  forbiddenTools: MemoryToolName[];
11
41
  requiresParentContext: boolean;
@@ -15,8 +45,8 @@ export interface RoleMemoryGovernance {
15
45
  rules: string[];
16
46
  }
17
47
  export interface MemoryGovernanceContract {
18
- rootOwnedTools: MemoryToolName[];
19
- readRecallChain: MemoryToolName[];
48
+ rootOwnedOperations: RootOwnedMemoryOperation[];
49
+ readRecallChain: MemoryOperation[];
20
50
  writeCapableDelegatedTools: MemoryToolName[];
21
51
  protectedTopicNamespaces: string[];
22
52
  roles: RoleMemoryGovernance[];
@@ -27,6 +57,11 @@ export interface MemoryGovernanceDiagnosticInput {
27
57
  parentContextInjection: HarnessCapabilityStatus;
28
58
  memoryWriteControls: HarnessCapabilityStatus;
29
59
  }
60
+ export declare const ROOT_OWNED_OPERATIONS: RootOwnedMemoryOperation[];
61
+ export declare const READ_RECALL_CHAIN: MemoryOperation[];
62
+ export declare const PARENT_SCOPED_READ_TOOLS: MemoryToolName[];
63
+ export declare const WRITE_CAPABLE_DELEGATED_TOOLS: MemoryToolName[];
64
+ export declare const ALL_MEMORY_TOOLS: MemoryToolName[];
30
65
  export declare function getRoleMemoryGovernance(role: AgentRoleContract): RoleMemoryGovernance;
31
66
  export declare function getMemoryGovernanceContract(roles: readonly AgentRoleContract[]): MemoryGovernanceContract;
32
67
  export declare function renderMemoryGovernanceInstructions(role: AgentRoleContract, dialect?: HarnessPromptDialect): string;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Locate the thoth-agents root package.json by walking up from each candidate
3
+ * directory. Shared by harness adapters that stamp the package version into
4
+ * generated plugin manifests.
5
+ */
6
+ export declare function findRootPackageJsonPath(startDirs: readonly string[]): string;
7
+ export declare function readPackageJsonVersion(packageJsonPath: string): string;
@@ -1,4 +1,4 @@
1
- export type HarnessId = 'opencode' | 'codex';
1
+ export type HarnessId = 'opencode' | 'codex' | 'claude';
2
2
  export type HarnessArtifactKind = 'agent-config' | 'harness-config' | 'mcp-config' | 'skill' | 'hook-config' | 'manifest' | 'documentation';
3
3
  export type HarnessDiagnosticSeverity = 'info' | 'warning' | 'error';
4
4
  export type HarnessDiagnosticCode = 'harness.unsupported' | 'harness.capability_gap' | 'harness.surface_unvalidated' | 'harness.artifact_skipped' | (string & {});
@@ -0,0 +1,32 @@
1
+ import type { HarnessArtifact, HarnessDiagnostic } from '../types';
2
+ export declare const CLAUDE_PLUGIN_MANIFEST_FIELDS: readonly ["name", "version", "description", "author"];
3
+ export interface ClaudeCodePluginAuthor {
4
+ name?: string;
5
+ email?: string;
6
+ url?: string;
7
+ }
8
+ export interface ClaudeCodePluginManifest {
9
+ name: string;
10
+ version: string;
11
+ description: string;
12
+ author?: ClaudeCodePluginAuthor | string;
13
+ }
14
+ export interface ClaudeCodePluginPackageInput {
15
+ manifest: ClaudeCodePluginManifest;
16
+ /**
17
+ * Already-rendered plugin component artifacts (subagents, `.mcp.json`,
18
+ * `hooks/`, skills). Auto-discovered by Claude Code, so the manifest does not
19
+ * reference them; the writer records their provenance.
20
+ */
21
+ componentArtifacts: HarnessArtifact[];
22
+ }
23
+ export interface ClaudeCodePluginPackageResult {
24
+ artifacts: HarnessArtifact[];
25
+ diagnostics: HarnessDiagnostic[];
26
+ }
27
+ /**
28
+ * Assemble the Claude Code plugin package: the deterministic `plugin.json`
29
+ * manifest, an asset-provenance manifest, and the passed-through component
30
+ * artifacts (sorted by path). First-class — no surface-validation gate.
31
+ */
32
+ export declare function renderClaudeCodePluginPackage(input: ClaudeCodePluginPackageInput): ClaudeCodePluginPackageResult;
@@ -0,0 +1,16 @@
1
+ import type { SkillRegistryEntry } from '../core/skills';
2
+ import type { HarnessArtifact, HarnessDiagnostic } from '../types';
3
+ export interface ClaudeCodeSkillLayoutInput {
4
+ projectRoot: string;
5
+ packageRoot?: string;
6
+ skills: SkillRegistryEntry[];
7
+ }
8
+ export interface ClaudeCodeSkillLayoutResult {
9
+ artifacts: HarnessArtifact[];
10
+ diagnostics: HarnessDiagnostic[];
11
+ }
12
+ /**
13
+ * Copy the bundled skill registry into the Claude Code plugin `skills/` layout.
14
+ * First-class: no surface gate. Records source provenance with content hashes.
15
+ */
16
+ export declare function renderClaudeCodeSkillLayout(input: ClaudeCodeSkillLayoutInput): ClaudeCodeSkillLayoutResult;
@@ -0,0 +1,26 @@
1
+ export type ClaudeCodeModel = 'sonnet' | 'opus' | 'haiku' | 'inherit';
2
+ /** The model aliases Claude Code accepts in subagent frontmatter. */
3
+ export declare const CLAUDE_CODE_MODELS: readonly ["sonnet", "opus", "haiku", "inherit"];
4
+ export declare function isClaudeCodeModel(value: string): value is ClaudeCodeModel;
5
+ export interface ClaudeCodeSubagentInput {
6
+ /** Subagent name; also the `subagent_type` used by the Task tool. */
7
+ name: string;
8
+ /** When the orchestrator should delegate to this subagent. */
9
+ description: string;
10
+ /**
11
+ * Comma-separated tool allowlist. This is the Claude Code mechanism that
12
+ * enforces role permissions (read-only vs write-capable). Omit to inherit all
13
+ * tools — used by the orchestrator main-thread agent, which must keep Task,
14
+ * AskUserQuestion, TodoWrite, MCP, and edit tools.
15
+ */
16
+ tools?: string;
17
+ /** Per-role model alias for the subagent frontmatter. */
18
+ model: ClaudeCodeModel;
19
+ /** Rendered system prompt body (role prompt + governance). */
20
+ instructions: string;
21
+ }
22
+ /**
23
+ * Render a Claude Code subagent file: deterministic YAML frontmatter plus the
24
+ * markdown system-prompt body. Auto-discovered from a plugin `agents/` directory.
25
+ */
26
+ export declare function renderClaudeCodeSubagent(input: ClaudeCodeSubagentInput): string;
@@ -0,0 +1,7 @@
1
+ export declare function normalizeSkillPath(value: string): string;
2
+ /**
3
+ * Recursively collect every file under a directory, sorted for deterministic
4
+ * output. Shared by harness skill-layout writers.
5
+ */
6
+ export declare function collectSkillFiles(directory: string): string[];
7
+ export declare function sha256Hash(content: string | Uint8Array): string;
@@ -1,4 +1,6 @@
1
1
  export declare const PHASE_REMINDER = "<reminder>Recall Workflow Rules:\nUnderstand \u2192 split discovery into surgical probes with explorer/librarian \u2192 synthesize the decision and internal handoff \u2192 execute \u2192 verify.\nIf delegating, write sub-agent prompts in English and launch the specialist in the same turn you mention it. If multiple delegations are independent, emit all tool calls in a single response.\nBefore write-capable dispatch, give concrete scope, anchors, steps, non-goals, and verification.\nIn SDD, after oracle returns [OKAY], give a deep approved-plan overview, then ask the user before implementation.</reminder>";
2
+ export declare const PHASE_REMINDER_SEPARATOR = "\n\n---\n\n";
3
+ export declare function stripPhaseReminder(text: string): string;
2
4
  interface MessageInfo {
3
5
  role: string;
4
6
  agent?: string;
@@ -1,6 +1,6 @@
1
1
  export declare const SDD_TOPIC_KEY_FORMAT = "sdd/{change}/{artifact}";
2
- export declare const FIRST_ACTION_INSTRUCTION = "FIRST ACTION REQUIRED: Call mem_session_summary with the content of the compacted summary. This preserves what was accomplished before compaction. Do this BEFORE any other work. Then call mem_context for a recent-session overview, and use the 3-layer recall protocol (mem_search with mode \"compact\" -> mem_timeline -> mem_get_observation) for precise retrieval.";
3
- export declare const SESSION_SUMMARY_TEMPLATE = "Use this exact structure for `mem_session_summary` content:\n\n## Goal\n[What we were working on this session]\n\n## Instructions\n[User preferences or constraints discovered during this session]\n\n## Discoveries\n- [Technical findings, gotchas, non-obvious learnings]\n\n## Accomplished\n- [Completed items with key details]\n\n## Next Steps\n- [What remains to be done]\n\n## Relevant Files\n- path/to/file.ts - [what it does or what changed]";
2
+ export declare const FIRST_ACTION_INSTRUCTION = "FIRST ACTION REQUIRED: Call mem_session(action=\"summary\") with the content of the compacted summary. This preserves what was accomplished before compaction. Do this BEFORE any other work. Then call mem_context(recall_query=...) for fused recent context, and use the recall funnel (mem_recall(mode=\"compact\") -> mem_recall(mode=\"context\") -> mem_get(...)) for precise retrieval.";
3
+ export declare const SESSION_SUMMARY_TEMPLATE = "Use this exact structure for `mem_session(action=\"summary\")` content:\n\n## Goal\n[What we were working on this session]\n\n## Instructions\n[User preferences or constraints discovered during this session]\n\n## Discoveries\n- [Technical findings, gotchas, non-obvious learnings]\n\n## Accomplished\n- [Completed items with key details]\n\n## Next Steps\n- [What remains to be done]\n\n## Relevant Files\n- path/to/file.ts - [what it does or what changed]";
4
4
  export declare function buildCompactionReminder(sessionID: string): string;
5
5
  export declare function buildCompactorInstruction(project: string): string;
6
6
  export declare function buildMemoryInstructions(sessionID: string, project: string): string;