@wjarka/cezarion 0.17.0-dev.5528 → 0.17.0-dev.5536
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/ci-wait/controller.d.ts +37 -37
- package/dist/delegation/routes.d.ts +15 -15
- package/dist/delegation/transport.d.ts +15 -15
- package/dist/home/migration-boot.d.ts +5 -1
- package/dist/home/migration-boot.js +10 -4
- package/dist/home/migration-boot.js.map +1 -1
- package/dist/server/activity-routes.d.ts +23 -23
- package/dist/server/open-in-targets.d.ts +6 -4
- package/dist/server/open-in-targets.js +5 -10
- package/dist/server/open-in-targets.js.map +1 -1
- package/dist/server/run-checkout.d.ts +12 -1
- package/dist/server/run-checkout.js +19 -1
- package/dist/server/run-checkout.js.map +1 -1
- package/dist/server/self-update-routes.d.ts +19 -19
- package/dist/server/server.d.ts +1440 -1494
- package/dist/server/server.js +20 -20
- package/dist/server/server.js.map +1 -1
- package/dist/server-install/group-migrate.js +25 -10
- package/dist/server-install/group-migrate.js.map +1 -1
- package/dist/server-install/migrate-cli.js +9 -3
- package/dist/server-install/migrate-cli.js.map +1 -1
- package/dist/server-install/platforms/ubuntu-vps-migration.js +16 -0
- package/dist/server-install/platforms/ubuntu-vps-migration.js.map +1 -1
- package/dist/server-install/state.d.ts +2 -2
- package/dist/server-install/state.js +5 -5
- package/dist/server-install/state.js.map +1 -1
- package/dist/server-install/strategies.d.ts +2 -0
- package/dist/server-install/strategies.js +4 -0
- package/dist/server-install/strategies.js.map +1 -1
- package/dist/workspace/backups.d.ts +1 -1
- package/dist/workspace/backups.js +5 -1
- package/dist/workspace/backups.js.map +1 -1
- package/package.json +3 -3
package/dist/server/server.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { runCheckout, preparePublishCheckout, reclaimCheckoutError
|
|
1
|
+
import { runCheckout, preparePublishCheckout, reclaimCheckoutError } from './run-checkout.js';
|
|
2
2
|
import { adoptFallbackControl, protectFallbackRun, runArtifactDirectory } from './project-run-files.js';
|
|
3
3
|
import { deleteSavedWorkflow } from './workflow-files.js';
|
|
4
4
|
import { projectPaths, fallbackProjectWriteError } from '../project-paths.js';
|
|
@@ -3187,11 +3187,10 @@ export function createApp(deps) {
|
|
|
3187
3187
|
// "Open in terminal" (spec 003): hand the session off to a real terminal —
|
|
3188
3188
|
// in the task's worktree when it still exists (spec 006).
|
|
3189
3189
|
.post('/runs/:id/open-in-cli', async (c) => {
|
|
3190
|
-
const
|
|
3191
|
-
const
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
return c.json({ error: 'not found' }, 404);
|
|
3190
|
+
const project = c.get('project');
|
|
3191
|
+
const checkout = runCheckout(project, c.req.param('id'), 'open', { ignoresEngineOwnership: true, defaultTargetNeedsWorktree: false });
|
|
3192
|
+
if ('status' in checkout)
|
|
3193
|
+
return c.json(checkout.body, checkout.status);
|
|
3195
3194
|
// Hosted mode: there is no "my machine" to open a terminal on. The UI
|
|
3196
3195
|
// hides the button when localHandoff is false — this is defense in depth.
|
|
3197
3196
|
if (!capabilities().localHandoff) {
|
|
@@ -3199,15 +3198,15 @@ export function createApp(deps) {
|
|
|
3199
3198
|
error: 'local handoff is disabled — this cockpit runs in hosted mode (CEZ_REMOTE); resume the session from a machine that has the checkout',
|
|
3200
3199
|
}, 409);
|
|
3201
3200
|
}
|
|
3202
|
-
const sessionStep = [...run.steps].reverse().find((s) => s.sessionId);
|
|
3201
|
+
const sessionStep = [...checkout.run.steps].reverse().find((s) => s.sessionId);
|
|
3203
3202
|
const sessionId = sessionStep?.sessionId;
|
|
3204
3203
|
if (!sessionId)
|
|
3205
3204
|
return c.json({ error: 'no agent session to resume' }, 409);
|
|
3206
|
-
const backend = sessionStep?.backend ?? run.runner ?? 'claude';
|
|
3205
|
+
const backend = sessionStep?.backend ?? checkout.run.runner ?? 'claude';
|
|
3207
3206
|
const blocked = await providerActionError([backend]);
|
|
3208
3207
|
if (blocked)
|
|
3209
3208
|
return c.json({ error: blocked }, 409);
|
|
3210
|
-
const cwd =
|
|
3209
|
+
const cwd = checkout.directory();
|
|
3211
3210
|
const refusal = fallbackProjectWriteError(cwd);
|
|
3212
3211
|
if (refusal)
|
|
3213
3212
|
return c.json({ error: refusal }, 409);
|
|
@@ -3232,11 +3231,10 @@ export function createApp(deps) {
|
|
|
3232
3231
|
})
|
|
3233
3232
|
// Open a run's worktree (or the repo root) in the chosen local app.
|
|
3234
3233
|
.post('/runs/:id/open-in', jsonZodValidator(openInSchema), async (c) => {
|
|
3235
|
-
const
|
|
3236
|
-
const
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
return c.json({ error: 'not found' }, 404);
|
|
3234
|
+
const project = c.get('project');
|
|
3235
|
+
const checkout = runCheckout(project, c.req.param('id'), 'open', { ignoresEngineOwnership: false, defaultTargetNeedsWorktree: true });
|
|
3236
|
+
if ('status' in checkout)
|
|
3237
|
+
return c.json(checkout.body, checkout.status);
|
|
3240
3238
|
if (!capabilities().localHandoff) {
|
|
3241
3239
|
return c.json({
|
|
3242
3240
|
error: 'local handoff is disabled — this cockpit runs in hosted mode (CEZ_REMOTE)',
|
|
@@ -3244,17 +3242,19 @@ export function createApp(deps) {
|
|
|
3244
3242
|
}
|
|
3245
3243
|
// Follows the safeParse convention (#429); the downstream allowlist match is the real
|
|
3246
3244
|
// injection guard, this just validates the shape.
|
|
3247
|
-
const
|
|
3248
|
-
const
|
|
3249
|
-
const dir = run.worktreePath && existsSync(run.worktreePath) ? run.worktreePath : repoRoot;
|
|
3245
|
+
const { target, path: relPath } = c.req.valid('json');
|
|
3246
|
+
const dir = checkout.directory();
|
|
3250
3247
|
if (target === 'default') {
|
|
3251
|
-
|
|
3248
|
+
const worktree = checkout.defaultWorktree();
|
|
3249
|
+
if (typeof worktree !== 'string')
|
|
3250
|
+
return c.json(worktree.body, worktree.status);
|
|
3251
|
+
return openRunDefaultApp(c, worktree, relPath, openFile);
|
|
3252
3252
|
}
|
|
3253
3253
|
const cliRunner = agentCliRunner(target);
|
|
3254
3254
|
if (cliRunner) {
|
|
3255
|
-
return openRunCli(c, run, cliRunner, dir,
|
|
3255
|
+
return openRunCli(c, checkout.run, cliRunner, dir, project.root, { home: deps.home,
|
|
3256
3256
|
providerActionError, resumeCommand, handoffEnv, handoffFallbackCommand, openTerminal,
|
|
3257
|
-
});
|
|
3257
|
+
}, checkout);
|
|
3258
3258
|
}
|
|
3259
3259
|
return openRunApp(c, target, dir, openApp);
|
|
3260
3260
|
})
|