@aeolus-fleet/trierarch 0.20.4 → 0.20.5
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 +2 -2
- package/dist/adapters/claude-code-screen.js +12 -2
- package/dist/adapters/claude-code-screen.js.map +1 -1
- package/dist/adapters/claude-code-setup.d.ts +8 -2
- package/dist/adapters/claude-code-setup.js +11 -0
- package/dist/adapters/claude-code-setup.js.map +1 -1
- package/dist/adapters/claude-code.d.ts +9 -1
- package/dist/adapters/claude-code.js +9 -3
- package/dist/adapters/claude-code.js.map +1 -1
- package/dist/adapters/codex-screen.js +1 -0
- package/dist/adapters/codex-screen.js.map +1 -1
- package/dist/adapters/codex.js +1 -1
- package/dist/adapters/codex.js.map +1 -1
- package/dist/adapters/flags.d.ts +0 -8
- package/dist/adapters/flags.js +1 -12
- package/dist/adapters/flags.js.map +1 -1
- package/dist/adapters/harnesses.js +2 -1
- package/dist/adapters/harnesses.js.map +1 -1
- package/dist/adapters/launch-screen.d.ts +8 -2
- package/dist/adapters/launch-screen.js +8 -3
- package/dist/adapters/launch-screen.js.map +1 -1
- package/dist/adapters/service.d.ts +2 -0
- package/dist/adapters/service.js +10 -1
- package/dist/adapters/service.js.map +1 -1
- package/dist/adapters/trust.d.ts +3 -1
- package/dist/adapters/trust.js +11 -3
- package/dist/adapters/trust.js.map +1 -1
- package/dist/cli/config-check.js +2 -1
- package/dist/cli/config-check.js.map +1 -1
- package/dist/cli/init.d.ts +3 -3
- package/dist/cli/init.js +55 -31
- package/dist/cli/init.js.map +1 -1
- package/dist/core/check-settings.d.ts +13 -1
- package/dist/core/check-settings.js +19 -1
- package/dist/core/check-settings.js.map +1 -1
- package/dist/core/effective-flags.d.ts +9 -0
- package/dist/core/effective-flags.js +13 -0
- package/dist/core/effective-flags.js.map +1 -0
- package/dist/core/ports.d.ts +10 -2
- package/dist/core/reconciler.js +21 -11
- package/dist/core/reconciler.js.map +1 -1
- package/dist/core/run-pass.js +3 -2
- package/dist/core/run-pass.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ That gives the command `aeolus-trierarch`.
|
|
|
27
27
|
- the folders it may crew a ship in as they are, by name and path. It trusts each one, so a session there starts with no trust question;
|
|
28
28
|
- the caps: how many ships it takes, how many sessions run at once.
|
|
29
29
|
|
|
30
|
-
It writes `~/.aeolus/trierarch/config.json`, with `config.schema.json` beside it so an editor checks it. When the configuration offers Codex, it answers Codex's one-time questions ahead too, through `codex app-server` as Codex's own dialogs do: it trusts each configured repository and folder in `~/.codex/config.toml` (a repository covers its worktrees), and trusts the aeolus plugin's hooks, without which a Codex session marks no turn and is never woken. A plugin update changes the hooks: run `aeolus-trierarch init` again after updating the aeolus plugin for Codex.
|
|
30
|
+
It writes `~/.aeolus/trierarch/config.json`, with `config.schema.json` beside it so an editor checks it. When the configuration offers Codex, it answers Codex's one-time questions ahead too, through `codex app-server` as Codex's own dialogs do: it trusts each configured repository and folder in `~/.codex/config.toml` (a repository covers its worktrees), and trusts the aeolus plugin's hooks, without which a Codex session marks no turn and is never woken. A plugin update changes the hooks: run `aeolus-trierarch init` again after updating the aeolus plugin for Codex. When the configuration offers Claude Code, it answers Claude Code's one-time questions ahead, so a session nobody watches never waits on one, and otherwise leaves Claude Code's files alone: it trusts the worktree root in `~/.claude.json`, each configured repository and each configured folder (on every run, so a place added since is trusted too), completes Claude Code's onboarding there without asking (each launch completes it again), and, when the sessions skip permissions, offers to accept bypass permissions mode in `~/.claude/settings.json`. Then it offers to install and start the service: a launchd agent on macOS (`~/Library/LaunchAgents/dev.aeolus-fleet.trierarch.plist`), a systemd user unit on Linux (`aeolus-trierarch.service`), started at login and again whenever it stops.
|
|
31
31
|
|
|
32
32
|
Without a terminal, pass everything as flags and take every default with `--yes`: `aeolus-trierarch init --fleet-url https://fleet.example.com --ship-id shp_... --secret aeolus_sk_v1_... --yes`. Prefer the prompt: a secret in a flag lands in your shell history.
|
|
33
33
|
|
|
@@ -39,7 +39,7 @@ That gives the command `aeolus-trierarch`.
|
|
|
39
39
|
| --- | --- |
|
|
40
40
|
| `aeolus-trierarch status` | The installed version, and the one the service runs when it differs (then it says to restart), the service (running, pid, since), the fleet and the trierarch's own lease, the caps in use, the entries by state, kept worktrees and orphans |
|
|
41
41
|
| `aeolus-trierarch list` | The ships it crews: ship, state, harness, workspace, since, restarts |
|
|
42
|
-
| `aeolus-trierarch logs [--lines <n>] [--follow]` | The last lines of `~/.aeolus/trierarch/logs/trierarch.log`, and with `--follow` each new one. The log holds one JSON record per line: each action the loop takes for a ship (crew, launch, wake, report, release, confirm, forget, leave, stop) as `{ time, shipId, shipName, action, outcome, next }`, where `next` says what happens after a failure, or a message as `{ time, level, message }`. `logs` renders them as text, and `--json` gives the records as they are (a line that is no record as `{ line }`). `run` in a terminal writes the text |
|
|
42
|
+
| `aeolus-trierarch logs [--lines <n>] [--follow]` | The last lines of `~/.aeolus/trierarch/logs/trierarch.log`, where the launchd agent writes on macOS, and with `--follow` each new one. On Linux the systemd user unit writes to the journal instead: `journalctl --user -u aeolus-trierarch`. The log holds one JSON record per line: each action the loop takes for a ship (crew, launch, wake, report, release, confirm, forget, leave, stop) as `{ time, shipId, shipName, action, outcome, next }`, where `next` says what happens after a failure, or a message as `{ time, level, message }`. `logs` renders them as text, and `--json` gives the records as they are (a line that is no record as `{ line }`). `run` in a terminal writes the text |
|
|
43
43
|
| `aeolus-trierarch add repository <name> <path>`, `aeolus-trierarch add folder <name> <path>` | Adds a repository to make worktrees of, or a folder to crew a ship in as it is, checked as init checks it, and trusts it for every configured harness in one step: adding a place is what trusts it. Then it restarts the service so the trierarch offers it, and waits until the new process says its version (at most 30 seconds); sessions keep running. A place written into `config.json` by hand is never offered and never crewed until it is added |
|
|
44
44
|
| `aeolus-trierarch config check` | Checks the configuration and gives the flags each harness launches with, and each option value's flags. Then the command each harness launches on a first start and on a restart, with each flag marked `(configuration)` or `(adapter)` when the adapter adds it itself (`--no-daemon` for Codex, `--continue` on a Claude Code restart, the remote-control session name) |
|
|
45
45
|
| `aeolus-trierarch detect` | Detects again what each configured harness offers (its models, and effort where its CLI has a flag for it) and keeps it in `~/.aeolus/trierarch/detected.json`, then gives per harness its version, each option's values and when its models were last confirmed. Restart the trierarch so it reads them ([docs/trierarch.md](../../docs/trierarch.md#detected-options)) |
|
|
@@ -2,12 +2,22 @@ import { launchSeenWith } from './launch-screen.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* Claude Code's screen in a session's launch window (#382), as Claude Code
|
|
4
4
|
* 2.1.295 writes it: the one place its texts are matched, tested on screens
|
|
5
|
-
* captured from real sessions (test/screens).
|
|
5
|
+
* captured from real sessions (test/screens). Its first-run screens (#403)
|
|
6
|
+
* show on a machine where it never ran by hand, and each waits for a key.
|
|
7
|
+
* It marks a tool call with ⏺ on macOS and with ● on Linux (#487).
|
|
6
8
|
*/
|
|
7
9
|
const CLAUDE_CODE_TEXTS = {
|
|
8
10
|
// A tool call collapsed once done ("Ran 1 shell command", "Read 1 file", "Called aeolus"), under way ("⏺ Reading 1 file…"), or shown whole ("⏺ Bash(echo hi)").
|
|
9
|
-
activity: /^ {2}(?:Ran|Read|Wrote|Edited|Updated|Searched for|Listed|Fetched) \d+ |^ {2}Called \S
|
|
11
|
+
activity: /^ {2}(?:Ran|Read|Wrote|Edited|Updated|Searched for|Listed|Fetched) \d+ |^ {2}Called \S+|^[⏺●] (?:Running|Reading|Calling|Writing|Editing|Updating|Searching|Listing|Fetching) |^[⏺●] [A-Za-z][\w-]*\(/mu,
|
|
10
12
|
refused: /There's an issue with the selected model \(([^()\s]+)\)/gu,
|
|
13
|
+
screens: [
|
|
14
|
+
{ name: 'theme picker', text: /Choose the text style that looks best with your terminal/u },
|
|
15
|
+
{ name: 'login method question', text: /Select login method:/u },
|
|
16
|
+
{ name: 'security notes', text: /^ Security notes:/mu },
|
|
17
|
+
{ name: 'folder trust question', text: /Is this a project you created or one you trust\?/u },
|
|
18
|
+
{ name: 'bypass permissions warning', text: /WARNING: Claude Code running in Bypass Permissions mode/u },
|
|
19
|
+
{ name: 'fullscreen renderer offer', text: /Try the new fullscreen renderer\?/u },
|
|
20
|
+
],
|
|
11
21
|
};
|
|
12
22
|
export function claudeCodeLaunchSeen(at) {
|
|
13
23
|
return launchSeenWith(CLAUDE_CODE_TEXTS, at);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-code-screen.js","sourceRoot":"","sources":["../../src/adapters/claude-code-screen.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAoB,MAAM,oBAAoB,CAAC;AAEtE
|
|
1
|
+
{"version":3,"file":"claude-code-screen.js","sourceRoot":"","sources":["../../src/adapters/claude-code-screen.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAoB,MAAM,oBAAoB,CAAC;AAEtE;;;;;;GAMG;AACH,MAAM,iBAAiB,GAAgB;IACrC,gKAAgK;IAChK,QAAQ,EACN,yMAAyM;IAC3M,OAAO,EAAE,2DAA2D;IACpE,OAAO,EAAE;QACP,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,2DAA2D,EAAE;QAC3F,EAAE,IAAI,EAAE,uBAAuB,EAAE,IAAI,EAAE,uBAAuB,EAAE;QAChE,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,qBAAqB,EAAE;QACvD,EAAE,IAAI,EAAE,uBAAuB,EAAE,IAAI,EAAE,mDAAmD,EAAE;QAC5F,EAAE,IAAI,EAAE,4BAA4B,EAAE,IAAI,EAAE,0DAA0D,EAAE;QACxG,EAAE,IAAI,EAAE,2BAA2B,EAAE,IAAI,EAAE,oCAAoC,EAAE;KAClF;CACF,CAAC;AAEF,MAAM,UAAU,oBAAoB,CAAC,EAAsC;IACzE,OAAO,cAAc,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -4,8 +4,12 @@
|
|
|
4
4
|
* its first start there, even with `--dangerously-skip-permissions`; trusting
|
|
5
5
|
* a folder covers every folder under it, so trusting the worktree root covers
|
|
6
6
|
* every worktree. It asks once per user whether to accept bypass permissions
|
|
7
|
-
* mode.
|
|
8
|
-
*
|
|
7
|
+
* mode. On a machine where it never ran by hand it shows its onboarding (the
|
|
8
|
+
* theme, the login, the security notes) and later offers its fullscreen
|
|
9
|
+
* renderer (#403); a completed onboarding skips the first, and an offer seen
|
|
10
|
+
* as often as it is shown skips the second. The answers live in Claude Code's
|
|
11
|
+
* own files, which this changes key by key, keeping everything else and the
|
|
12
|
+
* file's mode.
|
|
9
13
|
*/
|
|
10
14
|
export interface ClaudeCodeSetup {
|
|
11
15
|
trust(folder: string): Promise<void>;
|
|
@@ -14,6 +18,8 @@ export interface ClaudeCodeSetup {
|
|
|
14
18
|
trustedFolders(): Promise<ReadonlySet<string>>;
|
|
15
19
|
acceptSkipPermissions(): Promise<void>;
|
|
16
20
|
isSkipPermissionsAccepted(): Promise<boolean>;
|
|
21
|
+
completeOnboarding(): Promise<void>;
|
|
22
|
+
isOnboardingComplete(): Promise<boolean>;
|
|
17
23
|
}
|
|
18
24
|
export declare function createClaudeCodeSetup(at: {
|
|
19
25
|
homeDirectory: string;
|
|
@@ -3,6 +3,8 @@ import { dirname, join } from 'node:path';
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { TrierarchFileError } from './files.js';
|
|
5
5
|
const jsonObjectSchema = z.record(z.string(), z.unknown());
|
|
6
|
+
/** How often Claude Code 2.1.295 offers its fullscreen renderer at most: once seen this often, it offers it no more. */
|
|
7
|
+
const FULLSCREEN_OFFER_SHOWN_MAX = 3;
|
|
6
8
|
/** A file only its user reads, as Claude Code keeps ~/.claude.json. */
|
|
7
9
|
const PRIVATE_MODE = 0o600;
|
|
8
10
|
async function readJsonObject(path) {
|
|
@@ -31,6 +33,7 @@ export function createClaudeCodeSetup(at) {
|
|
|
31
33
|
const state = join(at.homeDirectory, '.claude.json');
|
|
32
34
|
const settings = join(at.homeDirectory, '.claude', 'settings.json');
|
|
33
35
|
const projectsOf = (claude) => jsonObjectSchema.safeParse(claude.projects).data ?? {};
|
|
36
|
+
const fullscreenOfferSeen = (claude) => z.number().safeParse(claude.fullscreenUpsellSeenCount).data ?? 0;
|
|
34
37
|
return {
|
|
35
38
|
trust: async (folder) => {
|
|
36
39
|
const claude = await readJsonObject(state);
|
|
@@ -50,6 +53,14 @@ export function createClaudeCodeSetup(at) {
|
|
|
50
53
|
await writeJsonObject(settings, { ...(await readJsonObject(settings)), skipDangerousModePermissionPrompt: true });
|
|
51
54
|
},
|
|
52
55
|
isSkipPermissionsAccepted: async () => (await readJsonObject(settings)).skipDangerousModePermissionPrompt === true,
|
|
56
|
+
completeOnboarding: async () => {
|
|
57
|
+
const claude = await readJsonObject(state);
|
|
58
|
+
await writeJsonObject(state, { ...claude, hasCompletedOnboarding: true, fullscreenUpsellSeenCount: Math.max(fullscreenOfferSeen(claude), FULLSCREEN_OFFER_SHOWN_MAX) });
|
|
59
|
+
},
|
|
60
|
+
isOnboardingComplete: async () => {
|
|
61
|
+
const claude = await readJsonObject(state);
|
|
62
|
+
return claude.hasCompletedOnboarding === true && fullscreenOfferSeen(claude) >= FULLSCREEN_OFFER_SHOWN_MAX;
|
|
63
|
+
},
|
|
53
64
|
};
|
|
54
65
|
}
|
|
55
66
|
//# sourceMappingURL=claude-code-setup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-code-setup.js","sourceRoot":"","sources":["../../src/adapters/claude-code-setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":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AM,EAAE,sBAAsB,EAAE,IAAI,EAAE,yBAAyB,EAAE,IAAI,CAAC,GAAG,CAAC,mBAAmB,CAAC,MAAM,CAAC,EAAE,0BAA0B,CAAC,EAAE,CAAC,CAAC;QAC1K,CAAC;QACD,oBAAoB,EAAE,KAAK,IAAI,EAAE;YAC/B,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,KAAK,CAAC,CAAC;YAC3C,OAAO,MAAM,CAAC,sBAAsB,KAAK,IAAI,IAAI,mBAAmB,CAAC,MAAM,CAAC,IAAI,0BAA0B,CAAC;QAC7G,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { TrierarchConfiguration } from '@aeolus-fleet/common';
|
|
2
2
|
import type { AdapterFlag, HarnessPort } from '../core/ports.js';
|
|
3
|
+
import type { ClaudeCodeSetup } from './claude-code-setup.js';
|
|
3
4
|
import { type CommandPart } from './command-line.js';
|
|
4
5
|
import { type AeolusPlugin } from './plugin-identity.js';
|
|
5
6
|
import type { Tmux } from './tmux.js';
|
|
@@ -10,12 +11,17 @@ import type { Tmux } from './tmux.js';
|
|
|
10
11
|
* without AskUserQuestion and plan mode: nobody watches the session's pane, so
|
|
11
12
|
* it asks its questions over the fleet, and a question form or a plan approval
|
|
12
13
|
* waiting there would take the keys of a wake (#457, #460). Plan mode goes as a
|
|
13
|
-
* whole: without ExitPlanMode alone a session that entered it could never leave.
|
|
14
|
+
* whole: without ExitPlanMode alone a session that entered it could never leave.
|
|
15
|
+
* Its onboarding is completed before every launch, so a session on a machine
|
|
16
|
+
* where Claude Code never ran by hand stops at no first-run screen (#403). A
|
|
17
|
+
* session's identity is written and read through the aeolus
|
|
14
18
|
* plugin's own `aeolus-identity.sh`, never a copy of how the plugin names its
|
|
15
19
|
* files.
|
|
16
20
|
*/
|
|
17
21
|
export declare const WAKE_PROMPT = "/aeolus:wake";
|
|
18
22
|
export declare const CLAUDE_CODE_ADAPTER_FLAGS: readonly AdapterFlag[];
|
|
23
|
+
/** Claude Code's flag that runs every tool without asking; it asks once per user to accept that (#403). */
|
|
24
|
+
export declare const SKIP_PERMISSIONS = "--dangerously-skip-permissions";
|
|
19
25
|
/** The flags of Claude Code that are risky: it then runs every tool without asking (#326). */
|
|
20
26
|
export declare const CLAUDE_CODE_RISKY_FLAGS: readonly string[];
|
|
21
27
|
/** `claude`, the flags, AskUserQuestion and plan mode disallowed, `--continue` on a restart, then the prompt last after `--`: no flag takes it (`--remote-control [name]` has an optional value), and it never reads as a flag. */
|
|
@@ -32,6 +38,8 @@ export declare function createClaudeCodeHarness(options: {
|
|
|
32
38
|
sessions: Pick<Tmux, 'start' | 'type' | 'screen'>;
|
|
33
39
|
/** Claude Code's projects folder, where it keeps each folder's conversations. */
|
|
34
40
|
projects: string;
|
|
41
|
+
/** Claude Code's own files, where its onboarding is completed before each launch (#403). */
|
|
42
|
+
setup: Pick<ClaudeCodeSetup, 'completeOnboarding'>;
|
|
35
43
|
/** The program to run; `claude` unless a test runs another. */
|
|
36
44
|
command?: string;
|
|
37
45
|
}): HarnessPort;
|
|
@@ -2,7 +2,7 @@ import { readdir } from 'node:fs/promises';
|
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { claudeCodeLaunchSeen } from './claude-code-screen.js';
|
|
4
4
|
import { partsWithWords, wordsOf } from './command-line.js';
|
|
5
|
-
import { effectiveFlags } from '
|
|
5
|
+
import { effectiveFlags } from '../core/effective-flags.js';
|
|
6
6
|
import { createPluginIdentity } from './plugin-identity.js';
|
|
7
7
|
/**
|
|
8
8
|
* Claude Code as a harness (docs/architecture.md, "First adapters"): `claude`
|
|
@@ -11,7 +11,10 @@ import { createPluginIdentity } from './plugin-identity.js';
|
|
|
11
11
|
* without AskUserQuestion and plan mode: nobody watches the session's pane, so
|
|
12
12
|
* it asks its questions over the fleet, and a question form or a plan approval
|
|
13
13
|
* waiting there would take the keys of a wake (#457, #460). Plan mode goes as a
|
|
14
|
-
* whole: without ExitPlanMode alone a session that entered it could never leave.
|
|
14
|
+
* whole: without ExitPlanMode alone a session that entered it could never leave.
|
|
15
|
+
* Its onboarding is completed before every launch, so a session on a machine
|
|
16
|
+
* where Claude Code never ran by hand stops at no first-run screen (#403). A
|
|
17
|
+
* session's identity is written and read through the aeolus
|
|
15
18
|
* plugin's own `aeolus-identity.sh`, never a copy of how the plugin names its
|
|
16
19
|
* files.
|
|
17
20
|
*/
|
|
@@ -24,8 +27,10 @@ export const CLAUDE_CODE_ADAPTER_FLAGS = [
|
|
|
24
27
|
{ flag: NO_PANE_PROMPTS, when: 'always' },
|
|
25
28
|
{ flag: CONTINUE, when: 'restart' },
|
|
26
29
|
];
|
|
30
|
+
/** Claude Code's flag that runs every tool without asking; it asks once per user to accept that (#403). */
|
|
31
|
+
export const SKIP_PERMISSIONS = '--dangerously-skip-permissions';
|
|
27
32
|
/** The flags of Claude Code that are risky: it then runs every tool without asking (#326). */
|
|
28
|
-
export const CLAUDE_CODE_RISKY_FLAGS = [
|
|
33
|
+
export const CLAUDE_CODE_RISKY_FLAGS = [SKIP_PERMISSIONS];
|
|
29
34
|
/**
|
|
30
35
|
* The configured flags, with a name for the remote-control session where the
|
|
31
36
|
* operator gave `--remote-control` without one: `[<repository or folder>]
|
|
@@ -86,6 +91,7 @@ export function createClaudeCodeHarness(options) {
|
|
|
86
91
|
isFirstStart: isFirstStart || !(await hasConversation(options.projects, folder)),
|
|
87
92
|
...(options.command !== undefined && { program: options.command }),
|
|
88
93
|
});
|
|
94
|
+
await options.setup.completeOnboarding();
|
|
89
95
|
await sessions.start({ shipId, folder, command: wordsOf(command) });
|
|
90
96
|
},
|
|
91
97
|
wake: async ({ shipId }) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-code.js","sourceRoot":"","sources":["../../src/adapters/claude-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,W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,OAAO,CAAC,OAAO,KAAK,SAAS,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC;aACnE,CAAC,CAAC;YACH,MAAM,OAAO,CAAC,KAAK,CAAC,kBAAkB,EAAE,CAAC;YACzC,MAAM,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACtE,CAAC;QACD,IAAI,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;YACzB,MAAM,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;QACrD,CAAC;QACD,UAAU,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,oBAAoB,CAAC,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,KAAK,KAAK,SAAS,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;KAChJ,CAAC;AACJ,CAAC"}
|
|
@@ -9,6 +9,7 @@ const CODEX_TEXTS = {
|
|
|
9
9
|
// A tool call done: "• Ran echo hi", "• Explored", "• Called aeolus.whoami", "• Edited file.ts".
|
|
10
10
|
activity: /^• (?:Ran \S|Explored$|Called \S|Edited \S)/mu,
|
|
11
11
|
refused: /"type":"invalid_request_error","message":"The '([^']+)' model is not supported/gu,
|
|
12
|
+
screens: [],
|
|
12
13
|
};
|
|
13
14
|
export function codexLaunchSeen(at) {
|
|
14
15
|
return launchSeenWith(CODEX_TEXTS, at);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex-screen.js","sourceRoot":"","sources":["../../src/adapters/codex-screen.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAoB,MAAM,oBAAoB,CAAC;AAEtE;;;;;GAKG;AACH,MAAM,WAAW,GAAgB;IAC/B,iGAAiG;IACjG,QAAQ,EAAE,+CAA+C;IACzD,OAAO,EAAE,kFAAkF;
|
|
1
|
+
{"version":3,"file":"codex-screen.js","sourceRoot":"","sources":["../../src/adapters/codex-screen.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAoB,MAAM,oBAAoB,CAAC;AAEtE;;;;;GAKG;AACH,MAAM,WAAW,GAAgB;IAC/B,iGAAiG;IACjG,QAAQ,EAAE,+CAA+C;IACzD,OAAO,EAAE,kFAAkF;IAC3F,OAAO,EAAE,EAAE;CACZ,CAAC;AAEF,MAAM,UAAU,eAAe,CAAC,EAAsC;IACpE,OAAO,cAAc,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;AACzC,CAAC"}
|
package/dist/adapters/codex.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { codexLaunchSeen } from './codex-screen.js';
|
|
2
2
|
import { partsWithWords, wordsOf } from './command-line.js';
|
|
3
|
-
import { effectiveFlags } from '
|
|
3
|
+
import { effectiveFlags } from '../core/effective-flags.js';
|
|
4
4
|
import { createPluginIdentity } from './plugin-identity.js';
|
|
5
5
|
/**
|
|
6
6
|
* Codex as a harness (docs/architecture.md, "First adapters"): `codex` in the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex.js","sourceRoot":"","sources":["../../src/adapters/codex.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,OAAO,EAAoB,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"codex.js","sourceRoot":"","sources":["../../src/adapters/codex.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,OAAO,EAAoB,MAAM,mBAAmB,CAAC;AAC9E,OAAO,E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AAC,CAAC;QAC7F,CAAC;QACD,UAAU,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,KAAK,KAAK,SAAS,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;KAC3I,CAAC;AACJ,CAAC"}
|
package/dist/adapters/flags.d.ts
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
1
|
import type { TrierarchConfiguration } from '@aeolus-fleet/common';
|
|
2
|
-
type HarnessConfiguration = TrierarchConfiguration['harnesses'][string];
|
|
3
|
-
/**
|
|
4
|
-
* The flags a launch gets: the harness's own, then each option's value as the
|
|
5
|
-
* settings picked it, or its default. Settings pick names only; the flags come
|
|
6
|
-
* from the configuration alone.
|
|
7
|
-
*/
|
|
8
|
-
export declare function effectiveFlags(harness: HarnessConfiguration, options: Readonly<Record<string, string>>): string[];
|
|
9
2
|
/** What `config check` prints: per harness, the flags settings with no options launch with, and each option's values. */
|
|
10
3
|
export declare function describeFlags(configuration: TrierarchConfiguration): string;
|
|
11
|
-
export {};
|
package/dist/adapters/flags.js
CHANGED
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* The flags a launch gets: the harness's own, then each option's value as the
|
|
3
|
-
* settings picked it, or its default. Settings pick names only; the flags come
|
|
4
|
-
* from the configuration alone.
|
|
5
|
-
*/
|
|
6
|
-
export function effectiveFlags(harness, options) {
|
|
7
|
-
const picked = Object.entries(harness.options).flatMap(([name, option]) => {
|
|
8
|
-
const value = options[name] ?? option.default;
|
|
9
|
-
return value === undefined ? [] : (option.values[value] ?? []);
|
|
10
|
-
});
|
|
11
|
-
return [...harness.flags, ...picked];
|
|
12
|
-
}
|
|
1
|
+
import { effectiveFlags } from '../core/effective-flags.js';
|
|
13
2
|
/** What `config check` prints: per harness, the flags settings with no options launch with, and each option's values. */
|
|
14
3
|
export function describeFlags(configuration) {
|
|
15
4
|
return Object.entries(configuration.harnesses)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flags.js","sourceRoot":"","sources":["../../src/adapters/flags.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flags.js","sourceRoot":"","sources":["../../src/adapters/flags.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,yHAAyH;AACzH,MAAM,UAAU,aAAa,CAAC,aAAqC;IACjE,OAAO,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC;SAC3C,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE;QACvB,MAAM,KAAK,GAAG,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,cAAc,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,YAAY,EAAE,CAAC,CAAC;QACzF,KAAK,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;YACjE,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC7D,MAAM,SAAS,GAAG,QAAQ,CAAC,OAAO,KAAK,KAAK,CAAC;gBAC7C,KAAK,CAAC,IAAI,CAAC,KAAK,MAAM,IAAI,KAAK,GAAG,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,YAAY,EAAE,CAAC,CAAC;YACzG,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC,CAAC;SACD,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { join } from 'node:path';
|
|
2
2
|
import { CLAUDE_CODE_ADAPTER_FLAGS, CLAUDE_CODE_RISKY_FLAGS, claudeCodeCommandLine, createClaudeCodeHarness, WAKE_PROMPT as CLAUDE_CODE_WAKE_PROMPT } from './claude-code.js';
|
|
3
|
+
import { createClaudeCodeSetup } from './claude-code-setup.js';
|
|
3
4
|
import { CODEX_ADAPTER_FLAGS, CODEX_RISKY_FLAGS, codexCommandLine, createCodexHarness, WAKE_PROMPT as CODEX_WAKE_PROMPT } from './codex.js';
|
|
4
5
|
import { findAeolusPlugin } from './plugin.js';
|
|
5
6
|
/** What the settings' first prompt and a ship's session name stand for where config check shows a command line. */
|
|
@@ -48,7 +49,7 @@ export async function createHarnesses(at) {
|
|
|
48
49
|
}
|
|
49
50
|
const plugin = await findAeolusPlugin({ homeDirectory, env, harness: name });
|
|
50
51
|
plugins[name] = plugin;
|
|
51
|
-
harnesses[name] = name === 'codex' ? createCodexHarness({ configuration, plugin, sessions }) : createClaudeCodeHarness({ configuration, plugin, sessions, projects: join(env.CLAUDE_CONFIG_DIR ?? join(homeDirectory, '.claude'), 'projects') });
|
|
52
|
+
harnesses[name] = name === 'codex' ? createCodexHarness({ configuration, plugin, sessions }) : createClaudeCodeHarness({ configuration, plugin, sessions, projects: join(env.CLAUDE_CONFIG_DIR ?? join(homeDirectory, '.claude'), 'projects'), setup: createClaudeCodeSetup({ homeDirectory }) });
|
|
52
53
|
}
|
|
53
54
|
return { harnesses, plugins };
|
|
54
55
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harnesses.js","sourceRoot":"","sources":["../../src/adapters/harnesses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAKjC,OAAO,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,WA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|
5
5
|
readonly activity: RegExp;
|
|
6
6
|
/** The refusal of a model, with the id it refused as its first group; global, so every refusal is seen. */
|
|
7
7
|
readonly refused: RegExp;
|
|
8
|
+
/** The harness's screens a session can stop at before its first prompt runs (#403), each by its name and a text only it shows. */
|
|
9
|
+
readonly screens: readonly {
|
|
10
|
+
readonly name: string;
|
|
11
|
+
readonly text: RegExp;
|
|
12
|
+
}[];
|
|
8
13
|
}
|
|
9
14
|
/**
|
|
10
15
|
* What the screen shows: the model refused, when a refusal names the one it
|
|
11
16
|
* launched with (or any, when it launched with none, so the CLI's own
|
|
12
|
-
* default); else activity when a tool line shows; else none
|
|
13
|
-
*
|
|
17
|
+
* default); else activity when a tool line shows; else none, naming the
|
|
18
|
+
* known screen it stopped at when one shows. A refusal of another id is only
|
|
19
|
+
* text, as when a ship discusses one.
|
|
14
20
|
*/
|
|
15
21
|
export declare function launchSeenWith(texts: LaunchTexts, at: {
|
|
16
22
|
screen: string;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* What the screen shows: the model refused, when a refusal names the one it
|
|
3
3
|
* launched with (or any, when it launched with none, so the CLI's own
|
|
4
|
-
* default); else activity when a tool line shows; else none
|
|
5
|
-
*
|
|
4
|
+
* default); else activity when a tool line shows; else none, naming the
|
|
5
|
+
* known screen it stopped at when one shows. A refusal of another id is only
|
|
6
|
+
* text, as when a ship discusses one.
|
|
6
7
|
*/
|
|
7
8
|
export function launchSeenWith(texts, at) {
|
|
8
9
|
for (const [, id] of at.screen.matchAll(texts.refused)) {
|
|
@@ -10,6 +11,10 @@ export function launchSeenWith(texts, at) {
|
|
|
10
11
|
return { kind: 'refused', model: id };
|
|
11
12
|
}
|
|
12
13
|
}
|
|
13
|
-
|
|
14
|
+
if (texts.activity.test(at.screen)) {
|
|
15
|
+
return { kind: 'active' };
|
|
16
|
+
}
|
|
17
|
+
const stopped = texts.screens.find((screen) => screen.text.test(at.screen));
|
|
18
|
+
return stopped === undefined ? { kind: 'none' } : { kind: 'none', screen: stopped.name };
|
|
14
19
|
}
|
|
15
20
|
//# sourceMappingURL=launch-screen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launch-screen.js","sourceRoot":"","sources":["../../src/adapters/launch-screen.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"launch-screen.js","sourceRoot":"","sources":["../../src/adapters/launch-screen.ts"],"names":[],"mappings":"AAYA;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,KAAkB,EAAE,EAAsC;IACvF,KAAK,MAAM,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;QACvD,IAAI,EAAE,KAAK,SAAS,IAAI,CAAC,EAAE,CAAC,KAAK,KAAK,SAAS,IAAI,EAAE,KAAK,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;YACpE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;QACxC,CAAC;IACH,CAAC;IACD,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC;QACnC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IAC5B,CAAC;IACD,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5E,OAAO,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC;AAC3F,CAAC"}
|
|
@@ -26,6 +26,8 @@ export interface ServiceStatus {
|
|
|
26
26
|
export interface Service {
|
|
27
27
|
/** Writes the service's file without loading it. */
|
|
28
28
|
write(): Promise<void>;
|
|
29
|
+
/** Writes the service's file over an installed one, for its next start, leaving the running trierarch and its sessions alone. */
|
|
30
|
+
rewrite(): Promise<void>;
|
|
29
31
|
/** Writes the service's file, then loads and starts it. */
|
|
30
32
|
install(): Promise<void>;
|
|
31
33
|
/** Stops the service and removes its file. */
|
package/dist/adapters/service.js
CHANGED
|
@@ -69,6 +69,8 @@ ExecStart="${at.run.node}" "${at.run.script}" run
|
|
|
69
69
|
${variables}
|
|
70
70
|
Restart=always
|
|
71
71
|
RestartSec=5
|
|
72
|
+
# The sessions run in the tmux server the trierarch starts, in this unit's control group: a stop ends the trierarch only (#479).
|
|
73
|
+
KillMode=process
|
|
72
74
|
|
|
73
75
|
[Install]
|
|
74
76
|
WantedBy=default.target
|
|
@@ -147,6 +149,8 @@ export function createService(options) {
|
|
|
147
149
|
};
|
|
148
150
|
return {
|
|
149
151
|
write,
|
|
152
|
+
// launchd reads the file when it loads the agent again; the trierarch's own stop and start do.
|
|
153
|
+
rewrite: write,
|
|
150
154
|
install: async () => {
|
|
151
155
|
await write();
|
|
152
156
|
// Unload an earlier copy first: bootstrap refuses a loaded agent.
|
|
@@ -189,6 +193,11 @@ export function createService(options) {
|
|
|
189
193
|
};
|
|
190
194
|
return {
|
|
191
195
|
write,
|
|
196
|
+
// A reload, not a restart: systemd stops and starts the unit as the new file says from then on.
|
|
197
|
+
rewrite: async () => {
|
|
198
|
+
await write();
|
|
199
|
+
await systemctl('daemon-reload');
|
|
200
|
+
},
|
|
192
201
|
install: async () => {
|
|
193
202
|
await write();
|
|
194
203
|
await systemctl('daemon-reload');
|
|
@@ -222,6 +231,6 @@ export function createService(options) {
|
|
|
222
231
|
};
|
|
223
232
|
}
|
|
224
233
|
const elsewhere = () => Promise.reject(new Error(`aeolus-trierarch knows launchd (macOS) and systemd (Linux), not ${platform}: run aeolus-trierarch run under your own supervisor`));
|
|
225
|
-
return { write: elsewhere, install: elsewhere, uninstall: elsewhere, start: elsewhere, stop: elsewhere, restart: elsewhere, status: elsewhere };
|
|
234
|
+
return { write: elsewhere, rewrite: elsewhere, install: elsewhere, uninstall: elsewhere, start: elsewhere, stop: elsewhere, restart: elsewhere, status: elsewhere };
|
|
226
235
|
}
|
|
227
236
|
//# sourceMappingURL=service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../src/adapters/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAKjC;;;;;;GAMG;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG,4BAA4B,CAAC;AAC1D,MAAM,CAAC,MAAM,YAAY,GAAG,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../src/adapters/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAKjC;;;;;;GAMG;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG,4BAA4B,CAAC;AAC1D,MAAM,CAAC,MAAM,YAAY,GAAG,0BAA0B,CAAC;AAoCvD,qGAAqG;AACrG,MAAM,mBAAmB,GAAG,CAAC,oBAAoB,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,YAAY,EAAE,yBAAyB,CAAU,CAAC;AAEnL,MAAM,YAAY,GAAG,eAAe,CAAC;AAErC,mHAAmH;AACnH,MAAM,UAAU,kBAAkB,CAAC,GAAiD;IAClF,MAAM,WAAW,GAA2B,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,IAAI,YAAY,EAAE,CAAC;IAC/E,KAAK,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,CAAC,KAAK,CAAC,CAAC;gBACrD,MAAM,GAAG,GAAG,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC;gBAC/D,OAAO,OAAO,CAAC,IAAI,EAAE,QAAQ,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YAC9D,CAAC;SACF,CAAC;IACJ,CAAC;IAED,MAAM,SAAS,GAAG,GAAmB,EAAE,CACrC,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,mEAAmE,QAAQ,sDAAsD,CAAC,CAAC,CAAC;IAC/J,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;AACtK,CAAC"}
|
package/dist/adapters/trust.d.ts
CHANGED
|
@@ -5,7 +5,9 @@ import type { TrustPort } from '../core/ports.js';
|
|
|
5
5
|
* (#381): Claude Code's ~/.claude.json, Codex's config.toml. A repository is
|
|
6
6
|
* trusted when its own checkout is, as both ask about a worktree's
|
|
7
7
|
* repository; a folder when its path is. A harness with no reader trusts
|
|
8
|
-
* nothing.
|
|
8
|
+
* nothing. Claude Code's skip-permissions flag is unaccepted until bypass
|
|
9
|
+
* permissions mode is accepted in its settings (#403); Codex asks about no
|
|
10
|
+
* flag.
|
|
9
11
|
*/
|
|
10
12
|
export declare function createTrust(at: {
|
|
11
13
|
configuration: TrierarchConfiguration;
|
package/dist/adapters/trust.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SKIP_PERMISSIONS } from './claude-code.js';
|
|
1
2
|
import { createClaudeCodeSetup } from './claude-code-setup.js';
|
|
2
3
|
import { codexTrustedFolders } from './codex-setup.js';
|
|
3
4
|
/**
|
|
@@ -5,14 +6,20 @@ import { codexTrustedFolders } from './codex-setup.js';
|
|
|
5
6
|
* (#381): Claude Code's ~/.claude.json, Codex's config.toml. A repository is
|
|
6
7
|
* trusted when its own checkout is, as both ask about a worktree's
|
|
7
8
|
* repository; a folder when its path is. A harness with no reader trusts
|
|
8
|
-
* nothing.
|
|
9
|
+
* nothing. Claude Code's skip-permissions flag is unaccepted until bypass
|
|
10
|
+
* permissions mode is accepted in its settings (#403); Codex asks about no
|
|
11
|
+
* flag.
|
|
9
12
|
*/
|
|
10
13
|
export function createTrust(at) {
|
|
11
14
|
const { configuration, homeDirectory, env } = at;
|
|
15
|
+
const claudeCode = createClaudeCodeSetup({ homeDirectory });
|
|
12
16
|
const readers = {
|
|
13
|
-
'claude-code': () =>
|
|
17
|
+
'claude-code': () => claudeCode.trustedFolders(),
|
|
14
18
|
codex: () => codexTrustedFolders({ homeDirectory, env }),
|
|
15
19
|
};
|
|
20
|
+
const unaccepted = {
|
|
21
|
+
'claude-code': async () => ((await claudeCode.isSkipPermissionsAccepted()) ? [] : [SKIP_PERMISSIONS]),
|
|
22
|
+
};
|
|
16
23
|
const namesIn = (places, trusted) => Object.entries(places)
|
|
17
24
|
.filter(([, place]) => trusted.has(place.path))
|
|
18
25
|
.map(([name]) => name);
|
|
@@ -20,7 +27,8 @@ export function createTrust(at) {
|
|
|
20
27
|
trusted: async () => {
|
|
21
28
|
const entries = await Promise.all(Object.keys(configuration.harnesses).map(async (harness) => {
|
|
22
29
|
const trusted = (await readers[harness]?.()) ?? new Set();
|
|
23
|
-
|
|
30
|
+
const unacceptedFlags = (await unaccepted[harness]?.()) ?? [];
|
|
31
|
+
return [harness, { repositories: namesIn(configuration.repositories, trusted), folders: namesIn(configuration.folders, trusted), unacceptedFlags }];
|
|
24
32
|
}));
|
|
25
33
|
return Object.fromEntries(entries);
|
|
26
34
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trust.js","sourceRoot":"","sources":["../../src/adapters/trust.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD
|
|
1
|
+
{"version":3,"file":"trust.js","sourceRoot":"","sources":["../../src/adapters/trust.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW,CAAC,EAAuH;IACjJ,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;IACjD,MAAM,UAAU,GAAG,qBAAqB,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC;IAC5D,MAAM,OAAO,GAA+E;QAC1F,aAAa,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,cAAc,EAAE;QAChD,KAAK,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,EAAE,aAAa,EAAE,GAAG,EAAE,CAAC;KACzD,CAAC;IACF,MAAM,UAAU,GAA6E;QAC3F,aAAa,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,MAAM,UAAU,CAAC,yBAAyB,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC;KACtG,CAAC;IACF,MAAM,OAAO,GAAG,CAAC,MAA8C,EAAE,OAA4B,EAAY,EAAE,CACzG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;SACnB,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SAC9C,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;IAE3B,OAAO;QACL,OAAO,EAAE,KAAK,IAA4B,EAAE;YAC1C,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAC/B,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;gBACzD,MAAM,OAAO,GAAG,CAAC,MAAM,OAAO,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,IAAI,IAAI,GAAG,EAAU,CAAC;gBAClE,MAAM,eAAe,GAAG,CAAC,MAAM,UAAU,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC;gBAC9D,OAAO,CAAC,OAAO,EAAE,EAAE,YAAY,EAAE,OAAO,CAAC,aAAa,CAAC,YAAY,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,eAAe,EAAE,CAAU,CAAC;YAC/J,CAAC,CAAC,CACH,CAAC;YACF,OAAO,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACrC,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/cli/config-check.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { describeCommandLine } from '../adapters/command-line.js';
|
|
2
2
|
import { createDetectedFile } from '../adapters/detected-file.js';
|
|
3
3
|
import { loadConfiguration, TrierarchFileError } from '../adapters/files.js';
|
|
4
|
-
import { describeFlags
|
|
4
|
+
import { describeFlags } from '../adapters/flags.js';
|
|
5
|
+
import { effectiveFlags } from '../core/effective-flags.js';
|
|
5
6
|
import { adapterFlagsOf, commandLinesOf } from '../adapters/harnesses.js';
|
|
6
7
|
import { modelOptionsIgnored, withDetectedOptions } from '../core/detected-options.js';
|
|
7
8
|
export async function configCheck(paths) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-check.js","sourceRoot":"","sources":["../../src/cli/config-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAoB,MAAM,6BAA6B,CAAC;AACpF,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"config-check.js","sourceRoot":"","sources":["../../src/cli/config-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAoB,MAAM,6BAA6B,CAAC;AACpF,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AA2BvF,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,KAAqB;IACrD,MAAM,UAAU,GAAG,MAAM,iBAAiB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACzD,MAAM,CAAC,SAAS,EAAE,GAAG,IAAI,CAAC,GAAG,mBAAmB,CAAC,UAAU,CAAC,CAAC;IAC7D,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC5B,uGAAuG;QACvG,MAAM,IAAI,kBAAkB,CAC1B,wBAAwB,KAAK,CAAC,MAAM,4BAA4B,CAAC,SAAS,EAAE,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,+FAA+F,CAC/L,CAAC;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