@clagentic/console 1.10.0 → 1.11.0-beta.2
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 +14 -1
- package/bin/cli.js +38 -16
- package/lib/agents.js +1 -55
- package/lib/bash-auto-approve.js +133 -0
- package/lib/build-identity.js +23 -5
- package/lib/build-sha.json +2 -2
- package/lib/build-update-check.js +0 -62
- package/lib/build-update-offer.js +23 -13
- package/lib/build-update-restart.js +59 -43
- package/lib/cli/arg-validation.js +50 -0
- package/lib/cli/daemon-launch.js +5 -4
- package/lib/cli/menus.js +2 -2
- package/lib/cli/schedule-input-subcommands.js +327 -0
- package/lib/cli/session-subcommands.js +101 -17
- package/lib/client-build-id.js +56 -0
- package/lib/daemon.js +38 -6
- package/lib/identity/index.js +9 -4
- package/lib/injected-sender.js +225 -0
- package/lib/message-sender-record.js +133 -0
- package/lib/pending-prompts.js +55 -0
- package/lib/permission-mode-policy.js +63 -0
- package/lib/permission-settings.js +96 -0
- package/lib/permission-summary.js +67 -0
- package/lib/project-connection.js +10 -11
- package/lib/project-external-trigger.js +9 -1
- package/lib/project-loop.js +50 -23
- package/lib/project-permission-settings.js +59 -0
- package/lib/project-prompt-responses.js +25 -15
- package/lib/project-sessions.js +164 -60
- package/lib/project-user-message.js +18 -47
- package/lib/project.js +46 -74
- package/lib/public/app.js +4 -7
- package/lib/public/css/channel-layout.css +20 -0
- package/lib/public/css/diagnostics.css +7 -0
- package/lib/public/css/input.css +78 -0
- package/lib/public/css/menus.css +17 -0
- package/lib/public/css/overlays.css +0 -3
- package/lib/public/css/scheduler-modal.css +5 -0
- package/lib/public/index.html +44 -8
- package/lib/public/modules/app-connection.js +18 -1
- package/lib/public/modules/app-loop-ui.js +11 -1
- package/lib/public/modules/app-messages.js +23 -30
- package/lib/public/modules/app-panels.js +10 -3
- package/lib/public/modules/app-rate-limit.js +64 -88
- package/lib/public/modules/app-rendering.js +37 -6
- package/lib/public/modules/approve-tools-toggle.js +33 -0
- package/lib/public/modules/at-agents.js +8 -0
- package/lib/public/modules/build-guard.js +61 -0
- package/lib/public/modules/build-update-detail.js +1 -4
- package/lib/public/modules/diagnostics.js +98 -9
- package/lib/public/modules/injected-identity.js +78 -0
- package/lib/public/modules/injected-label.js +62 -0
- package/lib/public/modules/input.js +64 -114
- package/lib/public/modules/loop-hooks-warning.js +20 -0
- package/lib/public/modules/mode-options.js +35 -16
- package/lib/public/modules/permission-settings.js +56 -0
- package/lib/public/modules/project-settings.js +3 -0
- package/lib/public/modules/rate-limit-state.js +47 -22
- package/lib/public/modules/schedule-panel.js +234 -0
- package/lib/public/modules/schedule-time.js +193 -0
- package/lib/public/modules/scheduled-input-actions.js +19 -0
- package/lib/public/modules/scheduler-config.js +12 -0
- package/lib/public/modules/scheduler.js +8 -0
- package/lib/public/modules/server-settings.js +5 -9
- package/lib/public/modules/settings-defaults.js +18 -4
- package/lib/runtime-env.js +4 -0
- package/lib/scheduled-input/ipc.js +92 -0
- package/lib/scheduled-input/rate-limit-resume.js +53 -0
- package/lib/scheduled-input/records.js +350 -0
- package/lib/scheduled-input/service.js +743 -0
- package/lib/scheduled-input/store.js +132 -0
- package/lib/scheduled-input/ws.js +194 -0
- package/lib/scheduler.js +4 -0
- package/lib/sdk-bridge.js +194 -175
- package/lib/sdk-message-processor.js +13 -5
- package/lib/sdk-skill-discovery.js +17 -0
- package/lib/sender-ref.js +109 -0
- package/lib/server.js +37 -11
- package/lib/session-directory.js +224 -0
- package/lib/session-file-scan.js +55 -0
- package/lib/session-input-ipc.js +21 -0
- package/lib/session-input.js +396 -23
- package/lib/session-name-holder.js +82 -0
- package/lib/session-resume.js +3 -0
- package/lib/sessions.js +111 -2
- package/lib/turn-initiator.js +6 -2
- package/lib/updater.js +8 -2
- package/lib/ws-schema.js +20 -9
- package/lib/yoke/adapters/claude-worker.js +3 -1
- package/lib/yoke/adapters/claude.js +13 -17
- package/lib/yoke/adapters/codex.js +18 -5
- package/lib/yoke/adapters/permission-relay.js +9 -0
- package/lib/yoke/interface.js +7 -1
- package/package.json +1 -1
- package/scripts/check-test-count.js +1 -1
- package/scripts/install-local-test.js +45 -1
- package/scripts/postinstall.js +1 -0
|
@@ -15,7 +15,10 @@
|
|
|
15
15
|
// trailing JSON array specifically (the only valid JSON substring `npm pack
|
|
16
16
|
// --json` ever emits), rather than trusting the whole stdout to be clean.
|
|
17
17
|
|
|
18
|
+
const fs = require('fs');
|
|
19
|
+
const path = require('path');
|
|
18
20
|
const { execFileSync } = require('child_process');
|
|
21
|
+
const { createTreeHasher } = require('../lib/build-identity');
|
|
19
22
|
|
|
20
23
|
// Extracts the packed tarball filename from `npm pack --json`'s raw stdout.
|
|
21
24
|
// Exported (not just used internally) so tests can exercise the parsing
|
|
@@ -66,7 +69,48 @@ function packAndGetFilename() {
|
|
|
66
69
|
return extractTarballFilename(raw);
|
|
67
70
|
}
|
|
68
71
|
|
|
72
|
+
// A same-sha reinstall replaces the installed files with new inodes under a
|
|
73
|
+
// running daemon, so it can only do harm: the daemon is already running that
|
|
74
|
+
// build. True when the installed build has this tree's sha and the same files.
|
|
75
|
+
// `read` is injectable for tests; it must return { headSha, installedSha,
|
|
76
|
+
// repoHash, installedHash } and any of them may be null when unknown.
|
|
77
|
+
function installedMatchesTree(read) {
|
|
78
|
+
const s = read();
|
|
79
|
+
return !!(s.headSha && s.installedSha === s.headSha &&
|
|
80
|
+
s.repoHash && s.installedHash === s.repoHash);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function readTreeState() {
|
|
84
|
+
const repoRoot = path.join(__dirname, '..');
|
|
85
|
+
const headSha = execFileSync('git', ['rev-parse', 'HEAD'], { cwd: repoRoot, encoding: 'utf8' }).trim();
|
|
86
|
+
const globalRoot = execFileSync('npm', ['root', '-g'], { encoding: 'utf8' }).trim();
|
|
87
|
+
const installedRoot = path.join(globalRoot, '@clagentic', 'console');
|
|
88
|
+
const installedSha = JSON.parse(fs.readFileSync(path.join(installedRoot, 'lib', 'build-sha.json'), 'utf8')).sha;
|
|
89
|
+
return {
|
|
90
|
+
headSha,
|
|
91
|
+
installedSha,
|
|
92
|
+
repoHash: createTreeHasher(repoRoot).hash(),
|
|
93
|
+
installedHash: createTreeHasher(installedRoot).hash(),
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Any failure to establish the match (nothing installed yet, unreadable
|
|
98
|
+
// tree) means "install", never "skip".
|
|
99
|
+
function shouldSkipInstall(read) {
|
|
100
|
+
try {
|
|
101
|
+
return installedMatchesTree(read || readTreeState);
|
|
102
|
+
} catch (err) {
|
|
103
|
+
console.log(`[install-local-test] could not compare with the installed build (${err.message}); installing`);
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
69
108
|
function main() {
|
|
109
|
+
if (!process.argv.includes('--force') && shouldSkipInstall()) {
|
|
110
|
+
console.log('[install-local-test] ok: this build is already installed with identical files; nothing to do (--force reinstalls)');
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
|
|
70
114
|
let tarball;
|
|
71
115
|
try {
|
|
72
116
|
tarball = packAndGetFilename();
|
|
@@ -90,7 +134,7 @@ function main() {
|
|
|
90
134
|
console.log('[install-local-test] ok: installed');
|
|
91
135
|
}
|
|
92
136
|
|
|
93
|
-
module.exports = { extractTarballFilename };
|
|
137
|
+
module.exports = { extractTarballFilename, installedMatchesTree, shouldSkipInstall };
|
|
94
138
|
|
|
95
139
|
if (require.main === module) {
|
|
96
140
|
main();
|
package/scripts/postinstall.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
// postinstall.js — installs/updates the systemd service unit on Linux global npm installs.
|
|
5
|
+
// It never reads or writes Claude Code settings.
|
|
5
6
|
// Runs automatically after `npm install -g @clagentic/console`.
|
|
6
7
|
// Does nothing on non-Linux platforms, on non-global installs (a local `npm ci` /
|
|
7
8
|
// `npm install` in a dev checkout or worktree must never touch /etc/systemd or
|