@venturewild/workspace 0.4.2 → 0.5.1

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.
Files changed (56) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +112 -112
  3. package/package.json +85 -83
  4. package/server/bin/wild-workspace.mjs +1096 -1096
  5. package/server/src/account.mjs +114 -114
  6. package/server/src/agent-login.mjs +146 -146
  7. package/server/src/agent-readiness.mjs +200 -200
  8. package/server/src/agent.mjs +468 -468
  9. package/server/src/bazaar/core.mjs +790 -579
  10. package/server/src/bazaar/index.mjs +88 -75
  11. package/server/src/bazaar/mcp-server.mjs +417 -328
  12. package/server/src/bazaar/mock-tickup.mjs +97 -97
  13. package/server/src/bazaar/preview-server.mjs +95 -95
  14. package/server/src/bazaar/seed-recipes/customer-feedback-form/know-how.md +23 -23
  15. package/server/src/bazaar/seed-recipes/customer-feedback-form/recipe.json +24 -24
  16. package/server/src/bazaar/seed-recipes/landing-page-launch/know-how.md +29 -29
  17. package/server/src/bazaar/seed-recipes/landing-page-launch/recipe.json +25 -25
  18. package/server/src/bazaar/seed-recipes/personal-portfolio/know-how.md +21 -21
  19. package/server/src/bazaar/seed-recipes/personal-portfolio/recipe.json +24 -24
  20. package/server/src/bazaar/seed-recipes/receipt-sorter/know-how.md +31 -31
  21. package/server/src/bazaar/seed-recipes/receipt-sorter/recipe.json +25 -25
  22. package/server/src/bazaar/seed-recipes/tickup-hr-matching/know-how.md +79 -79
  23. package/server/src/bazaar/seed-recipes/tickup-hr-matching/recipe.json +40 -32
  24. package/server/src/canvas/core.mjs +446 -446
  25. package/server/src/canvas/index.mjs +42 -42
  26. package/server/src/canvas/mcp-server.mjs +253 -253
  27. package/server/src/canvas-rails.mjs +108 -108
  28. package/server/src/config.mjs +404 -404
  29. package/server/src/daemon-bin.mjs +110 -110
  30. package/server/src/daemon-supervisor.mjs +285 -285
  31. package/server/src/doctor.mjs +375 -375
  32. package/server/src/inbox.mjs +86 -86
  33. package/server/src/index.mjs +3279 -3032
  34. package/server/src/listings-rails.mjs +126 -0
  35. package/server/src/logpaths.mjs +98 -98
  36. package/server/src/observability.mjs +45 -45
  37. package/server/src/operator.mjs +92 -92
  38. package/server/src/pairing.mjs +137 -137
  39. package/server/src/service.mjs +515 -515
  40. package/server/src/session-reporter.mjs +201 -201
  41. package/server/src/settings.mjs +145 -145
  42. package/server/src/share.mjs +182 -182
  43. package/server/src/skills.mjs +213 -213
  44. package/server/src/supervisor.mjs +647 -647
  45. package/server/src/support-consent.mjs +133 -133
  46. package/server/src/sync.mjs +248 -248
  47. package/server/src/transcript.mjs +121 -121
  48. package/server/src/turn-mcp.mjs +46 -46
  49. package/server/src/usage.mjs +405 -405
  50. package/server/src/workspace-registry.mjs +295 -295
  51. package/server/src/workspaces.mjs +145 -135
  52. package/web/dist/assets/index-B8tHt7x-.css +32 -0
  53. package/web/dist/assets/index-BRY-IKaC.js +131 -0
  54. package/web/dist/index.html +2 -2
  55. package/web/dist/assets/index-DahRXN26.js +0 -91
  56. package/web/dist/assets/index-NXZN2LU2.css +0 -1
@@ -1,110 +1,110 @@
1
- // Locates the bmo-sync-daemon binary for the current platform.
2
- //
3
- // wild-workspace ships the daemon as a per-platform npm subpackage
4
- // (@venturewild/workspace-daemon-<tag>, biome pattern). The resolver walks a
5
- // lookup chain so it works both in development (a locally built binary in
6
- // vendor/ or on PATH) and in a published install (the platform subpackage).
7
-
8
- import { existsSync, readFileSync } from 'node:fs';
9
- import path from 'node:path';
10
- import url from 'node:url';
11
- import { createRequire } from 'node:module';
12
-
13
- const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
14
- const require = createRequire(import.meta.url);
15
-
16
- /** `<platform>-<arch>` token, e.g. `win32-x64`, `darwin-arm64`, `linux-x64`. */
17
- export function platformTag() {
18
- return `${process.platform}-${process.arch}`;
19
- }
20
-
21
- /** Daemon binary file name for the current platform. */
22
- export function daemonBinaryName() {
23
- return process.platform === 'win32' ? 'bmo-sync-daemon.exe' : 'bmo-sync-daemon';
24
- }
25
-
26
- /**
27
- * Resolve the daemon binary. Lookup order:
28
- * 1. WILD_WORKSPACE_DAEMON_BIN — explicit override (must exist, or null).
29
- * 2. the per-platform npm subpackage `@venturewild/workspace-daemon-<tag>`.
30
- * 3. a local `vendor/bmo-sync-daemon-<tag>/<bin>` dir (dev builds land here).
31
- * 4. the bare binary name — let the OS resolve it on PATH at spawn time.
32
- *
33
- * Returns `{ path, source }`. `source` is one of `env` | `subpackage` |
34
- * `vendor` | `path`. Returns `null` only when an explicit override is set
35
- * but missing — every other case falls through to the PATH last resort.
36
- *
37
- * @param {{ env?: NodeJS.ProcessEnv, vendorRoot?: string }} [opts]
38
- */
39
- export function resolveDaemonBinary({ env = process.env, vendorRoot, requireResolve } = {}) {
40
- const binName = daemonBinaryName();
41
- const tag = platformTag();
42
- // Injected seam: lets a test simulate "the platform subpackage isn't
43
- // installed" deterministically, regardless of what's in this machine's
44
- // node_modules (the win32-x64 subpackage IS present on a Windows dev box).
45
- const resolvePkg = requireResolve || ((id) => require.resolve(id));
46
-
47
- // 1. explicit override — if set but missing, that's an error, not a miss.
48
- const override = env.WILD_WORKSPACE_DAEMON_BIN;
49
- if (override) {
50
- return existsSync(override) ? { path: override, source: 'env' } : null;
51
- }
52
-
53
- // 2. per-platform npm subpackage — resolve via its package.json so the
54
- // lookup doesn't depend on an `exports` map for the binary file.
55
- try {
56
- const pkgJson = resolvePkg(`@venturewild/workspace-daemon-${tag}/package.json`);
57
- const candidate = path.join(path.dirname(pkgJson), binName);
58
- if (existsSync(candidate)) return { path: candidate, source: 'subpackage' };
59
- } catch {
60
- // subpackage not installed — fall through
61
- }
62
-
63
- // 3. local vendor dir (a dev build of the daemon drops the binary here).
64
- const root = vendorRoot || path.resolve(__dirname, '..', '..', 'vendor');
65
- const vendor = path.join(root, `bmo-sync-daemon-${tag}`, binName);
66
- if (existsSync(vendor)) return { path: vendor, source: 'vendor' };
67
-
68
- // 4. last resort — spawn by name and let PATH resolve it.
69
- return { path: binName, source: 'path' };
70
- }
71
-
72
- /**
73
- * The version of the INSTALLED per-platform daemon subpackage (e.g. `"0.1.3"`),
74
- * or null when it can't be determined (resolved via PATH/vendor, or not found).
75
- * Used by the supervisor to detect a stale running daemon after an auto-update
76
- * (the daemon's own /health doesn't report a version), so it can recycle it.
77
- */
78
- export function resolveDaemonVersion({ env = process.env, requireResolve } = {}) {
79
- const tag = platformTag();
80
- const resolvePkg = requireResolve || ((id) => require.resolve(id));
81
- try {
82
- const pkgJson = resolvePkg(`@venturewild/workspace-daemon-${tag}/package.json`);
83
- const parsed = JSON.parse(readFileSync(pkgJson, 'utf8'));
84
- return typeof parsed.version === 'string' ? parsed.version : null;
85
- } catch {
86
- return null;
87
- }
88
- }
89
-
90
- /**
91
- * The daemon version the INSTALLED meta package PINS for this platform — read
92
- * from the meta `package.json`'s optionalDependencies. This is the version
93
- * `npm i -g @venturewild/workspace@<v>` is SUPPOSED to have pulled onto disk.
94
- * Comparing it to resolveDaemonVersion() catches the go-live failure where the
95
- * meta package updated but its daemon optionalDependency on disk lagged behind
96
- * (the tangled Windows dev box stuck on the @0.2.0-era daemon). Returns the
97
- * pinned version string, or null when it can't be read. Self-contained: reads the
98
- * meta package.json that ships two dirs up from this file.
99
- */
100
- export function expectedDaemonVersion({ metaPkgPath } = {}) {
101
- const tag = platformTag();
102
- try {
103
- const pkg = metaPkgPath || path.resolve(__dirname, '..', '..', 'package.json');
104
- const parsed = JSON.parse(readFileSync(pkg, 'utf8'));
105
- const v = parsed?.optionalDependencies?.[`@venturewild/workspace-daemon-${tag}`];
106
- return typeof v === 'string' ? v.replace(/^[~^]/, '') : null;
107
- } catch {
108
- return null;
109
- }
110
- }
1
+ // Locates the bmo-sync-daemon binary for the current platform.
2
+ //
3
+ // wild-workspace ships the daemon as a per-platform npm subpackage
4
+ // (@venturewild/workspace-daemon-<tag>, biome pattern). The resolver walks a
5
+ // lookup chain so it works both in development (a locally built binary in
6
+ // vendor/ or on PATH) and in a published install (the platform subpackage).
7
+
8
+ import { existsSync, readFileSync } from 'node:fs';
9
+ import path from 'node:path';
10
+ import url from 'node:url';
11
+ import { createRequire } from 'node:module';
12
+
13
+ const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
14
+ const require = createRequire(import.meta.url);
15
+
16
+ /** `<platform>-<arch>` token, e.g. `win32-x64`, `darwin-arm64`, `linux-x64`. */
17
+ export function platformTag() {
18
+ return `${process.platform}-${process.arch}`;
19
+ }
20
+
21
+ /** Daemon binary file name for the current platform. */
22
+ export function daemonBinaryName() {
23
+ return process.platform === 'win32' ? 'bmo-sync-daemon.exe' : 'bmo-sync-daemon';
24
+ }
25
+
26
+ /**
27
+ * Resolve the daemon binary. Lookup order:
28
+ * 1. WILD_WORKSPACE_DAEMON_BIN — explicit override (must exist, or null).
29
+ * 2. the per-platform npm subpackage `@venturewild/workspace-daemon-<tag>`.
30
+ * 3. a local `vendor/bmo-sync-daemon-<tag>/<bin>` dir (dev builds land here).
31
+ * 4. the bare binary name — let the OS resolve it on PATH at spawn time.
32
+ *
33
+ * Returns `{ path, source }`. `source` is one of `env` | `subpackage` |
34
+ * `vendor` | `path`. Returns `null` only when an explicit override is set
35
+ * but missing — every other case falls through to the PATH last resort.
36
+ *
37
+ * @param {{ env?: NodeJS.ProcessEnv, vendorRoot?: string }} [opts]
38
+ */
39
+ export function resolveDaemonBinary({ env = process.env, vendorRoot, requireResolve } = {}) {
40
+ const binName = daemonBinaryName();
41
+ const tag = platformTag();
42
+ // Injected seam: lets a test simulate "the platform subpackage isn't
43
+ // installed" deterministically, regardless of what's in this machine's
44
+ // node_modules (the win32-x64 subpackage IS present on a Windows dev box).
45
+ const resolvePkg = requireResolve || ((id) => require.resolve(id));
46
+
47
+ // 1. explicit override — if set but missing, that's an error, not a miss.
48
+ const override = env.WILD_WORKSPACE_DAEMON_BIN;
49
+ if (override) {
50
+ return existsSync(override) ? { path: override, source: 'env' } : null;
51
+ }
52
+
53
+ // 2. per-platform npm subpackage — resolve via its package.json so the
54
+ // lookup doesn't depend on an `exports` map for the binary file.
55
+ try {
56
+ const pkgJson = resolvePkg(`@venturewild/workspace-daemon-${tag}/package.json`);
57
+ const candidate = path.join(path.dirname(pkgJson), binName);
58
+ if (existsSync(candidate)) return { path: candidate, source: 'subpackage' };
59
+ } catch {
60
+ // subpackage not installed — fall through
61
+ }
62
+
63
+ // 3. local vendor dir (a dev build of the daemon drops the binary here).
64
+ const root = vendorRoot || path.resolve(__dirname, '..', '..', 'vendor');
65
+ const vendor = path.join(root, `bmo-sync-daemon-${tag}`, binName);
66
+ if (existsSync(vendor)) return { path: vendor, source: 'vendor' };
67
+
68
+ // 4. last resort — spawn by name and let PATH resolve it.
69
+ return { path: binName, source: 'path' };
70
+ }
71
+
72
+ /**
73
+ * The version of the INSTALLED per-platform daemon subpackage (e.g. `"0.1.3"`),
74
+ * or null when it can't be determined (resolved via PATH/vendor, or not found).
75
+ * Used by the supervisor to detect a stale running daemon after an auto-update
76
+ * (the daemon's own /health doesn't report a version), so it can recycle it.
77
+ */
78
+ export function resolveDaemonVersion({ env = process.env, requireResolve } = {}) {
79
+ const tag = platformTag();
80
+ const resolvePkg = requireResolve || ((id) => require.resolve(id));
81
+ try {
82
+ const pkgJson = resolvePkg(`@venturewild/workspace-daemon-${tag}/package.json`);
83
+ const parsed = JSON.parse(readFileSync(pkgJson, 'utf8'));
84
+ return typeof parsed.version === 'string' ? parsed.version : null;
85
+ } catch {
86
+ return null;
87
+ }
88
+ }
89
+
90
+ /**
91
+ * The daemon version the INSTALLED meta package PINS for this platform — read
92
+ * from the meta `package.json`'s optionalDependencies. This is the version
93
+ * `npm i -g @venturewild/workspace@<v>` is SUPPOSED to have pulled onto disk.
94
+ * Comparing it to resolveDaemonVersion() catches the go-live failure where the
95
+ * meta package updated but its daemon optionalDependency on disk lagged behind
96
+ * (the tangled Windows dev box stuck on the @0.2.0-era daemon). Returns the
97
+ * pinned version string, or null when it can't be read. Self-contained: reads the
98
+ * meta package.json that ships two dirs up from this file.
99
+ */
100
+ export function expectedDaemonVersion({ metaPkgPath } = {}) {
101
+ const tag = platformTag();
102
+ try {
103
+ const pkg = metaPkgPath || path.resolve(__dirname, '..', '..', 'package.json');
104
+ const parsed = JSON.parse(readFileSync(pkg, 'utf8'));
105
+ const v = parsed?.optionalDependencies?.[`@venturewild/workspace-daemon-${tag}`];
106
+ return typeof v === 'string' ? v.replace(/^[~^]/, '') : null;
107
+ } catch {
108
+ return null;
109
+ }
110
+ }