lsd-pi 1.3.10 → 1.3.11

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/loader.js CHANGED
File without changes
@@ -15,6 +15,7 @@ Read-only constraint (strict):
15
15
  - Allowed operations are limited to inspection and navigation.
16
16
  - With LSP, use read-only actions only (e.g., symbols, definition, references, hover, diagnostics, incoming/outgoing calls). Do **not** use rename, format, or code actions that apply edits.
17
17
  - Do **not** call `ask_user_questions`. There is no human available. Operate fully autonomously.
18
+ - Do **not** try to write any memory.
18
19
 
19
20
  Scope boundary:
20
21
  - Scout is for reconnaissance and mapping only.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lsd-pi",
3
- "version": "1.3.10",
3
+ "version": "1.3.11",
4
4
  "description": "LSD — Looks Sort of Done coding agent",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gsd/pi-coding-agent",
3
- "version": "1.3.10",
3
+ "version": "1.3.11",
4
4
  "description": "Coding agent CLI (vendored from pi-mono)",
5
5
  "type": "module",
6
6
  "piConfig": {
package/pkg/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lsd-pi",
3
- "version": "1.3.10",
3
+ "version": "1.3.11",
4
4
  "piConfig": {
5
5
  "name": "lsd",
6
6
  "configDir": ".lsd"
@@ -15,6 +15,7 @@ Read-only constraint (strict):
15
15
  - Allowed operations are limited to inspection and navigation.
16
16
  - With LSP, use read-only actions only (e.g., symbols, definition, references, hover, diagnostics, incoming/outgoing calls). Do **not** use rename, format, or code actions that apply edits.
17
17
  - Do **not** call `ask_user_questions`. There is no human available. Operate fully autonomously.
18
+ - Do **not** try to write any memory.
18
19
 
19
20
  Scope boundary:
20
21
  - Scout is for reconnaissance and mapping only.
@@ -8,9 +8,42 @@
8
8
  * - linuxPython venv detection
9
9
  */
10
10
 
11
- import { createTestContext } from "../../gsd/tests/test-helpers.ts";
12
11
  import { diagnoseSounddeviceError, ensureVoiceVenv } from "../linux-ready.ts";
13
12
 
13
+ function createTestContext() {
14
+ let passed = 0;
15
+ let failed = 0;
16
+
17
+ function assertEq<T>(actual: T, expected: T, message: string): void {
18
+ if (JSON.stringify(actual) === JSON.stringify(expected)) {
19
+ passed++;
20
+ } else {
21
+ failed++;
22
+ console.error(` FAIL: ${message} — expected ${JSON.stringify(expected)}, got ${JSON.stringify(actual)}`);
23
+ }
24
+ }
25
+
26
+ function assertTrue(condition: boolean, message: string): void {
27
+ if (condition) {
28
+ passed++;
29
+ } else {
30
+ failed++;
31
+ console.error(` FAIL: ${message}`);
32
+ }
33
+ }
34
+
35
+ function report(): void {
36
+ console.log(`\nResults: ${passed} passed, ${failed} failed`);
37
+ if (failed > 0) {
38
+ process.exit(1);
39
+ } else {
40
+ console.log("All tests passed");
41
+ }
42
+ }
43
+
44
+ return { assertEq, assertTrue, report };
45
+ }
46
+
14
47
  const { assertEq, assertTrue, report } = createTestContext();
15
48
 
16
49
  function main(): void {
@@ -1,40 +0,0 @@
1
- /**
2
- * Headless Query — `gsd headless query`
3
- *
4
- * Single read-only command that returns the full project snapshot as JSON
5
- * to stdout, without spawning an LLM session. Instant (~50ms).
6
- *
7
- * Output: { state, next, cost }
8
- * state — deriveState() output (phase, milestones, progress, blockers)
9
- * next — dry-run dispatch preview (what auto-mode would do next)
10
- * cost — aggregated parallel worker costs
11
- *
12
- * Note: Extension modules are .ts files loaded via jiti (not compiled to .js).
13
- * We use createJiti() here because this module is imported directly from cli.ts,
14
- * bypassing the extension loader's jiti setup (#1137).
15
- */
16
- import type { GSDState } from './resources/extensions/gsd/types.js';
17
- export interface QuerySnapshot {
18
- state: GSDState;
19
- next: {
20
- action: 'dispatch' | 'stop' | 'skip';
21
- unitType?: string;
22
- unitId?: string;
23
- reason?: string;
24
- };
25
- cost: {
26
- workers: Array<{
27
- milestoneId: string;
28
- pid: number;
29
- state: string;
30
- cost: number;
31
- lastHeartbeat: number;
32
- }>;
33
- total: number;
34
- };
35
- }
36
- export interface QueryResult {
37
- exitCode: number;
38
- data?: QuerySnapshot;
39
- }
40
- export declare function handleQuery(basePath: string): Promise<QueryResult>;
@@ -1,77 +0,0 @@
1
- /**
2
- * Headless Query — `gsd headless query`
3
- *
4
- * Single read-only command that returns the full project snapshot as JSON
5
- * to stdout, without spawning an LLM session. Instant (~50ms).
6
- *
7
- * Output: { state, next, cost }
8
- * state — deriveState() output (phase, milestones, progress, blockers)
9
- * next — dry-run dispatch preview (what auto-mode would do next)
10
- * cost — aggregated parallel worker costs
11
- *
12
- * Note: Extension modules are .ts files loaded via jiti (not compiled to .js).
13
- * We use createJiti() here because this module is imported directly from cli.ts,
14
- * bypassing the extension loader's jiti setup (#1137).
15
- */
16
- import { createJiti } from '@mariozechner/jiti';
17
- import { fileURLToPath } from 'node:url';
18
- import { resolveBundledSourceResource } from './bundled-resource-path.js';
19
- const jiti = createJiti(fileURLToPath(import.meta.url), { interopDefault: true, debug: false });
20
- const gsdExtensionPath = (...segments) => resolveBundledSourceResource(import.meta.url, 'extensions', 'gsd', ...segments);
21
- async function loadExtensionModules() {
22
- const stateModule = await jiti.import(gsdExtensionPath('state.ts'), {});
23
- const dispatchModule = await jiti.import(gsdExtensionPath('auto-dispatch.ts'), {});
24
- const sessionModule = await jiti.import(gsdExtensionPath('session-status-io.ts'), {});
25
- const prefsModule = await jiti.import(gsdExtensionPath('preferences.ts'), {});
26
- return {
27
- deriveState: stateModule.deriveState,
28
- resolveDispatch: dispatchModule.resolveDispatch,
29
- readAllSessionStatuses: sessionModule.readAllSessionStatuses,
30
- loadEffectiveGSDPreferences: prefsModule.loadEffectiveGSDPreferences,
31
- };
32
- }
33
- // ─── Implementation ─────────────────────────────────────────────────────────
34
- export async function handleQuery(basePath) {
35
- const { deriveState, resolveDispatch, readAllSessionStatuses, loadEffectiveGSDPreferences } = await loadExtensionModules();
36
- const state = await deriveState(basePath);
37
- // Derive next dispatch action
38
- let next;
39
- if (!state.activeMilestone?.id) {
40
- next = {
41
- action: 'stop',
42
- reason: state.phase === 'complete' ? 'All milestones complete.' : state.nextAction,
43
- };
44
- }
45
- else {
46
- const loaded = loadEffectiveGSDPreferences();
47
- const dispatch = await resolveDispatch({
48
- basePath,
49
- mid: state.activeMilestone.id,
50
- midTitle: state.activeMilestone.title,
51
- state,
52
- prefs: loaded?.preferences,
53
- });
54
- next = {
55
- action: dispatch.action,
56
- unitType: dispatch.action === 'dispatch' ? dispatch.unitType : undefined,
57
- unitId: dispatch.action === 'dispatch' ? dispatch.unitId : undefined,
58
- reason: dispatch.action === 'stop' ? dispatch.reason : undefined,
59
- };
60
- }
61
- // Aggregate parallel worker costs
62
- const statuses = readAllSessionStatuses(basePath);
63
- const workers = statuses.map((s) => ({
64
- milestoneId: s.milestoneId,
65
- pid: s.pid,
66
- state: s.state,
67
- cost: s.cost,
68
- lastHeartbeat: s.lastHeartbeat,
69
- }));
70
- const snapshot = {
71
- state,
72
- next,
73
- cost: { workers, total: workers.reduce((sum, w) => sum + w.cost, 0) },
74
- };
75
- process.stdout.write(JSON.stringify(snapshot) + '\n');
76
- return { exitCode: 0, data: snapshot };
77
- }
@@ -1,61 +0,0 @@
1
- // Shared assertion helpers for GSD test files.
2
- //
3
- // Usage:
4
- // import { createTestContext } from './test-helpers.ts';
5
- // const { assertEq, assertTrue, assertMatch, assertNoMatch, report } = createTestContext();
6
-
7
- /**
8
- * Create an isolated set of assertion helpers with their own pass/fail counters.
9
- * Each test file gets its own context to avoid shared state across workers.
10
- */
11
- export function createTestContext() {
12
- let passed = 0;
13
- let failed = 0;
14
-
15
- function assertEq<T>(actual: T, expected: T, message: string): void {
16
- if (JSON.stringify(actual) === JSON.stringify(expected)) {
17
- passed++;
18
- } else {
19
- failed++;
20
- console.error(` FAIL: ${message} — expected ${JSON.stringify(expected)}, got ${JSON.stringify(actual)}`);
21
- }
22
- }
23
-
24
- function assertTrue(condition: boolean, message: string): void {
25
- if (condition) {
26
- passed++;
27
- } else {
28
- failed++;
29
- console.error(` FAIL: ${message}`);
30
- }
31
- }
32
-
33
- function assertMatch(value: string, pattern: RegExp, message: string): void {
34
- if (pattern.test(value)) {
35
- passed++;
36
- } else {
37
- failed++;
38
- console.error(` FAIL: ${message} — "${value}" did not match ${pattern}`);
39
- }
40
- }
41
-
42
- function assertNoMatch(value: string, pattern: RegExp, message: string): void {
43
- if (!pattern.test(value)) {
44
- passed++;
45
- } else {
46
- failed++;
47
- console.error(` FAIL: ${message} — "${value}" should not have matched ${pattern}`);
48
- }
49
- }
50
-
51
- function report(): void {
52
- console.log(`\nResults: ${passed} passed, ${failed} failed`);
53
- if (failed > 0) {
54
- process.exit(1);
55
- } else {
56
- console.log("All tests passed");
57
- }
58
- }
59
-
60
- return { assertEq, assertTrue, assertMatch, assertNoMatch, report };
61
- }