@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.
- package/README.md +403 -0
- package/agents/clarify.meta.json +19 -0
- package/agents/decomposer.meta.json +21 -0
- package/agents/implementer.meta.json +20 -0
- package/agents/manualTestsChecklist.meta.json +18 -0
- package/agents/manualWebUiTesting.meta.json +18 -0
- package/agents/planReviewer.meta.json +19 -0
- package/agents/planner.meta.json +20 -0
- package/agents/refiner.meta.json +19 -0
- package/agents/reviewer.meta.json +19 -0
- package/agents/worca-cc-clarify.md +67 -0
- package/agents/worca-cc-code-reviewer.md +66 -0
- package/agents/worca-cc-decomposer.md +84 -0
- package/agents/worca-cc-implementer.md +69 -0
- package/agents/worca-cc-manual-tests-checklist.md +63 -0
- package/agents/worca-cc-manual-web-ui-testing.md +64 -0
- package/agents/worca-cc-plan-refiner.md +69 -0
- package/agents/worca-cc-plan-reviewer.md +70 -0
- package/agents/worca-cc-planner.md +70 -0
- package/agents/worca-cc-workspace-reviewer.md +56 -0
- package/agents/worca-cc-workspace-scanner.md +55 -0
- package/agents/workspaceReviewer.meta.json +20 -0
- package/agents/workspaceScanner.meta.json +18 -0
- package/package.json +61 -0
- package/scripts/install.mjs +209 -0
- package/skills/worca/SKILL.md +66 -0
- package/src/cli/worca-cc.mjs +1520 -0
- package/src/core/agent-gen.mjs +206 -0
- package/src/core/agent-registry.mjs +417 -0
- package/src/core/agent-store.mjs +143 -0
- package/src/core/artifacts.mjs +2019 -0
- package/src/core/channels.mjs +302 -0
- package/src/core/chat/allowlist.mjs +27 -0
- package/src/core/chat/channel-host.mjs +562 -0
- package/src/core/chat/channel-protocol.mjs +117 -0
- package/src/core/chat/channel-worker-child.mjs +211 -0
- package/src/core/chat/chat-context.mjs +66 -0
- package/src/core/chat/command-router.mjs +343 -0
- package/src/core/chat/notifier.mjs +120 -0
- package/src/core/chat/parser.mjs +30 -0
- package/src/core/chat/rate-limiter.mjs +133 -0
- package/src/core/chat/redact.mjs +27 -0
- package/src/core/chat/renderers.mjs +136 -0
- package/src/core/claude-runner.mjs +1356 -0
- package/src/core/config.mjs +882 -0
- package/src/core/cost-budget.mjs +103 -0
- package/src/core/db.mjs +864 -0
- package/src/core/fanout.mjs +48 -0
- package/src/core/folder-dialog.mjs +138 -0
- package/src/core/fs-browse.mjs +49 -0
- package/src/core/git-info.mjs +200 -0
- package/src/core/guardrail-store.mjs +204 -0
- package/src/core/guardrails.mjs +302 -0
- package/src/core/marketplaces.mjs +267 -0
- package/src/core/migrate-fs-to-db.mjs +612 -0
- package/src/core/model-env.mjs +74 -0
- package/src/core/orchestrator.mjs +4279 -0
- package/src/core/overview-agent.mjs +124 -0
- package/src/core/phases.mjs +1279 -0
- package/src/core/pipeline-delete.mjs +428 -0
- package/src/core/plugin-api.mjs +13 -0
- package/src/core/plugin-config.mjs +100 -0
- package/src/core/plugin-inventory.mjs +50 -0
- package/src/core/plugin-manifest.mjs +447 -0
- package/src/core/plugin-models.mjs +130 -0
- package/src/core/plugin-repo.mjs +303 -0
- package/src/core/plugin-shim-child.mjs +76 -0
- package/src/core/plugin-shim.mjs +197 -0
- package/src/core/plugin-store.mjs +485 -0
- package/src/core/plugin-workflows.mjs +179 -0
- package/src/core/plugins-lock.mjs +49 -0
- package/src/core/preflight-node.mjs +122 -0
- package/src/core/preflight.mjs +341 -0
- package/src/core/projects.mjs +157 -0
- package/src/core/protocol.mjs +257 -0
- package/src/core/recoverable-error.mjs +51 -0
- package/src/core/results.mjs +188 -0
- package/src/core/run-context.mjs +1375 -0
- package/src/core/run-log.mjs +64 -0
- package/src/core/run-manifest.mjs +317 -0
- package/src/core/runners.mjs +167 -0
- package/src/core/settings.mjs +682 -0
- package/src/core/skills.mjs +210 -0
- package/src/core/sources.mjs +232 -0
- package/src/core/stats.mjs +182 -0
- package/src/core/store.mjs +67 -0
- package/src/core/title.mjs +64 -0
- package/src/core/workflow-validator.mjs +185 -0
- package/src/core/workflows.mjs +568 -0
- package/src/core/workspace-scan.mjs +420 -0
- package/src/core/workspaces.mjs +353 -0
- package/src/core/worktree.mjs +708 -0
- package/src/feature.mjs +9 -0
- package/ui/public/app.js +10647 -0
- package/ui/public/assets/worca-favicon.png +0 -0
- package/ui/public/assets/worca-logo.png +0 -0
- package/ui/public/chat-settings-view.mjs +89 -0
- package/ui/public/composer-core.mjs +211 -0
- package/ui/public/fonts/jetbrains-mono-latin-400-normal.woff2 +0 -0
- package/ui/public/fonts/poppins-latin-400-normal.woff2 +0 -0
- package/ui/public/fonts/poppins-latin-500-normal.woff2 +0 -0
- package/ui/public/fonts/poppins-latin-600-normal.woff2 +0 -0
- package/ui/public/fonts/poppins-latin-700-normal.woff2 +0 -0
- package/ui/public/guardrails-view.mjs +244 -0
- package/ui/public/index.html +1145 -0
- package/ui/public/log-filter.mjs +81 -0
- package/ui/public/log-line.mjs +86 -0
- package/ui/public/models-view.mjs +433 -0
- package/ui/public/plugins-view.mjs +430 -0
- package/ui/public/results-view.mjs +121 -0
- package/ui/public/source-pane.mjs +156 -0
- package/ui/public/stats-view.mjs +523 -0
- package/ui/public/style.css +1557 -0
- 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
|
+
}
|