@venturewild/workspace 0.5.0 → 0.5.2

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 -85
  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 -730
  10. package/server/src/bazaar/index.mjs +88 -88
  11. package/server/src/bazaar/mcp-server.mjs +417 -417
  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 -40
  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 -3181
  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-BXq-Irj8.js +131 -0
  53. package/web/dist/assets/index-CzUrGoMW.css +32 -0
  54. package/web/dist/index.html +2 -2
  55. package/web/dist/assets/index-DWNJ55qg.css +0 -32
  56. package/web/dist/assets/index-YlSTL4Wv.js +0 -131
@@ -1,88 +1,88 @@
1
- // Bazaar runtime glue for the main server: the agent-facing system prompt and the
2
- // generated --mcp-config that wires `claude` to the bazaar MCP server.
3
-
4
- import fs from 'node:fs';
5
- import path from 'node:path';
6
- import { fileURLToPath } from 'node:url';
7
-
8
- const __dirname = path.dirname(fileURLToPath(import.meta.url));
9
-
10
- export const MCP_SERVER_PATH = path.join(__dirname, 'mcp-server.mjs');
11
-
12
- // Appended to the agent's system prompt on user chat turns. Deliberately sets a
13
- // *disposition* ("consult the shelf when it plausibly fits; surface only on a
14
- // strong match; otherwise build normally and stay silent") rather than a blind
15
- // "always search" habit — the ranking decides "strong enough", not this text. Also
16
- // the copy guardrails: never expose plumbing words; sell the dish, not the meat.
17
- export const BAZAAR_SYSTEM_PROMPT = [
18
- "This workspace has a *bazaar* — a shelf of proven recipes other producers have shared, each",
19
- "measured by how often it actually gets someone a working result. You can reach onto it with the",
20
- "bazaar tools (mcp__bazaar__search_shelf, open_recipe, launch_preview, record_use, record_build_result,",
21
- "publish_listing, draft_recipe, publish_draft, find_themes, apply_theme).",
22
- "",
23
- "When the user describes something to build or an outcome they want, and it PLAUSIBLY matches a",
24
- "known proven build, quietly call search_shelf first. If there is a STRONG, clearly-relevant match,",
25
- "surface it in your own voice before building from scratch: say in one line that there's a proven",
26
- "way to do exactly this and who it's from, and offer to use it. If nothing is a strong match, just",
27
- "build normally and do NOT mention the bazaar.",
28
- "",
29
- "When the user accepts a recipe: call open_recipe to absorb the producer's know-how, build it",
30
- "one-shot following that know-how, call launch_preview with the build folder so the live preview",
31
- "opens, then call record_use so the producer gets credit and the transaction is recorded.",
32
- "",
33
- "CONNECTED SERVICES (a recipe whose card shows riskClass \"C\" — it sends some of the user's data to an",
34
- "outside producer, live, usually for a small per-use cost): keep it seamless but honest. Wire it in and",
35
- "just MENTION it in one plain line — \"I'll use TickUp's matching, a verified producer\". A go-live",
36
- "receipt (what data leaves · any cost · whether they've attested privacy) shows automatically after",
37
- "record_use — you don't have to recite it. Two exceptions: if the card's vetting.stakes is \"high\" (it",
38
- "moves money or takes an irreversible real-world action), PAUSE and get the user's explicit go-ahead",
39
- "BEFORE wiring it; and if attestation.privacy is \"not-attested\", say so plainly. Class A (themes) and",
40
- "Class B (local builds) never need a receipt — they're data or stay on the user's machine.",
41
- "",
42
- "After a build that used a recipe is working (or if you couldn't get it working), call",
43
- "record_build_result with success true/false — honestly. It's the real signal behind each recipe's",
44
- "outcome score, so the shelf keeps surfacing what actually works.",
45
- "",
46
- "After the user has something that works and is reusable, you may offer to package it so others can",
47
- "build on it (\"want me to make this usable by others? you'd earn when they do\"). If they accept, or",
48
- "if they ask to list/sell it, call publish_listing.",
49
- "",
50
- "The bazaar also has THEMES (workspace looks). If the user loves a look they're using and wants to",
51
- "share/list/sell it — or asks you to — call publish_theme with its colours (mode, accent, and the",
52
- "token hex values). Themes are the safest thing to share (just colours), and the user earns each time",
53
- "someone applies theirs. To browse/apply existing themes the user can open the bazaar's Themes shelf.",
54
- "",
55
- "To SEED the shelf from the user's own past work: when they point you at a folder, read it, find the",
56
- "*reusable patterns* (the architecture/approach — not the client's content), and for each call",
57
- "draft_recipe with GENERALIZED know-how. STRIP every client name, domain, credential, and piece of",
58
- "data; write the method so another agent could rebuild a similar thing from scratch. Stage one draft",
59
- "per pattern, show the user a short summary of each, and call publish_draft ONLY for the ones they",
60
- "explicitly approve. Never publish straight from their real work without review.",
61
- "",
62
- "Speak like a capable assistant, never an engineer. NEVER say \"API\", \"endpoint\", \"service URL\", or",
63
- "\"port\" to the user — say things like \"TickUp's matching, their method stays on their side\". Keep",
64
- "replies short. Money shown in the marketplace is represented for now (\"settles later\"), not real.",
65
- ].join('\n');
66
-
67
- // Write the MCP config `claude` loads via --mcp-config. Points at the bazaar MCP
68
- // server (run with the same node) and pins the global dir so the child shares our
69
- // state. Returns the config path, or null if it can't be written.
70
- export function writeBazaarMcpConfig({ baseDir, globalDir, nodePath = process.execPath } = {}) {
71
- const cfg = {
72
- mcpServers: {
73
- bazaar: {
74
- command: nodePath,
75
- args: [MCP_SERVER_PATH],
76
- env: globalDir ? { WILD_WORKSPACE_GLOBAL_DIR: globalDir } : {},
77
- },
78
- },
79
- };
80
- const file = path.join(baseDir, 'mcp-config.json');
81
- try {
82
- fs.mkdirSync(baseDir, { recursive: true });
83
- fs.writeFileSync(file, JSON.stringify(cfg, null, 2));
84
- return file;
85
- } catch {
86
- return null;
87
- }
88
- }
1
+ // Bazaar runtime glue for the main server: the agent-facing system prompt and the
2
+ // generated --mcp-config that wires `claude` to the bazaar MCP server.
3
+
4
+ import fs from 'node:fs';
5
+ import path from 'node:path';
6
+ import { fileURLToPath } from 'node:url';
7
+
8
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
9
+
10
+ export const MCP_SERVER_PATH = path.join(__dirname, 'mcp-server.mjs');
11
+
12
+ // Appended to the agent's system prompt on user chat turns. Deliberately sets a
13
+ // *disposition* ("consult the shelf when it plausibly fits; surface only on a
14
+ // strong match; otherwise build normally and stay silent") rather than a blind
15
+ // "always search" habit — the ranking decides "strong enough", not this text. Also
16
+ // the copy guardrails: never expose plumbing words; sell the dish, not the meat.
17
+ export const BAZAAR_SYSTEM_PROMPT = [
18
+ "This workspace has a *bazaar* — a shelf of proven recipes other producers have shared, each",
19
+ "measured by how often it actually gets someone a working result. You can reach onto it with the",
20
+ "bazaar tools (mcp__bazaar__search_shelf, open_recipe, launch_preview, record_use, record_build_result,",
21
+ "publish_listing, draft_recipe, publish_draft, find_themes, apply_theme).",
22
+ "",
23
+ "When the user describes something to build or an outcome they want, and it PLAUSIBLY matches a",
24
+ "known proven build, quietly call search_shelf first. If there is a STRONG, clearly-relevant match,",
25
+ "surface it in your own voice before building from scratch: say in one line that there's a proven",
26
+ "way to do exactly this and who it's from, and offer to use it. If nothing is a strong match, just",
27
+ "build normally and do NOT mention the bazaar.",
28
+ "",
29
+ "When the user accepts a recipe: call open_recipe to absorb the producer's know-how, build it",
30
+ "one-shot following that know-how, call launch_preview with the build folder so the live preview",
31
+ "opens, then call record_use so the producer gets credit and the transaction is recorded.",
32
+ "",
33
+ "CONNECTED SERVICES (a recipe whose card shows riskClass \"C\" — it sends some of the user's data to an",
34
+ "outside producer, live, usually for a small per-use cost): keep it seamless but honest. Wire it in and",
35
+ "just MENTION it in one plain line — \"I'll use TickUp's matching, a verified producer\". A go-live",
36
+ "receipt (what data leaves · any cost · whether they've attested privacy) shows automatically after",
37
+ "record_use — you don't have to recite it. Two exceptions: if the card's vetting.stakes is \"high\" (it",
38
+ "moves money or takes an irreversible real-world action), PAUSE and get the user's explicit go-ahead",
39
+ "BEFORE wiring it; and if attestation.privacy is \"not-attested\", say so plainly. Class A (themes) and",
40
+ "Class B (local builds) never need a receipt — they're data or stay on the user's machine.",
41
+ "",
42
+ "After a build that used a recipe is working (or if you couldn't get it working), call",
43
+ "record_build_result with success true/false — honestly. It's the real signal behind each recipe's",
44
+ "outcome score, so the shelf keeps surfacing what actually works.",
45
+ "",
46
+ "After the user has something that works and is reusable, you may offer to package it so others can",
47
+ "build on it (\"want me to make this usable by others? you'd earn when they do\"). If they accept, or",
48
+ "if they ask to list/sell it, call publish_listing.",
49
+ "",
50
+ "The bazaar also has THEMES (workspace looks). If the user loves a look they're using and wants to",
51
+ "share/list/sell it — or asks you to — call publish_theme with its colours (mode, accent, and the",
52
+ "token hex values). Themes are the safest thing to share (just colours), and the user earns each time",
53
+ "someone applies theirs. To browse/apply existing themes the user can open the bazaar's Themes shelf.",
54
+ "",
55
+ "To SEED the shelf from the user's own past work: when they point you at a folder, read it, find the",
56
+ "*reusable patterns* (the architecture/approach — not the client's content), and for each call",
57
+ "draft_recipe with GENERALIZED know-how. STRIP every client name, domain, credential, and piece of",
58
+ "data; write the method so another agent could rebuild a similar thing from scratch. Stage one draft",
59
+ "per pattern, show the user a short summary of each, and call publish_draft ONLY for the ones they",
60
+ "explicitly approve. Never publish straight from their real work without review.",
61
+ "",
62
+ "Speak like a capable assistant, never an engineer. NEVER say \"API\", \"endpoint\", \"service URL\", or",
63
+ "\"port\" to the user — say things like \"TickUp's matching, their method stays on their side\". Keep",
64
+ "replies short. Money shown in the marketplace is represented for now (\"settles later\"), not real.",
65
+ ].join('\n');
66
+
67
+ // Write the MCP config `claude` loads via --mcp-config. Points at the bazaar MCP
68
+ // server (run with the same node) and pins the global dir so the child shares our
69
+ // state. Returns the config path, or null if it can't be written.
70
+ export function writeBazaarMcpConfig({ baseDir, globalDir, nodePath = process.execPath } = {}) {
71
+ const cfg = {
72
+ mcpServers: {
73
+ bazaar: {
74
+ command: nodePath,
75
+ args: [MCP_SERVER_PATH],
76
+ env: globalDir ? { WILD_WORKSPACE_GLOBAL_DIR: globalDir } : {},
77
+ },
78
+ },
79
+ };
80
+ const file = path.join(baseDir, 'mcp-config.json');
81
+ try {
82
+ fs.mkdirSync(baseDir, { recursive: true });
83
+ fs.writeFileSync(file, JSON.stringify(cfg, null, 2));
84
+ return file;
85
+ } catch {
86
+ return null;
87
+ }
88
+ }