@zcy2nn/agent-forge 1.0.1
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 +266 -0
- package/agent-forge.schema.json +675 -0
- package/dist/agents/council.d.ts +27 -0
- package/dist/agents/councillor.d.ts +2 -0
- package/dist/agents/implementer.d.ts +2 -0
- package/dist/agents/index.d.ts +30 -0
- package/dist/agents/orchestrator.d.ts +30 -0
- package/dist/agents/researcher.d.ts +2 -0
- package/dist/agents/reviewer.d.ts +2 -0
- package/dist/cli/config-io.d.ts +24 -0
- package/dist/cli/config-manager.d.ts +4 -0
- package/dist/cli/custom-skills.d.ts +29 -0
- package/dist/cli/doctor.d.ts +38 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +1932 -0
- package/dist/cli/install.d.ts +2 -0
- package/dist/cli/migration.d.ts +46 -0
- package/dist/cli/model-key-normalization.d.ts +1 -0
- package/dist/cli/paths.d.ts +35 -0
- package/dist/cli/providers.d.ts +99 -0
- package/dist/cli/skills.d.ts +52 -0
- package/dist/cli/system.d.ts +6 -0
- package/dist/cli/types.d.ts +40 -0
- package/dist/config/agent-mcps.d.ts +15 -0
- package/dist/config/constants.d.ts +28 -0
- package/dist/config/council-schema.d.ts +127 -0
- package/dist/config/index.d.ts +5 -0
- package/dist/config/loader.d.ts +57 -0
- package/dist/config/runtime-preset.d.ts +12 -0
- package/dist/config/schema.d.ts +371 -0
- package/dist/config/utils.d.ts +15 -0
- package/dist/council/council-manager.d.ts +49 -0
- package/dist/council/index.d.ts +1 -0
- package/dist/divoom/council.gif +0 -0
- package/dist/divoom/designer.gif +0 -0
- package/dist/divoom/explorer.gif +0 -0
- package/dist/divoom/fixer.gif +0 -0
- package/dist/divoom/input.gif +0 -0
- package/dist/divoom/intro.gif +0 -0
- package/dist/divoom/librarian.gif +0 -0
- package/dist/divoom/manager.d.ts +57 -0
- package/dist/divoom/oracle.gif +0 -0
- package/dist/divoom/orchestrator.gif +0 -0
- package/dist/hooks/apply-patch/codec.d.ts +7 -0
- package/dist/hooks/apply-patch/errors.d.ts +25 -0
- package/dist/hooks/apply-patch/execution-context.d.ts +27 -0
- package/dist/hooks/apply-patch/index.d.ts +15 -0
- package/dist/hooks/apply-patch/matching.d.ts +26 -0
- package/dist/hooks/apply-patch/operations.d.ts +3 -0
- package/dist/hooks/apply-patch/patch.d.ts +2 -0
- package/dist/hooks/apply-patch/prepared-changes.d.ts +17 -0
- package/dist/hooks/apply-patch/resolution.d.ts +19 -0
- package/dist/hooks/apply-patch/rewrite.d.ts +7 -0
- package/dist/hooks/apply-patch/test-helpers.d.ts +6 -0
- package/dist/hooks/apply-patch/types.d.ts +80 -0
- package/dist/hooks/auto-update-checker/cache.d.ts +11 -0
- package/dist/hooks/auto-update-checker/checker.d.ts +32 -0
- package/dist/hooks/auto-update-checker/constants.d.ts +11 -0
- package/dist/hooks/auto-update-checker/index.d.ts +18 -0
- package/dist/hooks/auto-update-checker/types.d.ts +22 -0
- package/dist/hooks/chat-headers.d.ts +16 -0
- package/dist/hooks/delegate-task-retry/guidance.d.ts +2 -0
- package/dist/hooks/delegate-task-retry/hook.d.ts +8 -0
- package/dist/hooks/delegate-task-retry/index.d.ts +4 -0
- package/dist/hooks/delegate-task-retry/patterns.d.ts +11 -0
- package/dist/hooks/filter-available-skills/index.d.ts +32 -0
- package/dist/hooks/foreground-fallback/index.d.ts +72 -0
- package/dist/hooks/image-hook.d.ts +19 -0
- package/dist/hooks/index.d.ts +13 -0
- package/dist/hooks/json-error-recovery/hook.d.ts +18 -0
- package/dist/hooks/json-error-recovery/index.d.ts +1 -0
- package/dist/hooks/phase-reminder/index.d.ts +26 -0
- package/dist/hooks/post-file-tool-nudge/index.d.ts +19 -0
- package/dist/hooks/task-session-manager/index.d.ts +52 -0
- package/dist/hooks/todo-continuation/index.d.ts +53 -0
- package/dist/hooks/todo-continuation/todo-hygiene.d.ts +35 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +32981 -0
- package/dist/interview/dashboard.d.ts +62 -0
- package/dist/interview/document.d.ts +25 -0
- package/dist/interview/helpers.d.ts +10 -0
- package/dist/interview/index.d.ts +1 -0
- package/dist/interview/manager.d.ts +35 -0
- package/dist/interview/parser.d.ts +11 -0
- package/dist/interview/prompts.d.ts +7 -0
- package/dist/interview/server.d.ts +13 -0
- package/dist/interview/service.d.ts +34 -0
- package/dist/interview/types.d.ts +96 -0
- package/dist/interview/ui.d.ts +12 -0
- package/dist/mcp/context7.d.ts +6 -0
- package/dist/mcp/grep-app.d.ts +6 -0
- package/dist/mcp/index.d.ts +8 -0
- package/dist/mcp/types.d.ts +12 -0
- package/dist/mcp/websearch.d.ts +9 -0
- package/dist/multiplexer/factory.d.ts +26 -0
- package/dist/multiplexer/index.d.ts +9 -0
- package/dist/multiplexer/session-manager.d.ts +53 -0
- package/dist/multiplexer/tmux/index.d.ts +22 -0
- package/dist/multiplexer/types.d.ts +54 -0
- package/dist/multiplexer/zellij/index.d.ts +34 -0
- package/dist/tools/ast-grep/cli.d.ts +15 -0
- package/dist/tools/ast-grep/constants.d.ts +25 -0
- package/dist/tools/ast-grep/downloader.d.ts +5 -0
- package/dist/tools/ast-grep/index.d.ts +10 -0
- package/dist/tools/ast-grep/tools.d.ts +3 -0
- package/dist/tools/ast-grep/types.d.ts +30 -0
- package/dist/tools/ast-grep/utils.d.ts +4 -0
- package/dist/tools/council.d.ts +10 -0
- package/dist/tools/index.d.ts +6 -0
- package/dist/tools/preset-manager.d.ts +27 -0
- package/dist/tools/skill.d.ts +9 -0
- package/dist/tools/smartfetch/binary.d.ts +3 -0
- package/dist/tools/smartfetch/cache.d.ts +6 -0
- package/dist/tools/smartfetch/constants.d.ts +12 -0
- package/dist/tools/smartfetch/index.d.ts +3 -0
- package/dist/tools/smartfetch/network.d.ts +38 -0
- package/dist/tools/smartfetch/secondary-model.d.ts +28 -0
- package/dist/tools/smartfetch/tool.d.ts +3 -0
- package/dist/tools/smartfetch/types.d.ts +122 -0
- package/dist/tools/smartfetch/utils.d.ts +18 -0
- package/dist/tui-state.d.ts +15 -0
- package/dist/tui.d.ts +8 -0
- package/dist/tui.js +248 -0
- package/dist/utils/agent-variant.d.ts +63 -0
- package/dist/utils/compat.d.ts +30 -0
- package/dist/utils/env.d.ts +1 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/internal-initiator.d.ts +6 -0
- package/dist/utils/logger.d.ts +8 -0
- package/dist/utils/polling.d.ts +21 -0
- package/dist/utils/session-manager.d.ts +55 -0
- package/dist/utils/session.d.ts +74 -0
- package/dist/utils/subagent-depth.d.ts +35 -0
- package/dist/utils/system-collapse.d.ts +6 -0
- package/dist/utils/task.d.ts +4 -0
- package/dist/utils/zip-extractor.d.ts +1 -0
- package/package.json +104 -0
- package/src/skills/brainstorming/SKILL.md +177 -0
- package/src/skills/brainstorming/scripts/frame-template.html +214 -0
- package/src/skills/brainstorming/scripts/helper.js +88 -0
- package/src/skills/brainstorming/scripts/server.cjs +354 -0
- package/src/skills/brainstorming/scripts/start-server.sh +148 -0
- package/src/skills/brainstorming/scripts/stop-server.sh +56 -0
- package/src/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/src/skills/brainstorming/visual-companion.md +279 -0
- package/src/skills/codemap/README.md +59 -0
- package/src/skills/codemap/SKILL.md +163 -0
- package/src/skills/codemap/codemap.md +36 -0
- package/src/skills/codemap/scripts/codemap.mjs +483 -0
- package/src/skills/codemap/scripts/codemap.test.ts +129 -0
- package/src/skills/codemap.md +40 -0
- package/src/skills/dispatching-parallel-agents/SKILL.md +193 -0
- package/src/skills/executing-plans/SKILL.md +78 -0
- package/src/skills/finishing-a-development-branch/SKILL.md +211 -0
- package/src/skills/receiving-code-review/SKILL.md +224 -0
- package/src/skills/requesting-code-review/SKILL.md +113 -0
- package/src/skills/requesting-code-review/code-reviewer.md +146 -0
- package/src/skills/simplify/README.md +19 -0
- package/src/skills/simplify/SKILL.md +138 -0
- package/src/skills/simplify/codemap.md +36 -0
- package/src/skills/subagent-driven-development/SKILL.md +288 -0
- package/src/skills/subagent-driven-development/code-quality-reviewer-prompt.md +26 -0
- package/src/skills/subagent-driven-development/implementer-prompt.md +113 -0
- package/src/skills/subagent-driven-development/spec-reviewer-prompt.md +61 -0
- package/src/skills/systematic-debugging/CREATION-LOG.md +119 -0
- package/src/skills/systematic-debugging/SKILL.md +308 -0
- package/src/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
- package/src/skills/systematic-debugging/condition-based-waiting.md +115 -0
- package/src/skills/systematic-debugging/defense-in-depth.md +122 -0
- package/src/skills/systematic-debugging/find-polluter.sh +63 -0
- package/src/skills/systematic-debugging/root-cause-tracing.md +169 -0
- package/src/skills/systematic-debugging/test-academic.md +14 -0
- package/src/skills/systematic-debugging/test-pressure-1.md +58 -0
- package/src/skills/systematic-debugging/test-pressure-2.md +68 -0
- package/src/skills/systematic-debugging/test-pressure-3.md +69 -0
- package/src/skills/test-driven-development/SKILL.md +383 -0
- package/src/skills/test-driven-development/testing-anti-patterns.md +299 -0
- package/src/skills/using-git-worktrees/SKILL.md +226 -0
- package/src/skills/verification-before-completion/SKILL.md +147 -0
- package/src/skills/writing-plans/SKILL.md +165 -0
- package/src/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
- package/src/skills/writing-skills/SKILL.md +666 -0
- package/src/skills/writing-skills/anthropic-best-practices.md +1150 -0
- package/src/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
- package/src/skills/writing-skills/graphviz-conventions.dot +172 -0
- package/src/skills/writing-skills/persuasion-principles.md +187 -0
- package/src/skills/writing-skills/render-graphs.js +168 -0
- package/src/skills/writing-skills/testing-skills-with-subagents.md +384 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { InterviewStateEntry } from './types';
|
|
2
|
+
export declare function readDashboardAuthFile(port: number): Promise<{
|
|
3
|
+
token: string;
|
|
4
|
+
pid: number;
|
|
5
|
+
startedAt: number;
|
|
6
|
+
} | null>;
|
|
7
|
+
interface RegisteredSession {
|
|
8
|
+
sessionID: string;
|
|
9
|
+
directory: string;
|
|
10
|
+
pid: number;
|
|
11
|
+
registeredAt: number;
|
|
12
|
+
}
|
|
13
|
+
export declare const DEFAULT_DASHBOARD_PORT = 43211;
|
|
14
|
+
export interface DashboardConfig {
|
|
15
|
+
port: number;
|
|
16
|
+
outputFolder: string;
|
|
17
|
+
sessionClient?: {
|
|
18
|
+
list: (params?: Record<string, unknown>) => Promise<{
|
|
19
|
+
data?: Array<{
|
|
20
|
+
directory?: string;
|
|
21
|
+
time?: {
|
|
22
|
+
updated?: number;
|
|
23
|
+
};
|
|
24
|
+
}>;
|
|
25
|
+
}>;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export declare function createDashboardServer(config: DashboardConfig): {
|
|
29
|
+
start: () => Promise<string>;
|
|
30
|
+
close: () => void;
|
|
31
|
+
registerSession: (info: RegisteredSession) => void;
|
|
32
|
+
removeSession: (sessionID: string) => void;
|
|
33
|
+
pushState: (entry: InterviewStateEntry) => void;
|
|
34
|
+
getState: (interviewId: string) => InterviewStateEntry | undefined;
|
|
35
|
+
storeAnswers: (interviewId: string, answers: Array<{
|
|
36
|
+
questionId: string;
|
|
37
|
+
answer: string;
|
|
38
|
+
}>) => void;
|
|
39
|
+
getPendingAnswers: (interviewId: string) => Array<{
|
|
40
|
+
questionId: string;
|
|
41
|
+
answer: string;
|
|
42
|
+
}> | null;
|
|
43
|
+
consumePendingAnswers: (interviewId: string) => Array<{
|
|
44
|
+
questionId: string;
|
|
45
|
+
answer: string;
|
|
46
|
+
}> | null;
|
|
47
|
+
consumeNudgeAction: (interviewId: string) => 'more-questions' | 'confirm-complete' | null;
|
|
48
|
+
authToken: string;
|
|
49
|
+
discoverSessionDirectories: () => Promise<void>;
|
|
50
|
+
addManualFolder: (dir: string) => void;
|
|
51
|
+
removeManualFolder: (dir: string) => void;
|
|
52
|
+
getManualFolders: () => string[];
|
|
53
|
+
setScanDays: (days: number) => void;
|
|
54
|
+
getScanDays: () => number;
|
|
55
|
+
refreshFiles: () => Promise<void>;
|
|
56
|
+
};
|
|
57
|
+
export declare function probeDashboard(port: number): Promise<{
|
|
58
|
+
alive: boolean;
|
|
59
|
+
timestamp: number;
|
|
60
|
+
}>;
|
|
61
|
+
export declare function tryBecomeDashboard(config: DashboardConfig, maxAttempts?: number): Promise<ReturnType<typeof createDashboardServer> | null>;
|
|
62
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { InterviewAnswer, InterviewQuestion, InterviewRecord } from './types';
|
|
2
|
+
export declare const DEFAULT_OUTPUT_FOLDER = "interview";
|
|
3
|
+
export declare function normalizeOutputFolder(outputFolder: string): string;
|
|
4
|
+
export declare function createInterviewDirectoryPath(directory: string, outputFolder: string): string;
|
|
5
|
+
export declare function createInterviewFilePath(directory: string, outputFolder: string, idea: string): string;
|
|
6
|
+
export declare function relativeInterviewPath(directory: string, filePath: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* Resolve a user-provided value to an existing .md file path.
|
|
9
|
+
* Checks absolute paths, relative paths, and output-folder-relative paths.
|
|
10
|
+
* Returns null if no matching file is found.
|
|
11
|
+
*/
|
|
12
|
+
export declare function resolveExistingInterviewPath(directory: string, outputFolder: string, value: string): string | null;
|
|
13
|
+
export declare function slugify(value: string): string;
|
|
14
|
+
export declare function extractSummarySection(document: string): string;
|
|
15
|
+
export declare function extractTitle(document: string): string;
|
|
16
|
+
export declare function buildInterviewDocument(idea: string, summary: string, history: string, meta?: {
|
|
17
|
+
sessionID?: string;
|
|
18
|
+
baseMessageCount?: number;
|
|
19
|
+
}): string;
|
|
20
|
+
/** Parse frontmatter from a .md file. Returns null if no frontmatter. */
|
|
21
|
+
export declare function parseFrontmatter(content: string): Record<string, string> | null;
|
|
22
|
+
export declare function ensureInterviewFile(record: InterviewRecord): Promise<void>;
|
|
23
|
+
export declare function readInterviewDocument(record: InterviewRecord): Promise<string>;
|
|
24
|
+
export declare function rewriteInterviewDocument(record: InterviewRecord, summary: string): Promise<string>;
|
|
25
|
+
export declare function appendInterviewAnswers(record: InterviewRecord, questions: InterviewQuestion[], answers: InterviewAnswer[]): Promise<void>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
2
|
+
export declare function sendJson(response: ServerResponse, status: number, value: unknown): void;
|
|
3
|
+
export declare function sendHtml(response: ServerResponse, html: string): void;
|
|
4
|
+
export declare function isValidId(id: string): boolean;
|
|
5
|
+
export declare function extractResumeSlug(interviewId: string): string;
|
|
6
|
+
/**
|
|
7
|
+
* Read and parse JSON body from an HTTP request with size limit.
|
|
8
|
+
* Destroys the request if the body exceeds MAX_BODY_SIZE.
|
|
9
|
+
*/
|
|
10
|
+
export declare function readJsonBody(request: IncomingMessage): Promise<unknown>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createInterviewManager } from './manager';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { PluginInput } from '@opencode-ai/plugin';
|
|
2
|
+
import type { PluginConfig } from '../config';
|
|
3
|
+
/**
|
|
4
|
+
* Interview Manager — Composition root.
|
|
5
|
+
*
|
|
6
|
+
* Two modes:
|
|
7
|
+
*
|
|
8
|
+
* 1. **Dashboard mode** (dashboard:true or port>0):
|
|
9
|
+
* First process to bind the port becomes the dashboard (dumb aggregator).
|
|
10
|
+
* Other processes register as sessions and push state to it.
|
|
11
|
+
* Sessions drive LLM interaction locally, dashboard just serves the web UI.
|
|
12
|
+
*
|
|
13
|
+
* 2. **Per-session mode** (default, port=0, dashboard:false):
|
|
14
|
+
* Upstream behavior. Each process runs its own interview server on a random
|
|
15
|
+
* port. Lazy startup on first /interview command.
|
|
16
|
+
*/
|
|
17
|
+
export declare function createInterviewManager(ctx: PluginInput, config: PluginConfig): {
|
|
18
|
+
registerCommand: (config: Record<string, unknown>) => void;
|
|
19
|
+
handleCommandExecuteBefore: (input: {
|
|
20
|
+
command: string;
|
|
21
|
+
sessionID: string;
|
|
22
|
+
arguments: string;
|
|
23
|
+
}, output: {
|
|
24
|
+
parts: Array<{
|
|
25
|
+
type: string;
|
|
26
|
+
text?: string;
|
|
27
|
+
}>;
|
|
28
|
+
}) => Promise<void>;
|
|
29
|
+
handleEvent: (input: {
|
|
30
|
+
event: {
|
|
31
|
+
type: string;
|
|
32
|
+
properties?: Record<string, unknown>;
|
|
33
|
+
};
|
|
34
|
+
}) => Promise<void>;
|
|
35
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { InterviewAssistantState, InterviewMessage } from './types';
|
|
2
|
+
export declare function flattenMessage(message: InterviewMessage): string;
|
|
3
|
+
export declare function buildFallbackState(messages: InterviewMessage[]): InterviewAssistantState;
|
|
4
|
+
export declare function parseAssistantState(text: string, maxQuestions?: number): {
|
|
5
|
+
state: InterviewAssistantState | null;
|
|
6
|
+
error?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function findLatestAssistantState(messages: InterviewMessage[], maxQuestions?: number): {
|
|
9
|
+
state: InterviewAssistantState | null;
|
|
10
|
+
latestAssistantError?: string;
|
|
11
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { InterviewQuestion } from './types';
|
|
2
|
+
export declare function buildKickoffPrompt(idea: string, maxQuestions: number): string;
|
|
3
|
+
export declare function buildResumePrompt(document: string, maxQuestions: number): string;
|
|
4
|
+
export declare function buildAnswerPrompt(answers: Array<{
|
|
5
|
+
questionId: string;
|
|
6
|
+
answer: string;
|
|
7
|
+
}>, questions: InterviewQuestion[], maxQuestions: number): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { InterviewAnswer, InterviewFileItem, InterviewListItem, InterviewState } from './types';
|
|
2
|
+
export declare function createInterviewServer(deps: {
|
|
3
|
+
getState: (interviewId: string) => Promise<InterviewState>;
|
|
4
|
+
listInterviewFiles: () => Promise<InterviewFileItem[]>;
|
|
5
|
+
listInterviews: () => InterviewListItem[];
|
|
6
|
+
submitAnswers: (interviewId: string, answers: InterviewAnswer[]) => Promise<void>;
|
|
7
|
+
handleNudgeAction: (interviewId: string, action: 'more-questions' | 'confirm-complete') => Promise<void>;
|
|
8
|
+
outputFolder: string;
|
|
9
|
+
port: number;
|
|
10
|
+
}): {
|
|
11
|
+
ensureStarted: () => Promise<string>;
|
|
12
|
+
close: () => void;
|
|
13
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { PluginInput } from '@opencode-ai/plugin';
|
|
2
|
+
import type { InterviewConfig } from '../config';
|
|
3
|
+
import type { InterviewAnswer, InterviewFileItem, InterviewListItem, InterviewRecord, InterviewState } from './types';
|
|
4
|
+
export declare function createInterviewService(ctx: PluginInput, config?: InterviewConfig, deps?: {
|
|
5
|
+
openBrowser?: (url: string) => void;
|
|
6
|
+
env?: NodeJS.ProcessEnv;
|
|
7
|
+
}): {
|
|
8
|
+
setBaseUrlResolver: (resolver: () => Promise<string>) => void;
|
|
9
|
+
setStatePushCallback: (callback: (interviewId: string, state: InterviewState) => void) => void;
|
|
10
|
+
setOnInterviewCreated: (callback: (interview: InterviewRecord) => void) => void;
|
|
11
|
+
getActiveInterviewId: (sessionID: string) => string | null;
|
|
12
|
+
registerCommand: (config: Record<string, unknown>) => void;
|
|
13
|
+
handleCommandExecuteBefore: (input: {
|
|
14
|
+
command: string;
|
|
15
|
+
sessionID: string;
|
|
16
|
+
arguments: string;
|
|
17
|
+
}, output: {
|
|
18
|
+
parts: Array<{
|
|
19
|
+
type: string;
|
|
20
|
+
text?: string;
|
|
21
|
+
}>;
|
|
22
|
+
}) => Promise<void>;
|
|
23
|
+
handleEvent: (input: {
|
|
24
|
+
event: {
|
|
25
|
+
type: string;
|
|
26
|
+
properties?: Record<string, unknown>;
|
|
27
|
+
};
|
|
28
|
+
}) => Promise<void>;
|
|
29
|
+
getInterviewState: (interviewId: string) => Promise<InterviewState>;
|
|
30
|
+
listInterviewFiles: () => Promise<InterviewFileItem[]>;
|
|
31
|
+
listInterviews: () => InterviewListItem[];
|
|
32
|
+
submitAnswers: (interviewId: string, answers: InterviewAnswer[]) => Promise<void>;
|
|
33
|
+
handleNudgeAction: (interviewId: string, action: 'more-questions' | 'confirm-complete') => Promise<void>;
|
|
34
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export interface InterviewQuestion {
|
|
3
|
+
id: string;
|
|
4
|
+
question: string;
|
|
5
|
+
options: string[];
|
|
6
|
+
suggested?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface InterviewAnswer {
|
|
9
|
+
questionId: string;
|
|
10
|
+
answer: string;
|
|
11
|
+
}
|
|
12
|
+
export interface InterviewAssistantState {
|
|
13
|
+
summary: string;
|
|
14
|
+
title?: string;
|
|
15
|
+
questions: InterviewQuestion[];
|
|
16
|
+
}
|
|
17
|
+
/** Raw question object from LLM output — loose, everything optional. */
|
|
18
|
+
export declare const RawQuestionSchema: z.ZodObject<{
|
|
19
|
+
id: z.ZodOptional<z.ZodString>;
|
|
20
|
+
question: z.ZodOptional<z.ZodString>;
|
|
21
|
+
options: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
22
|
+
suggested: z.ZodOptional<z.ZodUnknown>;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
/** Raw interview_state block from LLM output. */
|
|
25
|
+
export declare const RawInterviewStateSchema: z.ZodObject<{
|
|
26
|
+
summary: z.ZodOptional<z.ZodUnknown>;
|
|
27
|
+
title: z.ZodOptional<z.ZodUnknown>;
|
|
28
|
+
questions: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
export interface InterviewRecord {
|
|
31
|
+
id: string;
|
|
32
|
+
sessionID: string;
|
|
33
|
+
idea: string;
|
|
34
|
+
markdownPath: string;
|
|
35
|
+
createdAt: string;
|
|
36
|
+
status: 'active' | 'abandoned';
|
|
37
|
+
baseMessageCount: number;
|
|
38
|
+
}
|
|
39
|
+
export interface InterviewMessagePart {
|
|
40
|
+
type?: string;
|
|
41
|
+
text?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface InterviewMessage {
|
|
44
|
+
info?: {
|
|
45
|
+
role?: string;
|
|
46
|
+
[key: string]: unknown;
|
|
47
|
+
};
|
|
48
|
+
parts?: InterviewMessagePart[];
|
|
49
|
+
}
|
|
50
|
+
export interface InterviewListItem {
|
|
51
|
+
id: string;
|
|
52
|
+
idea: string;
|
|
53
|
+
status: InterviewRecord['status'];
|
|
54
|
+
createdAt: string;
|
|
55
|
+
}
|
|
56
|
+
export interface InterviewFileItem {
|
|
57
|
+
fileName: string;
|
|
58
|
+
resumeCommand: string;
|
|
59
|
+
title: string;
|
|
60
|
+
summary: string;
|
|
61
|
+
sessionID?: string;
|
|
62
|
+
directory?: string;
|
|
63
|
+
}
|
|
64
|
+
export interface InterviewState {
|
|
65
|
+
interview: InterviewRecord;
|
|
66
|
+
url: string;
|
|
67
|
+
markdownPath: string;
|
|
68
|
+
mode: 'awaiting-agent' | 'awaiting-user' | 'abandoned' | 'completed' | 'error' | 'session-disconnected';
|
|
69
|
+
lastParseError?: string;
|
|
70
|
+
isBusy: boolean;
|
|
71
|
+
summary: string;
|
|
72
|
+
questions: InterviewQuestion[];
|
|
73
|
+
document: string;
|
|
74
|
+
}
|
|
75
|
+
/** Wire format for dashboard state cache entries. */
|
|
76
|
+
export interface InterviewStateEntry {
|
|
77
|
+
interviewId: string;
|
|
78
|
+
sessionID: string;
|
|
79
|
+
idea: string;
|
|
80
|
+
mode: 'awaiting-agent' | 'awaiting-user' | 'abandoned' | 'completed' | 'error' | 'session-disconnected';
|
|
81
|
+
summary: string;
|
|
82
|
+
title: string;
|
|
83
|
+
questions: Array<{
|
|
84
|
+
id: string;
|
|
85
|
+
question: string;
|
|
86
|
+
options?: string[];
|
|
87
|
+
suggested?: string;
|
|
88
|
+
}>;
|
|
89
|
+
pendingAnswers: Array<{
|
|
90
|
+
questionId: string;
|
|
91
|
+
answer: string;
|
|
92
|
+
}> | null;
|
|
93
|
+
lastUpdatedAt: number;
|
|
94
|
+
filePath: string;
|
|
95
|
+
nudgeAction: 'more-questions' | 'confirm-complete' | null;
|
|
96
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { InterviewFileItem, InterviewListItem } from './types';
|
|
2
|
+
interface DashboardInterviewItem extends InterviewListItem {
|
|
3
|
+
url: string;
|
|
4
|
+
mode: string;
|
|
5
|
+
resumeSlug: string;
|
|
6
|
+
sessionID?: string;
|
|
7
|
+
directory?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function escapeHtml(value: string): string;
|
|
10
|
+
export declare function renderDashboardPage(interviews: DashboardInterviewItem[], files: InterviewFileItem[], outputFolder: string): string;
|
|
11
|
+
export declare function renderInterviewPage(interviewId: string, resumeSlug: string): string;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { WebsearchConfig } from '../config';
|
|
2
|
+
import type { McpConfig } from './types';
|
|
3
|
+
export type { LocalMcpConfig, McpConfig, RemoteMcpConfig } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Creates MCP configurations, excluding disabled ones.
|
|
6
|
+
* Accepts an optional websearchConfig to override the default Exa provider.
|
|
7
|
+
*/
|
|
8
|
+
export declare function createBuiltinMcps(disabledMcps?: readonly string[], websearchConfig?: WebsearchConfig): Record<string, McpConfig>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type RemoteMcpConfig = {
|
|
2
|
+
type: 'remote';
|
|
3
|
+
url: string;
|
|
4
|
+
headers?: Record<string, string>;
|
|
5
|
+
oauth?: false;
|
|
6
|
+
};
|
|
7
|
+
export type LocalMcpConfig = {
|
|
8
|
+
type: 'local';
|
|
9
|
+
command: string[];
|
|
10
|
+
environment?: Record<string, string>;
|
|
11
|
+
};
|
|
12
|
+
export type McpConfig = RemoteMcpConfig | LocalMcpConfig;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { WebsearchConfig } from '../config';
|
|
2
|
+
import type { RemoteMcpConfig } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Creates a websearch MCP config based on the provided configuration.
|
|
5
|
+
* Supports Exa (default) and Tavily providers.
|
|
6
|
+
* @see https://exa.ai @see https://tavily.com
|
|
7
|
+
*/
|
|
8
|
+
export declare function createWebsearchConfig(config?: WebsearchConfig): RemoteMcpConfig;
|
|
9
|
+
export declare const websearch: RemoteMcpConfig;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multiplexer factory - creates the appropriate multiplexer instance
|
|
3
|
+
*/
|
|
4
|
+
import type { MultiplexerConfig } from '../config/schema';
|
|
5
|
+
import type { Multiplexer } from './types';
|
|
6
|
+
/**
|
|
7
|
+
* Create a multiplexer instance based on config.
|
|
8
|
+
*
|
|
9
|
+
* Do not cache instances: tmux/zellij integrations may depend on
|
|
10
|
+
* per-process environment like TMUX_PANE/ZELLIJ, which should be captured
|
|
11
|
+
* fresh for each plugin context.
|
|
12
|
+
*/
|
|
13
|
+
export declare function getMultiplexer(config: MultiplexerConfig): Multiplexer | null;
|
|
14
|
+
/**
|
|
15
|
+
* Clear the multiplexer cache (useful for testing)
|
|
16
|
+
*/
|
|
17
|
+
export declare function clearMultiplexerCache(): void;
|
|
18
|
+
/**
|
|
19
|
+
* Get the effective multiplexer type for auto mode
|
|
20
|
+
* Returns the actual type that would be used (tmux/zellij/none)
|
|
21
|
+
*/
|
|
22
|
+
export declare function getAutoMultiplexerType(): 'tmux' | 'zellij' | 'none';
|
|
23
|
+
/**
|
|
24
|
+
* Start background availability check for a multiplexer
|
|
25
|
+
*/
|
|
26
|
+
export declare function startAvailabilityCheck(config: MultiplexerConfig): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multiplexer module exports
|
|
3
|
+
*/
|
|
4
|
+
export { clearMultiplexerCache, getMultiplexer, startAvailabilityCheck, } from './factory';
|
|
5
|
+
export { MultiplexerSessionManager, TmuxSessionManager, } from './session-manager';
|
|
6
|
+
export { TmuxMultiplexer } from './tmux';
|
|
7
|
+
export type { Multiplexer, PaneResult } from './types';
|
|
8
|
+
export { isServerRunning } from './types';
|
|
9
|
+
export { ZellijMultiplexer } from './zellij';
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { PluginInput } from '@opencode-ai/plugin';
|
|
2
|
+
import type { MultiplexerConfig } from '../config/schema';
|
|
3
|
+
interface SessionEvent {
|
|
4
|
+
type: string;
|
|
5
|
+
properties?: {
|
|
6
|
+
info?: {
|
|
7
|
+
id?: string;
|
|
8
|
+
parentID?: string;
|
|
9
|
+
title?: string;
|
|
10
|
+
directory?: string;
|
|
11
|
+
};
|
|
12
|
+
sessionID?: string;
|
|
13
|
+
status?: {
|
|
14
|
+
type: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Tracks child sessions and spawns/closes multiplexer panes for them.
|
|
20
|
+
*
|
|
21
|
+
* Uses session.status events for completion detection instead of polling,
|
|
22
|
+
* with polling kept as a fallback for reliability.
|
|
23
|
+
*/
|
|
24
|
+
export declare class MultiplexerSessionManager {
|
|
25
|
+
private client;
|
|
26
|
+
private serverUrl;
|
|
27
|
+
private directory;
|
|
28
|
+
private multiplexer;
|
|
29
|
+
private sessions;
|
|
30
|
+
private knownSessions;
|
|
31
|
+
private spawningSessions;
|
|
32
|
+
private closingSessions;
|
|
33
|
+
private pollInterval?;
|
|
34
|
+
private enabled;
|
|
35
|
+
constructor(ctx: PluginInput, config: MultiplexerConfig);
|
|
36
|
+
onSessionCreated(event: SessionEvent): Promise<void>;
|
|
37
|
+
onSessionStatus(event: SessionEvent): Promise<void>;
|
|
38
|
+
onSessionDeleted(event: SessionEvent): Promise<void>;
|
|
39
|
+
private startPolling;
|
|
40
|
+
private stopPolling;
|
|
41
|
+
private pollSessions;
|
|
42
|
+
private closeSession;
|
|
43
|
+
private respawnIfKnown;
|
|
44
|
+
private isTrackedOrSpawning;
|
|
45
|
+
private updatePolling;
|
|
46
|
+
private getSessionId;
|
|
47
|
+
cleanup(): Promise<void>;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* @deprecated Use MultiplexerSessionManager instead
|
|
51
|
+
*/
|
|
52
|
+
export declare const TmuxSessionManager: typeof MultiplexerSessionManager;
|
|
53
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tmux multiplexer implementation
|
|
3
|
+
*/
|
|
4
|
+
import type { MultiplexerLayout } from '../../config/schema';
|
|
5
|
+
import type { Multiplexer, PaneResult } from '../types';
|
|
6
|
+
export declare class TmuxMultiplexer implements Multiplexer {
|
|
7
|
+
readonly type: "tmux";
|
|
8
|
+
private binaryPath;
|
|
9
|
+
private hasChecked;
|
|
10
|
+
private storedLayout;
|
|
11
|
+
private storedMainPaneSize;
|
|
12
|
+
private targetPane;
|
|
13
|
+
constructor(layout?: MultiplexerLayout, mainPaneSize?: number);
|
|
14
|
+
isAvailable(): Promise<boolean>;
|
|
15
|
+
isInsideSession(): boolean;
|
|
16
|
+
spawnPane(sessionId: string, description: string, serverUrl: string, directory: string): Promise<PaneResult>;
|
|
17
|
+
closePane(paneId: string): Promise<boolean>;
|
|
18
|
+
applyLayout(layout: MultiplexerLayout, mainPaneSize: number): Promise<void>;
|
|
19
|
+
private getBinary;
|
|
20
|
+
private targetArgs;
|
|
21
|
+
private findBinary;
|
|
22
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multiplexer abstraction layer
|
|
3
|
+
*
|
|
4
|
+
* Provides a unified interface for terminal multiplexers (tmux, zellij, etc.)
|
|
5
|
+
* to spawn and manage panes for child agent sessions.
|
|
6
|
+
*/
|
|
7
|
+
import type { MultiplexerConfig, MultiplexerLayout } from '../config/schema';
|
|
8
|
+
export interface PaneResult {
|
|
9
|
+
success: boolean;
|
|
10
|
+
paneId?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Core multiplexer interface
|
|
14
|
+
* Implementations: TmuxMultiplexer, ZellijMultiplexer
|
|
15
|
+
*/
|
|
16
|
+
export interface Multiplexer {
|
|
17
|
+
readonly type: 'tmux' | 'zellij';
|
|
18
|
+
/**
|
|
19
|
+
* Check if the multiplexer binary is available on the system
|
|
20
|
+
*/
|
|
21
|
+
isAvailable(): Promise<boolean>;
|
|
22
|
+
/**
|
|
23
|
+
* Check if currently running inside a multiplexer session
|
|
24
|
+
*/
|
|
25
|
+
isInsideSession(): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Spawn a new pane running the given command
|
|
28
|
+
* @param sessionId - The OpenCode session ID to attach to
|
|
29
|
+
* @param description - Human-readable description for the pane
|
|
30
|
+
* @param serverUrl - The OpenCode server URL to attach to
|
|
31
|
+
* @param directory - The project directory to attach from
|
|
32
|
+
*/
|
|
33
|
+
spawnPane(sessionId: string, description: string, serverUrl: string, directory: string): Promise<PaneResult>;
|
|
34
|
+
/**
|
|
35
|
+
* Close a pane by its ID
|
|
36
|
+
* @param paneId - The pane ID returned by spawnPane
|
|
37
|
+
* @returns true if successfully closed
|
|
38
|
+
*/
|
|
39
|
+
closePane(paneId: string): Promise<boolean>;
|
|
40
|
+
/**
|
|
41
|
+
* Apply layout to rebalance panes
|
|
42
|
+
* @param layout - The layout type to apply
|
|
43
|
+
* @param mainPaneSize - Percentage for main pane (for main-* layouts)
|
|
44
|
+
*/
|
|
45
|
+
applyLayout(layout: MultiplexerLayout, mainPaneSize: number): Promise<void>;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Factory function type for creating multiplexer instances
|
|
49
|
+
*/
|
|
50
|
+
export type MultiplexerFactory = (config: MultiplexerConfig) => Multiplexer;
|
|
51
|
+
/**
|
|
52
|
+
* Server health check utility (shared across implementations)
|
|
53
|
+
*/
|
|
54
|
+
export declare function isServerRunning(serverUrl: string, timeoutMs?: number, maxAttempts?: number): Promise<boolean>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zellij multiplexer implementation
|
|
3
|
+
*
|
|
4
|
+
* Creates a dedicated "opencode-agents" tab for all sub-agent panes.
|
|
5
|
+
* - First sub-agent uses the default pane from new-tab
|
|
6
|
+
* - Subsequent sub-agents create new panes
|
|
7
|
+
* - User stays in their original tab
|
|
8
|
+
*/
|
|
9
|
+
import type { MultiplexerLayout } from '../../config/schema';
|
|
10
|
+
import type { Multiplexer, PaneResult } from '../types';
|
|
11
|
+
export declare class ZellijMultiplexer implements Multiplexer {
|
|
12
|
+
readonly type: "zellij";
|
|
13
|
+
private binaryPath;
|
|
14
|
+
private hasChecked;
|
|
15
|
+
private agentTabId;
|
|
16
|
+
private firstPaneId;
|
|
17
|
+
private firstPaneUsed;
|
|
18
|
+
constructor(layout?: MultiplexerLayout, mainPaneSize?: number);
|
|
19
|
+
isAvailable(): Promise<boolean>;
|
|
20
|
+
isInsideSession(): boolean;
|
|
21
|
+
spawnPane(sessionId: string, description: string, serverUrl: string, directory: string): Promise<PaneResult>;
|
|
22
|
+
private createPaneInAgentTab;
|
|
23
|
+
private runInPane;
|
|
24
|
+
private ensureAgentTab;
|
|
25
|
+
private getFirstPaneInTab;
|
|
26
|
+
private findTabByName;
|
|
27
|
+
private findTabByNameText;
|
|
28
|
+
private getCurrentTabId;
|
|
29
|
+
private listPanes;
|
|
30
|
+
closePane(paneId: string): Promise<boolean>;
|
|
31
|
+
applyLayout(_layout: MultiplexerLayout, _mainPaneSize: number): Promise<void>;
|
|
32
|
+
private getBinary;
|
|
33
|
+
private findBinary;
|
|
34
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CliLanguage, SgResult } from './types';
|
|
2
|
+
export interface RunOptions {
|
|
3
|
+
pattern: string;
|
|
4
|
+
lang: CliLanguage;
|
|
5
|
+
paths?: string[];
|
|
6
|
+
globs?: string[];
|
|
7
|
+
rewrite?: string;
|
|
8
|
+
context?: number;
|
|
9
|
+
updateAll?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function getAstGrepPath(): Promise<string | null>;
|
|
12
|
+
export declare function startBackgroundInit(): void;
|
|
13
|
+
export declare function runSg(options: RunOptions): Promise<SgResult>;
|
|
14
|
+
export declare function isCliAvailable(): boolean;
|
|
15
|
+
export declare function ensureCliAvailable(): Promise<boolean>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { CLI_LANGUAGES } from './types';
|
|
2
|
+
export declare function findSgCliPathSync(): string | null;
|
|
3
|
+
export declare function getSgCliPath(): string;
|
|
4
|
+
export declare function setSgCliPath(path: string): void;
|
|
5
|
+
export { CLI_LANGUAGES };
|
|
6
|
+
export declare const DEFAULT_TIMEOUT_MS = 300000;
|
|
7
|
+
export declare const DEFAULT_MAX_OUTPUT_BYTES: number;
|
|
8
|
+
export declare const DEFAULT_MAX_MATCHES = 500;
|
|
9
|
+
export declare const LANG_EXTENSIONS: Record<string, string[]>;
|
|
10
|
+
export interface EnvironmentCheckResult {
|
|
11
|
+
cli: {
|
|
12
|
+
available: boolean;
|
|
13
|
+
path: string;
|
|
14
|
+
error?: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Check if ast-grep CLI is available.
|
|
19
|
+
* Call this at startup to provide early feedback about missing dependencies.
|
|
20
|
+
*/
|
|
21
|
+
export declare function checkEnvironment(): EnvironmentCheckResult;
|
|
22
|
+
/**
|
|
23
|
+
* Format environment check result as user-friendly message.
|
|
24
|
+
*/
|
|
25
|
+
export declare function formatEnvironmentCheck(result: EnvironmentCheckResult): string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function getCacheDir(): string;
|
|
2
|
+
export declare function getBinaryName(): string;
|
|
3
|
+
export declare function getCachedBinaryPath(): string | null;
|
|
4
|
+
export declare function downloadAstGrep(version?: string): Promise<string | null>;
|
|
5
|
+
export declare function ensureAstGrepBinary(): Promise<string | null>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ToolDefinition } from '@opencode-ai/plugin';
|
|
2
|
+
import { ast_grep_replace, ast_grep_search } from './tools';
|
|
3
|
+
export declare const builtinTools: Record<string, ToolDefinition>;
|
|
4
|
+
export { ensureCliAvailable, getAstGrepPath, isCliAvailable, startBackgroundInit, } from './cli';
|
|
5
|
+
export type { EnvironmentCheckResult } from './constants';
|
|
6
|
+
export { checkEnvironment, formatEnvironmentCheck } from './constants';
|
|
7
|
+
export { ensureAstGrepBinary, getCacheDir, getCachedBinaryPath, } from './downloader';
|
|
8
|
+
export type { CliLanguage, CliMatch, SgResult } from './types';
|
|
9
|
+
export { CLI_LANGUAGES } from './types';
|
|
10
|
+
export { ast_grep_replace, ast_grep_search };
|