@north-light/crouter 0.3.274 → 0.3.276
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/dist/builtin-memory/02-turn-lifecycle/01-terminal.md +1 -1
- package/dist/clients/attach/viewer.js +459 -459
- package/dist/commands/cron.js +3 -3
- package/dist/commands/node/create.js +3 -1
- package/dist/commands/node-worktree.js +7 -7
- package/dist/commands/pkg/plugin-manage.js +19 -8
- package/dist/commands/push.js +1 -1
- package/dist/core/__tests__/helpers/harness.d.ts +1 -0
- package/dist/core/__tests__/helpers/harness.js +12 -10
- package/dist/core/__tests__/integration/worktree-land.test.js +7 -2
- package/dist/core/__tests__/seam/broker-provider-retry.test.js +3 -16
- package/dist/core/canvas/browse/render.js +82 -67
- package/dist/core/canvas/status-glyph.d.ts +4 -3
- package/dist/core/canvas/status-glyph.js +17 -9
- package/dist/core/canvas/types.d.ts +18 -0
- package/dist/core/command-plugins/bundle.d.ts +7 -0
- package/dist/core/command-plugins/bundle.js +18 -4
- package/dist/core/git.d.ts +5 -1
- package/dist/core/git.js +18 -4
- package/dist/core/runtime/spawn.d.ts +2 -0
- package/dist/core/runtime/spawn.js +1 -1
- package/dist/core/runtime/surface-bg.d.ts +6 -4
- package/dist/core/runtime/surface-bg.js +39 -22
- package/dist/core/tui/draw.d.ts +2 -0
- package/dist/core/tui/draw.js +15 -0
- package/dist/core/worktree-sweep.js +28 -5
- package/dist/core/worktree.d.ts +1 -12
- package/dist/core/worktree.js +222 -10
- package/dist/daemon/api/handlers/crons.js +5 -4
- package/dist/daemon/api/handlers/messages.js +5 -0
- package/dist/daemon/api/handlers/nodes.js +2 -0
- package/dist/daemon/api/handlers/reports.js +11 -7
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
- package/runtime.lock.json +2 -2
|
@@ -9,7 +9,7 @@ import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';
|
|
|
9
9
|
import { join } from 'node:path';
|
|
10
10
|
import { getNode } from '../../../core/canvas/canvas.js';
|
|
11
11
|
import { push, FinalizationError } from '../../../core/feed/feed.js';
|
|
12
|
-
import { autoDropCleanManagedWorktree, hasOpenManagedWorktree, missingWorktreeRecoveryHint } from '../../../core/worktree.js';
|
|
12
|
+
import { autoDropCleanManagedWorktree, branchIsPushedAtCurrentTip, hasOpenManagedWorktree, missingWorktreeRecoveryHint } from '../../../core/worktree.js';
|
|
13
13
|
import { reportsDir } from '../../../core/canvas/paths.js';
|
|
14
14
|
import { notFound, usage } from '../../../core/errors.js';
|
|
15
15
|
import { InputError } from '../../../core/io.js';
|
|
@@ -51,14 +51,19 @@ async function handlePush(ctx) {
|
|
|
51
51
|
// `final` with an OPEN managed worktree, BEFORE the push/transition (spec
|
|
52
52
|
// §6.2 — worktree fs ops are server-side). A provably-clean, zero-commit
|
|
53
53
|
// worktree is auto-dropped so a read-only or already-landed node
|
|
54
|
-
// can finish without an explicit `node worktree close`;
|
|
55
|
-
//
|
|
54
|
+
// can finish without an explicit `node worktree close`; a clean worktree
|
|
55
|
+
// whose exact tip is already on origin can also finish while retaining its
|
|
56
|
+
// branch and checkout. Any work that is neither locally landed nor remotely
|
|
57
|
+
// retained instead blocks with the parity `open_managed_worktree` error,
|
|
56
58
|
// round-tripped via CrtrError.details so the CLI renders the same InputError
|
|
57
59
|
// (next-hint included) it surfaced before B-5 re-homed this to the server.
|
|
58
60
|
let autoDroppedPath;
|
|
59
61
|
if (req.tier === 'final' && hasOpenManagedWorktree(getNode(id))) {
|
|
60
62
|
const dropped = autoDropCleanManagedWorktree(id);
|
|
61
|
-
if (dropped
|
|
63
|
+
if (dropped !== null) {
|
|
64
|
+
autoDroppedPath = dropped.worktree_path;
|
|
65
|
+
}
|
|
66
|
+
else if (!(await branchIsPushedAtCurrentTip(getNode(id).managed_worktree))) {
|
|
62
67
|
// Thrown as InputError so `toErrorBody` round-trips the FULL structured
|
|
63
68
|
// payload (code + message + next) into `ApiError.details`, and the CLI's
|
|
64
69
|
// shared `apiErrorToCliError` reconstructs it byte-for-byte — no
|
|
@@ -70,11 +75,10 @@ async function handlePush(ctx) {
|
|
|
70
75
|
const wt = getNode(id)?.managed_worktree;
|
|
71
76
|
return wt !== null && wt !== undefined && wt.state === 'open' && !existsSync(wt.path)
|
|
72
77
|
? missingWorktreeRecoveryHint(wt)
|
|
73
|
-
: 'Commit the remaining work in the worktree,
|
|
78
|
+
: 'Commit the remaining work in the worktree, push its branch to origin at its current tip, then rerun `crtr push final`; or run `crtr node worktree close` to land it locally.';
|
|
74
79
|
})(),
|
|
75
80
|
});
|
|
76
81
|
}
|
|
77
|
-
autoDroppedPath = dropped.worktree_path;
|
|
78
82
|
}
|
|
79
83
|
const result = await pushOrRethrow(id, req);
|
|
80
84
|
const transitioned = req.tier === 'final' && before !== undefined
|
|
@@ -100,7 +104,7 @@ async function pushOrRethrow(id, req) {
|
|
|
100
104
|
throw new InputError({
|
|
101
105
|
error: 'already_finalized',
|
|
102
106
|
message: 'This node already submitted its canonical final result.',
|
|
103
|
-
next: '
|
|
107
|
+
next: 'Push an update with the new information, then stop.',
|
|
104
108
|
});
|
|
105
109
|
}
|
|
106
110
|
if (err instanceof FinalizationError && err.code === 'finalization_forbidden') {
|
package/dist/types.d.ts
CHANGED
|
@@ -97,7 +97,7 @@ export interface PluginManifest {
|
|
|
97
97
|
commands?: string;
|
|
98
98
|
/** Plugin-root-relative path to a declarative hook manifest (`hooks.json`).
|
|
99
99
|
* Must be declared together with `hookExecutable`; hooks are trusted local
|
|
100
|
-
* code
|
|
100
|
+
* code. */
|
|
101
101
|
hooks?: string;
|
|
102
102
|
/** Plugin-root-relative executable that dispatches declarations in `hooks`.
|
|
103
103
|
* Must be a regular file with a POSIX executable permission bit. */
|
package/package.json
CHANGED
package/runtime.lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/crouter",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.276",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@north-light/crouter",
|
|
9
|
-
"version": "0.3.
|
|
9
|
+
"version": "0.3.276",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"dependencies": {
|