assistme 0.8.7 → 0.8.8

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.
@@ -3734,6 +3734,7 @@ export {
3734
3734
  executeShell,
3735
3735
  MemoryManager,
3736
3736
  LRUCache,
3737
+ upsertAgentSkill,
3737
3738
  SkillManager,
3738
3739
  getLocalStore,
3739
3740
  getCredentialStore
package/dist/index.js CHANGED
@@ -27,7 +27,7 @@ import {
27
27
  setSessionBusy,
28
28
  toggleScheduledTask,
29
29
  updateHeartbeat
30
- } from "./chunk-QBXD76HA.js";
30
+ } from "./chunk-T3DBLWUW.js";
31
31
  import {
32
32
  HEARTBEAT_INTERVAL_MS,
33
33
  HEARTBEAT_LOG_MAX_ENTRIES,
@@ -18,8 +18,9 @@ import {
18
18
  getNextRunTime,
19
19
  pollActionResponse,
20
20
  resetEventSequence,
21
- setActionRequest
22
- } from "../chunk-QBXD76HA.js";
21
+ setActionRequest,
22
+ upsertAgentSkill
23
+ } from "../chunk-T3DBLWUW.js";
23
24
  import {
24
25
  EDSGER_PRODUCT_SLUG,
25
26
  JobRunner,
@@ -1778,25 +1779,27 @@ function createAgentToolsServer(deps) {
1778
1779
  description: z2.string().optional().describe("Updated description (optional)")
1779
1780
  },
1780
1781
  async (args) => {
1781
- const existing = await skillManager.getWithDbFallback(args.name);
1782
- if (!existing) {
1783
- const available = skillManager.getAll().map((s) => s.name).join(", ");
1782
+ await skillManager.ensureLoaded();
1783
+ if (skillManager.update(args.name, args.improved_instructions, args.description)) {
1784
+ log.success(`Self-improvement: improved skill "${args.name}"`);
1784
1785
  return {
1785
1786
  content: [
1786
1787
  {
1787
1788
  type: "text",
1788
- text: `Skill "${args.name}" not found. Available skills: ${available}`
1789
+ text: `Skill "${args.name}" improved and version bumped.`
1789
1790
  }
1790
1791
  ]
1791
1792
  };
1792
1793
  }
1793
- const updated = skillManager.update(
1794
- args.name,
1795
- args.improved_instructions,
1796
- args.description
1797
- );
1798
- if (updated) {
1799
- log.success(`Self-improvement: improved skill "${args.name}"`);
1794
+ const result = await upsertAgentSkill({
1795
+ name: args.name,
1796
+ description: args.description || "",
1797
+ content: args.improved_instructions,
1798
+ version: "1.0.1",
1799
+ source: "auto_improved"
1800
+ });
1801
+ if (result) {
1802
+ log.success(`Self-improvement: improved skill "${args.name}" (direct DB)`);
1800
1803
  return {
1801
1804
  content: [
1802
1805
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "assistme",
3
- "version": "0.8.7",
3
+ "version": "0.8.8",
4
4
  "description": "AssistMe CLI Agent - AI-powered agentic assistant for code, browser, and automation",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -10,6 +10,7 @@ import type { SkillManager } from "../agent/skills.js";
10
10
  import { substituteArguments, preprocessDynamicContext } from "../agent/skill-utils.js";
11
11
  import { validateSkillName } from "../agent/skill-utils.js";
12
12
  import { callMcpHandler } from "../db/api-client.js";
13
+ import { upsertAgentSkill } from "../agent/skill-db.js";
13
14
  import { JobRunner } from "../agent/job-runner.js";
14
15
  import { createScheduledTask, getNextRunTime } from "../agent/scheduler.js";
15
16
  import { getCredentialStore, type CredentialType } from "../credentials/index.js";
@@ -173,30 +174,32 @@ export function createAgentToolsServer(deps: AgentToolsDeps): McpSdkServerConfig
173
174
  description: z.string().optional().describe("Updated description (optional)"),
174
175
  },
175
176
  async (args) => {
176
- // Use DB fallback to handle race condition with async loadFromDb
177
- const existing = await skillManager.getWithDbFallback(args.name);
178
- if (!existing) {
179
- const available = skillManager
180
- .getAll()
181
- .map((s) => s.name)
182
- .join(", ");
177
+ // Fast path: skill is in memory update in-memory + DB
178
+ await skillManager.ensureLoaded();
179
+ if (skillManager.update(args.name, args.improved_instructions, args.description)) {
180
+ log.success(`Self-improvement: improved skill "${args.name}"`);
183
181
  return {
184
182
  content: [
185
183
  {
186
184
  type: "text",
187
- text: `Skill "${args.name}" not found. Available skills: ${available}`,
185
+ text: `Skill "${args.name}" improved and version bumped.`,
188
186
  },
189
187
  ],
190
188
  };
191
189
  }
192
190
 
193
- const updated = skillManager.update(
194
- args.name,
195
- args.improved_instructions,
196
- args.description
197
- );
198
- if (updated) {
199
- log.success(`Self-improvement: improved skill "${args.name}"`);
191
+ // Fallback: skill not in memory (e.g. loadFromDb failed, race condition,
192
+ // or invoked from detail page where prompt already contains full content).
193
+ // Write directly to agent_skills — the tool params already have everything needed.
194
+ const result = await upsertAgentSkill({
195
+ name: args.name,
196
+ description: args.description || "",
197
+ content: args.improved_instructions,
198
+ version: "1.0.1",
199
+ source: "auto_improved",
200
+ });
201
+ if (result) {
202
+ log.success(`Self-improvement: improved skill "${args.name}" (direct DB)`);
200
203
  return {
201
204
  content: [
202
205
  {