opencode-pilot 0.15.0 → 0.15.2

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.
@@ -295,16 +295,19 @@ async function configCommand() {
295
295
  const name = source.name || "<unnamed>";
296
296
  const tool = source.tool;
297
297
 
298
- if (!tool || !tool.mcp || !tool.name) {
299
- console.log(` ✗ ${name}: missing tool.mcp or tool.name`);
298
+ if (!tool || (!tool.command && (!tool.mcp || !tool.name))) {
299
+ console.log(` ✗ ${name}: missing tool.command or tool.mcp/tool.name`);
300
300
  continue;
301
301
  }
302
302
 
303
+ const toolDesc = tool.command
304
+ ? `cli: ${Array.isArray(tool.command) ? tool.command[0] : tool.command.split(' ')[0]}`
305
+ : `${tool.mcp}/${tool.name}`;
303
306
  const itemId = source.item?.id;
304
307
  if (!itemId) {
305
- console.log(` ⚠ ${name}: ${tool.mcp}/${tool.name} (no item.id template)`);
308
+ console.log(` ⚠ ${name}: ${toolDesc} (no item.id template)`);
306
309
  } else {
307
- console.log(` ✓ ${name}: ${tool.mcp}/${tool.name}`);
310
+ console.log(` ✓ ${name}: ${toolDesc}`);
308
311
  }
309
312
 
310
313
  // Show prompt and agent
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-pilot",
3
- "version": "0.15.0",
3
+ "version": "0.15.2",
4
4
  "type": "module",
5
5
  "main": "plugin/index.js",
6
6
  "description": "Automation daemon for OpenCode - polls for work and spawns sessions",
@@ -22,11 +22,12 @@ const DEFAULT_POLL_INTERVAL = 5 * 60 * 1000; // 5 minutes
22
22
 
23
23
  /**
24
24
  * Check if a source has tool configuration
25
+ * @see getToolConfig in poller.js for actual tool config resolution
25
26
  * @param {object} source - Source configuration
26
- * @returns {boolean} True if source has tool.mcp and tool.name
27
+ * @returns {boolean} True if source has tool.command or (tool.mcp and tool.name)
27
28
  */
28
29
  export function hasToolConfig(source) {
29
- return !!(source.tool && source.tool.mcp && source.tool.name);
30
+ return !!(source.tool && (source.tool.command || (source.tool.mcp && source.tool.name)));
30
31
  }
31
32
 
32
33
  /**
@@ -113,7 +114,7 @@ export async function pollOnce(options = {}) {
113
114
  const sourceName = source.name || 'unknown';
114
115
 
115
116
  if (!hasToolConfig(source)) {
116
- console.error(`[poll] Source '${sourceName}' missing tool configuration (requires tool.mcp and tool.name)`);
117
+ console.error(`[poll] Source '${sourceName}' missing tool configuration (requires tool.command or tool.mcp and tool.name)`);
117
118
  continue;
118
119
  }
119
120
 
@@ -50,23 +50,39 @@ sources:
50
50
  test('hasToolConfig validates source configuration', async () => {
51
51
  const { hasToolConfig } = await import('../../service/poll-service.js');
52
52
 
53
- // Valid config
54
- const valid = {
53
+ // Valid MCP config
54
+ const validMcp = {
55
55
  name: 'test',
56
56
  tool: { mcp: 'github', name: 'search_issues' },
57
57
  args: {}
58
58
  };
59
- assert.strictEqual(hasToolConfig(valid), true);
59
+ assert.strictEqual(hasToolConfig(validMcp), true);
60
+
61
+ // Valid CLI command config
62
+ const validCli = {
63
+ name: 'test',
64
+ tool: { command: ['gh', 'search', 'issues'] },
65
+ args: {}
66
+ };
67
+ assert.strictEqual(hasToolConfig(validCli), true);
68
+
69
+ // Valid CLI command config (string form)
70
+ const validCliString = {
71
+ name: 'test',
72
+ tool: { command: 'gh search issues' },
73
+ args: {}
74
+ };
75
+ assert.strictEqual(hasToolConfig(validCliString), true);
60
76
 
61
77
  // Missing tool
62
78
  const missingTool = { name: 'test' };
63
79
  assert.strictEqual(hasToolConfig(missingTool), false);
64
80
 
65
- // Missing mcp
81
+ // Missing mcp (and no command)
66
82
  const missingMcp = { name: 'test', tool: { name: 'search_issues' } };
67
83
  assert.strictEqual(hasToolConfig(missingMcp), false);
68
84
 
69
- // Missing tool.name
85
+ // Missing tool.name (and no command)
70
86
  const missingName = { name: 'test', tool: { mcp: 'github' } };
71
87
  assert.strictEqual(hasToolConfig(missingName), false);
72
88
  });