@bastani/atomic 0.5.14-0 → 0.5.15-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/.claude/settings.json +24 -0
- package/.opencode/opencode.json +10 -0
- package/README.md +10 -58
- package/assets/settings.schema.json +29 -0
- package/dist/sdk/runtime/executor.d.ts.map +1 -1
- package/dist/sdk/workflows/builtin/deep-research-codebase/claude/index.d.ts +4 -1
- package/dist/sdk/workflows/builtin/deep-research-codebase/claude/index.d.ts.map +1 -1
- package/dist/sdk/workflows/builtin/deep-research-codebase/copilot/index.d.ts +4 -1
- package/dist/sdk/workflows/builtin/deep-research-codebase/copilot/index.d.ts.map +1 -1
- package/dist/sdk/workflows/builtin/deep-research-codebase/opencode/index.d.ts +4 -1
- package/dist/sdk/workflows/builtin/deep-research-codebase/opencode/index.d.ts.map +1 -1
- package/dist/services/config/atomic-config.d.ts +44 -0
- package/dist/services/config/atomic-config.d.ts.map +1 -0
- package/dist/services/config/definitions.d.ts +18 -13
- package/dist/services/config/definitions.d.ts.map +1 -1
- package/dist/services/config/index.d.ts +7 -0
- package/dist/services/config/index.d.ts.map +1 -0
- package/dist/services/config/settings-schema.d.ts +2 -0
- package/dist/services/config/settings-schema.d.ts.map +1 -0
- package/dist/services/system/copy.d.ts +8 -1
- package/dist/services/system/copy.d.ts.map +1 -1
- package/package.json +3 -1
- package/src/cli.ts +1 -30
- package/src/commands/cli/chat/index.ts +21 -6
- package/src/commands/cli/init/index.ts +78 -323
- package/src/commands/cli/init/onboarding.ts +4 -10
- package/src/commands/cli/init/scm.ts +3 -34
- package/src/lib/common-ignore.ts +46 -0
- package/src/lib/merge.ts +28 -1
- package/src/sdk/runtime/executor.ts +85 -52
- package/src/sdk/workflows/builtin/deep-research-codebase/claude/index.ts +9 -4
- package/src/sdk/workflows/builtin/deep-research-codebase/copilot/index.ts +12 -7
- package/src/sdk/workflows/builtin/deep-research-codebase/opencode/index.ts +12 -7
- package/src/services/config/atomic-config.ts +95 -1
- package/src/services/config/atomic-global-config.ts +8 -21
- package/src/services/config/definitions.ts +41 -44
- package/src/services/config/settings.ts +2 -1
- package/src/services/system/agents.ts +2 -1
- package/src/services/system/copy.ts +18 -7
- package/src/services/system/skills.ts +3 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"env": {
|
|
3
|
+
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
|
|
4
|
+
"ENABLE_LSP_TOOL": "1",
|
|
5
|
+
"CLAUDE_CODE_NO_FLICKER": "1"
|
|
6
|
+
},
|
|
7
|
+
"includeCoAuthoredBy": false,
|
|
8
|
+
"permissions": {
|
|
9
|
+
"defaultMode": "bypassPermissions"
|
|
10
|
+
},
|
|
11
|
+
"enabledPlugins": {
|
|
12
|
+
"pyright-lsp@claude-plugins-official": true,
|
|
13
|
+
"typescript-lsp@claude-plugins-official": true,
|
|
14
|
+
"gopls-lsp@claude-plugins-official": true,
|
|
15
|
+
"rust-analyzer-lsp@claude-plugins-official": true,
|
|
16
|
+
"jdtls-lsp@claude-plugins-official": true,
|
|
17
|
+
"clangd-lsp@claude-plugins-official": true,
|
|
18
|
+
"csharp-lsp@claude-plugins-official": true,
|
|
19
|
+
"php-lsp@claude-plugins-official": true,
|
|
20
|
+
"kotlin-lsp@claude-plugins-official": true,
|
|
21
|
+
"swift-lsp@claude-plugins-official": true,
|
|
22
|
+
"lua-lsp@claude-plugins-official": true
|
|
23
|
+
}
|
|
24
|
+
}
|
package/README.md
CHANGED
|
@@ -51,7 +51,7 @@ atomic workflow -n review-to-merge -a claude
|
|
|
51
51
|
atomic workflow -n ux-personas -a claude
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
Each of these is a `.ts` file using Atomic's [Workflow SDK](#workflow-sdk--build-your-own-deterministic-harness). See [Build a Workflow](#
|
|
54
|
+
Each of these is a `.ts` file using Atomic's [Workflow SDK](#workflow-sdk--build-your-own-deterministic-harness). See [Build a Workflow](#4-build-a-workflow) for a working example, or read the full SDK reference below.
|
|
55
55
|
|
|
56
56
|
---
|
|
57
57
|
|
|
@@ -64,10 +64,9 @@ Each of these is a `.ts` file using Atomic's [Workflow SDK](#workflow-sdk--build
|
|
|
64
64
|
- [Quick Start](#quick-start)
|
|
65
65
|
- [Prerequisites](#prerequisites)
|
|
66
66
|
- [1. Install](#1-install)
|
|
67
|
-
- [2.
|
|
68
|
-
- [3.
|
|
69
|
-
- [4.
|
|
70
|
-
- [5. Build a Workflow](#5-build-a-workflow)
|
|
67
|
+
- [2. Generate Context Files](#2-generate-context-files)
|
|
68
|
+
- [3. Managing Sessions](#3-managing-sessions)
|
|
69
|
+
- [4. Build a Workflow](#4-build-a-workflow)
|
|
71
70
|
- [Core Features](#core-features)
|
|
72
71
|
- [Multi-Agent Support](#multi-agent-support)
|
|
73
72
|
- [Workflow SDK — Build Your Own Deterministic Harness](#workflow-sdk--build-your-own-deterministic-harness)
|
|
@@ -88,7 +87,6 @@ Each of these is a `.ts` file using Atomic's [Workflow SDK](#workflow-sdk--build
|
|
|
88
87
|
- [Commands Reference](#commands-reference)
|
|
89
88
|
- [CLI Commands](#cli-commands)
|
|
90
89
|
- [Global Flags](#global-flags)
|
|
91
|
-
- [`atomic init` Flags](#atomic-init-flags)
|
|
92
90
|
- [`atomic session` Subcommands](#atomic-session-subcommands)
|
|
93
91
|
- [`atomic chat` Flags](#atomic-chat-flags)
|
|
94
92
|
- [`atomic workflow` Flags](#atomic-workflow-flags)
|
|
@@ -189,16 +187,7 @@ irm https://raw.githubusercontent.com/flora131/atomic/main/install.ps1 | iex
|
|
|
189
187
|
> 4. Remove legacy skill directories: `rm -rf ~/.copilot/skills ~/.opencode/skills`
|
|
190
188
|
> 5. Re-install using any of the install options above
|
|
191
189
|
|
|
192
|
-
### 2.
|
|
193
|
-
|
|
194
|
-
```bash
|
|
195
|
-
cd your-project
|
|
196
|
-
atomic init
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
Select your coding agent and source control system when prompted. The CLI configures your project automatically.
|
|
200
|
-
|
|
201
|
-
### 3. Generate Context Files
|
|
190
|
+
### 2. Generate Context Files
|
|
202
191
|
|
|
203
192
|
Start a chat session and run `/init` to generate `CLAUDE.md` and `AGENTS.md`:
|
|
204
193
|
|
|
@@ -212,7 +201,7 @@ atomic chat -a <claude|opencode|copilot>
|
|
|
212
201
|
|
|
213
202
|
This explores your codebase using sub-agents and generates documentation that gives coding agents the context they need.
|
|
214
203
|
|
|
215
|
-
###
|
|
204
|
+
### 3. Managing Sessions
|
|
216
205
|
|
|
217
206
|
Atomic runs every chat and workflow session inside [tmux](https://github.com/tmux/tmux) on a dedicated socket, isolated from any personal tmux sessions you may have running. Use the built-in `session` commands to manage them:
|
|
218
207
|
|
|
@@ -242,7 +231,7 @@ Session names follow a predictable pattern:
|
|
|
242
231
|
|
|
243
232
|
> **Tip:** If your terminal disconnects or you accidentally close the window, your session is still alive — just run `atomic session connect <session-name>` to pick up where you left off.
|
|
244
233
|
|
|
245
|
-
###
|
|
234
|
+
### 4. Build a Workflow
|
|
246
235
|
|
|
247
236
|
Every team has a process. Atomic lets you encode it as TypeScript — chain agent sessions together, pass transcripts between them, and run the whole thing from the CLI.
|
|
248
237
|
|
|
@@ -989,7 +978,6 @@ During `atomic chat`, there is no Atomic-owned TUI — `atomic chat -a <agent>`
|
|
|
989
978
|
|
|
990
979
|
| Command | Description |
|
|
991
980
|
| ------------------------------- | --------------------------------------------------------------------- |
|
|
992
|
-
| `atomic init` | Interactive project setup (agent selection, SCM choice, config sync) |
|
|
993
981
|
| `atomic chat` | Spawn the native agent CLI inside a tmux/psmux session |
|
|
994
982
|
| `atomic workflow` | Run a multi-session agent workflow with the Atomic orchestrator panel |
|
|
995
983
|
| `atomic workflow list` | List available workflows, grouped by source |
|
|
@@ -1008,19 +996,6 @@ These flags are available on all commands:
|
|
|
1008
996
|
| `--no-banner` | Skip ASCII banner display |
|
|
1009
997
|
| `-v, --version` | Show version number |
|
|
1010
998
|
|
|
1011
|
-
#### `atomic init` Flags
|
|
1012
|
-
|
|
1013
|
-
| Flag | Description |
|
|
1014
|
-
| -------------------- | ------------------------------------------------- |
|
|
1015
|
-
| `-a, --agent <name>` | Pre-select agent: `claude`, `opencode`, `copilot` |
|
|
1016
|
-
| `-s, --scm <name>` | Pre-select SCM: `github`, `sapling` |
|
|
1017
|
-
|
|
1018
|
-
```bash
|
|
1019
|
-
atomic init # Interactive setup
|
|
1020
|
-
atomic init -a claude -s github # Pre-select agent and SCM
|
|
1021
|
-
atomic init --yes # Auto-confirm all prompts
|
|
1022
|
-
```
|
|
1023
|
-
|
|
1024
999
|
#### `atomic session` Subcommands
|
|
1025
1000
|
|
|
1026
1001
|
The `session` command is available at three levels — scoped or global:
|
|
@@ -1127,7 +1102,7 @@ Native slash commands like `/help`, `/clear`, `/compact`, `/model`, `/theme`, `/
|
|
|
1127
1102
|
|
|
1128
1103
|
### `.atomic/settings.json`
|
|
1129
1104
|
|
|
1130
|
-
|
|
1105
|
+
Resolution order:
|
|
1131
1106
|
|
|
1132
1107
|
1. Local: `.atomic/settings.json`
|
|
1133
1108
|
2. Global: `~/.atomic/settings.json`
|
|
@@ -1150,7 +1125,7 @@ Created automatically during `atomic init`. Resolution order:
|
|
|
1150
1125
|
| `version` | number | Config schema version (currently `1`) |
|
|
1151
1126
|
| `scm` | string | Source control: `github` or `sapling` |
|
|
1152
1127
|
| `lastUpdated` | string | ISO 8601 timestamp of the last update |
|
|
1153
|
-
| `trustedPaths` | array | Workspaces that have completed provider onboarding
|
|
1128
|
+
| `trustedPaths` | array | Workspaces that have completed provider onboarding; atomic skips re-prompting for these |
|
|
1154
1129
|
|
|
1155
1130
|
> **Note:** Model selection and reasoning effort are managed by each underlying agent CLI (e.g. Claude Code's `/model`), not by Atomic itself. Atomic's chat command spawns the agent's native TUI — use the agent's own controls to pick a model or adjust reasoning effort.
|
|
1156
1131
|
|
|
@@ -1319,22 +1294,6 @@ $env:GITHUB_TOKEN='ghp_...'; irm https://raw.githubusercontent.com/flora131/atom
|
|
|
1319
1294
|
|
|
1320
1295
|
</details>
|
|
1321
1296
|
|
|
1322
|
-
<details>
|
|
1323
|
-
<summary>Source control selection</summary>
|
|
1324
|
-
|
|
1325
|
-
During `atomic init`, you'll select your source control system:
|
|
1326
|
-
|
|
1327
|
-
| SCM Type | CLI Tool | Code Review | Use Case |
|
|
1328
|
-
| --------------------- | -------- | ----------------- | ----------------- |
|
|
1329
|
-
| GitHub / Git | `git` | Pull Requests | Most projects |
|
|
1330
|
-
| Sapling + Phabricator | `sl` | Phabricator Diffs | Stacked workflows |
|
|
1331
|
-
|
|
1332
|
-
**Sapling + Phabricator:** Ensure `.arcconfig` exists in your repo root. Use `/sl-commit` and `/sl-submit-diff`.
|
|
1333
|
-
|
|
1334
|
-
**Windows note:** Sapling templates use the full path `& 'C:\Program Files\Sapling\sl.exe'` to avoid conflicts with PowerShell's `sl` alias.
|
|
1335
|
-
|
|
1336
|
-
</details>
|
|
1337
|
-
|
|
1338
1297
|
---
|
|
1339
1298
|
|
|
1340
1299
|
## Updating & Uninstalling
|
|
@@ -1387,7 +1346,7 @@ Remove-Item -Path ".atomic" -Recurse -Force
|
|
|
1387
1346
|
<details>
|
|
1388
1347
|
<summary>Clean up global config files</summary>
|
|
1389
1348
|
|
|
1390
|
-
> **Warning:** This deletes Atomic's global settings and cached agent configs.
|
|
1349
|
+
> **Warning:** This deletes Atomic's global settings and cached agent configs.
|
|
1391
1350
|
|
|
1392
1351
|
**macOS / Linux:**
|
|
1393
1352
|
|
|
@@ -1425,13 +1384,6 @@ If agents fail to spawn on Windows, ensure the agent CLI is in your PATH. Atomic
|
|
|
1425
1384
|
|
|
1426
1385
|
</details>
|
|
1427
1386
|
|
|
1428
|
-
<details>
|
|
1429
|
-
<summary>Generating CLAUDE.md / AGENTS.md</summary>
|
|
1430
|
-
|
|
1431
|
-
`atomic init` does **not** create these files. Run `/init` inside a chat session to generate them.
|
|
1432
|
-
|
|
1433
|
-
</details>
|
|
1434
|
-
|
|
1435
1387
|
<details>
|
|
1436
1388
|
<summary>Sub-agent tree stuck on "Initializing..."</summary>
|
|
1437
1389
|
|
|
@@ -41,6 +41,35 @@
|
|
|
41
41
|
},
|
|
42
42
|
"additionalProperties": false
|
|
43
43
|
}
|
|
44
|
+
},
|
|
45
|
+
"providers": {
|
|
46
|
+
"type": "object",
|
|
47
|
+
"description": "Per-provider overrides for chatFlags and envVars. chatFlags replaces built-in defaults entirely when set; envVars are merged on top of defaults (user values win on conflict). Local .atomic/settings.json takes precedence over global ~/.atomic/settings.json.",
|
|
48
|
+
"properties": {
|
|
49
|
+
"claude": { "$ref": "#/$defs/providerOverrides" },
|
|
50
|
+
"opencode": { "$ref": "#/$defs/providerOverrides" },
|
|
51
|
+
"copilot": { "$ref": "#/$defs/providerOverrides" }
|
|
52
|
+
},
|
|
53
|
+
"additionalProperties": false
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"$defs": {
|
|
57
|
+
"providerOverrides": {
|
|
58
|
+
"type": "object",
|
|
59
|
+
"description": "Override settings for a single provider.",
|
|
60
|
+
"properties": {
|
|
61
|
+
"chatFlags": {
|
|
62
|
+
"type": "array",
|
|
63
|
+
"items": { "type": "string" },
|
|
64
|
+
"description": "CLI flags that replace the provider's default chat flags entirely when set."
|
|
65
|
+
},
|
|
66
|
+
"envVars": {
|
|
67
|
+
"type": "object",
|
|
68
|
+
"additionalProperties": { "type": "string" },
|
|
69
|
+
"description": "Environment variables merged on top of the provider's defaults (user values win on conflict)."
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"additionalProperties": false
|
|
44
73
|
}
|
|
45
74
|
},
|
|
46
75
|
"additionalProperties": false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/sdk/runtime/executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,OAAO,KAAK,EACV,kBAAkB,EAMlB,SAAS,EAET,YAAY,EAMb,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/sdk/runtime/executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,OAAO,KAAK,EACV,kBAAkB,EAMlB,SAAS,EAET,YAAY,EAMb,MAAM,aAAa,CAAC;AAqErB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAa5C,MAAM,WAAW,kBAAkB;IACjC,uCAAuC;IACvC,UAAU,EAAE,kBAAkB,CAAC;IAC/B,iBAAiB;IACjB,KAAK,EAAE,SAAS,CAAC;IACjB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,qEAAqE;IACrE,YAAY,EAAE,MAAM,CAAC;IACrB,qCAAqC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAuID;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAKzC;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAMzC;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,MAAM,GAAG,SAAS,GACtB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAgBxB;AAMD;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAyEf;AAcD,gGAAgG;AAChG,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAOvE;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,YAAY,EAAE,GAAG,MAAM,CAkDrE;AAulBD,wBAAsB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CA8JrD"}
|
|
@@ -17,12 +17,15 @@
|
|
|
17
17
|
* │
|
|
18
18
|
* ▼
|
|
19
19
|
* ┌──────────────────────────────────────────────────┐
|
|
20
|
-
* │ explorer-1 explorer-2 ... explorer-N │ (Promise.all)
|
|
20
|
+
* │ explorer-1 explorer-2 ... explorer-N │ (Promise.all, headless)
|
|
21
21
|
* └──────────────────────────────────────────────────┘
|
|
22
22
|
* │
|
|
23
23
|
* ▼
|
|
24
24
|
* aggregator
|
|
25
25
|
*
|
|
26
|
+
* Explorers run headless (in-process, no tmux window) — they are transparent
|
|
27
|
+
* to the graph, so the visible topology is: [scout, history] → aggregator.
|
|
28
|
+
*
|
|
26
29
|
* Stage 1a — codebase-scout
|
|
27
30
|
* Pure-TypeScript: lists files (git ls-files), counts LOC (batched wc -l),
|
|
28
31
|
* renders a depth-bounded ASCII tree, and bin-packs directories into N
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/workflows/builtin/deep-research-codebase/claude/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/workflows/builtin/deep-research-codebase/claude/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;;AA4BH,wBA2Oa"}
|
|
@@ -18,12 +18,15 @@
|
|
|
18
18
|
* │
|
|
19
19
|
* ▼
|
|
20
20
|
* ┌──────────────────────────────────────────────────┐
|
|
21
|
-
* │ explorer-1 explorer-2 ... explorer-N │ (Promise.all)
|
|
21
|
+
* │ explorer-1 explorer-2 ... explorer-N │ (Promise.all, headless)
|
|
22
22
|
* └──────────────────────────────────────────────────┘
|
|
23
23
|
* │
|
|
24
24
|
* ▼
|
|
25
25
|
* aggregator
|
|
26
26
|
*
|
|
27
|
+
* Explorers run headless (in-process, no tmux window) — they are transparent
|
|
28
|
+
* to the graph, so the visible topology is: [scout, history] → aggregator.
|
|
29
|
+
*
|
|
27
30
|
* Copilot-specific concerns baked in:
|
|
28
31
|
*
|
|
29
32
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/workflows/builtin/deep-research-codebase/copilot/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/workflows/builtin/deep-research-codebase/copilot/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;;AAuBH,wBAiMa"}
|
|
@@ -18,12 +18,15 @@
|
|
|
18
18
|
* │
|
|
19
19
|
* ▼
|
|
20
20
|
* ┌──────────────────────────────────────────────────┐
|
|
21
|
-
* │ explorer-1 explorer-2 ... explorer-N │ (Promise.all)
|
|
21
|
+
* │ explorer-1 explorer-2 ... explorer-N │ (Promise.all, headless)
|
|
22
22
|
* └──────────────────────────────────────────────────┘
|
|
23
23
|
* │
|
|
24
24
|
* ▼
|
|
25
25
|
* aggregator
|
|
26
26
|
*
|
|
27
|
+
* Explorers run headless (in-process, no tmux window) — they are transparent
|
|
28
|
+
* to the graph, so the visible topology is: [scout, history] → aggregator.
|
|
29
|
+
*
|
|
27
30
|
* OpenCode-specific concerns baked in:
|
|
28
31
|
*
|
|
29
32
|
* • F5 — every `ctx.stage()` call is a FRESH session with no memory of
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/workflows/builtin/deep-research-codebase/opencode/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/workflows/builtin/deep-research-codebase/opencode/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;;AAuBH,wBA6Na"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Atomic configuration file utilities for persisting project settings.
|
|
3
|
+
*
|
|
4
|
+
* Project/source-control selections are stored in `.atomic/settings.json`.
|
|
5
|
+
* Resolution order:
|
|
6
|
+
* 1) local `.atomic/settings.json` (project override)
|
|
7
|
+
* 2) global `~/.atomic/settings.json` (default fallback)
|
|
8
|
+
*/
|
|
9
|
+
import { type SourceControlType, type AgentKey, type ProviderOverrides } from "./index.ts";
|
|
10
|
+
/**
|
|
11
|
+
* Atomic project configuration schema.
|
|
12
|
+
*/
|
|
13
|
+
export interface AtomicConfig {
|
|
14
|
+
/** Version of config schema */
|
|
15
|
+
version?: number;
|
|
16
|
+
/** Selected source control type */
|
|
17
|
+
scm?: SourceControlType;
|
|
18
|
+
/** Timestamp of last init */
|
|
19
|
+
lastUpdated?: string;
|
|
20
|
+
/** Per-provider overrides for chatFlags and envVars */
|
|
21
|
+
providers?: Partial<Record<AgentKey, ProviderOverrides>>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Read atomic config with local override semantics.
|
|
25
|
+
*/
|
|
26
|
+
export declare function readAtomicConfig(projectDir: string): Promise<AtomicConfig | null>;
|
|
27
|
+
/**
|
|
28
|
+
* Save project config to `.atomic/settings.json`.
|
|
29
|
+
*/
|
|
30
|
+
export declare function saveAtomicConfig(projectDir: string, updates: Partial<AtomicConfig>): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Get selected SCM using local override + global fallback.
|
|
33
|
+
*/
|
|
34
|
+
export declare function getSelectedScm(projectDir: string): Promise<SourceControlType | null>;
|
|
35
|
+
/**
|
|
36
|
+
* Resolve provider overrides from global + local settings (local wins).
|
|
37
|
+
*
|
|
38
|
+
* Returns `{ chatFlags, envVars }` that are meant to be layered on top
|
|
39
|
+
* of the provider's hardcoded defaults:
|
|
40
|
+
* - `chatFlags`: when set, replaces the provider's default chat_flags entirely
|
|
41
|
+
* - `envVars`: merged on top of the provider's default env_vars (user values win)
|
|
42
|
+
*/
|
|
43
|
+
export declare function getProviderOverrides(agentKey: AgentKey, projectDir: string): Promise<ProviderOverrides>;
|
|
44
|
+
//# sourceMappingURL=atomic-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atomic-config.d.ts","sourceRoot":"","sources":["../../../src/services/config/atomic-config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,QAAQ,EAAE,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAO3F;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,+BAA+B;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mCAAmC;IACnC,GAAG,CAAC,EAAE,iBAAiB,CAAC;IACxB,6BAA6B;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uDAAuD;IACvD,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC,CAAC;CAC1D;AA2HD;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAMvF;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,OAAO,CAAC,YAAY,CAAC,GAC7B,OAAO,CAAC,IAAI,CAAC,CAsBf;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAG1F;AAED;;;;;;;GAOG;AACH,wBAAsB,oBAAoB,CACxC,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,iBAAiB,CAAC,CAG5B"}
|
|
@@ -26,6 +26,18 @@ export interface AgentConfig {
|
|
|
26
26
|
declare const AGENT_KEYS: readonly ["claude", "opencode", "copilot"];
|
|
27
27
|
export type AgentKey = (typeof AGENT_KEYS)[number];
|
|
28
28
|
export declare const AGENT_CONFIG: Record<AgentKey, AgentConfig>;
|
|
29
|
+
/**
|
|
30
|
+
* Per-provider overrides that users can set in `.atomic/settings.json`
|
|
31
|
+
* (local) or `~/.atomic/settings.json` (global).
|
|
32
|
+
*
|
|
33
|
+
* - `chatFlags`: when set, replaces the agent's default `chat_flags` entirely.
|
|
34
|
+
* - `envVars`: environment variables merged on top of the agent's default
|
|
35
|
+
* `env_vars` (user values win on conflict).
|
|
36
|
+
*/
|
|
37
|
+
export interface ProviderOverrides {
|
|
38
|
+
chatFlags?: string[];
|
|
39
|
+
envVars?: Record<string, string>;
|
|
40
|
+
}
|
|
29
41
|
export declare function isValidAgent(key: string): key is AgentKey;
|
|
30
42
|
export declare function getAgentConfig(key: AgentKey): AgentConfig;
|
|
31
43
|
export declare function getAgentKeys(): AgentKey[];
|
|
@@ -37,26 +49,16 @@ declare const SCM_KEYS: readonly ["github", "sapling"];
|
|
|
37
49
|
/** Supported source control types — derived from SCM_KEYS tuple. */
|
|
38
50
|
export type SourceControlType = (typeof SCM_KEYS)[number];
|
|
39
51
|
export interface ScmConfig {
|
|
40
|
-
/** Internal identifier */
|
|
41
|
-
name: string;
|
|
42
52
|
/** Display name for prompts */
|
|
43
53
|
displayName: string;
|
|
44
54
|
/** Primary CLI tool (git or sl) */
|
|
45
55
|
cliTool: string;
|
|
46
|
-
/** Code review tool (gh, jf submit, arc diff, etc.) */
|
|
47
|
-
reviewTool: string;
|
|
48
56
|
/** Code review system (github, phabricator) */
|
|
49
57
|
reviewSystem: string;
|
|
50
|
-
/** Directory marker
|
|
58
|
+
/** Directory marker used to detect this SCM in a repo (e.g. `.git`, `.sl`) */
|
|
51
59
|
detectDir: string;
|
|
52
|
-
/** Code review command file name */
|
|
53
|
-
reviewCommandFile: string;
|
|
54
|
-
/** Required configuration files */
|
|
55
|
-
requiredConfigFiles?: string[];
|
|
56
60
|
}
|
|
57
61
|
export declare const SCM_CONFIG: Record<SourceControlType, ScmConfig>;
|
|
58
|
-
/** Commands that have SCM-specific variants */
|
|
59
|
-
export declare const SCM_SPECIFIC_COMMANDS: string[];
|
|
60
62
|
/**
|
|
61
63
|
* SCM-variant skill names, grouped by source control type.
|
|
62
64
|
*
|
|
@@ -78,8 +80,11 @@ export declare function getScmKeys(): SourceControlType[];
|
|
|
78
80
|
*/
|
|
79
81
|
export declare function isValidScm(key: string): key is SourceControlType;
|
|
80
82
|
/**
|
|
81
|
-
*
|
|
83
|
+
* Detect the SCM type by looking for marker directories in `projectRoot`.
|
|
84
|
+
*
|
|
85
|
+
* Checks each {@link ScmConfig.detectDir} (e.g. `.git`, `.sl`) and returns
|
|
86
|
+
* the first match. Returns `null` when no known marker is found.
|
|
82
87
|
*/
|
|
83
|
-
export declare function
|
|
88
|
+
export declare function detectScmType(projectRoot: string): Promise<SourceControlType | null>;
|
|
84
89
|
export {};
|
|
85
90
|
//# sourceMappingURL=definitions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../../src/services/config/definitions.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../../src/services/config/definitions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,MAAM,WAAW,WAAW;IAC1B,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,mCAAmC;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,kEAAkE;IAClE,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,qFAAqF;IACrF,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,0CAA0C;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,qEAAqE;IACrE,gBAAgB,EAAE,KAAK,CAAC;QACtB,MAAM,EAAE,MAAM,CAAC;QACf,WAAW,EAAE,MAAM,CAAC;QACpB,KAAK,EAAE,OAAO,CAAC;KAChB,CAAC,CAAC;CACJ;AAED,QAAA,MAAM,UAAU,4CAA6C,CAAC;AAC9D,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnD,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,QAAQ,EAAE,WAAW,CA4DtD,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB;IAChC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,IAAI,QAAQ,CAEzD;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,QAAQ,GAAG,WAAW,CAEzD;AAED,wBAAgB,YAAY,IAAI,QAAQ,EAAE,CAEzC;AAED;;GAEG;AAEH,6BAA6B;AAC7B,QAAA,MAAM,QAAQ,gCAAiC,CAAC;AAEhD,oEAAoE;AACpE,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1D,MAAM,WAAW,SAAS;IACxB,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,+CAA+C;IAC/C,YAAY,EAAE,MAAM,CAAC;IACrB,8EAA8E;IAC9E,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,iBAAiB,EAAE,SAAS,CAa3D,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAIzE,CAAC;AAEJ,4EAA4E;AAC5E,eAAO,MAAM,cAAc,EAAE,SAAS,MAAM,EAG3C,CAAC;AAEF;;GAEG;AACH,wBAAgB,UAAU,IAAI,iBAAiB,EAAE,CAEhD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,IAAI,iBAAiB,CAEhE;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAWnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/config/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-schema.d.ts","sourceRoot":"","sources":["../../../src/services/config/settings-schema.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,uFACsD,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Utilities for copying directories and files with exclusions
|
|
3
3
|
*/
|
|
4
|
+
import type { Ignore } from "ignore";
|
|
4
5
|
/**
|
|
5
6
|
* Safely create a directory (and parents) without throwing on EEXIST.
|
|
6
7
|
*
|
|
@@ -31,6 +32,8 @@ export declare function isPathSafe(basePath: string, targetPath: string): boolea
|
|
|
31
32
|
interface CopyOptions {
|
|
32
33
|
/** Paths to exclude (relative to source root or base names) */
|
|
33
34
|
exclude?: string[];
|
|
35
|
+
/** Gitignore-style filter for common junk patterns (via the `ignore` package) */
|
|
36
|
+
ignoreFilter?: Ignore;
|
|
34
37
|
/** Whether to skip scripts for the opposite platform */
|
|
35
38
|
skipOppositeScripts?: boolean;
|
|
36
39
|
}
|
|
@@ -43,8 +46,12 @@ export declare function copyFile(src: string, dest: string): Promise<void>;
|
|
|
43
46
|
* Check if a path should be excluded based on exclusion rules.
|
|
44
47
|
* Uses normalized paths (forward slashes) to ensure consistent matching
|
|
45
48
|
* on both Windows and Unix systems.
|
|
49
|
+
*
|
|
50
|
+
* When an {@link Ignore} filter is provided, gitignore-style glob patterns
|
|
51
|
+
* are evaluated first so common junk files (.DS_Store, node_modules, etc.)
|
|
52
|
+
* are filtered automatically without polluting the explicit `exclude` list.
|
|
46
53
|
*/
|
|
47
|
-
export declare function shouldExclude(relativePath: string, name: string, exclude: string[]): boolean;
|
|
54
|
+
export declare function shouldExclude(relativePath: string, name: string, exclude: string[], ignoreFilter?: Ignore): boolean;
|
|
48
55
|
/**
|
|
49
56
|
* Recursively copy a directory, overwriting existing destination files.
|
|
50
57
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy.d.ts","sourceRoot":"","sources":["../../../src/services/system/copy.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"copy.d.ts","sourceRoot":"","sources":["../../../src/services/system/copy.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAQrC;;;;;;;GAOG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAa3D;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAahD;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAGxE;AAED,UAAU,WAAW;IACnB,+DAA+D;IAC/D,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,iFAAiF;IACjF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wDAAwD;IACxD,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED;;;GAGG;AACH,wBAAsB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAYvE;AAyDD;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EAAE,EACjB,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAyBT;AA+GD;;GAEG;AACH,wBAAsB,OAAO,CAC3B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,WAAgB,EACzB,OAAO,CAAC,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC,CAEf;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CACzC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,WAAgB,EACzB,OAAO,CAAC,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC,CAEf;AAED;;GAEG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAO/D;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAOhE;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAqBhE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/atomic",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.15-0",
|
|
4
4
|
"description": "Configuration management CLI and SDK for coding agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -45,7 +45,9 @@
|
|
|
45
45
|
"assets/settings.schema.json",
|
|
46
46
|
".agents/skills",
|
|
47
47
|
".claude/agents",
|
|
48
|
+
".claude/settings.json",
|
|
48
49
|
".opencode/agents",
|
|
50
|
+
".opencode/opencode.json",
|
|
49
51
|
".github/agents",
|
|
50
52
|
".github/lsp.json"
|
|
51
53
|
],
|
package/src/cli.ts
CHANGED
|
@@ -5,10 +5,6 @@
|
|
|
5
5
|
* Built with Commander.js for robust argument parsing and type-safe options.
|
|
6
6
|
*
|
|
7
7
|
* Usage:
|
|
8
|
-
* atomic Interactive setup (same as 'atomic init')
|
|
9
|
-
* atomic init Interactive setup with agent selection
|
|
10
|
-
* atomic init -a <agent> Setup specific agent (skip selection)
|
|
11
|
-
* atomic init -s <scm> Setup specific SCM (github, sapling)
|
|
12
8
|
* atomic chat -a <agent> Start interactive chat with an agent
|
|
13
9
|
* atomic chat session list List running chat/workflow sessions
|
|
14
10
|
* atomic chat session connect <id> Attach to a session
|
|
@@ -25,7 +21,7 @@
|
|
|
25
21
|
import { Command } from "@commander-js/extra-typings";
|
|
26
22
|
import { VERSION } from "./version.ts";
|
|
27
23
|
import { COLORS } from "./theme/colors.ts";
|
|
28
|
-
import { AGENT_CONFIG, type AgentKey
|
|
24
|
+
import { AGENT_CONFIG, type AgentKey } from "./services/config/index.ts";
|
|
29
25
|
import { SUPPORTED_SHELLS, type Shell } from "./completions/index.ts";
|
|
30
26
|
|
|
31
27
|
// ─── Session subcommand factory ─────────────────────────────────────────────
|
|
@@ -114,31 +110,6 @@ export function createProgram() {
|
|
|
114
110
|
|
|
115
111
|
// Build agent choices string for help text
|
|
116
112
|
const agentChoices = Object.keys(AGENT_CONFIG).join(", ");
|
|
117
|
-
const scmChoices = Object.keys(SCM_CONFIG).join(", ");
|
|
118
|
-
|
|
119
|
-
// Add init command
|
|
120
|
-
program
|
|
121
|
-
.command("init")
|
|
122
|
-
.description("Interactive setup with agent selection")
|
|
123
|
-
.option(
|
|
124
|
-
"-a, --agent <name>",
|
|
125
|
-
`Pre-select agent to configure (${agentChoices})`,
|
|
126
|
-
)
|
|
127
|
-
.option(
|
|
128
|
-
"-s, --scm <name>",
|
|
129
|
-
`Pre-select source control system (${scmChoices})`,
|
|
130
|
-
)
|
|
131
|
-
.action(async (localOpts) => {
|
|
132
|
-
const globalOpts = program.opts();
|
|
133
|
-
const { initCommand } = await import("./commands/cli/init.ts");
|
|
134
|
-
|
|
135
|
-
await initCommand({
|
|
136
|
-
showBanner: globalOpts.banner !== false,
|
|
137
|
-
preSelectedAgent: localOpts.agent as AgentKey | undefined,
|
|
138
|
-
preSelectedScm: localOpts.scm as SourceControlType | undefined,
|
|
139
|
-
yes: globalOpts.yes,
|
|
140
|
-
});
|
|
141
|
-
});
|
|
142
113
|
|
|
143
114
|
// ── Chat command (default) ──────────────────────────────────────────────
|
|
144
115
|
const chatCmd = program
|
|
@@ -17,6 +17,8 @@ import { join } from "node:path";
|
|
|
17
17
|
import { homedir } from "node:os";
|
|
18
18
|
import { mkdir, writeFile, rm } from "node:fs/promises";
|
|
19
19
|
import { AGENT_CONFIG, type AgentKey } from "../../../services/config/index.ts";
|
|
20
|
+
import { getProviderOverrides } from "../../../services/config/atomic-config.ts";
|
|
21
|
+
import { ensureProjectSetup } from "../init/index.ts";
|
|
20
22
|
import { COLORS } from "../../../theme/colors.ts";
|
|
21
23
|
import { isCommandInstalled } from "../../../services/system/detect.ts";
|
|
22
24
|
import {
|
|
@@ -66,12 +68,21 @@ export function getAgentDisplayName(agentType: AgentType): string {
|
|
|
66
68
|
/**
|
|
67
69
|
* Build the argv array for spawning the agent CLI.
|
|
68
70
|
*
|
|
69
|
-
* Starts with the agent's default chat_flags
|
|
70
|
-
*
|
|
71
|
+
* Starts with the agent's default chat_flags (or replaces them entirely
|
|
72
|
+
* when the user sets `chatFlags` in `.atomic/settings.json`), then
|
|
73
|
+
* appends any extra args the user passed after `-a <agent>`.
|
|
71
74
|
*/
|
|
72
|
-
export function buildAgentArgs(
|
|
75
|
+
export async function buildAgentArgs(
|
|
76
|
+
agentType: AgentType,
|
|
77
|
+
passthroughArgs: string[] = [],
|
|
78
|
+
projectRoot: string = process.cwd(),
|
|
79
|
+
): Promise<string[]> {
|
|
73
80
|
const config = AGENT_CONFIG[agentType];
|
|
74
|
-
|
|
81
|
+
const overrides = await getProviderOverrides(agentType, projectRoot);
|
|
82
|
+
|
|
83
|
+
const flags = overrides.chatFlags ?? [...config.chat_flags];
|
|
84
|
+
|
|
85
|
+
return [...flags, ...passthroughArgs];
|
|
75
86
|
}
|
|
76
87
|
|
|
77
88
|
function generateChatId(): string {
|
|
@@ -172,10 +183,14 @@ export async function chatCommand(options: ChatCommandOptions = {}): Promise<num
|
|
|
172
183
|
|
|
173
184
|
await ensureAtomicGlobalAgentConfigs(configRoot);
|
|
174
185
|
|
|
186
|
+
// ── Preflight: project setup (onboarding files, skills, trusted workspace) ──
|
|
187
|
+
await ensureProjectSetup(agentType, projectRoot);
|
|
188
|
+
|
|
175
189
|
// ── Build argv ──
|
|
176
|
-
const args = buildAgentArgs(agentType, passthroughArgs);
|
|
190
|
+
const args = await buildAgentArgs(agentType, passthroughArgs, projectRoot);
|
|
177
191
|
const cmd = [config.cmd, ...args];
|
|
178
|
-
const
|
|
192
|
+
const overrides = await getProviderOverrides(agentType, projectRoot);
|
|
193
|
+
const envVars = { ...config.env_vars, ...overrides.envVars };
|
|
179
194
|
|
|
180
195
|
// ── No TTY: tmux attach requires a real terminal ──
|
|
181
196
|
if (!process.stdin.isTTY) {
|