@worca/app 0.0.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 (114) hide show
  1. package/README.md +403 -0
  2. package/agents/clarify.meta.json +19 -0
  3. package/agents/decomposer.meta.json +21 -0
  4. package/agents/implementer.meta.json +20 -0
  5. package/agents/manualTestsChecklist.meta.json +18 -0
  6. package/agents/manualWebUiTesting.meta.json +18 -0
  7. package/agents/planReviewer.meta.json +19 -0
  8. package/agents/planner.meta.json +20 -0
  9. package/agents/refiner.meta.json +19 -0
  10. package/agents/reviewer.meta.json +19 -0
  11. package/agents/worca-cc-clarify.md +67 -0
  12. package/agents/worca-cc-code-reviewer.md +66 -0
  13. package/agents/worca-cc-decomposer.md +84 -0
  14. package/agents/worca-cc-implementer.md +69 -0
  15. package/agents/worca-cc-manual-tests-checklist.md +63 -0
  16. package/agents/worca-cc-manual-web-ui-testing.md +64 -0
  17. package/agents/worca-cc-plan-refiner.md +69 -0
  18. package/agents/worca-cc-plan-reviewer.md +70 -0
  19. package/agents/worca-cc-planner.md +70 -0
  20. package/agents/worca-cc-workspace-reviewer.md +56 -0
  21. package/agents/worca-cc-workspace-scanner.md +55 -0
  22. package/agents/workspaceReviewer.meta.json +20 -0
  23. package/agents/workspaceScanner.meta.json +18 -0
  24. package/package.json +61 -0
  25. package/scripts/install.mjs +209 -0
  26. package/skills/worca/SKILL.md +66 -0
  27. package/src/cli/worca-cc.mjs +1520 -0
  28. package/src/core/agent-gen.mjs +206 -0
  29. package/src/core/agent-registry.mjs +417 -0
  30. package/src/core/agent-store.mjs +143 -0
  31. package/src/core/artifacts.mjs +2019 -0
  32. package/src/core/channels.mjs +302 -0
  33. package/src/core/chat/allowlist.mjs +27 -0
  34. package/src/core/chat/channel-host.mjs +562 -0
  35. package/src/core/chat/channel-protocol.mjs +117 -0
  36. package/src/core/chat/channel-worker-child.mjs +211 -0
  37. package/src/core/chat/chat-context.mjs +66 -0
  38. package/src/core/chat/command-router.mjs +343 -0
  39. package/src/core/chat/notifier.mjs +120 -0
  40. package/src/core/chat/parser.mjs +30 -0
  41. package/src/core/chat/rate-limiter.mjs +133 -0
  42. package/src/core/chat/redact.mjs +27 -0
  43. package/src/core/chat/renderers.mjs +136 -0
  44. package/src/core/claude-runner.mjs +1356 -0
  45. package/src/core/config.mjs +882 -0
  46. package/src/core/cost-budget.mjs +103 -0
  47. package/src/core/db.mjs +864 -0
  48. package/src/core/fanout.mjs +48 -0
  49. package/src/core/folder-dialog.mjs +138 -0
  50. package/src/core/fs-browse.mjs +49 -0
  51. package/src/core/git-info.mjs +200 -0
  52. package/src/core/guardrail-store.mjs +204 -0
  53. package/src/core/guardrails.mjs +302 -0
  54. package/src/core/marketplaces.mjs +267 -0
  55. package/src/core/migrate-fs-to-db.mjs +612 -0
  56. package/src/core/model-env.mjs +74 -0
  57. package/src/core/orchestrator.mjs +4279 -0
  58. package/src/core/overview-agent.mjs +124 -0
  59. package/src/core/phases.mjs +1279 -0
  60. package/src/core/pipeline-delete.mjs +428 -0
  61. package/src/core/plugin-api.mjs +13 -0
  62. package/src/core/plugin-config.mjs +100 -0
  63. package/src/core/plugin-inventory.mjs +50 -0
  64. package/src/core/plugin-manifest.mjs +447 -0
  65. package/src/core/plugin-models.mjs +130 -0
  66. package/src/core/plugin-repo.mjs +303 -0
  67. package/src/core/plugin-shim-child.mjs +76 -0
  68. package/src/core/plugin-shim.mjs +197 -0
  69. package/src/core/plugin-store.mjs +485 -0
  70. package/src/core/plugin-workflows.mjs +179 -0
  71. package/src/core/plugins-lock.mjs +49 -0
  72. package/src/core/preflight-node.mjs +122 -0
  73. package/src/core/preflight.mjs +341 -0
  74. package/src/core/projects.mjs +157 -0
  75. package/src/core/protocol.mjs +257 -0
  76. package/src/core/recoverable-error.mjs +51 -0
  77. package/src/core/results.mjs +188 -0
  78. package/src/core/run-context.mjs +1375 -0
  79. package/src/core/run-log.mjs +64 -0
  80. package/src/core/run-manifest.mjs +317 -0
  81. package/src/core/runners.mjs +167 -0
  82. package/src/core/settings.mjs +682 -0
  83. package/src/core/skills.mjs +210 -0
  84. package/src/core/sources.mjs +232 -0
  85. package/src/core/stats.mjs +182 -0
  86. package/src/core/store.mjs +67 -0
  87. package/src/core/title.mjs +64 -0
  88. package/src/core/workflow-validator.mjs +185 -0
  89. package/src/core/workflows.mjs +568 -0
  90. package/src/core/workspace-scan.mjs +420 -0
  91. package/src/core/workspaces.mjs +353 -0
  92. package/src/core/worktree.mjs +708 -0
  93. package/src/feature.mjs +9 -0
  94. package/ui/public/app.js +10647 -0
  95. package/ui/public/assets/worca-favicon.png +0 -0
  96. package/ui/public/assets/worca-logo.png +0 -0
  97. package/ui/public/chat-settings-view.mjs +89 -0
  98. package/ui/public/composer-core.mjs +211 -0
  99. package/ui/public/fonts/jetbrains-mono-latin-400-normal.woff2 +0 -0
  100. package/ui/public/fonts/poppins-latin-400-normal.woff2 +0 -0
  101. package/ui/public/fonts/poppins-latin-500-normal.woff2 +0 -0
  102. package/ui/public/fonts/poppins-latin-600-normal.woff2 +0 -0
  103. package/ui/public/fonts/poppins-latin-700-normal.woff2 +0 -0
  104. package/ui/public/guardrails-view.mjs +244 -0
  105. package/ui/public/index.html +1145 -0
  106. package/ui/public/log-filter.mjs +81 -0
  107. package/ui/public/log-line.mjs +86 -0
  108. package/ui/public/models-view.mjs +433 -0
  109. package/ui/public/plugins-view.mjs +430 -0
  110. package/ui/public/results-view.mjs +121 -0
  111. package/ui/public/source-pane.mjs +156 -0
  112. package/ui/public/stats-view.mjs +523 -0
  113. package/ui/public/style.css +1557 -0
  114. package/ui/server.mjs +3573 -0
@@ -0,0 +1,74 @@
1
+ // src/core/model-env.mjs
2
+ // Shared, dependency-free definitions for configurable models
3
+ // (configurable-models-design.md §4.1/§4.4): the effort vocabulary, the
4
+ // reserved-key policy for per-model routing env, whole-value ${VAR}
5
+ // indirection, and the defensive spawn-time filter.
6
+ //
7
+ // This module imports NOTHING. settings.mjs — whose import contract forbids
8
+ // core-graph modules (it would cycle via projects.mjs) — validates catalog
9
+ // writes against this policy, and claude-runner.mjs applies the same policy
10
+ // defensively at spawn time. Keeping the single source of truth in a
11
+ // zero-import leaf lets both sides share it without bending either module's
12
+ // import contract; that is why the constant does NOT live next to
13
+ // SPAWN_ENV_BASE in claude-runner.mjs.
14
+
15
+ /** Reasoning-effort vocabulary. Canonical home is HERE (not config.mjs, which
16
+ * re-exports it) so settings.mjs can validate a catalog entry's `efforts`
17
+ * without importing the core graph. */
18
+ export const EFFORTS = ['medium', 'high', 'xhigh', 'max'];
19
+
20
+ // Env keys a model entry may NOT set (§4.4): process fundamentals and worca's
21
+ // own runtime knobs, any of which injection could otherwise subvert (mock
22
+ // mode, the claude binary path, the effort flag name). Everything else —
23
+ // including all ANTHROPIC_* / CLAUDE_* — is allowed: routing them is the
24
+ // point. CLAUDE_CODE_SUBPROCESS_ENV_SCRUB is the CLI-2.1.220 permission-mode
25
+ // landmine documented at claude-runner.mjs#buildSpawnEnv.
26
+ export const RESERVED_MODEL_ENV_KEYS = [
27
+ 'PATH', 'HOME', 'TMPDIR', 'SHELL', 'USER', 'LOGNAME', 'TERM',
28
+ 'NODE_OPTIONS', 'NODE_EXTRA_CA_CERTS',
29
+ 'CLAUDECODE', 'CLAUDE_CODE_SUBPROCESS_ENV_SCRUB',
30
+ ];
31
+ export const RESERVED_MODEL_ENV_PREFIXES = ['WORCA_'];
32
+
33
+ /** Whether a model-env key is reserved (exact match or reserved prefix). */
34
+ export function isReservedModelEnvKey(key) {
35
+ return RESERVED_MODEL_ENV_KEYS.includes(key)
36
+ || RESERVED_MODEL_ENV_PREFIXES.some((p) => typeof key === 'string' && key.startsWith(p));
37
+ }
38
+
39
+ // Whole-value indirection only (§4.1): `${VARNAME}` and nothing else. Embedded
40
+ // refs ("prefix-${X}") are deliberately literals — no templating language.
41
+ const ENV_REF_RE = /^\$\{([A-Za-z_][A-Za-z0-9_]*)\}$/;
42
+
43
+ /** The var name a whole-value `${VARNAME}` env value points at, or null for a literal. */
44
+ export function modelEnvRef(value) {
45
+ const m = typeof value === 'string' ? value.match(ENV_REF_RE) : null;
46
+ return m ? m[1] : null;
47
+ }
48
+
49
+ /**
50
+ * Defensive spawn-time pass over a model entry's env (§4.4): drops reserved
51
+ * keys and non-string values, and expands whole-value ${VAR} refs from
52
+ * `sourceEnv` (an unset or empty var drops the key). Write-time validation
53
+ * already rejects reserved keys, so a drop here means a hand-edited settings
54
+ * file — the caller owns warning about `dropped`.
55
+ * @param {Record<string,*>|undefined} modelEnv
56
+ * @param {Record<string,string|undefined>} [sourceEnv]
57
+ * @returns {{env: Record<string,string>, dropped: string[]}}
58
+ */
59
+ export function prepareModelEnv(modelEnv, sourceEnv = process.env) {
60
+ const env = {};
61
+ const dropped = [];
62
+ for (const [k, v] of Object.entries(modelEnv || {})) {
63
+ if (isReservedModelEnvKey(k) || typeof v !== 'string') { dropped.push(k); continue; }
64
+ const ref = modelEnvRef(v);
65
+ if (ref !== null) {
66
+ const resolved = sourceEnv ? sourceEnv[ref] : undefined;
67
+ if (resolved === undefined || resolved === '') { dropped.push(k); continue; }
68
+ env[k] = resolved;
69
+ } else {
70
+ env[k] = v;
71
+ }
72
+ }
73
+ return { env, dropped };
74
+ }