@yeshwanthyk/runtime-effect 0.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 (130) hide show
  1. package/README.md +19 -0
  2. package/dist/agent.d.ts +15 -0
  3. package/dist/agent.d.ts.map +1 -0
  4. package/dist/agent.js +28 -0
  5. package/dist/agent.js.map +1 -0
  6. package/dist/config.d.ts +65 -0
  7. package/dist/config.d.ts.map +1 -0
  8. package/dist/config.js +232 -0
  9. package/dist/config.js.map +1 -0
  10. package/dist/extensibility/custom-commands.d.ts +51 -0
  11. package/dist/extensibility/custom-commands.d.ts.map +1 -0
  12. package/dist/extensibility/custom-commands.js +139 -0
  13. package/dist/extensibility/custom-commands.js.map +1 -0
  14. package/dist/extensibility/custom-tools/index.d.ts +6 -0
  15. package/dist/extensibility/custom-tools/index.d.ts.map +1 -0
  16. package/dist/extensibility/custom-tools/index.js +5 -0
  17. package/dist/extensibility/custom-tools/index.js.map +1 -0
  18. package/dist/extensibility/custom-tools/loader.d.ts +24 -0
  19. package/dist/extensibility/custom-tools/loader.d.ts.map +1 -0
  20. package/dist/extensibility/custom-tools/loader.js +219 -0
  21. package/dist/extensibility/custom-tools/loader.js.map +1 -0
  22. package/dist/extensibility/custom-tools/types.d.ts +102 -0
  23. package/dist/extensibility/custom-tools/types.d.ts.map +1 -0
  24. package/dist/extensibility/custom-tools/types.js +5 -0
  25. package/dist/extensibility/custom-tools/types.js.map +1 -0
  26. package/dist/extensibility/index.d.ts +36 -0
  27. package/dist/extensibility/index.d.ts.map +1 -0
  28. package/dist/extensibility/index.js +79 -0
  29. package/dist/extensibility/index.js.map +1 -0
  30. package/dist/extensibility/schema.d.ts +40 -0
  31. package/dist/extensibility/schema.d.ts.map +1 -0
  32. package/dist/extensibility/schema.js +75 -0
  33. package/dist/extensibility/schema.js.map +1 -0
  34. package/dist/extensibility/validation.d.ts +11 -0
  35. package/dist/extensibility/validation.d.ts.map +1 -0
  36. package/dist/extensibility/validation.js +59 -0
  37. package/dist/extensibility/validation.js.map +1 -0
  38. package/dist/hooks/context-controller.d.ts +25 -0
  39. package/dist/hooks/context-controller.d.ts.map +1 -0
  40. package/dist/hooks/context-controller.js +21 -0
  41. package/dist/hooks/context-controller.js.map +1 -0
  42. package/dist/hooks/effects.d.ts +25 -0
  43. package/dist/hooks/effects.d.ts.map +1 -0
  44. package/dist/hooks/effects.js +45 -0
  45. package/dist/hooks/effects.js.map +1 -0
  46. package/dist/hooks/hook-messages.d.ts +10 -0
  47. package/dist/hooks/hook-messages.d.ts.map +1 -0
  48. package/dist/hooks/hook-messages.js +28 -0
  49. package/dist/hooks/hook-messages.js.map +1 -0
  50. package/dist/hooks/hook-tool-adapter.d.ts +12 -0
  51. package/dist/hooks/hook-tool-adapter.d.ts.map +1 -0
  52. package/dist/hooks/hook-tool-adapter.js +39 -0
  53. package/dist/hooks/hook-tool-adapter.js.map +1 -0
  54. package/dist/hooks/hook-transport.d.ts +19 -0
  55. package/dist/hooks/hook-transport.d.ts.map +1 -0
  56. package/dist/hooks/hook-transport.js +29 -0
  57. package/dist/hooks/hook-transport.js.map +1 -0
  58. package/dist/hooks/hook-ui-context.d.ts +20 -0
  59. package/dist/hooks/hook-ui-context.d.ts.map +1 -0
  60. package/dist/hooks/hook-ui-context.js +16 -0
  61. package/dist/hooks/hook-ui-context.js.map +1 -0
  62. package/dist/hooks/index.d.ts +17 -0
  63. package/dist/hooks/index.d.ts.map +1 -0
  64. package/dist/hooks/index.js +27 -0
  65. package/dist/hooks/index.js.map +1 -0
  66. package/dist/hooks/loader.d.ts +59 -0
  67. package/dist/hooks/loader.d.ts.map +1 -0
  68. package/dist/hooks/loader.js +170 -0
  69. package/dist/hooks/loader.js.map +1 -0
  70. package/dist/hooks/message-transformer.d.ts +16 -0
  71. package/dist/hooks/message-transformer.d.ts.map +1 -0
  72. package/dist/hooks/message-transformer.js +46 -0
  73. package/dist/hooks/message-transformer.js.map +1 -0
  74. package/dist/hooks/runner.d.ts +109 -0
  75. package/dist/hooks/runner.d.ts.map +1 -0
  76. package/dist/hooks/runner.js +426 -0
  77. package/dist/hooks/runner.js.map +1 -0
  78. package/dist/hooks/tool-wrapper.d.ts +16 -0
  79. package/dist/hooks/tool-wrapper.d.ts.map +1 -0
  80. package/dist/hooks/tool-wrapper.js +74 -0
  81. package/dist/hooks/tool-wrapper.js.map +1 -0
  82. package/dist/hooks/types.d.ts +431 -0
  83. package/dist/hooks/types.d.ts.map +1 -0
  84. package/dist/hooks/types.js +8 -0
  85. package/dist/hooks/types.js.map +1 -0
  86. package/dist/index.d.ts +17 -0
  87. package/dist/index.d.ts.map +1 -0
  88. package/dist/index.js +17 -0
  89. package/dist/index.js.map +1 -0
  90. package/dist/instrumentation.d.ts +56 -0
  91. package/dist/instrumentation.d.ts.map +1 -0
  92. package/dist/instrumentation.js +13 -0
  93. package/dist/instrumentation.js.map +1 -0
  94. package/dist/lazy-tool-loader.d.ts +67 -0
  95. package/dist/lazy-tool-loader.d.ts.map +1 -0
  96. package/dist/lazy-tool-loader.js +129 -0
  97. package/dist/lazy-tool-loader.js.map +1 -0
  98. package/dist/lsp.d.ts +16 -0
  99. package/dist/lsp.d.ts.map +1 -0
  100. package/dist/lsp.js +24 -0
  101. package/dist/lsp.js.map +1 -0
  102. package/dist/runtime.d.ts +62 -0
  103. package/dist/runtime.d.ts.map +1 -0
  104. package/dist/runtime.js +243 -0
  105. package/dist/runtime.js.map +1 -0
  106. package/dist/session/execution-plan.d.ts +53 -0
  107. package/dist/session/execution-plan.d.ts.map +1 -0
  108. package/dist/session/execution-plan.js +170 -0
  109. package/dist/session/execution-plan.js.map +1 -0
  110. package/dist/session/orchestrator.d.ts +21 -0
  111. package/dist/session/orchestrator.d.ts.map +1 -0
  112. package/dist/session/orchestrator.js +154 -0
  113. package/dist/session/orchestrator.js.map +1 -0
  114. package/dist/session/prompt-queue.d.ts +50 -0
  115. package/dist/session/prompt-queue.d.ts.map +1 -0
  116. package/dist/session/prompt-queue.js +155 -0
  117. package/dist/session/prompt-queue.js.map +1 -0
  118. package/dist/session-manager.d.ts +80 -0
  119. package/dist/session-manager.d.ts.map +1 -0
  120. package/dist/session-manager.js +257 -0
  121. package/dist/session-manager.js.map +1 -0
  122. package/dist/tools.d.ts +10 -0
  123. package/dist/tools.d.ts.map +1 -0
  124. package/dist/tools.js +19 -0
  125. package/dist/tools.js.map +1 -0
  126. package/dist/transports.d.ts +18 -0
  127. package/dist/transports.d.ts.map +1 -0
  128. package/dist/transports.js +37 -0
  129. package/dist/transports.js.map +1 -0
  130. package/package.json +43 -0
@@ -0,0 +1,219 @@
1
+ /**
2
+ * Custom tool loader - discovers and loads TypeScript tool modules.
3
+ *
4
+ * Tools are loaded from:
5
+ * - ~/.config/marvin/tools/*.ts (single-file tools)
6
+ * - ~/.config/marvin/tools/<name>/index.ts (directory-based tools)
7
+ *
8
+ * Uses Bun's native import() which handles TypeScript directly.
9
+ */
10
+ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
11
+ if (typeof path === "string" && /^\.\.?\//.test(path)) {
12
+ return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
13
+ return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
14
+ });
15
+ }
16
+ return path;
17
+ };
18
+ import { spawn } from "node:child_process";
19
+ import { existsSync, readdirSync } from "node:fs";
20
+ import { join, resolve } from "node:path";
21
+ import { pathToFileURL } from "node:url";
22
+ import { validateCustomTool, issueFromError } from "../validation.js";
23
+ const createToolIssue = (path, message, severity = "error") => ({
24
+ kind: "tool",
25
+ severity,
26
+ path,
27
+ message,
28
+ });
29
+ const isCustomToolFactory = (value) => typeof value === "function";
30
+ /**
31
+ * Execute a command and return stdout/stderr/code.
32
+ * Supports cancellation via AbortSignal and timeout.
33
+ */
34
+ async function execCommand(command, args, cwd, options) {
35
+ return new Promise((resolve) => {
36
+ const proc = spawn(command, args, {
37
+ cwd,
38
+ shell: false,
39
+ stdio: ["ignore", "pipe", "pipe"],
40
+ });
41
+ let stdout = "";
42
+ let stderr = "";
43
+ let killed = false;
44
+ let timeoutId;
45
+ const killProcess = () => {
46
+ if (!killed) {
47
+ killed = true;
48
+ proc.kill("SIGTERM");
49
+ // Force kill after 5s if SIGTERM doesn't work
50
+ setTimeout(() => {
51
+ if (!proc.killed) {
52
+ proc.kill("SIGKILL");
53
+ }
54
+ }, 5000);
55
+ }
56
+ };
57
+ // Handle abort signal
58
+ if (options?.signal) {
59
+ if (options.signal.aborted) {
60
+ killProcess();
61
+ }
62
+ else {
63
+ options.signal.addEventListener("abort", killProcess, { once: true });
64
+ }
65
+ }
66
+ // Handle timeout
67
+ if (options?.timeout && options.timeout > 0) {
68
+ timeoutId = setTimeout(killProcess, options.timeout);
69
+ }
70
+ proc.stdout.on("data", (data) => {
71
+ stdout += data.toString();
72
+ });
73
+ proc.stderr.on("data", (data) => {
74
+ stderr += data.toString();
75
+ });
76
+ proc.on("close", (code) => {
77
+ if (timeoutId)
78
+ clearTimeout(timeoutId);
79
+ if (options?.signal) {
80
+ options.signal.removeEventListener("abort", killProcess);
81
+ }
82
+ resolve({
83
+ stdout,
84
+ stderr,
85
+ code: code ?? 0,
86
+ killed,
87
+ });
88
+ });
89
+ proc.on("error", (err) => {
90
+ if (timeoutId)
91
+ clearTimeout(timeoutId);
92
+ if (options?.signal) {
93
+ options.signal.removeEventListener("abort", killProcess);
94
+ }
95
+ resolve({
96
+ stdout,
97
+ stderr: stderr || err.message,
98
+ code: 1,
99
+ killed,
100
+ });
101
+ });
102
+ });
103
+ }
104
+ /**
105
+ * Load a single tool module.
106
+ */
107
+ async function loadTool(toolPath, api) {
108
+ const resolvedPath = resolve(toolPath);
109
+ try {
110
+ // Use file URL for import - Bun handles TS natively
111
+ const fileUrl = pathToFileURL(resolvedPath).href;
112
+ const module = await import(__rewriteRelativeImportExtension(fileUrl));
113
+ const factory = module.default;
114
+ if (!isCustomToolFactory(factory)) {
115
+ return { tools: null, error: "Tool must export a default function" };
116
+ }
117
+ // Call factory with API
118
+ const result = await factory(api);
119
+ // Handle single tool or array of tools
120
+ const toolsArray = Array.isArray(result) ? result : [result];
121
+ const loadedTools = toolsArray.map((tool) => ({
122
+ path: toolPath,
123
+ resolvedPath,
124
+ tool,
125
+ }));
126
+ return { tools: loadedTools, error: null };
127
+ }
128
+ catch (err) {
129
+ const message = err instanceof Error ? err.message : String(err);
130
+ return { tools: null, error: `Failed to load tool: ${message}` };
131
+ }
132
+ }
133
+ /**
134
+ * Discover tool files from a directory.
135
+ * Finds both:
136
+ * - tools/*.ts (single-file tools)
137
+ * - tools/<name>/index.ts (directory-based tools with assets)
138
+ */
139
+ function discoverToolsInDir(dir) {
140
+ if (!existsSync(dir)) {
141
+ return [];
142
+ }
143
+ const paths = [];
144
+ try {
145
+ const entries = readdirSync(dir, { withFileTypes: true });
146
+ for (const entry of entries) {
147
+ if (entry.isFile() || entry.isSymbolicLink()) {
148
+ // Single-file tool: tools/name.ts
149
+ if (entry.name.endsWith(".ts")) {
150
+ paths.push(join(dir, entry.name));
151
+ }
152
+ }
153
+ else if (entry.isDirectory()) {
154
+ // Directory-based tool: tools/name/index.ts
155
+ const indexPath = join(dir, entry.name, "index.ts");
156
+ if (existsSync(indexPath)) {
157
+ paths.push(indexPath);
158
+ }
159
+ }
160
+ }
161
+ }
162
+ catch {
163
+ // Ignore read errors
164
+ }
165
+ return paths;
166
+ }
167
+ /**
168
+ * Discover and load tools from the config directory.
169
+ * Loads from ~/.config/marvin/tools/*.ts
170
+ *
171
+ * @param configDir - Base config directory (e.g., ~/.config/marvin)
172
+ * @param cwd - Current working directory for tool execution
173
+ * @param builtInToolNames - Names of built-in tools to check for conflicts
174
+ * @param sendRef - Ref for send handler (set by App after initialization)
175
+ */
176
+ export async function loadCustomTools(configDir, cwd, builtInToolNames, sendRef, hasUI) {
177
+ const tools = [];
178
+ const issues = [];
179
+ const seenNames = new Set(builtInToolNames);
180
+ // Shared API object - all tools get the same instance
181
+ const api = {
182
+ cwd,
183
+ hasUI,
184
+ exec: (command, args, options) => execCommand(command, args, cwd, options),
185
+ send: (text) => sendRef.current(text),
186
+ };
187
+ const toolsDir = join(configDir, "tools");
188
+ const paths = discoverToolsInDir(toolsDir);
189
+ for (const toolPath of paths) {
190
+ const { tools: loadedTools, error } = await loadTool(toolPath, api);
191
+ if (error) {
192
+ issues.push(issueFromError("tool", toolPath, error));
193
+ continue;
194
+ }
195
+ if (loadedTools) {
196
+ for (const loadedTool of loadedTools) {
197
+ // Check for name conflicts
198
+ if (seenNames.has(loadedTool.tool.name)) {
199
+ issues.push(createToolIssue(toolPath, `Tool name "${loadedTool.tool.name}" conflicts with existing tool`));
200
+ continue;
201
+ }
202
+ seenNames.add(loadedTool.tool.name);
203
+ tools.push(loadedTool);
204
+ issues.push(...validateCustomTool(loadedTool.tool, toolPath));
205
+ if (typeof loadedTool.tool.execute !== "function") {
206
+ issues.push(createToolIssue(toolPath, `Tool "${loadedTool.tool.name}" is missing an execute() function`));
207
+ }
208
+ if (!loadedTool.tool.parameters) {
209
+ issues.push(createToolIssue(toolPath, `Tool "${loadedTool.tool.name}" does not export parameters schema`, "warning"));
210
+ }
211
+ }
212
+ }
213
+ }
214
+ return { tools, issues };
215
+ }
216
+ /**
217
+ * Get built-in tool names from an array of tools.
218
+ */
219
+ //# sourceMappingURL=loader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loader.js","sourceRoot":"","sources":["../../../src/extensibility/custom-tools/loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;;;;;;;;;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACjD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,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CACV,eAAe,CACd,QAAQ,EACR,cAAc,UAAU,CAAC,IAAI,CAAC,IAAI,gCAAgC,CAClE,CACD,CAAA;oBACD,SAAQ;gBACT,CAAC;gBAED,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;gBACnC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;gBAEtB,MAAM,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAC,UAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAA;gBAE7D,IAAI,OAAO,UAAU,CAAC,IAAI,CAAC,OAAO,KAAK,UAAU,EAAE,CAAC;oBACnD,MAAM,CAAC,IAAI,CACV,eAAe,CACd,QAAQ,EACR,SAAS,UAAU,CAAC,IAAI,CAAC,IAAI,oCAAoC,CACjE,CACD,CAAA;gBACF,CAAC;gBACD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;oBACjC,MAAM,CAAC,IAAI,CACV,eAAe,CACd,QAAQ,EACR,SAAS,UAAU,CAAC,IAAI,CAAC,IAAI,qCAAqC,EAClE,SAAS,CACT,CACD,CAAA;gBACF,CAAC;YACF,CAAC;QACF,CAAC;IACF,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAA;AACzB,CAAC;AAED;;GAEG"}
@@ -0,0 +1,102 @@
1
+ /**
2
+ * Custom tool types for user-defined tools.
3
+ */
4
+ import type { AgentTool, AgentToolResult } from "@yeshwanthyk/ai";
5
+ import type { JSX } from "solid-js";
6
+ import type { ValidationIssue } from "../schema.js";
7
+ import type { HookTheme } from "../../hooks/types.js";
8
+ /**
9
+ * Options passed to custom tool result renderers.
10
+ */
11
+ export interface RenderResultOptions {
12
+ expanded: boolean;
13
+ isPartial: boolean;
14
+ }
15
+ /**
16
+ * Session lifecycle event types for custom tools.
17
+ */
18
+ export type SessionEvent = {
19
+ type: "session.start";
20
+ sessionId: string;
21
+ } | {
22
+ type: "session.resume";
23
+ sessionId: string;
24
+ } | {
25
+ type: "session.end";
26
+ sessionId: string;
27
+ };
28
+ /**
29
+ * Extended AgentTool with optional UI hooks for first-class rendering.
30
+ * Uses `any` for TParams to avoid TypeBox version constraint issues.
31
+ */
32
+ export interface CustomAgentTool<TDetails = any> extends AgentTool<any, TDetails> {
33
+ /** Custom header/call rendering */
34
+ renderCall?: (args: any, theme: HookTheme) => JSX.Element;
35
+ /** Custom result rendering */
36
+ renderResult?: (result: AgentToolResult<TDetails>, opts: RenderResultOptions, theme: HookTheme) => JSX.Element;
37
+ /** Session lifecycle hook */
38
+ onSession?: (ev: SessionEvent) => void | Promise<void>;
39
+ /** Cleanup on app exit */
40
+ dispose?: () => void | Promise<void>;
41
+ }
42
+ /**
43
+ * Result from executing a command.
44
+ */
45
+ export interface ExecResult {
46
+ stdout: string;
47
+ stderr: string;
48
+ code: number;
49
+ killed: boolean;
50
+ }
51
+ /**
52
+ * Options for command execution.
53
+ */
54
+ export interface ExecOptions {
55
+ /** Timeout in milliseconds */
56
+ timeout?: number;
57
+ /** Abort signal for cancellation */
58
+ signal?: AbortSignal;
59
+ }
60
+ /**
61
+ * Ref for send handler - allows late binding of the send function.
62
+ */
63
+ export type SendRef = {
64
+ current: (text: string) => void;
65
+ };
66
+ /**
67
+ * API provided to custom tool factories.
68
+ */
69
+ export interface ToolAPI {
70
+ /** Current working directory */
71
+ cwd: string;
72
+ /** Whether running in interactive mode (TUI). False for headless/ACP modes. */
73
+ hasUI: boolean;
74
+ /** Execute a command */
75
+ exec: (command: string, args: string[], options?: ExecOptions) => Promise<ExecResult>;
76
+ /** Send a message to the agent (queued as user input) */
77
+ send: (text: string) => void;
78
+ }
79
+ /**
80
+ * Factory function that creates one or more tools.
81
+ * Default export from tool modules.
82
+ */
83
+ export type CustomToolFactory = (api: ToolAPI) => CustomAgentTool | CustomAgentTool[] | Promise<CustomAgentTool | CustomAgentTool[]>;
84
+ /**
85
+ * A loaded custom tool with its source path.
86
+ */
87
+ export interface LoadedCustomTool {
88
+ /** Original file path */
89
+ path: string;
90
+ /** Resolved absolute path */
91
+ resolvedPath: string;
92
+ /** The loaded tool */
93
+ tool: CustomAgentTool;
94
+ }
95
+ /**
96
+ * Result of loading custom tools.
97
+ */
98
+ export interface CustomToolsLoadResult {
99
+ tools: LoadedCustomTool[];
100
+ issues: ValidationIssue[];
101
+ }
102
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/extensibility/custom-tools/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAErD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,QAAQ,EAAE,OAAO,CAAA;IACjB,SAAS,EAAE,OAAO,CAAA;CAClB;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,GACrB;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAC5C;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAC7C;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAA;AAE7C;;;GAGG;AACH,MAAM,WAAW,eAAe,CAAC,QAAQ,GAAG,GAAG,CAAE,SAAQ,SAAS,CAAC,GAAG,EAAE,QAAQ,CAAC;IAChF,mCAAmC;IACnC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,KAAK,GAAG,CAAC,OAAO,CAAA;IACzD,8BAA8B;IAC9B,Y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O,CAAC,eAAe,GAAG,eAAe,EAAE,CAAC,CAAA;AAEvF;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,6BAA6B;IAC7B,YAAY,EAAE,MAAM,CAAA;IACpB,sBAAsB;IACtB,IAAI,EAAE,eAAe,CAAA;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC,KAAK,EAAE,gBAAgB,EAAE,CAAA;IACzB,MAAM,EAAE,eAAe,EAAE,CAAA;CACzB"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Custom tool types for user-defined tools.
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/extensibility/custom-tools/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -0,0 +1,36 @@
1
+ import { Context, Layer } from "effect";
2
+ import { HookRunner } from "../hooks/index.js";
3
+ import { type LoadedCustomTool, type SendRef } from "./custom-tools/index.js";
4
+ import type { ValidationIssue } from "./schema.js";
5
+ import type { ReadonlySessionManager } from "../session-manager.js";
6
+ import { type CustomCommandService } from "./custom-commands.js";
7
+ export interface ExtensibilityLoadOptions {
8
+ configDir: string;
9
+ cwd: string;
10
+ sendRef: SendRef;
11
+ builtinToolNames: string[];
12
+ /** Whether running in interactive mode (TUI) */
13
+ hasUI: boolean;
14
+ /** Session manager for hook context */
15
+ sessionManager: ReadonlySessionManager;
16
+ }
17
+ export interface ExtensibilityLoadResult {
18
+ hookRunner: HookRunner;
19
+ customTools: LoadedCustomTool[];
20
+ validationIssues: ValidationIssue[];
21
+ hookCount: number;
22
+ }
23
+ export declare const loadExtensibility: (options: ExtensibilityLoadOptions) => Promise<ExtensibilityLoadResult>;
24
+ export declare const attachHookErrorLogging: (hookRunner: HookRunner, log: (message: string) => void) => void;
25
+ export interface ExtensibilityService extends ExtensibilityLoadResult {
26
+ }
27
+ export declare const ExtensibilityTag: Context.Tag<ExtensibilityService, ExtensibilityService>;
28
+ export interface ExtensibilityLayerOptions {
29
+ sendRef: SendRef;
30
+ builtinToolNames: string[];
31
+ hasUI: boolean;
32
+ cwd?: string;
33
+ loader?: typeof loadExtensibility;
34
+ }
35
+ export declare const ExtensibilityLayer: (options: ExtensibilityLayerOptions) => Layer.Layer<ExtensibilityService, import("effect/Cause").UnknownException, import("../config.js").ConfigService | import("../session-manager.js").SessionManagerService | import("../instrumentation.js").InstrumentationService | CustomCommandService>;
36
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/extensibility/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,KAAK,EAAE,MAAM,QAAQ,CAAA;AAC/C,OAAO,EAAa,UAAU,EAAkB,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAEN,KAAK,gBAAgB,EACrB,KAAK,OAAO,EACZ,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAInE,OAAO,EAAoB,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAElF,MAAM,WAAW,wBAAwB;IACxC,SAAS,EAAE,MAAM,CAAA;IACjB,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,OAAO,CAAA;IAChB,gBAAgB,EAAE,MAAM,EAAE,CAAA;IAC1B,gDAAgD;IAChD,KAAK,EAAE,OAAO,CAAA;IACd,uCAAuC;IACvC,cAAc,EAAE,sBAAsB,CAAA;CACtC;AAED,MAAM,WAAW,uBAAuB;IACvC,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,gBAAgB,EAAE,CAAA;IAC/B,gBAAgB,EAAE,eAAe,EAAE,CAAA;IACnC,SAAS,EAAE,MAAM,CAAA;CACjB;AAED,eAAO,MAAM,iBAAiB,GAC7B,SAAS,wBAAwB,KAC/B,OAAO,CAAC,uBAAuB,CAkBjC,CAAA;AAED,eAAO,MAAM,sBAAsB,GAAI,YAAY,UAAU,EAAE,KAAK,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,SAI5F,CAAA;AAED,MAAM,WAAW,oBAAqB,SAAQ,uBAAuB;CAAG;AAExE,eAAO,MAAM,gBAAgB,yDAAkF,CAAA;AAE/G,MAAM,WAAW,yBAAyB;IACzC,OAAO,EAAE,OAAO,CAAA;IAChB,gBAAgB,EAAE,MAAM,EAAE,CAAA;IAC1B,KAAK,EAAE,OAAO,CAAA;IACd,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,OAAO,iBAAiB,CAAA;CACjC;AAED,eAAO,MAAM,kBAAkB,GAAI,SAAS,yBAAyB,6PAoEnE,CAAA"}
@@ -0,0 +1,79 @@
1
+ import { Context, Effect, Layer } from "effect";
2
+ import { loadHooks, HookRunner } from "../hooks/index.js";
3
+ import { loadCustomTools, } from "./custom-tools/index.js";
4
+ import { ConfigTag } from "../config.js";
5
+ import { SessionManagerTag } from "../session-manager.js";
6
+ import { InstrumentationTag } from "../instrumentation.js";
7
+ import { CustomCommandTag } from "./custom-commands.js";
8
+ export const loadExtensibility = async (options) => {
9
+ const { hooks, issues: hookIssues } = await loadHooks(options.configDir);
10
+ const hookRunner = new HookRunner(hooks, options.cwd, options.configDir, options.sessionManager);
11
+ const { tools: customTools, issues: toolIssues } = await loadCustomTools(options.configDir, options.cwd, options.builtinToolNames, options.sendRef, options.hasUI);
12
+ return {
13
+ hookRunner,
14
+ customTools,
15
+ validationIssues: [...hookIssues, ...toolIssues],
16
+ hookCount: hooks.length,
17
+ };
18
+ };
19
+ export const attachHookErrorLogging = (hookRunner, log) => {
20
+ hookRunner.onError((err) => {
21
+ log(`Hook error [${err.event}] ${err.hookPath}: ${err.error}`);
22
+ });
23
+ };
24
+ export const ExtensibilityTag = Context.GenericTag("runtime-effect/ExtensibilityService");
25
+ export const ExtensibilityLayer = (options) => Layer.effect(ExtensibilityTag, Effect.gen(function* () {
26
+ const { config } = yield* ConfigTag;
27
+ const { sessionManager } = yield* SessionManagerTag;
28
+ const instrumentation = yield* InstrumentationTag;
29
+ const customCommands = yield* Effect.catchAll(CustomCommandTag, () => Effect.succeed(null));
30
+ const loader = options.loader ?? loadExtensibility;
31
+ const result = yield* Effect.tryPromise(() => loader({
32
+ configDir: config.configDir,
33
+ cwd: options.cwd ?? process.cwd(),
34
+ sendRef: options.sendRef,
35
+ builtinToolNames: options.builtinToolNames,
36
+ hasUI: options.hasUI,
37
+ sessionManager,
38
+ }));
39
+ result.hookRunner.onError((err) => {
40
+ const errorValue = err.error;
41
+ let errorMessage;
42
+ if (typeof errorValue === "object" && errorValue !== null && "message" in errorValue) {
43
+ const maybeMessage = errorValue.message;
44
+ errorMessage = maybeMessage !== undefined ? String(maybeMessage) : String(errorValue);
45
+ }
46
+ else {
47
+ errorMessage = String(errorValue);
48
+ }
49
+ instrumentation.record({
50
+ type: "hook:error",
51
+ hookPath: err.hookPath,
52
+ event: err.event,
53
+ error: errorMessage,
54
+ });
55
+ });
56
+ for (const issue of result.validationIssues) {
57
+ instrumentation.record({
58
+ type: "extensibility:validation-issue",
59
+ issue,
60
+ });
61
+ }
62
+ const commandCount = customCommands?.commands.size;
63
+ instrumentation.record({
64
+ type: "extensibility:loaded",
65
+ hooks: result.hookCount,
66
+ customTools: result.customTools.length,
67
+ ...(commandCount !== undefined ? { customCommands: commandCount } : {}),
68
+ });
69
+ instrumentation.record({
70
+ type: "extensibility:custom-tools-loaded",
71
+ count: result.customTools.length,
72
+ entries: result.customTools.map((tool) => ({
73
+ name: tool.tool.name,
74
+ path: tool.resolvedPath,
75
+ })),
76
+ });
77
+ return result;
78
+ }));
79
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/extensibility/index.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AG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YAC1C,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI;YACpB,IAAI,EAAE,IAAI,CAAC,YAAY;SACvB,CAAC,CAAC;KACH,CAAC,CAAA;IAEF,OAAO,MAAM,CAAA;AACd,CAAC,CAAC,CACF,CAAA"}
@@ -0,0 +1,40 @@
1
+ import type { Static } from "@sinclair/typebox";
2
+ export declare const VALIDATION_KINDS: readonly ["hook", "tool", "command"];
3
+ export type ValidationKind = (typeof VALIDATION_KINDS)[number];
4
+ export declare const VALIDATION_SEVERITIES: readonly ["error", "warning"];
5
+ export type ValidationSeverity = (typeof VALIDATION_SEVERITIES)[number];
6
+ export declare const validationKindSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"hook">, import("@sinclair/typebox").TLiteral<"tool">, import("@sinclair/typebox").TLiteral<"command">]>;
7
+ export declare const validationSeveritySchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"error">, import("@sinclair/typebox").TLiteral<"warning">]>;
8
+ export interface ValidationIssue {
9
+ kind: ValidationKind;
10
+ severity: ValidationSeverity;
11
+ path: string;
12
+ message: string;
13
+ hint?: string;
14
+ }
15
+ export declare const validationIssueSchema: import("@sinclair/typebox").TObject<{
16
+ kind: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"hook">, import("@sinclair/typebox").TLiteral<"tool">, import("@sinclair/typebox").TLiteral<"command">]>;
17
+ severity: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"error">, import("@sinclair/typebox").TLiteral<"warning">]>;
18
+ path: import("@sinclair/typebox").TString;
19
+ message: import("@sinclair/typebox").TString;
20
+ hint: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
21
+ }>;
22
+ export declare const customCommandSchema: import("@sinclair/typebox").TObject<{
23
+ name: import("@sinclair/typebox").TString;
24
+ description: import("@sinclair/typebox").TString;
25
+ template: import("@sinclair/typebox").TString;
26
+ }>;
27
+ export type CustomCommandManifest = Static<typeof customCommandSchema>;
28
+ export declare const customToolSchema: import("@sinclair/typebox").TObject<{
29
+ name: import("@sinclair/typebox").TString;
30
+ label: import("@sinclair/typebox").TString;
31
+ description: import("@sinclair/typebox").TString;
32
+ }>;
33
+ export type CustomToolDescriptor = Static<typeof customToolSchema>;
34
+ export declare const HOOK_EVENT_NAMES: readonly ["app.start", "session.start", "session.resume", "session.clear", "session.before_compact", "session.compact", "session.shutdown", "agent.before_start", "agent.start", "agent.end", "turn.start", "turn.end", "tool.execute.before", "tool.execute.after", "chat.message", "chat.messages.transform", "chat.system.transform", "chat.params", "auth.get", "model.resolve"];
35
+ export declare const hookDescriptorSchema: import("@sinclair/typebox").TObject<{
36
+ path: import("@sinclair/typebox").TString;
37
+ events: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"app.start">, import("@sinclair/typebox").TLiteral<"session.start">, import("@sinclair/typebox").TLiteral<"session.resume">, import("@sinclair/typebox").TLiteral<"session.clear">, import("@sinclair/typebox").TLiteral<"session.before_compact">, import("@sinclair/typebox").TLiteral<"session.compact">, import("@sinclair/typebox").TLiteral<"session.shutdown">, import("@sinclair/typebox").TLiteral<"agent.before_start">, import("@sinclair/typebox").TLiteral<"agent.start">, import("@sinclair/typebox").TLiteral<"agent.end">, import("@sinclair/typebox").TLiteral<"turn.start">, import("@sinclair/typebox").TLiteral<"turn.end">, import("@sinclair/typebox").TLiteral<"tool.execute.before">, import("@sinclair/typebox").TLiteral<"tool.execute.after">, import("@sinclair/typebox").TLiteral<"chat.message">, import("@sinclair/typebox").TLiteral<"chat.messages.transform">, import("@sinclair/typebox").TLiteral<"chat.system.transform">, import("@sinclair/typebox").TLiteral<"chat.params">, import("@sinclair/typebox").TLiteral<"auth.get">, import("@sinclair/typebox").TLiteral<"model.resolve">]>>;
38
+ }>;
39
+ export type HookDescriptor = Static<typeof hookDescriptorSchema>;
40
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/extensibility/schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE/C,eAAO,MAAM,gBAAgB,sCAAuC,CAAA;AACpE,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAA;AAE9D,eAAO,MAAM,qBAAqB,+BAAgC,CAAA;AAClE,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEvE,eAAO,MAAM,oBAAoB,mLAI/B,CAAA;AACF,eAAO,MAAM,wBAAwB,sIAA+D,CAAA;AAEpG,MAAM,WAAW,eAAe;IAC/B,IAAI,EAAE,cAAc,CAAA;IACpB,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;CACb;AAED,eAAO,MAAM,qBAAqB;;;;;;EAMhC,CAAA;AAEF,eAAO,MAAM,mBAAmB;;;;EAI9B,CAAA;AAEF,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAEtE,eAAO,MAAM,gBAAgB;;;;EAO5B,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAElE,eAAO,MAAM,gBAAgB,sXAqBnB,CAAA;AAyBV,eAAO,MAAM,oBAAoB;;;EAG/B,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAA"}
@@ -0,0 +1,75 @@
1
+ import { Type } from "@sinclair/typebox";
2
+ export const VALIDATION_KINDS = ["hook", "tool", "command"];
3
+ export const VALIDATION_SEVERITIES = ["error", "warning"];
4
+ export const validationKindSchema = Type.Union([
5
+ Type.Literal("hook"),
6
+ Type.Literal("tool"),
7
+ Type.Literal("command"),
8
+ ]);
9
+ export const validationSeveritySchema = Type.Union([Type.Literal("error"), Type.Literal("warning")]);
10
+ export const validationIssueSchema = Type.Object({
11
+ kind: validationKindSchema,
12
+ severity: validationSeveritySchema,
13
+ path: Type.String({ minLength: 1 }),
14
+ message: Type.String({ minLength: 1 }),
15
+ hint: Type.Optional(Type.String({ minLength: 1 })),
16
+ });
17
+ export const customCommandSchema = Type.Object({
18
+ name: Type.String({ pattern: "^[A-Za-z0-9][A-Za-z0-9_-]*$", minLength: 1 }),
19
+ description: Type.String({ minLength: 1 }),
20
+ template: Type.String({ minLength: 1 }),
21
+ });
22
+ export const customToolSchema = Type.Object({
23
+ name: Type.String({ minLength: 1 }),
24
+ label: Type.String({ minLength: 1 }),
25
+ description: Type.String({ minLength: 1 }),
26
+ }, { additionalProperties: true });
27
+ export const HOOK_EVENT_NAMES = [
28
+ "app.start",
29
+ "session.start",
30
+ "session.resume",
31
+ "session.clear",
32
+ "session.before_compact",
33
+ "session.compact",
34
+ "session.shutdown",
35
+ "agent.before_start",
36
+ "agent.start",
37
+ "agent.end",
38
+ "turn.start",
39
+ "turn.end",
40
+ "tool.execute.before",
41
+ "tool.execute.after",
42
+ "chat.message",
43
+ "chat.messages.transform",
44
+ "chat.system.transform",
45
+ "chat.params",
46
+ "auth.get",
47
+ "model.resolve",
48
+ ];
49
+ const hookEventLiteralSchema = Type.Union([
50
+ Type.Literal("app.start"),
51
+ Type.Literal("session.start"),
52
+ Type.Literal("session.resume"),
53
+ Type.Literal("session.clear"),
54
+ Type.Literal("session.before_compact"),
55
+ Type.Literal("session.compact"),
56
+ Type.Literal("session.shutdown"),
57
+ Type.Literal("agent.before_start"),
58
+ Type.Literal("agent.start"),
59
+ Type.Literal("agent.end"),
60
+ Type.Literal("turn.start"),
61
+ Type.Literal("turn.end"),
62
+ Type.Literal("tool.execute.before"),
63
+ Type.Literal("tool.execute.after"),
64
+ Type.Literal("chat.message"),
65
+ Type.Literal("chat.messages.transform"),
66
+ Type.Literal("chat.system.transform"),
67
+ Type.Literal("chat.params"),
68
+ Type.Literal("auth.get"),
69
+ Type.Literal("model.resolve"),
70
+ ]);
71
+ export const hookDescriptorSchema = Type.Object({
72
+ path: Type.String({ minLength: 1 }),
73
+ events: Type.Array(hookEventLiteralSchema, { default: [] }),
74
+ });
75
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/extensibility/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAGxC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAU,CAAA;AAGpE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,OAAO,EAAE,SAAS,CAAU,CAAA;AAGlE,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC,KAAK,CAAC;IAC9C,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;IACpB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;IACpB,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;CACvB,CAAC,CAAA;AACF,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAA;AAUpG,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC,MAAM,CAAC;IAChD,IAAI,EAAE,oBAAoB;IAC1B,QAAQ,EAAE,wBAAwB;IAClC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;IACnC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,SAAS,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C,WAAW,CAAC;IACzB,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC;IAC7B,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC;IAC9B,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC;IAC7B,IAAI,CAAC,OAAO,CAAC,wBAAwB,CAAC;IACtC,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC;IAC/B,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC;IAChC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC;IAClC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;IAC3B,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC;IACzB,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC;IAC1B,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;IACxB,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC;IACnC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC;IAClC,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC;IAC5B,IAAI,CAAC,OAAO,CAAC,yBAAyB,CAAC;IACvC,IAAI,CAAC,OAAO,CAAC,uBAAuB,CAAC;IACrC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;IAC3B,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;IACxB,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC;CAC7B,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC,MAAM,CAAC;IAC/C,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;IACnC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,sBAAsB,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;CAC3D,CAAC,CAAA"}
@@ -0,0 +1,11 @@
1
+ import { type CustomCommandManifest, type HookDescriptor, type ValidationIssue, type ValidationKind, type ValidationSeverity } from "./schema.js";
2
+ export declare const issueFromError: (kind: ValidationKind, path: string, error: unknown, options?: {
3
+ hint?: string;
4
+ severity?: ValidationSeverity;
5
+ }) => ValidationIssue;
6
+ export declare const validateCustomCommand: (manifest: CustomCommandManifest, path: string) => ValidationIssue[];
7
+ export declare const validateCustomTool: (descriptor: unknown, path: string) => ValidationIssue[];
8
+ export declare const validateHookDescriptor: (descriptor: HookDescriptor) => ValidationIssue[];
9
+ export declare const formatValidationIssue: (issue: ValidationIssue) => string;
10
+ export declare const hasBlockingIssues: (issues: ValidationIssue[]) => boolean;
11
+ //# sourceMappingURL=validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/extensibility/validation.ts"],"names":[],"mappings":"AAEA,OAAO,EAIN,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,MAAM,aAAa,CAAA;AAkCpB,eAAO,MAAM,cAAc,GAC1B,MAAM,cAAc,EACpB,MAAM,MAAM,EACZ,OAAO,OAAO,EACd,UAAU;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,kBAAkB,CAAA;CAAE,KACxD,eAoBF,CAAA;AAYD,eAAO,MAAM,qBAAqB,GAAI,UAAU,qBAAqB,EAAE,MAAM,MAAM,KAAG,eAAe,EAEpG,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,YAAY,OAAO,EAAE,MAAM,MAAM,KAAG,eAAe,EAErF,CAAA;AAED,eAAO,MAAM,sBAAsB,GAAI,YAAY,cAAc,KAAG,eAAe,EAMlF,CAAA;AAED,eAAO,MAAM,qBAAqB,GAAI,OAAO,eAAe,KAAG,MAI9D,CAAA;AAED,eAAO,MAAM,iBAAiB,GAAI,QAAQ,eAAe,EAAE,KAAG,OACX,CAAA"}