clavarium 0.2.24-next.4 → 0.2.24-next.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/npm-shrinkwrap.json +6 -6
- package/package.json +2 -2
- package/server/dockets.mjs +4 -1
- package/server/gitkeeper.mjs +2 -2
- package/server/talk.mjs +2 -1
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavarium",
|
|
3
|
-
"version": "0.2.24-next.
|
|
3
|
+
"version": "0.2.24-next.5",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "clavarium",
|
|
9
|
-
"version": "0.2.24-next.
|
|
9
|
+
"version": "0.2.24-next.5",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
|
13
13
|
"@xterm/xterm": "^6.0.0",
|
|
14
14
|
"clavarium-binder": "0.1.0-next.1",
|
|
15
|
-
"clavarium-docket": "0.1.
|
|
15
|
+
"clavarium-docket": "0.1.1-next.1",
|
|
16
16
|
"clavarium-parley": "0.15.0-next.3",
|
|
17
17
|
"mermaid": "11.17.2",
|
|
18
18
|
"node-pty": "^1.1.0",
|
|
@@ -701,9 +701,9 @@
|
|
|
701
701
|
}
|
|
702
702
|
},
|
|
703
703
|
"node_modules/clavarium-docket": {
|
|
704
|
-
"version": "0.1.
|
|
705
|
-
"resolved": "https://registry.npmjs.org/clavarium-docket/-/clavarium-docket-0.1.
|
|
706
|
-
"integrity": "sha512-
|
|
704
|
+
"version": "0.1.1-next.1",
|
|
705
|
+
"resolved": "https://registry.npmjs.org/clavarium-docket/-/clavarium-docket-0.1.1-next.1.tgz",
|
|
706
|
+
"integrity": "sha512-GYt2o/J4RH3n9eEuE8BHU3bTUUleABe+1iPypxqpbllWfaiz8LDXmrhCm8YdcMaYySYq1NLt/ZJLahHp2dJ8Qw==",
|
|
707
707
|
"license": "MIT",
|
|
708
708
|
"bin": {
|
|
709
709
|
"docket": "bin/docket.mjs",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavarium",
|
|
3
|
-
"version": "0.2.24-next.
|
|
3
|
+
"version": "0.2.24-next.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "A conversation is a VM with a terminal in it. Everything else is a folder.",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@xterm/addon-fit": "^0.11.0",
|
|
46
46
|
"@xterm/xterm": "^6.0.0",
|
|
47
47
|
"clavarium-binder": "0.1.0-next.1",
|
|
48
|
-
"clavarium-docket": "0.1.
|
|
48
|
+
"clavarium-docket": "0.1.1-next.1",
|
|
49
49
|
"clavarium-parley": "0.15.0-next.3",
|
|
50
50
|
"mermaid": "11.17.2",
|
|
51
51
|
"node-pty": "^1.1.0",
|
package/server/dockets.mjs
CHANGED
|
@@ -32,6 +32,9 @@ export const AGAIN_MS = 30 * 60_000;
|
|
|
32
32
|
/* ...this many times at most (the first included); then its chat says so. */
|
|
33
33
|
export const TOLD_MAX = 3;
|
|
34
34
|
|
|
35
|
+
/* One line in the chat: what was handled, cut short; the docket keeps it whole. */
|
|
36
|
+
const cut = (text, max) => { const s = String(text ?? '').replace(/\s+/g, ' ').trim(); return s.length > max ? `${s.slice(0, max - 1)}…` : s; };
|
|
37
|
+
|
|
35
38
|
export class Dockets {
|
|
36
39
|
#resources; #store; #say; #event; #alert; #idle; #awake; #chatOn; #now; #every; #zone;
|
|
37
40
|
#listening = new Map(); #zoned = new Set(); #busy = false;
|
|
@@ -97,7 +100,7 @@ export class Dockets {
|
|
|
97
100
|
|
|
98
101
|
/* What the tool did: said in its chat; a failure alerts its owner. */
|
|
99
102
|
#heard(name, e) {
|
|
100
|
-
if (e.type === 'acked' && e.ack.kind === 'done') this.#line(name, { kind: 'docket-done', text: `Handled: ${e.event.text}${e.ack.note ? ` -- ${e.ack.note}` : ''}`, topic: 'Handled', brief: e.event.text.slice(0, 60) });
|
|
103
|
+
if (e.type === 'acked' && e.ack.kind === 'done') this.#line(name, { kind: 'docket-done', text: `Handled: ${cut(e.event.text, 80)}${e.ack.note ? ` -- ${cut(e.ack.note, 120)}` : ''}`, topic: 'Handled', brief: e.event.text.slice(0, 60) });
|
|
101
104
|
if (e.type === 'acked' && e.ack.kind === 'failed') {
|
|
102
105
|
this.#line(name, { kind: 'docket-failed', text: `Could not be handled: ${e.event.text} -- ${e.ack.note}`, tone: 'warn', topic: 'Not handled' });
|
|
103
106
|
try { this.#alert({ title: `${name}: could not be handled`, body: `${e.event.text}: ${e.ack.note}`, url: `/?c=${name}` }); } catch { /* as said */ }
|
package/server/gitkeeper.mjs
CHANGED
|
@@ -568,7 +568,7 @@ export class GitKeeper {
|
|
|
568
568
|
}
|
|
569
569
|
try {
|
|
570
570
|
const sent = await this.#review.push(r.name, body);
|
|
571
|
-
if (!sent.already) this.#say(r.name, this.#attached(r.name), { kind: 'sent-by-hand', text: `Sent by hand
|
|
571
|
+
if (!sent.already) this.#say(r.name, this.#attached(r.name), { kind: 'sent-by-hand', text: `Sent by hand: ${r.name} → ${sent.branch}, ${commitsOf(sent.commits)}${sent.made ? ', a new branch' : ''}.`, topic: 'Sent', brief: sent.branch, actions: seeCommits(r.name, sent.head, sent.base, sent.commits) });
|
|
572
572
|
return sent;
|
|
573
573
|
} catch (error) {
|
|
574
574
|
if (error instanceof GitFailure) this.#sendFailed(r.name, error, { branch: body?.target, head: body?.head });
|
|
@@ -682,7 +682,7 @@ export class GitKeeper {
|
|
|
682
682
|
if (sent.already) { this.#log(name, { branch: b, head: tip.id, conversation, ok: true, what: `Already on the remote: ${b}.` }, { sent: true, by: conversation }); return true; }
|
|
683
683
|
this.#log(name, { branch: b, head: tip.id, conversation, ok: true, what: `Sent automatically for ${conversation}: ${sent.commits} commit(s) to ${sent.branch}${sent.made ? ' (a new branch)' : ''}, ${checked}.${sent.note ? ` ${sent.note}` : ''}` }, { sent: true, by: conversation });
|
|
684
684
|
if (alert) this.#tell(`${name}: sent to ${sent.branch}`, `${sent.commits} commit(s), automatically for ${conversation}, ${checked}.`);
|
|
685
|
-
this.#say(name, [conversation], { kind: 'sent', text: `Sent
|
|
685
|
+
this.#say(name, [conversation], { kind: 'sent', text: `Sent: ${name} → ${sent.branch}, ${commitsOf(sent.commits)}${sent.made ? ', a new branch' : ''}${s.checks ? '' : ', no checks'}.`, topic: 'Sent', brief: sent.branch, actions: seeCommits(name, sent.head, sent.base, sent.commits) });
|
|
686
686
|
return true;
|
|
687
687
|
} catch (error) {
|
|
688
688
|
const kind = error instanceof GitFailure ? error.kind : 'error';
|
package/server/talk.mjs
CHANGED
|
@@ -148,7 +148,8 @@ export const EVENT_LEVELS = Object.freeze({
|
|
|
148
148
|
/* New tools in its machine that its tool reads only when it starts: a restart recommended (main.mjs). */
|
|
149
149
|
'tools-updated': 'news',
|
|
150
150
|
/* Its docket (dockets.mjs): what it handled, what it could not, what it never did; a reminder it set itself. */
|
|
151
|
-
|
|
151
|
+
/* What it handled is a trace by default: one line, in the detailed view; what failed or was never handled calls. */
|
|
152
|
+
'docket-done': 'trace',
|
|
152
153
|
'docket-failed': 'needs-you',
|
|
153
154
|
'docket-unhandled': 'needs-you',
|
|
154
155
|
'docket-reminder': 'trace',
|