@cogfoundry/loomloom 0.4.5 → 0.4.6

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/README.md CHANGED
@@ -12,5 +12,5 @@ GitHub Release assets remain the binary source of truth. The launcher selects an
12
12
  To install the matching general LoomLoom Skill for one explicit Agent, run:
13
13
 
14
14
  ```sh
15
- npx @cogfoundry/loomloom@0.4.5 install --agent codex --yes
15
+ npx @cogfoundry/loomloom@0.4.6 install --agent codex --yes
16
16
  ```
package/bin/installer.cjs CHANGED
@@ -2,12 +2,14 @@
2
2
 
3
3
  const { spawnSync } = require("node:child_process");
4
4
  const fs = require("node:fs");
5
+ const os = require("node:os");
5
6
  const path = require("node:path");
6
7
  const readline = require("node:readline/promises");
7
8
 
8
9
  const PACKAGE_NAME = "@cogfoundry/loomloom";
9
10
  const SKILL_NAME = "loomloom";
10
11
  const BUNDLED_SKILL_PATH = path.join(__dirname, "..", "skill", SKILL_NAME);
12
+ const RECEIPT_FILE = "skill-sync.json";
11
13
 
12
14
  function parseInstallArgs(argv) {
13
15
  const result = { agent: "", yes: false };
@@ -43,6 +45,30 @@ function globalPackageSpec(version) {
43
45
  return `${PACKAGE_NAME}@${version}`;
44
46
  }
45
47
 
48
+ function configDirectory(env = process.env, home = os.homedir()) {
49
+ if (process.platform === "win32") return env.APPDATA || path.join(home, "AppData", "Roaming");
50
+ if (process.platform === "darwin") return path.join(home, "Library", "Application Support");
51
+ return env.XDG_CONFIG_HOME || path.join(home, ".config");
52
+ }
53
+
54
+ function receiptPath(env = process.env, home = os.homedir()) {
55
+ return path.join(configDirectory(env, home), "loomloom", RECEIPT_FILE);
56
+ }
57
+
58
+ function loadReceipts(options = {}) {
59
+ try { return JSON.parse(fs.readFileSync(options.path ?? receiptPath(options.env, options.home), "utf8")); } catch { return { version: 1, agents: {} }; }
60
+ }
61
+
62
+ function saveReceipt(agent, packageVersion, options = {}) {
63
+ const file = options.path ?? receiptPath(options.env, options.home);
64
+ const receipts = loadReceipts({ path: file });
65
+ receipts.version = 1;
66
+ receipts.agents ??= {};
67
+ receipts.agents[agent] = { package: PACKAGE_NAME, package_version: packageVersion, synced_at: new Date().toISOString() };
68
+ fs.mkdirSync(path.dirname(file), { recursive: true, mode: 0o700 });
69
+ fs.writeFileSync(file, `${JSON.stringify(receipts, null, 2)}\n`, { mode: 0o600 });
70
+ }
71
+
46
72
  function skillsAddArgs(source, agent) {
47
73
  return ["--yes", "skills", "add", source, "--skill", SKILL_NAME, "--global", "--agent", agent, "--yes", "--copy"];
48
74
  }
@@ -114,6 +140,7 @@ async function install(argv, options = {}) {
114
140
  if (!skillInstalled(listed.stdout)) {
115
141
  throw new Error(`skills manager did not report ${SKILL_NAME} for agent ${agent}`);
116
142
  }
143
+ saveReceipt(agent, version, options);
117
144
  } catch (error) {
118
145
  throw new Error(
119
146
  `CLI ${version} is installed, but the ${SKILL_NAME} Skill was not installed for ${agent}. ` +
@@ -126,6 +153,17 @@ async function install(argv, options = {}) {
126
153
  return { agent, source, version };
127
154
  }
128
155
 
156
+ async function update(argv, options = {}) {
157
+ const parsed = parseInstallArgs(argv);
158
+ const agent = parsed.agent || await (options.promptForAgent ?? promptForAgent)();
159
+ const receipts = loadReceipts(options);
160
+ if (receipts.agents?.[agent]?.package !== PACKAGE_NAME) {
161
+ throw new Error(`no npm-managed LoomLoom Skill receipt for ${agent}; run npx ${PACKAGE_NAME}@latest install --agent ${agent} --yes first`);
162
+ }
163
+ const execute = options.runCommand ?? runCommand;
164
+ execute("npx", ["--yes", `${PACKAGE_NAME}@latest`, "install", "--agent", agent, "--yes"]);
165
+ }
166
+
129
167
  module.exports = {
130
168
  PACKAGE_NAME,
131
169
  SKILL_NAME,
@@ -133,6 +171,10 @@ module.exports = {
133
171
  bundledSkillPath,
134
172
  globalPackageSpec,
135
173
  install,
174
+ update,
175
+ loadReceipts,
176
+ receiptPath,
177
+ saveReceipt,
136
178
  parseInstallArgs,
137
179
  retryCommand,
138
180
  skillInstalled,
package/bin/loomloom.cjs CHANGED
@@ -119,6 +119,9 @@ async function run(args = process.argv.slice(2), options = {}) {
119
119
  if (args[0] === "install") {
120
120
  return installer.install(args.slice(1), options);
121
121
  }
122
+ if (args[0] === "update") {
123
+ return installer.update(args.slice(1), options);
124
+ }
122
125
  const manifest = loadManifest();
123
126
  const selected = selectPlatform(manifest);
124
127
  const binary = locateBinary(selected);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cogfoundry/loomloom",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
4
4
  "description": "LoomLoom CLI for defining, compiling, executing, and managing AI work as software",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -22,12 +22,12 @@
22
22
  "LICENSE"
23
23
  ],
24
24
  "optionalDependencies": {
25
- "@cogfoundry/loomloom-linux-x64": "0.4.5",
26
- "@cogfoundry/loomloom-linux-arm64": "0.4.5",
27
- "@cogfoundry/loomloom-darwin-x64": "0.4.5",
28
- "@cogfoundry/loomloom-darwin-arm64": "0.4.5",
29
- "@cogfoundry/loomloom-win32-x64": "0.4.5",
30
- "@cogfoundry/loomloom-win32-arm64": "0.4.5"
25
+ "@cogfoundry/loomloom-linux-x64": "0.4.6",
26
+ "@cogfoundry/loomloom-linux-arm64": "0.4.6",
27
+ "@cogfoundry/loomloom-darwin-x64": "0.4.6",
28
+ "@cogfoundry/loomloom-darwin-arm64": "0.4.6",
29
+ "@cogfoundry/loomloom-win32-x64": "0.4.6",
30
+ "@cogfoundry/loomloom-win32-arm64": "0.4.6"
31
31
  },
32
32
  "publishConfig": {
33
33
  "access": "public"
package/platforms.json CHANGED
@@ -1,48 +1,48 @@
1
1
  {
2
- "releaseTag": "v0.4.5",
3
- "version": "0.4.5",
2
+ "releaseTag": "v0.4.6",
3
+ "version": "0.4.6",
4
4
  "platforms": {
5
5
  "linux-x64": {
6
6
  "package": "@cogfoundry/loomloom-linux-x64",
7
7
  "binary": "bin/loomloom",
8
- "binarySHA256": "f40ab4fd137849823614d10b4e886706cd0edea2ced6359d703e11dc0ebb5280",
8
+ "binarySHA256": "5a0d2a5af7502058361017d4985137a01ec489b047a499875f0e15f9aa8c2845",
9
9
  "archive": "loomloom-linux-amd64.tar.gz",
10
- "archiveSHA256": "9e5b420ee8fb70499db0cc961ed5ead12ece286b1a28a59ac322f71eed964a61"
10
+ "archiveSHA256": "923fb6e69eb6376c559f45affe1fbed8065d718c46d0511b79b1cd39e7855d2b"
11
11
  },
12
12
  "linux-arm64": {
13
13
  "package": "@cogfoundry/loomloom-linux-arm64",
14
14
  "binary": "bin/loomloom",
15
- "binarySHA256": "b5650215a5619c490f51da32d2f21c1d0e32f514ae3dbaea9c1c8d8c6c65a6c6",
15
+ "binarySHA256": "e9704d20accde97df793539a00fe35680088240459d45c333422e5a5f6bad473",
16
16
  "archive": "loomloom-linux-arm64.tar.gz",
17
- "archiveSHA256": "2882ce29c276ad536a016ab551dec24d1900eeb4ee061fb5e669a310d4c6131d"
17
+ "archiveSHA256": "bcdd1678d8bf61d2b1fda0ceae65c7d643f41a4b46a097ae7b2993eb1419bf8b"
18
18
  },
19
19
  "darwin-x64": {
20
20
  "package": "@cogfoundry/loomloom-darwin-x64",
21
21
  "binary": "bin/loomloom",
22
- "binarySHA256": "1f83a14ae282df7ebf77a68bc42e497837869313f2a4a6c187ef05e7fbad188a",
22
+ "binarySHA256": "aa47d2ab62c7919841216d96f2cdaae117993da8ec8e90fed24d6f825cb60523",
23
23
  "archive": "loomloom-darwin-amd64.tar.gz",
24
- "archiveSHA256": "63f2ea0377d54115dcf715a4eb4cc8ab1a7e1c68f29b138cb175dec1b342c272"
24
+ "archiveSHA256": "35ae6737e581136a53f22f86bced7b9e009afacf5cba20f62f11e87287335f32"
25
25
  },
26
26
  "darwin-arm64": {
27
27
  "package": "@cogfoundry/loomloom-darwin-arm64",
28
28
  "binary": "bin/loomloom",
29
- "binarySHA256": "2b84a1c8d19aab29c7dcaf026e4b3552fb08ed2cc2430b66d63a0a09ca0616cf",
29
+ "binarySHA256": "dc19dad2e02d0dd5eea3d44810177928b86b37c49d741d71f500284ada96424c",
30
30
  "archive": "loomloom-darwin-arm64.tar.gz",
31
- "archiveSHA256": "bef9ab1a91b7ee9a14b3a6deb2ce0495088f658d1c52c3c81875c0f75e808941"
31
+ "archiveSHA256": "0057cabb22f76d6a959e3a01749d929855701f1a53d6702b4e391340a99c4b27"
32
32
  },
33
33
  "win32-x64": {
34
34
  "package": "@cogfoundry/loomloom-win32-x64",
35
35
  "binary": "bin/loomloom.exe",
36
- "binarySHA256": "26a30023334c05ee5b146b7303411af7255e1e7b36a0c8c9ff4e4e809b7bfb92",
36
+ "binarySHA256": "1181bed231df507830db574730f1ba83258d34419f8989ff37d7ea517d5c1d74",
37
37
  "archive": "loomloom-windows-amd64.zip",
38
- "archiveSHA256": "708e58153f98652b8301dd28e8cee24e29f96ce32ac9c7a63fdc02046e0bd9ca"
38
+ "archiveSHA256": "a96feafaa302c1ce95ff3ade6259855759debbae3f93e4ee88ae480cb2ca375e"
39
39
  },
40
40
  "win32-arm64": {
41
41
  "package": "@cogfoundry/loomloom-win32-arm64",
42
42
  "binary": "bin/loomloom.exe",
43
- "binarySHA256": "e0cb307f55563f644e2a550e886e70b802332462c991a4161ba9ba14cf9af307",
43
+ "binarySHA256": "237e5506499b63ab0deef2174c5997b6dcc06595c3bbba8de70beb2e37d8a8ee",
44
44
  "archive": "loomloom-windows-arm64.zip",
45
- "archiveSHA256": "45e9064ae14150bdee2f0ca1b14f62ae968135cb1af34c61d944a62de0033a5e"
45
+ "archiveSHA256": "15a56aaa63ffb320b90883ed0482b4d4f1d8f7c4b4f4fcb17e3a8035cd05b494"
46
46
  }
47
47
  }
48
48
  }
@@ -25,6 +25,11 @@ Use this reference for installation, `doctor`, browser login, explicit API Token
25
25
  ```
26
26
 
27
27
  The npm setup command delegates the selected Agent's Skill root to the `skills` manager, copies the matching official Skill bundled in that npm package, and verifies that the selected Agent reports `loomloom`. In an Agent or non-interactive session, `--agent` is required; never ask the manager to install for every detected Agent.
28
+ - For an Agent previously installed by that npm setup command, update both the npm CLI and its matching copied Skill explicitly:
29
+ ```bash
30
+ loomloom update --agent <agent-id>
31
+ ```
32
+ It only acts on a recorded npm setup receipt. It must not take over a shell, PowerShell, or Homebrew installation, and it must not guess an Agent directory.
28
33
  - For shell or PowerShell installation, determine the current Agent's supported Skill root from its runtime configuration or official conventions. Use `<agent-skill-root>/loomloom` as the complete destination and pass it with `--skill-dir` or `-SkillDir`.
29
34
  - `--skill-dir` selects the Agent that receives the Skill; it is not the CLI binary directory. Do not use another Agent's directory as a fallback. In particular, `~/.codex/skills/loomloom` is for Codex only; a WorkBuddy target uses `~/.workbuddy/skills/loomloom`.
30
35
  - If the explicit-directory path's current Agent Skill root is unknown, ask the user for it. After installation, verify that `<agent-skill-root>/loomloom/SKILL.md` exists.
@@ -1,6 +1,6 @@
1
1
  {
2
- "releaseTag": "v0.4.5",
3
- "version": "0.4.5",
2
+ "releaseTag": "v0.4.6",
3
+ "version": "0.4.6",
4
4
  "source": "agent-guidance/loomloom",
5
5
  "files": [
6
6
  {
@@ -25,7 +25,7 @@
25
25
  },
26
26
  {
27
27
  "path": "references/setup.md",
28
- "sha256": "480191df77cdd4e66173e5ca046b87baf5406c9a0d60578cb2235fead576b134"
28
+ "sha256": "77b11609fccaf8a6ca80184c04c859d040e093be758634e716e1e712e3471ce3"
29
29
  },
30
30
  {
31
31
  "path": "references/template-spec.md",