oh-my-opencode-slim 0.9.4 → 0.9.6
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 +5 -1
- package/dist/agents/orchestrator.d.ts +1 -0
- package/dist/cli/index.js +159 -13693
- package/dist/config/schema.d.ts +11 -0
- package/dist/hooks/auto-update-checker/index.d.ts +1 -0
- package/dist/index.js +4098 -14903
- package/dist/interview/index.d.ts +1 -0
- package/dist/interview/manager.d.ts +39 -0
- package/dist/interview/parser.d.ts +11 -0
- package/dist/interview/prompts.d.ts +7 -0
- package/dist/interview/repository.d.ts +12 -0
- package/dist/interview/schemas.d.ts +27 -0
- package/dist/interview/server.d.ts +7 -0
- package/dist/interview/service.d.ts +27 -0
- package/dist/interview/types.d.ts +46 -0
- package/dist/interview/ui.d.ts +1 -0
- package/oh-my-opencode-slim.schema.json +20 -0
- package/package.json +3 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createInterviewManager } from './manager';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { PluginInput } from '@opencode-ai/plugin';
|
|
2
|
+
import type { PluginConfig } from '../config';
|
|
3
|
+
/**
|
|
4
|
+
* Interview Manager - Composition root wiring the lean service ↔ server flow.
|
|
5
|
+
*
|
|
6
|
+
* Architecture:
|
|
7
|
+
* - Service: in-memory interview runtime + markdown document updates
|
|
8
|
+
* - Server: localhost UI + JSON API
|
|
9
|
+
* - Manager: small adapter exposing plugin hooks
|
|
10
|
+
*
|
|
11
|
+
* Dependency injection pattern:
|
|
12
|
+
* - Server depends on service.getState and service.submitAnswers
|
|
13
|
+
* - Service depends on server.ensureStarted (via setBaseUrlResolver)
|
|
14
|
+
* - Circular dependency resolved by lazy resolution
|
|
15
|
+
*
|
|
16
|
+
* Plugin integration:
|
|
17
|
+
* - registerCommand: injects /interview into OpenCode config
|
|
18
|
+
* - handleCommandExecuteBefore: intercepts /interview execution
|
|
19
|
+
* - handleEvent: listens to session.status and session.deleted events
|
|
20
|
+
*/
|
|
21
|
+
export declare function createInterviewManager(ctx: PluginInput, config: PluginConfig): {
|
|
22
|
+
registerCommand: (config: Record<string, unknown>) => void;
|
|
23
|
+
handleCommandExecuteBefore: (input: {
|
|
24
|
+
command: string;
|
|
25
|
+
sessionID: string;
|
|
26
|
+
arguments: string;
|
|
27
|
+
}, output: {
|
|
28
|
+
parts: Array<{
|
|
29
|
+
type: string;
|
|
30
|
+
text?: string;
|
|
31
|
+
}>;
|
|
32
|
+
}) => Promise<void>;
|
|
33
|
+
handleEvent: (input: {
|
|
34
|
+
event: {
|
|
35
|
+
type: string;
|
|
36
|
+
properties?: Record<string, unknown>;
|
|
37
|
+
};
|
|
38
|
+
}) => Promise<void>;
|
|
39
|
+
};
|
|
@@ -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,12 @@
|
|
|
1
|
+
import type { InterviewAssistantState, InterviewMessage, InterviewRecord, InterviewSnapshot } from './types';
|
|
2
|
+
export declare function transcriptPath(directory: string, id: string): string;
|
|
3
|
+
export declare function summaryPath(directory: string, id: string): string;
|
|
4
|
+
export declare function snapshotPath(directory: string, id: string): string;
|
|
5
|
+
export declare function ensureInterviewDirectory(directory: string): Promise<void>;
|
|
6
|
+
export declare function writeInterviewRecord(record: InterviewRecord): Promise<void>;
|
|
7
|
+
export declare function readInterviewRecord(directory: string, id: string): Promise<InterviewRecord | null>;
|
|
8
|
+
export declare function writeInterviewSnapshot(record: InterviewRecord, snapshot: InterviewSnapshot): Promise<void>;
|
|
9
|
+
export declare function readInterviewSnapshot(directory: string, id: string): Promise<InterviewSnapshot | null>;
|
|
10
|
+
export declare function findActiveInterviewBySession(directory: string, sessionID: string): Promise<InterviewRecord | null>;
|
|
11
|
+
export declare function writeTranscript(record: InterviewRecord, messages: InterviewMessage[]): Promise<void>;
|
|
12
|
+
export declare function writeSummary(record: InterviewRecord, state: InterviewAssistantState, answerCount: number): Promise<void>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const interviewQuestionSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodOptional<z.ZodString>;
|
|
4
|
+
question: z.ZodString;
|
|
5
|
+
options: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
6
|
+
suggested: z.ZodOptional<z.ZodString>;
|
|
7
|
+
area: z.ZodOptional<z.ZodString>;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export declare const interviewAssistantStateSchema: z.ZodObject<{
|
|
10
|
+
summary: z.ZodDefault<z.ZodString>;
|
|
11
|
+
clarity: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
12
|
+
criticalAreas: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
13
|
+
questions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
14
|
+
id: z.ZodOptional<z.ZodString>;
|
|
15
|
+
question: z.ZodString;
|
|
16
|
+
options: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
17
|
+
suggested: z.ZodOptional<z.ZodString>;
|
|
18
|
+
area: z.ZodOptional<z.ZodString>;
|
|
19
|
+
}, z.core.$strip>>>;
|
|
20
|
+
readyToExport: z.ZodDefault<z.ZodBoolean>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
export declare const interviewAnswersPayloadSchema: z.ZodObject<{
|
|
23
|
+
answers: z.ZodArray<z.ZodObject<{
|
|
24
|
+
questionId: z.ZodString;
|
|
25
|
+
answer: z.ZodString;
|
|
26
|
+
}, z.core.$strip>>;
|
|
27
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { InterviewAnswer, InterviewState } from './types';
|
|
2
|
+
export declare function createInterviewServer(deps: {
|
|
3
|
+
getState: (interviewId: string) => Promise<InterviewState>;
|
|
4
|
+
submitAnswers: (interviewId: string, answers: InterviewAnswer[]) => Promise<void>;
|
|
5
|
+
}): {
|
|
6
|
+
ensureStarted: () => Promise<string>;
|
|
7
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { PluginInput } from '@opencode-ai/plugin';
|
|
2
|
+
import type { InterviewConfig } from '../config';
|
|
3
|
+
import type { InterviewAnswer, InterviewState } from './types';
|
|
4
|
+
export declare function createInterviewService(ctx: PluginInput, config?: InterviewConfig, deps?: {
|
|
5
|
+
openBrowser?: (url: string) => void;
|
|
6
|
+
}): {
|
|
7
|
+
setBaseUrlResolver: (resolver: () => Promise<string>) => void;
|
|
8
|
+
registerCommand: (config: Record<string, unknown>) => void;
|
|
9
|
+
handleCommandExecuteBefore: (input: {
|
|
10
|
+
command: string;
|
|
11
|
+
sessionID: string;
|
|
12
|
+
arguments: string;
|
|
13
|
+
}, output: {
|
|
14
|
+
parts: Array<{
|
|
15
|
+
type: string;
|
|
16
|
+
text?: string;
|
|
17
|
+
}>;
|
|
18
|
+
}) => Promise<void>;
|
|
19
|
+
handleEvent: (input: {
|
|
20
|
+
event: {
|
|
21
|
+
type: string;
|
|
22
|
+
properties?: Record<string, unknown>;
|
|
23
|
+
};
|
|
24
|
+
}) => Promise<void>;
|
|
25
|
+
getInterviewState: (interviewId: string) => Promise<InterviewState>;
|
|
26
|
+
submitAnswers: (interviewId: string, answers: InterviewAnswer[]) => Promise<void>;
|
|
27
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export interface InterviewQuestion {
|
|
2
|
+
id: string;
|
|
3
|
+
question: string;
|
|
4
|
+
options: string[];
|
|
5
|
+
suggested?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface InterviewAnswer {
|
|
8
|
+
questionId: string;
|
|
9
|
+
answer: string;
|
|
10
|
+
}
|
|
11
|
+
export interface InterviewAssistantState {
|
|
12
|
+
summary: string;
|
|
13
|
+
title?: string;
|
|
14
|
+
questions: InterviewQuestion[];
|
|
15
|
+
}
|
|
16
|
+
export interface InterviewRecord {
|
|
17
|
+
id: string;
|
|
18
|
+
sessionID: string;
|
|
19
|
+
idea: string;
|
|
20
|
+
markdownPath: string;
|
|
21
|
+
createdAt: string;
|
|
22
|
+
status: 'active' | 'abandoned';
|
|
23
|
+
baseMessageCount: number;
|
|
24
|
+
}
|
|
25
|
+
export interface InterviewMessagePart {
|
|
26
|
+
type?: string;
|
|
27
|
+
text?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface InterviewMessage {
|
|
30
|
+
info?: {
|
|
31
|
+
role?: string;
|
|
32
|
+
[key: string]: unknown;
|
|
33
|
+
};
|
|
34
|
+
parts?: InterviewMessagePart[];
|
|
35
|
+
}
|
|
36
|
+
export interface InterviewState {
|
|
37
|
+
interview: InterviewRecord;
|
|
38
|
+
url: string;
|
|
39
|
+
markdownPath: string;
|
|
40
|
+
mode: 'awaiting-agent' | 'awaiting-user' | 'abandoned' | 'error';
|
|
41
|
+
lastParseError?: string;
|
|
42
|
+
isBusy: boolean;
|
|
43
|
+
summary: string;
|
|
44
|
+
questions: InterviewQuestion[];
|
|
45
|
+
document: string;
|
|
46
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function renderInterviewPage(interviewId: string): string;
|
|
@@ -413,6 +413,26 @@
|
|
|
413
413
|
}
|
|
414
414
|
}
|
|
415
415
|
},
|
|
416
|
+
"interview": {
|
|
417
|
+
"type": "object",
|
|
418
|
+
"properties": {
|
|
419
|
+
"maxQuestions": {
|
|
420
|
+
"default": 2,
|
|
421
|
+
"type": "integer",
|
|
422
|
+
"minimum": 1,
|
|
423
|
+
"maximum": 10
|
|
424
|
+
},
|
|
425
|
+
"outputFolder": {
|
|
426
|
+
"default": "interview",
|
|
427
|
+
"type": "string",
|
|
428
|
+
"minLength": 1
|
|
429
|
+
},
|
|
430
|
+
"autoOpenBrowser": {
|
|
431
|
+
"default": true,
|
|
432
|
+
"type": "boolean"
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
},
|
|
416
436
|
"todoContinuation": {
|
|
417
437
|
"type": "object",
|
|
418
438
|
"properties": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oh-my-opencode-slim",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.6",
|
|
4
4
|
"description": "Lightweight agent orchestration plugin for OpenCode - a slimmed-down fork of oh-my-opencode",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
"LICENSE"
|
|
37
37
|
],
|
|
38
38
|
"scripts": {
|
|
39
|
-
"build": "bun build src/index.ts --outdir dist --target bun --format esm && bun build src/cli/index.ts --outdir dist/cli --target bun --format esm && tsc --emitDeclarationOnly && bun run generate-schema",
|
|
39
|
+
"build": "bun build src/index.ts --outdir dist --target bun --format esm --packages external && bun build src/cli/index.ts --outdir dist/cli --target bun --format esm --packages external && tsc --emitDeclarationOnly && bun run generate-schema",
|
|
40
|
+
"prepare": "bun build src/index.ts --outdir dist --target bun --format esm --external @ast-grep/napi --external @opencode-ai/plugin --external @opencode-ai/sdk",
|
|
40
41
|
"contributors:add": "all-contributors add",
|
|
41
42
|
"contributors:check": "all-contributors check",
|
|
42
43
|
"contributors:generate": "all-contributors generate",
|