@openagents-org/agent-launcher 0.2.131 → 0.2.132

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.
@@ -0,0 +1,125 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * Skill Hub catalog — JavaScript mirror of the backend skill_catalog.py.
5
+ *
6
+ * Provides the same skill definitions and conversion helpers so the
7
+ * launcher CLI and daemon can work offline without hitting the backend.
8
+ */
9
+
10
+ const SKILL_CATALOG = [
11
+ {
12
+ id: 'workspace-core',
13
+ name: 'Workspace Core',
14
+ description: 'Messaging, agent discovery, and status — always available',
15
+ category: 'core',
16
+ icon: 'message-square',
17
+ moduleKey: null,
18
+ defaultEnabled: true,
19
+ toggleable: false,
20
+ },
21
+ {
22
+ id: 'files',
23
+ name: 'Shared Files',
24
+ description: 'Upload, download, and share files across workspace agents and users',
25
+ category: 'collaboration',
26
+ icon: 'file-text',
27
+ moduleKey: 'files',
28
+ defaultEnabled: true,
29
+ toggleable: true,
30
+ },
31
+ {
32
+ id: 'browser',
33
+ name: 'Shared Browser',
34
+ description: 'Browse websites through the workspace\'s shared browser session',
35
+ category: 'collaboration',
36
+ icon: 'globe',
37
+ moduleKey: 'browser',
38
+ defaultEnabled: true,
39
+ toggleable: true,
40
+ },
41
+ {
42
+ id: 'tunnel',
43
+ name: 'Cloudflare Tunnel',
44
+ description: 'Expose local services to the internet via secure tunnels',
45
+ category: 'collaboration',
46
+ icon: 'cloud',
47
+ moduleKey: 'tunnel',
48
+ defaultEnabled: true,
49
+ toggleable: true,
50
+ },
51
+ {
52
+ id: 'todos',
53
+ name: 'Task Planning',
54
+ description: 'Create and manage to-do lists for coordinated agent work',
55
+ category: 'productivity',
56
+ icon: 'check-square',
57
+ moduleKey: 'todos',
58
+ defaultEnabled: true,
59
+ toggleable: true,
60
+ },
61
+ {
62
+ id: 'timers',
63
+ name: 'Timers',
64
+ description: 'Set countdown timers with callback messages',
65
+ category: 'productivity',
66
+ icon: 'timer',
67
+ moduleKey: 'timers',
68
+ defaultEnabled: true,
69
+ toggleable: true,
70
+ },
71
+ {
72
+ id: 'routines',
73
+ name: 'Routines',
74
+ description: 'Schedule recurring tasks on a daily or interval basis',
75
+ category: 'productivity',
76
+ icon: 'repeat',
77
+ moduleKey: 'routines',
78
+ defaultEnabled: true,
79
+ toggleable: true,
80
+ },
81
+ {
82
+ id: 'knowledge',
83
+ name: 'Knowledge Base',
84
+ description: 'Create, read, and share knowledge base entries across workspace agents',
85
+ category: 'collaboration',
86
+ icon: 'book-open',
87
+ moduleKey: 'knowledge',
88
+ defaultEnabled: true,
89
+ toggleable: true,
90
+ },
91
+ ];
92
+
93
+ const _TOGGLEABLE = SKILL_CATALOG.filter(s => s.toggleable);
94
+
95
+ /**
96
+ * Convert a per-agent skills config object to a disabledModules Set.
97
+ *
98
+ * @param {Object.<string, boolean>|null|undefined} skills
99
+ * @returns {Set<string>}
100
+ */
101
+ function skillsToDisabledModules(skills) {
102
+ if (!skills || typeof skills !== 'object') return new Set();
103
+
104
+ const disabled = new Set();
105
+ for (const s of _TOGGLEABLE) {
106
+ const enabled = skills[s.id] !== undefined ? skills[s.id] : s.defaultEnabled;
107
+ if (!enabled && s.moduleKey) {
108
+ disabled.add(s.moduleKey);
109
+ }
110
+ }
111
+ return disabled;
112
+ }
113
+
114
+ /**
115
+ * Return default skill state: {id: defaultEnabled} for all toggleable skills.
116
+ */
117
+ function getSkillDefaults() {
118
+ const defaults = {};
119
+ for (const s of _TOGGLEABLE) {
120
+ defaults[s.id] = s.defaultEnabled;
121
+ }
122
+ return defaults;
123
+ }
124
+
125
+ module.exports = { SKILL_CATALOG, skillsToDisabledModules, getSkillDefaults };
@@ -17,7 +17,7 @@ const { execSync, spawnSync } = require('child_process');
17
17
 
18
18
  const PKG_NAME = '@openagents-org/agent-launcher';
19
19
  const CACHE_FILE = path.join(os.homedir(), '.openagents', '.update-check.json');
20
- const CACHE_TTL_MS = 60 * 60 * 1000; // 1 hour
20
+ const CACHE_TTL_MS = 10 * 60 * 1000; // 10 minutes
21
21
 
22
22
  function currentVersion() {
23
23
  return require('../package.json').version;
@@ -161,8 +161,8 @@ function promptYes(question, timeoutMs = 30000) {
161
161
  }
162
162
 
163
163
  /**
164
- * Check, notify, and offer to update. Exits the process on successful update.
165
- * Safe to call at the top of any user-facing CLI command.
164
+ * Check and print a warning if a newer version is available.
165
+ * Never prompts or auto-updates — users run `agn update` explicitly.
166
166
  */
167
167
  async function notifyAndMaybeUpdate() {
168
168
  let info;
@@ -170,29 +170,9 @@ async function notifyAndMaybeUpdate() {
170
170
  if (!info || !info.isNewer) return;
171
171
 
172
172
  process.stderr.write(
173
- `\n[launcher] Update available: ${info.current} → ${info.latest}\n`
173
+ `\n[launcher] Update available: ${info.current} → ${info.latest}\n` +
174
+ '[launcher] Run `agn update` to upgrade.\n\n'
174
175
  );
175
-
176
- const interactive = process.stdin.isTTY && process.stdout.isTTY;
177
- if (!interactive) {
178
- process.stderr.write(
179
- '[launcher] Run `agn update` (or re-run install.sh) to upgrade.\n\n'
180
- );
181
- return;
182
- }
183
-
184
- const accepted = await promptYes('[launcher] Update now? [Y/n] ');
185
- if (!accepted) {
186
- process.stderr.write('[launcher] Skipped. Run `agn update` later to upgrade.\n\n');
187
- return;
188
- }
189
-
190
- const ok = runUpdate();
191
- if (ok) {
192
- process.stderr.write(`[launcher] Updated to ${info.latest}. Re-run your command.\n`);
193
- process.exit(0);
194
- }
195
- process.stderr.write('[launcher] Update failed — continuing with current version.\n\n');
196
176
  }
197
177
 
198
178
  module.exports = {
@@ -433,6 +433,7 @@ class WorkspaceClient {
433
433
  agentName: (a.address || '').replace('openagents:', ''),
434
434
  role: a.role || 'member',
435
435
  status: a.status || 'offline',
436
+ enabledSkills: a.enabled_skills || null,
436
437
  }));
437
438
  }
438
439
 
@@ -659,6 +660,74 @@ class WorkspaceClient {
659
660
  return data.data || data;
660
661
  }
661
662
 
663
+ // ── Notifications ──
664
+
665
+ async createNotification(workspaceId, token, { title, message, priority, channel, source } = {}) {
666
+ const body = {
667
+ title,
668
+ message,
669
+ priority: priority || 'normal',
670
+ network: workspaceId,
671
+ source: source || 'openagents:unknown',
672
+ };
673
+ if (channel) body.channel = channel;
674
+ const data = await this._post('/v1/notifications', body, this._wsHeaders(token));
675
+ return data.data || data;
676
+ }
677
+
678
+ async listNotifications(workspaceId, token, { limit = 50 } = {}) {
679
+ const params = new URLSearchParams({
680
+ network: workspaceId,
681
+ limit: String(limit),
682
+ });
683
+ const data = await this._get(`/v1/notifications?${params}`, this._wsHeaders(token));
684
+ return data.data || data;
685
+ }
686
+
687
+ // ── Knowledge Base ──
688
+
689
+ async listKnowledge(workspaceId, token, { limit = 100 } = {}) {
690
+ const params = new URLSearchParams({
691
+ network: workspaceId,
692
+ limit: String(limit),
693
+ });
694
+ const data = await this._get(`/v1/knowledge?${params}`, this._wsHeaders(token));
695
+ return data.data || data;
696
+ }
697
+
698
+ async getKnowledge(workspaceId, token, entryId) {
699
+ const params = new URLSearchParams({ network: workspaceId });
700
+ const data = await this._get(`/v1/knowledge/${entryId}?${params}`, this._wsHeaders(token));
701
+ return data.data || data;
702
+ }
703
+
704
+ async getKnowledgeBySlug(workspaceId, token, slug) {
705
+ const params = new URLSearchParams({ network: workspaceId });
706
+ const data = await this._get(`/v1/knowledge/by-slug/${slug}?${params}`, this._wsHeaders(token));
707
+ return data.data || data;
708
+ }
709
+
710
+ async createKnowledge(workspaceId, token, { title, content, description, source } = {}) {
711
+ const body = { title, content, network: workspaceId, source: source || 'openagents:unknown' };
712
+ if (description) body.description = description;
713
+ const data = await this._post('/v1/knowledge', body, this._wsHeaders(token));
714
+ return data.data || data;
715
+ }
716
+
717
+ async updateKnowledge(workspaceId, token, entryId, { title, content, description, source } = {}) {
718
+ const body = { network: workspaceId, source: source || 'openagents:unknown' };
719
+ if (title !== undefined) body.title = title;
720
+ if (content !== undefined) body.content = content;
721
+ if (description !== undefined) body.description = description;
722
+ const data = await this._put(`/v1/knowledge/${entryId}`, body, this._wsHeaders(token));
723
+ return data.data || data;
724
+ }
725
+
726
+ async deleteKnowledge(workspaceId, token, entryId) {
727
+ const data = await this._delete(`/v1/knowledge/${entryId}`, this._wsHeaders(token), workspaceId);
728
+ return data.data || data;
729
+ }
730
+
662
731
  // ── Internal helpers ──
663
732
 
664
733
  /**