toga-ai 1.0.1004 → 1.0.1005
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/knowledge.js
CHANGED
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
|
|
33
33
|
const fs = require('fs');
|
|
34
34
|
const path = require('path');
|
|
35
|
+
const os = require('os');
|
|
35
36
|
|
|
36
37
|
const ROOT = path.join(__dirname, 'knowledge');
|
|
37
38
|
const REGISTRY = path.join(ROOT, 'registry.json');
|
|
@@ -1048,10 +1049,31 @@ function cmdSkills(args) {
|
|
|
1048
1049
|
* every resolved knowledge doc in the main session; the gate detects it and releases.
|
|
1049
1050
|
*
|
|
1050
1051
|
* This command intentionally does nothing but confirm — the gate keys off the command
|
|
1051
|
-
* itself, so no shared state is needed here.
|
|
1052
|
+
* itself, so no shared state is needed here. The gate only allows the exact 3-word form, so
|
|
1053
|
+
* the session id comes from the env (as the hooks read it), never a flag. After the confirm
|
|
1054
|
+
* line it repeats the /rename line when /start saved a session title; else nothing extra.
|
|
1052
1055
|
*/
|
|
1056
|
+
const MAX_SESSION_TITLE_LENGTH = 60;
|
|
1057
|
+
|
|
1058
|
+
// Saved "<TICKET>: <short>" title from /start (start-helper.js set-title), or ''.
|
|
1059
|
+
function currentSessionTitle() {
|
|
1060
|
+
const sid = String(process.env.CLAUDE_SESSION_ID || process.env.CLAUDE_CODE_SESSION_ID || '').replace(/[^A-Za-z0-9_-]/g, '');
|
|
1061
|
+
if (!sid) return '';
|
|
1062
|
+
const dir = process.env.TOGA_SESSIONS_DIR || path.join(os.homedir(), '.claude', 'toga-sessions');
|
|
1063
|
+
try {
|
|
1064
|
+
const t = JSON.parse(fs.readFileSync(path.join(dir, sid + '.json'), 'utf8')).sessionTitle;
|
|
1065
|
+
return typeof t === 'string' ? t.replace(/[\u0000-\u001f\u007f`]+/g, ' ').trim().slice(0, MAX_SESSION_TITLE_LENGTH) : '';
|
|
1066
|
+
} catch (e) {
|
|
1067
|
+
if (e.code !== 'ENOENT') console.error('currentSessionTitle: ' + e.message);
|
|
1068
|
+
return '';
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1053
1072
|
function cmdKickoffPrimed() {
|
|
1054
1073
|
console.log('Team knowledge base primed in the main session — start gate released. Priming was synchronous; no subagents ran during it.');
|
|
1074
|
+
const title = currentSessionTitle();
|
|
1075
|
+
// Same text as skills/start/scripts/start-helper.js cmdSetTitle tellDeveloper — keep in sync.
|
|
1076
|
+
if (title) console.log('Reminder — tell the developer: Paste this to name the session: `/rename ' + title + '`');
|
|
1055
1077
|
}
|
|
1056
1078
|
|
|
1057
1079
|
function main() {
|
package/package.json
CHANGED
package/skills/start/SKILL.md
CHANGED
|
@@ -102,7 +102,9 @@ prefix words only if needed to stay short; never "TOGa". Max 60 characters. Save
|
|
|
102
102
|
node ".../start-helper.js" set-title --session <sid> --title "<T>: <short>"
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
-
|
|
105
|
+
**Send the `tellDeveloper` line now — never skip, never defer.** Team rule for every developer.
|
|
106
|
+
Put it in its own message, as its own plain line (not in a code block), BEFORE you start Step 4.
|
|
107
|
+
Do not wait for the Step 8 brief. Example: Paste this to name the session: `/rename TRUE-82605: ClickUp workflow`
|
|
106
108
|
The SessionStart hook also offers it as the session title on resume/compact, only when the
|
|
107
109
|
developer has not named the session.
|
|
108
110
|
|
|
@@ -239,11 +241,14 @@ Status flow: to do -> in progress (/start) -> development finished (/finish).
|
|
|
239
241
|
## Step 8 — Brief
|
|
240
242
|
|
|
241
243
|
Show a short brief, then propose the plan (multi-agent for non-trivial work, as in the old
|
|
242
|
-
kickoff Step 6: planner -> implement -> reviewers; auto-review rules apply)
|
|
244
|
+
kickoff Step 6: planner -> implement -> reviewers; auto-review rules apply).
|
|
245
|
+
Start the brief with the rename line, as its own plain line ABOVE the code block:
|
|
246
|
+
|
|
247
|
+
**Name this session:** `/rename <session title>`
|
|
243
248
|
|
|
244
249
|
```
|
|
245
250
|
Ticket: <T> — <title> (<status>, <list>)
|
|
246
|
-
Session: <session title>
|
|
251
|
+
Session: <session title>
|
|
247
252
|
Apps: <repos> (core: <core>)
|
|
248
253
|
Clients: <clients>
|
|
249
254
|
Task type: <type>
|
|
@@ -357,7 +357,14 @@ function cmdSetTitle(args) {
|
|
|
357
357
|
if (title.length > MAX_TITLE_LENGTH) return fail('title is longer than ' + MAX_TITLE_LENGTH + ' characters');
|
|
358
358
|
r.s.sessionTitle = prefix + title.slice(prefix.length);
|
|
359
359
|
writeSession(r.sid, r.s);
|
|
360
|
-
print({
|
|
360
|
+
print({
|
|
361
|
+
ok: true,
|
|
362
|
+
sessionId: r.sid,
|
|
363
|
+
ticket: r.s.ticket,
|
|
364
|
+
sessionTitle: r.s.sessionTitle,
|
|
365
|
+
// Same text as knowledge.js cmdKickoffPrimed reminder — keep in sync.
|
|
366
|
+
tellDeveloper: 'Paste this to name the session: `/rename ' + r.s.sessionTitle + '`',
|
|
367
|
+
});
|
|
361
368
|
}
|
|
362
369
|
|
|
363
370
|
/* Secret scan for text Claude is about to post (PR body, PM comment). Prints hit TYPES only. */
|