@yagni-app/code 0.1.0 → 0.2.0
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 +65 -11
- package/dist/claudeCompat.d.ts +109 -0
- package/dist/claudeCompat.js +260 -0
- package/dist/claudePlugins.d.ts +109 -0
- package/dist/claudePlugins.js +336 -0
- package/dist/cli.d.ts +1 -5
- package/dist/cli.js +79 -20
- package/dist/config.d.ts +1 -1
- package/dist/config.js +4 -2
- package/dist/crashReport.d.ts +135 -0
- package/dist/crashReport.js +291 -0
- package/dist/credentials.js +2 -1
- package/dist/distribution.d.ts +15 -0
- package/dist/distribution.js +45 -0
- package/dist/doctor.d.ts +27 -0
- package/dist/doctor.js +81 -3
- package/dist/extension/advisor.d.ts +84 -0
- package/dist/extension/advisor.js +101 -0
- package/dist/extension/askAdvisorTool.d.ts +83 -0
- package/dist/extension/askAdvisorTool.js +194 -0
- package/dist/extension/askYagniTool.d.ts +39 -0
- package/dist/extension/askYagniTool.js +63 -0
- package/dist/extension/bless.d.ts +45 -0
- package/dist/extension/bless.js +87 -0
- package/dist/extension/boostCommand.d.ts +144 -0
- package/dist/extension/boostCommand.js +263 -0
- package/dist/extension/branding.d.ts +79 -0
- package/dist/extension/branding.js +156 -0
- package/dist/extension/chipEditor.d.ts +117 -0
- package/dist/extension/chipEditor.js +373 -0
- package/dist/extension/claudeRules.d.ts +54 -0
- package/dist/extension/claudeRules.js +180 -0
- package/dist/extension/config.d.ts +173 -0
- package/dist/extension/config.js +194 -0
- package/dist/extension/costHud.d.ts +186 -0
- package/dist/extension/costHud.js +293 -0
- package/dist/extension/crashReport.d.ts +89 -0
- package/dist/extension/crashReport.js +241 -0
- package/dist/extension/decisionCapture.d.ts +52 -0
- package/dist/extension/decisionCapture.js +66 -0
- package/dist/extension/decisions.d.ts +83 -0
- package/dist/extension/decisions.js +200 -0
- package/dist/extension/diagnostics.d.ts +41 -0
- package/dist/extension/diagnostics.js +110 -0
- package/dist/extension/index.d.ts +155 -0
- package/dist/extension/index.js +597 -0
- package/dist/extension/initDone.d.ts +28 -0
- package/dist/extension/initDone.js +66 -0
- package/dist/extension/initPass.d.ts +170 -0
- package/dist/extension/initPass.js +394 -0
- package/dist/extension/mcpTools.d.ts +57 -0
- package/dist/extension/mcpTools.js +132 -0
- package/dist/extension/nextWorkTool.d.ts +51 -0
- package/dist/extension/nextWorkTool.js +80 -0
- package/dist/extension/permission.d.ts +91 -0
- package/dist/extension/permission.js +236 -0
- package/dist/extension/pipeline/activity.d.ts +37 -0
- package/dist/extension/pipeline/activity.js +151 -0
- package/dist/extension/pipeline/activityFeed.d.ts +59 -0
- package/dist/extension/pipeline/activityFeed.js +175 -0
- package/dist/extension/pipeline/budget.d.ts +48 -0
- package/dist/extension/pipeline/budget.js +68 -0
- package/dist/extension/pipeline/checkpoint.d.ts +31 -0
- package/dist/extension/pipeline/checkpoint.js +176 -0
- package/dist/extension/pipeline/eval.d.ts +205 -0
- package/dist/extension/pipeline/eval.js +226 -0
- package/dist/extension/pipeline/events.d.ts +56 -0
- package/dist/extension/pipeline/events.js +147 -0
- package/dist/extension/pipeline/findings.d.ts +42 -0
- package/dist/extension/pipeline/findings.js +144 -0
- package/dist/extension/pipeline/finish.d.ts +128 -0
- package/dist/extension/pipeline/finish.js +307 -0
- package/dist/extension/pipeline/goCommand.d.ts +146 -0
- package/dist/extension/pipeline/goCommand.js +1085 -0
- package/dist/extension/pipeline/goCompareCommand.d.ts +58 -0
- package/dist/extension/pipeline/goCompareCommand.js +203 -0
- package/dist/extension/pipeline/goFlags.d.ts +40 -0
- package/dist/extension/pipeline/goFlags.js +46 -0
- package/dist/extension/pipeline/goStatusCommands.d.ts +59 -0
- package/dist/extension/pipeline/goStatusCommands.js +188 -0
- package/dist/extension/pipeline/invocation.d.ts +45 -0
- package/dist/extension/pipeline/invocation.js +64 -0
- package/dist/extension/pipeline/orchestrator.d.ts +131 -0
- package/dist/extension/pipeline/orchestrator.js +645 -0
- package/dist/extension/pipeline/personas.d.ts +44 -0
- package/dist/extension/pipeline/personas.js +248 -0
- package/dist/extension/pipeline/resilience.d.ts +85 -0
- package/dist/extension/pipeline/resilience.js +166 -0
- package/dist/extension/pipeline/resume.d.ts +18 -0
- package/dist/extension/pipeline/resume.js +106 -0
- package/dist/extension/pipeline/runCostTable.d.ts +37 -0
- package/dist/extension/pipeline/runCostTable.js +165 -0
- package/dist/extension/pipeline/runRegistry.d.ts +112 -0
- package/dist/extension/pipeline/runRegistry.js +202 -0
- package/dist/extension/pipeline/runSession.d.ts +152 -0
- package/dist/extension/pipeline/runSession.js +167 -0
- package/dist/extension/pipeline/runState.d.ts +177 -0
- package/dist/extension/pipeline/runState.js +275 -0
- package/dist/extension/pipeline/runner.d.ts +98 -0
- package/dist/extension/pipeline/runner.js +310 -0
- package/dist/extension/pipeline/scrubSecrets.d.ts +15 -0
- package/dist/extension/pipeline/scrubSecrets.js +32 -0
- package/dist/extension/pipeline/stages.d.ts +53 -0
- package/dist/extension/pipeline/stages.js +115 -0
- package/dist/extension/pipeline/ticketResolution.d.ts +34 -0
- package/dist/extension/pipeline/ticketResolution.js +75 -0
- package/dist/extension/pipeline/types.d.ts +439 -0
- package/dist/extension/pipeline/types.js +48 -0
- package/dist/extension/pipeline/verify.d.ts +277 -0
- package/dist/extension/pipeline/verify.js +763 -0
- package/dist/extension/pipeline/workspace.d.ts +32 -0
- package/dist/extension/pipeline/workspace.js +73 -0
- package/dist/extension/pipeline/worktree.d.ts +107 -0
- package/dist/extension/pipeline/worktree.js +202 -0
- package/dist/extension/provider.d.ts +17 -0
- package/dist/extension/provider.js +33 -0
- package/dist/extension/recall.d.ts +93 -0
- package/dist/extension/recall.js +190 -0
- package/dist/extension/recordContextTool.d.ts +38 -0
- package/dist/extension/recordContextTool.js +85 -0
- package/dist/extension/recordDecisionTool.d.ts +52 -0
- package/dist/extension/recordDecisionTool.js +102 -0
- package/dist/extension/repoDocs.d.ts +81 -0
- package/dist/extension/repoDocs.js +260 -0
- package/dist/extension/rerouteNotice.d.ts +42 -0
- package/dist/extension/rerouteNotice.js +67 -0
- package/dist/extension/resilientFetch.d.ts +60 -0
- package/dist/extension/resilientFetch.js +133 -0
- package/dist/extension/reviewTool.d.ts +34 -0
- package/dist/extension/reviewTool.js +81 -0
- package/dist/extension/sessionRuns.d.ts +45 -0
- package/dist/extension/sessionRuns.js +77 -0
- package/dist/extension/spool.d.ts +92 -0
- package/dist/extension/spool.js +266 -0
- package/dist/extension/stateHome.d.ts +2 -0
- package/dist/extension/stateHome.js +6 -0
- package/dist/extension/subagents.d.ts +145 -0
- package/dist/extension/subagents.js +326 -0
- package/dist/extension/surface.d.ts +10 -0
- package/dist/extension/surface.js +12 -0
- package/dist/extension/todos.d.ts +110 -0
- package/dist/extension/todos.js +217 -0
- package/dist/extension/tokenProvider.d.ts +93 -0
- package/dist/extension/tokenProvider.js +234 -0
- package/dist/launch.d.ts +25 -3
- package/dist/launch.js +27 -9
- package/dist/login.d.ts +7 -0
- package/dist/login.js +3 -1
- package/dist/paths.d.ts +13 -4
- package/dist/paths.js +17 -5
- package/dist/profiles.d.ts +1 -1
- package/dist/profiles.js +5 -2
- package/dist/upgrade.d.ts +97 -0
- package/dist/upgrade.js +284 -0
- package/package.json +11 -15
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI diagnostics for the image-paste feature — layer C of the
|
|
3
|
+
* observability decision (A=debug flag, B=backend events, C=local log+report).
|
|
4
|
+
*
|
|
5
|
+
* The CLI is a terminal app, so it cannot log to stdout without corrupting the
|
|
6
|
+
* TUI. Instead it appends sanitized, single-line JSON events to a small
|
|
7
|
+
* rotating log under `~/.yagni-code/logs/`. "Sanitized" means event names,
|
|
8
|
+
* counts, mime types, byte sizes, and boolean outcomes — NEVER image bytes,
|
|
9
|
+
* message content, tokens, or file contents. Paths are recorded by basename
|
|
10
|
+
* only (the tmp `clipboard-*.png` name), never the full directory.
|
|
11
|
+
*
|
|
12
|
+
* A support flow can tail this file and POST it with the user's consent;
|
|
13
|
+
* nothing is uploaded automatically.
|
|
14
|
+
*/
|
|
15
|
+
export declare function _setDiagnosticsHomeForTest(dir: string | null): void;
|
|
16
|
+
export declare function diagnosticsLogPath(): string;
|
|
17
|
+
/** Layer A: verbose mode. `YAGNI_DEBUG=1` (or "true") turns on extra detail. */
|
|
18
|
+
export declare function isDebug(env?: NodeJS.ProcessEnv): boolean;
|
|
19
|
+
export interface ImagePasteEvent {
|
|
20
|
+
/** Stable event name: "paste_path" | "chip_drop" | "transform" | "backend_status". */
|
|
21
|
+
event: string;
|
|
22
|
+
/** Outcome: "ok" | "passthrough" | "error" | a status code as string. */
|
|
23
|
+
outcome?: string;
|
|
24
|
+
mimeType?: string;
|
|
25
|
+
bytes?: number;
|
|
26
|
+
imageCount?: number;
|
|
27
|
+
/** basename of the tmp image file only (never a full path). */
|
|
28
|
+
file?: string;
|
|
29
|
+
/** Extra debug-only detail; written only when YAGNI_DEBUG is on. */
|
|
30
|
+
detail?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Append one sanitized event. Fail-soft: a logging failure must never break the
|
|
34
|
+
* prompt. `detail` is included only when YAGNI_DEBUG is on.
|
|
35
|
+
*/
|
|
36
|
+
export declare function logImagePaste(ev: ImagePasteEvent): void;
|
|
37
|
+
/** Read the most recent log content (for a user-triggered report). */
|
|
38
|
+
export declare function readRecentDiagnostics(maxBytes?: number): string;
|
|
39
|
+
/** List existing diagnostic log files (active + rotations), for a report. */
|
|
40
|
+
export declare function listDiagnosticFiles(): string[];
|
|
41
|
+
//# sourceMappingURL=diagnostics.d.ts.map
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI diagnostics for the image-paste feature — layer C of the
|
|
3
|
+
* observability decision (A=debug flag, B=backend events, C=local log+report).
|
|
4
|
+
*
|
|
5
|
+
* The CLI is a terminal app, so it cannot log to stdout without corrupting the
|
|
6
|
+
* TUI. Instead it appends sanitized, single-line JSON events to a small
|
|
7
|
+
* rotating log under `~/.yagni-code/logs/`. "Sanitized" means event names,
|
|
8
|
+
* counts, mime types, byte sizes, and boolean outcomes — NEVER image bytes,
|
|
9
|
+
* message content, tokens, or file contents. Paths are recorded by basename
|
|
10
|
+
* only (the tmp `clipboard-*.png` name), never the full directory.
|
|
11
|
+
*
|
|
12
|
+
* A support flow can tail this file and POST it with the user's consent;
|
|
13
|
+
* nothing is uploaded automatically.
|
|
14
|
+
*/
|
|
15
|
+
import { appendFileSync, mkdirSync, readFileSync, readdirSync, renameSync, statSync, } from "node:fs";
|
|
16
|
+
import { dirname, join, basename } from "node:path";
|
|
17
|
+
import { codeStateHome } from "./stateHome.js";
|
|
18
|
+
/** Test seam (mirrors `_setYagniCodeHomeForTest`): point the log at a tmpdir. */
|
|
19
|
+
let homeOverride = null;
|
|
20
|
+
export function _setDiagnosticsHomeForTest(dir) {
|
|
21
|
+
homeOverride = dir;
|
|
22
|
+
}
|
|
23
|
+
function yagniCodeHome() {
|
|
24
|
+
return codeStateHome(homeOverride);
|
|
25
|
+
}
|
|
26
|
+
export function diagnosticsLogPath() {
|
|
27
|
+
return join(yagniCodeHome(), "logs", "image-paste.log");
|
|
28
|
+
}
|
|
29
|
+
const MAX_LOG_BYTES = 256 * 1024; // rotate the active file past this
|
|
30
|
+
const KEEP_ROTATIONS = 2; // keep image-paste.log.1 and .2 alongside the active file
|
|
31
|
+
/** Layer A: verbose mode. `YAGNI_DEBUG=1` (or "true") turns on extra detail. */
|
|
32
|
+
export function isDebug(env = process.env) {
|
|
33
|
+
const v = env.YAGNI_DEBUG;
|
|
34
|
+
return v === "1" || v === "true";
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Append one sanitized event. Fail-soft: a logging failure must never break the
|
|
38
|
+
* prompt. `detail` is included only when YAGNI_DEBUG is on.
|
|
39
|
+
*/
|
|
40
|
+
export function logImagePaste(ev) {
|
|
41
|
+
try {
|
|
42
|
+
// Hermetic under `node --test`: never touch the real home dir from a test
|
|
43
|
+
// unless the test explicitly stubbed it. Writing to the runner's $HOME made
|
|
44
|
+
// the suite's exit depend on the CI filesystem (a read-only or slow $HOME
|
|
45
|
+
// could stall the write), which is the leading suspect for the CI hang.
|
|
46
|
+
if (process.env.NODE_TEST_CONTEXT && homeOverride === null)
|
|
47
|
+
return;
|
|
48
|
+
const line = {
|
|
49
|
+
ts: new Date().toISOString(),
|
|
50
|
+
event: ev.event,
|
|
51
|
+
...(ev.outcome !== undefined ? { outcome: ev.outcome } : {}),
|
|
52
|
+
...(ev.mimeType !== undefined ? { mimeType: ev.mimeType } : {}),
|
|
53
|
+
...(ev.bytes !== undefined ? { bytes: ev.bytes } : {}),
|
|
54
|
+
...(ev.imageCount !== undefined ? { imageCount: ev.imageCount } : {}),
|
|
55
|
+
...(ev.file !== undefined ? { file: basename(ev.file) } : {}),
|
|
56
|
+
...(ev.detail !== undefined && isDebug() ? { detail: ev.detail } : {}),
|
|
57
|
+
};
|
|
58
|
+
const path = diagnosticsLogPath();
|
|
59
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
60
|
+
rotateIfNeeded(path);
|
|
61
|
+
appendFileSync(path, JSON.stringify(line) + "\n", "utf8");
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
/* logging must never throw into the editor */
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/** Shift image-paste.log -> .1 -> .2 once the active file passes the size cap. */
|
|
68
|
+
function rotateIfNeeded(path) {
|
|
69
|
+
try {
|
|
70
|
+
if (statSync(path).size < MAX_LOG_BYTES)
|
|
71
|
+
return;
|
|
72
|
+
for (let i = KEEP_ROTATIONS; i >= 1; i--) {
|
|
73
|
+
const from = i === 1 ? path : `${path}.${i - 1}`;
|
|
74
|
+
const to = `${path}.${i}`;
|
|
75
|
+
try {
|
|
76
|
+
renameSync(from, to);
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
/* absent source — fine */
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
/* rotation is best-effort */
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/** Read the most recent log content (for a user-triggered report). */
|
|
88
|
+
export function readRecentDiagnostics(maxBytes = 64 * 1024) {
|
|
89
|
+
try {
|
|
90
|
+
const data = readFileSync(diagnosticsLogPath(), "utf8");
|
|
91
|
+
return data.length > maxBytes ? data.slice(data.length - maxBytes) : data;
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
return "";
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/** List existing diagnostic log files (active + rotations), for a report. */
|
|
98
|
+
export function listDiagnosticFiles() {
|
|
99
|
+
try {
|
|
100
|
+
const dir = dirname(diagnosticsLogPath());
|
|
101
|
+
return readdirSync(dir)
|
|
102
|
+
.filter((f) => f.startsWith("image-paste.log"))
|
|
103
|
+
.sort()
|
|
104
|
+
.map((f) => join(dir, f));
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
return [];
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=diagnostics.js.map
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import { type SpendResponse } from "./costHud.js";
|
|
3
|
+
import { runInitPass as defaultRunInitPass } from "./initPass.js";
|
|
4
|
+
import { fetchMcpServers as defaultFetchMcpServers } from "./mcpTools.js";
|
|
5
|
+
import { type FlushOutcome, type SpoolClientOpts } from "./spool.js";
|
|
6
|
+
import { type TokenProvider } from "./tokenProvider.js";
|
|
7
|
+
import { type ContextBrief, type ModelEntry } from "./config.js";
|
|
8
|
+
/**
|
|
9
|
+
* YAGNI Code extension entry point.
|
|
10
|
+
*
|
|
11
|
+
* pi awaits async factory functions before startup, so fetching the model
|
|
12
|
+
* catalog here is safe. The factory:
|
|
13
|
+
* 1. registers the `yagni` model provider (catalog fetched from the backend),
|
|
14
|
+
* 2. registers the `ask_yagni` tool,
|
|
15
|
+
* 3. rebrands the system prompt as YAGNI Code on every turn (no "pi" leaks), and
|
|
16
|
+
* 4. sets the terminal title + a footer brand mark.
|
|
17
|
+
*
|
|
18
|
+
* If the catalog fetch fails, the error propagates (fail loud) carrying an
|
|
19
|
+
* actionable `yagni login` message.
|
|
20
|
+
*/
|
|
21
|
+
/** Injectable seams so the factory is unit-testable without pi or a network. */
|
|
22
|
+
export interface RegisterYagniDeps {
|
|
23
|
+
baseUrl?: string;
|
|
24
|
+
getToken?: () => string | undefined;
|
|
25
|
+
/** The token's ISO expiry, forwarded by the launcher (for the expiry notice). */
|
|
26
|
+
getTokenExpiresAt?: () => string | undefined;
|
|
27
|
+
/** Clock seam for the expiry notice (defaults to Date.now). */
|
|
28
|
+
now?: () => number;
|
|
29
|
+
fetchImpl?: typeof fetch;
|
|
30
|
+
fetchCatalog?: (opts: {
|
|
31
|
+
baseUrl: string;
|
|
32
|
+
getToken: () => string | undefined;
|
|
33
|
+
fetchImpl?: typeof fetch;
|
|
34
|
+
}) => Promise<ModelEntry[]>;
|
|
35
|
+
fetchContextBrief?: (opts: {
|
|
36
|
+
baseUrl: string;
|
|
37
|
+
getToken: () => string | undefined;
|
|
38
|
+
fetchImpl?: typeof fetch;
|
|
39
|
+
}) => Promise<ContextBrief | null>;
|
|
40
|
+
/**
|
|
41
|
+
* Workspace MCP server list seam (YAG-446). The default hits
|
|
42
|
+
* `/api/yagni-code/mcp/servers` and is fail-soft: older backends and
|
|
43
|
+
* un-rescoped tokens yield `[]`, never a startup error.
|
|
44
|
+
*/
|
|
45
|
+
fetchMcpServers?: typeof defaultFetchMcpServers;
|
|
46
|
+
/**
|
|
47
|
+
* The CLI init pass (Onramp Door B). Injectable so tests assert it fires on a
|
|
48
|
+
* fresh-workspace first-run and is skipped otherwise, without a network or disk.
|
|
49
|
+
*/
|
|
50
|
+
runInitPass?: typeof defaultRunInitPass;
|
|
51
|
+
/** The workspace id the token is bound to (keys the one-time init marker). */
|
|
52
|
+
getWorkspaceId?: () => string | undefined;
|
|
53
|
+
/** Has the init pass already run once for this workspace? Injectable (no disk in tests). */
|
|
54
|
+
isInitDone?: (workspaceId: string) => boolean;
|
|
55
|
+
/** Record that the init pass ran once for this workspace. Injectable (no disk in tests). */
|
|
56
|
+
markInitDone?: (workspaceId: string) => void;
|
|
57
|
+
/**
|
|
58
|
+
* The refreshing token provider (spec §4). Injectable so tests control the
|
|
59
|
+
* rotation surface; the default provider seeds from `getToken`/
|
|
60
|
+
* `getTokenExpiresAt` (falling back to the env) and owns the proactive
|
|
61
|
+
* refresh timer + the 401 refresh-and-retry-once seam.
|
|
62
|
+
*/
|
|
63
|
+
tokenProvider?: TokenProvider;
|
|
64
|
+
/** The spool flush (R4 write half), injectable so tests never touch disk. */
|
|
65
|
+
flushSpool?: (opts: SpoolClientOpts) => Promise<FlushOutcome>;
|
|
66
|
+
env?: NodeJS.ProcessEnv;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Build GET /api/yagni-code/spend's URL. Pure (no fetch), exported for tests.
|
|
70
|
+
*
|
|
71
|
+
* YAG-383: a `/go` run's dispatches bill under its OWN run id
|
|
72
|
+
* (`llm_usage.session_id` holds the run id, not the driver session id — see
|
|
73
|
+
* attributionHeaders in config.ts), so `sessionId=` alone misses every run
|
|
74
|
+
* this session launched. `runIds` (comma-separated) widens the same query to
|
|
75
|
+
* include them; empty is omitted entirely rather than sent as `runIds=`.
|
|
76
|
+
*/
|
|
77
|
+
export declare function buildSpendUrl(baseUrl: string, sessionId: string, runIds: readonly string[]): string;
|
|
78
|
+
/**
|
|
79
|
+
* Build GET /api/yagni-code/spend's URL for ONE `/go` run's own spend
|
|
80
|
+
* (`?runId=`, the sibling of {@link buildSpendUrl}'s session-wide
|
|
81
|
+
* `?sessionId=&runIds=`). Pure (no fetch), exported for tests. The backend
|
|
82
|
+
* route treats `runId` and `sessionId` as aliases into the same lookup (see
|
|
83
|
+
* routes/yagniCode.ts's `/spend` handler), so this is just the more honest
|
|
84
|
+
* query param name for "this one run" rather than reusing `buildSpendUrl`
|
|
85
|
+
* with the run id awkwardly standing in for a session id.
|
|
86
|
+
*/
|
|
87
|
+
export declare function buildRunSpendUrl(baseUrl: string, runId: string): string;
|
|
88
|
+
/**
|
|
89
|
+
* Validate + narrow a `GET /api/yagni-code/spend` response body before
|
|
90
|
+
* trusting it as a {@link SpendResponse}. A network response is untyped at
|
|
91
|
+
* runtime, so this is the ONE shared guard both the session-wide `/cost`
|
|
92
|
+
* fetch and the per-run `/go` fetch rely on (drift-risk fix: they used to
|
|
93
|
+
* each carry their own copy of this same check). Pure, exported for tests.
|
|
94
|
+
* Returns null on anything that doesn't look like the real shape.
|
|
95
|
+
*/
|
|
96
|
+
export declare function parseSpendResponse(data: unknown): SpendResponse | null;
|
|
97
|
+
export declare function registerYagni(pi: ExtensionAPI, deps?: RegisterYagniDeps): Promise<void>;
|
|
98
|
+
export default function (pi: ExtensionAPI): Promise<void>;
|
|
99
|
+
export { makeAskYagniTool } from "./askYagniTool.js";
|
|
100
|
+
export { makeAskAdvisorTool, registerAdviseCommand } from "./askAdvisorTool.js";
|
|
101
|
+
export { ADVISOR_TIER, DEFAULT_ADVISOR_LIMITS, decideConsult, formatAdvisorSubtotal, makeAdvisorState, } from "./advisor.js";
|
|
102
|
+
export type { Citation, MakeAskYagniToolOptions } from "./askYagniTool.js";
|
|
103
|
+
export { makeReviewBusinessMatchTool } from "./reviewTool.js";
|
|
104
|
+
export type { MakeReviewToolOptions } from "./reviewTool.js";
|
|
105
|
+
export { makeRecordEngineeringContextTool } from "./recordContextTool.js";
|
|
106
|
+
export type { MakeRecordContextToolOptions } from "./recordContextTool.js";
|
|
107
|
+
export { makeRecordDecisionTool } from "./recordDecisionTool.js";
|
|
108
|
+
export type { MakeRecordDecisionToolOptions } from "./recordDecisionTool.js";
|
|
109
|
+
export { makeSuggestNextWorkTool, defaultNextAction } from "./nextWorkTool.js";
|
|
110
|
+
export type { MakeNextWorkToolOptions, DefaultNextAction, NextActionOption, } from "./nextWorkTool.js";
|
|
111
|
+
export { recordDecision } from "./recordDecisionTool.js";
|
|
112
|
+
export type { RecordDecisionParams } from "./recordDecisionTool.js";
|
|
113
|
+
export { runInitPass, runTeamSetup, registerTeamSetupCommand, isFreshWorkspace, readRepoIntake, draftEngineering, summarizeDraft, FRESH_BRIEF_MIN_CHARS, } from "./initPass.js";
|
|
114
|
+
export type { RunInitPassDeps, InitPassOutcome, RunTeamSetupDeps, TeamSetupOutcome, RepoIntake, RepoIntakeFs, EngineeringDraft, DraftTeam, } from "./initPass.js";
|
|
115
|
+
export { isInitDone, markInitDone, initDoneMarkerFile, _setInitDoneHomeForTest } from "./initDone.js";
|
|
116
|
+
export { brandSystemPrompt, YAGNI_IDENTITY, YAGNI_IDENTITY_DRIVER, BRAND_NAME } from "./branding.js";
|
|
117
|
+
export { attributionHeaders, isDriverCaller, fetchCatalog, getToken, getWorkspaceId, resolveBaseUrl, sanitizeCallerSegment, } from "./config.js";
|
|
118
|
+
export type { FetchCatalogOptions, ModelEntry } from "./config.js";
|
|
119
|
+
export { buildYagniProvider } from "./provider.js";
|
|
120
|
+
export { registerGoCommand } from "./pipeline/goCommand.js";
|
|
121
|
+
export type { RegisterGoDeps } from "./pipeline/goCommand.js";
|
|
122
|
+
export { runPipeline } from "./pipeline/orchestrator.js";
|
|
123
|
+
export type { RunPipelineDeps } from "./pipeline/orchestrator.js";
|
|
124
|
+
export { withResilience, classifyTransient, composeAbortSignal } from "./pipeline/resilience.js";
|
|
125
|
+
export type { ResilienceAttemptRecord, ResilienceSeams, RunStageFn } from "./pipeline/resilience.js";
|
|
126
|
+
export { DEFAULT_RESILIENCE_POLICY } from "./pipeline/types.js";
|
|
127
|
+
export type { ResiliencePolicy } from "./pipeline/types.js";
|
|
128
|
+
export { buildVerifyEnv, detectVerifyCommand, makeRunVerify, parseVerifyFailures } from "./pipeline/verify.js";
|
|
129
|
+
export type { VerifyCommand, VerifyOutcome } from "./pipeline/verify.js";
|
|
130
|
+
export { blindStages, reportOnlyStages, makeGroundedVsBlindEval, formatComparisonReport } from "./pipeline/eval.js";
|
|
131
|
+
export type { ComparisonReport, LaneFit, LaneOutcome } from "./pipeline/eval.js";
|
|
132
|
+
export { registerGoCompareCommand } from "./pipeline/goCompareCommand.js";
|
|
133
|
+
export { registerSubagents, makeSubagentTool, discoverSubagents, parseAgentMarkdown, buildSubagentStage, formatAgentList, mapModelTier, SUBAGENT_TOOL_NAME, GENERAL_AGENT_NAME, MAX_PARALLEL_SUBAGENTS, DEFAULT_SUBAGENT_TOOLS, } from "./subagents.js";
|
|
134
|
+
export type { SubagentDef, SubagentSource } from "./subagents.js";
|
|
135
|
+
export { registerTodos, makeTodoTool, normalizeTodos, reconstructTodos, renderTodoWidget, formatTodoList, todoSummary, TODO_TOOL_NAME, MAX_TODOS, } from "./todos.js";
|
|
136
|
+
export type { TodoItem, TodoStatus, TodoTheme } from "./todos.js";
|
|
137
|
+
export { decideGate, registerPermissionGate, filterStalePlanContext, DEFAULT_PERMISSION_POLICY, PLAN_CONTEXT_TYPE, PLAN_CONTEXT_MESSAGE, } from "./permission.js";
|
|
138
|
+
export type { PermissionMode, PermissionPolicy, GateDecision, RegisterPermissionDeps, BlessRememberInfo, } from "./permission.js";
|
|
139
|
+
export { makeBlessStore, blessPath } from "./bless.js";
|
|
140
|
+
export type { BlessStore, BlessRule } from "./bless.js";
|
|
141
|
+
export { bankDecision, fetchDecisions, supersedeDecision, parseDecideArgs, formatDecisionsList, shortId, registerDecisionCommands, DEFAULT_LIST_LIMIT, } from "./decisions.js";
|
|
142
|
+
export type { DecisionClientOpts, DecisionListItem, BankDecisionParams, DecideArgs } from "./decisions.js";
|
|
143
|
+
export { makeDecisionCapture, CAPTURE_DEBOUNCE_MS } from "./decisionCapture.js";
|
|
144
|
+
export type { DecisionCapture, DecisionCaptureDeps, BlessCaptureInfo, CaptureCtx } from "./decisionCapture.js";
|
|
145
|
+
export { registerAmbientRecall, fetchRecall, formatRecallBlock, toRepoRelativePath, normalizeRecall, RECALL_TIMEOUT_MS, RECALL_MIN_DECISIONS, } from "./recall.js";
|
|
146
|
+
export type { RecallResult, RecallClientOpts, RegisterRecallDeps } from "./recall.js";
|
|
147
|
+
export { makeCostAccumulator, formatCostLine, registerCostCommand } from "./costHud.js";
|
|
148
|
+
export type { CostSnapshot, Headroom } from "./costHud.js";
|
|
149
|
+
export { makeTokenProvider, makeAuthedFetch, persistRotationToProfile, PROACTIVE_REFRESH_WINDOW_MS, REFRESH_RETRY_MS, } from "./tokenProvider.js";
|
|
150
|
+
export type { TokenProvider, TokenProviderDeps, ScheduleFn } from "./tokenProvider.js";
|
|
151
|
+
export { appendToSpool, loadSpool, flushSpool, sendOrSpool, spoolFile, MAX_SPOOL_AGE_MS, _setSpoolHomeForTest, } from "./spool.js";
|
|
152
|
+
export type { SpoolEntry, SpoolClientOpts, FlushOutcome, JudgmentWriteOutcome } from "./spool.js";
|
|
153
|
+
export { crashReportsDisabled, installUncaughtExceptionMonitor, makeCrashReporter, reportFatalCrash, sanitizeCrashError, sanitizeCrashText, } from "./crashReport.js";
|
|
154
|
+
export type { CrashReporter, CrashReporterOpts, FatalCrashOpts, SanitizedCrash } from "./crashReport.js";
|
|
155
|
+
//# sourceMappingURL=index.d.ts.map
|