@lucasreiners/lead 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.
- package/README.md +337 -0
- package/dist/agents/agent-builder.d.ts +30 -0
- package/dist/agents/architect/index.d.ts +4 -0
- package/dist/agents/builtin-agents.d.ts +32 -0
- package/dist/agents/code-analyst/index.d.ts +4 -0
- package/dist/agents/cto/index.d.ts +11 -0
- package/dist/agents/custom-agent-factory.d.ts +27 -0
- package/dist/agents/dynamic-prompt-builder.d.ts +22 -0
- package/dist/agents/engineer/index.d.ts +4 -0
- package/dist/agents/executor/index.d.ts +6 -0
- package/dist/agents/guardian/index.d.ts +4 -0
- package/dist/agents/index.d.ts +17 -0
- package/dist/agents/lead/index.d.ts +11 -0
- package/dist/agents/lead-dev/index.d.ts +6 -0
- package/dist/agents/model-resolution.d.ts +44 -0
- package/dist/agents/prompt-loader.d.ts +30 -0
- package/dist/agents/prompt-utils.d.ts +12 -0
- package/dist/agents/researcher/index.d.ts +4 -0
- package/dist/agents/reviewer/index.d.ts +4 -0
- package/dist/agents/scout/index.d.ts +4 -0
- package/dist/agents/tech-lead/index.d.ts +11 -0
- package/dist/agents/tester/index.d.ts +4 -0
- package/dist/agents/types.d.ts +37 -0
- package/dist/config/continuation.d.ts +13 -0
- package/dist/config/index.d.ts +6 -0
- package/dist/config/loader.d.ts +12 -0
- package/dist/config/merge.d.ts +8 -0
- package/dist/config/scaffold.d.ts +12 -0
- package/dist/config/schema.d.ts +140 -0
- package/dist/create-managers.d.ts +32 -0
- package/dist/create-tools.d.ts +24 -0
- package/dist/domain/plans/index.d.ts +2 -0
- package/dist/domain/policy/policy-result.d.ts +23 -0
- package/dist/domain/session/index.d.ts +41 -0
- package/dist/domain/workflows/index.d.ts +4 -0
- package/dist/domain/workflows/workflow-completion.d.ts +9 -0
- package/dist/domain/workflows/workflow-context.d.ts +9 -0
- package/dist/domain/workflows/workflow-repository.d.ts +19 -0
- package/dist/domain/workflows/workflow-service.d.ts +32 -0
- package/dist/features/skill-loader/discovery.d.ts +36 -0
- package/dist/features/skill-loader/index.d.ts +6 -0
- package/dist/features/skill-loader/loader.d.ts +15 -0
- package/dist/features/skill-loader/opencode-client.d.ts +6 -0
- package/dist/features/skill-loader/resolver.d.ts +8 -0
- package/dist/features/skill-loader/types.d.ts +14 -0
- package/dist/features/work-state/constants.d.ts +4 -0
- package/dist/features/work-state/index.d.ts +5 -0
- package/dist/features/work-state/storage.d.ts +20 -0
- package/dist/features/work-state/types.d.ts +16 -0
- package/dist/features/work-state/validation-types.d.ts +8 -0
- package/dist/features/work-state/validation.d.ts +6 -0
- package/dist/features/workflow/commands.d.ts +10 -0
- package/dist/features/workflow/completion.d.ts +5 -0
- package/dist/features/workflow/constants.d.ts +8 -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 +19 -0
- package/dist/features/workflow/hook.d.ts +45 -0
- package/dist/features/workflow/index.d.ts +9 -0
- package/dist/features/workflow/schema.d.ts +43 -0
- package/dist/features/workflow/storage.d.ts +7 -0
- package/dist/features/workflow/types.d.ts +89 -0
- package/dist/hooks/architect-md-only.d.ts +11 -0
- package/dist/hooks/compaction-recovery.d.ts +20 -0
- package/dist/hooks/compaction-todo-preserver.d.ts +21 -0
- package/dist/hooks/context-window-monitor.d.ts +26 -0
- package/dist/hooks/create-hooks.d.ts +45 -0
- package/dist/hooks/first-message-variant.d.ts +23 -0
- package/dist/hooks/index.d.ts +28 -0
- package/dist/hooks/keyword-detector.d.ts +17 -0
- package/dist/hooks/rules-injector.d.ts +16 -0
- package/dist/hooks/session-token-state.d.ts +31 -0
- package/dist/hooks/start-implementation-hook.d.ts +26 -0
- package/dist/hooks/start-work-hook.d.ts +26 -0
- package/dist/hooks/todo-continuation-enforcer.d.ts +22 -0
- package/dist/hooks/todo-description-override.d.ts +10 -0
- package/dist/hooks/todo-writer.d.ts +20 -0
- package/dist/hooks/verification-reminder.d.ts +21 -0
- package/dist/hooks/work-continuation.d.ts +23 -0
- package/dist/hooks/write-existing-file-guard.d.ts +34 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +3811 -0
- package/dist/infrastructure/fs/config-fs-loader.d.ts +6 -0
- package/dist/managers/background-manager.d.ts +48 -0
- package/dist/managers/config-handler.d.ts +31 -0
- package/dist/managers/index.d.ts +6 -0
- package/dist/managers/skill-mcp-manager.d.ts +31 -0
- package/dist/plugin/index.d.ts +2 -0
- package/dist/plugin/plugin-interface.d.ts +7 -0
- package/dist/plugin/types.d.ts +18 -0
- package/dist/runtime/opencode/plugin-adapter.d.ts +17 -0
- package/dist/shared/agent-display-names.d.ts +3 -0
- package/dist/shared/index.d.ts +6 -0
- package/dist/shared/log.d.ts +9 -0
- package/dist/shared/resolve-safe-path.d.ts +7 -0
- package/dist/shared/types.d.ts +3 -0
- package/dist/shared/version.d.ts +1 -0
- package/package.json +39 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BackgroundManager.
|
|
3
|
+
* Manages background task spawning with concurrency control.
|
|
4
|
+
* v0.1: In-memory tracking only — real session spawning is deferred.
|
|
5
|
+
*/
|
|
6
|
+
export type TaskStatus = "pending" | "running" | "completed" | "failed" | "cancelled";
|
|
7
|
+
export interface SpawnOptions {
|
|
8
|
+
agentName: string;
|
|
9
|
+
prompt: string;
|
|
10
|
+
category?: string;
|
|
11
|
+
skills?: string[];
|
|
12
|
+
concurrencyKey?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface TaskRecord {
|
|
15
|
+
id: string;
|
|
16
|
+
status: TaskStatus;
|
|
17
|
+
options: SpawnOptions;
|
|
18
|
+
result?: unknown;
|
|
19
|
+
error?: string;
|
|
20
|
+
startedAt?: Date;
|
|
21
|
+
completedAt?: Date;
|
|
22
|
+
}
|
|
23
|
+
export declare class BackgroundManager {
|
|
24
|
+
private readonly tasks;
|
|
25
|
+
readonly maxConcurrent: number;
|
|
26
|
+
constructor(maxConcurrent?: number);
|
|
27
|
+
/**
|
|
28
|
+
* Spawn a new background task.
|
|
29
|
+
* Returns the task ID. v0.1: Creates record only, does not execute.
|
|
30
|
+
*/
|
|
31
|
+
spawn(options: SpawnOptions): string;
|
|
32
|
+
/** Get a task record by ID */
|
|
33
|
+
getTask(taskId: string): TaskRecord | undefined;
|
|
34
|
+
/** Cancel a task */
|
|
35
|
+
cancel(taskId: string): boolean;
|
|
36
|
+
/** Cancel all pending/running tasks */
|
|
37
|
+
cancelAll(): void;
|
|
38
|
+
/** List tasks, optionally filtered by status */
|
|
39
|
+
list(filter?: {
|
|
40
|
+
status?: TaskStatus;
|
|
41
|
+
}): TaskRecord[];
|
|
42
|
+
/** Count currently running tasks */
|
|
43
|
+
getRunningCount(): number;
|
|
44
|
+
/** Mark a task as completed with a result */
|
|
45
|
+
complete(taskId: string, result?: unknown): boolean;
|
|
46
|
+
/** Mark a task as failed with an error */
|
|
47
|
+
fail(taskId: string, error: string): boolean;
|
|
48
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { AgentConfig } from "@opencode-ai/sdk";
|
|
2
|
+
/**
|
|
3
|
+
* ConfigHandler.
|
|
4
|
+
* Registers all L.E.A.D. agents into OpenCode's agent configuration.
|
|
5
|
+
* Called by the plugin's `config` hook.
|
|
6
|
+
*/
|
|
7
|
+
export interface ConfigHandlerOptions {
|
|
8
|
+
/** Built-in agent configurations (name → AgentConfig) */
|
|
9
|
+
builtinAgents: Record<string, AgentConfig>;
|
|
10
|
+
/** Custom agent configurations (name → AgentConfig) */
|
|
11
|
+
customAgents?: Record<string, AgentConfig>;
|
|
12
|
+
}
|
|
13
|
+
export declare class ConfigHandler {
|
|
14
|
+
private readonly builtinAgents;
|
|
15
|
+
private readonly customAgents;
|
|
16
|
+
constructor(options: ConfigHandlerOptions);
|
|
17
|
+
/**
|
|
18
|
+
* Apply all agent configurations to the OpenCode config object.
|
|
19
|
+
* This method mutates the passed config to register all agents.
|
|
20
|
+
*/
|
|
21
|
+
handle(config: {
|
|
22
|
+
agent?: Record<string, AgentConfig | undefined>;
|
|
23
|
+
default_agent?: string;
|
|
24
|
+
permission?: Record<string, unknown> | string;
|
|
25
|
+
plugin?: Array<string | [string, {
|
|
26
|
+
[key: string]: unknown;
|
|
27
|
+
}]>;
|
|
28
|
+
}): void;
|
|
29
|
+
/** Get all registered agent names */
|
|
30
|
+
getAgentNames(): string[];
|
|
31
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { ConfigHandler } from "./config-handler";
|
|
2
|
+
export type { ConfigHandlerOptions } 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 { McpServerConfig, SkillMcpClientInfo } from "./skill-mcp-manager";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SkillMcpManager.
|
|
3
|
+
* Stub for MCP server declarations from skills.
|
|
4
|
+
* v0.1: No-op placeholder — full MCP integration deferred to future release.
|
|
5
|
+
*/
|
|
6
|
+
export interface McpServerConfig {
|
|
7
|
+
type?: "stdio" | "http";
|
|
8
|
+
command?: string;
|
|
9
|
+
args?: string[];
|
|
10
|
+
url?: string;
|
|
11
|
+
env?: Record<string, string>;
|
|
12
|
+
}
|
|
13
|
+
export interface SkillMcpClientInfo {
|
|
14
|
+
sessionId: string;
|
|
15
|
+
skillName: string;
|
|
16
|
+
serverName: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* SkillMcpManager manages MCP server connections declared by skills.
|
|
20
|
+
* Currently a stub — only stdio support planned, HTTP deferred.
|
|
21
|
+
*/
|
|
22
|
+
export declare class SkillMcpManager {
|
|
23
|
+
/** v0.1: No active connections */
|
|
24
|
+
getOrCreateClient(_info: SkillMcpClientInfo, _config: McpServerConfig): Promise<void>;
|
|
25
|
+
/** v0.1: Stub — throws not implemented */
|
|
26
|
+
callTool(_info: SkillMcpClientInfo, _config: McpServerConfig, _name: string, _args: unknown): Promise<unknown>;
|
|
27
|
+
/** Disconnect all clients for a session */
|
|
28
|
+
disconnectSession(_sessionId: string): Promise<void>;
|
|
29
|
+
/** Disconnect all clients */
|
|
30
|
+
disconnectAll(): Promise<void>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Hooks } from "@opencode-ai/plugin";
|
|
2
|
+
import type { PluginAdapterArgs } from "../runtime/opencode/plugin-adapter";
|
|
3
|
+
/**
|
|
4
|
+
* Create the final Hooks object satisfying the OpenCode Plugin contract.
|
|
5
|
+
* This is the return value of the main plugin entry point.
|
|
6
|
+
*/
|
|
7
|
+
export declare function createPluginInterface(args: PluginAdapterArgs): Hooks;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Hooks, PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
/**
|
|
3
|
+
* Plugin context passed through the initialization chain.
|
|
4
|
+
*/
|
|
5
|
+
export type PluginContext = PluginInput;
|
|
6
|
+
/**
|
|
7
|
+
* The full Hooks type from @opencode-ai/plugin.
|
|
8
|
+
* Re-exported for convenience.
|
|
9
|
+
*/
|
|
10
|
+
export type { Hooks } from "@opencode-ai/plugin";
|
|
11
|
+
/**
|
|
12
|
+
* The subset of Hooks that L.E.A.D. implements.
|
|
13
|
+
*/
|
|
14
|
+
export type LeadHooks = Required<Pick<Hooks, "tool" | "config" | "chat.message" | "chat.params" | "event" | "tool.execute.before" | "tool.execute.after" | "command.execute.before" | "tool.definition" | "experimental.session.compacting">>;
|
|
15
|
+
/**
|
|
16
|
+
* Tools record (empty in v0.1 — OpenCode provides the tools).
|
|
17
|
+
*/
|
|
18
|
+
export type ToolsRecord = Record<string, never>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Hooks } from "@opencode-ai/plugin";
|
|
2
|
+
import type { ConfigHandler } from "../../managers/config-handler";
|
|
3
|
+
import type { CreatedHooks } from "../../hooks/create-hooks";
|
|
4
|
+
import type { LeadConfig } from "../../config/schema";
|
|
5
|
+
/**
|
|
6
|
+
* Plugin adapter arguments.
|
|
7
|
+
*/
|
|
8
|
+
export interface PluginAdapterArgs {
|
|
9
|
+
pluginConfig: LeadConfig;
|
|
10
|
+
directory: string;
|
|
11
|
+
configHandler: ConfigHandler;
|
|
12
|
+
hooks: CreatedHooks;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Create the plugin adapter that bridges L.E.A.D. internals to OpenCode hooks.
|
|
16
|
+
*/
|
|
17
|
+
export declare function createPluginAdapter(args: PluginAdapterArgs): Hooks;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type { DeepPartial } from "./types";
|
|
2
|
+
export { setClient, setLogLevel, debug, info, warn, error } from "./log";
|
|
3
|
+
export type { LogLevel, SdkClient } from "./log";
|
|
4
|
+
export { resolveSafePath } from "./resolve-safe-path";
|
|
5
|
+
export { getVersion } from "./version";
|
|
6
|
+
export { getAgentDisplayName, updateBuiltinDisplayName, getAllDisplayNames } from "./agent-display-names";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { createOpencodeClient } from "@opencode-ai/sdk";
|
|
2
|
+
export type LogLevel = "DEBUG" | "INFO" | "WARN" | "ERROR";
|
|
3
|
+
export type SdkClient = ReturnType<typeof createOpencodeClient>;
|
|
4
|
+
export declare function setClient(client: SdkClient): void;
|
|
5
|
+
export declare function setLogLevel(level: LogLevel): void;
|
|
6
|
+
export declare function debug(message: string, ...args: unknown[]): void;
|
|
7
|
+
export declare function info(message: string, ...args: unknown[]): void;
|
|
8
|
+
export declare function warn(message: string, ...args: unknown[]): void;
|
|
9
|
+
export declare function error(message: string, ...args: unknown[]): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getVersion(): string;
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lucasreiners/lead",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "L.E.A.D. (Lucas Engineering Automation & Delivery) — enterprise-grade OpenCode plugin with professional agent orchestration",
|
|
5
|
+
"author": "L.E.A.D.",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"type": "module",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/lucasreiners/lead.git"
|
|
13
|
+
},
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"files": ["dist/"],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "bun run script/build.ts && tsc --emitDeclarationOnly",
|
|
23
|
+
"clean": "rm -rf dist",
|
|
24
|
+
"typecheck": "tsc --noEmit",
|
|
25
|
+
"test": "bun test"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@opencode-ai/plugin": "^1.4.3",
|
|
29
|
+
"@opencode-ai/sdk": "^1.4.3",
|
|
30
|
+
"jsonc-parser": "^3.3.1",
|
|
31
|
+
"picocolors": "^1.1.1",
|
|
32
|
+
"zod": "^4.0.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"bun": "^1.3.11",
|
|
36
|
+
"bun-types": "^1.3.11",
|
|
37
|
+
"typescript": "^6.0.2"
|
|
38
|
+
}
|
|
39
|
+
}
|