@orderful/droid 0.11.0 → 0.12.0

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/src/lib/tools.ts CHANGED
@@ -4,6 +4,7 @@ import { fileURLToPath } from 'url';
4
4
  import YAML from 'yaml';
5
5
  import { loadConfig } from './config.js';
6
6
  import { type ToolManifest, type ToolIncludes, getPlatformTools } from './types.js';
7
+ import { compareSemver } from './version.js';
7
8
 
8
9
  const __dirname = dirname(fileURLToPath(import.meta.url));
9
10
  const BUNDLED_TOOLS_DIR = join(__dirname, '../tools');
@@ -112,29 +113,67 @@ export function getInstalledToolVersion(toolName: string): string | null {
112
113
  return null;
113
114
  }
114
115
 
115
- /**
116
- * Check if a tool has an update available
117
- */
118
- export function getToolUpdateStatus(toolName: string): {
116
+ export interface ToolUpdateInfo {
117
+ name: string;
119
118
  hasUpdate: boolean;
120
119
  installedVersion: string | null;
121
120
  bundledVersion: string | null;
122
- } {
121
+ }
122
+
123
+ /**
124
+ * Check if a tool has an update available
125
+ */
126
+ export function getToolUpdateStatus(toolName: string): ToolUpdateInfo {
123
127
  const installedVersion = getInstalledToolVersion(toolName);
124
128
  const tool = getBundledTools().find(t => t.name === toolName);
125
129
  const bundledVersion = tool?.version || null;
126
130
 
127
131
  if (!installedVersion || !bundledVersion) {
128
132
  return {
133
+ name: toolName,
129
134
  hasUpdate: false,
130
135
  installedVersion,
131
136
  bundledVersion,
132
137
  };
133
138
  }
134
139
 
140
+ // Use semver comparison: bundled > installed means update available
141
+ const hasUpdate = compareSemver(bundledVersion, installedVersion) > 0;
142
+
135
143
  return {
136
- hasUpdate: bundledVersion !== installedVersion,
144
+ name: toolName,
145
+ hasUpdate,
137
146
  installedVersion,
138
147
  bundledVersion,
139
148
  };
140
149
  }
150
+
151
+ /**
152
+ * Get all installed tools that have updates available
153
+ */
154
+ export function getToolsWithUpdates(): ToolUpdateInfo[] {
155
+ const config = loadConfig();
156
+ const installedTools = getPlatformTools(config);
157
+ const bundledTools = getBundledTools();
158
+
159
+ const toolsWithUpdates: ToolUpdateInfo[] = [];
160
+
161
+ // Check each bundled tool to see if it's installed and has an update
162
+ for (const tool of bundledTools) {
163
+ // Find if any of the tool's required skills are installed
164
+ const requiredSkills = tool.includes.skills
165
+ .filter(s => s.required)
166
+ .map(s => s.name);
167
+
168
+ const isInstalled = requiredSkills.some(skillName => skillName in installedTools);
169
+
170
+ if (isInstalled) {
171
+ const updateStatus = getToolUpdateStatus(tool.name);
172
+ if (updateStatus.hasUpdate) {
173
+ toolsWithUpdates.push(updateStatus);
174
+ }
175
+ }
176
+ }
177
+
178
+ return toolsWithUpdates;
179
+ }
package/src/lib/types.ts CHANGED
@@ -42,12 +42,18 @@ export interface PlatformConfig {
42
42
  tools: Record<string, InstalledSkill>;
43
43
  }
44
44
 
45
+ export interface AutoUpdateConfig {
46
+ app: boolean; // Auto-update droid CLI (default: false)
47
+ tools: boolean; // Auto-update installed tools (default: true)
48
+ }
49
+
45
50
  export interface DroidConfig {
46
51
  platform: Platform;
47
52
  user_mention: string;
48
53
  output_preference: OutputPreference;
49
54
  git_username: string;
50
55
  platforms: Record<string, PlatformConfig>;
56
+ auto_update?: AutoUpdateConfig;
51
57
  }
52
58
 
53
59
  // Legacy config structure for migration
@@ -1,6 +1,6 @@
1
1
  name: comments
2
2
  description: "Enable inline conversations using @droid/@user markers. Tag @droid to ask the AI, AI responds with @{your-name}. Ideal for code review notes and async collaboration."
3
- version: 0.2.2
3
+ version: 0.2.3
4
4
  status: beta
5
5
 
6
6
  includes:
@@ -79,13 +79,22 @@ When you find a `@droid` marker:
79
79
 
80
80
  ### On `/comments check`:
81
81
 
82
+ **Use a two-pass approach for coherent responses:**
83
+
84
+ #### Pass 1: Read & Analyse
82
85
  1. **Read config first:** Check `~/.droid/skills/comments/overrides.yaml` for `preserve_comments` setting (default: `true`)
83
- 2. Search for `> @droid` (and any configured `ai_mentions`) in the specified scope
86
+ 2. Search for ALL `> @droid` comments (and any configured `ai_mentions`) in the specified scope
84
87
  3. If there's a `git diff`, check those files first for relevant context
85
- 4. For each comment, determine intent:
88
+ 4. **Read all comments before responding** - understand the full picture
89
+ 5. Look for connections between comments (one may inform another)
90
+ 6. Note any contradictions or tensions to address
91
+
92
+ #### Pass 2: Respond & Write
93
+ 1. For each comment, determine intent:
86
94
  - **Action request** ("do X", "add Y", "fix Z") → Execute the action
87
95
  - **Question** ("what do you think", "should we") → Respond with `> @{user_mention}`
88
- 5. **Handle original comment based on `preserve_comments`:**
96
+ 2. Ensure responses are coherent across all comments (don't contradict yourself)
97
+ 3. **Handle original comment based on `preserve_comments`:**
89
98
  - If `preserve_comments: true` → Keep the original `@droid` comment (add response below it)
90
99
  - If `preserve_comments: false` → Remove the original comment after addressing
91
100
 
@@ -1,6 +1,6 @@
1
1
  name: comments
2
2
  description: "Enable inline conversations using @droid/@user markers. Tag @droid to ask the AI, AI responds with @{your-name}. Use /comments check to address markers, /comments cleanup to remove resolved threads. Ideal for code review notes and async collaboration."
3
- version: 0.2.2
3
+ version: 0.2.3
4
4
  status: beta
5
5
  dependencies: []
6
6
  provides_output: false