oh-my-opencode-kikokikok 2.13.0 → 2.14.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.ja.md +32 -6
- package/README.ko.md +32 -6
- package/README.md +17 -7
- package/README.zh-cn.md +32 -6
- package/dist/agents/sisyphus-prompt-builder.d.ts +1 -0
- package/dist/cli/config-manager.d.ts +9 -0
- package/dist/cli/doctor/constants.d.ts +1 -1
- package/dist/cli/index.js +371 -99
- package/dist/config/schema.d.ts +273 -0
- package/dist/features/knowledge-provider/index.d.ts +8 -0
- package/dist/features/knowledge-provider/providers/local.d.ts +18 -0
- package/dist/features/knowledge-provider/providers/local.test.d.ts +1 -0
- package/dist/features/knowledge-provider/providers/mcp.d.ts +23 -0
- package/dist/features/knowledge-provider/providers/mem0.d.ts +23 -0
- package/dist/features/knowledge-provider/providers/notebooklm.d.ts +34 -0
- package/dist/features/knowledge-provider/providers/notebooklm.test.d.ts +1 -0
- package/dist/features/knowledge-provider/registry.d.ts +22 -0
- package/dist/features/knowledge-provider/registry.test.d.ts +1 -0
- package/dist/features/knowledge-provider/types.d.ts +266 -0
- package/dist/features/knowledge-repo/client.d.ts +9 -1
- package/dist/features/knowledge-repo/index.d.ts +1 -0
- package/dist/features/knowledge-repo/sync.d.ts +35 -0
- package/dist/features/knowledge-repo/types.d.ts +55 -1
- package/dist/features/mem0-memory/types.d.ts +6 -1
- package/dist/features/openspec/client.d.ts +39 -0
- package/dist/features/openspec/client.test.d.ts +1 -0
- package/dist/features/openspec/index.d.ts +3 -0
- package/dist/features/openspec/types.d.ts +365 -0
- package/dist/features/skill-mcp-manager/env-cleaner.d.ts +2 -0
- package/dist/features/skill-mcp-manager/env-cleaner.test.d.ts +1 -0
- package/dist/features/skill-mcp-manager/manager.d.ts +8 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/knowledge-monitor/index.test.d.ts +1 -0
- package/dist/hooks/memory-rehydration/constants.d.ts +4 -0
- package/dist/hooks/memory-rehydration/index.d.ts +17 -0
- package/dist/hooks/memory-rehydration/types.d.ts +12 -0
- package/dist/hooks/openspec-commitment/index.d.ts +32 -0
- package/dist/hooks/openspec-continuity/index.d.ts +15 -0
- package/dist/hooks/ralph-loop/types.d.ts +1 -0
- package/dist/hooks/tool-output-truncator.test.d.ts +1 -0
- package/dist/index.js +3338 -607
- package/dist/shared/config-path.d.ts +2 -2
- package/dist/shared/index.d.ts +2 -0
- package/dist/shared/opencode-config-dir.d.ts +19 -0
- package/dist/shared/opencode-config-dir.test.d.ts +1 -0
- package/dist/shared/package-info.d.ts +6 -0
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/memory/constants.d.ts +5 -0
- package/dist/tools/memory/index.d.ts +2 -0
- package/dist/tools/memory/tools.d.ts +3 -0
- package/dist/tools/memory/tools.test.d.ts +1 -0
- package/dist/tools/memory/types.d.ts +6 -0
- package/package.json +1 -1
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenSpec Lifecycle System Types
|
|
3
|
+
*
|
|
4
|
+
* A structured specification and task tracking system for multi-session AI agent work.
|
|
5
|
+
* Supports proposal → design → spec → tasks → implementation → verification workflow.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Status of an OpenSpec change through its lifecycle.
|
|
9
|
+
*/
|
|
10
|
+
export type OpenSpecStatus = "proposal" | "design" | "spec" | "tasks" | "implementing" | "verify" | "done" | "cancelled";
|
|
11
|
+
/**
|
|
12
|
+
* Valid state transitions in the OpenSpec lifecycle.
|
|
13
|
+
*/
|
|
14
|
+
export declare const VALID_TRANSITIONS: Record<OpenSpecStatus, OpenSpecStatus[]>;
|
|
15
|
+
/**
|
|
16
|
+
* Task priority levels.
|
|
17
|
+
*/
|
|
18
|
+
export type TaskPriority = "high" | "medium" | "low";
|
|
19
|
+
/**
|
|
20
|
+
* Task status within an OpenSpec change.
|
|
21
|
+
*/
|
|
22
|
+
export type TaskStatus = "pending" | "in_progress" | "completed" | "blocked" | "cancelled";
|
|
23
|
+
/**
|
|
24
|
+
* Enforcement level for OpenSpec commitment.
|
|
25
|
+
*/
|
|
26
|
+
export type EnforcementLevel = "off" | "soft" | "hard";
|
|
27
|
+
/**
|
|
28
|
+
* Types of changes that may require specification.
|
|
29
|
+
*/
|
|
30
|
+
export type ChangeType = "new_feature" | "enhancement" | "bug_fix" | "refactoring" | "breaking_change" | "documentation" | "infrastructure";
|
|
31
|
+
/**
|
|
32
|
+
* Author of an OpenSpec change or amendment.
|
|
33
|
+
*/
|
|
34
|
+
export interface OpenSpecAuthor {
|
|
35
|
+
id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
type: "user" | "agent";
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Log entry for a session that worked on this change.
|
|
41
|
+
*/
|
|
42
|
+
export interface SessionLog {
|
|
43
|
+
sessionId: string;
|
|
44
|
+
startedAt: string;
|
|
45
|
+
endedAt?: string;
|
|
46
|
+
tasksCompleted: string[];
|
|
47
|
+
tasksStarted: string[];
|
|
48
|
+
notes?: string;
|
|
49
|
+
agentModel?: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* A single task within an OpenSpec change.
|
|
53
|
+
*/
|
|
54
|
+
export interface OpenSpecTask {
|
|
55
|
+
/** Unique identifier within the change */
|
|
56
|
+
id: string;
|
|
57
|
+
/** Task description */
|
|
58
|
+
content: string;
|
|
59
|
+
/** Current status */
|
|
60
|
+
status: TaskStatus;
|
|
61
|
+
/** Priority level */
|
|
62
|
+
priority: TaskPriority;
|
|
63
|
+
/** Session ID that is/was working on this task */
|
|
64
|
+
assignedSession?: string;
|
|
65
|
+
/** ISO 8601 timestamp when completed */
|
|
66
|
+
completedAt?: string;
|
|
67
|
+
/** Additional notes or context */
|
|
68
|
+
notes?: string;
|
|
69
|
+
/** Link to session todo item */
|
|
70
|
+
linkedTodoId?: string;
|
|
71
|
+
/** Estimated effort */
|
|
72
|
+
estimate?: "xs" | "s" | "m" | "l" | "xl";
|
|
73
|
+
/** Tags for categorization */
|
|
74
|
+
tags?: string[];
|
|
75
|
+
/** Blocked reason if status is 'blocked' */
|
|
76
|
+
blockedReason?: string;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Dependency between tasks.
|
|
80
|
+
*/
|
|
81
|
+
export interface TaskDependency {
|
|
82
|
+
/** Task that depends on another */
|
|
83
|
+
taskId: string;
|
|
84
|
+
/** Task that must be completed first */
|
|
85
|
+
dependsOn: string;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The tasks document stored as tasks.json.
|
|
89
|
+
*/
|
|
90
|
+
export interface TasksDocument {
|
|
91
|
+
/** Schema version */
|
|
92
|
+
version: string;
|
|
93
|
+
/** Last updated timestamp */
|
|
94
|
+
updatedAt: string;
|
|
95
|
+
/** All tasks for this change */
|
|
96
|
+
tasks: OpenSpecTask[];
|
|
97
|
+
/** Dependencies between tasks */
|
|
98
|
+
dependencies: TaskDependency[];
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* A single change within an amendment.
|
|
102
|
+
*/
|
|
103
|
+
export interface AmendmentChange {
|
|
104
|
+
/** Which section of the spec changed */
|
|
105
|
+
section: string;
|
|
106
|
+
/** Summary of previous content */
|
|
107
|
+
before: string;
|
|
108
|
+
/** Summary of new content */
|
|
109
|
+
after: string;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Impact analysis for an amendment.
|
|
113
|
+
*/
|
|
114
|
+
export interface AmendmentImpact {
|
|
115
|
+
/** Task IDs that need rework */
|
|
116
|
+
tasksAffected: string[];
|
|
117
|
+
/** Estimated effort to address the amendment */
|
|
118
|
+
estimatedEffort: "low" | "medium" | "high";
|
|
119
|
+
/** Whether this is a breaking change */
|
|
120
|
+
breaking: boolean;
|
|
121
|
+
/** Additional notes */
|
|
122
|
+
notes?: string;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* An amendment record tracking spec changes.
|
|
126
|
+
*/
|
|
127
|
+
export interface Amendment {
|
|
128
|
+
/** Sequential ID: "001", "002", etc. */
|
|
129
|
+
id: string;
|
|
130
|
+
/** ISO 8601 timestamp */
|
|
131
|
+
timestamp: string;
|
|
132
|
+
/** Who made the amendment */
|
|
133
|
+
author: OpenSpecAuthor;
|
|
134
|
+
/** Why the change was needed */
|
|
135
|
+
reason: string;
|
|
136
|
+
/** What changed */
|
|
137
|
+
changes: AmendmentChange[];
|
|
138
|
+
/** Impact analysis */
|
|
139
|
+
impactAnalysis: AmendmentImpact;
|
|
140
|
+
/** File path to full amendment markdown */
|
|
141
|
+
filePath: string;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Metadata for an OpenSpec change.
|
|
145
|
+
*/
|
|
146
|
+
export interface ChangeMetadata {
|
|
147
|
+
/** Unique identifier */
|
|
148
|
+
id: string;
|
|
149
|
+
/** Human-readable title */
|
|
150
|
+
title: string;
|
|
151
|
+
/** One-line summary */
|
|
152
|
+
summary: string;
|
|
153
|
+
/** Current status in lifecycle */
|
|
154
|
+
status: OpenSpecStatus;
|
|
155
|
+
/** Type of change */
|
|
156
|
+
changeType?: ChangeType;
|
|
157
|
+
/** ISO 8601 creation timestamp */
|
|
158
|
+
createdAt: string;
|
|
159
|
+
/** ISO 8601 last update timestamp */
|
|
160
|
+
updatedAt: string;
|
|
161
|
+
/** Original author */
|
|
162
|
+
author: OpenSpecAuthor;
|
|
163
|
+
/** Sessions that have worked on this */
|
|
164
|
+
sessions: SessionLog[];
|
|
165
|
+
/** Amendments made after spec approval */
|
|
166
|
+
amendments: Amendment[];
|
|
167
|
+
/** Tags for categorization */
|
|
168
|
+
tags: string[];
|
|
169
|
+
/** Related change IDs */
|
|
170
|
+
relatedChanges?: string[];
|
|
171
|
+
/** Link to external issue tracker */
|
|
172
|
+
externalRef?: {
|
|
173
|
+
type: "github" | "jira" | "linear" | "other";
|
|
174
|
+
id: string;
|
|
175
|
+
url?: string;
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Full change including content paths.
|
|
180
|
+
*/
|
|
181
|
+
export interface OpenSpecChange extends ChangeMetadata {
|
|
182
|
+
/** Path to proposal.md */
|
|
183
|
+
proposalPath: string;
|
|
184
|
+
/** Path to design.md (if exists) */
|
|
185
|
+
designPath?: string;
|
|
186
|
+
/** Path to spec.md (if exists) */
|
|
187
|
+
specPath?: string;
|
|
188
|
+
/** Path to tasks.json (if exists) */
|
|
189
|
+
tasksPath?: string;
|
|
190
|
+
/** Path to verification.md (if exists) */
|
|
191
|
+
verificationPath?: string;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Reference to the currently active change.
|
|
195
|
+
*/
|
|
196
|
+
export interface ActiveChange {
|
|
197
|
+
/** Change ID */
|
|
198
|
+
changeId: string;
|
|
199
|
+
/** When this change became active */
|
|
200
|
+
activatedAt: string;
|
|
201
|
+
/** Currently active task ID (if implementing) */
|
|
202
|
+
currentTaskId?: string;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Entry in the OpenSpec manifest.
|
|
206
|
+
*/
|
|
207
|
+
export interface ManifestEntry {
|
|
208
|
+
id: string;
|
|
209
|
+
title: string;
|
|
210
|
+
status: OpenSpecStatus;
|
|
211
|
+
createdAt: string;
|
|
212
|
+
updatedAt: string;
|
|
213
|
+
tasksTotal?: number;
|
|
214
|
+
tasksCompleted?: number;
|
|
215
|
+
archived: boolean;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* The OpenSpec manifest indexing all changes.
|
|
219
|
+
*/
|
|
220
|
+
export interface OpenSpecManifest {
|
|
221
|
+
/** Schema version */
|
|
222
|
+
version: string;
|
|
223
|
+
/** Last generated timestamp */
|
|
224
|
+
generatedAt: string;
|
|
225
|
+
/** Total number of changes */
|
|
226
|
+
totalCount: number;
|
|
227
|
+
/** Active changes */
|
|
228
|
+
active: ManifestEntry[];
|
|
229
|
+
/** Archived changes */
|
|
230
|
+
archived: ManifestEntry[];
|
|
231
|
+
/** Statistics */
|
|
232
|
+
stats: {
|
|
233
|
+
byStatus: Record<OpenSpecStatus, number>;
|
|
234
|
+
byChangeType: Record<ChangeType, number>;
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* OpenSpec configuration.
|
|
239
|
+
*/
|
|
240
|
+
export interface OpenSpecConfig {
|
|
241
|
+
/** Whether OpenSpec is enabled */
|
|
242
|
+
enabled: boolean;
|
|
243
|
+
/** Enforcement level */
|
|
244
|
+
enforcement: EnforcementLevel;
|
|
245
|
+
/** Change types that require specification */
|
|
246
|
+
requireSpecFor: ChangeType[];
|
|
247
|
+
/** Root directory for OpenSpec storage */
|
|
248
|
+
rootDir?: string;
|
|
249
|
+
/** Whether to auto-sync with session todos */
|
|
250
|
+
autoSyncTodos: boolean;
|
|
251
|
+
/** Maximum amendments before requiring new spec */
|
|
252
|
+
maxAmendments?: number;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Default OpenSpec configuration.
|
|
256
|
+
*/
|
|
257
|
+
export declare const DEFAULT_OPENSPEC_CONFIG: OpenSpecConfig;
|
|
258
|
+
/**
|
|
259
|
+
* Options for creating a new proposal.
|
|
260
|
+
*/
|
|
261
|
+
export interface CreateProposalOptions {
|
|
262
|
+
title: string;
|
|
263
|
+
summary: string;
|
|
264
|
+
content: string;
|
|
265
|
+
author: OpenSpecAuthor;
|
|
266
|
+
changeType?: ChangeType;
|
|
267
|
+
tags?: string[];
|
|
268
|
+
externalRef?: ChangeMetadata["externalRef"];
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Options for transitioning to a new status.
|
|
272
|
+
*/
|
|
273
|
+
export interface TransitionOptions {
|
|
274
|
+
changeId: string;
|
|
275
|
+
content?: string;
|
|
276
|
+
author: OpenSpecAuthor;
|
|
277
|
+
notes?: string;
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Options for creating an amendment.
|
|
281
|
+
*/
|
|
282
|
+
export interface CreateAmendmentOptions {
|
|
283
|
+
changeId: string;
|
|
284
|
+
reason: string;
|
|
285
|
+
changes: AmendmentChange[];
|
|
286
|
+
author: OpenSpecAuthor;
|
|
287
|
+
tasksAffected?: string[];
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Options for updating a task.
|
|
291
|
+
*/
|
|
292
|
+
export interface UpdateTaskOptions {
|
|
293
|
+
changeId: string;
|
|
294
|
+
taskId: string;
|
|
295
|
+
status?: TaskStatus;
|
|
296
|
+
notes?: string;
|
|
297
|
+
linkedTodoId?: string;
|
|
298
|
+
blockedReason?: string;
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Result of a state transition.
|
|
302
|
+
*/
|
|
303
|
+
export interface TransitionResult {
|
|
304
|
+
success: boolean;
|
|
305
|
+
change: OpenSpecChange;
|
|
306
|
+
message: string;
|
|
307
|
+
warnings?: string[];
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Filter options for querying changes.
|
|
311
|
+
*/
|
|
312
|
+
export interface OpenSpecQueryFilter {
|
|
313
|
+
/** Filter by status */
|
|
314
|
+
status?: OpenSpecStatus | OpenSpecStatus[];
|
|
315
|
+
/** Filter by change type */
|
|
316
|
+
changeType?: ChangeType | ChangeType[];
|
|
317
|
+
/** Filter by tags */
|
|
318
|
+
tags?: string[];
|
|
319
|
+
/** Include archived changes */
|
|
320
|
+
includeArchived?: boolean;
|
|
321
|
+
/** Full-text search */
|
|
322
|
+
search?: string;
|
|
323
|
+
/** Maximum results */
|
|
324
|
+
limit?: number;
|
|
325
|
+
/** Pagination offset */
|
|
326
|
+
offset?: number;
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Result of a query.
|
|
330
|
+
*/
|
|
331
|
+
export interface OpenSpecQueryResult {
|
|
332
|
+
items: OpenSpecChange[];
|
|
333
|
+
total: number;
|
|
334
|
+
hasMore: boolean;
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Events emitted by the OpenSpec system.
|
|
338
|
+
*/
|
|
339
|
+
export type OpenSpecEvent = {
|
|
340
|
+
type: "change.created";
|
|
341
|
+
change: OpenSpecChange;
|
|
342
|
+
} | {
|
|
343
|
+
type: "change.transitioned";
|
|
344
|
+
change: OpenSpecChange;
|
|
345
|
+
from: OpenSpecStatus;
|
|
346
|
+
to: OpenSpecStatus;
|
|
347
|
+
} | {
|
|
348
|
+
type: "change.amended";
|
|
349
|
+
change: OpenSpecChange;
|
|
350
|
+
amendment: Amendment;
|
|
351
|
+
} | {
|
|
352
|
+
type: "task.updated";
|
|
353
|
+
change: OpenSpecChange;
|
|
354
|
+
task: OpenSpecTask;
|
|
355
|
+
} | {
|
|
356
|
+
type: "change.activated";
|
|
357
|
+
change: OpenSpecChange;
|
|
358
|
+
} | {
|
|
359
|
+
type: "change.deactivated";
|
|
360
|
+
changeId: string;
|
|
361
|
+
};
|
|
362
|
+
/**
|
|
363
|
+
* Event listener for OpenSpec events.
|
|
364
|
+
*/
|
|
365
|
+
export type OpenSpecEventListener = (event: OpenSpecEvent) => void | Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -4,11 +4,19 @@ import type { ClaudeCodeMcpServer } from "../claude-code-mcp-loader/types";
|
|
|
4
4
|
import type { SkillMcpClientInfo, SkillMcpServerContext } from "./types";
|
|
5
5
|
export declare class SkillMcpManager {
|
|
6
6
|
private clients;
|
|
7
|
+
private pendingConnections;
|
|
8
|
+
private cleanupRegistered;
|
|
9
|
+
private cleanupInterval;
|
|
10
|
+
private readonly IDLE_TIMEOUT;
|
|
7
11
|
private getClientKey;
|
|
12
|
+
private registerProcessCleanup;
|
|
8
13
|
getOrCreateClient(info: SkillMcpClientInfo, config: ClaudeCodeMcpServer): Promise<Client>;
|
|
9
14
|
private createClient;
|
|
10
15
|
disconnectSession(sessionID: string): Promise<void>;
|
|
11
16
|
disconnectAll(): Promise<void>;
|
|
17
|
+
private startCleanupTimer;
|
|
18
|
+
private stopCleanupTimer;
|
|
19
|
+
private cleanupIdleClients;
|
|
12
20
|
listTools(info: SkillMcpClientInfo, context: SkillMcpServerContext): Promise<Tool[]>;
|
|
13
21
|
listResources(info: SkillMcpClientInfo, context: SkillMcpServerContext): Promise<Resource[]>;
|
|
14
22
|
listPrompts(info: SkillMcpClientInfo, context: SkillMcpServerContext): Promise<Prompt[]>;
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -25,3 +25,6 @@ export { createRalphLoopHook, type RalphLoopHook } from "./ralph-loop";
|
|
|
25
25
|
export { createAutoSlashCommandHook } from "./auto-slash-command";
|
|
26
26
|
export { createEditErrorRecoveryHook } from "./edit-error-recovery";
|
|
27
27
|
export { createKnowledgeMonitorHook, type KnowledgeMonitorHook, type KnowledgeMonitorConfig } from "./knowledge-monitor";
|
|
28
|
+
export { createMemoryRehydrationHook, type MemoryRehydrationHook, type MemoryRehydrationConfig } from "./memory-rehydration";
|
|
29
|
+
export { createOpenSpecContinuityHook } from "./openspec-continuity";
|
|
30
|
+
export { createOpenSpecCommitmentHook } from "./openspec-commitment";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const HOOK_NAME = "memory-rehydration";
|
|
2
|
+
export declare const DEFAULT_REHYDRATE_LAYERS: readonly ["user", "project", "team"];
|
|
3
|
+
export declare const DEFAULT_MEMORY_LIMIT = 20;
|
|
4
|
+
export declare const REHYDRATION_PROMPT_HEADER = "[MEMORY REHYDRATION - Relevant memories from previous sessions]\n\nThe following memories have been retrieved from persistent storage. These represent learned patterns, preferences, and context from past interactions.\n";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Mem0Adapter } from "../../features/mem0-memory/adapter";
|
|
2
|
+
import type { MemoryRehydrationConfig, RehydrationResult } from "./types";
|
|
3
|
+
import { HOOK_NAME } from "./constants";
|
|
4
|
+
export interface MemoryRehydrationHook {
|
|
5
|
+
event: (input: {
|
|
6
|
+
event: {
|
|
7
|
+
type: string;
|
|
8
|
+
properties?: unknown;
|
|
9
|
+
};
|
|
10
|
+
}) => Promise<void>;
|
|
11
|
+
getRehydrationPrompt: (sessionID: string) => Promise<string | null>;
|
|
12
|
+
forceRehydrate: (sessionID: string) => Promise<RehydrationResult>;
|
|
13
|
+
clearSession: (sessionID: string) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare function createMemoryRehydrationHook(adapter: Mem0Adapter, config?: MemoryRehydrationConfig): MemoryRehydrationHook;
|
|
16
|
+
export { HOOK_NAME };
|
|
17
|
+
export type { MemoryRehydrationConfig } from "./types";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { MemoryLayer } from "../../features/mem0-memory/types";
|
|
2
|
+
export interface MemoryRehydrationConfig {
|
|
3
|
+
enabled?: boolean;
|
|
4
|
+
layers?: MemoryLayer[];
|
|
5
|
+
limit?: number;
|
|
6
|
+
threshold?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface RehydrationResult {
|
|
9
|
+
count: number;
|
|
10
|
+
layers: MemoryLayer[];
|
|
11
|
+
injected: boolean;
|
|
12
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
import { type EnforcementLevel, type ChangeType } from "../../features/openspec";
|
|
3
|
+
interface OpenSpecCommitmentConfig {
|
|
4
|
+
enforcement: EnforcementLevel;
|
|
5
|
+
requireSpecFor: ChangeType[];
|
|
6
|
+
}
|
|
7
|
+
interface ToolExecuteInput {
|
|
8
|
+
tool: string;
|
|
9
|
+
sessionID: string;
|
|
10
|
+
}
|
|
11
|
+
interface ToolExecuteBeforeOutput {
|
|
12
|
+
args?: unknown;
|
|
13
|
+
blocked?: boolean;
|
|
14
|
+
message?: string;
|
|
15
|
+
}
|
|
16
|
+
interface UserPromptSubmitInput {
|
|
17
|
+
sessionID: string;
|
|
18
|
+
prompt: string;
|
|
19
|
+
}
|
|
20
|
+
interface UserPromptSubmitOutput {
|
|
21
|
+
blocked?: boolean;
|
|
22
|
+
message?: string;
|
|
23
|
+
messages?: Array<{
|
|
24
|
+
role: "user" | "assistant";
|
|
25
|
+
content: string;
|
|
26
|
+
}>;
|
|
27
|
+
}
|
|
28
|
+
export declare function createOpenSpecCommitmentHook(ctx: PluginInput, config: OpenSpecCommitmentConfig): {
|
|
29
|
+
PreToolUse: (input: ToolExecuteInput) => Promise<ToolExecuteBeforeOutput>;
|
|
30
|
+
UserPromptSubmit: (input: UserPromptSubmitInput) => Promise<UserPromptSubmitOutput>;
|
|
31
|
+
};
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
interface UserPromptSubmitInput {
|
|
3
|
+
sessionID: string;
|
|
4
|
+
prompt: string;
|
|
5
|
+
}
|
|
6
|
+
interface UserPromptSubmitOutput {
|
|
7
|
+
messages?: Array<{
|
|
8
|
+
role: "user" | "assistant";
|
|
9
|
+
content: string;
|
|
10
|
+
}>;
|
|
11
|
+
}
|
|
12
|
+
export declare function createOpenSpecContinuityHook(ctx: PluginInput): {
|
|
13
|
+
UserPromptSubmit: (input: UserPromptSubmitInput) => Promise<UserPromptSubmitOutput>;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|