@floomhq/floom 1.0.46 → 1.0.47

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/dist/cli.js CHANGED
@@ -28,6 +28,13 @@ import { TARGET_HINT, isAgentTarget } from "./targets.js";
28
28
  const PKG = { name: "@floomhq/floom", version: CLI_VERSION };
29
29
  const V1_NOT_AVAILABLE = "Not available in Floom Version 1.";
30
30
  const CLI_COMMAND = "npx -y @floomhq/floom";
31
+ function exitOnBrokenPipe(err) {
32
+ if (err.code === "EPIPE")
33
+ process.exit(0);
34
+ throw err;
35
+ }
36
+ process.stdout.on("error", exitOnBrokenPipe);
37
+ process.stderr.on("error", exitOnBrokenPipe);
31
38
  function usage() {
32
39
  const out = `
33
40
  ${c.blue(" ________ ")}
package/dist/daemon.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { spawn } from "node:child_process";
2
- import { mkdir, readFile, unlink, writeFile } from "node:fs/promises";
2
+ import { access, mkdir, readFile, unlink, writeFile } from "node:fs/promises";
3
3
  import { homedir, hostname, platform } from "node:os";
4
4
  import { dirname, join } from "node:path";
5
5
  import { CONFIG_DIR } from "./config.js";
@@ -91,6 +91,7 @@ function parseSyncResult(output) {
91
91
  async function runTarget(target, opts) {
92
92
  const started = Date.now();
93
93
  const cacheDir = join(CONFIG_DIR, "skill-cache", target);
94
+ const nativeManifestPath = join(CONFIG_DIR, "native-sync-manifests", `${target}.json`);
94
95
  const syncResult = await runCommand([String(opts.timeoutSeconds), "sync", "--target", target], {
95
96
  [targetSkillsDirEnv(target)]: cacheDir,
96
97
  FLOOM_SYNC_MANIFEST_PATH: join(cacheDir, ".floom-cli-sync-manifest.json"),
@@ -105,11 +106,20 @@ async function runTarget(target, opts) {
105
106
  error = setupResult.timedOut ? "instruction setup timed out" : `${setupResult.stdout}\n${setupResult.stderr}`.trim() || "instruction setup failed";
106
107
  }
107
108
  }
109
+ if (opts.push && ok) {
110
+ if (opts.yolo && !(await fileExists(nativeManifestPath))) {
111
+ const baselineResult = await runCommand([String(opts.timeoutSeconds), "watch", "--push", "--once", "--target", target, "--no-yolo"], { FLOOM_SYNC_MANIFEST_PATH: nativeManifestPath });
112
+ if (baselineResult.code !== 0 || baselineResult.timedOut) {
113
+ ok = false;
114
+ error = baselineResult.timedOut ? "native baseline timed out" : `${baselineResult.stdout}\n${baselineResult.stderr}`.trim() || "native baseline failed";
115
+ }
116
+ }
117
+ }
108
118
  if (opts.push && ok) {
109
119
  const pushArgs = ["watch", "--push", "--once", "--target", target];
110
120
  if (!opts.yolo)
111
121
  pushArgs.push("--no-yolo");
112
- const pushResult = await runCommand([String(opts.timeoutSeconds), ...pushArgs], { FLOOM_SYNC_MANIFEST_PATH: join(CONFIG_DIR, "native-sync-manifests", `${target}.json`) });
122
+ const pushResult = await runCommand([String(opts.timeoutSeconds), ...pushArgs], { FLOOM_SYNC_MANIFEST_PATH: nativeManifestPath });
113
123
  if (pushResult.code !== 0 || pushResult.timedOut) {
114
124
  ok = false;
115
125
  error = pushResult.timedOut ? "push timed out" : `${pushResult.stdout}\n${pushResult.stderr}`.trim() || "push failed";
@@ -128,6 +138,17 @@ async function runTarget(target, opts) {
128
138
  duration_ms: Date.now() - started,
129
139
  };
130
140
  }
141
+ async function fileExists(path) {
142
+ try {
143
+ await access(path);
144
+ return true;
145
+ }
146
+ catch (err) {
147
+ if (err.code === "ENOENT")
148
+ return false;
149
+ throw err;
150
+ }
151
+ }
131
152
  async function sleep(ms) {
132
153
  await new Promise((resolve) => setTimeout(resolve, ms));
133
154
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floomhq/floom",
3
- "version": "1.0.46",
3
+ "version": "1.0.47",
4
4
  "description": "Sync AI skills across agents and machines.",
5
5
  "license": "MIT",
6
6
  "type": "module",