Files
Michał Pierzchała 51ed6217cc refactor(daemon): relocate the daemon client out of src/daemon (#2360)
* refactor(daemon): extract the repair-tombstone reader below store and client

`findUnrecoveredRepairCommitFailure` reads session artifacts off disk and is
reached from the daemon client, which had to import `session-store.ts` — the
daemon's largest server module — for it. Move the tombstone shape, its file
reader and the unrecovered-commit scan into `session-repair-tombstone.ts`, a
leaf below both, and give the tombstone file name a single owner.

No behavior change; both consumers keep their existing tests.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CZkJjeEhLmyGpGtcwY8pqc

* refactor(daemon): relocate the daemon client out of src/daemon

`src/daemon/client/` is the daemon's client, not the daemon: no daemon file
imports it, and its consumers are the CLI, the Node client, the proxy command
and the injected dispatch type. Move it to `src/daemon-client/` as renames so
`src/daemon` is server code plus the shared kernel the client still needs —
`config.ts`, `daemon-process.ts`, `request-progress-protocol.ts`,
`daemon-request.ts` and the extracted `session-repair-tombstone.ts`.

Zone name and rank are unchanged (`daemon-client`, 5); the zone now falls out
of the folder instead of a `src/daemon/client/` prefix. Tests move unchanged.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CZkJjeEhLmyGpGtcwY8pqc

* refactor(daemon): move the session artifact path helpers out of session-store

`src/cli.ts` and `src/remote/remote-request-diagnostics.ts` reach into
`session-store.ts` for one pure path function, `resolveRemoteRequestDiagnosticsPath`,
which made every CLI process eagerly evaluate the daemon's session store and
its whole subtree — the script writer, the event log, the action recorder and
the replay transaction vocabulary.

The four artifact path helpers name files; they hold no store state. Move them
to `src/daemon/session-artifact-paths.ts`, a leaf over `session-paths.ts`, and
point all ten consumers at it. `src/cli.ts`'s eager closure drops from 379
modules to 365 and no longer contains `session-store.ts`; the store itself is
464 -> 341 lines. AGENTS.md's declaration-site pointer follows.

No behavior change: the helpers are unmodified.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CZkJjeEhLmyGpGtcwY8pqc

* chore(gates): re-key the daemon-client gate paths onto src/daemon-client

Path-keyed enforcement follows the relocated files: the fallow health baseline
entries, the oxlint per-file override, the wire-compat surface/ledger/mutation
paths, and the layering zone derivation (the `src/daemon/client/` prefix is
dead now that the folder itself names the zone).

R10's external daemon request/session-state importer list gains the five client
modules. The edges are unchanged by this PR — the client has always built
`DaemonRequest` and read `DaemonResponse`; it sat inside `src/daemon/` and so
fell under the prefix skip. Naming the files keeps the dependency enumerated
and shrink-only, so a new `src/daemon-client/` module reaching `session-state`
still fails. Its size assertion now reads the recorded list instead of a
literal.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CZkJjeEhLmyGpGtcwY8pqc

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-07 07:49:19 +02:00

151 lines
4.0 KiB
TypeScript

import nkzw from '@nkzw/oxlint-config';
import { defineConfig } from 'oxlint';
export default defineConfig({
env: {
builtin: true,
es2024: true,
node: true,
},
extends: [nkzw],
ignorePatterns: ['dist/**', 'node_modules/**'],
rules: {
'@typescript-eslint/array-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@nkzw/no-instanceof': 'off',
curly: 'off',
'import/default': 'error',
'import/no-duplicates': 'error',
'import/namespace': 'error',
'import/no-namespace': 'off',
'no-caller': 'error',
'no-console': 'off',
'no-empty': ['error', { allowEmptyCatch: true }],
'no-eval': 'error',
'no-iterator': 'error',
'no-unassigned-vars': 'error',
'no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
fix: {
imports: 'safe-fix',
variables: 'suggestion',
},
varsIgnorePattern: '^_',
},
],
'perfectionist/sort-object-types': 'off',
'perfectionist/sort-objects': 'off',
'typescript/no-this-alias': 'error',
'typescript/no-unnecessary-parameter-property-assignment': 'error',
'typescript/no-useless-empty-export': 'error',
'unicorn/consistent-function-scoping': 'off',
'unicorn/numeric-separators-style': 'off',
'unicorn/prefer-top-level-await': 'off',
'unicorn/prefer-structured-clone': 'off',
},
overrides: [
{
files: ['scripts/**/*.ts', 'scripts/**/*.mts', 'scripts/**/*.cts'],
rules: {
'no-undef': 'error',
},
},
{
files: ['src/**/*.ts', 'packages/host-kit/src/**/*.ts'],
rules: {
'no-restricted-imports': [
'error',
{
paths: [
{
name: 'node:child_process',
message:
'Use process helpers from @agent-device/host-kit/command instead of importing node:child_process directly.',
},
],
},
],
},
},
{
files: ['src/commands/**/*.ts', 'src/cli/commands/**/*.ts'],
rules: {
'no-restricted-imports': [
'error',
{
paths: [
{
name: 'node:child_process',
message:
'Use process helpers from @agent-device/host-kit/command instead of importing node:child_process directly.',
},
],
patterns: [
{
group: ['@agent-device/provider-*'],
message:
'Command implementations must ask src/cli/connection/provider-policy.ts for provider capabilities.',
},
],
},
],
},
},
{
files: [
'packages/host-kit/src/internal/exec.ts',
'packages/host-kit/src/**/*.test.ts',
'src/**/*.test.ts',
'src/**/__tests__/**/*.ts',
],
rules: {
'no-restricted-imports': ['error', { paths: [] }],
},
},
{
files: ['examples/test-app/src/**/*.tsx'],
rules: {
'react/immutability': 'off',
'react/purity': 'off',
'react/refs': 'off',
},
},
{
files: ['examples/test-app/app.config.js'],
rules: {
'@typescript-eslint/no-require-imports': 'off',
},
},
{
files: [
'src/daemon-client/daemon-client-rpc.ts',
'src/daemon/downloadable-artifact-http.ts',
'src/remote/remote-request-diagnostics.ts',
'src/remote/upload-stream.ts',
],
rules: {
'unicorn/catch-error-name': 'off',
'unicorn/prefer-string-replace-all': 'off',
},
},
{
files: [
'src/daemon/replay/internal/__tests__/session-replay-target-verification-runtime.test.ts',
],
rules: {
'unicorn/prefer-string-raw': 'off',
},
},
{
files: ['scripts/maestro-conformance/corpus/authored/runscript.js'],
globals: {
output: 'writable',
},
},
],
});