opencode-manifold 0.4.11 → 0.4.12
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 +0 -494
- package/package.json +1 -1
- package/src/templates/manifold/settings.json +2 -0
package/dist/index.js
CHANGED
|
@@ -4195,484 +4195,6 @@ ${testResult.result.output}`,
|
|
|
4195
4195
|
}
|
|
4196
4196
|
});
|
|
4197
4197
|
|
|
4198
|
-
// src/tools/set-subagent-model.ts
|
|
4199
|
-
import { readFile as readFile5, writeFile as writeFile5, readdir as readdir3 } from "fs/promises";
|
|
4200
|
-
import { existsSync as existsSync6 } from "fs";
|
|
4201
|
-
import { join as join6 } from "path";
|
|
4202
|
-
import { homedir as homedir2 } from "os";
|
|
4203
|
-
var MANIFOLD_AGENTS = ["clerk", "senior-dev", "junior-dev", "debug"];
|
|
4204
|
-
async function getManifoldAgents(directory) {
|
|
4205
|
-
const agentsDir = join6(directory, ".opencode", "agents");
|
|
4206
|
-
if (!existsSync6(agentsDir)) {
|
|
4207
|
-
return [];
|
|
4208
|
-
}
|
|
4209
|
-
const files = await readdir3(agentsDir);
|
|
4210
|
-
const agents = [];
|
|
4211
|
-
for (const file of files) {
|
|
4212
|
-
if (!file.endsWith(".md"))
|
|
4213
|
-
continue;
|
|
4214
|
-
const name = file.replace(".md", "");
|
|
4215
|
-
if (MANIFOLD_AGENTS.includes(name)) {
|
|
4216
|
-
agents.push(name);
|
|
4217
|
-
}
|
|
4218
|
-
}
|
|
4219
|
-
return agents;
|
|
4220
|
-
}
|
|
4221
|
-
async function getAvailableModels(client) {
|
|
4222
|
-
try {
|
|
4223
|
-
const result = await client.config.providers();
|
|
4224
|
-
const providers = result.data?.providers || [];
|
|
4225
|
-
const models = [];
|
|
4226
|
-
for (const provider of providers) {
|
|
4227
|
-
if (provider.models) {
|
|
4228
|
-
for (const [modelId, model] of Object.entries(provider.models)) {
|
|
4229
|
-
models.push({
|
|
4230
|
-
id: `${provider.id}/${modelId}`,
|
|
4231
|
-
name: model.name || modelId,
|
|
4232
|
-
providerID: provider.id
|
|
4233
|
-
});
|
|
4234
|
-
}
|
|
4235
|
-
}
|
|
4236
|
-
}
|
|
4237
|
-
return models.sort((a, b) => a.name.localeCompare(b.name));
|
|
4238
|
-
} catch (error) {
|
|
4239
|
-
await client.app.log({
|
|
4240
|
-
body: {
|
|
4241
|
-
service: "opencode-manifold",
|
|
4242
|
-
level: "error",
|
|
4243
|
-
message: `Error fetching models: ${error}`
|
|
4244
|
-
}
|
|
4245
|
-
});
|
|
4246
|
-
return [];
|
|
4247
|
-
}
|
|
4248
|
-
}
|
|
4249
|
-
async function readAgentFile(agentName, directory) {
|
|
4250
|
-
const agentPath = join6(directory, ".opencode", "agents", `${agentName}.md`);
|
|
4251
|
-
if (!existsSync6(agentPath)) {
|
|
4252
|
-
const globalPath = join6(homedir2(), ".config", "opencode", "manifold", "agents", `${agentName}.md`);
|
|
4253
|
-
if (existsSync6(globalPath)) {
|
|
4254
|
-
const content2 = await readFile5(globalPath, "utf-8");
|
|
4255
|
-
const { frontmatter: frontmatter2, body: body2 } = parseFrontmatter(content2);
|
|
4256
|
-
return { content: content2, frontmatter: frontmatter2, body: body2 };
|
|
4257
|
-
}
|
|
4258
|
-
throw new Error(`Agent file not found for ${agentName}`);
|
|
4259
|
-
}
|
|
4260
|
-
const content = await readFile5(agentPath, "utf-8");
|
|
4261
|
-
const { frontmatter, body } = parseFrontmatter(content);
|
|
4262
|
-
return { content, frontmatter, body };
|
|
4263
|
-
}
|
|
4264
|
-
function parseFrontmatter(content) {
|
|
4265
|
-
const match = content.match(/^---\n([\s\S]*?)\n---\n([\s\S]*)$/);
|
|
4266
|
-
if (!match) {
|
|
4267
|
-
return { frontmatter: {}, body: content };
|
|
4268
|
-
}
|
|
4269
|
-
const frontmatterYaml = match[1];
|
|
4270
|
-
const body = match[2];
|
|
4271
|
-
const frontmatter = jsYaml.load(frontmatterYaml) || {};
|
|
4272
|
-
return { frontmatter, body };
|
|
4273
|
-
}
|
|
4274
|
-
function buildAgentFile(frontmatter, body) {
|
|
4275
|
-
const yamlContent = jsYaml.dump(frontmatter, {
|
|
4276
|
-
lineWidth: -1,
|
|
4277
|
-
noCompatMode: true
|
|
4278
|
-
});
|
|
4279
|
-
return `---
|
|
4280
|
-
${yamlContent}---
|
|
4281
|
-
${body}`;
|
|
4282
|
-
}
|
|
4283
|
-
async function updateAgentModel(client, agentName, modelId, directory) {
|
|
4284
|
-
const { frontmatter, body } = await readAgentFile(agentName, directory);
|
|
4285
|
-
frontmatter.model = modelId;
|
|
4286
|
-
const newContent = buildAgentFile(frontmatter, body);
|
|
4287
|
-
const agentPath = join6(directory, ".opencode", "agents", `${agentName}.md`);
|
|
4288
|
-
await writeFile5(agentPath, newContent);
|
|
4289
|
-
await client.app.log({
|
|
4290
|
-
body: {
|
|
4291
|
-
service: "opencode-manifold",
|
|
4292
|
-
level: "info",
|
|
4293
|
-
message: `Updated ${agentName} model to ${modelId}`
|
|
4294
|
-
}
|
|
4295
|
-
});
|
|
4296
|
-
}
|
|
4297
|
-
async function handleSubModelCommand(client, directory) {
|
|
4298
|
-
await client.app.log({
|
|
4299
|
-
body: {
|
|
4300
|
-
service: "opencode-manifold",
|
|
4301
|
-
level: "info",
|
|
4302
|
-
message: "Starting /sub-model command"
|
|
4303
|
-
}
|
|
4304
|
-
});
|
|
4305
|
-
const agents = await getManifoldAgents(directory);
|
|
4306
|
-
if (agents.length === 0) {
|
|
4307
|
-
await client.tui.showToast({
|
|
4308
|
-
body: {
|
|
4309
|
-
type: "error",
|
|
4310
|
-
message: "No Manifold agents found. Run /manifold-init first."
|
|
4311
|
-
}
|
|
4312
|
-
});
|
|
4313
|
-
return;
|
|
4314
|
-
}
|
|
4315
|
-
const models = await getAvailableModels(client);
|
|
4316
|
-
if (models.length === 0) {
|
|
4317
|
-
await client.tui.showToast({
|
|
4318
|
-
body: {
|
|
4319
|
-
type: "error",
|
|
4320
|
-
message: "No models available. Configure providers first."
|
|
4321
|
-
}
|
|
4322
|
-
});
|
|
4323
|
-
return;
|
|
4324
|
-
}
|
|
4325
|
-
const agentList = agents.map((a) => `${a} (sub-agent)`).join(`
|
|
4326
|
-
`);
|
|
4327
|
-
await client.tui.appendPrompt({
|
|
4328
|
-
body: {
|
|
4329
|
-
type: "text",
|
|
4330
|
-
text: `\uD83D\uDCCB Select a Manifold sub-agent to configure:
|
|
4331
|
-
|
|
4332
|
-
${agentList}`
|
|
4333
|
-
}
|
|
4334
|
-
});
|
|
4335
|
-
await client.tui.publish({
|
|
4336
|
-
body: {
|
|
4337
|
-
type: "tui.prompt_append",
|
|
4338
|
-
data: {
|
|
4339
|
-
type: "text",
|
|
4340
|
-
text: `
|
|
4341
|
-
|
|
4342
|
-
Type the agent name (clerk, senior-dev, junior-dev, or debug): `
|
|
4343
|
-
}
|
|
4344
|
-
}
|
|
4345
|
-
});
|
|
4346
|
-
const agentResponse = await client.tui.control.next();
|
|
4347
|
-
const selectedAgent = agentResponse.data?.input?.trim().toLowerCase();
|
|
4348
|
-
if (!selectedAgent || !MANIFOLD_AGENTS.includes(selectedAgent)) {
|
|
4349
|
-
await client.tui.showToast({
|
|
4350
|
-
body: {
|
|
4351
|
-
type: "error",
|
|
4352
|
-
message: `Invalid agent selection. Must be one of: ${MANIFOLD_AGENTS.join(", ")}`
|
|
4353
|
-
}
|
|
4354
|
-
});
|
|
4355
|
-
return;
|
|
4356
|
-
}
|
|
4357
|
-
if (!agents.includes(selectedAgent)) {
|
|
4358
|
-
await client.tui.showToast({
|
|
4359
|
-
body: {
|
|
4360
|
-
type: "error",
|
|
4361
|
-
message: `Agent ${selectedAgent} not found in .opencode/agents/`
|
|
4362
|
-
}
|
|
4363
|
-
});
|
|
4364
|
-
return;
|
|
4365
|
-
}
|
|
4366
|
-
const currentModel = await readAgentFile(selectedAgent, directory).then((f) => f.frontmatter.model || "not set");
|
|
4367
|
-
const modelList = models.map((m, i2) => `${i2 + 1}. ${m.name} (${m.id})`).join(`
|
|
4368
|
-
`);
|
|
4369
|
-
await client.tui.appendPrompt({
|
|
4370
|
-
body: {
|
|
4371
|
-
type: "text",
|
|
4372
|
-
text: `
|
|
4373
|
-
\uD83D\uDCE6 Available models for ${selectedAgent} (current: ${currentModel}):
|
|
4374
|
-
|
|
4375
|
-
${modelList}`
|
|
4376
|
-
}
|
|
4377
|
-
});
|
|
4378
|
-
await client.tui.publish({
|
|
4379
|
-
body: {
|
|
4380
|
-
type: "tui.prompt_append",
|
|
4381
|
-
data: {
|
|
4382
|
-
type: "text",
|
|
4383
|
-
text: `
|
|
4384
|
-
|
|
4385
|
-
Type the model number or full model ID (e.g., anthropic/claude-sonnet-4-20250514): `
|
|
4386
|
-
}
|
|
4387
|
-
}
|
|
4388
|
-
});
|
|
4389
|
-
const modelResponse = await client.tui.control.next();
|
|
4390
|
-
const selectedModelInput = modelResponse.data?.input?.trim();
|
|
4391
|
-
if (!selectedModelInput) {
|
|
4392
|
-
await client.tui.showToast({
|
|
4393
|
-
body: {
|
|
4394
|
-
type: "error",
|
|
4395
|
-
message: "No model selected"
|
|
4396
|
-
}
|
|
4397
|
-
});
|
|
4398
|
-
return;
|
|
4399
|
-
}
|
|
4400
|
-
let selectedModelId;
|
|
4401
|
-
const modelIndex = parseInt(selectedModelInput, 10) - 1;
|
|
4402
|
-
if (!isNaN(modelIndex) && modelIndex >= 0 && modelIndex < models.length) {
|
|
4403
|
-
selectedModelId = models[modelIndex].id;
|
|
4404
|
-
} else {
|
|
4405
|
-
const found = models.find((m) => m.id.toLowerCase() === selectedModelInput.toLowerCase());
|
|
4406
|
-
if (found) {
|
|
4407
|
-
selectedModelId = found.id;
|
|
4408
|
-
}
|
|
4409
|
-
}
|
|
4410
|
-
if (!selectedModelId) {
|
|
4411
|
-
await client.tui.showToast({
|
|
4412
|
-
body: {
|
|
4413
|
-
type: "error",
|
|
4414
|
-
message: `Invalid model selection: ${selectedModelInput}`
|
|
4415
|
-
}
|
|
4416
|
-
});
|
|
4417
|
-
return;
|
|
4418
|
-
}
|
|
4419
|
-
await updateAgentModel(client, selectedAgent, selectedModelId, directory);
|
|
4420
|
-
await client.tui.showToast({
|
|
4421
|
-
body: {
|
|
4422
|
-
type: "success",
|
|
4423
|
-
message: `✅ Set ${selectedAgent} to ${selectedModelId}`
|
|
4424
|
-
}
|
|
4425
|
-
});
|
|
4426
|
-
await client.tui.appendPrompt({
|
|
4427
|
-
body: {
|
|
4428
|
-
type: "text",
|
|
4429
|
-
text: `
|
|
4430
|
-
✅ Model updated for ${selectedAgent}: ${selectedModelId}
|
|
4431
|
-
`
|
|
4432
|
-
}
|
|
4433
|
-
});
|
|
4434
|
-
}
|
|
4435
|
-
|
|
4436
|
-
// src/tools/clear-cache.ts
|
|
4437
|
-
import { rm } from "fs/promises";
|
|
4438
|
-
import { existsSync as existsSync7 } from "fs";
|
|
4439
|
-
import { join as join7, isAbsolute } from "path";
|
|
4440
|
-
import { homedir as homedir3 } from "os";
|
|
4441
|
-
var PROTECTED_PATHS = [
|
|
4442
|
-
"/",
|
|
4443
|
-
"/System",
|
|
4444
|
-
"/Applications",
|
|
4445
|
-
"/Users",
|
|
4446
|
-
"/etc",
|
|
4447
|
-
"/bin",
|
|
4448
|
-
"/sbin",
|
|
4449
|
-
"/usr"
|
|
4450
|
-
];
|
|
4451
|
-
function resolvePath(pathStr) {
|
|
4452
|
-
const expanded = pathStr.startsWith("~") ? join7(homedir3(), pathStr.slice(1)) : pathStr;
|
|
4453
|
-
return isAbsolute(expanded) ? expanded : join7(process.cwd(), expanded);
|
|
4454
|
-
}
|
|
4455
|
-
function isPathSafe(pathStr) {
|
|
4456
|
-
const normalized = pathStr.toLowerCase();
|
|
4457
|
-
if (normalized.includes("*")) {
|
|
4458
|
-
return { safe: false, reason: "Wildcards are not allowed for safety" };
|
|
4459
|
-
}
|
|
4460
|
-
for (const protectedPath of PROTECTED_PATHS) {
|
|
4461
|
-
if (normalized === protectedPath.toLowerCase() || normalized.startsWith(protectedPath.toLowerCase() + "/") || normalized.startsWith(protectedPath.toLowerCase() + "\\")) {
|
|
4462
|
-
return { safe: false, reason: `Cannot delete protected system path: ${protectedPath}` };
|
|
4463
|
-
}
|
|
4464
|
-
}
|
|
4465
|
-
if (normalized === homedir3().toLowerCase() || normalized.startsWith(homedir3().toLowerCase() + "/") && !normalized.includes("cache") && !normalized.includes("node_modules")) {
|
|
4466
|
-
const parts = normalized.replace(homedir3().toLowerCase(), "").split(/[\/\\]/).filter(Boolean);
|
|
4467
|
-
if (parts.length === 1) {
|
|
4468
|
-
return { safe: false, reason: "Cannot delete directories directly in home folder" };
|
|
4469
|
-
}
|
|
4470
|
-
}
|
|
4471
|
-
return { safe: true };
|
|
4472
|
-
}
|
|
4473
|
-
async function isProjectDirectory(pathStr) {
|
|
4474
|
-
try {
|
|
4475
|
-
const hasGit = existsSync7(join7(pathStr, ".git"));
|
|
4476
|
-
const hasOpencodeConfig = existsSync7(join7(pathStr, "opencode.json"));
|
|
4477
|
-
const hasPackageJson = existsSync7(join7(pathStr, "package.json"));
|
|
4478
|
-
if (hasGit && (hasOpencodeConfig || hasPackageJson)) {
|
|
4479
|
-
return true;
|
|
4480
|
-
}
|
|
4481
|
-
const entries = await Promise.all([
|
|
4482
|
-
existsSync7(join7(pathStr, ".git")) ? "git" : null,
|
|
4483
|
-
existsSync7(join7(pathStr, "opencode.json")) ? "opencode" : null
|
|
4484
|
-
].filter(Boolean));
|
|
4485
|
-
return entries.length >= 2;
|
|
4486
|
-
} catch {
|
|
4487
|
-
return false;
|
|
4488
|
-
}
|
|
4489
|
-
}
|
|
4490
|
-
async function clearCachePaths(paths) {
|
|
4491
|
-
const cleared = [];
|
|
4492
|
-
const skipped = [];
|
|
4493
|
-
const blocked = [];
|
|
4494
|
-
for (const pathStr of paths) {
|
|
4495
|
-
const resolved = resolvePath(pathStr);
|
|
4496
|
-
const safetyCheck = isPathSafe(resolved);
|
|
4497
|
-
if (!safetyCheck.safe) {
|
|
4498
|
-
blocked.push({ path: resolved, reason: safetyCheck.reason || "Failed safety check" });
|
|
4499
|
-
continue;
|
|
4500
|
-
}
|
|
4501
|
-
if (!existsSync7(resolved)) {
|
|
4502
|
-
skipped.push(resolved);
|
|
4503
|
-
continue;
|
|
4504
|
-
}
|
|
4505
|
-
const isProject = await isProjectDirectory(resolved);
|
|
4506
|
-
if (isProject) {
|
|
4507
|
-
blocked.push({ path: resolved, reason: "Appears to be a project directory (contains .git + config files)" });
|
|
4508
|
-
continue;
|
|
4509
|
-
}
|
|
4510
|
-
try {
|
|
4511
|
-
await rm(resolved, { recursive: true, force: true });
|
|
4512
|
-
cleared.push(resolved);
|
|
4513
|
-
} catch (error) {
|
|
4514
|
-
blocked.push({ path: resolved, reason: `Failed to delete: ${error}` });
|
|
4515
|
-
}
|
|
4516
|
-
}
|
|
4517
|
-
return { cleared, skipped, blocked };
|
|
4518
|
-
}
|
|
4519
|
-
async function handleUpdateCommand(client, directory) {
|
|
4520
|
-
await client.app.log({
|
|
4521
|
-
body: {
|
|
4522
|
-
service: "opencode-manifold",
|
|
4523
|
-
level: "info",
|
|
4524
|
-
message: "Starting /manifold-update command"
|
|
4525
|
-
}
|
|
4526
|
-
});
|
|
4527
|
-
const settings = await readSettings(directory);
|
|
4528
|
-
const configuredPaths = settings.updateCachePaths || [];
|
|
4529
|
-
if (configuredPaths.length === 0) {
|
|
4530
|
-
const examplePaths = [
|
|
4531
|
-
"~/.cache/opencode/packages/opencode-manifold@latest",
|
|
4532
|
-
"~/node_modules/opencode-manifold"
|
|
4533
|
-
];
|
|
4534
|
-
await client.tui.appendPrompt({
|
|
4535
|
-
body: {
|
|
4536
|
-
type: "text",
|
|
4537
|
-
text: `\uD83D\uDD04 **Manifold Plugin Update**
|
|
4538
|
-
|
|
4539
|
-
No cache paths configured in \`Manifold/settings.json\`.
|
|
4540
|
-
|
|
4541
|
-
To enable this feature, add cache paths to your settings:
|
|
4542
|
-
|
|
4543
|
-
\`\`\`json
|
|
4544
|
-
{
|
|
4545
|
-
"updateCachePaths": [
|
|
4546
|
-
"~/.cache/opencode/packages/opencode-manifold@latest",
|
|
4547
|
-
"~/node_modules/opencode-manifold"
|
|
4548
|
-
]
|
|
4549
|
-
}
|
|
4550
|
-
\`\`\`
|
|
4551
|
-
|
|
4552
|
-
**Safety features:**
|
|
4553
|
-
• Wildcards are blocked
|
|
4554
|
-
• System directories are protected
|
|
4555
|
-
• Project directories (with .git + config) are protected
|
|
4556
|
-
|
|
4557
|
-
**macOS users:** The paths above are typical cache locations.
|
|
4558
|
-
**Linux/Windows users:** Add your opencode cache paths manually.
|
|
4559
|
-
`
|
|
4560
|
-
}
|
|
4561
|
-
});
|
|
4562
|
-
await client.tui.showToast({
|
|
4563
|
-
body: {
|
|
4564
|
-
type: "info",
|
|
4565
|
-
message: "Configure updateCachePaths in Manifold/settings.json"
|
|
4566
|
-
}
|
|
4567
|
-
});
|
|
4568
|
-
return;
|
|
4569
|
-
}
|
|
4570
|
-
const resolvedPaths = configuredPaths.map(resolvePath);
|
|
4571
|
-
await client.tui.appendPrompt({
|
|
4572
|
-
body: {
|
|
4573
|
-
type: "text",
|
|
4574
|
-
text: `\uD83D\uDD04 **Manifold Plugin Update**
|
|
4575
|
-
|
|
4576
|
-
The following paths will be cleared:
|
|
4577
|
-
|
|
4578
|
-
${resolvedPaths.map((p) => `• ${p}`).join(`
|
|
4579
|
-
`)}
|
|
4580
|
-
|
|
4581
|
-
⚠️ **This action is irreversible.** These paths are read from \`Manifold/settings.json\`.
|
|
4582
|
-
`
|
|
4583
|
-
}
|
|
4584
|
-
});
|
|
4585
|
-
await client.tui.publish({
|
|
4586
|
-
body: {
|
|
4587
|
-
type: "tui.prompt_append",
|
|
4588
|
-
data: {
|
|
4589
|
-
type: "text",
|
|
4590
|
-
text: `
|
|
4591
|
-
|
|
4592
|
-
Type 'yes' to confirm and clear cache: `
|
|
4593
|
-
}
|
|
4594
|
-
}
|
|
4595
|
-
});
|
|
4596
|
-
const response = await client.tui.control.next();
|
|
4597
|
-
const answer = response.data?.input?.trim().toLowerCase();
|
|
4598
|
-
if (answer !== "yes" && answer !== "y") {
|
|
4599
|
-
await client.tui.appendPrompt({
|
|
4600
|
-
body: {
|
|
4601
|
-
type: "text",
|
|
4602
|
-
text: `
|
|
4603
|
-
❌ Cancelled. No cache cleared.
|
|
4604
|
-
`
|
|
4605
|
-
}
|
|
4606
|
-
});
|
|
4607
|
-
return;
|
|
4608
|
-
}
|
|
4609
|
-
const { cleared, skipped, blocked } = await clearCachePaths(configuredPaths);
|
|
4610
|
-
let message = `
|
|
4611
|
-
`;
|
|
4612
|
-
if (cleared.length > 0) {
|
|
4613
|
-
message += `✅ **Cleared:**
|
|
4614
|
-
${cleared.map((p) => `• ${p}`).join(`
|
|
4615
|
-
`)}
|
|
4616
|
-
|
|
4617
|
-
`;
|
|
4618
|
-
}
|
|
4619
|
-
if (skipped.length > 0) {
|
|
4620
|
-
message += `⏭️ **Already clean / skipped:**
|
|
4621
|
-
${skipped.map((p) => `• ${p}`).join(`
|
|
4622
|
-
`)}
|
|
4623
|
-
|
|
4624
|
-
`;
|
|
4625
|
-
}
|
|
4626
|
-
if (blocked.length > 0) {
|
|
4627
|
-
message += `\uD83D\uDEAB **Blocked (safety check):**
|
|
4628
|
-
`;
|
|
4629
|
-
for (const item of blocked) {
|
|
4630
|
-
message += `• ${item.path}
|
|
4631
|
-
Reason: ${item.reason}
|
|
4632
|
-
`;
|
|
4633
|
-
}
|
|
4634
|
-
message += `
|
|
4635
|
-
`;
|
|
4636
|
-
}
|
|
4637
|
-
if (cleared.length > 0) {
|
|
4638
|
-
message += `**Next step:** Restart opencode to pull the latest plugin version.
|
|
4639
|
-
|
|
4640
|
-
Your project files (.opencode/, Manifold/) are untouched — only the configured cache paths were cleared.
|
|
4641
|
-
`;
|
|
4642
|
-
} else if (blocked.length > 0) {
|
|
4643
|
-
message += `⚠️ No paths were cleared. Review the blocked paths above and adjust your settings if needed.
|
|
4644
|
-
`;
|
|
4645
|
-
}
|
|
4646
|
-
await client.tui.appendPrompt({
|
|
4647
|
-
body: {
|
|
4648
|
-
type: "text",
|
|
4649
|
-
text: message
|
|
4650
|
-
}
|
|
4651
|
-
});
|
|
4652
|
-
if (cleared.length > 0) {
|
|
4653
|
-
await client.tui.showToast({
|
|
4654
|
-
body: {
|
|
4655
|
-
type: "success",
|
|
4656
|
-
message: `Cache cleared (${cleared.length} paths). Restart opencode to update.`
|
|
4657
|
-
}
|
|
4658
|
-
});
|
|
4659
|
-
} else if (blocked.length > 0) {
|
|
4660
|
-
await client.tui.showToast({
|
|
4661
|
-
body: {
|
|
4662
|
-
type: "error",
|
|
4663
|
-
message: `Cache update blocked (${blocked.length} paths failed safety check)`
|
|
4664
|
-
}
|
|
4665
|
-
});
|
|
4666
|
-
}
|
|
4667
|
-
await client.app.log({
|
|
4668
|
-
body: {
|
|
4669
|
-
service: "opencode-manifold",
|
|
4670
|
-
level: "info",
|
|
4671
|
-
message: `/manifold-update complete: cleared ${cleared.length}, skipped ${skipped.length}, blocked ${blocked.length}`
|
|
4672
|
-
}
|
|
4673
|
-
});
|
|
4674
|
-
}
|
|
4675
|
-
|
|
4676
4198
|
// src/index.ts
|
|
4677
4199
|
var ManifoldPlugin = async (ctx) => {
|
|
4678
4200
|
setPluginContext(ctx.client);
|
|
@@ -4706,22 +4228,6 @@ var ManifoldPlugin = async (ctx) => {
|
|
|
4706
4228
|
}
|
|
4707
4229
|
];
|
|
4708
4230
|
}
|
|
4709
|
-
} else if (input.command === "manifold-models") {
|
|
4710
|
-
await handleSubModelCommand(ctx.client, ctx.directory);
|
|
4711
|
-
output.parts = [
|
|
4712
|
-
{
|
|
4713
|
-
type: "text",
|
|
4714
|
-
text: "Sub-agent model configuration complete."
|
|
4715
|
-
}
|
|
4716
|
-
];
|
|
4717
|
-
} else if (input.command === "manifold-update") {
|
|
4718
|
-
await handleUpdateCommand(ctx.client, ctx.directory);
|
|
4719
|
-
output.parts = [
|
|
4720
|
-
{
|
|
4721
|
-
type: "text",
|
|
4722
|
-
text: "Plugin cache update complete."
|
|
4723
|
-
}
|
|
4724
|
-
];
|
|
4725
4231
|
}
|
|
4726
4232
|
}
|
|
4727
4233
|
};
|
package/package.json
CHANGED