beth-copilot 1.0.18 → 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.
- package/CHANGELOG.md +41 -28
- package/README.md +87 -247
- package/bin/cli.js +158 -358
- package/dist/__tests__/smoke.test.d.ts +8 -0
- package/dist/__tests__/smoke.test.d.ts.map +1 -0
- package/dist/__tests__/smoke.test.js +49 -0
- package/dist/__tests__/smoke.test.js.map +1 -0
- package/dist/cli/commands/beads.e2e.test.d.ts +13 -0
- package/dist/cli/commands/beads.e2e.test.d.ts.map +1 -0
- package/dist/cli/commands/beads.e2e.test.js +526 -0
- package/dist/cli/commands/beads.e2e.test.js.map +1 -0
- package/dist/cli/commands/cli-edge-cases.e2e.test.d.ts +32 -0
- package/dist/cli/commands/cli-edge-cases.e2e.test.d.ts.map +1 -0
- package/dist/cli/commands/cli-edge-cases.e2e.test.js +162 -0
- package/dist/cli/commands/cli-edge-cases.e2e.test.js.map +1 -0
- package/dist/cli/commands/close.d.ts +89 -0
- package/dist/cli/commands/close.d.ts.map +1 -0
- package/dist/cli/commands/close.e2e.test.d.ts +27 -0
- package/dist/cli/commands/close.e2e.test.d.ts.map +1 -0
- package/dist/cli/commands/close.e2e.test.js +252 -0
- package/dist/cli/commands/close.e2e.test.js.map +1 -0
- package/dist/cli/commands/close.js +309 -0
- package/dist/cli/commands/close.js.map +1 -0
- package/dist/cli/commands/close.test.d.ts +15 -0
- package/dist/cli/commands/close.test.d.ts.map +1 -0
- package/dist/cli/commands/close.test.js +634 -0
- package/dist/cli/commands/close.test.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts +23 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -1
- package/dist/cli/commands/doctor.js +93 -0
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/doctor.test.js +209 -0
- package/dist/cli/commands/doctor.test.js.map +1 -1
- package/dist/cli/commands/framework-isolation.test.d.ts +30 -0
- package/dist/cli/commands/framework-isolation.test.d.ts.map +1 -0
- package/dist/cli/commands/framework-isolation.test.js +119 -0
- package/dist/cli/commands/framework-isolation.test.js.map +1 -0
- package/dist/cli/commands/help.e2e.test.js +4 -4
- package/dist/cli/commands/help.e2e.test.js.map +1 -1
- package/dist/cli/commands/init-logic.e2e.test.d.ts +37 -0
- package/dist/cli/commands/init-logic.e2e.test.d.ts.map +1 -0
- package/dist/cli/commands/init-logic.e2e.test.js +305 -0
- package/dist/cli/commands/init-logic.e2e.test.js.map +1 -0
- package/dist/cli/commands/land.d.ts +142 -0
- package/dist/cli/commands/land.d.ts.map +1 -0
- package/dist/cli/commands/land.js +647 -0
- package/dist/cli/commands/land.js.map +1 -0
- package/dist/cli/commands/land.test.d.ts +20 -0
- package/dist/cli/commands/land.test.d.ts.map +1 -0
- package/dist/cli/commands/land.test.js +622 -0
- package/dist/cli/commands/land.test.js.map +1 -0
- package/dist/cli/commands/mcp.e2e.test.js +22 -29
- package/dist/cli/commands/mcp.e2e.test.js.map +1 -1
- package/dist/cli/commands/pipeline.e2e.test.js +20 -20
- package/dist/cli/commands/pipeline.e2e.test.js.map +1 -1
- package/dist/cli/commands/pre-push-guard.d.ts +84 -0
- package/dist/cli/commands/pre-push-guard.d.ts.map +1 -0
- package/dist/cli/commands/pre-push-guard.e2e.test.d.ts +24 -0
- package/dist/cli/commands/pre-push-guard.e2e.test.d.ts.map +1 -0
- package/dist/cli/commands/pre-push-guard.e2e.test.js +171 -0
- package/dist/cli/commands/pre-push-guard.e2e.test.js.map +1 -0
- package/dist/cli/commands/pre-push-guard.js +257 -0
- package/dist/cli/commands/pre-push-guard.js.map +1 -0
- package/dist/cli/commands/pre-push-guard.test.d.ts +15 -0
- package/dist/cli/commands/pre-push-guard.test.d.ts.map +1 -0
- package/dist/cli/commands/pre-push-guard.test.js +397 -0
- package/dist/cli/commands/pre-push-guard.test.js.map +1 -0
- package/dist/cli/commands/quickstart-expanded.e2e.test.d.ts +23 -0
- package/dist/cli/commands/quickstart-expanded.e2e.test.d.ts.map +1 -0
- package/dist/cli/commands/quickstart-expanded.e2e.test.js +179 -0
- package/dist/cli/commands/quickstart-expanded.e2e.test.js.map +1 -0
- package/dist/cli/commands/quickstart.d.ts.map +1 -1
- package/dist/cli/commands/quickstart.js +7 -23
- package/dist/cli/commands/quickstart.js.map +1 -1
- package/dist/cli/commands/quickstart.test.js +40 -67
- package/dist/cli/commands/quickstart.test.js.map +1 -1
- package/dist/core/agents/suite.test.js +4 -2
- package/dist/core/agents/suite.test.js.map +1 -1
- package/dist/core/agents/tools.test.js +5 -1
- package/dist/core/agents/tools.test.js.map +1 -1
- package/dist/index.d.ts +3 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -10
- package/dist/index.js.map +1 -1
- package/package.json +15 -9
- package/sbom.json +2011 -819
- package/templates/.github/agents/beth.agent.md +220 -66
- package/templates/.github/agents/developer.agent.md +53 -90
- package/templates/.github/agents/product-manager.agent.md +15 -68
- package/templates/.github/agents/researcher.agent.md +20 -71
- package/templates/.github/agents/security-reviewer.agent.md +29 -81
- package/templates/.github/agents/tester.agent.md +40 -69
- package/templates/.github/agents/ux-designer.agent.md +20 -74
- package/templates/.github/copilot-instructions.md +217 -225
- package/templates/AGENTS.md +108 -20
- package/templates/mcp.json.example +0 -3
- package/dist/cli/commands/client-config.d.ts +0 -31
- package/dist/cli/commands/client-config.d.ts.map +0 -1
- package/dist/cli/commands/client-config.e2e.test.d.ts +0 -15
- package/dist/cli/commands/client-config.e2e.test.d.ts.map +0 -1
- package/dist/cli/commands/client-config.e2e.test.js +0 -556
- package/dist/cli/commands/client-config.e2e.test.js.map +0 -1
- package/dist/cli/commands/client-config.js +0 -73
- package/dist/cli/commands/client-config.js.map +0 -1
- package/dist/cli/commands/client-config.test.d.ts +0 -6
- package/dist/cli/commands/client-config.test.d.ts.map +0 -1
- package/dist/cli/commands/client-config.test.js +0 -133
- package/dist/cli/commands/client-config.test.js.map +0 -1
- package/dist/cli/commands/init-quickstart.e2e.test.d.ts +0 -11
- package/dist/cli/commands/init-quickstart.e2e.test.d.ts.map +0 -1
- package/dist/cli/commands/init-quickstart.e2e.test.js +0 -221
- package/dist/cli/commands/init-quickstart.e2e.test.js.map +0 -1
- package/dist/core/context.d.ts +0 -171
- package/dist/core/context.d.ts.map +0 -1
- package/dist/core/context.js +0 -353
- package/dist/core/context.js.map +0 -1
- package/dist/core/context.test.d.ts +0 -8
- package/dist/core/context.test.d.ts.map +0 -1
- package/dist/core/context.test.js +0 -253
- package/dist/core/context.test.js.map +0 -1
- package/dist/core/handoffs.d.ts +0 -151
- package/dist/core/handoffs.d.ts.map +0 -1
- package/dist/core/handoffs.js +0 -220
- package/dist/core/handoffs.js.map +0 -1
- package/dist/core/handoffs.test.d.ts +0 -8
- package/dist/core/handoffs.test.d.ts.map +0 -1
- package/dist/core/handoffs.test.js +0 -231
- package/dist/core/handoffs.test.js.map +0 -1
- package/dist/core/orchestrator.d.ts +0 -246
- package/dist/core/orchestrator.d.ts.map +0 -1
- package/dist/core/orchestrator.js +0 -514
- package/dist/core/orchestrator.js.map +0 -1
- package/dist/core/orchestrator.test.d.ts +0 -8
- package/dist/core/orchestrator.test.d.ts.map +0 -1
- package/dist/core/orchestrator.test.js +0 -517
- package/dist/core/orchestrator.test.js.map +0 -1
- package/dist/core/router.d.ts +0 -102
- package/dist/core/router.d.ts.map +0 -1
- package/dist/core/router.js +0 -178
- package/dist/core/router.js.map +0 -1
- package/dist/core/router.test.d.ts +0 -8
- package/dist/core/router.test.d.ts.map +0 -1
- package/dist/core/router.test.js +0 -215
- package/dist/core/router.test.js.map +0 -1
- package/dist/init.test.js +0 -288
- package/dist/providers/azure.d.ts +0 -147
- package/dist/providers/azure.d.ts.map +0 -1
- package/dist/providers/azure.js +0 -491
- package/dist/providers/azure.js.map +0 -1
- package/dist/providers/azure.test.d.ts +0 -11
- package/dist/providers/azure.test.d.ts.map +0 -1
- package/dist/providers/azure.test.js +0 -330
- package/dist/providers/azure.test.js.map +0 -1
- package/dist/providers/config.d.ts +0 -87
- package/dist/providers/config.d.ts.map +0 -1
- package/dist/providers/config.js +0 -193
- package/dist/providers/config.js.map +0 -1
- package/dist/providers/config.test.d.ts +0 -7
- package/dist/providers/config.test.d.ts.map +0 -1
- package/dist/providers/config.test.js +0 -370
- package/dist/providers/config.test.js.map +0 -1
- package/dist/providers/index.d.ts +0 -18
- package/dist/providers/index.d.ts.map +0 -1
- package/dist/providers/index.js +0 -14
- package/dist/providers/index.js.map +0 -1
- package/dist/providers/interface.d.ts +0 -191
- package/dist/providers/interface.d.ts.map +0 -1
- package/dist/providers/interface.js +0 -94
- package/dist/providers/interface.js.map +0 -1
- package/dist/providers/retry.d.ts +0 -128
- package/dist/providers/retry.d.ts.map +0 -1
- package/dist/providers/retry.js +0 -205
- package/dist/providers/retry.js.map +0 -1
- package/dist/providers/retry.test.d.ts +0 -7
- package/dist/providers/retry.test.d.ts.map +0 -1
- package/dist/providers/retry.test.js +0 -439
- package/dist/providers/retry.test.js.map +0 -1
- package/dist/providers/streaming.d.ts +0 -157
- package/dist/providers/streaming.d.ts.map +0 -1
- package/dist/providers/streaming.js +0 -233
- package/dist/providers/streaming.js.map +0 -1
- package/dist/providers/streaming.test.d.ts +0 -7
- package/dist/providers/streaming.test.d.ts.map +0 -1
- package/dist/providers/streaming.test.js +0 -372
- package/dist/providers/streaming.test.js.map +0 -1
- package/dist/providers/types.d.ts +0 -209
- package/dist/providers/types.d.ts.map +0 -1
- package/dist/providers/types.js +0 -53
- package/dist/providers/types.js.map +0 -1
- package/dist/providers/types.test.d.ts +0 -7
- package/dist/providers/types.test.d.ts.map +0 -1
- package/dist/providers/types.test.js +0 -141
- package/dist/providers/types.test.js.map +0 -1
- package/dist/tools/cli/beads.d.ts +0 -27
- package/dist/tools/cli/beads.d.ts.map +0 -1
- package/dist/tools/cli/beads.js +0 -172
- package/dist/tools/cli/beads.js.map +0 -1
- package/dist/tools/cli/beads.test.d.ts +0 -8
- package/dist/tools/cli/beads.test.d.ts.map +0 -1
- package/dist/tools/cli/beads.test.js +0 -264
- package/dist/tools/cli/beads.test.js.map +0 -1
- package/dist/tools/cli/editFile.d.ts +0 -17
- package/dist/tools/cli/editFile.d.ts.map +0 -1
- package/dist/tools/cli/editFile.js +0 -125
- package/dist/tools/cli/editFile.js.map +0 -1
- package/dist/tools/cli/editFile.test.d.ts +0 -8
- package/dist/tools/cli/editFile.test.d.ts.map +0 -1
- package/dist/tools/cli/editFile.test.js +0 -177
- package/dist/tools/cli/editFile.test.js.map +0 -1
- package/dist/tools/cli/readFile.d.ts +0 -25
- package/dist/tools/cli/readFile.d.ts.map +0 -1
- package/dist/tools/cli/readFile.js +0 -118
- package/dist/tools/cli/readFile.js.map +0 -1
- package/dist/tools/cli/readFile.test.d.ts +0 -8
- package/dist/tools/cli/readFile.test.d.ts.map +0 -1
- package/dist/tools/cli/readFile.test.js +0 -194
- package/dist/tools/cli/readFile.test.js.map +0 -1
- package/dist/tools/cli/search.d.ts +0 -16
- package/dist/tools/cli/search.d.ts.map +0 -1
- package/dist/tools/cli/search.js +0 -261
- package/dist/tools/cli/search.js.map +0 -1
- package/dist/tools/cli/search.test.d.ts +0 -8
- package/dist/tools/cli/search.test.d.ts.map +0 -1
- package/dist/tools/cli/search.test.js +0 -172
- package/dist/tools/cli/search.test.js.map +0 -1
- package/dist/tools/cli/subagent.d.ts +0 -43
- package/dist/tools/cli/subagent.d.ts.map +0 -1
- package/dist/tools/cli/subagent.js +0 -99
- package/dist/tools/cli/subagent.js.map +0 -1
- package/dist/tools/cli/subagent.test.d.ts +0 -8
- package/dist/tools/cli/subagent.test.d.ts.map +0 -1
- package/dist/tools/cli/subagent.test.js +0 -190
- package/dist/tools/cli/subagent.test.js.map +0 -1
- package/dist/tools/cli/terminal.d.ts +0 -19
- package/dist/tools/cli/terminal.d.ts.map +0 -1
- package/dist/tools/cli/terminal.js +0 -164
- package/dist/tools/cli/terminal.js.map +0 -1
- package/dist/tools/cli/terminal.test.d.ts +0 -8
- package/dist/tools/cli/terminal.test.d.ts.map +0 -1
- package/dist/tools/cli/terminal.test.js +0 -161
- package/dist/tools/cli/terminal.test.js.map +0 -1
- package/dist/tools/index.d.ts +0 -25
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/index.js +0 -41
- package/dist/tools/index.js.map +0 -1
- package/dist/tools/interface.d.ts +0 -64
- package/dist/tools/interface.d.ts.map +0 -1
- package/dist/tools/interface.js +0 -37
- package/dist/tools/interface.js.map +0 -1
- package/dist/tools/interface.test.d.ts +0 -7
- package/dist/tools/interface.test.d.ts.map +0 -1
- package/dist/tools/interface.test.js +0 -179
- package/dist/tools/interface.test.js.map +0 -1
- package/dist/tools/mcp/bridge.d.ts +0 -48
- package/dist/tools/mcp/bridge.d.ts.map +0 -1
- package/dist/tools/mcp/bridge.js +0 -128
- package/dist/tools/mcp/bridge.js.map +0 -1
- package/dist/tools/mcp/bridge.test.d.ts +0 -8
- package/dist/tools/mcp/bridge.test.d.ts.map +0 -1
- package/dist/tools/mcp/bridge.test.js +0 -300
- package/dist/tools/mcp/bridge.test.js.map +0 -1
- package/dist/tools/mcp/client.d.ts +0 -135
- package/dist/tools/mcp/client.d.ts.map +0 -1
- package/dist/tools/mcp/client.js +0 -263
- package/dist/tools/mcp/client.js.map +0 -1
- package/dist/tools/mcp/client.test.d.ts +0 -8
- package/dist/tools/mcp/client.test.d.ts.map +0 -1
- package/dist/tools/mcp/client.test.js +0 -390
- package/dist/tools/mcp/client.test.js.map +0 -1
- package/dist/tools/registry.d.ts +0 -82
- package/dist/tools/registry.d.ts.map +0 -1
- package/dist/tools/registry.js +0 -99
- package/dist/tools/registry.js.map +0 -1
- package/dist/tools/registry.test.d.ts +0 -7
- package/dist/tools/registry.test.d.ts.map +0 -1
- package/dist/tools/registry.test.js +0 -199
- package/dist/tools/registry.test.js.map +0 -1
- package/dist/tools/suite.test.d.ts +0 -11
- package/dist/tools/suite.test.d.ts.map +0 -1
- package/dist/tools/suite.test.js +0 -119
- package/dist/tools/suite.test.js.map +0 -1
- package/dist/tools/types.d.ts +0 -75
- package/dist/tools/types.d.ts.map +0 -1
- package/dist/tools/types.js +0 -30
- package/dist/tools/types.js.map +0 -1
- package/dist/tools/types.test.d.ts +0 -7
- package/dist/tools/types.test.d.ts.map +0 -1
- package/dist/tools/types.test.js +0 -178
- package/dist/tools/types.test.js.map +0 -1
- package/templates/.vscode/mcp.json +0 -20
- package/templates/CLAUDE.md +0 -129
package/dist/tools/types.d.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tool Abstraction Types
|
|
3
|
-
*
|
|
4
|
-
* Type definitions for the tool abstraction layer.
|
|
5
|
-
* Tools provide a uniform interface for agent capabilities
|
|
6
|
-
* regardless of runtime environment (CLI, Copilot, MCP).
|
|
7
|
-
*/
|
|
8
|
-
import type { JSONSchema } from '../providers/types.js';
|
|
9
|
-
/**
|
|
10
|
-
* Error codes for tool execution errors.
|
|
11
|
-
* Used to categorize failures and provide actionable error messages.
|
|
12
|
-
*/
|
|
13
|
-
export type ToolErrorCode = 'INVALID_INPUT' | 'PERMISSION_DENIED' | 'EXECUTION_FAILED' | 'NOT_FOUND' | 'TIMEOUT';
|
|
14
|
-
/**
|
|
15
|
-
* Custom error class for tool execution errors.
|
|
16
|
-
* Includes an error code for programmatic handling and
|
|
17
|
-
* an optional cause for error chaining.
|
|
18
|
-
*/
|
|
19
|
-
export declare class ToolError extends Error {
|
|
20
|
-
/** Categorized error code for programmatic handling */
|
|
21
|
-
readonly code: ToolErrorCode;
|
|
22
|
-
/** Name of the tool that generated this error */
|
|
23
|
-
readonly toolName: string;
|
|
24
|
-
/** Original error that caused this error */
|
|
25
|
-
readonly cause?: Error;
|
|
26
|
-
constructor(message: string, code: ToolErrorCode, toolName: string, options?: {
|
|
27
|
-
cause?: Error;
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Permissions governing what a tool is allowed to do.
|
|
32
|
-
* Enforced by tool implementations before performing operations.
|
|
33
|
-
*/
|
|
34
|
-
export interface ToolPermissions {
|
|
35
|
-
/** Whether the tool can read files from the filesystem */
|
|
36
|
-
allowFileRead: boolean;
|
|
37
|
-
/** Whether the tool can write or modify files on the filesystem */
|
|
38
|
-
allowFileWrite: boolean;
|
|
39
|
-
/** Whether the tool can execute terminal commands */
|
|
40
|
-
allowTerminal: boolean;
|
|
41
|
-
/** Whether the tool can make network requests */
|
|
42
|
-
allowNetwork: boolean;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Execution context provided to a tool when it runs.
|
|
46
|
-
* Contains the working directory, permissions, and an optional abort signal.
|
|
47
|
-
*/
|
|
48
|
-
export interface ToolContext {
|
|
49
|
-
/** Absolute path to the working directory for file operations */
|
|
50
|
-
workingDir: string;
|
|
51
|
-
/** Permissions governing what the tool is allowed to do */
|
|
52
|
-
permissions: ToolPermissions;
|
|
53
|
-
/** Optional signal for cancelling tool execution */
|
|
54
|
-
signal?: AbortSignal;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Result returned by a tool after execution.
|
|
58
|
-
* Includes a success flag, output text, and optional error/metadata.
|
|
59
|
-
*/
|
|
60
|
-
export interface ToolResult {
|
|
61
|
-
/** Whether the tool executed successfully */
|
|
62
|
-
success: boolean;
|
|
63
|
-
/** Human-readable output from the tool */
|
|
64
|
-
output: string;
|
|
65
|
-
/** Error message if the tool failed */
|
|
66
|
-
error?: string;
|
|
67
|
-
/** Additional structured metadata from the tool execution */
|
|
68
|
-
metadata?: Record<string, unknown>;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* JSON Schema type for tool input validation.
|
|
72
|
-
* Re-exports the JSONSchema type from the providers layer for consistency.
|
|
73
|
-
*/
|
|
74
|
-
export type ToolInputSchema = JSONSchema;
|
|
75
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../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,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAMD;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC"}
|
package/dist/tools/types.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tool Abstraction Types
|
|
3
|
-
*
|
|
4
|
-
* Type definitions for the tool abstraction layer.
|
|
5
|
-
* Tools provide a uniform interface for agent capabilities
|
|
6
|
-
* regardless of runtime environment (CLI, Copilot, MCP).
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Custom error class for tool execution errors.
|
|
10
|
-
* Includes an error code for programmatic handling and
|
|
11
|
-
* an optional cause for error chaining.
|
|
12
|
-
*/
|
|
13
|
-
export class ToolError extends Error {
|
|
14
|
-
/** Categorized error code for programmatic handling */
|
|
15
|
-
code;
|
|
16
|
-
/** Name of the tool that generated this error */
|
|
17
|
-
toolName;
|
|
18
|
-
/** Original error that caused this error */
|
|
19
|
-
cause;
|
|
20
|
-
constructor(message, code, toolName, options) {
|
|
21
|
-
super(message);
|
|
22
|
-
this.name = 'ToolError';
|
|
23
|
-
this.code = code;
|
|
24
|
-
this.toolName = toolName;
|
|
25
|
-
if (options?.cause) {
|
|
26
|
-
this.cause = options.cause;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=types.js.map
|
package/dist/tools/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/tools/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAmBH;;;;GAIG;AACH,MAAM,OAAO,SAAU,SAAQ,KAAK;IAClC,uDAAuD;IAC9C,IAAI,CAAgB;IAE7B,iDAAiD;IACxC,QAAQ,CAAS;IAE1B,4CAA4C;IACnC,KAAK,CAAS;IAEvB,YACE,OAAe,EACf,IAAmB,EACnB,QAAgB,EAChB,OAEC;QAED,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,IAAI,OAAO,EAAE,KAAK,EAAE,CAAC;YACnB,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC7B,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.test.d.ts","sourceRoot":"","sources":["../../src/tools/types.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
package/dist/tools/types.test.js
DELETED
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tool Types Tests
|
|
3
|
-
*
|
|
4
|
-
* Tests for ToolError class and type shapes.
|
|
5
|
-
*/
|
|
6
|
-
import { describe, it } from 'node:test';
|
|
7
|
-
import assert from 'node:assert';
|
|
8
|
-
import { ToolError } from './types.js';
|
|
9
|
-
describe('ToolError', () => {
|
|
10
|
-
describe('constructor', () => {
|
|
11
|
-
it('should set message correctly', () => {
|
|
12
|
-
const error = new ToolError('Bad input', 'INVALID_INPUT', 'readFile');
|
|
13
|
-
assert.strictEqual(error.message, 'Bad input');
|
|
14
|
-
});
|
|
15
|
-
it('should set code correctly', () => {
|
|
16
|
-
const error = new ToolError('Denied', 'PERMISSION_DENIED', 'editFile');
|
|
17
|
-
assert.strictEqual(error.code, 'PERMISSION_DENIED');
|
|
18
|
-
});
|
|
19
|
-
it('should set toolName correctly', () => {
|
|
20
|
-
const error = new ToolError('Failed', 'EXECUTION_FAILED', 'terminal');
|
|
21
|
-
assert.strictEqual(error.toolName, 'terminal');
|
|
22
|
-
});
|
|
23
|
-
it('should set cause from options', () => {
|
|
24
|
-
const original = new Error('Root cause');
|
|
25
|
-
const error = new ToolError('Wrapped', 'EXECUTION_FAILED', 'search', {
|
|
26
|
-
cause: original,
|
|
27
|
-
});
|
|
28
|
-
assert.strictEqual(error.cause, original);
|
|
29
|
-
});
|
|
30
|
-
it('should leave cause undefined when not provided', () => {
|
|
31
|
-
const error = new ToolError('Test', 'NOT_FOUND', 'readFile');
|
|
32
|
-
assert.strictEqual(error.cause, undefined);
|
|
33
|
-
});
|
|
34
|
-
it('should set all fields together', () => {
|
|
35
|
-
const cause = new Error('Underlying issue');
|
|
36
|
-
const error = new ToolError('Complete error', 'TIMEOUT', 'terminal', {
|
|
37
|
-
cause,
|
|
38
|
-
});
|
|
39
|
-
assert.strictEqual(error.message, 'Complete error');
|
|
40
|
-
assert.strictEqual(error.code, 'TIMEOUT');
|
|
41
|
-
assert.strictEqual(error.toolName, 'terminal');
|
|
42
|
-
assert.strictEqual(error.cause, cause);
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
describe('name property', () => {
|
|
46
|
-
it('should be "ToolError"', () => {
|
|
47
|
-
const error = new ToolError('Test', 'INVALID_INPUT', 'test');
|
|
48
|
-
assert.strictEqual(error.name, 'ToolError');
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
describe('inheritance', () => {
|
|
52
|
-
it('should be an instance of Error', () => {
|
|
53
|
-
const error = new ToolError('Test', 'INVALID_INPUT', 'test');
|
|
54
|
-
assert.ok(error instanceof Error);
|
|
55
|
-
});
|
|
56
|
-
it('should be an instance of ToolError', () => {
|
|
57
|
-
const error = new ToolError('Test', 'INVALID_INPUT', 'test');
|
|
58
|
-
assert.ok(error instanceof ToolError);
|
|
59
|
-
});
|
|
60
|
-
it('should have a stack trace', () => {
|
|
61
|
-
const error = new ToolError('Test', 'INVALID_INPUT', 'test');
|
|
62
|
-
assert.ok(typeof error.stack === 'string');
|
|
63
|
-
assert.ok(error.stack.length > 0);
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
describe('error codes', () => {
|
|
67
|
-
const allCodes = [
|
|
68
|
-
'INVALID_INPUT',
|
|
69
|
-
'PERMISSION_DENIED',
|
|
70
|
-
'EXECUTION_FAILED',
|
|
71
|
-
'NOT_FOUND',
|
|
72
|
-
'TIMEOUT',
|
|
73
|
-
];
|
|
74
|
-
for (const code of allCodes) {
|
|
75
|
-
it(`should accept error code "${code}"`, () => {
|
|
76
|
-
const error = new ToolError('Test', code, 'test-tool');
|
|
77
|
-
assert.strictEqual(error.code, code);
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
describe('readonly properties', () => {
|
|
82
|
-
it('should have readonly code', () => {
|
|
83
|
-
const error = new ToolError('Test', 'INVALID_INPUT', 'test');
|
|
84
|
-
assert.strictEqual(error.code, 'INVALID_INPUT');
|
|
85
|
-
});
|
|
86
|
-
it('should have readonly toolName', () => {
|
|
87
|
-
const error = new ToolError('Test', 'INVALID_INPUT', 'readFile');
|
|
88
|
-
assert.strictEqual(error.toolName, 'readFile');
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
describe('ToolResult shape', () => {
|
|
93
|
-
it('should accept a successful result', () => {
|
|
94
|
-
const result = {
|
|
95
|
-
success: true,
|
|
96
|
-
output: 'File contents here',
|
|
97
|
-
};
|
|
98
|
-
assert.strictEqual(result.success, true);
|
|
99
|
-
assert.strictEqual(result.output, 'File contents here');
|
|
100
|
-
assert.strictEqual(result.error, undefined);
|
|
101
|
-
assert.strictEqual(result.metadata, undefined);
|
|
102
|
-
});
|
|
103
|
-
it('should accept a failed result with error', () => {
|
|
104
|
-
const result = {
|
|
105
|
-
success: false,
|
|
106
|
-
output: '',
|
|
107
|
-
error: 'File not found',
|
|
108
|
-
};
|
|
109
|
-
assert.strictEqual(result.success, false);
|
|
110
|
-
assert.strictEqual(result.error, 'File not found');
|
|
111
|
-
});
|
|
112
|
-
it('should accept a result with metadata', () => {
|
|
113
|
-
const result = {
|
|
114
|
-
success: true,
|
|
115
|
-
output: 'Done',
|
|
116
|
-
metadata: { bytesRead: 1024, encoding: 'utf-8' },
|
|
117
|
-
};
|
|
118
|
-
assert.strictEqual(result.success, true);
|
|
119
|
-
assert.deepStrictEqual(result.metadata, { bytesRead: 1024, encoding: 'utf-8' });
|
|
120
|
-
});
|
|
121
|
-
});
|
|
122
|
-
describe('ToolPermissions shape', () => {
|
|
123
|
-
it('should accept fully permissive permissions', () => {
|
|
124
|
-
const perms = {
|
|
125
|
-
allowFileRead: true,
|
|
126
|
-
allowFileWrite: true,
|
|
127
|
-
allowTerminal: true,
|
|
128
|
-
allowNetwork: true,
|
|
129
|
-
};
|
|
130
|
-
assert.strictEqual(perms.allowFileRead, true);
|
|
131
|
-
assert.strictEqual(perms.allowFileWrite, true);
|
|
132
|
-
assert.strictEqual(perms.allowTerminal, true);
|
|
133
|
-
assert.strictEqual(perms.allowNetwork, true);
|
|
134
|
-
});
|
|
135
|
-
it('should accept fully restrictive permissions', () => {
|
|
136
|
-
const perms = {
|
|
137
|
-
allowFileRead: false,
|
|
138
|
-
allowFileWrite: false,
|
|
139
|
-
allowTerminal: false,
|
|
140
|
-
allowNetwork: false,
|
|
141
|
-
};
|
|
142
|
-
assert.strictEqual(perms.allowFileRead, false);
|
|
143
|
-
assert.strictEqual(perms.allowFileWrite, false);
|
|
144
|
-
assert.strictEqual(perms.allowTerminal, false);
|
|
145
|
-
assert.strictEqual(perms.allowNetwork, false);
|
|
146
|
-
});
|
|
147
|
-
});
|
|
148
|
-
describe('ToolContext shape', () => {
|
|
149
|
-
it('should accept a context with required fields', () => {
|
|
150
|
-
const ctx = {
|
|
151
|
-
workingDir: '/home/user/project',
|
|
152
|
-
permissions: {
|
|
153
|
-
allowFileRead: true,
|
|
154
|
-
allowFileWrite: false,
|
|
155
|
-
allowTerminal: false,
|
|
156
|
-
allowNetwork: false,
|
|
157
|
-
},
|
|
158
|
-
};
|
|
159
|
-
assert.strictEqual(ctx.workingDir, '/home/user/project');
|
|
160
|
-
assert.strictEqual(ctx.permissions.allowFileRead, true);
|
|
161
|
-
assert.strictEqual(ctx.signal, undefined);
|
|
162
|
-
});
|
|
163
|
-
it('should accept a context with an AbortSignal', () => {
|
|
164
|
-
const controller = new AbortController();
|
|
165
|
-
const ctx = {
|
|
166
|
-
workingDir: '/tmp',
|
|
167
|
-
permissions: {
|
|
168
|
-
allowFileRead: true,
|
|
169
|
-
allowFileWrite: true,
|
|
170
|
-
allowTerminal: true,
|
|
171
|
-
allowNetwork: true,
|
|
172
|
-
},
|
|
173
|
-
signal: controller.signal,
|
|
174
|
-
};
|
|
175
|
-
assert.ok(ctx.signal instanceof AbortSignal);
|
|
176
|
-
});
|
|
177
|
-
});
|
|
178
|
-
//# sourceMappingURL=types.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.test.js","sourceRoot":"","sources":["../../src/tools/types.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvC,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;QAC3B,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE;YACtC,MAAM,KAAK,GAAG,IAAI,SAAS,CAAC,WAAW,EAAE,eAAe,EAAE,UAAU,CAAC,CAAC;YAEtE,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QACjD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,2BAA2B,EAAE,GAAG,EAAE;YACnC,MAAM,KAAK,GAAG,IAAI,SAAS,CAAC,QAAQ,EAAE,mBAAmB,EAAE,UAAU,CAAC,CAAC;YAEvE,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;QACtD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,+BAA+B,EAAE,GAAG,EAAE;YACvC,MAA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AAE,IAAI,CAAC,CAAC;QACxD,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE;QACrD,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;QACzC,MAAM,GAAG,GAAgB;YACvB,UAAU,EAAE,MAAM;YAClB,WAAW,EAAE;gBACX,aAAa,EAAE,IAAI;gBACnB,cAAc,EAAE,IAAI;gBACpB,aAAa,EAAE,IAAI;gBACnB,YAAY,EAAE,IAAI;aACnB;YACD,MAAM,EAAE,UAAU,CAAC,MAAM;SAC1B,CAAC;QAEF,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,YAAY,WAAW,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://code.visualstudio.com/docs/copilot/chat/mcp-servers",
|
|
3
|
-
"servers": {
|
|
4
|
-
"beads": {
|
|
5
|
-
"command": "beads-mcp"
|
|
6
|
-
},
|
|
7
|
-
"shadcn": {
|
|
8
|
-
"command": "npx",
|
|
9
|
-
"args": ["shadcn@3.7.0", "mcp"]
|
|
10
|
-
},
|
|
11
|
-
"playwright": {
|
|
12
|
-
"command": "npx",
|
|
13
|
-
"args": ["@playwright/mcp@latest"]
|
|
14
|
-
},
|
|
15
|
-
"deepwiki": {
|
|
16
|
-
"type": "http",
|
|
17
|
-
"url": "https://mcp.deepwiki.com/mcp"
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
package/templates/CLAUDE.md
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
# Beth - AI Agent System
|
|
2
|
-
|
|
3
|
-
A ruthless, hyper-competent AI orchestrator for multi-agent workflows.
|
|
4
|
-
|
|
5
|
-
## How Beth Works
|
|
6
|
-
|
|
7
|
-
Beth is a team of specialized AI agents coordinated by an orchestrator. Each agent has a specific role and domain expertise. You are the orchestrator — adopt Beth's personality and coordinate work across these roles.
|
|
8
|
-
|
|
9
|
-
### The Seven Roles
|
|
10
|
-
|
|
11
|
-
| Role | Purpose |
|
|
12
|
-
|------|---------|
|
|
13
|
-
| **Beth (Orchestrator)** | Routes work, coordinates specialists, tracks progress |
|
|
14
|
-
| **Product Manager** | WHAT to build: requirements, user stories, priorities, success metrics |
|
|
15
|
-
| **Researcher** | User/market research, competitive analysis, insight synthesis |
|
|
16
|
-
| **UX Designer** | HOW it works: component specs, design tokens, accessibility |
|
|
17
|
-
| **Developer** | React/TypeScript/Next.js implementation, UI and full-stack |
|
|
18
|
-
| **Security Reviewer** | Security audits, threat modeling, OWASP compliance |
|
|
19
|
-
| **Tester** | QA, accessibility testing, performance auditing |
|
|
20
|
-
|
|
21
|
-
### Personality
|
|
22
|
-
|
|
23
|
-
You are Beth — direct, sharp, relentless. You don't hedge. You don't soften. You assess, decide, and execute. Channel Beth Dutton: cut through the noise, call out weak thinking, and deliver results without excuses.
|
|
24
|
-
|
|
25
|
-
## Skills System
|
|
26
|
-
|
|
27
|
-
Domain knowledge modules are in `.github/skills/<name>/SKILL.md`. Read the relevant SKILL.md when working in that domain:
|
|
28
|
-
|
|
29
|
-
| Skill | Location | When to use |
|
|
30
|
-
|-------|----------|-------------|
|
|
31
|
-
| PRD Generation | `.github/skills/prd/SKILL.md` | Creating product requirements |
|
|
32
|
-
| Framer Components | `.github/skills/framer-components/SKILL.md` | Building Framer components |
|
|
33
|
-
| Vercel React Best Practices | `.github/skills/vercel-react-best-practices/SKILL.md` | React/Next.js performance |
|
|
34
|
-
| Web Design Guidelines | `.github/skills/web-design-guidelines/SKILL.md` | UI review, accessibility |
|
|
35
|
-
| shadcn/ui Components | `.github/skills/shadcn-ui/SKILL.md` | UI component installation |
|
|
36
|
-
| Security Analysis | `.github/skills/security-analysis/SKILL.md` | Security reviews, threat models |
|
|
37
|
-
|
|
38
|
-
## Issue Tracking
|
|
39
|
-
|
|
40
|
-
This project uses [beads](https://github.com/steveyegge/beads) (`bd`) for structured issue tracking.
|
|
41
|
-
|
|
42
|
-
Run `bd prime` at the start of every session for workflow context.
|
|
43
|
-
|
|
44
|
-
### Quick Reference
|
|
45
|
-
```bash
|
|
46
|
-
bd ready # See unblocked work
|
|
47
|
-
bd create "Title" # Create a new issue
|
|
48
|
-
bd close <id> # Close completed work
|
|
49
|
-
bd sync # Sync beads database
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
### Workflow
|
|
53
|
-
1. Start sessions with `bd prime` to load context
|
|
54
|
-
2. Use `bd ready` to find unblocked work
|
|
55
|
-
3. Create issues with `bd create` for new tasks
|
|
56
|
-
4. Close issues with `bd close <id>` when done
|
|
57
|
-
5. End sessions with `bd sync` to persist state
|
|
58
|
-
|
|
59
|
-
See `AGENTS.md` at the repo root for the full dual tracking system (beads + Backlog.md).
|
|
60
|
-
|
|
61
|
-
## Development Conventions
|
|
62
|
-
|
|
63
|
-
### Tech Stack
|
|
64
|
-
- **React 19** with Server Components, Server Actions, `use`, `useOptimistic`
|
|
65
|
-
- **Next.js App Router** with streaming, Suspense, parallel routes
|
|
66
|
-
- **TypeScript** in strict mode, Zod for runtime validation
|
|
67
|
-
- **Styling**: Tailwind CSS with `class-variance-authority` (cva)
|
|
68
|
-
|
|
69
|
-
### Code Patterns
|
|
70
|
-
|
|
71
|
-
**Server Components as default** — Only add `'use client'` when needed for interactivity:
|
|
72
|
-
```typescript
|
|
73
|
-
// Server Component (default)
|
|
74
|
-
export default async function Page() {
|
|
75
|
-
const data = await fetchData();
|
|
76
|
-
return <Display data={data} />;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// Client Component (when needed)
|
|
80
|
-
'use client';
|
|
81
|
-
export function InteractiveWidget() { ... }
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
**Server Actions for mutations**:
|
|
85
|
-
```typescript
|
|
86
|
-
'use server';
|
|
87
|
-
export async function updateItem(formData: FormData) {
|
|
88
|
-
const parsed = Schema.safeParse(Object.fromEntries(formData));
|
|
89
|
-
if (!parsed.success) return { error: 'Invalid input' };
|
|
90
|
-
// mutation logic
|
|
91
|
-
revalidatePath('/path');
|
|
92
|
-
}
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
### Quality Standards
|
|
96
|
-
- WCAG 2.1 AA accessibility compliance
|
|
97
|
-
- Core Web Vitals in green (LCP < 2.5s, FID < 100ms, CLS < 0.1)
|
|
98
|
-
- Full TypeScript coverage, no `any`
|
|
99
|
-
- Unit tests for utilities, integration tests for features
|
|
100
|
-
|
|
101
|
-
## Performance Patterns
|
|
102
|
-
|
|
103
|
-
### Eliminate Waterfalls (CRITICAL)
|
|
104
|
-
```typescript
|
|
105
|
-
// ❌ Sequential
|
|
106
|
-
const user = await fetchUser();
|
|
107
|
-
const posts = await fetchPosts();
|
|
108
|
-
|
|
109
|
-
// ✅ Parallel
|
|
110
|
-
const [user, posts] = await Promise.all([fetchUser(), fetchPosts()]);
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
### Server Action Security
|
|
114
|
-
Always authenticate inside Server Actions — they're public endpoints:
|
|
115
|
-
```typescript
|
|
116
|
-
'use server';
|
|
117
|
-
export async function deleteUser(userId: string) {
|
|
118
|
-
const session = await verifySession();
|
|
119
|
-
if (!session || session.user.id !== userId) throw unauthorized();
|
|
120
|
-
// proceed with mutation
|
|
121
|
-
}
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
## File Naming Conventions
|
|
125
|
-
|
|
126
|
-
- Skills: `.github/skills/<skill-name>/SKILL.md`
|
|
127
|
-
- Components: `components/<Name>/<Name>.tsx` with `index.tsx` barrel
|
|
128
|
-
- Server Actions: `lib/actions/<domain>.ts`
|
|
129
|
-
- Data fetching: `lib/data/<domain>.ts`
|