legion-cc 0.2.1 → 0.2.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/VERSION +1 -1
- package/bin/legion-tools.cjs +29 -0
- package/package.json +1 -1
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.2.
|
|
1
|
+
0.2.2
|
package/bin/legion-tools.cjs
CHANGED
|
@@ -28,6 +28,7 @@ function usage() {
|
|
|
28
28
|
' task-record <type> <desc> <status> Add a task record to STATE.md',
|
|
29
29
|
' context-load [path] Load context from .legion/codebase/ and .legion/planning/',
|
|
30
30
|
' domain list|info [name] Domain registry operations',
|
|
31
|
+
' session-record <summary> Create a session record in .legion/planning/sessions/',
|
|
31
32
|
' update-check Check for newer version on npm',
|
|
32
33
|
'',
|
|
33
34
|
'Examples:',
|
|
@@ -39,6 +40,7 @@ function usage() {
|
|
|
39
40
|
' legion-tools generate-slug "My Cool Project"',
|
|
40
41
|
' legion-tools current-timestamp date',
|
|
41
42
|
' legion-tools task-record architect "Initial architecture" done',
|
|
43
|
+
' legion-tools session-record "Created codebase documentation"',
|
|
42
44
|
' legion-tools context-load',
|
|
43
45
|
' legion-tools domain list',
|
|
44
46
|
' legion-tools domain info devops',
|
|
@@ -266,6 +268,30 @@ function cmdTaskRecord(args) {
|
|
|
266
268
|
console.log(`${core.UI.check} Task recorded: [${type}] ${desc} (${status})`);
|
|
267
269
|
}
|
|
268
270
|
|
|
271
|
+
// ─── Command: session-record ─────────────────────────────────────────────────
|
|
272
|
+
|
|
273
|
+
function cmdSessionRecord(args) {
|
|
274
|
+
const summary = args.join(' ');
|
|
275
|
+
if (!summary) {
|
|
276
|
+
die('Usage: legion-tools session-record <summary>');
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
const planningDir = requirePlanningDir();
|
|
280
|
+
|
|
281
|
+
// Load current state for domain/stage context
|
|
282
|
+
const stateObj = state.loadState(planningDir);
|
|
283
|
+
const cfg = config.loadConfig(planningDir);
|
|
284
|
+
|
|
285
|
+
const sessionPath = session.createSession(planningDir, {
|
|
286
|
+
domain: (cfg && cfg.domain) || (stateObj && stateObj.project && stateObj.project.domain) || undefined,
|
|
287
|
+
stage: (stateObj && stateObj.currentWork && stateObj.currentWork.stage) || undefined,
|
|
288
|
+
description: summary,
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
const fileName = path.basename(sessionPath);
|
|
292
|
+
console.log(`${core.UI.check} Session recorded: ${fileName}`);
|
|
293
|
+
}
|
|
294
|
+
|
|
269
295
|
// ─── Command: context-load ───────────────────────────────────────────────────
|
|
270
296
|
|
|
271
297
|
function cmdContextLoad(args) {
|
|
@@ -436,6 +462,9 @@ function main() {
|
|
|
436
462
|
case 'task-record':
|
|
437
463
|
cmdTaskRecord(commandArgs);
|
|
438
464
|
break;
|
|
465
|
+
case 'session-record':
|
|
466
|
+
cmdSessionRecord(commandArgs);
|
|
467
|
+
break;
|
|
439
468
|
case 'context-load':
|
|
440
469
|
cmdContextLoad(commandArgs);
|
|
441
470
|
break;
|