opencode-pilot 0.15.0 → 0.15.1
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/package.json
CHANGED
package/service/poll-service.js
CHANGED
|
@@ -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
|
|
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(
|
|
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
|
});
|