@drewpayment/mink 0.13.0-beta.1 → 0.13.0-beta.3
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 +4 -20
- package/dashboard/out/404.html +1 -1
- package/dashboard/out/_next/static/U9AeObddt4LmJkKRZpEfy/_buildManifest.js +1 -0
- package/dashboard/out/_next/static/chunks/app/(panels)/activity/page-c285fb9f63d9a82a.js +1 -0
- package/dashboard/out/_next/static/chunks/app/(panels)/bugs/page-f3ba7d8f50a96568.js +1 -0
- package/dashboard/out/_next/static/chunks/app/(panels)/capture/page-e004bec9af99a244.js +1 -0
- package/dashboard/out/_next/static/chunks/app/(panels)/compression/page-21e1af119b3f81ff.js +1 -0
- package/dashboard/out/_next/static/chunks/app/(panels)/config/page-d47fb6f588ccfd4b.js +1 -0
- package/dashboard/out/_next/static/chunks/app/(panels)/daemon/page-52f913e751416717.js +1 -0
- package/dashboard/out/_next/static/chunks/app/(panels)/design/page-53a76719b9af5830.js +1 -0
- package/dashboard/out/_next/static/chunks/app/(panels)/discord/page-04502d12c4a96cf7.js +1 -0
- package/dashboard/out/_next/static/chunks/app/(panels)/file-index/page-a1bd10e04bb219d9.js +1 -0
- package/dashboard/out/_next/static/chunks/app/(panels)/insights/page-7367274963571b6b.js +1 -0
- package/dashboard/out/_next/static/chunks/app/(panels)/learning/{page-b766adc79099adb4.js → page-4a03cf7b9a6106fd.js} +1 -1
- package/dashboard/out/_next/static/chunks/app/(panels)/overview/page-38b8430b5c56e807.js +1 -0
- package/dashboard/out/_next/static/chunks/app/(panels)/scheduler/page-510b78c9b0a61012.js +1 -0
- package/dashboard/out/_next/static/chunks/app/(panels)/sync/page-b7215c2a29a7d7a7.js +1 -0
- package/dashboard/out/_next/static/chunks/app/(panels)/tokens/page-1be7ed35a5c9bd39.js +1 -0
- package/dashboard/out/_next/static/chunks/app/(panels)/waste/page-24a726e6d63f771a.js +1 -0
- package/dashboard/out/_next/static/chunks/app/(panels)/wiki/page-230d2d1cae6507a8.js +1 -0
- package/dashboard/out/_next/static/chunks/app/layout-70a6d18f8e464960.js +1 -0
- package/dashboard/out/action-log.html +1 -1
- package/dashboard/out/action-log.txt +4 -4
- package/dashboard/out/activity.html +1 -1
- package/dashboard/out/activity.txt +5 -5
- package/dashboard/out/bugs.html +1 -1
- package/dashboard/out/bugs.txt +5 -5
- package/dashboard/out/capture.html +1 -1
- package/dashboard/out/capture.txt +5 -5
- package/dashboard/out/compression.html +1 -0
- package/dashboard/out/compression.txt +24 -0
- package/dashboard/out/config.html +1 -1
- package/dashboard/out/config.txt +5 -5
- package/dashboard/out/daemon.html +1 -1
- package/dashboard/out/daemon.txt +5 -5
- package/dashboard/out/design.html +1 -1
- package/dashboard/out/design.txt +5 -5
- package/dashboard/out/discord.html +1 -1
- package/dashboard/out/discord.txt +5 -5
- package/dashboard/out/file-index.html +1 -1
- package/dashboard/out/file-index.txt +5 -5
- package/dashboard/out/index.html +1 -1
- package/dashboard/out/index.txt +4 -4
- package/dashboard/out/insights.html +1 -1
- package/dashboard/out/insights.txt +5 -5
- package/dashboard/out/learning.html +1 -1
- package/dashboard/out/learning.txt +5 -5
- package/dashboard/out/overview.html +1 -1
- package/dashboard/out/overview.txt +5 -5
- package/dashboard/out/scheduler.html +1 -1
- package/dashboard/out/scheduler.txt +5 -5
- package/dashboard/out/sync.html +1 -1
- package/dashboard/out/sync.txt +5 -5
- package/dashboard/out/tokens.html +1 -1
- package/dashboard/out/tokens.txt +5 -5
- package/dashboard/out/waste.html +1 -1
- package/dashboard/out/waste.txt +5 -5
- package/dashboard/out/wiki.html +1 -1
- package/dashboard/out/wiki.txt +5 -5
- package/dist/cli.bun.js +1300 -908
- package/dist/cli.node.js +1319 -928
- package/package.json +1 -1
- package/src/cli.ts +17 -20
- package/src/commands/init.ts +14 -123
- package/src/commands/post-read.ts +18 -0
- package/src/commands/post-tool.ts +48 -0
- package/src/commands/retrieve.ts +32 -0
- package/src/commands/status.ts +13 -1
- package/src/core/code-skeleton.ts +108 -0
- package/src/core/compress-tool-output.ts +127 -0
- package/src/core/compression.ts +81 -0
- package/src/core/dashboard-api.ts +20 -1
- package/src/core/dashboard-server.ts +3 -0
- package/src/core/hook-output.ts +42 -0
- package/src/core/output-compression.ts +252 -0
- package/src/core/token-estimate.ts +40 -0
- package/src/repositories/compression-cache-repo.ts +97 -0
- package/src/repositories/token-ledger-repo.ts +142 -0
- package/src/storage/schema.ts +50 -1
- package/src/types/compression.ts +29 -0
- package/src/types/config.ts +40 -0
- package/src/types/dashboard.ts +22 -1
- package/src/types/hook-input.ts +4 -0
- package/src/types/token-ledger.ts +55 -0
- package/dashboard/out/_next/static/UWfkbJY4zr9fSt7O-CAge/_buildManifest.js +0 -1
- package/dashboard/out/_next/static/chunks/app/(panels)/activity/page-096a97ba539d5323.js +0 -1
- package/dashboard/out/_next/static/chunks/app/(panels)/bugs/page-449d31c133432458.js +0 -1
- package/dashboard/out/_next/static/chunks/app/(panels)/capture/page-c6617aa0a8a7333e.js +0 -1
- package/dashboard/out/_next/static/chunks/app/(panels)/config/page-aa0a0623b3fdd0d8.js +0 -1
- package/dashboard/out/_next/static/chunks/app/(panels)/daemon/page-7cd3fac2f5d87a0d.js +0 -1
- package/dashboard/out/_next/static/chunks/app/(panels)/design/page-5304675c96b6793b.js +0 -1
- package/dashboard/out/_next/static/chunks/app/(panels)/discord/page-9940dde80ba2a69e.js +0 -1
- package/dashboard/out/_next/static/chunks/app/(panels)/file-index/page-ecd8a753614e981e.js +0 -1
- package/dashboard/out/_next/static/chunks/app/(panels)/insights/page-7909d8beb8d8ef7a.js +0 -1
- package/dashboard/out/_next/static/chunks/app/(panels)/overview/page-7a9e86dcde67d6a9.js +0 -1
- package/dashboard/out/_next/static/chunks/app/(panels)/scheduler/page-a88f93204c9742a1.js +0 -1
- package/dashboard/out/_next/static/chunks/app/(panels)/sync/page-8a9ad4c36aa6cb65.js +0 -1
- package/dashboard/out/_next/static/chunks/app/(panels)/tokens/page-8dac7d50d4db2756.js +0 -1
- package/dashboard/out/_next/static/chunks/app/(panels)/waste/page-bcf56144faf7d133.js +0 -1
- package/dashboard/out/_next/static/chunks/app/(panels)/wiki/page-a32fdbd0bf58b30b.js +0 -1
- package/dashboard/out/_next/static/chunks/app/layout-782cd26e0ccc4514.js +0 -1
- package/src/core/agent-detect.ts +0 -88
- package/src/core/agent-pi.ts +0 -314
- package/src/core/prompt.ts +0 -27
- /package/dashboard/out/_next/static/{UWfkbJY4zr9fSt7O-CAge → U9AeObddt4LmJkKRZpEfy}/_ssgManifest.js +0 -0
|
@@ -21,6 +21,11 @@ import type {
|
|
|
21
21
|
TokenLedger,
|
|
22
22
|
LedgerSession,
|
|
23
23
|
LifetimeCounters,
|
|
24
|
+
CompressionEvent,
|
|
25
|
+
CompressionEventInput,
|
|
26
|
+
CompressionLifetime,
|
|
27
|
+
CompressionArms,
|
|
28
|
+
CompressionBreakdownRow,
|
|
24
29
|
} from "../types/token-ledger";
|
|
25
30
|
import type { SessionSummary } from "../types/session";
|
|
26
31
|
import type { WasteFlag, WastePattern } from "../types/waste-detection";
|
|
@@ -182,6 +187,7 @@ export class TokenLedgerRepo {
|
|
|
182
187
|
const ledger: TokenLedger = {
|
|
183
188
|
lifetime: this.lifetime(),
|
|
184
189
|
sessions: this.activeSessions(),
|
|
190
|
+
compression: this.compressionLifetime(),
|
|
185
191
|
};
|
|
186
192
|
const flagRows = this.db
|
|
187
193
|
.prepare(
|
|
@@ -233,6 +239,142 @@ export class TokenLedgerRepo {
|
|
|
233
239
|
});
|
|
234
240
|
}
|
|
235
241
|
|
|
242
|
+
// ── Compression measurement (spec 21) ────────────────────────────────
|
|
243
|
+
|
|
244
|
+
// Record one compression decision and fold it into this device's
|
|
245
|
+
// compression-lifetime aggregates, transactionally so the row and the
|
|
246
|
+
// aggregate never drift. measured savings credits compressed arms only —
|
|
247
|
+
// a holdout arm saves nothing by construction.
|
|
248
|
+
recordCompression(
|
|
249
|
+
event: CompressionEventInput,
|
|
250
|
+
deviceId: string = getOrCreateDeviceId()
|
|
251
|
+
): void {
|
|
252
|
+
const id = event.id ?? crypto.randomUUID();
|
|
253
|
+
const createdAt = event.createdAt ?? new Date().toISOString();
|
|
254
|
+
const holdout = event.holdout ? 1 : 0;
|
|
255
|
+
const savings = event.holdout
|
|
256
|
+
? 0
|
|
257
|
+
: Math.max(0, event.originalTokens - event.compressedTokens);
|
|
258
|
+
this.db.transaction(() => {
|
|
259
|
+
this.db.prepare(`
|
|
260
|
+
INSERT OR REPLACE INTO ledger_compressions
|
|
261
|
+
(id, created_at, tool_name, content_kind,
|
|
262
|
+
original_tokens, compressed_tokens, holdout, device_id)
|
|
263
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
264
|
+
`).run(
|
|
265
|
+
id, createdAt, event.toolName, event.contentKind,
|
|
266
|
+
event.originalTokens, event.compressedTokens, holdout, deviceId
|
|
267
|
+
);
|
|
268
|
+
this.db.prepare(`
|
|
269
|
+
INSERT INTO ledger_compression_lifetime
|
|
270
|
+
(device_id, total_events, total_holdout_events,
|
|
271
|
+
total_original_tokens, total_compressed_tokens, total_measured_savings)
|
|
272
|
+
VALUES (?, ?, ?, ?, ?, ?)
|
|
273
|
+
ON CONFLICT(device_id) DO UPDATE SET
|
|
274
|
+
total_events = ledger_compression_lifetime.total_events + excluded.total_events,
|
|
275
|
+
total_holdout_events = ledger_compression_lifetime.total_holdout_events + excluded.total_holdout_events,
|
|
276
|
+
total_original_tokens = ledger_compression_lifetime.total_original_tokens + excluded.total_original_tokens,
|
|
277
|
+
total_compressed_tokens = ledger_compression_lifetime.total_compressed_tokens + excluded.total_compressed_tokens,
|
|
278
|
+
total_measured_savings = ledger_compression_lifetime.total_measured_savings + excluded.total_measured_savings
|
|
279
|
+
`).run(
|
|
280
|
+
deviceId, 1, holdout,
|
|
281
|
+
event.originalTokens, event.compressedTokens, savings
|
|
282
|
+
);
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// Project-wide compression aggregates — summed across every device's row.
|
|
287
|
+
compressionLifetime(): CompressionLifetime {
|
|
288
|
+
const row = this.db.prepare(`
|
|
289
|
+
SELECT
|
|
290
|
+
COALESCE(SUM(total_events), 0) AS totalEvents,
|
|
291
|
+
COALESCE(SUM(total_holdout_events), 0) AS totalHoldoutEvents,
|
|
292
|
+
COALESCE(SUM(total_original_tokens), 0) AS totalOriginalTokens,
|
|
293
|
+
COALESCE(SUM(total_compressed_tokens), 0) AS totalCompressedTokens,
|
|
294
|
+
COALESCE(SUM(total_measured_savings), 0) AS totalMeasuredSavings
|
|
295
|
+
FROM ledger_compression_lifetime
|
|
296
|
+
`).get() as Record<string, number> | undefined;
|
|
297
|
+
return {
|
|
298
|
+
totalEvents: Number(row?.totalEvents ?? 0),
|
|
299
|
+
totalHoldoutEvents: Number(row?.totalHoldoutEvents ?? 0),
|
|
300
|
+
totalOriginalTokens: Number(row?.totalOriginalTokens ?? 0),
|
|
301
|
+
totalCompressedTokens: Number(row?.totalCompressedTokens ?? 0),
|
|
302
|
+
totalMeasuredSavings: Number(row?.totalMeasuredSavings ?? 0),
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
// Recent compression events, newest first. Primarily for inspection/tests.
|
|
307
|
+
compressionEvents(limit = 100): CompressionEvent[] {
|
|
308
|
+
const rows = this.db.prepare(`
|
|
309
|
+
SELECT id, created_at, tool_name, content_kind,
|
|
310
|
+
original_tokens, compressed_tokens, holdout
|
|
311
|
+
FROM ledger_compressions
|
|
312
|
+
ORDER BY created_at DESC
|
|
313
|
+
LIMIT ?
|
|
314
|
+
`).all(limit) as Array<Record<string, unknown>>;
|
|
315
|
+
return rows.map((r) => ({
|
|
316
|
+
id: String(r.id),
|
|
317
|
+
createdAt: String(r.created_at),
|
|
318
|
+
toolName: String(r.tool_name),
|
|
319
|
+
contentKind: String(r.content_kind),
|
|
320
|
+
originalTokens: Number(r.original_tokens),
|
|
321
|
+
compressedTokens: Number(r.compressed_tokens),
|
|
322
|
+
holdout: Number(r.holdout) === 1,
|
|
323
|
+
}));
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
// Compression split by arm (holdout A/B). Compressed-arm carries the savings
|
|
327
|
+
// story; the holdout arm records the originals we deliberately left
|
|
328
|
+
// uncompressed as a control.
|
|
329
|
+
compressionArms(): CompressionArms {
|
|
330
|
+
const row = this.db.prepare(`
|
|
331
|
+
SELECT
|
|
332
|
+
COALESCE(SUM(CASE WHEN holdout = 0 THEN 1 END), 0) AS cEvents,
|
|
333
|
+
COALESCE(SUM(CASE WHEN holdout = 0 THEN original_tokens END), 0) AS cOriginal,
|
|
334
|
+
COALESCE(SUM(CASE WHEN holdout = 0 THEN compressed_tokens END), 0) AS cCompressed,
|
|
335
|
+
COALESCE(SUM(CASE WHEN holdout = 1 THEN 1 END), 0) AS hEvents,
|
|
336
|
+
COALESCE(SUM(CASE WHEN holdout = 1 THEN original_tokens END), 0) AS hOriginal
|
|
337
|
+
FROM ledger_compressions
|
|
338
|
+
`).get() as Record<string, number> | undefined;
|
|
339
|
+
return {
|
|
340
|
+
compressed: {
|
|
341
|
+
events: Number(row?.cEvents ?? 0),
|
|
342
|
+
originalTokens: Number(row?.cOriginal ?? 0),
|
|
343
|
+
compressedTokens: Number(row?.cCompressed ?? 0),
|
|
344
|
+
},
|
|
345
|
+
holdout: {
|
|
346
|
+
events: Number(row?.hEvents ?? 0),
|
|
347
|
+
originalTokens: Number(row?.hOriginal ?? 0),
|
|
348
|
+
},
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
// Compression aggregates grouped by a dimension (content_kind or tool_name),
|
|
353
|
+
// ordered by measured savings. `savings` credits compressed arms only, so the
|
|
354
|
+
// breakdown reflects realised reductions, not held-out controls.
|
|
355
|
+
compressionBreakdown(
|
|
356
|
+
dimension: "content_kind" | "tool_name"
|
|
357
|
+
): CompressionBreakdownRow[] {
|
|
358
|
+
const rows = this.db.prepare(`
|
|
359
|
+
SELECT
|
|
360
|
+
${dimension} AS key,
|
|
361
|
+
COUNT(*) AS events,
|
|
362
|
+
COALESCE(SUM(original_tokens), 0) AS originalTokens,
|
|
363
|
+
COALESCE(SUM(compressed_tokens), 0) AS compressedTokens,
|
|
364
|
+
COALESCE(SUM(CASE WHEN holdout = 0 THEN original_tokens - compressed_tokens END), 0) AS savings
|
|
365
|
+
FROM ledger_compressions
|
|
366
|
+
GROUP BY ${dimension}
|
|
367
|
+
ORDER BY savings DESC
|
|
368
|
+
`).all() as Array<Record<string, unknown>>;
|
|
369
|
+
return rows.map((r) => ({
|
|
370
|
+
key: String(r.key),
|
|
371
|
+
events: Number(r.events),
|
|
372
|
+
originalTokens: Number(r.originalTokens),
|
|
373
|
+
compressedTokens: Number(r.compressedTokens),
|
|
374
|
+
savings: Number(r.savings),
|
|
375
|
+
}));
|
|
376
|
+
}
|
|
377
|
+
|
|
236
378
|
// ── Helpers ───────────────────────────────────────────────────────────
|
|
237
379
|
|
|
238
380
|
private insertSessionRow(
|
package/src/storage/schema.ts
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
// - `meta(key, value)` holds versioning + migration markers. Keep it small;
|
|
13
13
|
// per-store counters live in `counters` and `ledger_lifetime`.
|
|
14
14
|
|
|
15
|
-
export const SCHEMA_VERSION =
|
|
15
|
+
export const SCHEMA_VERSION = 3;
|
|
16
16
|
|
|
17
17
|
export const INITIAL_SCHEMA = `
|
|
18
18
|
CREATE TABLE IF NOT EXISTS meta (
|
|
@@ -176,6 +176,55 @@ CREATE TABLE IF NOT EXISTS counters (
|
|
|
176
176
|
file_index_hits INTEGER NOT NULL DEFAULT 0,
|
|
177
177
|
file_index_misses INTEGER NOT NULL DEFAULT 0
|
|
178
178
|
);
|
|
179
|
+
|
|
180
|
+
-- Tool-output compression measurement (spec 21). One row per compression
|
|
181
|
+
-- decision: either a compressed arm (compressed_tokens < original_tokens) or a
|
|
182
|
+
-- holdout arm (left uncompressed for control, compressed_tokens = original_tokens).
|
|
183
|
+
-- These are append-only telemetry, independent of session lifecycle, written at
|
|
184
|
+
-- the moment a tool output is processed. New table → applied to existing DBs via
|
|
185
|
+
-- IF NOT EXISTS on the next open.
|
|
186
|
+
CREATE TABLE IF NOT EXISTS ledger_compressions (
|
|
187
|
+
id TEXT PRIMARY KEY,
|
|
188
|
+
created_at TEXT NOT NULL,
|
|
189
|
+
tool_name TEXT NOT NULL,
|
|
190
|
+
content_kind TEXT NOT NULL,
|
|
191
|
+
original_tokens INTEGER NOT NULL DEFAULT 0,
|
|
192
|
+
compressed_tokens INTEGER NOT NULL DEFAULT 0,
|
|
193
|
+
holdout INTEGER NOT NULL DEFAULT 0,
|
|
194
|
+
device_id TEXT NOT NULL
|
|
195
|
+
);
|
|
196
|
+
CREATE INDEX IF NOT EXISTS idx_ledger_compressions_created ON ledger_compressions(created_at);
|
|
197
|
+
CREATE INDEX IF NOT EXISTS idx_ledger_compressions_device ON ledger_compressions(device_id);
|
|
198
|
+
|
|
199
|
+
-- Per-device compression aggregates, summed across devices like ledger_lifetime.
|
|
200
|
+
-- measured_savings only credits compressed arms (holdout arms save nothing by
|
|
201
|
+
-- construction), so the reported figure is a true measured delta, not an estimate.
|
|
202
|
+
CREATE TABLE IF NOT EXISTS ledger_compression_lifetime (
|
|
203
|
+
device_id TEXT PRIMARY KEY,
|
|
204
|
+
total_events INTEGER NOT NULL DEFAULT 0,
|
|
205
|
+
total_holdout_events INTEGER NOT NULL DEFAULT 0,
|
|
206
|
+
total_original_tokens INTEGER NOT NULL DEFAULT 0,
|
|
207
|
+
total_compressed_tokens INTEGER NOT NULL DEFAULT 0,
|
|
208
|
+
total_measured_savings INTEGER NOT NULL DEFAULT 0
|
|
209
|
+
);
|
|
210
|
+
|
|
211
|
+
-- Reversible-compression cache (spec 21 §Reversibility). When a tool output is
|
|
212
|
+
-- compressed, the original is stored here keyed by a short retrieval token and
|
|
213
|
+
-- embedded in the compressed result; "mink retrieve <token>" returns it
|
|
214
|
+
-- byte-exact. Rows expire after the configured retention window; an expired or
|
|
215
|
+
-- unknown token is a graceful miss. This is a local cache, not synced state, so
|
|
216
|
+
-- (unlike other tables) it carries no merge semantics beyond device_id for audit.
|
|
217
|
+
CREATE TABLE IF NOT EXISTS compression_cache (
|
|
218
|
+
token TEXT PRIMARY KEY,
|
|
219
|
+
created_at TEXT NOT NULL,
|
|
220
|
+
expires_at TEXT NOT NULL,
|
|
221
|
+
tool_name TEXT NOT NULL,
|
|
222
|
+
content_kind TEXT NOT NULL,
|
|
223
|
+
content TEXT NOT NULL,
|
|
224
|
+
size_bytes INTEGER NOT NULL,
|
|
225
|
+
device_id TEXT NOT NULL
|
|
226
|
+
);
|
|
227
|
+
CREATE INDEX IF NOT EXISTS idx_compression_cache_expires ON compression_cache(expires_at);
|
|
179
228
|
`;
|
|
180
229
|
|
|
181
230
|
export interface DriverForSchema {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Tool-output compression types (spec 21). The decision/config types live in
|
|
2
|
+
// src/core/compression.ts; these describe the reversible cache and the engine's
|
|
3
|
+
// content-aware output.
|
|
4
|
+
|
|
5
|
+
// What kind of tool output we detected, which selects the compressor and is
|
|
6
|
+
// recorded on the ledger event for later analysis.
|
|
7
|
+
export type ContentKind = "search" | "log" | "file" | "json" | "text";
|
|
8
|
+
|
|
9
|
+
// One stored original, retrievable byte-exact via `mink retrieve <token>` until
|
|
10
|
+
// it expires.
|
|
11
|
+
export interface CompressionCacheEntry {
|
|
12
|
+
token: string;
|
|
13
|
+
createdAt: string;
|
|
14
|
+
expiresAt: string;
|
|
15
|
+
toolName: string;
|
|
16
|
+
contentKind: ContentKind;
|
|
17
|
+
content: string;
|
|
18
|
+
sizeBytes: number;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// The result of compressing one output. `compressed` is the body the model will
|
|
22
|
+
// see (sans retrieval affordance, which the pipeline appends); `omittedNote`
|
|
23
|
+
// summarises what was dropped. A compressor returns null when it has nothing
|
|
24
|
+
// worth substituting.
|
|
25
|
+
export interface CompressionResult {
|
|
26
|
+
kind: ContentKind;
|
|
27
|
+
compressed: string;
|
|
28
|
+
omittedNote: string;
|
|
29
|
+
}
|
package/src/types/config.ts
CHANGED
|
@@ -18,6 +18,11 @@ export interface GlobalConfig {
|
|
|
18
18
|
"cli.auto-update-schedule"?: string;
|
|
19
19
|
"cli.auto-update-package-manager"?: string;
|
|
20
20
|
"projects.identity"?: string;
|
|
21
|
+
"compression.enabled"?: string;
|
|
22
|
+
"compression.threshold-tokens"?: string;
|
|
23
|
+
"compression.min-savings-ratio"?: string;
|
|
24
|
+
"compression.holdout-fraction"?: string;
|
|
25
|
+
"compression.retention-hours"?: string;
|
|
21
26
|
}
|
|
22
27
|
|
|
23
28
|
export type ConfigKey = keyof GlobalConfig & string;
|
|
@@ -179,6 +184,41 @@ export const CONFIG_KEYS: ConfigKeyMeta[] = [
|
|
|
179
184
|
"Project identity strategy: path-derived (legacy) or git-remote (stable across machines)",
|
|
180
185
|
scope: "shared",
|
|
181
186
|
},
|
|
187
|
+
{
|
|
188
|
+
key: "compression.enabled",
|
|
189
|
+
default: "false",
|
|
190
|
+
envVar: "MINK_COMPRESSION_ENABLED",
|
|
191
|
+
description: "Enable tool-output compression (spec 21). Off until inline compression ships.",
|
|
192
|
+
scope: "shared",
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
key: "compression.threshold-tokens",
|
|
196
|
+
default: "800",
|
|
197
|
+
envVar: "MINK_COMPRESSION_THRESHOLD_TOKENS",
|
|
198
|
+
description: "Minimum estimated token size before a tool output is eligible for compression",
|
|
199
|
+
scope: "shared",
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
key: "compression.min-savings-ratio",
|
|
203
|
+
default: "0.25",
|
|
204
|
+
envVar: "MINK_COMPRESSION_MIN_SAVINGS_RATIO",
|
|
205
|
+
description: "Discard a compression attempt unless it saves at least this fraction of tokens",
|
|
206
|
+
scope: "shared",
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
key: "compression.holdout-fraction",
|
|
210
|
+
default: "0.1",
|
|
211
|
+
envVar: "MINK_COMPRESSION_HOLDOUT_FRACTION",
|
|
212
|
+
description: "Fraction of eligible outputs left uncompressed as a measured control group",
|
|
213
|
+
scope: "shared",
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
key: "compression.retention-hours",
|
|
217
|
+
default: "168",
|
|
218
|
+
envVar: "MINK_COMPRESSION_RETENTION_HOURS",
|
|
219
|
+
description: "How long compressed originals stay retrievable before eviction",
|
|
220
|
+
scope: "shared",
|
|
221
|
+
},
|
|
182
222
|
];
|
|
183
223
|
|
|
184
224
|
const VALID_KEYS = new Set<string>(CONFIG_KEYS.map((k) => k.key));
|
package/src/types/dashboard.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
LifetimeCounters,
|
|
3
|
+
LedgerSession,
|
|
4
|
+
CompressionLifetime,
|
|
5
|
+
CompressionArms,
|
|
6
|
+
CompressionBreakdownRow,
|
|
7
|
+
CompressionEvent,
|
|
8
|
+
} from "./token-ledger";
|
|
2
9
|
import type { WasteFlag } from "./waste-detection";
|
|
3
10
|
import type { FileIndexHeader, FileIndexEntry } from "./file-index";
|
|
4
11
|
import type { BugEntry } from "./bug-memory";
|
|
@@ -59,6 +66,9 @@ export interface OverviewPayload {
|
|
|
59
66
|
totalWrites: number;
|
|
60
67
|
estimatedSavings: number;
|
|
61
68
|
};
|
|
69
|
+
// Measured tool-output compression aggregates (spec 21), kept distinct from
|
|
70
|
+
// the heuristic estimatedSavings above. Optional for back-compat.
|
|
71
|
+
compression?: CompressionLifetime;
|
|
62
72
|
stateFiles: FileStatus[];
|
|
63
73
|
}
|
|
64
74
|
|
|
@@ -66,6 +76,17 @@ export interface TokenLedgerPayload {
|
|
|
66
76
|
lifetime: LifetimeCounters;
|
|
67
77
|
sessions: LedgerSession[];
|
|
68
78
|
wasteFlags: WasteFlag[];
|
|
79
|
+
compression?: CompressionLifetime;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Dedicated Compression panel payload (spec 21, phase 4).
|
|
83
|
+
export interface CompressionPayload {
|
|
84
|
+
enabled: boolean;
|
|
85
|
+
lifetime: CompressionLifetime;
|
|
86
|
+
arms: CompressionArms;
|
|
87
|
+
byKind: CompressionBreakdownRow[];
|
|
88
|
+
byTool: CompressionBreakdownRow[];
|
|
89
|
+
recent: CompressionEvent[];
|
|
69
90
|
}
|
|
70
91
|
|
|
71
92
|
export interface FileIndexPayload {
|
package/src/types/hook-input.ts
CHANGED
|
@@ -19,6 +19,10 @@ export interface PostToolUseInput {
|
|
|
19
19
|
// Edit tool
|
|
20
20
|
old_string?: string;
|
|
21
21
|
new_string?: string;
|
|
22
|
+
// Read tool — present for ranged reads; their output is a slice, so we
|
|
23
|
+
// don't substitute a whole-file summary for them (spec 21 edge case).
|
|
24
|
+
offset?: number;
|
|
25
|
+
limit?: number;
|
|
22
26
|
};
|
|
23
27
|
// Legacy / older hook payload shape — kept for backward compatibility.
|
|
24
28
|
tool_output?: {
|
|
@@ -40,4 +40,59 @@ export interface TokenLedger {
|
|
|
40
40
|
lifetime: LifetimeCounters;
|
|
41
41
|
sessions: LedgerSession[];
|
|
42
42
|
wasteFlags?: WasteFlag[];
|
|
43
|
+
// Measured tool-output compression aggregates (spec 21). Optional because the
|
|
44
|
+
// legacy JSON-fallback ledger path has no compression data; only the SQLite
|
|
45
|
+
// snapshot() populates it.
|
|
46
|
+
compression?: CompressionLifetime;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Tool-output compression measurement (spec 21).
|
|
50
|
+
|
|
51
|
+
// What the caller supplies when recording a compression decision. `id` and
|
|
52
|
+
// `createdAt` are generated when omitted. For a holdout arm, pass the original
|
|
53
|
+
// output unchanged so `compressedTokens === originalTokens` and `holdout: true`.
|
|
54
|
+
export interface CompressionEventInput {
|
|
55
|
+
toolName: string;
|
|
56
|
+
contentKind: string;
|
|
57
|
+
originalTokens: number;
|
|
58
|
+
compressedTokens: number;
|
|
59
|
+
holdout: boolean;
|
|
60
|
+
id?: string;
|
|
61
|
+
createdAt?: string;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface CompressionEvent {
|
|
65
|
+
id: string;
|
|
66
|
+
createdAt: string;
|
|
67
|
+
toolName: string;
|
|
68
|
+
contentKind: string;
|
|
69
|
+
originalTokens: number;
|
|
70
|
+
compressedTokens: number;
|
|
71
|
+
holdout: boolean;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface CompressionLifetime {
|
|
75
|
+
totalEvents: number;
|
|
76
|
+
totalHoldoutEvents: number;
|
|
77
|
+
totalOriginalTokens: number;
|
|
78
|
+
totalCompressedTokens: number;
|
|
79
|
+
totalMeasuredSavings: number;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Compression aggregates split by arm — the holdout A/B view. The lifetime row
|
|
83
|
+
// sums original/compressed across both arms, so an honest comparison must come
|
|
84
|
+
// from grouping ledger_compressions by the holdout flag.
|
|
85
|
+
export interface CompressionArms {
|
|
86
|
+
compressed: { events: number; originalTokens: number; compressedTokens: number };
|
|
87
|
+
holdout: { events: number; originalTokens: number };
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// One row of a compression breakdown grouped by a dimension (content kind or
|
|
91
|
+
// tool). `savings` credits compressed arms only.
|
|
92
|
+
export interface CompressionBreakdownRow {
|
|
93
|
+
key: string;
|
|
94
|
+
events: number;
|
|
95
|
+
originalTokens: number;
|
|
96
|
+
compressedTokens: number;
|
|
97
|
+
savings: number;
|
|
43
98
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
self.__BUILD_MANIFEST=function(e,r,t,s){return{__rewrites:{afterFiles:[{has:t,source:"/api/:path*",destination:t}],beforeFiles:[],fallback:[]},__routerFilterStatic:{numItems:19,errorRate:1e-4,numBits:365,numHashes:14,bitArray:[0,0,1,e,1,r,e,e,r,r,r,e,r,e,r,e,r,e,r,r,e,r,e,r,e,r,r,e,r,r,e,r,e,r,e,r,r,e,r,e,r,e,e,e,e,r,e,e,e,e,e,e,e,e,e,r,e,e,e,e,e,e,r,r,e,e,r,e,e,r,e,e,e,r,r,r,r,r,e,e,e,r,r,e,e,r,e,r,e,r,r,r,r,r,r,e,r,r,r,r,e,e,e,r,e,r,e,e,e,r,e,r,e,e,r,e,r,r,e,r,r,r,e,r,r,e,r,r,e,r,e,e,r,r,r,r,r,r,r,r,r,r,r,e,e,e,r,r,r,r,e,r,e,e,e,e,r,r,r,e,e,r,r,r,r,r,e,e,e,e,e,e,r,r,e,r,e,e,r,e,e,e,r,r,r,r,e,r,e,e,r,r,e,e,e,e,e,r,e,e,e,r,e,e,r,e,r,e,r,r,r,e,r,r,e,e,e,r,e,e,e,r,r,e,e,r,e,e,r,r,e,e,r,r,e,r,e,e,r,e,e,r,e,e,e,e,r,r,r,r,r,e,e,r,e,e,r,e,r,e,e,r,r,e,e,e,e,e,e,e,e,e,e,r,r,e,e,e,r,r,r,e,r,r,r,r,r,e,e,r,e,e,r,e,e,r,e,e,r,e,e,r,r,e,r,r,e,e,e,r,r,e,e,e,r,e,e,r,e,e,r,r,r,e,r,r,r,e,r,e,r,e,r,e,e,r,e,e,r,r,r,e,e,e,r,e,e,e,e,r,r,r,r,r,r,e,r,r,e,e,e,r,r,r,e]},__routerFilterDynamic:{numItems:e,errorRate:1e-4,numBits:e,numHashes:null,bitArray:[]},"/_error":["static/chunks/pages/_error-cb2a52f75f2162e2.js"],sortedPages:["/_app","/_error"]}}(0,1,void 0,1e-4),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[91],{1044:(e,t,s)=>{"use strict";s.d(t,{I:()=>n});var l=s(5155);let a={pulse:"M2 12h4l2-7 4 14 2-7h6",activity:"M22 12h-4l-3 9L9 3l-3 9H2",layers:"M12 2l10 6-10 6L2 8l10-6zm0 10l10 6-10 6L2 18l10-6z",database:"M4 5a8 3 0 1016 0 8 3 0 10-16 0v14a8 3 0 0016 0V5",sparkles:"M12 3l1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5zM20 15l.8 2.2L23 18l-2.2.8L20 21l-.8-2.2L17 18l2.2-.8z",brain:"M12 4a4 4 0 00-4 4v1a3 3 0 00-2 5.5A3 3 0 008 19a4 4 0 004 2 4 4 0 004-2 3 3 0 002-4.5A3 3 0 0016 9V8a4 4 0 00-4-4z",bug:"M8 8V6a4 4 0 018 0v2M4 13h16M12 8v13M7 21s-3-2-3-8M17 21s3-2 3-8M8 9l-4-3M16 9l4-3M8 13l-4 3M16 13l4 3",file:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6z",folder:"M3 7a2 2 0 012-2h4l2 2h8a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V7z",clock:"M12 22a10 10 0 100-20 10 10 0 000 20zm0-16v6l4 2",alert:"M12 2l11 20H1L12 2zm0 7v5m0 4v0",settings:"M12 15a3 3 0 100-6 3 3 0 000 6zm8-3l2-1-2-4-2 1-1-1V4h-4v1l-1 1-2-1-2 4 2 1v2l-2 1 2 4 2-1 1 1v1h4v-1l1-1 2 1 2-4-2-1v-2z",link:"M10 13a5 5 0 007 0l3-3a5 5 0 00-7-7l-1 1M14 11a5 5 0 00-7 0l-3 3a5 5 0 007 7l1-1",git:"M6 3v12M6 15a3 3 0 110 6 3 3 0 010-6zm0-12a3 3 0 110 6 3 3 0 010-6zm12 6a3 3 0 110 6 3 3 0 010-6zM18 9v2a2 2 0 01-2 2H9",discord:"M9 14a1 1 0 100-2 1 1 0 000 2zm6 0a1 1 0 100-2 1 1 0 000 2zM7 7l2-1h6l2 1 2 5-1 5-3 1-1-2-4 0-1 2-3-1-1-5z",chev:"M9 6l6 6-6 6",chevDown:"M6 9l6 6 6-6",play:"M6 4l14 8-14 8z",pause:"M7 4h4v16H7zM13 4h4v16h-4z",stop:"M6 6h12v12H6z",plus:"M12 5v14M5 12h14",search:"M21 21l-5-5m2-6a8 8 0 11-16 0 8 8 0 0116 0z",refresh:"M3 12a9 9 0 019-9c2.5 0 4.7 1 6.3 2.7M21 3v5h-5M21 12a9 9 0 01-9 9c-2.5 0-4.7-1-6.3-2.7M3 21v-5h5",dots:"M5 12a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0z",check:"M20 6L9 17l-5-5",x:"M6 6l12 12M6 18L18 6",download:"M12 3v13m0 0l-5-5m5 5l5-5M4 21h16",upload:"M12 21V8m0 0l-5 5m5-5l5 5M4 3h16",arrowUp:"M12 19V5m0 0l-7 7m7-7l7 7",arrowDown:"M12 5v14m0 0l-7-7m7 7l7-7",trash:"M4 7h16M10 7V4h4v3m-6 0v13h8V7",home:"M3 12l9-9 9 9M5 10v10h14V10",command:"M6 3a3 3 0 013 3v12a3 3 0 11-3-3h12a3 3 0 113 3V6a3 3 0 11-3 3H6",archive:"M3 7h18v4H3zM5 11v9h14v-9M10 14h4",terminal:"M4 5h16v14H4zM8 9l3 3-3 3M13 15h4",wand:"M15 4V2m0 14v-2m-7-7h2M22 9h-2M5.6 5.6l1.4 1.4M18.4 5.6L17 7m0 10l1.4 1.4M7 17l-1.4 1.4M14 7l-9 9 3 3 9-9",tag:"M20 13l-7 7a2 2 0 01-3 0L3 13V4h9l8 9zM7 7h.01",calendar:"M3 7h18v13H3zM3 7l0-3h18v3M8 2v4M16 2v4M3 11h18",list:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01",grid:"M3 3h8v8H3zM13 3h8v8h-8zM3 13h8v8H3zM13 13h8v8h-8z",eye:"M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12zm10 3a3 3 0 100-6 3 3 0 000 6z",chart:"M3 20h18M6 16V8M11 16V4M16 16v-6M21 16v-3",book:"M4 4h12a4 4 0 014 4v12H8a4 4 0 01-4-4V4zm0 0v16",copy:"M8 5h10a2 2 0 012 2v10M4 9h10a2 2 0 012 2v10H6a2 2 0 01-2-2V9z",power:"M18 6a8 8 0 11-12 0M12 2v8",stack:"M4 6h16M4 12h16M4 18h16"};function n(e){let{name:t,size:s=14,stroke:n=1.7,className:i=""}=e,r=a[t];return r?(0,l.jsx)("svg",{className:"icn ".concat(i).trim(),width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round",children:(0,l.jsx)("path",{d:r})}):null}},3742:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});var l=s(5155);function a(e){let{title:t,sub:s,tools:a,flush:n,className:i="",style:r,children:c}=e,o=null!=t||null!=a;return(0,l.jsxs)("div",{className:"card ".concat(i).trim(),style:r,children:[o&&(0,l.jsxs)("div",{className:"card-head",children:[null!=t&&("string"==typeof t?(0,l.jsx)("h3",{children:t}):t),null!=s&&(0,l.jsx)("span",{className:"sub",children:s}),null!=a&&(0,l.jsx)("div",{className:"tools",children:a})]}),(0,l.jsx)("div",{className:"card-body ".concat(n?"flush":"").trim(),children:c})]})}},3928:(e,t,s)=>{"use strict";s.d(t,{f:()=>l});let l=(0,s(5959).v)(e=>({connected:!1,projects:[],activeProjectId:null,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[],config:null,sync:null,channel:null,wiki:null,wikiNote:null,setConnected:t=>e({connected:t}),setProjects:(t,s)=>e({projects:t,activeProjectId:s}),setActiveProject:t=>e({activeProjectId:t,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[]}),setOverview:t=>e({overview:t}),setLedger:t=>{var s;return e({ledger:t,wasteFlags:null!=(s=t.wasteFlags)?s:[]})},setFileIndex:t=>e({fileIndex:t}),setScheduler:(t,s,l)=>e({tasks:t,taskDefinitions:s,deadLetters:l}),setHealth:t=>e({health:t}),setLearningMemory:t=>e({learningMemory:t}),setActionLog:t=>e({actionLog:t}),setBugs:t=>e({bugs:t}),setWasteFlags:t=>e({wasteFlags:t}),setDesignImages:t=>e({designImages:t}),setConfig:t=>e({config:t}),setSync:t=>e({sync:t}),setChannel:t=>e({channel:t}),setWiki:t=>e({wiki:t}),setWikiNote:t=>e({wikiNote:t})}))},5530:(e,t,s)=>{Promise.resolve().then(s.bind(s,6893))},5959:(e,t,s)=>{"use strict";s.d(t,{v:()=>i});var l=s(2115);let a=e=>{let t,s=new Set,l=(e,l)=>{let a="function"==typeof e?e(t):e;if(!Object.is(a,t)){let e=t;t=(null!=l?l:"object"!=typeof a||null===a)?a:Object.assign({},t,a),s.forEach(s=>s(t,e))}},a=()=>t,n={setState:l,getState:a,getInitialState:()=>i,subscribe:e=>(s.add(e),()=>s.delete(e))},i=t=e(l,a,n);return n},n=e=>{let t=(e=>e?a(e):a)(e),s=e=>(function(e,t=e=>e){let s=l.useSyncExternalStore(e.subscribe,l.useCallback(()=>t(e.getState()),[e,t]),l.useCallback(()=>t(e.getInitialState()),[e,t]));return l.useDebugValue(s),s})(t,e);return Object.assign(s,t),s},i=e=>e?n(e):n},6845:(e,t,s)=>{"use strict";s.d(t,{t:()=>n});var l=s(5155),a=s(1044);function n(e){let{icon:t,variant:s,size:n,className:i="",children:r,...c}=e,o=["btn"];return s&&o.push(s),n&&o.push(n),i&&o.push(i),(0,l.jsxs)("button",{className:o.join(" "),...c,children:[t&&(0,l.jsx)(a.I,{name:t}),r]})}},6893:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>u});var l=s(5155),a=s(2115),n=s(3928),i=s(3742),r=s(7125),c=s(6845);let o=["all","read","write","session","other"];function h(e){let t=e.action.toLowerCase();return"read"===t?"read":"create"===t||"edit"===t||"write"===t?"write":t.includes("session")?"session":"other"}function d(){let e=(0,n.f)(e=>e.actionLog),[t,s]=(0,a.useState)("all"),d=(0,a.useMemo)(()=>[...e].reverse(),[e]),u="all"===t?d:d.filter(e=>h(e)===t);return(0,l.jsxs)("div",{className:"page",children:[(0,l.jsxs)("div",{className:"page-head",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h1",{className:"page-title",children:"Activity log"}),(0,l.jsx)("p",{className:"page-sub",children:"Chronological, human-readable record of every hook event"})]}),(0,l.jsx)("div",{className:"page-actions",children:(0,l.jsx)(c.t,{icon:"download",variant:"ghost",disabled:!0,title:"Export coming soon",children:"Export .md"})})]}),(0,l.jsx)(i.Z,{title:"Recent activity",sub:"".concat(u.length," events"),tools:(0,l.jsx)("div",{className:"row tight",children:o.map(e=>(0,l.jsx)("button",{type:"button",className:"tab ".concat(t===e?"on":""),style:{padding:"3px 8px",fontSize:10.5,marginBottom:0,borderBottom:0,borderRadius:4,background:t===e?"var(--bg-3)":"transparent"},onClick:()=>s(e),children:e},e))}),flush:!0,children:0===u.length?(0,l.jsxs)("div",{className:"empty",children:[(0,l.jsx)("h4",{children:"No activity recorded"}),(0,l.jsx)("span",{children:"start a Claude session with mink hooks enabled to populate this log."})]}):(0,l.jsx)("div",{children:u.map((e,t)=>{let s=h(e);return(0,l.jsxs)("div",{className:"evt ".concat(t<2?"fresh":"").trim(),children:[(0,l.jsx)("span",{className:"t",children:e.time}),(0,l.jsxs)("span",{className:"c",children:[(0,l.jsx)(r.v,{tone:function(e){switch(e){case"read":return"";case"write":return"blue";case"session":return"accent";default:return"amber"}}(s),children:s}),(0,l.jsxs)("span",{children:[" ",e.action," "]}),e.files&&"—"!==e.files&&(0,l.jsx)("code",{children:e.files}),e.outcome&&"—"!==e.outcome&&(0,l.jsx)("span",{className:"muted",style:{marginLeft:8,fontSize:10.5,fontFamily:"var(--font-mono), monospace"},children:e.outcome}),e.tokens&&"—"!==e.tokens&&(0,l.jsxs)("span",{className:"muted",style:{marginLeft:8,fontSize:10.5,fontFamily:"var(--font-mono), monospace"},children:[e.tokens," tok"]})]})]},"".concat(e.time,"-").concat(t))})})})]})}function u(){return(0,l.jsx)(d,{})}},7125:(e,t,s)=>{"use strict";s.d(t,{v:()=>a});var l=s(5155);function a(e){let{tone:t="",children:s,className:a=""}=e;return(0,l.jsx)("span",{className:"chip ".concat(t," ").concat(a).trim(),children:s})}}},e=>{e.O(0,[441,255,358],()=>e(e.s=5530)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[273],{1008:(e,t,l)=>{Promise.resolve().then(l.bind(l,8032))},1044:(e,t,l)=>{"use strict";l.d(t,{I:()=>n});var s=l(5155);let a={pulse:"M2 12h4l2-7 4 14 2-7h6",activity:"M22 12h-4l-3 9L9 3l-3 9H2",layers:"M12 2l10 6-10 6L2 8l10-6zm0 10l10 6-10 6L2 18l10-6z",database:"M4 5a8 3 0 1016 0 8 3 0 10-16 0v14a8 3 0 0016 0V5",sparkles:"M12 3l1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5zM20 15l.8 2.2L23 18l-2.2.8L20 21l-.8-2.2L17 18l2.2-.8z",brain:"M12 4a4 4 0 00-4 4v1a3 3 0 00-2 5.5A3 3 0 008 19a4 4 0 004 2 4 4 0 004-2 3 3 0 002-4.5A3 3 0 0016 9V8a4 4 0 00-4-4z",bug:"M8 8V6a4 4 0 018 0v2M4 13h16M12 8v13M7 21s-3-2-3-8M17 21s3-2 3-8M8 9l-4-3M16 9l4-3M8 13l-4 3M16 13l4 3",file:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6z",folder:"M3 7a2 2 0 012-2h4l2 2h8a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V7z",clock:"M12 22a10 10 0 100-20 10 10 0 000 20zm0-16v6l4 2",alert:"M12 2l11 20H1L12 2zm0 7v5m0 4v0",settings:"M12 15a3 3 0 100-6 3 3 0 000 6zm8-3l2-1-2-4-2 1-1-1V4h-4v1l-1 1-2-1-2 4 2 1v2l-2 1 2 4 2-1 1 1v1h4v-1l1-1 2 1 2-4-2-1v-2z",link:"M10 13a5 5 0 007 0l3-3a5 5 0 00-7-7l-1 1M14 11a5 5 0 00-7 0l-3 3a5 5 0 007 7l1-1",git:"M6 3v12M6 15a3 3 0 110 6 3 3 0 010-6zm0-12a3 3 0 110 6 3 3 0 010-6zm12 6a3 3 0 110 6 3 3 0 010-6zM18 9v2a2 2 0 01-2 2H9",discord:"M9 14a1 1 0 100-2 1 1 0 000 2zm6 0a1 1 0 100-2 1 1 0 000 2zM7 7l2-1h6l2 1 2 5-1 5-3 1-1-2-4 0-1 2-3-1-1-5z",chev:"M9 6l6 6-6 6",chevDown:"M6 9l6 6 6-6",play:"M6 4l14 8-14 8z",pause:"M7 4h4v16H7zM13 4h4v16h-4z",stop:"M6 6h12v12H6z",plus:"M12 5v14M5 12h14",search:"M21 21l-5-5m2-6a8 8 0 11-16 0 8 8 0 0116 0z",refresh:"M3 12a9 9 0 019-9c2.5 0 4.7 1 6.3 2.7M21 3v5h-5M21 12a9 9 0 01-9 9c-2.5 0-4.7-1-6.3-2.7M3 21v-5h5",dots:"M5 12a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0z",check:"M20 6L9 17l-5-5",x:"M6 6l12 12M6 18L18 6",download:"M12 3v13m0 0l-5-5m5 5l5-5M4 21h16",upload:"M12 21V8m0 0l-5 5m5-5l5 5M4 3h16",arrowUp:"M12 19V5m0 0l-7 7m7-7l7 7",arrowDown:"M12 5v14m0 0l-7-7m7 7l7-7",trash:"M4 7h16M10 7V4h4v3m-6 0v13h8V7",home:"M3 12l9-9 9 9M5 10v10h14V10",command:"M6 3a3 3 0 013 3v12a3 3 0 11-3-3h12a3 3 0 113 3V6a3 3 0 11-3 3H6",archive:"M3 7h18v4H3zM5 11v9h14v-9M10 14h4",terminal:"M4 5h16v14H4zM8 9l3 3-3 3M13 15h4",wand:"M15 4V2m0 14v-2m-7-7h2M22 9h-2M5.6 5.6l1.4 1.4M18.4 5.6L17 7m0 10l1.4 1.4M7 17l-1.4 1.4M14 7l-9 9 3 3 9-9",tag:"M20 13l-7 7a2 2 0 01-3 0L3 13V4h9l8 9zM7 7h.01",calendar:"M3 7h18v13H3zM3 7l0-3h18v3M8 2v4M16 2v4M3 11h18",list:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01",grid:"M3 3h8v8H3zM13 3h8v8h-8zM3 13h8v8H3zM13 13h8v8h-8z",eye:"M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12zm10 3a3 3 0 100-6 3 3 0 000 6z",chart:"M3 20h18M6 16V8M11 16V4M16 16v-6M21 16v-3",book:"M4 4h12a4 4 0 014 4v12H8a4 4 0 01-4-4V4zm0 0v16",copy:"M8 5h10a2 2 0 012 2v10M4 9h10a2 2 0 012 2v10H6a2 2 0 01-2-2V9z",power:"M18 6a8 8 0 11-12 0M12 2v8",stack:"M4 6h16M4 12h16M4 18h16"};function n(e){let{name:t,size:l=14,stroke:n=1.7,className:r=""}=e,i=a[t];return i?(0,s.jsx)("svg",{className:"icn ".concat(r).trim(),width:l,height:l,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round",children:(0,s.jsx)("path",{d:i})}):null}},3742:(e,t,l)=>{"use strict";l.d(t,{Z:()=>a});var s=l(5155);function a(e){let{title:t,sub:l,tools:a,flush:n,className:r="",style:i,children:c}=e,o=null!=t||null!=a;return(0,s.jsxs)("div",{className:"card ".concat(r).trim(),style:i,children:[o&&(0,s.jsxs)("div",{className:"card-head",children:[null!=t&&("string"==typeof t?(0,s.jsx)("h3",{children:t}):t),null!=l&&(0,s.jsx)("span",{className:"sub",children:l}),null!=a&&(0,s.jsx)("div",{className:"tools",children:a})]}),(0,s.jsx)("div",{className:"card-body ".concat(n?"flush":"").trim(),children:c})]})}},3928:(e,t,l)=>{"use strict";l.d(t,{f:()=>s});let s=(0,l(5959).v)(e=>({connected:!1,projects:[],activeProjectId:null,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[],config:null,sync:null,channel:null,wiki:null,wikiNote:null,setConnected:t=>e({connected:t}),setProjects:(t,l)=>e({projects:t,activeProjectId:l}),setActiveProject:t=>e({activeProjectId:t,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[]}),setOverview:t=>e({overview:t}),setLedger:t=>{var l;return e({ledger:t,wasteFlags:null!=(l=t.wasteFlags)?l:[]})},setFileIndex:t=>e({fileIndex:t}),setScheduler:(t,l,s)=>e({tasks:t,taskDefinitions:l,deadLetters:s}),setHealth:t=>e({health:t}),setLearningMemory:t=>e({learningMemory:t}),setActionLog:t=>e({actionLog:t}),setBugs:t=>e({bugs:t}),setWasteFlags:t=>e({wasteFlags:t}),setDesignImages:t=>e({designImages:t}),setConfig:t=>e({config:t}),setSync:t=>e({sync:t}),setChannel:t=>e({channel:t}),setWiki:t=>e({wiki:t}),setWikiNote:t=>e({wikiNote:t})}))},5959:(e,t,l)=>{"use strict";l.d(t,{v:()=>r});var s=l(2115);let a=e=>{let t,l=new Set,s=(e,s)=>{let a="function"==typeof e?e(t):e;if(!Object.is(a,t)){let e=t;t=(null!=s?s:"object"!=typeof a||null===a)?a:Object.assign({},t,a),l.forEach(l=>l(t,e))}},a=()=>t,n={setState:s,getState:a,getInitialState:()=>r,subscribe:e=>(l.add(e),()=>l.delete(e))},r=t=e(s,a,n);return n},n=e=>{let t=(e=>e?a(e):a)(e),l=e=>(function(e,t=e=>e){let l=s.useSyncExternalStore(e.subscribe,s.useCallback(()=>t(e.getState()),[e,t]),s.useCallback(()=>t(e.getInitialState()),[e,t]));return s.useDebugValue(l),l})(t,e);return Object.assign(l,t),l},r=e=>e?n(e):n},6845:(e,t,l)=>{"use strict";l.d(t,{t:()=>n});var s=l(5155),a=l(1044);function n(e){let{icon:t,variant:l,size:n,className:r="",children:i,...c}=e,o=["btn"];return l&&o.push(l),n&&o.push(n),r&&o.push(r),(0,s.jsxs)("button",{className:o.join(" "),...c,children:[t&&(0,s.jsx)(a.I,{name:t}),i]})}},7e3:(e,t,l)=>{"use strict";function s(e){return e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":String(e)}function a(e){if(!e||e<=0)return"—";let t=Math.floor(e/1e3),l=Math.floor(t/60),s=Math.floor(l/60);return s>0?s+"h "+l%60+"m":l>0?l+"m "+t%60+"s":t+"s"}function n(e){if(!e)return"—";try{let t=new Date(e);return t.toLocaleDateString()+" "+t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch(t){return e}}l.d(t,{Y0:()=>a,aT:()=>s,r6:()=>n})},7125:(e,t,l)=>{"use strict";l.d(t,{v:()=>a});var s=l(5155);function a(e){let{tone:t="",children:l,className:a=""}=e;return(0,s.jsx)("span",{className:"chip ".concat(t," ").concat(a).trim(),children:l})}},8032:(e,t,l)=>{"use strict";l.r(t),l.d(t,{default:()=>m});var s=l(5155),a=l(2115),n=l(3928),r=l(3742),i=l(7125),c=l(6845),o=l(1044),d=l(7e3);function h(e){return!!e.fixDescription&&e.fixDescription.trim().length>0}function u(){let e=(0,n.f)(e=>e.bugs),[t,l]=(0,a.useState)(""),[u,m]=(0,a.useState)("all"),[v,M]=(0,a.useState)([]),[g,x]=(0,a.useState)(null),f=(0,a.useMemo)(()=>{let t=new Set;return e.forEach(e=>{var l;return null==(l=e.tags)?void 0:l.forEach(e=>t.add(e))}),Array.from(t).sort()},[e]),j=(0,a.useMemo)(()=>e.filter(e=>{var l;return!("open"===u&&h(e))&&("fixed"!==u||!!h(e))&&(!t||!!((null==(l=e.errorMessage)?void 0:l.toLowerCase().includes(t.toLowerCase()))||e.id.toLowerCase().includes(t.toLowerCase())))&&(!v.length||!!v.every(t=>e.tags.includes(t)))}),[e,t,u,v]),p=e.filter(e=>!h(e)).length;return(0,s.jsxs)("div",{className:"page",children:[(0,s.jsxs)("div",{className:"page-head",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"page-title",children:"Bug memory"}),(0,s.jsxs)("p",{className:"page-sub",children:[e.length," bugs \xb7 ",p," open"]})]}),(0,s.jsx)("div",{className:"page-actions",children:(0,s.jsx)(c.t,{icon:"plus",variant:"primary",disabled:!0,title:"Write endpoint coming soon",children:"Log bug"})})]}),(0,s.jsx)(r.Z,{title:(0,s.jsxs)("div",{className:"row",style:{flex:1,gap:10,flexWrap:"wrap"},children:[(0,s.jsxs)("div",{className:"row",style:{maxWidth:280,flex:1},children:[(0,s.jsx)(o.I,{name:"search",size:12,className:"muted"}),(0,s.jsx)("input",{value:t,onChange:e=>l(e.target.value),placeholder:"Search bugs…","aria-label":"Search bugs",style:{flex:1,background:"transparent",border:0,color:"var(--fg-0)",fontSize:11.5,outline:"none",fontFamily:"var(--font-mono), monospace"}})]}),(0,s.jsx)("div",{className:"seg",children:["all","open","fixed"].map(e=>(0,s.jsx)("button",{type:"button",className:u===e?"on":"",onClick:()=>m(e),children:e},e))}),(0,s.jsx)("div",{className:"row tight",style:{flexWrap:"wrap"},children:f.map(e=>(0,s.jsx)("button",{type:"button",onClick:()=>{M(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},children:(0,s.jsxs)(i.v,{tone:v.includes(e)?"accent":"",children:["#",e]})},e))})]}),flush:!0,children:0===j.length?(0,s.jsx)("div",{className:"empty",children:(0,s.jsx)("h4",{children:"No bugs match"})}):(0,s.jsxs)("table",{className:"tbl",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{}),(0,s.jsx)("th",{children:"ID"}),(0,s.jsx)("th",{children:"Error"}),(0,s.jsx)("th",{children:"Tags"}),(0,s.jsx)("th",{children:"File"}),(0,s.jsx)("th",{children:"Root cause"}),(0,s.jsx)("th",{className:"right",children:"When"})]})}),(0,s.jsx)("tbody",{children:j.map(e=>{let t=h(e),l=g===e.id;return(0,s.jsxs)(a.Fragment,{children:[(0,s.jsxs)("tr",{onClick:()=>x(l?null:e.id),style:{cursor:"pointer"},children:[(0,s.jsx)("td",{children:t?(0,s.jsx)(i.v,{tone:"accent",children:"fixed"}):(0,s.jsx)(i.v,{tone:"red",children:"open"})}),(0,s.jsx)("td",{className:"mono",children:e.id}),(0,s.jsx)("td",{className:"strong",style:{maxWidth:280,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.errorMessage}),(0,s.jsx)("td",{children:(0,s.jsx)("div",{className:"row tight",style:{flexWrap:"wrap"},children:e.tags.map(e=>(0,s.jsxs)(i.v,{children:["#",e]},e))})}),(0,s.jsxs)("td",{className:"mono muted",style:{fontSize:10.5},children:[e.filePath,e.lineNumber?":".concat(e.lineNumber):""]}),(0,s.jsx)("td",{className:"muted",style:{maxWidth:260,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.rootCause}),(0,s.jsx)("td",{className:"right mono muted",children:(0,d.r6)(e.lastSeenAt)})]}),l&&(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:7,style:{background:"var(--bg-2)",padding:"12px 14px"},children:(0,s.jsxs)("div",{className:"vstack",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"muted",style:{fontSize:10,textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:600,marginBottom:4},children:"Root cause"}),(0,s.jsx)("div",{children:e.rootCause||"—"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"muted",style:{fontSize:10,textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:600,marginBottom:4},children:"Fix"}),(0,s.jsx)("div",{children:e.fixDescription||(0,s.jsx)("span",{className:"muted",children:"not fixed yet"})})]}),(0,s.jsxs)("div",{className:"mono muted",style:{fontSize:11},children:["seen ",e.occurrenceCount,"\xd7 \xb7 created ",(0,d.r6)(e.createdAt)]})]})})})]},e.id)})})]})})]})}function m(){return(0,s.jsx)(u,{})}}},e=>{e.O(0,[441,255,358],()=>e(e.s=1008)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[24],{1044:(e,t,n)=>{"use strict";n.d(t,{I:()=>i});var a=n(5155);let s={pulse:"M2 12h4l2-7 4 14 2-7h6",activity:"M22 12h-4l-3 9L9 3l-3 9H2",layers:"M12 2l10 6-10 6L2 8l10-6zm0 10l10 6-10 6L2 18l10-6z",database:"M4 5a8 3 0 1016 0 8 3 0 10-16 0v14a8 3 0 0016 0V5",sparkles:"M12 3l1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5zM20 15l.8 2.2L23 18l-2.2.8L20 21l-.8-2.2L17 18l2.2-.8z",brain:"M12 4a4 4 0 00-4 4v1a3 3 0 00-2 5.5A3 3 0 008 19a4 4 0 004 2 4 4 0 004-2 3 3 0 002-4.5A3 3 0 0016 9V8a4 4 0 00-4-4z",bug:"M8 8V6a4 4 0 018 0v2M4 13h16M12 8v13M7 21s-3-2-3-8M17 21s3-2 3-8M8 9l-4-3M16 9l4-3M8 13l-4 3M16 13l4 3",file:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6z",folder:"M3 7a2 2 0 012-2h4l2 2h8a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V7z",clock:"M12 22a10 10 0 100-20 10 10 0 000 20zm0-16v6l4 2",alert:"M12 2l11 20H1L12 2zm0 7v5m0 4v0",settings:"M12 15a3 3 0 100-6 3 3 0 000 6zm8-3l2-1-2-4-2 1-1-1V4h-4v1l-1 1-2-1-2 4 2 1v2l-2 1 2 4 2-1 1 1v1h4v-1l1-1 2 1 2-4-2-1v-2z",link:"M10 13a5 5 0 007 0l3-3a5 5 0 00-7-7l-1 1M14 11a5 5 0 00-7 0l-3 3a5 5 0 007 7l1-1",git:"M6 3v12M6 15a3 3 0 110 6 3 3 0 010-6zm0-12a3 3 0 110 6 3 3 0 010-6zm12 6a3 3 0 110 6 3 3 0 010-6zM18 9v2a2 2 0 01-2 2H9",discord:"M9 14a1 1 0 100-2 1 1 0 000 2zm6 0a1 1 0 100-2 1 1 0 000 2zM7 7l2-1h6l2 1 2 5-1 5-3 1-1-2-4 0-1 2-3-1-1-5z",chev:"M9 6l6 6-6 6",chevDown:"M6 9l6 6 6-6",play:"M6 4l14 8-14 8z",pause:"M7 4h4v16H7zM13 4h4v16h-4z",stop:"M6 6h12v12H6z",plus:"M12 5v14M5 12h14",search:"M21 21l-5-5m2-6a8 8 0 11-16 0 8 8 0 0116 0z",refresh:"M3 12a9 9 0 019-9c2.5 0 4.7 1 6.3 2.7M21 3v5h-5M21 12a9 9 0 01-9 9c-2.5 0-4.7-1-6.3-2.7M3 21v-5h5",dots:"M5 12a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0z",check:"M20 6L9 17l-5-5",x:"M6 6l12 12M6 18L18 6",download:"M12 3v13m0 0l-5-5m5 5l5-5M4 21h16",upload:"M12 21V8m0 0l-5 5m5-5l5 5M4 3h16",arrowUp:"M12 19V5m0 0l-7 7m7-7l7 7",arrowDown:"M12 5v14m0 0l-7-7m7 7l7-7",trash:"M4 7h16M10 7V4h4v3m-6 0v13h8V7",home:"M3 12l9-9 9 9M5 10v10h14V10",command:"M6 3a3 3 0 013 3v12a3 3 0 11-3-3h12a3 3 0 113 3V6a3 3 0 11-3 3H6",archive:"M3 7h18v4H3zM5 11v9h14v-9M10 14h4",terminal:"M4 5h16v14H4zM8 9l3 3-3 3M13 15h4",wand:"M15 4V2m0 14v-2m-7-7h2M22 9h-2M5.6 5.6l1.4 1.4M18.4 5.6L17 7m0 10l1.4 1.4M7 17l-1.4 1.4M14 7l-9 9 3 3 9-9",tag:"M20 13l-7 7a2 2 0 01-3 0L3 13V4h9l8 9zM7 7h.01",calendar:"M3 7h18v13H3zM3 7l0-3h18v3M8 2v4M16 2v4M3 11h18",list:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01",grid:"M3 3h8v8H3zM13 3h8v8h-8zM3 13h8v8H3zM13 13h8v8h-8z",eye:"M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12zm10 3a3 3 0 100-6 3 3 0 000 6z",chart:"M3 20h18M6 16V8M11 16V4M16 16v-6M21 16v-3",book:"M4 4h12a4 4 0 014 4v12H8a4 4 0 01-4-4V4zm0 0v16",copy:"M8 5h10a2 2 0 012 2v10M4 9h10a2 2 0 012 2v10H6a2 2 0 01-2-2V9z",power:"M18 6a8 8 0 11-12 0M12 2v8",stack:"M4 6h16M4 12h16M4 18h16"};function i(e){let{name:t,size:n=14,stroke:i=1.7,className:l=""}=e,r=s[t];return r?(0,a.jsx)("svg",{className:"icn ".concat(l).trim(),width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:i,strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("path",{d:r})}):null}},2327:(e,t,n)=>{"use strict";async function a(e,t){let n=t?"".concat(e).concat(e.includes("?")?"&":"?","project=").concat(encodeURIComponent(t)):e,a=await fetch(n);if(!a.ok)throw Error("API error ".concat(a.status,": ").concat(e));return a.json()}function s(){return a("/api/projects")}function i(e){return a("/api/overview",e)}function l(e){return a("/api/token-ledger",e)}function r(e){return a("/api/file-index",e)}function c(e){return a("/api/scheduler",e)}function o(e){return a("/api/learning-memory",e)}function d(e){return a("/api/action-log",e)}function u(e){return a("/api/bugs",e)}function h(e){return a("/api/design",e)}async function v(e){return(await fetch("/api/switch-project",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:e})})).json()}async function p(e,t){let n=t?"?project=".concat(encodeURIComponent(t)):"";return(await fetch("/api/tasks/".concat(encodeURIComponent(e),"/run").concat(n),{method:"POST"})).json()}async function m(e,t){let n=t?"?project=".concat(encodeURIComponent(t)):"";return(await fetch("/api/dead-letter/".concat(encodeURIComponent(e),"/retry").concat(n),{method:"POST"})).json()}async function g(e){let t=e?"?project=".concat(encodeURIComponent(e)):"";return(await fetch("/api/rescan".concat(t),{method:"POST"})).json()}async function f(){return(await fetch("/api/daemon/start",{method:"POST"})).json()}async function j(){return(await fetch("/api/daemon/stop",{method:"POST"})).json()}async function y(){return(await fetch("/api/daemon/restart",{method:"POST"})).json()}function M(){return a("/api/config")}async function x(e,t){return(await fetch("/api/config/set",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e,value:t})})).json()}async function w(e,t){return(await fetch("/api/config/reset",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e,all:t})})).json()}function S(){return a("/api/sync")}async function b(){return(await fetch("/api/sync/pull",{method:"POST"})).json()}async function k(){return(await fetch("/api/sync/push",{method:"POST"})).json()}async function N(){return(await fetch("/api/sync/disconnect",{method:"POST"})).json()}function C(){return a("/api/channel")}async function z(){return(await fetch("/api/channel/start",{method:"POST"})).json()}async function P(){return(await fetch("/api/channel/stop",{method:"POST"})).json()}async function O(){return(await fetch("/api/channel/restart",{method:"POST"})).json()}function I(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new URLSearchParams;null!=e.limit&&t.set("limit",String(e.limit)),e.category&&t.set("category",e.category);let n=t.toString();return a("/api/wiki".concat(n?"?".concat(n):""))}function T(e){return a("/api/wiki/note?path=".concat(encodeURIComponent(e)))}function L(e){let t={"Content-Type":"application/json"};return e&&(t["X-Mink-Dedup-Key"]=e),t}async function V(e){return(await fetch("/api/wiki/notes",{method:"POST",headers:L(e.dedupKey),body:JSON.stringify({mode:e.mode,title:e.title,category:e.category,body:e.body,tags:e.tags})})).json()}async function H(e,t){return(await fetch("/api/wiki/daily",{method:"POST",headers:L(t),body:JSON.stringify({content:e})})).json()}async function D(e){return(await fetch("/api/wiki/ingest",{method:"POST",headers:L(e.dedupKey),body:JSON.stringify({sourcePath:e.sourcePath,category:e.category,tags:e.tags})})).json()}n.d(t,{$Z:()=>O,Aq:()=>N,D:()=>I,Dz:()=>M,EP:()=>i,FW:()=>w,G1:()=>C,Gs:()=>S,Iw:()=>H,MP:()=>u,On:()=>z,P:()=>p,Vo:()=>l,WH:()=>P,Z4:()=>m,ZN:()=>T,ab:()=>y,co:()=>o,e2:()=>c,fX:()=>f,hD:()=>g,hY:()=>h,jm:()=>b,kH:()=>k,p4:()=>V,pu:()=>d,tf:()=>D,vj:()=>s,vo:()=>j,xl:()=>r,yJ:()=>x,yP:()=>v})},2346:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>v});var a=n(5155),s=n(2115),i=n(3742),l=n(7125),r=n(6845),c=n(3928),o=n(2327);let d=[];function u(){return"undefined"!=typeof crypto&&"randomUUID"in crypto?crypto.randomUUID():"dedup-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2))}function h(){let[e,t]=(0,s.useState)("quick"),n=(0,c.f)(e=>{var t,n;return null!=(n=null==(t=e.wiki)?void 0:t.tags)?n:d}),[h,v]=(0,s.useState)(""),[p,m]=(0,s.useState)(""),[g,f]=(0,s.useState)("inbox"),[j,y]=(0,s.useState)(""),[M,x]=(0,s.useState)(""),[w,S]=(0,s.useState)(""),[b,k]=(0,s.useState)(""),[N,C]=(0,s.useState)("resources"),[z,P]=(0,s.useState)("idle"),[O,I]=(0,s.useState)(null),[T,L]=(0,s.useState)(null);async function V(e){P("saving"),I(null);try{var t,n;let a=await e();a.success?(P("saved"),L(null!=(t=a.filePath)?t:null),setTimeout(()=>P(e=>"saved"===e?"idle":e),2e3)):(P("error"),I(null!=(n=a.error)?n:"Save failed"))}catch(e){P("error"),I(e instanceof Error?e.message:String(e))}}function H(){let e=h.trim();if(!e)return;let t=u();V(()=>(0,o.p4)({mode:"quick",body:e,dedupKey:t})).then(()=>v(""))}function D(){let e=w.trim();if(!e)return;let t=u();V(()=>(0,o.Iw)(e,t)).then(()=>S(""))}function U(){return"saved"===z&&T?(0,a.jsxs)("div",{className:"muted",style:{fontSize:11,color:"var(--accent)"},children:["Saved → ",(0,a.jsx)("span",{className:"mono",children:T})]}):"error"===z&&O?(0,a.jsx)("div",{style:{fontSize:11,color:"var(--danger, #c33)",whiteSpace:"pre-wrap"},children:O}):"saving"===z?(0,a.jsx)("div",{className:"muted",style:{fontSize:11},children:"Saving…"}):null}return(0,a.jsxs)("div",{className:"page",style:{maxWidth:900},children:[(0,a.jsx)("div",{className:"page-head",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"page-title row tight",children:(0,a.jsx)("span",{children:"Capture"})}),(0,a.jsx)("p",{className:"page-sub",children:"Quick or structured — captures land in the vault immediately"})]})}),(0,a.jsxs)(i.Z,{children:[(0,a.jsx)("div",{className:"seg",style:{marginBottom:12},children:["quick","structured","daily","file"].map(n=>(0,a.jsx)("button",{type:"button",className:e===n?"on":"",onClick:()=>t(n),children:"file"===n?"Ingest file":"daily"===n?"Daily journal":n[0].toUpperCase()+n.slice(1)},n))}),"quick"===e&&(0,a.jsxs)("div",{className:"vstack",children:[(0,a.jsxs)("div",{className:"field",children:[(0,a.jsx)("label",{children:"Quick capture"}),(0,a.jsx)("textarea",{rows:4,value:h,onChange:e=>v(e.target.value),placeholder:"What's on your mind? First line becomes the title; lands in inbox/.",onKeyDown:e=>{"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&H()}}),(0,a.jsxs)("div",{className:"hint",children:["Lands in ",(0,a.jsx)("span",{className:"mono",children:"inbox/"}),". Cmd/Ctrl+Enter to save."]})]}),(0,a.jsxs)("div",{className:"row tight",children:[(0,a.jsx)(r.t,{variant:"primary",icon:"plus",onClick:H,disabled:"saving"===z||!h.trim(),children:"saving"===z?"Saving…":"Capture"}),(0,a.jsx)(U,{})]})]}),"structured"===e&&(0,a.jsxs)("div",{className:"grid g-2",children:[(0,a.jsxs)("div",{className:"field",children:[(0,a.jsx)("label",{children:"Title"}),(0,a.jsx)("input",{value:p,onChange:e=>m(e.target.value),placeholder:"e.g. JWT Cookie Pattern"})]}),(0,a.jsxs)("div",{className:"field",children:[(0,a.jsx)("label",{children:"Category"}),(0,a.jsxs)("select",{value:g,onChange:e=>f(e.target.value),children:[(0,a.jsx)("option",{value:"inbox",children:"inbox"}),(0,a.jsx)("option",{value:"projects",children:"projects"}),(0,a.jsx)("option",{value:"areas",children:"areas"}),(0,a.jsx)("option",{value:"resources",children:"resources"}),(0,a.jsx)("option",{value:"archives",children:"archives"})]})]}),(0,a.jsxs)("div",{className:"field",style:{gridColumn:"span 2"},children:[(0,a.jsx)("label",{children:"Body (markdown)"}),(0,a.jsx)("textarea",{rows:6,className:"mono",value:j,onChange:e=>y(e.target.value),placeholder:"## Context\n\nUse httpOnly cookies for token storage..."})]}),(0,a.jsxs)("div",{className:"field",style:{gridColumn:"span 2"},children:[(0,a.jsx)("label",{children:"Tags (comma-separated)"}),(0,a.jsx)("input",{value:M,onChange:e=>x(e.target.value),placeholder:"auth, security, pattern"})]}),(0,a.jsxs)("div",{style:{gridColumn:"span 2"},className:"row tight",children:[(0,a.jsx)(r.t,{variant:"primary",icon:"plus",onClick:function(){let e=j.trim();if(!e)return;let t=u();V(()=>(0,o.p4)({mode:"structured",title:p.trim(),category:g,body:e,tags:M.split(",").map(e=>e.trim().replace(/^#/,"")).filter(Boolean),dedupKey:t})).then(()=>{m(""),y(""),x("")})},disabled:"saving"===z||!j.trim(),children:"saving"===z?"Saving…":"Create note"}),(0,a.jsx)(U,{})]})]}),"daily"===e&&(0,a.jsxs)("div",{className:"vstack",children:[(0,a.jsxs)("div",{className:"field",children:[(0,a.jsx)("label",{children:"Today"}),(0,a.jsx)("textarea",{rows:5,value:w,onChange:e=>S(e.target.value),placeholder:"Append to today's daily entry…",onKeyDown:e=>{"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&D()}})]}),(0,a.jsxs)("div",{className:"row tight",children:[(0,a.jsx)(r.t,{variant:"primary",icon:"plus",onClick:D,disabled:"saving"===z||!w.trim(),children:"saving"===z?"Saving…":"Append"}),(0,a.jsx)(U,{})]})]}),"file"===e&&(0,a.jsxs)("div",{className:"vstack",children:[(0,a.jsxs)("div",{className:"field",children:[(0,a.jsx)("label",{children:"Source file"}),(0,a.jsx)("input",{value:b,onChange:e=>k(e.target.value),placeholder:"./scratch-notes.md",className:"mono"})]}),(0,a.jsxs)("div",{className:"field",children:[(0,a.jsx)("label",{children:"Category"}),(0,a.jsxs)("select",{value:N,onChange:e=>C(e.target.value),children:[(0,a.jsx)("option",{value:"resources",children:"resources"}),(0,a.jsx)("option",{value:"inbox",children:"inbox"}),(0,a.jsx)("option",{value:"projects",children:"projects"}),(0,a.jsx)("option",{value:"archives",children:"archives"})]})]}),(0,a.jsxs)("div",{className:"row tight",children:[(0,a.jsx)(r.t,{variant:"primary",icon:"upload",onClick:function(){let e=b.trim();if(!e)return;let t=u();V(()=>(0,o.tf)({sourcePath:e,category:N,dedupKey:t})).then(()=>k(""))},disabled:"saving"===z||!b.trim(),children:"saving"===z?"Ingesting…":"Ingest"}),(0,a.jsx)(U,{})]})]})]}),(0,a.jsx)("div",{style:{height:14}}),(0,a.jsx)(i.Z,{title:"Tag cloud",sub:"top tags across the vault",children:(0,a.jsx)("div",{className:"row tight",style:{flexWrap:"wrap",gap:6},children:0===n.length?(0,a.jsx)("span",{className:"muted",style:{fontSize:11},children:"No tags yet — capture a note to get started."}):n.slice(0,40).map(e=>{let[t,n]=e;return(0,a.jsxs)(l.v,{children:[(0,a.jsxs)("span",{children:["#",t]}),(0,a.jsx)("span",{className:"muted",children:n})]},t)})})})]})}function v(){return(0,a.jsx)(h,{})}},3742:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var a=n(5155);function s(e){let{title:t,sub:n,tools:s,flush:i,className:l="",style:r,children:c}=e,o=null!=t||null!=s;return(0,a.jsxs)("div",{className:"card ".concat(l).trim(),style:r,children:[o&&(0,a.jsxs)("div",{className:"card-head",children:[null!=t&&("string"==typeof t?(0,a.jsx)("h3",{children:t}):t),null!=n&&(0,a.jsx)("span",{className:"sub",children:n}),null!=s&&(0,a.jsx)("div",{className:"tools",children:s})]}),(0,a.jsx)("div",{className:"card-body ".concat(i?"flush":"").trim(),children:c})]})}},3928:(e,t,n)=>{"use strict";n.d(t,{f:()=>a});let a=(0,n(5959).v)(e=>({connected:!1,projects:[],activeProjectId:null,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[],config:null,sync:null,channel:null,wiki:null,wikiNote:null,setConnected:t=>e({connected:t}),setProjects:(t,n)=>e({projects:t,activeProjectId:n}),setActiveProject:t=>e({activeProjectId:t,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[]}),setOverview:t=>e({overview:t}),setLedger:t=>{var n;return e({ledger:t,wasteFlags:null!=(n=t.wasteFlags)?n:[]})},setFileIndex:t=>e({fileIndex:t}),setScheduler:(t,n,a)=>e({tasks:t,taskDefinitions:n,deadLetters:a}),setHealth:t=>e({health:t}),setLearningMemory:t=>e({learningMemory:t}),setActionLog:t=>e({actionLog:t}),setBugs:t=>e({bugs:t}),setWasteFlags:t=>e({wasteFlags:t}),setDesignImages:t=>e({designImages:t}),setConfig:t=>e({config:t}),setSync:t=>e({sync:t}),setChannel:t=>e({channel:t}),setWiki:t=>e({wiki:t}),setWikiNote:t=>e({wikiNote:t})}))},5959:(e,t,n)=>{"use strict";n.d(t,{v:()=>l});var a=n(2115);let s=e=>{let t,n=new Set,a=(e,a)=>{let s="function"==typeof e?e(t):e;if(!Object.is(s,t)){let e=t;t=(null!=a?a:"object"!=typeof s||null===s)?s:Object.assign({},t,s),n.forEach(n=>n(t,e))}},s=()=>t,i={setState:a,getState:s,getInitialState:()=>l,subscribe:e=>(n.add(e),()=>n.delete(e))},l=t=e(a,s,i);return i},i=e=>{let t=(e=>e?s(e):s)(e),n=e=>(function(e,t=e=>e){let n=a.useSyncExternalStore(e.subscribe,a.useCallback(()=>t(e.getState()),[e,t]),a.useCallback(()=>t(e.getInitialState()),[e,t]));return a.useDebugValue(n),n})(t,e);return Object.assign(n,t),n},l=e=>e?i(e):i},6845:(e,t,n)=>{"use strict";n.d(t,{t:()=>i});var a=n(5155),s=n(1044);function i(e){let{icon:t,variant:n,size:i,className:l="",children:r,...c}=e,o=["btn"];return n&&o.push(n),i&&o.push(i),l&&o.push(l),(0,a.jsxs)("button",{className:o.join(" "),...c,children:[t&&(0,a.jsx)(s.I,{name:t}),r]})}},7125:(e,t,n)=>{"use strict";n.d(t,{v:()=>s});var a=n(5155);function s(e){let{tone:t="",children:n,className:s=""}=e;return(0,a.jsx)("span",{className:"chip ".concat(t," ").concat(s).trim(),children:n})}},9993:(e,t,n)=>{Promise.resolve().then(n.bind(n,2346))}},e=>{e.O(0,[441,255,358],()=>e(e.s=9993)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[748],{1044:(e,t,n)=>{"use strict";n.d(t,{I:()=>i});var a=n(5155);let s={pulse:"M2 12h4l2-7 4 14 2-7h6",activity:"M22 12h-4l-3 9L9 3l-3 9H2",layers:"M12 2l10 6-10 6L2 8l10-6zm0 10l10 6-10 6L2 18l10-6z",database:"M4 5a8 3 0 1016 0 8 3 0 10-16 0v14a8 3 0 0016 0V5",sparkles:"M12 3l1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5zM20 15l.8 2.2L23 18l-2.2.8L20 21l-.8-2.2L17 18l2.2-.8z",brain:"M12 4a4 4 0 00-4 4v1a3 3 0 00-2 5.5A3 3 0 008 19a4 4 0 004 2 4 4 0 004-2 3 3 0 002-4.5A3 3 0 0016 9V8a4 4 0 00-4-4z",bug:"M8 8V6a4 4 0 018 0v2M4 13h16M12 8v13M7 21s-3-2-3-8M17 21s3-2 3-8M8 9l-4-3M16 9l4-3M8 13l-4 3M16 13l4 3",file:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6z",folder:"M3 7a2 2 0 012-2h4l2 2h8a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V7z",clock:"M12 22a10 10 0 100-20 10 10 0 000 20zm0-16v6l4 2",alert:"M12 2l11 20H1L12 2zm0 7v5m0 4v0",settings:"M12 15a3 3 0 100-6 3 3 0 000 6zm8-3l2-1-2-4-2 1-1-1V4h-4v1l-1 1-2-1-2 4 2 1v2l-2 1 2 4 2-1 1 1v1h4v-1l1-1 2 1 2-4-2-1v-2z",link:"M10 13a5 5 0 007 0l3-3a5 5 0 00-7-7l-1 1M14 11a5 5 0 00-7 0l-3 3a5 5 0 007 7l1-1",git:"M6 3v12M6 15a3 3 0 110 6 3 3 0 010-6zm0-12a3 3 0 110 6 3 3 0 010-6zm12 6a3 3 0 110 6 3 3 0 010-6zM18 9v2a2 2 0 01-2 2H9",discord:"M9 14a1 1 0 100-2 1 1 0 000 2zm6 0a1 1 0 100-2 1 1 0 000 2zM7 7l2-1h6l2 1 2 5-1 5-3 1-1-2-4 0-1 2-3-1-1-5z",chev:"M9 6l6 6-6 6",chevDown:"M6 9l6 6 6-6",play:"M6 4l14 8-14 8z",pause:"M7 4h4v16H7zM13 4h4v16h-4z",stop:"M6 6h12v12H6z",plus:"M12 5v14M5 12h14",search:"M21 21l-5-5m2-6a8 8 0 11-16 0 8 8 0 0116 0z",refresh:"M3 12a9 9 0 019-9c2.5 0 4.7 1 6.3 2.7M21 3v5h-5M21 12a9 9 0 01-9 9c-2.5 0-4.7-1-6.3-2.7M3 21v-5h5",dots:"M5 12a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0z",check:"M20 6L9 17l-5-5",x:"M6 6l12 12M6 18L18 6",download:"M12 3v13m0 0l-5-5m5 5l5-5M4 21h16",upload:"M12 21V8m0 0l-5 5m5-5l5 5M4 3h16",arrowUp:"M12 19V5m0 0l-7 7m7-7l7 7",arrowDown:"M12 5v14m0 0l-7-7m7 7l7-7",trash:"M4 7h16M10 7V4h4v3m-6 0v13h8V7",home:"M3 12l9-9 9 9M5 10v10h14V10",command:"M6 3a3 3 0 013 3v12a3 3 0 11-3-3h12a3 3 0 113 3V6a3 3 0 11-3 3H6",archive:"M3 7h18v4H3zM5 11v9h14v-9M10 14h4",terminal:"M4 5h16v14H4zM8 9l3 3-3 3M13 15h4",wand:"M15 4V2m0 14v-2m-7-7h2M22 9h-2M5.6 5.6l1.4 1.4M18.4 5.6L17 7m0 10l1.4 1.4M7 17l-1.4 1.4M14 7l-9 9 3 3 9-9",tag:"M20 13l-7 7a2 2 0 01-3 0L3 13V4h9l8 9zM7 7h.01",calendar:"M3 7h18v13H3zM3 7l0-3h18v3M8 2v4M16 2v4M3 11h18",list:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01",grid:"M3 3h8v8H3zM13 3h8v8h-8zM3 13h8v8H3zM13 13h8v8h-8z",eye:"M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12zm10 3a3 3 0 100-6 3 3 0 000 6z",chart:"M3 20h18M6 16V8M11 16V4M16 16v-6M21 16v-3",book:"M4 4h12a4 4 0 014 4v12H8a4 4 0 01-4-4V4zm0 0v16",copy:"M8 5h10a2 2 0 012 2v10M4 9h10a2 2 0 012 2v10H6a2 2 0 01-2-2V9z",power:"M18 6a8 8 0 11-12 0M12 2v8",stack:"M4 6h16M4 12h16M4 18h16"};function i(e){let{name:t,size:n=14,stroke:i=1.7,className:r=""}=e,l=s[t];return l?(0,a.jsx)("svg",{className:"icn ".concat(r).trim(),width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:i,strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("path",{d:l})}):null}},2327:(e,t,n)=>{"use strict";async function a(e,t){let n=t?"".concat(e).concat(e.includes("?")?"&":"?","project=").concat(encodeURIComponent(t)):e,a=await fetch(n);if(!a.ok)throw Error("API error ".concat(a.status,": ").concat(e));return a.json()}function s(){return a("/api/projects")}function i(e){return a("/api/overview",e)}function r(e){return a("/api/token-ledger",e)}function l(e){return a("/api/file-index",e)}function o(e){return a("/api/scheduler",e)}function c(e){return a("/api/learning-memory",e)}function u(e){return a("/api/action-log",e)}function d(e){return a("/api/bugs",e)}function h(e){return a("/api/design",e)}async function v(e){return(await fetch("/api/switch-project",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:e})})).json()}async function p(e,t){let n=t?"?project=".concat(encodeURIComponent(t)):"";return(await fetch("/api/tasks/".concat(encodeURIComponent(e),"/run").concat(n),{method:"POST"})).json()}async function f(e,t){let n=t?"?project=".concat(encodeURIComponent(t)):"";return(await fetch("/api/dead-letter/".concat(encodeURIComponent(e),"/retry").concat(n),{method:"POST"})).json()}async function m(e){let t=e?"?project=".concat(encodeURIComponent(e)):"";return(await fetch("/api/rescan".concat(t),{method:"POST"})).json()}async function g(){return(await fetch("/api/daemon/start",{method:"POST"})).json()}async function M(){return(await fetch("/api/daemon/stop",{method:"POST"})).json()}async function y(){return(await fetch("/api/daemon/restart",{method:"POST"})).json()}function j(){return a("/api/config")}async function x(e,t){return(await fetch("/api/config/set",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e,value:t})})).json()}async function w(e,t){return(await fetch("/api/config/reset",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e,all:t})})).json()}function b(){return a("/api/sync")}async function k(){return(await fetch("/api/sync/pull",{method:"POST"})).json()}async function S(){return(await fetch("/api/sync/push",{method:"POST"})).json()}async function z(){return(await fetch("/api/sync/disconnect",{method:"POST"})).json()}function N(){return a("/api/channel")}async function O(){return(await fetch("/api/channel/start",{method:"POST"})).json()}async function P(){return(await fetch("/api/channel/stop",{method:"POST"})).json()}async function T(){return(await fetch("/api/channel/restart",{method:"POST"})).json()}function C(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new URLSearchParams;null!=e.limit&&t.set("limit",String(e.limit)),e.category&&t.set("category",e.category);let n=t.toString();return a("/api/wiki".concat(n?"?".concat(n):""))}function I(e){return a("/api/wiki/note?path=".concat(encodeURIComponent(e)))}function L(e){let t={"Content-Type":"application/json"};return e&&(t["X-Mink-Dedup-Key"]=e),t}async function H(e){return(await fetch("/api/wiki/notes",{method:"POST",headers:L(e.dedupKey),body:JSON.stringify({mode:e.mode,title:e.title,category:e.category,body:e.body,tags:e.tags})})).json()}async function V(e,t){return(await fetch("/api/wiki/daily",{method:"POST",headers:L(t),body:JSON.stringify({content:e})})).json()}async function F(e){return(await fetch("/api/wiki/ingest",{method:"POST",headers:L(e.dedupKey),body:JSON.stringify({sourcePath:e.sourcePath,category:e.category,tags:e.tags})})).json()}n.d(t,{$Z:()=>T,Aq:()=>z,D:()=>C,Dz:()=>j,EP:()=>i,FW:()=>w,G1:()=>N,Gs:()=>b,Iw:()=>V,MP:()=>d,On:()=>O,P:()=>p,Vo:()=>r,WH:()=>P,Z4:()=>f,ZN:()=>I,ab:()=>y,co:()=>c,e2:()=>o,fX:()=>g,hD:()=>m,hY:()=>h,jm:()=>k,kH:()=>S,p4:()=>H,pu:()=>u,tf:()=>F,vj:()=>s,vo:()=>M,xl:()=>l,yJ:()=>x,yP:()=>v})},3067:(e,t,n)=>{Promise.resolve().then(n.bind(n,6411))},3742:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var a=n(5155);function s(e){let{title:t,sub:n,tools:s,flush:i,className:r="",style:l,children:o}=e,c=null!=t||null!=s;return(0,a.jsxs)("div",{className:"card ".concat(r).trim(),style:l,children:[c&&(0,a.jsxs)("div",{className:"card-head",children:[null!=t&&("string"==typeof t?(0,a.jsx)("h3",{children:t}):t),null!=n&&(0,a.jsx)("span",{className:"sub",children:n}),null!=s&&(0,a.jsx)("div",{className:"tools",children:s})]}),(0,a.jsx)("div",{className:"card-body ".concat(i?"flush":"").trim(),children:o})]})}},3928:(e,t,n)=>{"use strict";n.d(t,{f:()=>a});let a=(0,n(5959).v)(e=>({connected:!1,projects:[],activeProjectId:null,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[],config:null,sync:null,channel:null,wiki:null,wikiNote:null,setConnected:t=>e({connected:t}),setProjects:(t,n)=>e({projects:t,activeProjectId:n}),setActiveProject:t=>e({activeProjectId:t,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[]}),setOverview:t=>e({overview:t}),setLedger:t=>{var n;return e({ledger:t,wasteFlags:null!=(n=t.wasteFlags)?n:[]})},setFileIndex:t=>e({fileIndex:t}),setScheduler:(t,n,a)=>e({tasks:t,taskDefinitions:n,deadLetters:a}),setHealth:t=>e({health:t}),setLearningMemory:t=>e({learningMemory:t}),setActionLog:t=>e({actionLog:t}),setBugs:t=>e({bugs:t}),setWasteFlags:t=>e({wasteFlags:t}),setDesignImages:t=>e({designImages:t}),setConfig:t=>e({config:t}),setSync:t=>e({sync:t}),setChannel:t=>e({channel:t}),setWiki:t=>e({wiki:t}),setWikiNote:t=>e({wikiNote:t})}))},4239:(e,t,n)=>{"use strict";n.d(t,{l:()=>s});var a=n(5155);function s(e){let{on:t,onChange:n,className:s="",ariaLabel:i}=e;return(0,a.jsx)("button",{type:"button",role:"switch","aria-checked":t,"aria-label":i,className:"toggle ".concat(t?"on":""," ").concat(s).trim(),onClick:()=>null==n?void 0:n(!t)})}},5959:(e,t,n)=>{"use strict";n.d(t,{v:()=>r});var a=n(2115);let s=e=>{let t,n=new Set,a=(e,a)=>{let s="function"==typeof e?e(t):e;if(!Object.is(s,t)){let e=t;t=(null!=a?a:"object"!=typeof s||null===s)?s:Object.assign({},t,s),n.forEach(n=>n(t,e))}},s=()=>t,i={setState:a,getState:s,getInitialState:()=>r,subscribe:e=>(n.add(e),()=>n.delete(e))},r=t=e(a,s,i);return i},i=e=>{let t=(e=>e?s(e):s)(e),n=e=>(function(e,t=e=>e){let n=a.useSyncExternalStore(e.subscribe,a.useCallback(()=>t(e.getState()),[e,t]),a.useCallback(()=>t(e.getInitialState()),[e,t]));return a.useDebugValue(n),n})(t,e);return Object.assign(n,t),n},r=e=>e?i(e):i},6411:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>g});var a=n(5155),s=n(2115),i=n(3742),r=n(7125),l=n(6845),o=n(1044),c=n(4239),u=n(3928),d=n(2327);let h={default:"",shared:"accent",local:"accent",env:"amber"},v={default:"default",shared:"shared",local:"local",env:"env"};function p(e){let{label:t}=e;return(0,a.jsx)("div",{style:{padding:"8px 14px",background:"var(--bg-2)",borderTop:"1px solid var(--line-1)",borderBottom:"1px solid var(--line-1)",fontSize:10.5,color:"var(--fg-3)",textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:600},children:t})}function f(e){let{entry:t}=e,[n,i]=(0,s.useState)(t.value),[o,u]=(0,s.useState)("idle"),[p,f]=(0,s.useState)(null),[m,g]=(0,s.useState)(!1),M=(0,s.useRef)(null),y=(0,s.useRef)(t.value);function j(e){u("saving"),f(null),(0,d.yJ)(t.key,e).then(e=>{if(e.success)u("saved"),setTimeout(()=>u(e=>"saved"===e?"idle":e),1500);else{var t;u("error"),f(null!=(t=e.error)?t:"Failed to save")}}).catch(e=>{u("error"),f(e instanceof Error?e.message:String(e))})}(0,s.useEffect)(()=>{t.value!==y.current&&(y.current=t.value,"saving"!==o&&i(t.value))},[t.value,o]);let x="boolean"===t.type,w=(t.isSecret,n);return(0,a.jsxs)("div",{className:"row",style:{padding:"8px 14px",borderBottom:"1px solid var(--line-1)",gap:14,alignItems:"center"},children:[(0,a.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,a.jsxs)("div",{className:"row tight",style:{gap:6},children:[(0,a.jsx)("span",{className:"mono strong",style:{fontSize:12},children:t.key}),(0,a.jsx)(r.v,{tone:h[t.source],children:v[t.source]}),t.isSecret&&(0,a.jsx)(r.v,{children:"secret"})]}),t.description&&(0,a.jsx)("div",{className:"muted",style:{fontSize:10.5,marginTop:2},children:t.description}),p&&(0,a.jsx)("div",{style:{fontSize:10.5,color:"var(--danger, #c33)",marginTop:2},children:p})]}),(0,a.jsxs)("div",{style:{width:260,display:"flex",gap:6,alignItems:"center"},children:[x?(0,a.jsx)(c.l,{on:"true"===n,onChange:function(e){let t=e?"true":"false";i(t),j(t)}}):(0,a.jsx)("input",{value:w,onChange:e=>{var t;i(t=e.target.value),M.current&&clearTimeout(M.current),M.current=setTimeout(()=>j(t),500)},type:t.isSecret&&!m?"password":"text",className:"mono","aria-label":t.key,style:{width:"100%",background:"var(--bg-inset)",border:"1px solid var(--line-1)",borderRadius:5,padding:"4px 8px",color:"var(--fg-0)",fontSize:11,outline:"none"}}),t.isSecret&&!x&&(0,a.jsx)(l.t,{size:"sm",variant:"ghost",icon:"eye",onClick:()=>g(e=>!e),title:m?"Hide":"Reveal",children:m?"Hide":"Show"}),(0,a.jsx)(l.t,{size:"sm",variant:"ghost",icon:"refresh",onClick:function(){u("saving"),f(null),(0,d.FW)(t.key).then(e=>{if(e.success)u("saved"),setTimeout(()=>u(e=>"saved"===e?"idle":e),1500);else{var t;u("error"),f(null!=(t=e.error)?t:"Failed to reset")}}).catch(e=>{u("error"),f(e instanceof Error?e.message:String(e))})},disabled:"saving"===o||"default"===t.source,title:"Reset to default",children:"saving"===o?"…":"saved"===o?"✓":"Reset"})]})]})}function m(){var e;let t=(0,u.f)(e=>e.config),[n,r]=(0,s.useState)(""),c=null!=(e=null==t?void 0:t.entries)?e:[],d=(0,s.useMemo)(()=>{let e={};for(let a of c){var t;(!n||a.key.toLowerCase().includes(n.toLowerCase()))&&(e[a.group]=null!=(t=e[a.group])?t:[]).push(a)}return e},[c,n]);return(0,a.jsxs)("div",{className:"page",style:{maxWidth:900},children:[(0,a.jsxs)("div",{className:"page-head",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"page-title row tight",children:(0,a.jsx)("span",{children:"Configuration"})}),(0,a.jsx)("p",{className:"page-sub",children:"~/.mink/config (shared) \xb7 ~/.mink/config.local (per-machine) \xb7 env vars override"})]}),(0,a.jsxs)("div",{className:"page-actions",children:[(0,a.jsx)(l.t,{icon:"download",variant:"ghost",disabled:!0,children:"Export"}),(0,a.jsx)(l.t,{icon:"upload",disabled:!0,children:"Import"})]})]}),(0,a.jsx)(i.Z,{title:"All settings",tools:(0,a.jsxs)("div",{className:"row",style:{maxWidth:220},children:[(0,a.jsx)(o.I,{name:"search",size:12,className:"muted"}),(0,a.jsx)("input",{value:n,onChange:e=>r(e.target.value),placeholder:"Filter keys…","aria-label":"Filter config keys",style:{background:"transparent",border:0,color:"var(--fg-0)",outline:"none",fontSize:11.5,flex:1,fontFamily:"var(--font-mono), monospace"}})]}),flush:!0,children:0===c.length?(0,a.jsx)("div",{className:"empty",children:(0,a.jsx)("h4",{children:"Loading configuration…"})}):0===Object.keys(d).length?(0,a.jsx)("div",{className:"empty",children:(0,a.jsx)("h4",{children:"No settings match"})}):Object.entries(d).map(e=>{let[t,n]=e;return(0,a.jsxs)("div",{children:[(0,a.jsx)(p,{label:t}),n.map(e=>(0,a.jsx)(f,{entry:e},e.key))]},t)})})]})}function g(){return(0,a.jsx)(m,{})}},6845:(e,t,n)=>{"use strict";n.d(t,{t:()=>i});var a=n(5155),s=n(1044);function i(e){let{icon:t,variant:n,size:i,className:r="",children:l,...o}=e,c=["btn"];return n&&c.push(n),i&&c.push(i),r&&c.push(r),(0,a.jsxs)("button",{className:c.join(" "),...o,children:[t&&(0,a.jsx)(s.I,{name:t}),l]})}},7125:(e,t,n)=>{"use strict";n.d(t,{v:()=>s});var a=n(5155);function s(e){let{tone:t="",children:n,className:s=""}=e;return(0,a.jsx)("span",{className:"chip ".concat(t," ").concat(s).trim(),children:n})}}},e=>{e.O(0,[441,255,358],()=>e(e.s=3067)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[666],{1044:(e,t,n)=>{"use strict";n.d(t,{I:()=>i});var s=n(5155);let a={pulse:"M2 12h4l2-7 4 14 2-7h6",activity:"M22 12h-4l-3 9L9 3l-3 9H2",layers:"M12 2l10 6-10 6L2 8l10-6zm0 10l10 6-10 6L2 18l10-6z",database:"M4 5a8 3 0 1016 0 8 3 0 10-16 0v14a8 3 0 0016 0V5",sparkles:"M12 3l1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5zM20 15l.8 2.2L23 18l-2.2.8L20 21l-.8-2.2L17 18l2.2-.8z",brain:"M12 4a4 4 0 00-4 4v1a3 3 0 00-2 5.5A3 3 0 008 19a4 4 0 004 2 4 4 0 004-2 3 3 0 002-4.5A3 3 0 0016 9V8a4 4 0 00-4-4z",bug:"M8 8V6a4 4 0 018 0v2M4 13h16M12 8v13M7 21s-3-2-3-8M17 21s3-2 3-8M8 9l-4-3M16 9l4-3M8 13l-4 3M16 13l4 3",file:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6z",folder:"M3 7a2 2 0 012-2h4l2 2h8a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V7z",clock:"M12 22a10 10 0 100-20 10 10 0 000 20zm0-16v6l4 2",alert:"M12 2l11 20H1L12 2zm0 7v5m0 4v0",settings:"M12 15a3 3 0 100-6 3 3 0 000 6zm8-3l2-1-2-4-2 1-1-1V4h-4v1l-1 1-2-1-2 4 2 1v2l-2 1 2 4 2-1 1 1v1h4v-1l1-1 2 1 2-4-2-1v-2z",link:"M10 13a5 5 0 007 0l3-3a5 5 0 00-7-7l-1 1M14 11a5 5 0 00-7 0l-3 3a5 5 0 007 7l1-1",git:"M6 3v12M6 15a3 3 0 110 6 3 3 0 010-6zm0-12a3 3 0 110 6 3 3 0 010-6zm12 6a3 3 0 110 6 3 3 0 010-6zM18 9v2a2 2 0 01-2 2H9",discord:"M9 14a1 1 0 100-2 1 1 0 000 2zm6 0a1 1 0 100-2 1 1 0 000 2zM7 7l2-1h6l2 1 2 5-1 5-3 1-1-2-4 0-1 2-3-1-1-5z",chev:"M9 6l6 6-6 6",chevDown:"M6 9l6 6 6-6",play:"M6 4l14 8-14 8z",pause:"M7 4h4v16H7zM13 4h4v16h-4z",stop:"M6 6h12v12H6z",plus:"M12 5v14M5 12h14",search:"M21 21l-5-5m2-6a8 8 0 11-16 0 8 8 0 0116 0z",refresh:"M3 12a9 9 0 019-9c2.5 0 4.7 1 6.3 2.7M21 3v5h-5M21 12a9 9 0 01-9 9c-2.5 0-4.7-1-6.3-2.7M3 21v-5h5",dots:"M5 12a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0zm6 0a1 1 0 102 0 1 1 0 00-2 0z",check:"M20 6L9 17l-5-5",x:"M6 6l12 12M6 18L18 6",download:"M12 3v13m0 0l-5-5m5 5l5-5M4 21h16",upload:"M12 21V8m0 0l-5 5m5-5l5 5M4 3h16",arrowUp:"M12 19V5m0 0l-7 7m7-7l7 7",arrowDown:"M12 5v14m0 0l-7-7m7 7l7-7",trash:"M4 7h16M10 7V4h4v3m-6 0v13h8V7",home:"M3 12l9-9 9 9M5 10v10h14V10",command:"M6 3a3 3 0 013 3v12a3 3 0 11-3-3h12a3 3 0 113 3V6a3 3 0 11-3 3H6",archive:"M3 7h18v4H3zM5 11v9h14v-9M10 14h4",terminal:"M4 5h16v14H4zM8 9l3 3-3 3M13 15h4",wand:"M15 4V2m0 14v-2m-7-7h2M22 9h-2M5.6 5.6l1.4 1.4M18.4 5.6L17 7m0 10l1.4 1.4M7 17l-1.4 1.4M14 7l-9 9 3 3 9-9",tag:"M20 13l-7 7a2 2 0 01-3 0L3 13V4h9l8 9zM7 7h.01",calendar:"M3 7h18v13H3zM3 7l0-3h18v3M8 2v4M16 2v4M3 11h18",list:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01",grid:"M3 3h8v8H3zM13 3h8v8h-8zM3 13h8v8H3zM13 13h8v8h-8z",eye:"M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12zm10 3a3 3 0 100-6 3 3 0 000 6z",chart:"M3 20h18M6 16V8M11 16V4M16 16v-6M21 16v-3",book:"M4 4h12a4 4 0 014 4v12H8a4 4 0 01-4-4V4zm0 0v16",copy:"M8 5h10a2 2 0 012 2v10M4 9h10a2 2 0 012 2v10H6a2 2 0 01-2-2V9z",power:"M18 6a8 8 0 11-12 0M12 2v8",stack:"M4 6h16M4 12h16M4 18h16"};function i(e){let{name:t,size:n=14,stroke:i=1.7,className:l=""}=e,r=a[t];return r?(0,s.jsx)("svg",{className:"icn ".concat(l).trim(),width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:i,strokeLinecap:"round",strokeLinejoin:"round",children:(0,s.jsx)("path",{d:r})}):null}},2327:(e,t,n)=>{"use strict";async function s(e,t){let n=t?"".concat(e).concat(e.includes("?")?"&":"?","project=").concat(encodeURIComponent(t)):e,s=await fetch(n);if(!s.ok)throw Error("API error ".concat(s.status,": ").concat(e));return s.json()}function a(){return s("/api/projects")}function i(e){return s("/api/overview",e)}function l(e){return s("/api/token-ledger",e)}function r(e){return s("/api/file-index",e)}function c(e){return s("/api/scheduler",e)}function o(e){return s("/api/learning-memory",e)}function d(e){return s("/api/action-log",e)}function h(e){return s("/api/bugs",e)}function u(e){return s("/api/design",e)}async function m(e){return(await fetch("/api/switch-project",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:e})})).json()}async function v(e,t){let n=t?"?project=".concat(encodeURIComponent(t)):"";return(await fetch("/api/tasks/".concat(encodeURIComponent(e),"/run").concat(n),{method:"POST"})).json()}async function f(e,t){let n=t?"?project=".concat(encodeURIComponent(t)):"";return(await fetch("/api/dead-letter/".concat(encodeURIComponent(e),"/retry").concat(n),{method:"POST"})).json()}async function p(e){let t=e?"?project=".concat(encodeURIComponent(e)):"";return(await fetch("/api/rescan".concat(t),{method:"POST"})).json()}async function g(){return(await fetch("/api/daemon/start",{method:"POST"})).json()}async function j(){return(await fetch("/api/daemon/stop",{method:"POST"})).json()}async function M(){return(await fetch("/api/daemon/restart",{method:"POST"})).json()}function y(){return s("/api/config")}async function x(e,t){return(await fetch("/api/config/set",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e,value:t})})).json()}async function w(e,t){return(await fetch("/api/config/reset",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e,all:t})})).json()}function k(){return s("/api/sync")}async function b(){return(await fetch("/api/sync/pull",{method:"POST"})).json()}async function N(){return(await fetch("/api/sync/push",{method:"POST"})).json()}async function S(){return(await fetch("/api/sync/disconnect",{method:"POST"})).json()}function z(){return s("/api/channel")}async function P(){return(await fetch("/api/channel/start",{method:"POST"})).json()}async function O(){return(await fetch("/api/channel/stop",{method:"POST"})).json()}async function T(){return(await fetch("/api/channel/restart",{method:"POST"})).json()}function C(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new URLSearchParams;null!=e.limit&&t.set("limit",String(e.limit)),e.category&&t.set("category",e.category);let n=t.toString();return s("/api/wiki".concat(n?"?".concat(n):""))}function L(e){return s("/api/wiki/note?path=".concat(encodeURIComponent(e)))}function I(e){let t={"Content-Type":"application/json"};return e&&(t["X-Mink-Dedup-Key"]=e),t}async function H(e){return(await fetch("/api/wiki/notes",{method:"POST",headers:I(e.dedupKey),body:JSON.stringify({mode:e.mode,title:e.title,category:e.category,body:e.body,tags:e.tags})})).json()}async function V(e,t){return(await fetch("/api/wiki/daily",{method:"POST",headers:I(t),body:JSON.stringify({content:e})})).json()}async function D(e){return(await fetch("/api/wiki/ingest",{method:"POST",headers:I(e.dedupKey),body:JSON.stringify({sourcePath:e.sourcePath,category:e.category,tags:e.tags})})).json()}n.d(t,{$Z:()=>T,Aq:()=>S,D:()=>C,Dz:()=>y,EP:()=>i,FW:()=>w,G1:()=>z,Gs:()=>k,Iw:()=>V,MP:()=>h,On:()=>P,P:()=>v,Vo:()=>l,WH:()=>O,Z4:()=>f,ZN:()=>L,ab:()=>M,co:()=>o,e2:()=>c,fX:()=>g,hD:()=>p,hY:()=>u,jm:()=>b,kH:()=>N,p4:()=>H,pu:()=>d,tf:()=>D,vj:()=>a,vo:()=>j,xl:()=>r,yJ:()=>x,yP:()=>m})},3742:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var s=n(5155);function a(e){let{title:t,sub:n,tools:a,flush:i,className:l="",style:r,children:c}=e,o=null!=t||null!=a;return(0,s.jsxs)("div",{className:"card ".concat(l).trim(),style:r,children:[o&&(0,s.jsxs)("div",{className:"card-head",children:[null!=t&&("string"==typeof t?(0,s.jsx)("h3",{children:t}):t),null!=n&&(0,s.jsx)("span",{className:"sub",children:n}),null!=a&&(0,s.jsx)("div",{className:"tools",children:a})]}),(0,s.jsx)("div",{className:"card-body ".concat(i?"flush":"").trim(),children:c})]})}},3928:(e,t,n)=>{"use strict";n.d(t,{f:()=>s});let s=(0,n(5959).v)(e=>({connected:!1,projects:[],activeProjectId:null,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[],config:null,sync:null,channel:null,wiki:null,wikiNote:null,setConnected:t=>e({connected:t}),setProjects:(t,n)=>e({projects:t,activeProjectId:n}),setActiveProject:t=>e({activeProjectId:t,overview:null,ledger:null,fileIndex:null,tasks:[],taskDefinitions:[],deadLetters:[],health:null,learningMemory:null,actionLog:[],bugs:[],wasteFlags:[],designImages:[]}),setOverview:t=>e({overview:t}),setLedger:t=>{var n;return e({ledger:t,wasteFlags:null!=(n=t.wasteFlags)?n:[]})},setFileIndex:t=>e({fileIndex:t}),setScheduler:(t,n,s)=>e({tasks:t,taskDefinitions:n,deadLetters:s}),setHealth:t=>e({health:t}),setLearningMemory:t=>e({learningMemory:t}),setActionLog:t=>e({actionLog:t}),setBugs:t=>e({bugs:t}),setWasteFlags:t=>e({wasteFlags:t}),setDesignImages:t=>e({designImages:t}),setConfig:t=>e({config:t}),setSync:t=>e({sync:t}),setChannel:t=>e({channel:t}),setWiki:t=>e({wiki:t}),setWikiNote:t=>e({wikiNote:t})}))},4239:(e,t,n)=>{"use strict";n.d(t,{l:()=>a});var s=n(5155);function a(e){let{on:t,onChange:n,className:a="",ariaLabel:i}=e;return(0,s.jsx)("button",{type:"button",role:"switch","aria-checked":t,"aria-label":i,className:"toggle ".concat(t?"on":""," ").concat(a).trim(),onClick:()=>null==n?void 0:n(!t)})}},4940:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>m});var s=n(5155),a=n(2115),i=n(3928),l=n(3742),r=n(7125),c=n(6845),o=n(4239),d=n(7e3),h=n(2327);function u(){var e,t,n;let u=(0,i.f)(e=>e.overview),m=(0,i.f)(e=>e.health),[v,f]=(0,a.useState)(null),[p,g]=(0,a.useState)(null),j=null!=(n=null==u||null==(e=u.daemon)?void 0:e.running)&&n,M=null==u||null==(t=u.daemon)?void 0:t.pid,y=j&&(null==m?void 0:m.uptimeMs)?(0,d.Y0)(m.uptimeMs):"—";async function x(e,t){f(e),g(null);try{let s=await t();if(!s.success){var n;g(null!=(n=s.error)?n:"Failed to ".concat(e," daemon"))}}catch(e){g(e instanceof Error?e.message:String(e))}finally{f(null)}}return(0,s.jsxs)("div",{className:"page",style:{maxWidth:1100},children:[(0,s.jsxs)("div",{className:"page-head",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"page-title row tight",children:(0,s.jsx)("span",{children:"Daemon"})}),(0,s.jsx)("p",{className:"page-sub",children:"Background process — runs scheduled tasks, listens for hook events, pushes live updates"})]}),(0,s.jsx)("div",{className:"page-actions",children:j?(0,s.jsx)(c.t,{icon:"stop",variant:"danger",disabled:null!==v,onClick:()=>x("stop",h.vo),children:"stop"===v?"Stopping…":"Stop daemon"}):(0,s.jsx)(c.t,{icon:"play",variant:"primary",disabled:null!==v,onClick:()=>x("start",h.fX),children:"start"===v?"Starting…":"Start daemon"})})]}),p&&(0,s.jsxs)("div",{className:"kpi",style:{marginBottom:14,borderColor:"var(--danger, #c33)"},children:[(0,s.jsx)("div",{className:"label",style:{color:"var(--danger, #c33)"},children:"Error"}),(0,s.jsx)("div",{className:"value",style:{fontSize:13},children:p})]}),(0,s.jsxs)("div",{className:"grid g-4",style:{marginBottom:14},children:[(0,s.jsxs)("div",{className:"kpi",children:[(0,s.jsx)("div",{className:"label",children:"Status"}),(0,s.jsxs)("div",{className:"value",style:{display:"flex",alignItems:"center",gap:6,fontSize:16},children:[(0,s.jsx)("span",{className:"pulse",style:{width:8,height:8,borderRadius:4,background:j?"var(--accent)":"var(--fg-3)"}}),j?"Online":"Offline"]}),(0,s.jsx)("div",{className:"delta",children:j?M?"pid ".concat(M):"running":"run: mink daemon start"})]}),(0,s.jsxs)("div",{className:"kpi",children:[(0,s.jsx)("div",{className:"label",children:"Uptime"}),(0,s.jsx)("div",{className:"value mono",children:y})]}),(0,s.jsxs)("div",{className:"kpi",children:[(0,s.jsx)("div",{className:"label",children:"Heartbeat"}),(0,s.jsx)("div",{className:"value mono",children:j?"5.0s":"—"}),(0,s.jsx)("div",{className:"delta",children:j?"healthy":"paused"})]}),(0,s.jsxs)("div",{className:"kpi",children:[(0,s.jsx)("div",{className:"label",children:"Hook wiring"}),(0,s.jsx)("div",{className:"value",style:{fontSize:16},children:j?"6 events":"—"}),(0,s.jsx)("div",{className:"delta",children:".claude/settings.json"})]})]}),(0,s.jsxs)("div",{className:"grid g-2",children:[(0,s.jsx)(l.Z,{title:"Controls",children:(0,s.jsxs)("div",{className:"vstack",children:[(0,s.jsxs)("div",{className:"row",children:[(0,s.jsxs)("div",{style:{flex:1},children:[(0,s.jsx)("div",{style:{fontSize:12},children:"Auto-restart on failure"}),(0,s.jsx)("div",{className:"muted",style:{fontSize:11},children:"max 5 attempts, backoff 30s"})]}),(0,s.jsx)(o.l,{on:!0})]}),(0,s.jsxs)("div",{className:"row",children:[(0,s.jsxs)("div",{style:{flex:1},children:[(0,s.jsx)("div",{style:{fontSize:12},children:"Boot on system login"}),(0,s.jsx)("div",{className:"muted",style:{fontSize:11},children:"launchd / systemd user service"})]}),(0,s.jsx)(o.l,{on:!1})]}),(0,s.jsxs)("div",{className:"row",children:[(0,s.jsxs)("div",{style:{flex:1},children:[(0,s.jsx)("div",{style:{fontSize:12},children:"Verbose logging"}),(0,s.jsx)("div",{className:"muted",style:{fontSize:11},children:"log level: debug"})]}),(0,s.jsx)(o.l,{on:!1})]}),(0,s.jsx)("div",{className:"divider"}),(0,s.jsxs)("div",{className:"row tight",style:{flexWrap:"wrap"},children:[(0,s.jsx)(c.t,{size:"sm",icon:"refresh",disabled:null!==v||!j,onClick:()=>x("restart",h.ab),children:"restart"===v?"Restarting…":"Restart"}),(0,s.jsx)(c.t,{size:"sm",variant:"ghost",icon:"eye",disabled:!0,children:"Open log file"}),(0,s.jsx)(c.t,{size:"sm",variant:"ghost",icon:"download",disabled:!0,children:"Dump state"})]})]})}),(0,s.jsx)(l.Z,{title:"Hook integration",sub:".claude/settings.json",flush:!0,children:(0,s.jsxs)("table",{className:"tbl",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Event"}),(0,s.jsx)("th",{children:"Command"}),(0,s.jsx)("th",{children:"Purpose"}),(0,s.jsx)("th",{children:"Status"})]})}),(0,s.jsx)("tbody",{children:[["SessionStart","mink session-start","Create fresh session state"],["Stop","mink session-stop","Finalize session, calculate savings"],["PreToolUse (Read)","mink pre-read","Check file index, warn on repeats"],["PostToolUse (Read)","mink post-read","Track read, estimate tokens"],["PreToolUse (Write)","mink pre-write","Enforce learned rules, surface bugs"],["PostToolUse (Write)","mink post-write","Log write, update file index"]].map(e=>{let[t,n,a]=e;return(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{className:"mono strong",children:t}),(0,s.jsx)("td",{className:"mono muted",children:n}),(0,s.jsx)("td",{children:a}),(0,s.jsx)("td",{children:(0,s.jsx)(r.v,{tone:j?"accent":"",children:j?"wired":"—"})})]},t)})})]})})]})]})}function m(){return(0,s.jsx)(u,{})}},5959:(e,t,n)=>{"use strict";n.d(t,{v:()=>l});var s=n(2115);let a=e=>{let t,n=new Set,s=(e,s)=>{let a="function"==typeof e?e(t):e;if(!Object.is(a,t)){let e=t;t=(null!=s?s:"object"!=typeof a||null===a)?a:Object.assign({},t,a),n.forEach(n=>n(t,e))}},a=()=>t,i={setState:s,getState:a,getInitialState:()=>l,subscribe:e=>(n.add(e),()=>n.delete(e))},l=t=e(s,a,i);return i},i=e=>{let t=(e=>e?a(e):a)(e),n=e=>(function(e,t=e=>e){let n=s.useSyncExternalStore(e.subscribe,s.useCallback(()=>t(e.getState()),[e,t]),s.useCallback(()=>t(e.getInitialState()),[e,t]));return s.useDebugValue(n),n})(t,e);return Object.assign(n,t),n},l=e=>e?i(e):i},6845:(e,t,n)=>{"use strict";n.d(t,{t:()=>i});var s=n(5155),a=n(1044);function i(e){let{icon:t,variant:n,size:i,className:l="",children:r,...c}=e,o=["btn"];return n&&o.push(n),i&&o.push(i),l&&o.push(l),(0,s.jsxs)("button",{className:o.join(" "),...c,children:[t&&(0,s.jsx)(a.I,{name:t}),r]})}},7e3:(e,t,n)=>{"use strict";function s(e){return e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":String(e)}function a(e){if(!e||e<=0)return"—";let t=Math.floor(e/1e3),n=Math.floor(t/60),s=Math.floor(n/60);return s>0?s+"h "+n%60+"m":n>0?n+"m "+t%60+"s":t+"s"}function i(e){if(!e)return"—";try{let t=new Date(e);return t.toLocaleDateString()+" "+t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch(t){return e}}n.d(t,{Y0:()=>a,aT:()=>s,r6:()=>i})},7125:(e,t,n)=>{"use strict";n.d(t,{v:()=>a});var s=n(5155);function a(e){let{tone:t="",children:n,className:a=""}=e;return(0,s.jsx)("span",{className:"chip ".concat(t," ").concat(a).trim(),children:n})}},8105:(e,t,n)=>{Promise.resolve().then(n.bind(n,4940))}},e=>{e.O(0,[441,255,358],()=>e(e.s=8105)),_N_E=e.O()}]);
|