opencode-cc10x 6.0.23 → 6.0.24
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/dist/index.js +25 -20
- package/opencode.json +0 -18
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -459,7 +459,7 @@ ${(/* @__PURE__ */ new Date()).toISOString()}
|
|
|
459
459
|
try {
|
|
460
460
|
await readFile(input, path);
|
|
461
461
|
const currentContent = await readFile(input, path);
|
|
462
|
-
await editFile(input, {
|
|
462
|
+
await editFile(input, path, {
|
|
463
463
|
oldString: currentContent,
|
|
464
464
|
newString: content
|
|
465
465
|
});
|
|
@@ -1195,7 +1195,6 @@ var workflowExecutor = new WorkflowExecutor();
|
|
|
1195
1195
|
// src/router.ts
|
|
1196
1196
|
async function cc10xRouter(input) {
|
|
1197
1197
|
await memoryManager.initialize(input);
|
|
1198
|
-
const activeWorkflows = /* @__PURE__ */ new Map();
|
|
1199
1198
|
const routerHooks = {
|
|
1200
1199
|
// Main message interceptor - this is where cc10x magic happens
|
|
1201
1200
|
messageReceived: async (input2, output) => {
|
|
@@ -1210,7 +1209,8 @@ async function cc10xRouter(input) {
|
|
|
1210
1209
|
return;
|
|
1211
1210
|
}
|
|
1212
1211
|
const memory = await memoryManager.load(input2);
|
|
1213
|
-
const
|
|
1212
|
+
const intentResult = detectIntent(userMessage, memory);
|
|
1213
|
+
const intent = intentResult.intent;
|
|
1214
1214
|
const workflowTask = await taskOrchestrator.createWorkflowTask(input2, {
|
|
1215
1215
|
userRequest: userMessage,
|
|
1216
1216
|
intent,
|
|
@@ -1244,8 +1244,8 @@ async function cc10xRouter(input) {
|
|
|
1244
1244
|
toolExecuteAfter: async (input2, output) => {
|
|
1245
1245
|
if (output.exitCode !== void 0) {
|
|
1246
1246
|
await taskOrchestrator.recordExecutionResult(input2, {
|
|
1247
|
-
tool: input2.tool,
|
|
1248
|
-
command: input2.args?.command,
|
|
1247
|
+
tool: input2.tool || "unknown",
|
|
1248
|
+
command: String(input2.args?.command || ""),
|
|
1249
1249
|
exitCode: output.exitCode,
|
|
1250
1250
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1251
1251
|
});
|
|
@@ -1278,22 +1278,17 @@ async function cc10xRouter(input) {
|
|
|
1278
1278
|
return "Please provide a task description.";
|
|
1279
1279
|
}
|
|
1280
1280
|
console.log(`\u{1F680} Manual cc10x invocation: ${request}`);
|
|
1281
|
-
const syntheticMessage = {
|
|
1282
|
-
id: `manual-${Date.now()}`,
|
|
1283
|
-
content: request,
|
|
1284
|
-
role: "user",
|
|
1285
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1286
|
-
};
|
|
1287
1281
|
try {
|
|
1288
|
-
await routerHooks.messageReceived(context,
|
|
1282
|
+
await routerHooks.messageReceived({ args: { message: request }, ...context }, {});
|
|
1289
1283
|
return `\u2705 cc10x orchestration started for: ${request}`;
|
|
1290
1284
|
} catch (error) {
|
|
1291
1285
|
console.error("Manual invocation failed:", error);
|
|
1292
|
-
|
|
1286
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
1287
|
+
return `\u274C cc10x orchestration failed: ${message}`;
|
|
1293
1288
|
}
|
|
1294
1289
|
}
|
|
1295
1290
|
};
|
|
1296
|
-
return
|
|
1291
|
+
return routerHooks;
|
|
1297
1292
|
}
|
|
1298
1293
|
function isDevelopmentIntent(message) {
|
|
1299
1294
|
const devKeywords = [
|
|
@@ -1365,14 +1360,24 @@ function isMemoryOperation(input) {
|
|
|
1365
1360
|
];
|
|
1366
1361
|
return memoryPaths.some((path) => filePath.includes(path));
|
|
1367
1362
|
}
|
|
1368
|
-
async function enforceTDDRequirements(
|
|
1363
|
+
async function enforceTDDRequirements(_ctx, _input) {
|
|
1369
1364
|
}
|
|
1370
|
-
async function validateMemoryOperation(
|
|
1365
|
+
async function validateMemoryOperation(_ctx, _input) {
|
|
1371
1366
|
}
|
|
1372
1367
|
async function checkForActiveWorkflow(ctx) {
|
|
1373
|
-
|
|
1368
|
+
const active = await taskOrchestrator.checkForActiveWorkflows(ctx);
|
|
1369
|
+
if (!active) {
|
|
1370
|
+
return null;
|
|
1371
|
+
}
|
|
1372
|
+
return {
|
|
1373
|
+
id: active.id,
|
|
1374
|
+
type: active.type,
|
|
1375
|
+
status: "in_progress",
|
|
1376
|
+
startedAt: active.createdAt,
|
|
1377
|
+
userRequest: active.userRequest
|
|
1378
|
+
};
|
|
1374
1379
|
}
|
|
1375
|
-
async function resumeWorkflow(workflow, userMessage,
|
|
1380
|
+
async function resumeWorkflow(workflow, userMessage, _ctx) {
|
|
1376
1381
|
}
|
|
1377
1382
|
function extractMemoryNotes(result) {
|
|
1378
1383
|
if (typeof result === "string") {
|
|
@@ -1400,13 +1405,13 @@ function extractMemoryNotes(result) {
|
|
|
1400
1405
|
|
|
1401
1406
|
// src/index.ts
|
|
1402
1407
|
var OpenCodeCC10xPlugin = async (input) => {
|
|
1403
|
-
console.log("\u{1F50C} OpenCode cc10x Plugin v6.0.
|
|
1408
|
+
console.log("\u{1F50C} OpenCode cc10x Plugin v6.0.24 initializing...");
|
|
1404
1409
|
const { $ } = input;
|
|
1405
1410
|
const routerHook = await cc10xRouter({ ...input, $ });
|
|
1406
1411
|
return {
|
|
1407
1412
|
name: "opencode-cc10x",
|
|
1408
1413
|
description: "Intelligent orchestration system for OpenCode - port of cc10x from Claude Code",
|
|
1409
|
-
version: "6.0.
|
|
1414
|
+
version: "6.0.24",
|
|
1410
1415
|
hooks: {
|
|
1411
1416
|
// Router hook that intercepts user requests and orchestrates workflows
|
|
1412
1417
|
"message.received": routerHook.messageReceived,
|
package/opencode.json
CHANGED
|
@@ -96,23 +96,5 @@
|
|
|
96
96
|
"webfetch": true
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
},
|
|
100
|
-
"permission": {
|
|
101
|
-
"bash": {
|
|
102
|
-
"mkdir -p .claude/cc10x": "allow",
|
|
103
|
-
"git status": "allow",
|
|
104
|
-
"git diff": "allow",
|
|
105
|
-
"git log": "allow",
|
|
106
|
-
"npm test": "allow",
|
|
107
|
-
"yarn test": "allow",
|
|
108
|
-
"bun test": "allow",
|
|
109
|
-
"npm start": "allow",
|
|
110
|
-
"*": "ask"
|
|
111
|
-
},
|
|
112
|
-
"edit": "allow",
|
|
113
|
-
"write": "allow",
|
|
114
|
-
"skill": {
|
|
115
|
-
"cc10x:*": "allow"
|
|
116
|
-
}
|
|
117
99
|
}
|
|
118
100
|
}
|