@brunobracaioli/aibrain 0.4.0-beta.4 → 0.4.0-beta.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/dist/claude-observation.mjs +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/extensions-cli.mjs +28 -3
- package/dist/package.json +1 -1
- package/package.json +1 -1
|
@@ -16,7 +16,7 @@ export const MAX_LOG_FILES = 3;
|
|
|
16
16
|
const LOCK_WAIT_MS = 250;
|
|
17
17
|
const LOCK_STALE_MS = 30_000;
|
|
18
18
|
const ADMISSION_MS = 60 * 60 * 1000;
|
|
19
|
-
export const ADAPTER_VERSION = '0.4.0-beta.
|
|
19
|
+
export const ADAPTER_VERSION = '0.4.0-beta.5';
|
|
20
20
|
const MAX_DIAGNOSTIC_COUNT = 10_000_000;
|
|
21
21
|
const MAX_DIAGNOSTIC_BYTES = 128 * 1024 * 1024;
|
|
22
22
|
const CHECKPOINT_BACKENDS = new Set(['native_store', 'private_file']);
|
package/dist/cli.mjs
CHANGED
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
import { extensionsSummary, hooksCommand } from './extensions-cli.mjs';
|
|
40
40
|
import { anyFormatter } from './guardrails/format.mjs';
|
|
41
41
|
|
|
42
|
-
const VERSION = '0.4.0-beta.
|
|
42
|
+
const VERSION = '0.4.0-beta.5';
|
|
43
43
|
// The command is `aisac`; `aibrain` is an alias installed from the same entry.
|
|
44
44
|
const COMMAND = 'aisac';
|
|
45
45
|
const ENDPOINT = 'https://mcp.ai-brain.aisac.cloud/mcp';
|
package/dist/extensions-cli.mjs
CHANGED
|
@@ -21,6 +21,29 @@ const ID_WIDTH = Math.max(...HOOK_CATALOG.map((entry) => entry.id.length));
|
|
|
21
21
|
const NEXT_SESSION =
|
|
22
22
|
'Applies to the next `aisac claude` session; running sessions keep their current set.';
|
|
23
23
|
const LICENSE_NOTE = 'Hooks load only with an active AISAC Engineering license.';
|
|
24
|
+
const CHECKLIST_HEADER =
|
|
25
|
+
'AISAC Engineering hooks: up/down moves, space toggles, enter saves, q cancels.';
|
|
26
|
+
const DEFAULT_COLUMNS = 80;
|
|
27
|
+
const MIN_COLUMNS = 20;
|
|
28
|
+
const ELLIPSIS = '…';
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Cut a checklist row to the terminal width. The redraw moves the cursor up one
|
|
32
|
+
* row per hook, which only holds while no row wraps; one column stays free so
|
|
33
|
+
* no terminal wraps at the last column either.
|
|
34
|
+
* @param {string} line
|
|
35
|
+
* @param {number | undefined} columns
|
|
36
|
+
*/
|
|
37
|
+
export function fitLine(line, columns) {
|
|
38
|
+
const total =
|
|
39
|
+
typeof columns === 'number' && Number.isInteger(columns) && columns > 0
|
|
40
|
+
? columns
|
|
41
|
+
: DEFAULT_COLUMNS;
|
|
42
|
+
const width = Math.max(MIN_COLUMNS, total) - 1;
|
|
43
|
+
const characters = [...line];
|
|
44
|
+
if (characters.length <= width) return line;
|
|
45
|
+
return `${characters.slice(0, width - 1).join('')}${ELLIPSIS}`;
|
|
46
|
+
}
|
|
24
47
|
|
|
25
48
|
/**
|
|
26
49
|
* @typedef {object} ChecklistState
|
|
@@ -96,12 +119,14 @@ function afterChange(licensed) {
|
|
|
96
119
|
function runChecklist(locale, hooks) {
|
|
97
120
|
return new Promise((resolve) => {
|
|
98
121
|
let state = { cursor: 0, enabled: hooks.map((hook) => hook.enabled) };
|
|
99
|
-
const header = 'AISAC Engineering hooks: space toggles, enter saves, q cancels.';
|
|
100
122
|
const draw = (/** @type {boolean} */ first) => {
|
|
101
123
|
if (!first) process.stdout.write(`\u001b[${hooks.length}A\u001b[J`);
|
|
102
|
-
|
|
124
|
+
const rows = renderLines(locale, hooks, state).map((line) =>
|
|
125
|
+
fitLine(line, process.stdout.columns),
|
|
126
|
+
);
|
|
127
|
+
process.stdout.write(`${rows.join('\n')}\n`);
|
|
103
128
|
};
|
|
104
|
-
console.log(
|
|
129
|
+
console.log(CHECKLIST_HEADER);
|
|
105
130
|
draw(true);
|
|
106
131
|
emitKeypressEvents(process.stdin);
|
|
107
132
|
process.stdin.setRawMode(true);
|
package/dist/package.json
CHANGED
package/package.json
CHANGED