newtype-profile 1.0.31 → 1.0.32
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/cli/index.js
CHANGED
|
@@ -2253,7 +2253,7 @@ var require_picocolors = __commonJS((exports, module) => {
|
|
|
2253
2253
|
var require_package = __commonJS((exports, module) => {
|
|
2254
2254
|
module.exports = {
|
|
2255
2255
|
name: "newtype-profile",
|
|
2256
|
-
version: "1.0.
|
|
2256
|
+
version: "1.0.32",
|
|
2257
2257
|
description: "AI Agent Collaboration System for Content Creation - Based on oh-my-opencode",
|
|
2258
2258
|
main: "dist/index.js",
|
|
2259
2259
|
types: "dist/index.d.ts",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SWITCH_PLUGIN_TEMPLATE = "Switch OpenCode plugin configuration.\n\n## USAGE\n\n`/switch <plugin-name>`\n\n**Available presets:**\n- `newtype` - Switch to newtype-profile (this plugin)\n- `omo` - Switch to oh-my-opencode\n- `none` - Disable all plugins\n\n**Arguments:**\n$ARGUMENTS\n\n## WHAT TO DO\n\n1. **Parse the argument** to determine which plugin preset to use:\n - \"newtype\" or \"newtype-profile\" \u2192 [\"newtype-profile\"]\n - \"omo\" or \"oh-my-opencode\" \u2192 [\"oh-my-opencode\"]\n - \"none\" or \"disable\" or \"off\" \u2192 []\n\n2. **Read current config** at `~/.config/opencode/opencode.json`\n\n3. **Update the plugin field** in the config JSON:\n ```json\n {\n \"plugin\": [\"newtype-profile\"] // or [\"oh-my-opencode\"] or []\n }\n ```\n\n4. **Write the updated config** back to the file\n\n5. **Inform the user** that they need to restart OpenCode for changes to take effect\n\n## IMPLEMENTATION\n\nUse the bash tool to read, modify, and write the config file:\n\n```bash\n# Read current config\ncat ~/.config/opencode/opencode.json\n\n# The config structure looks like:\n# {\n# \"plugin\": [\"newtype-profile\"],\n# \"model\": {...},\n# ...\n# }\n```\n\nAfter reading, use a script or jq to update the plugin field, then write back.\n\nExample with jq (if available):\n```bash\n# For newtype-profile\njq '.plugin = [\"newtype-profile\"]' ~/.config/opencode/opencode.json > /tmp/opencode.json.tmp && mv /tmp/opencode.json.tmp ~/.config/opencode/opencode.json\n\n# For oh-my-opencode\njq '.plugin = [\"oh-my-opencode\"]' ~/.config/opencode/opencode.json > /tmp/opencode.json.tmp && mv /tmp/opencode.json.tmp ~/.config/opencode/opencode.json\n\n# For none\njq '.plugin = []' ~/.config/opencode/opencode.json > /tmp/opencode.json.tmp && mv /tmp/opencode.json.tmp ~/.config/opencode/opencode.json\n```\n\nIf jq is not available, use node/bun inline script:\n```bash\nnode -e \"\nconst fs = require('fs');\nconst path = require('os').homedir() + '/.config/opencode/opencode.json';\nconst config = JSON.parse(fs.readFileSync(path, 'utf-8'));\nconfig.plugin = ['newtype-profile']; // or the appropriate value\nfs.writeFileSync(path, JSON.stringify(config, null, 2));\nconsole.log('Plugin switched to: ' + config.plugin.join(', ') || 'none');\n\"\n```\n\n## OUTPUT FORMAT\n\nAfter successful switch:\n```\n\u2705 Plugin switched to: {plugin-name}\n\n\u26A0\uFE0F Please restart OpenCode for changes to take effect:\n 1. Press Ctrl+C to exit\n 2. Run `opencode` to start again\n\nCurrent plugin configuration:\n{\n \"plugin\": [\"{plugin-name}\"]\n}\n```\n\nIf argument is invalid:\n```\n\u274C Unknown plugin: {argument}\n\nAvailable options:\n - newtype (newtype-profile)\n - omo (oh-my-opencode)\n - none (disable plugins)\n\nUsage: /switch <plugin-name>\n```\n\n## IMPORTANT\n\n- OpenCode does NOT support hot-reloading plugins\n- The user MUST restart OpenCode after switching\n- Always preserve other fields in opencode.json (model, auth, etc.)\n- If opencode.json doesn't exist, create it with just the plugin field\n";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CommandDefinition } from "../claude-code-command-loader";
|
|
2
|
-
export type BuiltinCommandName = "init-deep" | "ralph-loop" | "cancel-ralph" | "refactor" | "start-work";
|
|
2
|
+
export type BuiltinCommandName = "init-deep" | "ralph-loop" | "cancel-ralph" | "refactor" | "start-work" | "switch";
|
|
3
3
|
export interface BuiltinCommandConfig {
|
|
4
4
|
disabled_commands?: BuiltinCommandName[];
|
|
5
5
|
}
|
package/dist/index.js
CHANGED
|
@@ -52280,6 +52280,119 @@ Reading plan and beginning execution...
|
|
|
52280
52280
|
- Read the FULL plan file before delegating any tasks
|
|
52281
52281
|
- Follow Orchestrator Sisyphus delegation protocols (7-section format)`;
|
|
52282
52282
|
|
|
52283
|
+
// src/features/builtin-commands/templates/switch-plugin.ts
|
|
52284
|
+
var SWITCH_PLUGIN_TEMPLATE = `Switch OpenCode plugin configuration.
|
|
52285
|
+
|
|
52286
|
+
## USAGE
|
|
52287
|
+
|
|
52288
|
+
\`/switch <plugin-name>\`
|
|
52289
|
+
|
|
52290
|
+
**Available presets:**
|
|
52291
|
+
- \`newtype\` - Switch to newtype-profile (this plugin)
|
|
52292
|
+
- \`omo\` - Switch to oh-my-opencode
|
|
52293
|
+
- \`none\` - Disable all plugins
|
|
52294
|
+
|
|
52295
|
+
**Arguments:**
|
|
52296
|
+
$ARGUMENTS
|
|
52297
|
+
|
|
52298
|
+
## WHAT TO DO
|
|
52299
|
+
|
|
52300
|
+
1. **Parse the argument** to determine which plugin preset to use:
|
|
52301
|
+
- "newtype" or "newtype-profile" \u2192 ["newtype-profile"]
|
|
52302
|
+
- "omo" or "oh-my-opencode" \u2192 ["oh-my-opencode"]
|
|
52303
|
+
- "none" or "disable" or "off" \u2192 []
|
|
52304
|
+
|
|
52305
|
+
2. **Read current config** at \`~/.config/opencode/opencode.json\`
|
|
52306
|
+
|
|
52307
|
+
3. **Update the plugin field** in the config JSON:
|
|
52308
|
+
\`\`\`json
|
|
52309
|
+
{
|
|
52310
|
+
"plugin": ["newtype-profile"] // or ["oh-my-opencode"] or []
|
|
52311
|
+
}
|
|
52312
|
+
\`\`\`
|
|
52313
|
+
|
|
52314
|
+
4. **Write the updated config** back to the file
|
|
52315
|
+
|
|
52316
|
+
5. **Inform the user** that they need to restart OpenCode for changes to take effect
|
|
52317
|
+
|
|
52318
|
+
## IMPLEMENTATION
|
|
52319
|
+
|
|
52320
|
+
Use the bash tool to read, modify, and write the config file:
|
|
52321
|
+
|
|
52322
|
+
\`\`\`bash
|
|
52323
|
+
# Read current config
|
|
52324
|
+
cat ~/.config/opencode/opencode.json
|
|
52325
|
+
|
|
52326
|
+
# The config structure looks like:
|
|
52327
|
+
# {
|
|
52328
|
+
# "plugin": ["newtype-profile"],
|
|
52329
|
+
# "model": {...},
|
|
52330
|
+
# ...
|
|
52331
|
+
# }
|
|
52332
|
+
\`\`\`
|
|
52333
|
+
|
|
52334
|
+
After reading, use a script or jq to update the plugin field, then write back.
|
|
52335
|
+
|
|
52336
|
+
Example with jq (if available):
|
|
52337
|
+
\`\`\`bash
|
|
52338
|
+
# For newtype-profile
|
|
52339
|
+
jq '.plugin = ["newtype-profile"]' ~/.config/opencode/opencode.json > /tmp/opencode.json.tmp && mv /tmp/opencode.json.tmp ~/.config/opencode/opencode.json
|
|
52340
|
+
|
|
52341
|
+
# For oh-my-opencode
|
|
52342
|
+
jq '.plugin = ["oh-my-opencode"]' ~/.config/opencode/opencode.json > /tmp/opencode.json.tmp && mv /tmp/opencode.json.tmp ~/.config/opencode/opencode.json
|
|
52343
|
+
|
|
52344
|
+
# For none
|
|
52345
|
+
jq '.plugin = []' ~/.config/opencode/opencode.json > /tmp/opencode.json.tmp && mv /tmp/opencode.json.tmp ~/.config/opencode/opencode.json
|
|
52346
|
+
\`\`\`
|
|
52347
|
+
|
|
52348
|
+
If jq is not available, use node/bun inline script:
|
|
52349
|
+
\`\`\`bash
|
|
52350
|
+
node -e "
|
|
52351
|
+
const fs = require('fs');
|
|
52352
|
+
const path = require('os').homedir() + '/.config/opencode/opencode.json';
|
|
52353
|
+
const config = JSON.parse(fs.readFileSync(path, 'utf-8'));
|
|
52354
|
+
config.plugin = ['newtype-profile']; // or the appropriate value
|
|
52355
|
+
fs.writeFileSync(path, JSON.stringify(config, null, 2));
|
|
52356
|
+
console.log('Plugin switched to: ' + config.plugin.join(', ') || 'none');
|
|
52357
|
+
"
|
|
52358
|
+
\`\`\`
|
|
52359
|
+
|
|
52360
|
+
## OUTPUT FORMAT
|
|
52361
|
+
|
|
52362
|
+
After successful switch:
|
|
52363
|
+
\`\`\`
|
|
52364
|
+
\u2705 Plugin switched to: {plugin-name}
|
|
52365
|
+
|
|
52366
|
+
\u26A0\uFE0F Please restart OpenCode for changes to take effect:
|
|
52367
|
+
1. Press Ctrl+C to exit
|
|
52368
|
+
2. Run \`opencode\` to start again
|
|
52369
|
+
|
|
52370
|
+
Current plugin configuration:
|
|
52371
|
+
{
|
|
52372
|
+
"plugin": ["{plugin-name}"]
|
|
52373
|
+
}
|
|
52374
|
+
\`\`\`
|
|
52375
|
+
|
|
52376
|
+
If argument is invalid:
|
|
52377
|
+
\`\`\`
|
|
52378
|
+
\u274C Unknown plugin: {argument}
|
|
52379
|
+
|
|
52380
|
+
Available options:
|
|
52381
|
+
- newtype (newtype-profile)
|
|
52382
|
+
- omo (oh-my-opencode)
|
|
52383
|
+
- none (disable plugins)
|
|
52384
|
+
|
|
52385
|
+
Usage: /switch <plugin-name>
|
|
52386
|
+
\`\`\`
|
|
52387
|
+
|
|
52388
|
+
## IMPORTANT
|
|
52389
|
+
|
|
52390
|
+
- OpenCode does NOT support hot-reloading plugins
|
|
52391
|
+
- The user MUST restart OpenCode after switching
|
|
52392
|
+
- Always preserve other fields in opencode.json (model, auth, etc.)
|
|
52393
|
+
- If opencode.json doesn't exist, create it with just the plugin field
|
|
52394
|
+
`;
|
|
52395
|
+
|
|
52283
52396
|
// src/features/builtin-commands/commands.ts
|
|
52284
52397
|
var BUILTIN_COMMAND_DEFINITIONS = {
|
|
52285
52398
|
"init-deep": {
|
|
@@ -52333,6 +52446,13 @@ Timestamp: $TIMESTAMP
|
|
|
52333
52446
|
$ARGUMENTS
|
|
52334
52447
|
</user-request>`,
|
|
52335
52448
|
argumentHint: "[plan-name]"
|
|
52449
|
+
},
|
|
52450
|
+
switch: {
|
|
52451
|
+
description: "(builtin) Switch OpenCode plugin (newtype/omo/none)",
|
|
52452
|
+
template: `<command-instruction>
|
|
52453
|
+
${SWITCH_PLUGIN_TEMPLATE}
|
|
52454
|
+
</command-instruction>`,
|
|
52455
|
+
argumentHint: "<newtype|omo|none>"
|
|
52336
52456
|
}
|
|
52337
52457
|
};
|
|
52338
52458
|
function loadBuiltinCommands(disabledCommands) {
|