@exchanet/enet 1.0.15 → 1.0.17

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exchanet/enet",
3
- "version": "1.0.15",
3
+ "version": "1.0.17",
4
4
  "description": "enet — exchanet methods manager. Install, scaffold and manage AI coding methods.",
5
5
  "bin": {
6
6
  "enet": "src/index.js"
@@ -13,7 +13,8 @@
13
13
  ],
14
14
  "scripts": {
15
15
  "dev": "node src/index.js",
16
- "test": "node --test"
16
+ "test": "node --test",
17
+ "prepublishOnly": "node scripts/check-publish.cjs"
17
18
  },
18
19
  "dependencies": {
19
20
  "chalk": "^5.3.0",
@@ -4,7 +4,7 @@ import fs from 'fs-extra'
4
4
  import path from 'path'
5
5
  import readline from 'readline'
6
6
  import { getAllMethods, getMethod, fetchFromGitHub, readInstallRecord, writeInstallRecord } from '../utils/registry.js'
7
- import { detectSystemAgents, getInstallPath, AGENTS } from '../utils/agent_detector.js'
7
+ import { detectSystemAgents, detectAgent, getInstallPath, AGENTS } from '../utils/agent_detector.js'
8
8
  import { installForAgent } from './install.js'
9
9
 
10
10
  export async function updateCommand(methodId, options) {
@@ -27,11 +27,20 @@ export async function updateCommand(methodId, options) {
27
27
  console.log(chalk.bold('\n ◆ enet update\n'))
28
28
 
29
29
  let totalUpdated = 0, totalAdded = 0, totalSkipped = 0
30
+ const currentAgent = await detectAgent()
30
31
 
31
32
  for (const method of targets) {
32
- const record = await readInstallRecord(method.id)
33
+ let record = await readInstallRecord(method.id)
34
+
35
+ // If no record but adapter file exists (e.g. list shows "installed"), treat as installed for current agent
36
+ if ((!record || record.agents.length === 0) && currentAgent) {
37
+ const pathForCurrent = getInstallPath(currentAgent, method.id)
38
+ if (await fs.pathExists(pathForCurrent)) {
39
+ record = { agents: [currentAgent.key], version: record?.version, updatedAt: record?.updatedAt }
40
+ await writeInstallRecord(method.id, { agents: record.agents, version: method.version })
41
+ }
42
+ }
33
43
 
34
- // Skip methods not installed at all
35
44
  if (!record || record.agents.length === 0) {
36
45
  totalSkipped++
37
46
  console.log(chalk.dim(` ${method.name} — not installed, skipping`))