@spexcode/spec-cli 0.6.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/README.md +95 -0
- package/bin/spex.mjs +76 -0
- package/dist/attach.d.ts +2 -0
- package/dist/attach.js +48 -0
- package/dist/claude-headless.d.ts +33 -0
- package/dist/claude-headless.js +307 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +1859 -0
- package/dist/client.d.ts +111 -0
- package/dist/client.js +476 -0
- package/dist/cockpit.d.ts +7 -0
- package/dist/cockpit.js +26 -0
- package/dist/codex-headless.d.ts +1 -0
- package/dist/codex-headless.js +7 -0
- package/dist/codex-runtime-generations.d.ts +53 -0
- package/dist/codex-runtime-generations.js +686 -0
- package/dist/commit-surgery.d.ts +1 -0
- package/dist/commit-surgery.js +90 -0
- package/dist/contract-filter.d.ts +14 -0
- package/dist/contract-filter.js +219 -0
- package/dist/dashboard-assets.d.ts +6 -0
- package/dist/dashboard-assets.js +50 -0
- package/dist/delivery-queue.d.ts +23 -0
- package/dist/delivery-queue.js +179 -0
- package/dist/doctor.d.ts +9 -0
- package/dist/doctor.js +547 -0
- package/dist/eval-host.d.ts +1 -0
- package/dist/eval-host.js +19 -0
- package/dist/execution-trace.d.ts +26 -0
- package/dist/execution-trace.js +475 -0
- package/dist/file-write.d.ts +2 -0
- package/dist/file-write.js +26 -0
- package/dist/flat.d.ts +89 -0
- package/dist/flat.js +1076 -0
- package/dist/gateway-auth.d.ts +56 -0
- package/dist/gateway-auth.js +168 -0
- package/dist/gateway-hub.d.ts +28 -0
- package/dist/gateway-hub.js +361 -0
- package/dist/gateway.d.ts +37 -0
- package/dist/gateway.js +503 -0
- package/dist/graphCache.d.ts +27 -0
- package/dist/graphCache.js +716 -0
- package/dist/graphSnapshot.d.ts +14 -0
- package/dist/graphSnapshot.js +35 -0
- package/dist/graphStream.d.ts +85 -0
- package/dist/graphStream.js +1195 -0
- package/dist/guidance-catalog.d.ts +64 -0
- package/dist/guidance-catalog.js +166 -0
- package/dist/guide.d.ts +8 -0
- package/dist/guide.js +684 -0
- package/dist/harness-select.d.ts +18 -0
- package/dist/harness-select.js +62 -0
- package/dist/harness.d.ts +325 -0
- package/dist/harness.js +3026 -0
- package/dist/headless-controller.d.ts +9 -0
- package/dist/headless-controller.js +47 -0
- package/dist/help.d.ts +10 -0
- package/dist/help.js +574 -0
- package/dist/hook-prompts.d.ts +18 -0
- package/dist/hook-prompts.js +122 -0
- package/dist/hooks.d.ts +1 -0
- package/dist/hooks.js +27 -0
- package/dist/host-resources.d.ts +97 -0
- package/dist/host-resources.js +795 -0
- package/dist/host.d.ts +88 -0
- package/dist/host.js +663 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +899 -0
- package/dist/init.d.ts +1 -0
- package/dist/init.js +284 -0
- package/dist/issues-cli.d.ts +6 -0
- package/dist/issues-cli.js +334 -0
- package/dist/issues.d.ts +69 -0
- package/dist/issues.js +189 -0
- package/dist/lint.d.ts +34 -0
- package/dist/lint.js +476 -0
- package/dist/listen.d.ts +7 -0
- package/dist/listen.js +24 -0
- package/dist/localIssues.d.ts +65 -0
- package/dist/localIssues.js +582 -0
- package/dist/login-page.d.ts +5 -0
- package/dist/login-page.js +86 -0
- package/dist/loop-in.d.ts +23 -0
- package/dist/loop-in.js +68 -0
- package/dist/machine-peer.d.ts +69 -0
- package/dist/machine-peer.js +603 -0
- package/dist/materialize.d.ts +18 -0
- package/dist/materialize.js +468 -0
- package/dist/mentions.d.ts +50 -0
- package/dist/mentions.js +117 -0
- package/dist/opencode-headless.d.ts +4 -0
- package/dist/opencode-headless.js +208 -0
- package/dist/opencode.d.ts +3 -0
- package/dist/opencode.js +142 -0
- package/dist/pi-harness.d.ts +3 -0
- package/dist/pi-harness.js +129 -0
- package/dist/pi-headless.d.ts +25 -0
- package/dist/pi-headless.js +196 -0
- package/dist/plugin-harness.d.ts +21 -0
- package/dist/plugin-harness.js +146 -0
- package/dist/pty-bridge.d.ts +10 -0
- package/dist/pty-bridge.js +404 -0
- package/dist/pty-helper.d.mts +1 -0
- package/dist/pty-helper.mjs +101 -0
- package/dist/pty-native-helper.d.mts +2 -0
- package/dist/pty-native-helper.mjs +23 -0
- package/dist/public-graph.d.ts +46 -0
- package/dist/public-graph.js +56 -0
- package/dist/ranker.d.ts +15 -0
- package/dist/ranker.js +188 -0
- package/dist/reaper.d.ts +6 -0
- package/dist/reaper.js +81 -0
- package/dist/reviews.d.ts +189 -0
- package/dist/reviews.js +350 -0
- package/dist/runtime-guard.d.ts +6 -0
- package/dist/runtime-guard.js +37 -0
- package/dist/runtime-ownership.d.ts +21 -0
- package/dist/runtime-ownership.js +84 -0
- package/dist/search.bench.d.mts +1 -0
- package/dist/search.bench.mjs +75 -0
- package/dist/search.d.ts +20 -0
- package/dist/search.js +61 -0
- package/dist/session-cursors.d.ts +14 -0
- package/dist/session-cursors.js +82 -0
- package/dist/session-declarations.d.ts +13 -0
- package/dist/session-declarations.js +126 -0
- package/dist/session-execution.d.ts +10 -0
- package/dist/session-execution.js +70 -0
- package/dist/session-files.d.ts +28 -0
- package/dist/session-files.js +130 -0
- package/dist/session-follow.d.ts +31 -0
- package/dist/session-follow.js +179 -0
- package/dist/session-reparent.d.ts +10 -0
- package/dist/session-reparent.js +33 -0
- package/dist/session-timeline.d.ts +51 -0
- package/dist/session-timeline.js +233 -0
- package/dist/session-web.d.ts +24 -0
- package/dist/session-web.js +141 -0
- package/dist/sessions.d.ts +412 -0
- package/dist/sessions.js +4239 -0
- package/dist/sh.d.ts +1 -0
- package/dist/sh.js +3 -0
- package/dist/shim-runtime.d.ts +1 -0
- package/dist/shim-runtime.js +161 -0
- package/dist/slash-commands.d.ts +9 -0
- package/dist/slash-commands.js +307 -0
- package/dist/source-files.d.ts +9 -0
- package/dist/source-files.js +113 -0
- package/dist/supervise.d.ts +1 -0
- package/dist/supervise.js +308 -0
- package/dist/tree.d.ts +25 -0
- package/dist/tree.js +98 -0
- package/dist/tsx-bin.d.ts +3 -0
- package/dist/tsx-bin.js +41 -0
- package/dist/uninstall.d.ts +3 -0
- package/dist/uninstall.js +177 -0
- package/dist/uploads.d.ts +36 -0
- package/dist/uploads.js +243 -0
- package/dist/worktree-sources.d.ts +1 -0
- package/dist/worktree-sources.js +47 -0
- package/hooks/compat/mark-active-0.5.2-eef1.fixture +53 -0
- package/hooks/compat/mark-active-sed-v0.fixture +46 -0
- package/hooks/dispatch.sh +105 -0
- package/hooks/harness.sh +272 -0
- package/package.json +47 -0
- package/templates/hooks/commit-msg +14 -0
- package/templates/hooks/post-checkout +25 -0
- package/templates/hooks/post-merge +34 -0
- package/templates/hooks/pre-commit +120 -0
- package/templates/hooks/prepare-commit-msg +35 -0
- package/templates/hooks/reference-transaction +105 -0
- package/templates/spec/project/.plugins/commands/extract/spec.md +66 -0
- package/templates/spec/project/.plugins/commands/regroup/spec.md +25 -0
- package/templates/spec/project/.plugins/commands/rename/spec.md +11 -0
- package/templates/spec/project/.plugins/commands/spec.md +30 -0
- package/templates/spec/project/.plugins/commands/supervisor/spec.md +8 -0
- package/templates/spec/project/.plugins/commands/tidy/spec.md +43 -0
- package/templates/spec/project/.plugins/core/comment-altitude/spec.md +9 -0
- package/templates/spec/project/.plugins/core/idle/idle.sh +15 -0
- package/templates/spec/project/.plugins/core/idle/spec.md +13 -0
- package/templates/spec/project/.plugins/core/mark-active/mark-active.sh +59 -0
- package/templates/spec/project/.plugins/core/mark-active/spec.md +22 -0
- package/templates/spec/project/.plugins/core/session-fail/fail.sh +12 -0
- package/templates/spec/project/.plugins/core/session-fail/spec.md +15 -0
- package/templates/spec/project/.plugins/core/spec-first/spec-first.sh +43 -0
- package/templates/spec/project/.plugins/core/spec-first/spec.md +17 -0
- package/templates/spec/project/.plugins/core/spec-of-file/spec-of-file.sh +66 -0
- package/templates/spec/project/.plugins/core/spec-of-file/spec.md +15 -0
- package/templates/spec/project/.plugins/core/spec.md +22 -0
- package/templates/spec/project/.plugins/core/stop-gate/spec.md +23 -0
- package/templates/spec/project/.plugins/core/stop-gate/stop-gate.sh +149 -0
- package/templates/spec/project/.plugins/prompts/atomic-landing/spec.md +15 -0
- package/templates/spec/project/.plugins/prompts/forge-link/spec.md +10 -0
- package/templates/spec/project/.plugins/prompts/memory-hygiene/spec.md +13 -0
- package/templates/spec/project/.plugins/prompts/reproduce-before-fix/spec.md +12 -0
- package/templates/spec/project/.plugins/prompts/spec.md +24 -0
- package/templates/spec/project/.plugins/skills/distill/digest.mjs +136 -0
- package/templates/spec/project/.plugins/skills/distill/spec.md +67 -0
- package/templates/spec/project/.plugins/skills/spec.md +19 -0
- package/templates/spec/project/.plugins/spec.md +23 -0
- package/templates/spec/project/spec.md +20 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type BoardSnapshot } from '@spexcode/spec-core';
|
|
2
|
+
export declare function boardSnapshot(): Promise<BoardSnapshot>;
|
|
3
|
+
export declare const buildBoard: () => Promise<{
|
|
4
|
+
nodes: any[];
|
|
5
|
+
sessions: any[];
|
|
6
|
+
identity: import("@spexcode/spec-core").ResolvedIdentity;
|
|
7
|
+
issuesStamp: string;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const spliceSessions: (prev: Awaited<ReturnType<typeof buildBoard>>) => Promise<{
|
|
10
|
+
nodes: any[];
|
|
11
|
+
sessions: any[];
|
|
12
|
+
identity: import("@spexcode/spec-core").ResolvedIdentity;
|
|
13
|
+
issuesStamp: string;
|
|
14
|
+
}>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { loadSpecs } from '@spexcode/spec-core';
|
|
2
|
+
import { resolveLayout } from '@spexcode/spec-core';
|
|
3
|
+
import { listSessions } from './sessions.js';
|
|
4
|
+
import { driftIndex, historyIndex, repoRoot } from '@spexcode/spec-core';
|
|
5
|
+
import { residentForgeRevision, residentForgeState } from '@spexcode/spec-forge/resident';
|
|
6
|
+
import { resolveForgeHost } from '@spexcode/spec-forge/drivers';
|
|
7
|
+
import { boardThreads } from './issues.js';
|
|
8
|
+
import { buildBoard as assembleBoard, spliceSessions as spliceBoardSessions } from '@spexcode/spec-core';
|
|
9
|
+
import { evalContext, evalTimelines } from '@spexcode/spec-eval/evaltab';
|
|
10
|
+
import { evalNodesAsync } from '@spexcode/spec-eval/scenarios';
|
|
11
|
+
import { sessionEvalProjections } from '@spexcode/spec-eval/sessioneval';
|
|
12
|
+
// The application adapter is the sole reader of runtime/forge state. graph.ts only receives this result.
|
|
13
|
+
export async function boardSnapshot() {
|
|
14
|
+
const root = repoRoot();
|
|
15
|
+
const [specs, sessions] = await Promise.all([loadSpecs(), listSessions()]);
|
|
16
|
+
const layout = await resolveLayout({ activeSessionIds: sessions.map((session) => session.id) });
|
|
17
|
+
const nodeIds = [...new Set([
|
|
18
|
+
...specs.map((node) => node.id),
|
|
19
|
+
...layout.worktrees.flatMap((worktree) => (worktree.ops || []).map((op) => op.nodeId)),
|
|
20
|
+
].filter((id) => typeof id === 'string' && id.length > 0))];
|
|
21
|
+
const { issues, stamp: issuesStamp } = boardThreads({ host: resolveForgeHost(), state: residentForgeState() }, nodeIds);
|
|
22
|
+
const [idx, hidx, evalNodes] = await Promise.all([driftIndex(root), historyIndex(root), evalNodesAsync(root)]);
|
|
23
|
+
const context = await evalContext(root, specs, idx, hidx, undefined, evalNodes);
|
|
24
|
+
const timelines = await evalTimelines(nodeIds, context);
|
|
25
|
+
return {
|
|
26
|
+
root, specs, layout, sessions, issues, issuesStamp, forgeRevision: residentForgeRevision(),
|
|
27
|
+
evalTimelines: new Map(nodeIds.map((nodeId, index) => [nodeId, timelines[index]])),
|
|
28
|
+
sessionEvalProjections: sessionEvalProjections(sessions),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export const buildBoard = async () => assembleBoard(await boardSnapshot());
|
|
32
|
+
export const spliceSessions = async (prev) => {
|
|
33
|
+
const sessions = await listSessions();
|
|
34
|
+
return spliceBoardSessions(prev, sessions, sessionEvalProjections(sessions));
|
|
35
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { Context } from 'hono';
|
|
2
|
+
import { type FSWatcher } from 'node:fs';
|
|
3
|
+
type Scope = 'sessions' | 'full';
|
|
4
|
+
type EvalTarget = 'all' | {
|
|
5
|
+
id?: string;
|
|
6
|
+
path?: string;
|
|
7
|
+
};
|
|
8
|
+
type TreeWatchCallback = (event: 'rename' | 'change', filename: string | Buffer | null) => void;
|
|
9
|
+
type WatchFactory = (path: string, options: {
|
|
10
|
+
recursive?: boolean;
|
|
11
|
+
}, callback: TreeWatchCallback) => FSWatcher;
|
|
12
|
+
type WatchTransport = 'consolidated-recursive' | 'exact-directory';
|
|
13
|
+
type TreeWatcherOptions = {
|
|
14
|
+
root: string;
|
|
15
|
+
source: string;
|
|
16
|
+
scope: Scope;
|
|
17
|
+
recursive?: boolean;
|
|
18
|
+
ignore?: (relativePath: string) => boolean;
|
|
19
|
+
watchFactory?: WatchFactory;
|
|
20
|
+
transport?: WatchTransport;
|
|
21
|
+
onInput: (event: 'rename' | 'change', relativePath: string) => void;
|
|
22
|
+
onFailure: (error: Error) => void;
|
|
23
|
+
};
|
|
24
|
+
export declare const consolidatedRecursiveWatch: (platform?: NodeJS.Platform) => boolean;
|
|
25
|
+
export declare function graphWatcherCensus(): {
|
|
26
|
+
sources: number;
|
|
27
|
+
registrations: number;
|
|
28
|
+
};
|
|
29
|
+
export declare class TreeWatcherRegistry {
|
|
30
|
+
readonly root: string;
|
|
31
|
+
readonly source: string;
|
|
32
|
+
readonly scope: Scope;
|
|
33
|
+
readonly transport: WatchTransport;
|
|
34
|
+
private readonly recursive;
|
|
35
|
+
private readonly ignore;
|
|
36
|
+
private readonly watchFactory;
|
|
37
|
+
private readonly onInput;
|
|
38
|
+
private readonly onFailure;
|
|
39
|
+
private readonly handles;
|
|
40
|
+
private refreshImmediate;
|
|
41
|
+
private failed;
|
|
42
|
+
constructor(options: TreeWatcherOptions);
|
|
43
|
+
get size(): number;
|
|
44
|
+
paths(): string[];
|
|
45
|
+
private get consolidated();
|
|
46
|
+
private desiredDirectories;
|
|
47
|
+
private closeHandles;
|
|
48
|
+
private sourceError;
|
|
49
|
+
private fail;
|
|
50
|
+
private scheduleRefresh;
|
|
51
|
+
refresh(): boolean;
|
|
52
|
+
close(): void;
|
|
53
|
+
}
|
|
54
|
+
export type PendingGraphChanges = {
|
|
55
|
+
full: boolean;
|
|
56
|
+
sessions: boolean;
|
|
57
|
+
};
|
|
58
|
+
export declare const addPendingGraphChange: (pending: PendingGraphChanges, scope: Scope) => PendingGraphChanges;
|
|
59
|
+
export declare function isSessionCreateCandidateRegistryEvent(relativePath: string, candidatePaths: Iterable<string>): boolean;
|
|
60
|
+
export declare const notifyBoardChanged: (scope?: Scope) => void;
|
|
61
|
+
type RegistryGroup = {
|
|
62
|
+
root: string;
|
|
63
|
+
close(): void;
|
|
64
|
+
};
|
|
65
|
+
export declare function evalTargetForRef(ref: string | undefined, base: string, branches: Map<string, string>): EvalTarget | undefined;
|
|
66
|
+
export declare function watchSessionEvalRefs(common: string, onInput: (ref?: string) => void, onFailure: (error: Error) => void): RegistryGroup;
|
|
67
|
+
type WorktreeWatch = {
|
|
68
|
+
path: string;
|
|
69
|
+
root: TreeWatcherRegistry;
|
|
70
|
+
index: TreeWatcherRegistry;
|
|
71
|
+
close(): void;
|
|
72
|
+
};
|
|
73
|
+
export declare const ignoredProjectRootPath: (file: string) => boolean;
|
|
74
|
+
export declare function watchSessionEvalWorktree(wtPath: string, gitDir: string, onInput: () => void, onFailure: (error: Error) => void): WorktreeWatch;
|
|
75
|
+
export declare function sessionWorktreeWatchPaths(sessions: {
|
|
76
|
+
id: string;
|
|
77
|
+
path: string;
|
|
78
|
+
liveness?: string;
|
|
79
|
+
}[], forcedSessions?: Set<string>): Set<string>;
|
|
80
|
+
export declare function flushDeferredWorktreeRegistryChange(): void;
|
|
81
|
+
export declare function watchSessionEvalRegistry(dir: string, onInput: (event: 'rename' | 'change', relativePath: string) => void, onFailure: (error: Error) => void): TreeWatcherRegistry;
|
|
82
|
+
export declare function ensureBoardFileWatchers(forceSessionId?: string): Promise<void>;
|
|
83
|
+
export declare function closeBoardFileWatchers(): void;
|
|
84
|
+
export declare function boardStream(c: Context): Promise<Response>;
|
|
85
|
+
export {};
|