thoth-plugin 1.1.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 (89) hide show
  1. package/README.md +84 -0
  2. package/dist/agents/archivist.d.ts +2 -0
  3. package/dist/agents/chronicler.d.ts +2 -0
  4. package/dist/agents/coach.d.ts +2 -0
  5. package/dist/agents/code-master.d.ts +2 -0
  6. package/dist/agents/diplomat.d.ts +2 -0
  7. package/dist/agents/index.d.ts +12 -0
  8. package/dist/agents/life-master.d.ts +2 -0
  9. package/dist/agents/scribe.d.ts +2 -0
  10. package/dist/agents/sentinel.d.ts +2 -0
  11. package/dist/agents/thoth.d.ts +37 -0
  12. package/dist/agents/work-master.d.ts +2 -0
  13. package/dist/cli.d.ts +9 -0
  14. package/dist/cli.js +220 -0
  15. package/dist/config/index.d.ts +1 -0
  16. package/dist/config/schema.d.ts +99 -0
  17. package/dist/defaults/AGENTS.md +53 -0
  18. package/dist/defaults/skill/cal-grid/SKILL.md +16 -0
  19. package/dist/defaults/skill/capsule-init/SKILL.md +102 -0
  20. package/dist/defaults/skill/cross-linker/SKILL.md +357 -0
  21. package/dist/defaults/skill/evening-close/SKILL.md +91 -0
  22. package/dist/defaults/skill/gardener/SKILL.md +248 -0
  23. package/dist/defaults/skill/gardener/confidence-tiers.md +142 -0
  24. package/dist/defaults/skill/gardener/repair-workflow.md +170 -0
  25. package/dist/defaults/skill/google-chat-scan/SKILL.md +135 -0
  26. package/dist/defaults/skill/handover/SKILL.md +18 -0
  27. package/dist/defaults/skill/interview-prep/SKILL.md +23 -0
  28. package/dist/defaults/skill/leadership-coach/SKILL.md +160 -0
  29. package/dist/defaults/skill/link-retrofit/SKILL.md +345 -0
  30. package/dist/defaults/skill/mail-triage/SKILL.md +16 -0
  31. package/dist/defaults/skill/morning-boot/SKILL.md +98 -0
  32. package/dist/defaults/skill/post-meeting-drill/SKILL.md +479 -0
  33. package/dist/defaults/skill/restore-environment/SKILL.md +30 -0
  34. package/dist/defaults/skill/scorecard-synthesis/SKILL.md +26 -0
  35. package/dist/defaults/skill/skill-generator/SKILL.md +240 -0
  36. package/dist/defaults/skill/skill-generator/testing-protocol.md +158 -0
  37. package/dist/defaults/skill/slack-pulse/SKILL.md +16 -0
  38. package/dist/defaults/skill/system-init/SKILL.md +103 -0
  39. package/dist/defaults/skill/thought-router/SKILL.md +80 -0
  40. package/dist/hooks/context-aperture.d.ts +37 -0
  41. package/dist/hooks/context-aperture.test.d.ts +1 -0
  42. package/dist/hooks/directory-agents-injector/constants.d.ts +6 -0
  43. package/dist/hooks/directory-agents-injector/index.d.ts +21 -0
  44. package/dist/hooks/directory-agents-injector/storage.d.ts +8 -0
  45. package/dist/hooks/directory-agents-injector/types.d.ts +24 -0
  46. package/dist/hooks/index.d.ts +4 -0
  47. package/dist/hooks/permission-enforcer.d.ts +15 -0
  48. package/dist/hooks/permission-enforcer.test.d.ts +1 -0
  49. package/dist/hooks/temporal-awareness.d.ts +31 -0
  50. package/dist/hooks/temporal-awareness.test.d.ts +1 -0
  51. package/dist/hooks/trust-level-tracker.d.ts +58 -0
  52. package/dist/hooks/trust-level-tracker.test.d.ts +1 -0
  53. package/dist/index.d.ts +4 -0
  54. package/dist/index.js +31196 -0
  55. package/dist/shared/index.d.ts +21 -0
  56. package/dist/shared-hooks/background-agent/index.d.ts +2 -0
  57. package/dist/shared-hooks/background-agent/manager.d.ts +39 -0
  58. package/dist/shared-hooks/background-agent/types.d.ts +30 -0
  59. package/dist/shared-hooks/background-notification/index.d.ts +12 -0
  60. package/dist/shared-hooks/background-notification/types.d.ts +4 -0
  61. package/dist/shared-hooks/context-window-monitor.d.ts +18 -0
  62. package/dist/shared-hooks/index.d.ts +7 -0
  63. package/dist/shared-hooks/session-recovery/constants.d.ts +6 -0
  64. package/dist/shared-hooks/session-recovery/index.d.ts +21 -0
  65. package/dist/shared-hooks/session-recovery/storage.d.ts +19 -0
  66. package/dist/shared-hooks/session-recovery/types.d.ts +90 -0
  67. package/dist/shared-hooks/todo-continuation-enforcer.d.ts +12 -0
  68. package/dist/shared-hooks/utils/constants.d.ts +6 -0
  69. package/dist/shared-hooks/utils/index.d.ts +5 -0
  70. package/dist/shared-hooks/utils/logger.d.ts +2 -0
  71. package/dist/shared-hooks/utils/message-storage.d.ts +6 -0
  72. package/dist/shared-hooks/utils/session-state.d.ts +4 -0
  73. package/dist/shared-hooks/utils/types.d.ts +141 -0
  74. package/dist/specialization/boot-sequences.d.ts +19 -0
  75. package/dist/specialization/detector.d.ts +20 -0
  76. package/dist/specialization/index.d.ts +10 -0
  77. package/dist/specialization/prompt-builder.d.ts +30 -0
  78. package/dist/specialization/prompt-sections.d.ts +19 -0
  79. package/dist/specialization/types.d.ts +86 -0
  80. package/dist/thoth-plugin.schema.json +7 -0
  81. package/dist/tools/background-task/constants.d.ts +3 -0
  82. package/dist/tools/background-task/index.d.ts +2 -0
  83. package/dist/tools/background-task/tools.d.ts +7 -0
  84. package/dist/tools/background-task/types.d.ts +14 -0
  85. package/dist/tools/index.d.ts +2 -0
  86. package/dist/tools/skill/index.d.ts +2 -0
  87. package/dist/tools/skill/tools.d.ts +2 -0
  88. package/dist/tools/skill/types.d.ts +37 -0
  89. package/package.json +54 -0
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Specialization Types
3
+ *
4
+ * Defines the types for Thoth's depth-based specialization system.
5
+ */
6
+ /**
7
+ * The four hemispheres of Thoth's knowledge base
8
+ */
9
+ export type Domain = "work" | "life" | "coding" | "kernel";
10
+ /**
11
+ * Depth levels for specialization
12
+ * 0 = Root (Pure Thoth)
13
+ * 1 = Hemisphere (e.g., /work/)
14
+ * 2 = Category (e.g., /work/projects/)
15
+ * 3 = Entity/Capsule (e.g., /work/projects/project-x/)
16
+ */
17
+ export type DepthLevel = 0 | 1 | 2 | 3;
18
+ /**
19
+ * The result of specialization detection
20
+ */
21
+ export interface Specialization {
22
+ /** The calculated depth level (0-3) */
23
+ depth: DepthLevel;
24
+ /** The primary domain/hemisphere */
25
+ domain: Domain | null;
26
+ /** The category within the domain (depth 2+) */
27
+ category: string | null;
28
+ /** The specific entity (depth 3) */
29
+ entity: string | null;
30
+ /** The full relative path from knowledge base root */
31
+ relativePath: string;
32
+ /** Boot sequence files to load */
33
+ bootSequence: string[];
34
+ /** Whether depth was overridden (via AGENTS.md or CONTEXT.md) */
35
+ depthOverridden: boolean;
36
+ /** Source of depth override if any */
37
+ depthSource: "folder" | "agents-md" | "context-md";
38
+ }
39
+ /**
40
+ * AGENTS.md frontmatter structure
41
+ */
42
+ export interface AgentsMdFrontmatter {
43
+ /** Explicit depth override */
44
+ depth?: number;
45
+ /** Hemisphere this AGENTS.md belongs to */
46
+ hemisphere?: Domain;
47
+ /** Boot sequence files */
48
+ boot_sequence?: string[];
49
+ /** Additional tags */
50
+ tags?: string[];
51
+ }
52
+ /**
53
+ * Parsed AGENTS.md file
54
+ */
55
+ export interface ParsedAgentsMd {
56
+ /** Parsed frontmatter */
57
+ frontmatter: AgentsMdFrontmatter | null;
58
+ /** Content after frontmatter */
59
+ content: string;
60
+ /** Full file path */
61
+ path: string;
62
+ }
63
+ /**
64
+ * Session specialization state
65
+ */
66
+ export interface SessionSpecializationState {
67
+ /** Session ID */
68
+ sessionID: string;
69
+ /** Detected specialization */
70
+ specialization: Specialization;
71
+ /** Whether boot has been executed */
72
+ bootExecuted: boolean;
73
+ /** Timestamp of detection */
74
+ detectedAt: number;
75
+ }
76
+ /**
77
+ * Boot instruction to inject on first message
78
+ */
79
+ export interface BootInstruction {
80
+ /** The instruction text to inject */
81
+ instruction: string;
82
+ /** Files that should be read */
83
+ files: string[];
84
+ /** Mode description for confirmation output */
85
+ modeDescription: string;
86
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "$ref": "#/definitions/ThothPluginConfig",
3
+ "definitions": {
4
+ "ThothPluginConfig": {}
5
+ },
6
+ "$schema": "http://json-schema.org/draft-07/schema#"
7
+ }
@@ -0,0 +1,3 @@
1
+ export declare const BACKGROUND_TASK_DESCRIPTION = "Run agent task in background. Returns task_id immediately; notifies on completion.\n\nUse `background_output` to get results. Prompts MUST be in English.";
2
+ export declare const BACKGROUND_OUTPUT_DESCRIPTION = "Get output from background task. System notifies on completion, so block=true rarely needed.";
3
+ export declare const BACKGROUND_CANCEL_DESCRIPTION = "Cancel running background task(s). Use all=true to cancel ALL before final answer.";
@@ -0,0 +1,2 @@
1
+ export { createBackgroundTask, createBackgroundOutput, createBackgroundCancel } from "./tools";
2
+ export type { BackgroundTaskArgs, BackgroundOutputArgs, BackgroundCancelArgs } from "./types";
@@ -0,0 +1,7 @@
1
+ import { tool, type PluginInput } from "@opencode-ai/plugin";
2
+ import type { BackgroundManager } from "../../shared-hooks/background-agent";
3
+ type OpencodeClient = PluginInput["client"];
4
+ export declare function createBackgroundTask(manager: BackgroundManager): ReturnType<typeof tool>;
5
+ export declare function createBackgroundOutput(manager: BackgroundManager, client: OpencodeClient): ReturnType<typeof tool>;
6
+ export declare function createBackgroundCancel(manager: BackgroundManager, client: OpencodeClient): ReturnType<typeof tool>;
7
+ export {};
@@ -0,0 +1,14 @@
1
+ export interface BackgroundTaskArgs {
2
+ description: string;
3
+ prompt: string;
4
+ agent: string;
5
+ }
6
+ export interface BackgroundOutputArgs {
7
+ task_id: string;
8
+ block?: boolean;
9
+ timeout?: number;
10
+ }
11
+ export interface BackgroundCancelArgs {
12
+ taskId?: string;
13
+ all?: boolean;
14
+ }
@@ -0,0 +1,2 @@
1
+ export { createBackgroundTask, createBackgroundOutput, createBackgroundCancel } from "./background-task";
2
+ export { createSkillTool } from "./skill";
@@ -0,0 +1,2 @@
1
+ export { createSkillTool } from "./tools";
2
+ export type { SkillScope, SkillMetadata, SkillInfo, LoadedSkill, SkillFrontmatter } from "./types";
@@ -0,0 +1,2 @@
1
+ import { tool } from "@opencode-ai/plugin";
2
+ export declare function createSkillTool(): ReturnType<typeof tool>;
@@ -0,0 +1,37 @@
1
+ import { z } from "zod/v4";
2
+ export type SkillScope = "user" | "project" | "builtin";
3
+ export declare const SkillFrontmatterSchema: z.ZodObject<{
4
+ name: z.ZodString;
5
+ description: z.ZodString;
6
+ license: z.ZodOptional<z.ZodString>;
7
+ "allowed-tools": z.ZodOptional<z.ZodArray<z.ZodString>>;
8
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
9
+ }, z.core.$strip>;
10
+ export type SkillFrontmatter = z.infer<typeof SkillFrontmatterSchema>;
11
+ export interface SkillMetadata {
12
+ name: string;
13
+ description: string;
14
+ license?: string;
15
+ allowedTools?: string[];
16
+ metadata?: Record<string, string>;
17
+ }
18
+ export interface SkillInfo {
19
+ name: string;
20
+ path: string;
21
+ basePath: string;
22
+ metadata: SkillMetadata;
23
+ content: string;
24
+ references: string[];
25
+ scripts: string[];
26
+ assets: string[];
27
+ }
28
+ export interface LoadedSkill {
29
+ name: string;
30
+ metadata: SkillMetadata;
31
+ basePath: string;
32
+ body: string;
33
+ referencesLoaded: Array<{
34
+ path: string;
35
+ content: string;
36
+ }>;
37
+ }
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "thoth-plugin",
3
+ "version": "1.1.0",
4
+ "description": "Thoth - Root-level life orchestrator for OpenCode. Unified AI chief of staff combining Sisyphus execution quality, Personal-OS rhythms, and Thoth relationship model.",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "type": "module",
8
+ "bin": {
9
+ "thoth": "./dist/cli.js"
10
+ },
11
+ "files": [
12
+ "dist"
13
+ ],
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/index.d.ts",
17
+ "import": "./dist/index.js"
18
+ },
19
+ "./schema.json": "./dist/thoth-plugin.schema.json"
20
+ },
21
+ "scripts": {
22
+ "build": "bun build src/index.ts src/cli.ts --outdir dist --target bun --format esm && cp -r defaults dist/ && (tsc --emitDeclarationOnly || true) && bun run build:schema",
23
+ "build:schema": "bun run script/build-schema.ts",
24
+ "clean": "rm -rf dist",
25
+ "prepublishOnly": "bun run clean && bun run build",
26
+ "typecheck": "tsc --noEmit",
27
+ "test": "bun test"
28
+ },
29
+ "keywords": [
30
+ "opencode",
31
+ "plugin",
32
+ "thoth",
33
+ "life-orchestrator",
34
+ "chief-of-staff",
35
+ "ai",
36
+ "llm",
37
+ "personal-os"
38
+ ],
39
+ "author": "David Helmus",
40
+ "license": "MIT",
41
+ "repository": {
42
+ "type": "git",
43
+ "url": "git+https://github.com/davidhelmus/thoth-core.git"
44
+ },
45
+ "dependencies": {
46
+ "@opencode-ai/plugin": "^1.0.162",
47
+ "zod": "^4.1.8"
48
+ },
49
+ "devDependencies": {
50
+ "bun-types": "latest",
51
+ "typescript": "^5.7.3",
52
+ "zod-to-json-schema": "^3.25.1"
53
+ }
54
+ }