@fabriccode/weave 0.7.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/LICENSE +21 -0
- package/README.md +309 -0
- package/dist/agents/agent-builder.d.ts +24 -0
- package/dist/agents/builtin-agents.d.ts +32 -0
- package/dist/agents/custom-agent-factory.d.ts +24 -0
- package/dist/agents/dynamic-prompt-builder.d.ts +35 -0
- package/dist/agents/index.d.ts +12 -0
- package/dist/agents/loom/default.d.ts +2 -0
- package/dist/agents/loom/index.d.ts +11 -0
- package/dist/agents/loom/prompt-composer.d.ts +35 -0
- package/dist/agents/model-resolution.d.ts +27 -0
- package/dist/agents/pattern/default.d.ts +2 -0
- package/dist/agents/pattern/index.d.ts +2 -0
- package/dist/agents/prompt-loader.d.ts +9 -0
- package/dist/agents/prompt-utils.d.ts +2 -0
- package/dist/agents/shuttle/default.d.ts +2 -0
- package/dist/agents/shuttle/index.d.ts +2 -0
- package/dist/agents/spindle/default.d.ts +2 -0
- package/dist/agents/spindle/index.d.ts +2 -0
- package/dist/agents/tapestry/default.d.ts +2 -0
- package/dist/agents/tapestry/index.d.ts +9 -0
- package/dist/agents/tapestry/prompt-composer.d.ts +24 -0
- package/dist/agents/thread/default.d.ts +2 -0
- package/dist/agents/thread/index.d.ts +2 -0
- package/dist/agents/types.d.ts +82 -0
- package/dist/agents/warp/default.d.ts +2 -0
- package/dist/agents/warp/index.d.ts +2 -0
- package/dist/agents/weft/default.d.ts +2 -0
- package/dist/agents/weft/index.d.ts +2 -0
- package/dist/config/index.d.ts +3 -0
- package/dist/config/loader.d.ts +2 -0
- package/dist/config/merge.d.ts +3 -0
- package/dist/config/schema.d.ts +274 -0
- package/dist/create-managers.d.ts +21 -0
- package/dist/create-tools.d.ts +16 -0
- package/dist/features/analytics/adherence.d.ts +10 -0
- package/dist/features/analytics/fingerprint.d.ts +33 -0
- package/dist/features/analytics/format-metrics.d.ts +10 -0
- package/dist/features/analytics/generate-metrics-report.d.ts +17 -0
- package/dist/features/analytics/git-diff.d.ts +7 -0
- package/dist/features/analytics/index.d.ts +29 -0
- package/dist/features/analytics/plan-parser.d.ts +7 -0
- package/dist/features/analytics/plan-token-aggregator.d.ts +11 -0
- package/dist/features/analytics/session-tracker.d.ts +68 -0
- package/dist/features/analytics/storage.d.ts +40 -0
- package/dist/features/analytics/suggestions.d.ts +10 -0
- package/dist/features/analytics/token-report.d.ts +14 -0
- package/dist/features/analytics/types.d.ts +194 -0
- package/dist/features/builtin-commands/commands.d.ts +2 -0
- package/dist/features/builtin-commands/index.d.ts +2 -0
- package/dist/features/builtin-commands/templates/metrics.d.ts +1 -0
- package/dist/features/builtin-commands/templates/run-workflow.d.ts +1 -0
- package/dist/features/builtin-commands/templates/start-work.d.ts +1 -0
- package/dist/features/builtin-commands/types.d.ts +16 -0
- package/dist/features/evals/baseline.d.ts +4 -0
- package/dist/features/evals/evaluators/deterministic.d.ts +2 -0
- package/dist/features/evals/evaluators/llm-judge.d.ts +2 -0
- package/dist/features/evals/executors/model-response.d.ts +2 -0
- package/dist/features/evals/executors/prompt-renderer.d.ts +2 -0
- package/dist/features/evals/index.d.ts +24 -0
- package/dist/features/evals/loader.d.ts +8 -0
- package/dist/features/evals/reporter.d.ts +2 -0
- package/dist/features/evals/runner.d.ts +7 -0
- package/dist/features/evals/schema.d.ts +478 -0
- package/dist/features/evals/storage.d.ts +7 -0
- package/dist/features/evals/targets/builtin-agent-target.d.ts +2 -0
- package/dist/features/evals/types.d.ts +223 -0
- package/dist/features/skill-loader/discovery.d.ts +12 -0
- package/dist/features/skill-loader/fabric-client.d.ts +2 -0
- package/dist/features/skill-loader/index.d.ts +6 -0
- package/dist/features/skill-loader/loader.d.ts +7 -0
- package/dist/features/skill-loader/resolver.d.ts +6 -0
- package/dist/features/skill-loader/types.d.ts +18 -0
- package/dist/features/work-state/constants.d.ts +8 -0
- package/dist/features/work-state/index.d.ts +5 -0
- package/dist/features/work-state/storage.d.ts +53 -0
- package/dist/features/work-state/types.d.ts +35 -0
- package/dist/features/work-state/validation-types.d.ts +26 -0
- package/dist/features/work-state/validation.d.ts +9 -0
- package/dist/features/workflow/commands.d.ts +17 -0
- package/dist/features/workflow/completion.d.ts +31 -0
- package/dist/features/workflow/constants.d.ts +12 -0
- package/dist/features/workflow/context.d.ts +16 -0
- package/dist/features/workflow/discovery.d.ts +19 -0
- package/dist/features/workflow/engine.d.ts +49 -0
- package/dist/features/workflow/hook.d.ts +47 -0
- package/dist/features/workflow/index.d.ts +15 -0
- package/dist/features/workflow/schema.d.ts +118 -0
- package/dist/features/workflow/storage.d.ts +51 -0
- package/dist/features/workflow/types.d.ts +142 -0
- package/dist/hooks/context-window-monitor.d.ts +19 -0
- package/dist/hooks/create-hooks.d.ts +40 -0
- package/dist/hooks/first-message-variant.d.ts +5 -0
- package/dist/hooks/index.d.ts +14 -0
- package/dist/hooks/keyword-detector.d.ts +8 -0
- package/dist/hooks/pattern-md-only.d.ts +13 -0
- package/dist/hooks/rules-injector.d.ts +6 -0
- package/dist/hooks/session-token-state.d.ts +42 -0
- package/dist/hooks/start-work-hook.d.ts +25 -0
- package/dist/hooks/verification-reminder.d.ts +22 -0
- package/dist/hooks/work-continuation.d.ts +26 -0
- package/dist/hooks/write-existing-file-guard.d.ts +14 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5585 -0
- package/dist/managers/background-manager.d.ts +88 -0
- package/dist/managers/config-handler.d.ts +54 -0
- package/dist/managers/index.d.ts +6 -0
- package/dist/managers/skill-mcp-manager.d.ts +30 -0
- package/dist/plugin/index.d.ts +1 -0
- package/dist/plugin/plugin-interface.d.ts +17 -0
- package/dist/plugin/types.d.ts +5 -0
- package/dist/shared/agent-display-names.d.ts +31 -0
- package/dist/shared/index.d.ts +5 -0
- package/dist/shared/log.d.ts +11 -0
- package/dist/shared/types.d.ts +6 -0
- package/dist/shared/version.d.ts +5 -0
- package/dist/tools/index.d.ts +4 -0
- package/dist/tools/permissions.d.ts +18 -0
- package/dist/tools/registry.d.ts +29 -0
- package/package.json +55 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/** Possible lifecycle states for a background task */
|
|
2
|
+
export type TaskStatus = "pending" | "running" | "completed" | "failed" | "cancelled";
|
|
3
|
+
/** Options for spawning a background task */
|
|
4
|
+
export interface SpawnOptions {
|
|
5
|
+
agentName: string;
|
|
6
|
+
prompt: string;
|
|
7
|
+
category?: string;
|
|
8
|
+
skills?: string[];
|
|
9
|
+
concurrencyKey?: string;
|
|
10
|
+
}
|
|
11
|
+
/** A record representing a background task and its lifecycle */
|
|
12
|
+
export interface TaskRecord {
|
|
13
|
+
id: string;
|
|
14
|
+
status: TaskStatus;
|
|
15
|
+
options: SpawnOptions;
|
|
16
|
+
result?: unknown;
|
|
17
|
+
error?: string;
|
|
18
|
+
startedAt?: Date;
|
|
19
|
+
completedAt?: Date;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* In-memory background task manager for the Weave Fabric plugin.
|
|
23
|
+
*
|
|
24
|
+
* v1 tracks tasks in memory only — no real session spawning, polling, or
|
|
25
|
+
* tmux integration. Real concurrency control and SDK integration are
|
|
26
|
+
* deferred to a future release.
|
|
27
|
+
*
|
|
28
|
+
* ## Planned Delegation Tracking Integration
|
|
29
|
+
*
|
|
30
|
+
* Once a UI consumer exists (e.g. a `/status` slash command), this class
|
|
31
|
+
* should be wired into `plugin-interface.ts` as follows:
|
|
32
|
+
*
|
|
33
|
+
* 1. **`tool.execute.before`** — when `input.tool === "task"`, call
|
|
34
|
+
* `backgroundManager.spawn({ agentName: args.agent, prompt: args.description })`
|
|
35
|
+
* and store the returned task ID keyed by `input.callID`.
|
|
36
|
+
*
|
|
37
|
+
* 2. **`tool.execute.after`** — look up the task ID by `input.callID` and
|
|
38
|
+
* transition its status:
|
|
39
|
+
* - On success: set `status = "completed"` and `completedAt = new Date()`
|
|
40
|
+
* - On error: set `status = "failed"` and `error = err.message`
|
|
41
|
+
*
|
|
42
|
+
* 3. **`/status` command** — call `list({ status: "running" })` to surface
|
|
43
|
+
* all in-flight delegations to the user in real time.
|
|
44
|
+
*
|
|
45
|
+
* This is deferred until there is an Fabric API to read task status back
|
|
46
|
+
* out of the plugin (e.g. a query hook or TUI panel).
|
|
47
|
+
*/
|
|
48
|
+
export declare class BackgroundManager {
|
|
49
|
+
private readonly tasks;
|
|
50
|
+
readonly maxConcurrent: number;
|
|
51
|
+
constructor(options?: {
|
|
52
|
+
maxConcurrent?: number;
|
|
53
|
+
});
|
|
54
|
+
/**
|
|
55
|
+
* Creates a new task record with status "pending", stores it, and returns
|
|
56
|
+
* the generated task ID.
|
|
57
|
+
*/
|
|
58
|
+
spawn(options: SpawnOptions): string;
|
|
59
|
+
/**
|
|
60
|
+
* Returns the task record for the given ID, or `undefined` if not found.
|
|
61
|
+
*/
|
|
62
|
+
getTask(taskId: string): TaskRecord | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* Attempts to cancel the task with the given ID.
|
|
65
|
+
*
|
|
66
|
+
* - Returns `true` if the task was found and successfully cancelled.
|
|
67
|
+
* - Returns `false` if the task does not exist or is already in a terminal
|
|
68
|
+
* state ("completed", "failed", "cancelled").
|
|
69
|
+
*/
|
|
70
|
+
cancel(taskId: string): boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Cancels all tasks that are not yet in a terminal state.
|
|
73
|
+
*/
|
|
74
|
+
cancelAll(): void;
|
|
75
|
+
/**
|
|
76
|
+
* Returns all tasks, optionally filtered by status.
|
|
77
|
+
*
|
|
78
|
+
* @param filter - If `filter.status` is provided, only tasks with that
|
|
79
|
+
* status are returned. If no filter is given, all tasks are returned.
|
|
80
|
+
*/
|
|
81
|
+
list(filter?: {
|
|
82
|
+
status?: TaskStatus;
|
|
83
|
+
}): TaskRecord[];
|
|
84
|
+
/**
|
|
85
|
+
* Returns the number of tasks currently in the "running" state.
|
|
86
|
+
*/
|
|
87
|
+
getRunningCount(): number;
|
|
88
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { AgentConfig } from "@fabriccode/sdk";
|
|
2
|
+
import type { WeaveConfig } from "../config/schema";
|
|
3
|
+
/** Input to the config pipeline */
|
|
4
|
+
export interface ConfigPipelineInput {
|
|
5
|
+
pluginConfig: WeaveConfig;
|
|
6
|
+
/** Available agents from createBuiltinAgents (or empty for testing) */
|
|
7
|
+
agents?: Record<string, AgentConfig>;
|
|
8
|
+
/** Available tool names */
|
|
9
|
+
availableTools?: string[];
|
|
10
|
+
}
|
|
11
|
+
/** Output from config pipeline */
|
|
12
|
+
export interface ConfigPipelineOutput {
|
|
13
|
+
agents: Record<string, AgentConfig>;
|
|
14
|
+
/** Default agent display name (set on config.default_agent) */
|
|
15
|
+
defaultAgent?: string;
|
|
16
|
+
tools: string[];
|
|
17
|
+
mcps: Record<string, unknown>;
|
|
18
|
+
commands: Record<string, unknown>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Runs the 6-phase config pipeline for the Fabric config hook.
|
|
22
|
+
* Phases 1, 4, 5, 6 are pass-through for v1.
|
|
23
|
+
* Phase 2 merges agent overrides, filters disabled, and remaps keys to display names.
|
|
24
|
+
* Phase 3 filters disabled tools.
|
|
25
|
+
*/
|
|
26
|
+
export declare class ConfigHandler {
|
|
27
|
+
private readonly pluginConfig;
|
|
28
|
+
constructor(options: {
|
|
29
|
+
pluginConfig: WeaveConfig;
|
|
30
|
+
});
|
|
31
|
+
/** Run the 6-phase pipeline and return accumulated config output */
|
|
32
|
+
handle(input: ConfigPipelineInput): Promise<ConfigPipelineOutput>;
|
|
33
|
+
/** Phase 1: Provider detection happens elsewhere — pass through */
|
|
34
|
+
private applyProviderConfig;
|
|
35
|
+
/**
|
|
36
|
+
* Phase 2: Merge agent overrides from pluginConfig.agents.
|
|
37
|
+
* Exclude agents listed in pluginConfig.disabled_agents.
|
|
38
|
+
* Remap keys from config keys (e.g., "loom") to display names (e.g., "Loom (Main Orchestrator)").
|
|
39
|
+
*/
|
|
40
|
+
private applyAgentConfig;
|
|
41
|
+
/**
|
|
42
|
+
* Resolve the default agent display name.
|
|
43
|
+
* Returns the display name of "loom" if present in resolved agents, otherwise first primary agent.
|
|
44
|
+
*/
|
|
45
|
+
private resolveDefaultAgent;
|
|
46
|
+
/** Phase 3: Filter tools by disabled_tools */
|
|
47
|
+
private applyToolConfig;
|
|
48
|
+
/** Phase 4: MCP loading is done elsewhere — return empty for v1 */
|
|
49
|
+
private applyMcpConfig;
|
|
50
|
+
/** Phase 5: Return builtin commands with agent fields remapped to display names */
|
|
51
|
+
private applyCommandConfig;
|
|
52
|
+
/** Phase 6: Skill injection happens in agent builder — no-op for v1 */
|
|
53
|
+
private applySkillConfig;
|
|
54
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { ConfigHandler } from "./config-handler";
|
|
2
|
+
export type { ConfigPipelineInput, ConfigPipelineOutput } from "./config-handler";
|
|
3
|
+
export { BackgroundManager } from "./background-manager";
|
|
4
|
+
export type { SpawnOptions, TaskRecord, TaskStatus } from "./background-manager";
|
|
5
|
+
export { SkillMcpManager } from "./skill-mcp-manager";
|
|
6
|
+
export type { McpClient, McpServerConfig, SkillMcpClientInfo } from "./skill-mcp-manager";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface McpClient {
|
|
2
|
+
callTool(params: {
|
|
3
|
+
name: string;
|
|
4
|
+
arguments: Record<string, unknown>;
|
|
5
|
+
}): Promise<{
|
|
6
|
+
content: unknown;
|
|
7
|
+
}>;
|
|
8
|
+
close(): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export interface McpServerConfig {
|
|
11
|
+
type?: "stdio" | "http";
|
|
12
|
+
command?: string;
|
|
13
|
+
args?: string[];
|
|
14
|
+
url?: string;
|
|
15
|
+
env?: Record<string, string>;
|
|
16
|
+
}
|
|
17
|
+
export interface SkillMcpClientInfo {
|
|
18
|
+
sessionID: string;
|
|
19
|
+
skillName: string;
|
|
20
|
+
serverName: string;
|
|
21
|
+
}
|
|
22
|
+
export declare class SkillMcpManager {
|
|
23
|
+
private clients;
|
|
24
|
+
getOrCreateClient(info: SkillMcpClientInfo, config: McpServerConfig): Promise<McpClient>;
|
|
25
|
+
disconnectSession(sessionID: string): Promise<void>;
|
|
26
|
+
disconnectAll(): Promise<void>;
|
|
27
|
+
getConnectedServers(): string[];
|
|
28
|
+
isConnected(info: SkillMcpClientInfo): boolean;
|
|
29
|
+
callTool(info: SkillMcpClientInfo, config: McpServerConfig, name: string, args: Record<string, unknown>): Promise<unknown>;
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { PluginContext, PluginInstance, PluginInterface, ToolsRecord } from "./types";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { PluginInterface, ToolsRecord } from "./types";
|
|
2
|
+
import type { AgentConfig } from "@fabriccode/sdk";
|
|
3
|
+
import type { WeaveConfig } from "../config/schema";
|
|
4
|
+
import type { ConfigHandler } from "../managers/config-handler";
|
|
5
|
+
import type { CreatedHooks } from "../hooks/create-hooks";
|
|
6
|
+
import type { PluginContext } from "./types";
|
|
7
|
+
import type { SessionTracker } from "../features/analytics";
|
|
8
|
+
export declare function createPluginInterface(args: {
|
|
9
|
+
pluginConfig: WeaveConfig;
|
|
10
|
+
hooks: CreatedHooks;
|
|
11
|
+
tools: ToolsRecord;
|
|
12
|
+
configHandler: ConfigHandler;
|
|
13
|
+
agents: Record<string, AgentConfig>;
|
|
14
|
+
client?: PluginContext["client"];
|
|
15
|
+
directory?: string;
|
|
16
|
+
tracker?: SessionTracker;
|
|
17
|
+
}): PluginInterface;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Plugin, ToolDefinition } from "@fabriccode/plugin";
|
|
2
|
+
export type PluginContext = Parameters<Plugin>[0];
|
|
3
|
+
export type PluginInstance = Awaited<ReturnType<Plugin>>;
|
|
4
|
+
export type PluginInterface = Required<Pick<PluginInstance, "tool" | "config" | "chat.message" | "chat.params" | "chat.headers" | "event" | "tool.execute.before" | "tool.execute.after" | "command.execute.before">>;
|
|
5
|
+
export type ToolsRecord = Record<string, ToolDefinition>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent config keys to display names mapping.
|
|
3
|
+
* Config keys are lowercase (e.g., "loom", "thread").
|
|
4
|
+
* Display names include role suffixes for UI (e.g., "Loom (Main Orchestrator)").
|
|
5
|
+
*
|
|
6
|
+
* Fabric uses the agent key in config.agent as the display name in the UI,
|
|
7
|
+
* so we remap lowercase config keys to descriptive display names.
|
|
8
|
+
*
|
|
9
|
+
* This map is mutable — custom agents can register display names via
|
|
10
|
+
* registerAgentDisplayName().
|
|
11
|
+
*/
|
|
12
|
+
export declare const AGENT_DISPLAY_NAMES: Record<string, string>;
|
|
13
|
+
/**
|
|
14
|
+
* Register a display name for an agent config key.
|
|
15
|
+
* Custom agents call this so getAgentDisplayName/getAgentConfigKey work for them.
|
|
16
|
+
*
|
|
17
|
+
* Throws if the display name collides with a built-in agent's display name,
|
|
18
|
+
* or if the config key is a built-in agent name.
|
|
19
|
+
*/
|
|
20
|
+
export declare function registerAgentDisplayName(configKey: string, displayName: string): void;
|
|
21
|
+
/**
|
|
22
|
+
* Get display name for an agent config key.
|
|
23
|
+
* Uses case-insensitive lookup for flexibility.
|
|
24
|
+
* Returns original key if not found in the mapping.
|
|
25
|
+
*/
|
|
26
|
+
export declare function getAgentDisplayName(configKey: string): string;
|
|
27
|
+
/**
|
|
28
|
+
* Resolve an agent name (display name or config key) to its lowercase config key.
|
|
29
|
+
* "Loom (Main Orchestrator)" → "loom", "loom" → "loom", "unknown" → "unknown"
|
|
30
|
+
*/
|
|
31
|
+
export declare function getAgentConfigKey(agentName: string): string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { DeepPartial, Brand } from "./types";
|
|
2
|
+
export { getWeaveVersion } from "./version";
|
|
3
|
+
export { log, getLogFilePath, logDelegation } from "./log";
|
|
4
|
+
export type { DelegationEvent } from "./log";
|
|
5
|
+
export { AGENT_DISPLAY_NAMES, getAgentDisplayName, getAgentConfigKey, registerAgentDisplayName, } from "./agent-display-names";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare function log(message: string, data?: unknown): void;
|
|
2
|
+
export declare function getLogFilePath(): string;
|
|
3
|
+
export interface DelegationEvent {
|
|
4
|
+
phase: "start" | "complete" | "error";
|
|
5
|
+
agent: string;
|
|
6
|
+
sessionId?: string;
|
|
7
|
+
toolCallId?: string;
|
|
8
|
+
durationMs?: number;
|
|
9
|
+
summary?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function logDelegation(event: DelegationEvent): void;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool permission management — per-agent grant/deny tool lists.
|
|
3
|
+
*
|
|
4
|
+
* Tools are represented as a boolean map where false = denied.
|
|
5
|
+
* This matches the AgentConfig.tools shape from @fabriccode/sdk.
|
|
6
|
+
*/
|
|
7
|
+
export type ToolPermissionMap = Record<string, boolean>;
|
|
8
|
+
export type ToolPermissions = {
|
|
9
|
+
getRestrictions(agentName: string): ToolPermissionMap;
|
|
10
|
+
isToolAllowed(agentName: string, toolName: string): boolean;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Build a ToolPermissions object from a record of agent configs.
|
|
14
|
+
*
|
|
15
|
+
* Each agent config's `tools` map is extracted and used for permission checks.
|
|
16
|
+
* Agents without a `tools` map have no restrictions (all tools allowed).
|
|
17
|
+
*/
|
|
18
|
+
export declare function createToolPermissions(agentRestrictions: Record<string, ToolPermissionMap>): ToolPermissions;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { WeaveConfig } from "../config/schema";
|
|
2
|
+
import type { ToolPermissions, ToolPermissionMap } from "./permissions";
|
|
3
|
+
export type { ToolPermissions, ToolPermissionMap };
|
|
4
|
+
/**
|
|
5
|
+
* Result from createToolRegistry.
|
|
6
|
+
* filteredTools: tool names allowed globally (not in disabled_tools).
|
|
7
|
+
* permissions: per-agent tool permission checker.
|
|
8
|
+
* taskSystemEnabled: whether the task spawning tool is globally enabled.
|
|
9
|
+
*/
|
|
10
|
+
export interface ToolRegistryResult {
|
|
11
|
+
filteredTools: string[];
|
|
12
|
+
permissions: ToolPermissions;
|
|
13
|
+
taskSystemEnabled: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface ToolRegistryOptions {
|
|
16
|
+
/** All available tool names (from Fabric's tool system) */
|
|
17
|
+
availableTools: string[];
|
|
18
|
+
/** Config with disabled_tools list */
|
|
19
|
+
config: WeaveConfig;
|
|
20
|
+
/** Per-agent tool restriction maps (from agent configs) */
|
|
21
|
+
agentRestrictions: Record<string, ToolPermissionMap>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Create a tool registry that filters by disabled_tools and builds per-agent permissions.
|
|
25
|
+
*
|
|
26
|
+
* Tools are not reimplemented here — they come from Fabric.
|
|
27
|
+
* Weave only manages which tools are visible and which are denied per agent.
|
|
28
|
+
*/
|
|
29
|
+
export declare function createToolRegistry(options: ToolRegistryOptions): ToolRegistryResult;
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fabriccode/weave",
|
|
3
|
+
"version": "0.7.0",
|
|
4
|
+
"description": "Weave — lean Fabric plugin with multi-agent orchestration",
|
|
5
|
+
"author": "Weave",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"homepage": "https://github.com/pgermishuys/weave#readme",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/pgermishuys/weave.git"
|
|
11
|
+
},
|
|
12
|
+
"main": "dist/index.js",
|
|
13
|
+
"types": "dist/index.d.ts",
|
|
14
|
+
"type": "module",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist/"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "bun run script/build.ts && tsc --emitDeclarationOnly",
|
|
26
|
+
"clean": "rm -rf dist",
|
|
27
|
+
"typecheck": "tsc --noEmit",
|
|
28
|
+
"test": "bun test",
|
|
29
|
+
"eval": "bun run script/eval.ts",
|
|
30
|
+
"eval:smoke": "bun run script/eval.ts --suite pr-smoke",
|
|
31
|
+
"eval:coverage": "bun run script/verify-eval-coverage.ts"
|
|
32
|
+
},
|
|
33
|
+
"keywords": [
|
|
34
|
+
"fabric",
|
|
35
|
+
"plugin",
|
|
36
|
+
"agents",
|
|
37
|
+
"weave"
|
|
38
|
+
],
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"registry": "https://registry.npmjs.org",
|
|
41
|
+
"access": "public"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@fabriccode/plugin": "^7.0.46",
|
|
45
|
+
"@fabriccode/sdk": "^7.0.46",
|
|
46
|
+
"jsonc-parser": "^3.3.1",
|
|
47
|
+
"picocolors": "^1.1.1",
|
|
48
|
+
"zod": "^4.0.0"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"bun": "^1.3.9",
|
|
52
|
+
"bun-types": "^1.3.6",
|
|
53
|
+
"typescript": "^5.7.3"
|
|
54
|
+
}
|
|
55
|
+
}
|