@dirgha/code 1.17.1 → 1.18.0
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/CHANGELOG.md +130 -45
- package/README.md +34 -25
- package/dist/cli/config.d.ts +2 -0
- package/dist/cli/config.js +16 -1
- package/dist/cli/config.js.map +1 -1
- package/dist/cli/flows/tarball.js +26 -21
- package/dist/cli/flows/tarball.js.map +1 -1
- package/dist/cli/flows/wizard.d.ts +1 -1
- package/dist/cli/flows/wizard.js +282 -163
- package/dist/cli/flows/wizard.js.map +1 -1
- package/dist/cli/interactive.js +11 -3
- package/dist/cli/interactive.js.map +1 -1
- package/dist/cli/main.js +77 -7
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/models-cmd.js +18 -20
- package/dist/cli/models-cmd.js.map +1 -1
- package/dist/cli/slash/fleet.d.ts +1 -1
- package/dist/cli/slash/fleet.js +25 -16
- package/dist/cli/slash/fleet.js.map +1 -1
- package/dist/cli/slash/fs.js +1 -3
- package/dist/cli/slash/fs.js.map +1 -1
- package/dist/cli/slash/login.d.ts +2 -2
- package/dist/cli/slash/login.js +8 -8
- package/dist/cli/slash/login.js.map +1 -1
- package/dist/cli/slash/models.js +3 -4
- package/dist/cli/slash/models.js.map +1 -1
- package/dist/cli/slash/paste.d.ts +1 -1
- package/dist/cli/slash/paste.js +87 -41
- package/dist/cli/slash/paste.js.map +1 -1
- package/dist/cli/slash/provider.js +2 -2
- package/dist/cli/slash/provider.js.map +1 -1
- package/dist/cli/slash/session.js +4 -1
- package/dist/cli/slash/session.js.map +1 -1
- package/dist/cli/subcommands/doctor.js +48 -0
- package/dist/cli/subcommands/doctor.js.map +1 -1
- package/dist/cli/subcommands/history.d.ts +8 -0
- package/dist/cli/subcommands/history.js +45 -0
- package/dist/cli/subcommands/history.js.map +1 -0
- package/dist/cli/subcommands/index.js +4 -0
- package/dist/cli/subcommands/index.js.map +1 -1
- package/dist/cli/subcommands/login.d.ts +1 -1
- package/dist/cli/subcommands/login.js +42 -34
- package/dist/cli/subcommands/login.js.map +1 -1
- package/dist/cli/subcommands/scaffold.js +6 -2
- package/dist/cli/subcommands/scaffold.js.map +1 -1
- package/dist/cli/subcommands/state.d.ts +8 -0
- package/dist/cli/subcommands/state.js +44 -0
- package/dist/cli/subcommands/state.js.map +1 -0
- package/dist/cli/subcommands/web.d.ts +1 -1
- package/dist/cli/subcommands/web.js +17 -14
- package/dist/cli/subcommands/web.js.map +1 -1
- package/dist/context/compaction.d.ts +3 -3
- package/dist/context/compaction.js +85 -37
- package/dist/context/compaction.js.map +1 -1
- package/dist/context/default-soul.md +5 -1
- package/dist/context/kb-init.d.ts +7 -0
- package/dist/context/kb-init.js +51 -0
- package/dist/context/kb-init.js.map +1 -0
- package/dist/context/ledger.js +3 -3
- package/dist/context/ledger.js.map +1 -1
- package/dist/context/memory.js +3 -0
- package/dist/context/memory.js.map +1 -1
- package/dist/context/primer.js +2 -0
- package/dist/context/primer.js.map +1 -1
- package/dist/context/session.js +5 -0
- package/dist/context/session.js.map +1 -1
- package/dist/daemon/server.d.ts +4 -0
- package/dist/daemon/server.js +81 -29
- package/dist/daemon/server.js.map +1 -1
- package/dist/fleet/apply-back.d.ts +1 -1
- package/dist/fleet/apply-back.js +90 -48
- package/dist/fleet/apply-back.js.map +1 -1
- package/dist/fleet/cli-command.d.ts +2 -2
- package/dist/fleet/cli-command.js +189 -72
- package/dist/fleet/cli-command.js.map +1 -1
- package/dist/fleet/dag.d.ts +38 -0
- package/dist/fleet/dag.js +77 -0
- package/dist/fleet/dag.js.map +1 -0
- package/dist/fleet/ledger-hook.d.ts +15 -0
- package/dist/fleet/ledger-hook.js +67 -0
- package/dist/fleet/ledger-hook.js.map +1 -0
- package/dist/fleet/runner.js +38 -5
- package/dist/fleet/runner.js.map +1 -1
- package/dist/fleet/scratchpad-tools.d.ts +13 -0
- package/dist/fleet/scratchpad-tools.js +73 -0
- package/dist/fleet/scratchpad-tools.js.map +1 -0
- package/dist/fleet/scratchpad.d.ts +28 -0
- package/dist/fleet/scratchpad.js +93 -0
- package/dist/fleet/scratchpad.js.map +1 -0
- package/dist/fleet/state.d.ts +37 -0
- package/dist/fleet/state.js +82 -0
- package/dist/fleet/state.js.map +1 -0
- package/dist/fleet/tripleshot.d.ts +2 -2
- package/dist/fleet/tripleshot.js +61 -48
- package/dist/fleet/tripleshot.js.map +1 -1
- package/dist/fleet/types.d.ts +4 -0
- package/dist/fleet/types.js.map +1 -1
- package/dist/fleet/worktree.d.ts +5 -0
- package/dist/fleet/worktree.js +82 -11
- package/dist/fleet/worktree.js.map +1 -1
- package/dist/hooks/config-bridge.d.ts +2 -2
- package/dist/hooks/config-bridge.js +49 -19
- package/dist/hooks/config-bridge.js.map +1 -1
- package/dist/integrations/arniko-client.d.ts +1 -1
- package/dist/integrations/arniko-client.js +32 -26
- package/dist/integrations/arniko-client.js.map +1 -1
- package/dist/integrations/device-auth.js +53 -42
- package/dist/integrations/device-auth.js.map +1 -1
- package/dist/intelligence/cost.js +13 -7
- package/dist/intelligence/cost.js.map +1 -1
- package/dist/intelligence/failover-chain.d.ts +27 -0
- package/dist/intelligence/failover-chain.js +70 -0
- package/dist/intelligence/failover-chain.js.map +1 -0
- package/dist/intelligence/models-dev-sync.js +10 -3
- package/dist/intelligence/models-dev-sync.js.map +1 -1
- package/dist/intelligence/prices.js +1 -1
- package/dist/intelligence/prices.js.map +1 -1
- package/dist/kernel/agent-loop.js +74 -17
- package/dist/kernel/agent-loop.js.map +1 -1
- package/dist/kernel/event-stream.d.ts +7 -2
- package/dist/kernel/event-stream.js +63 -9
- package/dist/kernel/event-stream.js.map +1 -1
- package/dist/kernel/message.d.ts +2 -2
- package/dist/kernel/message.js +45 -30
- package/dist/kernel/message.js.map +1 -1
- package/dist/kernel/types.d.ts +1 -1
- package/dist/lsp/client.js +16 -7
- package/dist/lsp/client.js.map +1 -1
- package/dist/providers/deepseek.d.ts +2 -2
- package/dist/providers/deepseek.js +21 -21
- package/dist/providers/deepseek.js.map +1 -1
- package/dist/providers/health.d.ts +4 -1
- package/dist/providers/health.js +24 -9
- package/dist/providers/health.js.map +1 -1
- package/dist/providers/http.d.ts +2 -0
- package/dist/providers/http.js +42 -22
- package/dist/providers/http.js.map +1 -1
- package/dist/providers/openai-compat.js +30 -27
- package/dist/providers/openai-compat.js.map +1 -1
- package/dist/providers/openrouter.d.ts +2 -2
- package/dist/providers/openrouter.js +25 -16
- package/dist/providers/openrouter.js.map +1 -1
- package/dist/safety/approval-bus.js +1 -1
- package/dist/safety/approval-bus.js.map +1 -1
- package/dist/safety/policy.d.ts +3 -3
- package/dist/safety/policy.js +60 -47
- package/dist/safety/policy.js.map +1 -1
- package/dist/safety/sandbox/noop.d.ts +2 -2
- package/dist/safety/sandbox/noop.js +23 -15
- package/dist/safety/sandbox/noop.js.map +1 -1
- package/dist/safety/sandbox/seatbelt.d.ts +1 -1
- package/dist/safety/sandbox/seatbelt.js +16 -9
- package/dist/safety/sandbox/seatbelt.js.map +1 -1
- package/dist/state/db.d.ts +28 -0
- package/dist/state/db.js +129 -0
- package/dist/state/db.js.map +1 -0
- package/dist/state/index.d.ts +23 -0
- package/dist/state/index.js +119 -0
- package/dist/state/index.js.map +1 -0
- package/dist/subagents/delegator.d.ts +8 -0
- package/dist/subagents/delegator.js +22 -5
- package/dist/subagents/delegator.js.map +1 -1
- package/dist/telemetry/crash-report.js +111 -79
- package/dist/telemetry/crash-report.js.map +1 -1
- package/dist/tools/browser.d.ts +1 -1
- package/dist/tools/browser.js +62 -45
- package/dist/tools/browser.js.map +1 -1
- package/dist/tools/checkpoint.js +3 -0
- package/dist/tools/checkpoint.js.map +1 -1
- package/dist/tools/cron.d.ts +1 -1
- package/dist/tools/cron.js +61 -41
- package/dist/tools/cron.js.map +1 -1
- package/dist/tools/exec.js +36 -1
- package/dist/tools/exec.js.map +1 -1
- package/dist/tools/fs-edit.js +4 -1
- package/dist/tools/fs-edit.js.map +1 -1
- package/dist/tools/fs-ls.js +4 -1
- package/dist/tools/fs-ls.js.map +1 -1
- package/dist/tools/fs-read.js +4 -1
- package/dist/tools/fs-read.js.map +1 -1
- package/dist/tools/fs-write.js +4 -1
- package/dist/tools/fs-write.js.map +1 -1
- package/dist/tools/git.d.ts +1 -1
- package/dist/tools/git.js +45 -25
- package/dist/tools/git.js.map +1 -1
- package/dist/tools/index.d.ts +3 -1
- package/dist/tools/index.js +5 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/lsp-definition.js +10 -1
- package/dist/tools/lsp-definition.js.map +1 -1
- package/dist/tools/lsp-hover.js +10 -1
- package/dist/tools/lsp-hover.js.map +1 -1
- package/dist/tools/lsp-references.js +10 -1
- package/dist/tools/lsp-references.js.map +1 -1
- package/dist/tools/lsp-symbols.js +10 -1
- package/dist/tools/lsp-symbols.js.map +1 -1
- package/dist/tools/multimodal.d.ts +2 -2
- package/dist/tools/multimodal.js +141 -90
- package/dist/tools/multimodal.js.map +1 -1
- package/dist/tools/qmd.d.ts +15 -0
- package/dist/tools/qmd.js +107 -0
- package/dist/tools/qmd.js.map +1 -0
- package/dist/tools/registry.d.ts +5 -0
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/rtk.d.ts +12 -0
- package/dist/tools/rtk.js +113 -0
- package/dist/tools/rtk.js.map +1 -0
- package/dist/tools/search-grep.js +1 -0
- package/dist/tools/search-grep.js.map +1 -1
- package/dist/tools/shell.js +25 -16
- package/dist/tools/shell.js.map +1 -1
- package/dist/tui/approval.d.ts +1 -1
- package/dist/tui/approval.js +38 -14
- package/dist/tui/approval.js.map +1 -1
- package/dist/tui/ink/App.js +88 -69
- package/dist/tui/ink/App.js.map +1 -1
- package/dist/tui/ink/components/DenseToolMessage.js +2 -8
- package/dist/tui/ink/components/DenseToolMessage.js.map +1 -1
- package/dist/tui/ink/components/InputBox.js +1 -1
- package/dist/tui/ink/components/InputBox.js.map +1 -1
- package/dist/tui/ink/components/StatusBar.js +2 -21
- package/dist/tui/ink/components/StatusBar.js.map +1 -1
- package/dist/tui/ink/components/ThinkingBlock.js +3 -3
- package/dist/tui/ink/components/ThinkingBlock.js.map +1 -1
- package/dist/tui/ink/components/ToolBox.js +3 -23
- package/dist/tui/ink/components/ToolBox.js.map +1 -1
- package/dist/tui/ink/components/ToolGroup.js +2 -8
- package/dist/tui/ink/components/ToolGroup.js.map +1 -1
- package/dist/tui/ink/ink-approval-bus.js +4 -1
- package/dist/tui/ink/ink-approval-bus.js.map +1 -1
- package/dist/tui/ink/spinner-context.d.ts +3 -0
- package/dist/tui/ink/spinner-context.js +6 -0
- package/dist/tui/ink/spinner-context.js.map +1 -0
- package/dist/tui/ink/use-event-projection.js +142 -37
- package/dist/tui/ink/use-event-projection.js.map +1 -1
- package/dist/tui/renderer.js +9 -1
- package/dist/tui/renderer.js.map +1 -1
- package/dist/web/ledger.d.ts +1 -1
- package/dist/web/ledger.js +44 -20
- package/dist/web/ledger.js.map +1 -1
- package/dist/web/server.js +4 -3
- package/dist/web/server.js.map +1 -1
- package/package.json +16 -12
- package/vendor/qmd/VERSION +3 -0
- package/vendor/rtk/CHECKSUMS.txt +6 -0
- package/vendor/rtk/VERSION +3 -0
- package/vendor/rtk/linux-x64/rtk +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,122 +2,201 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes are tracked here. Format loosely follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); we use [Semantic Versioning](https://semver.org/).
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## [1.18.0] — Kernel hardening, supply-chain hardening, security audit
|
|
6
|
+
|
|
7
|
+
### Stability
|
|
8
|
+
|
|
9
|
+
- EPIPE/EIO crash guards: process stdout/stderr/stdin error handlers prevent crash-log spam on PTY close.
|
|
10
|
+
- Stall detection: HTTP streaming aborts after 30s of no bytes received (prevents 5-min hangs).
|
|
11
|
+
- Crash log rotation: auto-rotates at 10 MB, keeps last 200 entries.
|
|
12
|
+
- Per-tool timeout enforcement: every tool gets a configurable `timeoutMs`; shell defaults to 5 min.
|
|
13
|
+
- Event queue backpressure: queue overflow emits a synthetic `backpressure` error event instead of silent drops; `drain()` API added.
|
|
14
|
+
|
|
15
|
+
### Daemon
|
|
16
|
+
|
|
17
|
+
- Graceful shutdown: state-machine (`running → shuttingDown → exited`), AbortController signals all in-flight agents, 10s deadline, session flush.
|
|
18
|
+
|
|
19
|
+
### Providers
|
|
20
|
+
|
|
21
|
+
- Failover cascade: `buildFailoverChain()` — 4-tier chain (user → same-family → registry → free), health-aware.
|
|
22
|
+
- DeepSeek-native prefix stripping (`deepseek-native/`).
|
|
23
|
+
- OpenRouter thinking pattern fix for `tencent/hy3` models.
|
|
24
|
+
- OpenAI-compat: synthetic tool call IDs, try/finally around SSE loop, dead `thinkBuffer` removed.
|
|
25
|
+
- Health scoring: 60s TTL compaction prunes stale windows; NaN/latency/cost fixes.
|
|
26
|
+
|
|
27
|
+
### Security
|
|
28
|
+
|
|
29
|
+
- Shell injection fix in hooks config-bridge (argv splitting, shell: false).
|
|
30
|
+
- Path traversal bypass fixed in safety policy (relative path resolution).
|
|
31
|
+
- Seatbelt profile injection blocked (reject unsafe chars).
|
|
32
|
+
- PowerShell command injection fixed in /paste.
|
|
33
|
+
|
|
34
|
+
### Kernel
|
|
35
|
+
|
|
36
|
+
- Event-stream handler recursion guard (max depth 1).
|
|
37
|
+
- contextTransform errors isolated from provider errors.
|
|
38
|
+
- `toolResultMessage` accepts configurable role.
|
|
39
|
+
- `assembleTurn` handles duplicate tool IDs, unmatched toolcall_end, missing toolcall_start.
|
|
40
|
+
- `maxTurns` clamping (0–1000), validated at config load.
|
|
41
|
+
- `StopReason` union expanded with `max_turns`.
|
|
42
|
+
|
|
43
|
+
### Tools
|
|
44
|
+
|
|
45
|
+
- Git cwd separator fix (`startsWith` → `startsWith(cwd + sep)`).
|
|
46
|
+
- Shell `exit` → `close` event for pipe closure handling.
|
|
47
|
+
- Cron atomic writes (temp file + rename), `dirname()` instead of `lastIndexOf('/')`.
|
|
48
|
+
- Browser connection check (`isConnected?.() !== false`).
|
|
49
|
+
- Multimodal path containment check.
|
|
50
|
+
- Tripleshot `handleFor` null-safe return.
|
|
51
|
+
|
|
52
|
+
### CLI/TUI
|
|
53
|
+
|
|
54
|
+
- Config schema versioning (`schemaVersion: 1`) with `migrateConfigSchema()`.
|
|
55
|
+
- Silent config loss now warns to stderr.
|
|
56
|
+
- Null config spread guard (`value !== null` check).
|
|
57
|
+
- ThinkingBlock: `useInput({ isActive: false })` fixes Enter-after-paste; text color changed to white.
|
|
58
|
+
- commitLive race condition fixed (liveItemsRef synchronous mirror).
|
|
59
|
+
- Slash dispatch errors caught and surfaced instead of freezing REPL.
|
|
60
|
+
- Fleet stdout monkey-patch scoped and restored.
|
|
61
|
+
- Input approval stdin error handling.
|
|
62
|
+
|
|
63
|
+
### Fleet
|
|
64
|
+
|
|
65
|
+
- DAG workflows: `runDag()` chains agents sequentially with cumulative context propagation.
|
|
66
|
+
- `withLock` timeout recovery with atomic write fallback.
|
|
67
|
+
- `ledger-hook` empty array guard.
|
|
68
|
+
|
|
69
|
+
### Security (second pass — depth audit)
|
|
70
|
+
|
|
71
|
+
- Path traversal in `/memory` — `assertValidKey()` now enforced in `get`, `upsert`, `remove` (previously only in the adapter's `save`).
|
|
72
|
+
- Path traversal in `/session rename` — `sessionPath()` validates id via `basename()` before building the file path.
|
|
73
|
+
- Path traversal in `scaffold --name` — `deriveName()` rejects names containing path separators.
|
|
74
|
+
- API key leak in TUI — `inputFocus` is now `false` when `KeySetOverlay` or `ApprovalPrompt` is active; keystrokes no longer bleed into the chat input box.
|
|
75
|
+
- `meta/llama-3.3-70b-instruct` was misattributed to `provider: "nvidia"` in `prices.ts` while dispatch routes it via OpenRouter — cost tracking now matches actual routing.
|
|
76
|
+
|
|
77
|
+
### Reliability (second pass)
|
|
78
|
+
|
|
79
|
+
- `cost.ts` NaN guard — malformed token counts from providers no longer poison session totals; `safeInt()` sanitizes before accumulation.
|
|
80
|
+
- `lsp/client.ts` timer leak — `setTimeout` handle now `clearTimeout`-ed when response resolves first; accumulation across long sessions prevented.
|
|
81
|
+
- `models-dev-sync.ts` — `getCatalogue()` falls back to stale cache on network failure instead of throwing.
|
|
82
|
+
- `web/server.ts` URL routing — route matching now uses `URL.pathname` so query-string requests (e.g. `?foo=bar`) are handled correctly.
|
|
83
|
+
|
|
84
|
+
### TUI
|
|
85
|
+
|
|
86
|
+
- `ThinkingBlock` — `isActive: false` on `useInput` was silently dead; expand/collapse via Enter now works.
|
|
87
|
+
|
|
88
|
+
### CI / Supply-chain
|
|
6
89
|
|
|
7
90
|
- `npm audit --audit-level=high --omit=dev` is now a CI gate (blocks PRs with high+ CVEs).
|
|
8
|
-
- SBOM emitted on every release in CycloneDX + SPDX formats;
|
|
9
|
-
- Bundle-size budget
|
|
91
|
+
- SBOM emitted on every release in CycloneDX + SPDX formats; cosign-signed and attached to GitHub Releases.
|
|
92
|
+
- Bundle-size budget updated to 6 MB (vendor/rtk binary included since v1.17).
|
|
10
93
|
- Dependabot weekly PRs (grouped: eslint, ink, types, vitest stack).
|
|
11
94
|
- OpenSSF Scorecard runs weekly + on push to main; result published to scorecard.dev.
|
|
12
|
-
-
|
|
95
|
+
- TypeScript upgraded to `^5.9.3` (required by `@tobilu/qmd` peer dep); Buffer type strictness fixes across 7 files.
|
|
96
|
+
- `react` pinned to `^18.3.1` to satisfy `react-reconciler@0.29.2` peer dep.
|
|
13
97
|
|
|
14
|
-
|
|
98
|
+
### Tests
|
|
15
99
|
|
|
100
|
+
- 104 tests passing (97 → 104: +4 fleet DAG, +3 TUI render).
|
|
101
|
+
- TypeScript 0 errors, ESLint 0 warnings.
|
|
102
|
+
- All 30+ CLI subcommands smoke-tested.
|
|
103
|
+
- Full codebase depth audit: 14 parallel agents × all subsystems, 25+ bugs identified and fixed.
|
|
104
|
+
|
|
105
|
+
## [1.13.1](https://github.com/Dirgha-AI/dirgha-code/compare/v1.13.0...v1.13.1) (2026-04-30)
|
|
16
106
|
|
|
17
107
|
### Bug Fixes
|
|
18
108
|
|
|
19
|
-
|
|
109
|
+
- reasoning_content multi-turn + /up alias ([9920e61](https://github.com/Dirgha-AI/dirgha-code/commit/9920e61a2b2244d7fde4debe2d5b5ff49c77b54b))
|
|
20
110
|
|
|
21
111
|
## [1.13.0](https://github.com/Dirgha-AI/dirgha-code/compare/v1.12.3...v1.13.0) (2026-04-30)
|
|
22
112
|
|
|
23
|
-
|
|
24
113
|
### Features
|
|
25
114
|
|
|
26
|
-
|
|
27
|
-
|
|
115
|
+
- **providers:** add DeepSeek native models + fix NVIDIA NIM routing ([48eb272](https://github.com/Dirgha-AI/dirgha-code/commit/48eb27211157a57d50cbc3e68ebeffb63f345239))
|
|
28
116
|
|
|
29
117
|
### Bug Fixes
|
|
30
118
|
|
|
31
|
-
|
|
32
|
-
|
|
119
|
+
- inline key setup overlay + pack update resilience + Windows update crash ([af259cc](https://github.com/Dirgha-AI/dirgha-code/commit/af259cc4112cd3be0641eeaf6253dd2e8de2f4e5))
|
|
120
|
+
- **tests:** update dispatch tests + add DeepSeek V4/Prover prices ([1d4856f](https://github.com/Dirgha-AI/dirgha-code/commit/1d4856f1d18abca83ad301e3be4969143c136193))
|
|
33
121
|
|
|
34
122
|
## [1.12.3](https://github.com/Dirgha-AI/dirgha-code/compare/v1.12.2...v1.12.3) (2026-04-28)
|
|
35
123
|
|
|
36
|
-
|
|
37
124
|
### Bug Fixes
|
|
38
125
|
|
|
39
|
-
|
|
126
|
+
- **slash:** /provider list reads from dispatch — adds 8 missing providers ([5a2741e](https://github.com/Dirgha-AI/dirgha-code/commit/5a2741e9177d325731292dd5302841cf6ff16565))
|
|
40
127
|
|
|
41
128
|
## [1.12.2](https://github.com/Dirgha-AI/dirgha-code/compare/v1.12.1...v1.12.2) (2026-04-28)
|
|
42
129
|
|
|
43
|
-
|
|
44
130
|
### Bug Fixes
|
|
45
131
|
|
|
46
|
-
|
|
132
|
+
- **windows:** cross-platform shell + auto readline-fallback + mount banner ([ecef403](https://github.com/Dirgha-AI/dirgha-code/commit/ecef4038249961fe3da6f73925d9a0851df2c7b0))
|
|
47
133
|
|
|
48
134
|
## [1.12.1](https://github.com/Dirgha-AI/dirgha-code/compare/v1.12.0...v1.12.1) (2026-04-28)
|
|
49
135
|
|
|
50
|
-
|
|
51
136
|
### Bug Fixes
|
|
52
137
|
|
|
53
|
-
|
|
138
|
+
- **tui:** Ink-native approval prompt — fixes tool-stall on Windows ([2612454](https://github.com/Dirgha-AI/dirgha-code/commit/26124547222fe8d556fec10b294627bdb8c7361e))
|
|
54
139
|
|
|
55
140
|
## [1.12.0](https://github.com/Dirgha-AI/dirgha-code/compare/v1.11.0...v1.12.0) (2026-04-28)
|
|
56
141
|
|
|
57
|
-
|
|
58
142
|
### Features
|
|
59
143
|
|
|
60
|
-
|
|
144
|
+
- **tui:** two-step provider→model picker + 2026-04-28 OpenRouter top models ([ceaa720](https://github.com/Dirgha-AI/dirgha-code/commit/ceaa720d93d4de00d97717516a06f3154ef510b8))
|
|
61
145
|
|
|
62
146
|
## [1.11.0](https://github.com/Dirgha-AI/dirgha-code/compare/v1.10.0...v1.11.0) (2026-04-28)
|
|
63
147
|
|
|
64
|
-
|
|
65
148
|
### Features
|
|
66
149
|
|
|
67
|
-
|
|
150
|
+
- **providers:** add 8 native providers + missing-key warning on /models switch ([4b07807](https://github.com/Dirgha-AI/dirgha-code/commit/4b078075c067eb9a0db49484c208f951b789f908))
|
|
68
151
|
|
|
69
152
|
## [1.10.0](https://github.com/Dirgha-AI/dirgha-code/compare/v1.9.0...v1.10.0) (2026-04-28)
|
|
70
153
|
|
|
71
|
-
|
|
72
154
|
### Features
|
|
73
155
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
156
|
+
- model-switch prompt + opencode picker + /provider skill ([587fe72](https://github.com/Dirgha-AI/dirgha-code/commit/587fe72b87a5a7f495386c859df6dff7ab35c23b))
|
|
157
|
+
- **tui:** connected-border tool group + DenseToolMessage (gemini parity) ([72077c7](https://github.com/Dirgha-AI/dirgha-code/commit/72077c72d5c35dd080da5574239748516aa80cbd))
|
|
158
|
+
- **tui:** native markdown rendering + semantic theme tokens + 5 themes ([49130b1](https://github.com/Dirgha-AI/dirgha-code/commit/49130b1ca7191b186fd3d72eb1b0943cccfeee93))
|
|
78
159
|
|
|
79
160
|
### Bug Fixes
|
|
80
161
|
|
|
81
|
-
|
|
82
|
-
|
|
162
|
+
- auto-migrate deprecated model IDs + readable theme + busy-state hint ([50c0c50](https://github.com/Dirgha-AI/dirgha-code/commit/50c0c507a390d2da17c0f8b262ca93b8bb806557))
|
|
163
|
+
- **tui:** busy-hint reads 'ctrl+c clear' instead of 'ctrl+c×2 exit' ([6b0f367](https://github.com/Dirgha-AI/dirgha-code/commit/6b0f367295d3a30ccc1ae8fe7911b69e561d1709))
|
|
83
164
|
|
|
84
165
|
## [1.9.0](https://github.com/Dirgha-AI/dirgha-code/compare/v1.8.1...v1.9.0) (2026-04-28)
|
|
85
166
|
|
|
86
|
-
|
|
87
167
|
### Features
|
|
88
168
|
|
|
89
|
-
|
|
90
|
-
|
|
169
|
+
- **providers,ask:** DeepSeek native provider + dirgha ask --cwd ([ab4351f](https://github.com/Dirgha-AI/dirgha-code/commit/ab4351f8cd9ae76973fc4af1afdfd3b3c0135ce9))
|
|
91
170
|
|
|
92
171
|
### Bug Fixes
|
|
93
172
|
|
|
94
|
-
|
|
173
|
+
- **audit-codebase,gitignore:** add --help handler + un-ignore dist/ ([76c3c0a](https://github.com/Dirgha-AI/dirgha-code/commit/76c3c0a31dbb9337710f195c24b2e52497d154b7))
|
|
95
174
|
|
|
96
175
|
## [1.8.1](https://github.com/Dirgha-AI/dirgha-code/compare/v1.8.0...v1.8.1) (2026-04-28)
|
|
97
176
|
|
|
98
|
-
|
|
99
177
|
### Bug Fixes
|
|
100
178
|
|
|
101
|
-
|
|
102
|
-
|
|
179
|
+
- **ci:** pin ossf/scorecard-action to correct v2.4.3 SHA ([b92f002](https://github.com/Dirgha-AI/dirgha-code/commit/b92f0022877a531d7b16edc9442b839e25ab518f))
|
|
180
|
+
- **ci:** repin three actions to verified-real SHAs ([491e799](https://github.com/Dirgha-AI/dirgha-code/commit/491e799ba239a60996a3a770052d2792be10d523))
|
|
103
181
|
|
|
104
182
|
## [1.8.0](https://github.com/Dirgha-AI/dirgha-code/compare/v1.7.15...v1.8.0) (2026-04-28)
|
|
105
183
|
|
|
106
|
-
|
|
107
184
|
### Features
|
|
108
185
|
|
|
109
|
-
|
|
110
|
-
|
|
186
|
+
- **scaffold:** dirgha scaffold "<prompt>" — instant Vite/Hono starter ([1ff456b](https://github.com/Dirgha-AI/dirgha-code/commit/1ff456b6defda145881509963b723a69b8e343bb))
|
|
187
|
+
- **tui:** Ctrl+C clears buffer + non-disruptive prompt queue ([12fe781](https://github.com/Dirgha-AI/dirgha-code/commit/12fe7817b16f8710fbf99f8900f3ba6fd9fc6579))
|
|
111
188
|
|
|
112
189
|
## 1.7.12 — 2026-04-28
|
|
113
190
|
|
|
114
191
|
**CI-6 — Posthog telemetry endpoint live + minimal-data schema.**
|
|
115
192
|
|
|
116
193
|
### Added
|
|
194
|
+
|
|
117
195
|
- `src_v2/telemetry/sender.ts` — Posthog-compatible sender, fires events on subcommand exit (when opt-in).
|
|
118
196
|
- 1s `Promise.race` cap so a slow Posthog never blocks the user.
|
|
119
197
|
|
|
120
198
|
### Changed
|
|
199
|
+
|
|
121
200
|
- Telemetry payload tightened to **5 fields** for command events (event, version, command, os, node) — no more `os_release`, `arch`, `duration_ms`. **6 fields** on errors (+ `error_class`).
|
|
122
201
|
- `docs/privacy/CLI-TELEMETRY.md` updated with the exact minimum data table.
|
|
123
202
|
|
|
@@ -126,11 +205,13 @@ All notable changes are tracked here. Format loosely follows [Keep a Changelog](
|
|
|
126
205
|
**CI-3 + CI-4 — multi-agent UX scorer + telemetry scaffold.**
|
|
127
206
|
|
|
128
207
|
### Added
|
|
208
|
+
|
|
129
209
|
- `tools/ux-scorer/run.mjs` — N-judge fleet records 5 scripted journeys via tmux, scores against `tools/ux-scorer/rubric.md`. Median ≥ 7.0 release-blocking.
|
|
130
210
|
- Default judge: `inclusionai/ling-2.6-1t:free`. Optional: `tencent/hy3-preview:free`, `deepseek-v4-pro`, `kimi-k2`.
|
|
131
211
|
- `dirgha telemetry <status|enable|disable|endpoint>` subcommand. Default OFF.
|
|
132
212
|
|
|
133
213
|
### Fixed
|
|
214
|
+
|
|
134
215
|
- ux-scorer unsets `CI`/`GITHUB_ACTIONS`/`CONTINUOUS_INTEGRATION` before launching `dirgha` inside tmux so Ink doesn't suppress dynamic output (`is-in-ci` detection).
|
|
135
216
|
|
|
136
217
|
## 1.7.10 — 2026-04-28
|
|
@@ -138,11 +219,13 @@ All notable changes are tracked here. Format loosely follows [Keep a Changelog](
|
|
|
138
219
|
**CI-2 — headless Ink overlay tests + StatusBar tok/s.**
|
|
139
220
|
|
|
140
221
|
### Added
|
|
222
|
+
|
|
141
223
|
- `scripts/qa-app/ink_unit_test.mjs` extended to 11 assertions — `/help`, `/theme`, `/models` slash overlay journeys.
|
|
142
224
|
- `FakeStdin` upgraded to a Readable-stream mimic (Ink listens on `'readable'`, not `'data'`).
|
|
143
225
|
- StatusBar now actually computes `tok/s` (was a declared-but-unused prop). 4 cases covered: arithmetic, idle, zero-output, sub-250ms warmup.
|
|
144
226
|
|
|
145
227
|
### Fixed
|
|
228
|
+
|
|
146
229
|
- `tool_exec_end → done` Ink test regex allows the tool icon glyph between ✓ and "Shell".
|
|
147
230
|
- Ink CI-mode suppressed dynamic output → `debug:true` escape.
|
|
148
231
|
- `kb` test reclassified `needs: 'NETWORK'` (was sneakily network-bound).
|
|
@@ -152,9 +235,11 @@ All notable changes are tracked here. Format loosely follows [Keep a Changelog](
|
|
|
152
235
|
**CI-1 — production-grade pre-release gates + `/theme` bug fix.**
|
|
153
236
|
|
|
154
237
|
### Fixed
|
|
238
|
+
|
|
155
239
|
- `/theme` overlay race condition (1.7.8 regression): SlashComplete `onPick` and InputBox `onSubmit` both fire on Enter; explicit `setActive(null)` was overwriting `openOverlay('theme')`. Removed the explicit clear; the `useEffect` on `slashQuery=null` handles cleanup safely.
|
|
156
240
|
|
|
157
241
|
### Added
|
|
242
|
+
|
|
158
243
|
- ESLint flat config + `npm run lint` (max-warnings 25 baseline).
|
|
159
244
|
- `npm run license-check` (fails on GPL/AGPL/LGPL).
|
|
160
245
|
- Cross-OS CI matrix: ubuntu × macos × windows × Node 20/22.
|
|
@@ -337,10 +422,10 @@ Second-generation CLI core under `src_v2/`, shipped as the `dirgha-v2` binary al
|
|
|
337
422
|
|
|
338
423
|
Adopted industry-standard terms from the multi-agent workspace ecosystem audit (ccpm, claudio, genie, devteam, citadel, maw, agent-worktree):
|
|
339
424
|
|
|
340
|
-
| Term
|
|
341
|
-
|
|
342
|
-
| **worktree** | Isolation unit (git worktree)
|
|
343
|
-
| **fleet**
|
|
344
|
-
| **subtask**
|
|
345
|
-
| **runtime**
|
|
346
|
-
| **skill**
|
|
425
|
+
| Term | Meaning |
|
|
426
|
+
| ------------ | ----------------------------------------------------- |
|
|
427
|
+
| **worktree** | Isolation unit (git worktree) |
|
|
428
|
+
| **fleet** | Parallel agents on one goal |
|
|
429
|
+
| **subtask** | Parallelizable stream within a fleet |
|
|
430
|
+
| **runtime** | Compute environment (local / worktree / SSH — future) |
|
|
431
|
+
| **skill** | Reusable capability bundle (CLI-Anything) |
|
package/README.md
CHANGED
|
@@ -6,13 +6,21 @@
|
|
|
6
6
|
[](./LICENSE)
|
|
7
7
|
[](https://dirgha.ai/contribute)
|
|
8
8
|
|
|
9
|
-
**Dirgha Code is
|
|
9
|
+
**Dirgha Code is the open-source CLI coding agent — 17 providers, BYOK, offline-capable, parallel agents, persistent memory, security-audited. One install command. No vendor lock-in.**
|
|
10
10
|
|
|
11
11
|
</div>
|
|
12
12
|
|
|
13
|
+
## The Seed: Why the CLI Comes First
|
|
14
|
+
|
|
15
|
+
Every operating system starts with a kernel. Dirgha Code — the open-source command-line agent — is the kernel of Dirgha AI OS. It is the smallest, most installable, most hackable piece of the stack: one install command, runs fully offline, ships under FSL → MIT.
|
|
16
|
+
|
|
17
|
+
By design, the CLI is the entry point for every developer — whether you're on a 10 Gbps fiber line or a shared 4G hotspot, in a WeWork in Bengaluru or a basement in Berlin. No browser, no paid account, no telemetry by default. Just `npm install -g @dirgha/code` and a terminal.
|
|
18
|
+
|
|
19
|
+
[Why a sovereign coding CLI matters](https://github.com/Dirgha-AI/Rama-I-Dirgha-AI-OS/blob/main/WHY_BHARAT_NEEDS_DIRGHA_CLI.md) — latency data, cost structure for independent developers, the layered view of AI sovereignty, and what the CLI does not solve.
|
|
20
|
+
|
|
13
21
|
## What it is
|
|
14
22
|
|
|
15
|
-
A terminal coding assistant that reads your codebase, edits files, runs tests, commits, and audits every step. It runs on your keys — or entirely on your machine via llama.cpp / Ollama — with your transcripts staying local until you choose otherwise. When a model rate-limits or times out, the
|
|
23
|
+
A terminal coding assistant that reads your codebase, edits files, runs tests, commits, and audits every step. It runs on your keys — or entirely on your machine via llama.cpp / Ollama — with your transcripts staying local until you choose otherwise. When a model rate-limits or times out, the 4-tier failover cascade (user choice → same-family → registry → free fallback) keeps the agent alive without losing context. HTTP streaming stalls are detected and aborted in 30 seconds. Your work doesn't vanish when an API hiccups.
|
|
16
24
|
|
|
17
25
|
## The five pillars
|
|
18
26
|
|
|
@@ -39,7 +47,7 @@ Information flows up. Old context gets distilled, not discarded.
|
|
|
39
47
|
|
|
40
48
|
### Parallel agents
|
|
41
49
|
|
|
42
|
-
`dirgha fleet launch "<goal>"` decomposes the goal into N independent tasks, spawns each in its own git worktree, runs them in parallel, and merges the winners back. `dirgha fleet triple "<goal>"` runs three approaches and lets a judge pick. Inside any session, the agent can call the `task` tool to dispatch a fresh sub-agent with its own context budget for a sub-problem — no compaction loss on the parent.
|
|
50
|
+
`dirgha fleet launch "<goal>"` decomposes the goal into N independent tasks, spawns each in its own git worktree, runs them in parallel, and merges the winners back. `dirgha fleet triple "<goal>"` runs three approaches and lets a judge pick. `dirgha fleet dag "step1..." "step2..." "step3..."` chains agents sequentially with cumulative context propagation — each step builds on the previous one's output. Inside any session, the agent can call the `task` tool to dispatch a fresh sub-agent with its own context budget for a sub-problem — no compaction loss on the parent.
|
|
43
51
|
|
|
44
52
|
### Skills, scanned
|
|
45
53
|
|
|
@@ -60,24 +68,25 @@ The interactive TUI is `dirgha` with no args. Resume a session with `dirgha resu
|
|
|
60
68
|
|
|
61
69
|
## What's in the box
|
|
62
70
|
|
|
63
|
-
|
|
|
64
|
-
|
|
65
|
-
| **17 providers**
|
|
66
|
-
| **34 model aliases**
|
|
67
|
-
| **12 built-in tools** | `fs_read`, `fs_write`, `fs_edit`, `fs_ls`, `shell`, `search_grep`, `search_glob`, `git`, `browser`, `checkpoint`, `cron`, `task`
|
|
71
|
+
| | |
|
|
72
|
+
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
73
|
+
| **17 providers** | anthropic, openai, gemini, openrouter, nvidia, fireworks, deepseek, groq, cerebras, together, deepinfra, mistral, xai, perplexity, cohere, kimi, zai |
|
|
74
|
+
| **34 model aliases** | `kimi`, `opus`, `sonnet`, `haiku`, `gemini`, `flash`, `deepseek`, `llama`, `ling`, `hy3`, … resolved before routing |
|
|
75
|
+
| **12 built-in tools** | `fs_read`, `fs_write`, `fs_edit`, `fs_ls`, `shell`, `search_grep`, `search_glob`, `git`, `browser`, `checkpoint`, `cron`, `task` |
|
|
68
76
|
| **20 slash commands** | `/account`, `/clear`, `/compact`, `/cost`, `/fleet`, `/keys`, `/login`, `/memory`, `/mode`, `/models`, `/resume`, `/session`, `/status`, `/theme`, `/upgrade`, … |
|
|
69
|
-
| **18 subcommands**
|
|
70
|
-
| **4 modes**
|
|
71
|
-
| **MCP**
|
|
72
|
-
| **Source**
|
|
77
|
+
| **18 subcommands** | `audit`, `audit-codebase`, `cost`, `kb`, `keys`, `ledger`, `login`, `models`, `resume`, `skills`, `undo`, `update`, `verify`, … |
|
|
78
|
+
| **4 modes** | `act` · `plan` (read-only thinking) · `verify` (read-only audit) · `ask` (read-only Q&A) |
|
|
79
|
+
| **MCP** | stdio + HTTP/SSE + `bearerProvider` async OAuth rotation |
|
|
80
|
+
| **Source** | ~14.5 K LOC across 23 modules in `src/`. Hard rule: every src file ≤ 200 lines. |
|
|
73
81
|
|
|
74
82
|
## Numbers worth checking
|
|
75
83
|
|
|
76
|
-
|
|
|
77
|
-
|
|
78
|
-
| Tests
|
|
79
|
-
| 17 providers
|
|
80
|
-
|
|
|
84
|
+
| | |
|
|
85
|
+
| -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
|
|
86
|
+
| Tests | **104/104** in ~8 s. TS 0 errors, ESLint 0 warnings. CI green is a precondition for any PR. |
|
|
87
|
+
| 17 providers | Multi-key BYOK pool with cooldown rotation, 4-tier failover cascade, health scoring with compaction. |
|
|
88
|
+
| 12 built-in tools | Per-tool timeout enforcement. Shell 300s, reads 30s, default 60s. |
|
|
89
|
+
| 16 vulnerability classes fixed in v1.18 | Path traversal (memory/session/scaffold), API key overlay isolation, NaN cost poisoning, LSP timer leak, model routing mismatch, web URL routing, stale-cache fallback, and more. |
|
|
81
90
|
|
|
82
91
|
## Why this exists
|
|
83
92
|
|
|
@@ -87,15 +96,15 @@ The opposite assumption is the right one. Your laptop is the unit of sovereignty
|
|
|
87
96
|
|
|
88
97
|
## Documentation
|
|
89
98
|
|
|
90
|
-
|
|
|
91
|
-
|
|
92
|
-
| Architecture
|
|
93
|
-
| Roadmap
|
|
94
|
-
| Knowledge management
|
|
99
|
+
| | |
|
|
100
|
+
| ----------------------- | ------------------------------------------------------------------------------------ |
|
|
101
|
+
| Architecture | [`docs/ARCHITECTURE.md`](./docs/ARCHITECTURE.md) |
|
|
102
|
+
| Roadmap | [`docs/ROADMAP.md`](./docs/ROADMAP.md) |
|
|
103
|
+
| Knowledge management | [`docs/memory/km-architecture.md`](./docs/memory/km-architecture.md) |
|
|
95
104
|
| Architecture efficiency | [`docs/memory/architecture-efficiency.md`](./docs/memory/architecture-efficiency.md) |
|
|
96
|
-
| Skill security
|
|
97
|
-
| Files & search contract | [`docs/agents/files-and-search.md`](./docs/agents/files-and-search.md)
|
|
98
|
-
| Per-release notes
|
|
105
|
+
| Skill security | [`docs/agents/skill-security.md`](./docs/agents/skill-security.md) |
|
|
106
|
+
| Files & search contract | [`docs/agents/files-and-search.md`](./docs/agents/files-and-search.md) |
|
|
107
|
+
| Per-release notes | [`changelog/`](./changelog) |
|
|
99
108
|
|
|
100
109
|
## Contributing
|
|
101
110
|
|
package/dist/cli/config.d.ts
CHANGED
package/dist/cli/config.js
CHANGED
|
@@ -6,7 +6,9 @@ import { readFile } from "node:fs/promises";
|
|
|
6
6
|
import { join } from "node:path";
|
|
7
7
|
import { homedir } from "node:os";
|
|
8
8
|
import { migrateDeprecatedModel } from "../intelligence/prices.js";
|
|
9
|
+
const CURRENT_SCHEMA = 1;
|
|
9
10
|
export const DEFAULT_CONFIG = {
|
|
11
|
+
schemaVersion: CURRENT_SCHEMA,
|
|
10
12
|
model: "moonshotai/kimi-k2.6",
|
|
11
13
|
cheapModel: "meta/llama-3.1-8b-instruct",
|
|
12
14
|
summaryModel: "moonshotai/kimi-k2.5",
|
|
@@ -26,6 +28,7 @@ export async function loadConfig(cwd = process.cwd()) {
|
|
|
26
28
|
const envPartial = readEnvOverrides();
|
|
27
29
|
const merged = merge(DEFAULT_CONFIG, userPartial, projectPartial, envPartial);
|
|
28
30
|
validate(merged);
|
|
31
|
+
migrateConfigSchema(merged);
|
|
29
32
|
// Migrate any model IDs the upstream provider has dropped, so users
|
|
30
33
|
// with stale `~/.dirgha/config.json` don't 400 on every call.
|
|
31
34
|
merged.model = migrateDeprecatedModel(merged.model);
|
|
@@ -41,6 +44,7 @@ async function readJson(path) {
|
|
|
41
44
|
return JSON.parse(text);
|
|
42
45
|
}
|
|
43
46
|
catch {
|
|
47
|
+
process.stderr.write(`[dirgha] Warning: ${path} contains malformed JSON — using defaults.\n`);
|
|
44
48
|
return {};
|
|
45
49
|
}
|
|
46
50
|
}
|
|
@@ -65,7 +69,9 @@ function merge(...partials) {
|
|
|
65
69
|
const value = p[key];
|
|
66
70
|
if (value === undefined)
|
|
67
71
|
continue;
|
|
68
|
-
if (typeof value === "object" &&
|
|
72
|
+
if (typeof value === "object" &&
|
|
73
|
+
value !== null &&
|
|
74
|
+
!Array.isArray(value)) {
|
|
69
75
|
out[key] = {
|
|
70
76
|
...out[key],
|
|
71
77
|
...value,
|
|
@@ -94,4 +100,13 @@ function validate(cfg) {
|
|
|
94
100
|
process.stderr.write("[dirgha] warn: model is empty; LLM calls will fail\n");
|
|
95
101
|
}
|
|
96
102
|
}
|
|
103
|
+
function migrateConfigSchema(cfg) {
|
|
104
|
+
if (cfg.schemaVersion === CURRENT_SCHEMA)
|
|
105
|
+
return;
|
|
106
|
+
// Future migrations go here. Example:
|
|
107
|
+
// if (cfg.schemaVersion === undefined || cfg.schemaVersion < 2) {
|
|
108
|
+
// // v1 → v2: rename field, add default
|
|
109
|
+
// }
|
|
110
|
+
cfg.schemaVersion = CURRENT_SCHEMA;
|
|
111
|
+
}
|
|
97
112
|
//# sourceMappingURL=config.js.map
|
package/dist/cli/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/cli/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/cli/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,O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AAC;IACD,IACE,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,iBAAiB,CAAC;QAClD,GAAG,CAAC,UAAU,CAAC,iBAAiB,GAAG,CAAC,EACpC,CAAC;QACD,GAAG,CAAC,UAAU,CAAC,iBAAiB,GAAG,CAAC,CAAC;IACvC,CAAC;IACD,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QAC1C,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,sDAAsD,CACvD,CAAC;IACJ,CAAC;AACH,CAAC;AAED,SAAS,mBAAmB,CAAC,GAAiB;IAC5C,IAAI,GAAG,CAAC,aAAa,KAAK,cAAc;QAAE,OAAO;IACjD,sCAAsC;IACtC,kEAAkE;IAClE,0CAA0C;IAC1C,IAAI;IACJ,GAAG,CAAC,aAAa,GAAG,cAAc,CAAC;AACrC,CAAC"}
|
|
@@ -3,38 +3,43 @@
|
|
|
3
3
|
* the cwd while honouring .gitignore + .dirghaignore and skipping
|
|
4
4
|
* heavy-weight build artifacts. Caps total size at 500 MB.
|
|
5
5
|
*/
|
|
6
|
-
import { spawn } from
|
|
7
|
-
import { mkdir, stat } from
|
|
8
|
-
import { tmpdir } from
|
|
9
|
-
import { join } from
|
|
10
|
-
import { randomUUID } from
|
|
6
|
+
import { spawn } from "node:child_process";
|
|
7
|
+
import { mkdir, stat } from "node:fs/promises";
|
|
8
|
+
import { tmpdir } from "node:os";
|
|
9
|
+
import { join } from "node:path";
|
|
10
|
+
import { randomUUID } from "node:crypto";
|
|
11
11
|
const DEFAULT_EXCLUDES = [
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
"node_modules",
|
|
13
|
+
".git",
|
|
14
|
+
".next",
|
|
15
|
+
"dist",
|
|
16
|
+
"build",
|
|
17
|
+
"coverage",
|
|
18
|
+
".turbo",
|
|
19
|
+
".cache",
|
|
20
|
+
".pnpm-store",
|
|
21
21
|
];
|
|
22
22
|
const MAX_SIZE_BYTES = 500 * 1024 * 1024;
|
|
23
23
|
export async function buildTarball(cwd, extraExcludes = []) {
|
|
24
|
-
const dir = join(tmpdir(),
|
|
24
|
+
const dir = join(tmpdir(), "dirgha-deploy");
|
|
25
25
|
await mkdir(dir, { recursive: true });
|
|
26
26
|
const out = join(dir, `${randomUUID()}.tar.gz`);
|
|
27
|
-
const excludes = [...DEFAULT_EXCLUDES, ...extraExcludes].flatMap(ex => [
|
|
27
|
+
const excludes = [...DEFAULT_EXCLUDES, ...extraExcludes].flatMap((ex) => [
|
|
28
|
+
"--exclude",
|
|
29
|
+
ex,
|
|
30
|
+
]);
|
|
28
31
|
await new Promise((resolveTar, rejectTar) => {
|
|
29
|
-
const child = spawn(
|
|
32
|
+
const child = spawn("tar", ["-czf", out, ...excludes, "-C", cwd, "."], {
|
|
33
|
+
stdio: ["ignore", "ignore", "pipe"],
|
|
34
|
+
});
|
|
30
35
|
const errChunks = [];
|
|
31
|
-
child.stderr.on(
|
|
32
|
-
child.on(
|
|
33
|
-
child.on(
|
|
36
|
+
child.stderr.on("data", (b) => errChunks.push(b));
|
|
37
|
+
child.on("error", (err) => rejectTar(err));
|
|
38
|
+
child.on("exit", (code) => {
|
|
34
39
|
if (code === 0)
|
|
35
40
|
resolveTar();
|
|
36
41
|
else
|
|
37
|
-
rejectTar(new Error(`tar exited ${code}: ${Buffer.concat(errChunks).toString(
|
|
42
|
+
rejectTar(new Error(`tar exited ${code}: ${Buffer.concat(errChunks).toString("utf8")}`));
|
|
38
43
|
});
|
|
39
44
|
});
|
|
40
45
|
const info = await stat(out);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tarball.js","sourceRoot":"","sources":["../../../src/cli/flows/tarball.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAA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CAAC,IAAI,GAAG,cAAc,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CACb,cAAc,IAAI,CAAC,IAAI,mBAAmB,cAAc,2CAA2C,CACpG,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;AAC7C,CAAC"}
|
|
@@ -12,6 +12,6 @@
|
|
|
12
12
|
*
|
|
13
13
|
* Non-TTY: prints a static how-to instead of prompting (CI-safe).
|
|
14
14
|
*/
|
|
15
|
-
import type { Subcommand } from
|
|
15
|
+
import type { Subcommand } from "../subcommands/index.js";
|
|
16
16
|
export declare function runWizard(argv: string[]): Promise<number>;
|
|
17
17
|
export declare const wizardSubcommand: Subcommand;
|