sensorium-mcp 3.1.3-board.4 → 3.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/misc-settings.d.ts +0 -14
- package/dist/config/misc-settings.d.ts.map +1 -1
- package/dist/config/misc-settings.js +0 -53
- package/dist/config/misc-settings.js.map +1 -1
- package/dist/dashboard/routes/settings.d.ts +0 -2
- package/dist/dashboard/routes/settings.d.ts.map +1 -1
- package/dist/dashboard/routes/settings.js +1 -24
- package/dist/dashboard/routes/settings.js.map +1 -1
- package/dist/dashboard/routes/types.d.ts +0 -6
- package/dist/dashboard/routes/types.d.ts.map +1 -1
- package/dist/dashboard/routes/types.js.map +1 -1
- package/dist/dashboard/routes.d.ts.map +1 -1
- package/dist/dashboard/routes.js +1 -42
- package/dist/dashboard/routes.js.map +1 -1
- package/dist/dashboard/spa.html +11 -11
- package/dist/data/memory/schema.d.ts.map +1 -1
- package/dist/data/memory/schema.js +0 -4
- package/dist/data/memory/schema.js.map +1 -1
- package/dist/index.js +2 -84
- package/dist/index.js.map +1 -1
- package/dist/server/http-server.d.ts +1 -3
- package/dist/server/http-server.d.ts.map +1 -1
- package/dist/server/http-server.js +2 -6
- package/dist/server/http-server.js.map +1 -1
- package/dist/services/broker-client.d.ts +0 -30
- package/dist/services/broker-client.d.ts.map +1 -1
- package/dist/services/broker-client.js +0 -23
- package/dist/services/broker-client.js.map +1 -1
- package/dist/services/spawn-common.d.ts.map +1 -1
- package/dist/services/spawn-common.js +1 -3
- package/dist/services/spawn-common.js.map +1 -1
- package/dist/services/worker-cleanup.service.d.ts +1 -6
- package/dist/services/worker-cleanup.service.d.ts.map +1 -1
- package/dist/services/worker-cleanup.service.js +10 -123
- package/dist/services/worker-cleanup.service.js.map +1 -1
- package/dist/tools/delegate-tool.d.ts.map +1 -1
- package/dist/tools/delegate-tool.js +0 -32
- package/dist/tools/delegate-tool.js.map +1 -1
- package/dist/tools/wait/message-delivery.d.ts.map +1 -1
- package/dist/tools/wait/message-delivery.js +0 -13
- package/dist/tools/wait/message-delivery.js.map +1 -1
- package/package.json +2 -2
- package/dist/board/api/api.js +0 -61
- package/dist/board/api/client.js +0 -96
- package/dist/board/components/BottomNav.js +0 -32
- package/dist/board/components/Card.js +0 -44
- package/dist/board/components/CommentComposer.js +0 -26
- package/dist/board/components/CommentList.js +0 -39
- package/dist/board/components/Dropdown.js +0 -66
- package/dist/board/components/Lane.js +0 -40
- package/dist/board/components/PriorityChip.js +0 -17
- package/dist/board/components/ProfileSummary.js +0 -39
- package/dist/board/components/StateBanner.js +0 -22
- package/dist/board/components/StatusChip.js +0 -21
- package/dist/board/components/TokenEntry.js +0 -42
- package/dist/board/config.js +0 -56
- package/dist/board/index.html +0 -18
- package/dist/board/main.js +0 -37
- package/dist/board/mock/api.mock.js +0 -193
- package/dist/board/mock/fixtures.js +0 -164
- package/dist/board/schema/policy.js +0 -192
- package/dist/board/state/auth.js +0 -55
- package/dist/board/state/useBoard.js +0 -149
- package/dist/board/state/useBuilder.js +0 -98
- package/dist/board/state/useCard.js +0 -67
- package/dist/board/styles/board.css +0 -1760
- package/dist/board/styles/tokens.css +0 -71
- package/dist/board/vendor/vue.esm-browser.js +0 -9
- package/dist/board/views/App.js +0 -65
- package/dist/board/views/BoardView.js +0 -84
- package/dist/board/views/BuilderView.js +0 -303
- package/dist/board/views/CardView.js +0 -245
- package/dist/board/views/SettingsView.js +0 -145
- package/dist/dashboard/board-static.d.ts +0 -23
- package/dist/dashboard/board-static.d.ts.map +0 -1
- package/dist/dashboard/board-static.js +0 -131
- package/dist/dashboard/board-static.js.map +0 -1
- package/dist/dashboard/routes/board.d.ts +0 -73
- package/dist/dashboard/routes/board.d.ts.map +0 -1
- package/dist/dashboard/routes/board.js +0 -623
- package/dist/dashboard/routes/board.js.map +0 -1
- package/dist/data/board/board-schema.d.ts +0 -22
- package/dist/data/board/board-schema.d.ts.map +0 -1
- package/dist/data/board/board-schema.js +0 -103
- package/dist/data/board/board-schema.js.map +0 -1
- package/dist/data/board/board-types.d.ts +0 -117
- package/dist/data/board/board-types.d.ts.map +0 -1
- package/dist/data/board/board-types.js +0 -9
- package/dist/data/board/board-types.js.map +0 -1
- package/dist/data/board/card.repository.d.ts +0 -64
- package/dist/data/board/card.repository.d.ts.map +0 -1
- package/dist/data/board/card.repository.js +0 -272
- package/dist/data/board/card.repository.js.map +0 -1
- package/dist/data/board/comment.repository.d.ts +0 -12
- package/dist/data/board/comment.repository.d.ts.map +0 -1
- package/dist/data/board/comment.repository.js +0 -31
- package/dist/data/board/comment.repository.js.map +0 -1
- package/dist/data/board/lane.repository.d.ts +0 -18
- package/dist/data/board/lane.repository.d.ts.map +0 -1
- package/dist/data/board/lane.repository.js +0 -44
- package/dist/data/board/lane.repository.js.map +0 -1
- package/dist/data/board/profile-defaults.d.ts +0 -19
- package/dist/data/board/profile-defaults.d.ts.map +0 -1
- package/dist/data/board/profile-defaults.js +0 -118
- package/dist/data/board/profile-defaults.js.map +0 -1
- package/dist/services/board/board-signals.d.ts +0 -25
- package/dist/services/board/board-signals.d.ts.map +0 -1
- package/dist/services/board/board-signals.js +0 -83
- package/dist/services/board/board-signals.js.map +0 -1
- package/dist/services/board/card-briefing.d.ts +0 -17
- package/dist/services/board/card-briefing.d.ts.map +0 -1
- package/dist/services/board/card-briefing.js +0 -86
- package/dist/services/board/card-briefing.js.map +0 -1
- package/dist/services/board/orchestrator.service.d.ts +0 -55
- package/dist/services/board/orchestrator.service.d.ts.map +0 -1
- package/dist/services/board/orchestrator.service.js +0 -198
- package/dist/services/board/orchestrator.service.js.map +0 -1
- package/dist/services/board/release-worker.d.ts +0 -32
- package/dist/services/board/release-worker.d.ts.map +0 -1
- package/dist/services/board/release-worker.js +0 -49
- package/dist/services/board/release-worker.js.map +0 -1
- package/dist/services/board/report-capture.d.ts +0 -48
- package/dist/services/board/report-capture.d.ts.map +0 -1
- package/dist/services/board/report-capture.js +0 -172
- package/dist/services/board/report-capture.js.map +0 -1
- package/dist/services/board/worker-spawn.d.ts +0 -30
- package/dist/services/board/worker-spawn.d.ts.map +0 -1
- package/dist/services/board/worker-spawn.js +0 -90
- package/dist/services/board/worker-spawn.js.map +0 -1
- package/dist/services/passive-notice.service.d.ts +0 -39
- package/dist/services/passive-notice.service.d.ts.map +0 -1
- package/dist/services/passive-notice.service.js +0 -274
- package/dist/services/passive-notice.service.js.map +0 -1
- package/dist/services/usage/usage-inbox-notifier.d.ts +0 -50
- package/dist/services/usage/usage-inbox-notifier.d.ts.map +0 -1
- package/dist/services/usage/usage-inbox-notifier.js +0 -118
- package/dist/services/usage/usage-inbox-notifier.js.map +0 -1
- package/dist/services/usage/usage-poller.service.d.ts +0 -41
- package/dist/services/usage/usage-poller.service.d.ts.map +0 -1
- package/dist/services/usage/usage-poller.service.js +0 -66
- package/dist/services/usage/usage-poller.service.js.map +0 -1
- package/dist/services/usage/usage-snapshot-provider.d.ts +0 -29
- package/dist/services/usage/usage-snapshot-provider.d.ts.map +0 -1
- package/dist/services/usage/usage-snapshot-provider.js +0 -59
- package/dist/services/usage/usage-snapshot-provider.js.map +0 -1
- package/dist/services/usage/usage-types.d.ts +0 -23
- package/dist/services/usage/usage-types.d.ts.map +0 -1
- package/dist/services/usage/usage-types.js +0 -14
- package/dist/services/usage/usage-types.js.map +0 -1
- package/templates/atomic-build-spec.default.md +0 -57
- package/templates/buildless-vue-preview.default.md +0 -47
- package/templates/phased-build.default.md +0 -59
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usage-poller.service.d.ts","sourceRoot":"","sources":["../../../src/services/usage/usage-poller.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AAClF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAItD,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,6BAA6B,CAAC;IACxC,+EAA+E;IAC/E,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,aAAa,EAAE,KAAK,IAAI,CAAC;IACnD,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5B;AAED,qBAAa,kBAAkB;IAIjB,OAAO,CAAC,QAAQ,CAAC,IAAI;IAHjC,OAAO,CAAC,KAAK,CAA+C;IAC5D,OAAO,CAAC,YAAY,CAAS;gBAEA,IAAI,EAAE,eAAe;IAElD,gFAAgF;IAChF,KAAK,IAAI,IAAI;IAQb,IAAI,IAAI,IAAI;IAKZ;;;OAGG;YACW,IAAI;CAenB"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Usage poller — the MCP-side pull loop (one-way IPC: MCP → supervisor).
|
|
3
|
-
*
|
|
4
|
-
* A small `start()/stop()` background loop in the `KeeperService` /
|
|
5
|
-
* `BoardOrchestrator` style. Every ~45 s it calls `brokerGetUsage()` (the broker
|
|
6
|
-
* client) and writes the result into the `UsageSnapshotProvider`. It only ever
|
|
7
|
-
* PULLS — it never pushes into the supervisor.
|
|
8
|
-
*
|
|
9
|
-
* Null handling is load-bearing: `brokerGetUsage()` returns `null` for ANY
|
|
10
|
-
* failure (unreachable / non-OK / unparseable). `null` means "cannot confirm",
|
|
11
|
-
* NEVER "usage is zero". On null the poller leaves the provider untouched so the
|
|
12
|
-
* last-known snapshot survives a transient supervisor hiccup. An inert monitor
|
|
13
|
-
* answers with an empty array (a confirmed "no sources"), which IS written.
|
|
14
|
-
*
|
|
15
|
-
* Wiring gates start on `MCP_HTTP_PORT`: every stdio agent session also boots
|
|
16
|
-
* `index.ts`, so an ungated poller would spawn one loop per session. Gating it
|
|
17
|
-
* to the HTTP transport keeps exactly one poller in the server process.
|
|
18
|
-
*/
|
|
19
|
-
import { brokerGetUsage } from "../broker-client.js";
|
|
20
|
-
const USAGE_POLL_INTERVAL_MS = 45_000; // spec range 30–60 s
|
|
21
|
-
export class UsagePollerService {
|
|
22
|
-
deps;
|
|
23
|
-
timer = null;
|
|
24
|
-
pollInFlight = false;
|
|
25
|
-
constructor(deps) {
|
|
26
|
-
this.deps = deps;
|
|
27
|
-
}
|
|
28
|
-
/** Idempotent: poll once immediately, then every ~45 s. Re-entry is a no-op. */
|
|
29
|
-
start() {
|
|
30
|
-
if (this.timer)
|
|
31
|
-
return;
|
|
32
|
-
this.timer = setInterval(() => void this.poll(), USAGE_POLL_INTERVAL_MS);
|
|
33
|
-
this.timer.unref();
|
|
34
|
-
void this.poll();
|
|
35
|
-
this.deps.log(`[usage] poller started (interval ${USAGE_POLL_INTERVAL_MS / 1000}s)`);
|
|
36
|
-
}
|
|
37
|
-
stop() {
|
|
38
|
-
if (this.timer)
|
|
39
|
-
clearInterval(this.timer);
|
|
40
|
-
this.timer = null;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* One pull cycle. A slow request must not stack ticks (the interval keeps
|
|
44
|
-
* firing), so an in-flight poll short-circuits re-entry.
|
|
45
|
-
*/
|
|
46
|
-
async poll() {
|
|
47
|
-
if (this.pollInFlight)
|
|
48
|
-
return;
|
|
49
|
-
this.pollInFlight = true;
|
|
50
|
-
try {
|
|
51
|
-
const snapshots = await brokerGetUsage();
|
|
52
|
-
// null ⇒ cannot confirm ⇒ keep last known; never zero out the provider.
|
|
53
|
-
if (snapshots === null)
|
|
54
|
-
return;
|
|
55
|
-
this.deps.provider.setSnapshots(snapshots);
|
|
56
|
-
this.deps.onSnapshots?.(snapshots);
|
|
57
|
-
}
|
|
58
|
-
catch (err) {
|
|
59
|
-
this.deps.log(`[usage] poll failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
60
|
-
}
|
|
61
|
-
finally {
|
|
62
|
-
this.pollInFlight = false;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
//# sourceMappingURL=usage-poller.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usage-poller.service.js","sourceRoot":"","sources":["../../../src/services/usage/usage-poller.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAIrD,MAAM,sBAAsB,GAAG,MAAM,CAAC,CAAC,qBAAqB;AAS5D,MAAM,OAAO,kBAAkB;IAIA;IAHrB,KAAK,GAA0C,IAAI,CAAC;IACpD,YAAY,GAAG,KAAK,CAAC;IAE7B,YAA6B,IAAqB;QAArB,SAAI,GAAJ,IAAI,CAAiB;IAAG,CAAC;IAEtD,gFAAgF;IAChF,KAAK;QACH,IAAI,IAAI,CAAC,KAAK;YAAE,OAAO;QACvB,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC,IAAI,EAAE,EAAE,sBAAsB,CAAC,CAAC;QACzE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACnB,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC;QACjB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,oCAAoC,sBAAsB,GAAG,IAAI,IAAI,CAAC,CAAC;IACvF,CAAC;IAED,IAAI;QACF,IAAI,IAAI,CAAC,KAAK;YAAE,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC1C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAED;;;OAGG;IACK,KAAK,CAAC,IAAI;QAChB,IAAI,IAAI,CAAC,YAAY;YAAE,OAAO;QAC9B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC;YACH,MAAM,SAAS,GAAG,MAAM,cAAc,EAAE,CAAC;YACzC,wEAAwE;YACxE,IAAI,SAAS,KAAK,IAAI;gBAAE,OAAO;YAC/B,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;YAC3C,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC,CAAC;QACrC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,wBAAwB,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC5F,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAC5B,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* In-memory `UsageSnapshotProvider` (the port's default impl) + lazy module
|
|
3
|
-
* singleton. The poller calls `setSnapshots` to upsert the latest snapshot per
|
|
4
|
-
* `agentType`; consumers read via the port interface. A lazy singleton matches
|
|
5
|
-
* the project's `initMemoryDb` idiom so dashboard route handlers can reach the
|
|
6
|
-
* provider without threading it through `DashboardContext`.
|
|
7
|
-
*/
|
|
8
|
-
import type { UsageSnapshot, UsageSnapshotProvider } from "./usage-types.js";
|
|
9
|
-
export declare class InMemoryUsageSnapshotProvider implements UsageSnapshotProvider {
|
|
10
|
-
/** Latest snapshot per agentType — upserted, so newer probes replace older. */
|
|
11
|
-
private readonly byAgentType;
|
|
12
|
-
private readonly listeners;
|
|
13
|
-
/**
|
|
14
|
-
* Upsert each snapshot by `agentType`, then notify listeners ONCE for the
|
|
15
|
-
* whole batch. An empty batch is still a valid signal ("monitor went inert")
|
|
16
|
-
* and clears nothing implicitly — callers pass what they want stored.
|
|
17
|
-
*/
|
|
18
|
-
setSnapshots(snapshots: UsageSnapshot[]): void;
|
|
19
|
-
getAll(): UsageSnapshot[];
|
|
20
|
-
getByAgentType(agentType: string): UsageSnapshot | null;
|
|
21
|
-
onUpdate(listener: (snapshots: UsageSnapshot[]) => void): () => void;
|
|
22
|
-
/** Fire every listener; one listener throwing must not starve the rest. */
|
|
23
|
-
private notify;
|
|
24
|
-
}
|
|
25
|
-
/** Lazy module singleton — the one provider shared by poller and consumers. */
|
|
26
|
-
export declare function getUsageSnapshotProvider(): InMemoryUsageSnapshotProvider;
|
|
27
|
-
/** Test hook: drop the module singleton so each test starts from a clean slate. */
|
|
28
|
-
export declare function resetUsageSnapshotProviderForTest(): void;
|
|
29
|
-
//# sourceMappingURL=usage-snapshot-provider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usage-snapshot-provider.d.ts","sourceRoot":"","sources":["../../../src/services/usage/usage-snapshot-provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAE7E,qBAAa,6BAA8B,YAAW,qBAAqB;IACzE,+EAA+E;IAC/E,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAoC;IAChE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAmD;IAE7E;;;;OAIG;IACH,YAAY,CAAC,SAAS,EAAE,aAAa,EAAE,GAAG,IAAI;IAO9C,MAAM,IAAI,aAAa,EAAE;IAIzB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI;IAIvD,QAAQ,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,aAAa,EAAE,KAAK,IAAI,GAAG,MAAM,IAAI;IAOpE,2EAA2E;IAC3E,OAAO,CAAC,MAAM;CASf;AAID,+EAA+E;AAC/E,wBAAgB,wBAAwB,IAAI,6BAA6B,CAKxE;AAED,mFAAmF;AACnF,wBAAgB,iCAAiC,IAAI,IAAI,CAExD"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* In-memory `UsageSnapshotProvider` (the port's default impl) + lazy module
|
|
3
|
-
* singleton. The poller calls `setSnapshots` to upsert the latest snapshot per
|
|
4
|
-
* `agentType`; consumers read via the port interface. A lazy singleton matches
|
|
5
|
-
* the project's `initMemoryDb` idiom so dashboard route handlers can reach the
|
|
6
|
-
* provider without threading it through `DashboardContext`.
|
|
7
|
-
*/
|
|
8
|
-
export class InMemoryUsageSnapshotProvider {
|
|
9
|
-
/** Latest snapshot per agentType — upserted, so newer probes replace older. */
|
|
10
|
-
byAgentType = new Map();
|
|
11
|
-
listeners = new Set();
|
|
12
|
-
/**
|
|
13
|
-
* Upsert each snapshot by `agentType`, then notify listeners ONCE for the
|
|
14
|
-
* whole batch. An empty batch is still a valid signal ("monitor went inert")
|
|
15
|
-
* and clears nothing implicitly — callers pass what they want stored.
|
|
16
|
-
*/
|
|
17
|
-
setSnapshots(snapshots) {
|
|
18
|
-
for (const snap of snapshots) {
|
|
19
|
-
this.byAgentType.set(snap.agentType, snap);
|
|
20
|
-
}
|
|
21
|
-
this.notify(snapshots);
|
|
22
|
-
}
|
|
23
|
-
getAll() {
|
|
24
|
-
return [...this.byAgentType.values()];
|
|
25
|
-
}
|
|
26
|
-
getByAgentType(agentType) {
|
|
27
|
-
return this.byAgentType.get(agentType) ?? null;
|
|
28
|
-
}
|
|
29
|
-
onUpdate(listener) {
|
|
30
|
-
this.listeners.add(listener);
|
|
31
|
-
return () => {
|
|
32
|
-
this.listeners.delete(listener);
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
/** Fire every listener; one listener throwing must not starve the rest. */
|
|
36
|
-
notify(snapshots) {
|
|
37
|
-
for (const listener of this.listeners) {
|
|
38
|
-
try {
|
|
39
|
-
listener(snapshots);
|
|
40
|
-
}
|
|
41
|
-
catch {
|
|
42
|
-
/* a consumer's failure must never break the update fan-out */
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
let singleton = null;
|
|
48
|
-
/** Lazy module singleton — the one provider shared by poller and consumers. */
|
|
49
|
-
export function getUsageSnapshotProvider() {
|
|
50
|
-
if (singleton === null) {
|
|
51
|
-
singleton = new InMemoryUsageSnapshotProvider();
|
|
52
|
-
}
|
|
53
|
-
return singleton;
|
|
54
|
-
}
|
|
55
|
-
/** Test hook: drop the module singleton so each test starts from a clean slate. */
|
|
56
|
-
export function resetUsageSnapshotProviderForTest() {
|
|
57
|
-
singleton = null;
|
|
58
|
-
}
|
|
59
|
-
//# sourceMappingURL=usage-snapshot-provider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usage-snapshot-provider.js","sourceRoot":"","sources":["../../../src/services/usage/usage-snapshot-provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,OAAO,6BAA6B;IACxC,+EAA+E;IAC9D,WAAW,GAAG,IAAI,GAAG,EAAyB,CAAC;IAC/C,SAAS,GAAG,IAAI,GAAG,EAAwC,CAAC;IAE7E;;;;OAIG;IACH,YAAY,CAAC,SAA0B;QACrC,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;YAC7B,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAC7C,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACzB,CAAC;IAED,MAAM;QACJ,OAAO,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC;IACxC,CAAC;IAED,cAAc,CAAC,SAAiB;QAC9B,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC;IACjD,CAAC;IAED,QAAQ,CAAC,QAA8C;QACrD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC7B,OAAO,GAAG,EAAE;YACV,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAClC,CAAC,CAAC;IACJ,CAAC;IAED,2EAA2E;IACnE,MAAM,CAAC,SAA0B;QACvC,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACtC,IAAI,CAAC;gBACH,QAAQ,CAAC,SAAS,CAAC,CAAC;YACtB,CAAC;YAAC,MAAM,CAAC;gBACP,8DAA8D;YAChE,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAED,IAAI,SAAS,GAAyC,IAAI,CAAC;AAE3D,+EAA+E;AAC/E,MAAM,UAAU,wBAAwB;IACtC,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;QACvB,SAAS,GAAG,IAAI,6BAA6B,EAAE,CAAC;IAClD,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,iCAAiC;IAC/C,SAAS,GAAG,IAAI,CAAC;AACnB,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Usage monitor — MCP-side port (OCP seam).
|
|
3
|
-
*
|
|
4
|
-
* The `UsageSnapshotProvider` is the single interface consumers depend on: the
|
|
5
|
-
* poller fills it (`setSnapshots`), while the inbox-notifier and the board read
|
|
6
|
-
* route consume it (`getAll` / `getByAgentType` / `onUpdate`). Consumers stay
|
|
7
|
-
* agent-type-agnostic — they iterate snapshots keyed by `agentType` and never
|
|
8
|
-
* branch on a specific agent (no `if (agentType === "claude")`).
|
|
9
|
-
*
|
|
10
|
-
* The snapshot shape is re-exported from the broker client so the wire contract
|
|
11
|
-
* (`GET /usage` on the supervisor) and the in-process port never drift.
|
|
12
|
-
*/
|
|
13
|
-
import type { BrokerUsageSnapshot } from "../broker-client.js";
|
|
14
|
-
export type UsageSnapshot = BrokerUsageSnapshot;
|
|
15
|
-
export interface UsageSnapshotProvider {
|
|
16
|
-
/** Latest snapshot per agentType; empty when the monitor is inert/unreachable. */
|
|
17
|
-
getAll(): UsageSnapshot[];
|
|
18
|
-
/** Latest snapshot for one agentType, or null when none is known. */
|
|
19
|
-
getByAgentType(agentType: string): UsageSnapshot | null;
|
|
20
|
-
/** Fires once per accepted update batch. Returns an unsubscribe function. */
|
|
21
|
-
onUpdate(listener: (snapshots: UsageSnapshot[]) => void): () => void;
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=usage-types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usage-types.d.ts","sourceRoot":"","sources":["../../../src/services/usage/usage-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,MAAM,MAAM,aAAa,GAAG,mBAAmB,CAAC;AAEhD,MAAM,WAAW,qBAAqB;IACpC,kFAAkF;IAClF,MAAM,IAAI,aAAa,EAAE,CAAC;IAC1B,qEAAqE;IACrE,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAAC;IACxD,6EAA6E;IAC7E,QAAQ,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,aAAa,EAAE,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;CACtE"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Usage monitor — MCP-side port (OCP seam).
|
|
3
|
-
*
|
|
4
|
-
* The `UsageSnapshotProvider` is the single interface consumers depend on: the
|
|
5
|
-
* poller fills it (`setSnapshots`), while the inbox-notifier and the board read
|
|
6
|
-
* route consume it (`getAll` / `getByAgentType` / `onUpdate`). Consumers stay
|
|
7
|
-
* agent-type-agnostic — they iterate snapshots keyed by `agentType` and never
|
|
8
|
-
* branch on a specific agent (no `if (agentType === "claude")`).
|
|
9
|
-
*
|
|
10
|
-
* The snapshot shape is re-exported from the broker client so the wire contract
|
|
11
|
-
* (`GET /usage` on the supervisor) and the in-process port never drift.
|
|
12
|
-
*/
|
|
13
|
-
export {};
|
|
14
|
-
//# sourceMappingURL=usage-types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usage-types.js","sourceRoot":"","sources":["../../../src/services/usage/usage-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Atomic Build Spec
|
|
3
|
-
triggers:
|
|
4
|
-
- build spec
|
|
5
|
-
- buildspec
|
|
6
|
-
- implementation plan
|
|
7
|
-
- decompose
|
|
8
|
-
- break down the work
|
|
9
|
-
- split into tasks
|
|
10
|
-
- phased rollout
|
|
11
|
-
- sprint plan
|
|
12
|
-
- atomic increments
|
|
13
|
-
- how to build
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
## Atomic Build Spec — decompose into tiny, verifiable increments
|
|
17
|
-
|
|
18
|
-
### The problem this fixes
|
|
19
|
-
By default, when asked for a "build spec" / "implementation plan", the model writes it **as if it
|
|
20
|
-
will do all the work in one blast** — phases A→Z, everything at once, verification only at the very
|
|
21
|
-
end. That produces huge PRs and a wall of code the operator cannot review or trust. **This is
|
|
22
|
-
wrong.** The operator wants the opposite.
|
|
23
|
-
|
|
24
|
-
### The rule (non-negotiable)
|
|
25
|
-
Split the work into **atomic increments**. Every increment MUST be:
|
|
26
|
-
1. **Small enough to finish in ONE sprint** — a single focused sitting, not an epic.
|
|
27
|
-
2. **Independently testable** — it can be verified on its own, without the later increments existing.
|
|
28
|
-
3. **Self-contained deliverables** — the increment names exactly what it produces (files, endpoint,
|
|
29
|
-
migration, UI element).
|
|
30
|
-
4. **A small PR** — a reviewable diff. **PRs touching 50–100 files are NOT accepted.** Keep each
|
|
31
|
-
increment to a handful of files / a small diff.
|
|
32
|
-
5. **Personally verified by the operator** before the next increment starts. Verification is a real
|
|
33
|
-
gate, not a formality.
|
|
34
|
-
|
|
35
|
-
### Anti-patterns (reject these)
|
|
36
|
-
- ❌ A build spec that reads like one big blast: "phase 1 do everything, phase 2 do everything…, then
|
|
37
|
-
verify at the end."
|
|
38
|
-
- ❌ Firing workers "like a machine gun" through phases A→Z and only checking the result afterwards.
|
|
39
|
-
- ❌ Any single increment that touches dozens of files or bundles unrelated changes.
|
|
40
|
-
- ❌ "We'll test it all once it's assembled." No — each atom is tested and approved on its own.
|
|
41
|
-
|
|
42
|
-
### How to write it
|
|
43
|
-
For EACH increment, specify:
|
|
44
|
-
- **Goal** — one sentence, one concern.
|
|
45
|
-
- **Deliverables** — the concrete artifacts (files/interfaces/endpoints/migration).
|
|
46
|
-
- **How to test** — the exact check that proves this atom works in isolation.
|
|
47
|
-
- **Operator verification** — what the operator looks at to personally sign off.
|
|
48
|
-
- **Files touched** — small, explicit list. If it grows large, the increment is too big → split it.
|
|
49
|
-
- **Depends on** — which earlier increment(s) must be approved first.
|
|
50
|
-
|
|
51
|
-
Sequence so that **only one increment is in flight at a time**: build → test → operator verifies →
|
|
52
|
-
merge → next. The full feature emerges as a chain of tiny, individually-trusted steps. Design the
|
|
53
|
-
whole model up front (one schema, no double-migration) but ship it as these atoms.
|
|
54
|
-
|
|
55
|
-
### One-line cue
|
|
56
|
-
When decomposing: "Split the work into atomic pieces, each easy to do in one sprint and easy to test;
|
|
57
|
-
no 50–100-file PRs; I verify each piece before the next."
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Buildless Vue Preview
|
|
3
|
-
triggers:
|
|
4
|
-
- buildless vue
|
|
5
|
-
- vue without build
|
|
6
|
-
- claude design over repo
|
|
7
|
-
- live design preview
|
|
8
|
-
- mock adapter
|
|
9
|
-
- preview mode ui
|
|
10
|
-
- design in place
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## Buildless Vue Preview — edit the real UI live, no bundler
|
|
14
|
-
|
|
15
|
-
### The problem this solves
|
|
16
|
-
An external design tool (Claude Design / claude.ai artifacts) can only run **static HTML/JS in a browser sandbox** — it has **no bundler**, so it cannot run a Vite/`.vue` SFC/TypeScript app. That forces one of two bad workflows:
|
|
17
|
-
- **`.zip` roundtrip** — export from the design tool, import into the repo, re-integrate by hand on every edit. Slow, error-prone, drifts.
|
|
18
|
-
- **Mirror mockups + Claude Code** — the design tool edits its own copy blind, then a coding agent ports the diff into the real repo. Double work, always something missed.
|
|
19
|
-
|
|
20
|
-
Both mean the designer edits something that is **not the running app**. The goal is the opposite: **iterate the UI on the real repo files with a live preview, zero re-integration.**
|
|
21
|
-
|
|
22
|
-
### The pattern
|
|
23
|
-
Build the front-end as **buildless Vue 3**: ES modules straight in the browser, components as plain `.js` with template strings, Vue loaded as `vue.esm-browser.js`. **No npm, no Vite, no bundler.** The *same* files run in the design tool's preview AND in production.
|
|
24
|
-
|
|
25
|
-
- **The only seam is data.** A thin `api.js` with a **swappable adapter**:
|
|
26
|
-
- `production` → real `fetch` to the backend (with the app's real auth).
|
|
27
|
-
- `preview` → `api.mock.js` returns fixtures; auth guard passes through.
|
|
28
|
-
- **One MODE flag** (`config.js`: `MODE = 'production' | 'preview'`, or auto-detect by hostname) drives everything downstream, including auth. Login/error/expired-session screens become just fixture states, so **every screen is physically visible** in preview.
|
|
29
|
-
- **Isolation contract:**
|
|
30
|
-
- `api/`, `state/`, `config.js`, entry/router = the **frozen seam** — the design tool does NOT edit these.
|
|
31
|
-
- `views/`, `components/`, `styles/` = the **only** folders the design tool edits.
|
|
32
|
-
- `mock/` fixtures are **loaded only when `MODE === 'preview'`** — statically un-imported in production, so **no mock byte ships to prod**.
|
|
33
|
-
- Keep a **typed contract on the data seam** even without TypeScript: a shared types file (`.d.ts` or JSDoc typedefs) so type-safety on the API boundary isn't lost.
|
|
34
|
-
|
|
35
|
-
### What you trade away (and why it's OK here)
|
|
36
|
-
Lose: SFC syntax (`<template>` blocks), hot-reload, tree-shaking, TypeScript. For a dashboard-sized app this is non-critical. You gain: the design tool edits the **real running app** with a live preview, small components (Card, Row, Builder…) instead of 1000-line files, and a backend left completely untouched (it just serves JSON).
|
|
37
|
-
|
|
38
|
-
### When to use
|
|
39
|
-
- You want a designer/agent to iterate UI **directly on the repo** with a live preview and no bundler in their environment.
|
|
40
|
-
- The app is small-to-medium (a dashboard/board), backend serves JSON, and SFC/HMR/TS are nice-to-have rather than essential.
|
|
41
|
-
|
|
42
|
-
### When NOT to use
|
|
43
|
-
- Large SPA where TypeScript, tree-shaking, and SFC tooling materially matter → use Vite+SFC and accept the mirror-mockup + Claude Code porting workflow.
|
|
44
|
-
- The existing app already standardises on a build step you must not diverge from (unless this is a separate app whose live-edit workflow justifies the divergence — state the justification).
|
|
45
|
-
|
|
46
|
-
### Adapting to a specific stack
|
|
47
|
-
The PATTERN is portable; the specifics are not. Map to the target app: swap the real API endpoints + the app's real auth (Bearer, session, OAuth, …) into the `production` adapter; the `preview` adapter mocks exactly those. Do not copy another app's auth/framework specifics — take buildless-Vue + swappable-adapter + MODE-flag only.
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Phased Worker Pipeline
|
|
3
|
-
triggers:
|
|
4
|
-
- phase per worker
|
|
5
|
-
- fresh worker per phase
|
|
6
|
-
- review after each phase
|
|
7
|
-
- phased execution
|
|
8
|
-
- orchestrated build
|
|
9
|
-
- one worker per phase
|
|
10
|
-
- build phase by phase
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## Phased Worker Pipeline — one fresh worker per phase, review after each
|
|
14
|
-
|
|
15
|
-
### What this is
|
|
16
|
-
The EXECUTION mechanism for building a decomposed plan. The orchestrator (not one long-lived worker)
|
|
17
|
-
drives the build **phase by phase**: **each phase gets its OWN fresh worker**, and **a separate
|
|
18
|
-
reviewer reviews after each phase**, before moving on. This complements two other skills:
|
|
19
|
-
- **Atomic Build Spec** — how to DECOMPOSE the work into tiny phases (small, testable, small PRs).
|
|
20
|
-
- **Handoff** — how to spawn a worker and wait for its result.
|
|
21
|
-
This skill is the LOOP that runs those phases.
|
|
22
|
-
|
|
23
|
-
### Why fresh-worker-per-phase (not one worker doing everything)
|
|
24
|
-
- Clean context each phase: no accumulation, no drift, no context bloat — each worker starts focused
|
|
25
|
-
on exactly one phase.
|
|
26
|
-
- Independent verification: the phase's reviewer is a DIFFERENT fresh agent (a worker must never
|
|
27
|
-
review its own code).
|
|
28
|
-
- Cheap failure isolation: a bad phase is contained; you re-run just that phase's worker.
|
|
29
|
-
|
|
30
|
-
### The loop (orchestrator-driven)
|
|
31
|
-
For each phase, in order:
|
|
32
|
-
1. **Spawn a fresh worker** for THIS phase only (Handoff pattern; agentType per the operator's
|
|
33
|
-
choice — e.g. Copilot). Give it: the phase's goal, its small file scope, how to test, and the
|
|
34
|
-
invariants (explicit-path commits, no `git add -A/./ -u`, no AI attribution, no push unless told).
|
|
35
|
-
2. Worker **implements only this phase**, tests green, then **STOPS and reports back** to the
|
|
36
|
-
orchestrator. It does NOT start the next phase.
|
|
37
|
-
3. **Spawn a SEPARATE reviewer** (fresh worker / code-review) over this phase's diff — never
|
|
38
|
-
self-review. Address findings.
|
|
39
|
-
4. **Commit** the phase (explicit paths). Then go to the next phase with a NEW fresh worker.
|
|
40
|
-
|
|
41
|
-
### Verification cadence — ask the operator
|
|
42
|
-
- Default: operator verifies the WHOLE stack at the END (after redeploy); per-phase **code review is
|
|
43
|
-
enough** between phases. (This is what the operator chose for the usage monitor.)
|
|
44
|
-
- Alternative: operator personally verifies **each** phase before the next (stricter). Confirm which
|
|
45
|
-
cadence applies before starting.
|
|
46
|
-
|
|
47
|
-
### Rules
|
|
48
|
-
- **One phase in flight at a time.** Never parallelize phases that depend on each other.
|
|
49
|
-
- **A worker never reviews its own work** — the reviewer is always a separate fresh agent.
|
|
50
|
-
- **Fresh worker per phase** — do not reuse one worker to grind all phases.
|
|
51
|
-
- Small commits, explicit paths, no AI attribution, no push unless the operator says so.
|
|
52
|
-
- The orchestrator stays thin: it spawns, waits (`wait_for_instructions`), reviews via a reviewer,
|
|
53
|
-
commits, and advances — it does not do the phase work itself.
|
|
54
|
-
|
|
55
|
-
### Anti-patterns
|
|
56
|
-
- ❌ One worker running phases A→Z in a single long session (context drift, huge diff, no isolation).
|
|
57
|
-
- ❌ The building worker reviewing its own phase.
|
|
58
|
-
- ❌ Advancing to the next phase before the current phase's review is addressed and committed.
|
|
59
|
-
- ❌ Pushing / deploying mid-pipeline unless explicitly instructed.
|