@sbugallo/opencode-vpet 0.0.0 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +833 -3
- package/dist/adapters/opencode/create-server-hooks.d.ts +39 -0
- package/dist/adapters/opencode/create-server-hooks.d.ts.map +1 -0
- package/dist/adapters/opencode/session-messages.d.ts +15 -0
- package/dist/adapters/opencode/session-messages.d.ts.map +1 -0
- package/dist/adapters/opencode/usage-event-mapper.d.ts +5 -0
- package/dist/adapters/opencode/usage-event-mapper.d.ts.map +1 -0
- package/dist/adapters/opencode/vpet-toast.d.ts +29 -0
- package/dist/adapters/opencode/vpet-toast.d.ts.map +1 -0
- package/dist/adapters/sqlite/app-data-path.d.ts +6 -0
- package/dist/adapters/sqlite/app-data-path.d.ts.map +1 -0
- package/dist/adapters/sqlite/bun-sqlite-driver.d.ts +12 -0
- package/dist/adapters/sqlite/bun-sqlite-driver.d.ts.map +1 -0
- package/dist/adapters/sqlite/sqlite-migrations.d.ts +9 -0
- package/dist/adapters/sqlite/sqlite-migrations.d.ts.map +1 -0
- package/dist/adapters/sqlite/sqlite-sidebar-snapshot-reader.d.ts +7 -0
- package/dist/adapters/sqlite/sqlite-sidebar-snapshot-reader.d.ts.map +1 -0
- package/dist/adapters/sqlite/sqlite-vpet-archive-reader.d.ts +12 -0
- package/dist/adapters/sqlite/sqlite-vpet-archive-reader.d.ts.map +1 -0
- package/dist/adapters/sqlite/sqlite-vpet-schema.d.ts +47 -0
- package/dist/adapters/sqlite/sqlite-vpet-schema.d.ts.map +1 -0
- package/dist/adapters/sqlite/sqlite-vpet-types.d.ts +43 -0
- package/dist/adapters/sqlite/sqlite-vpet-types.d.ts.map +1 -0
- package/dist/adapters/sqlite/sqlite-vpet-write-store.d.ts +9 -0
- package/dist/adapters/sqlite/sqlite-vpet-write-store.d.ts.map +1 -0
- package/dist/application/models/sidebar-card-inputs.d.ts +13 -0
- package/dist/application/models/sidebar-card-inputs.d.ts.map +1 -0
- package/dist/application/models/spawn-partner.d.ts +10 -0
- package/dist/application/models/spawn-partner.d.ts.map +1 -0
- package/dist/application/models/usage.d.ts +30 -0
- package/dist/application/models/usage.d.ts.map +1 -0
- package/dist/application/models/vpet-archive.d.ts +22 -0
- package/dist/application/models/vpet-archive.d.ts.map +1 -0
- package/dist/application/models/vpet-control.d.ts +18 -0
- package/dist/application/models/vpet-control.d.ts.map +1 -0
- package/dist/application/ports/partner-lifecycle.d.ts +6 -0
- package/dist/application/ports/partner-lifecycle.d.ts.map +1 -0
- package/dist/application/ports/sidebar-snapshot.d.ts +12 -0
- package/dist/application/ports/sidebar-snapshot.d.ts.map +1 -0
- package/dist/application/ports/usage-ledger.d.ts +6 -0
- package/dist/application/ports/usage-ledger.d.ts.map +1 -0
- package/dist/application/ports/vpet-archive.d.ts +5 -0
- package/dist/application/ports/vpet-archive.d.ts.map +1 -0
- package/dist/application/ports/vpet-control.d.ts +7 -0
- package/dist/application/ports/vpet-control.d.ts.map +1 -0
- package/dist/application/use-cases/freeze-vpet.d.ts +4 -0
- package/dist/application/use-cases/freeze-vpet.d.ts.map +1 -0
- package/dist/application/use-cases/get-sidebar-card-inputs.d.ts +5 -0
- package/dist/application/use-cases/get-sidebar-card-inputs.d.ts.map +1 -0
- package/dist/application/use-cases/reconcile-usage.d.ts +14 -0
- package/dist/application/use-cases/reconcile-usage.d.ts.map +1 -0
- package/dist/application/use-cases/record-usage.d.ts +14 -0
- package/dist/application/use-cases/record-usage.d.ts.map +1 -0
- package/dist/application/use-cases/set-vpet-cheat-node.d.ts +4 -0
- package/dist/application/use-cases/set-vpet-cheat-node.d.ts.map +1 -0
- package/dist/application/use-cases/spawn-partner.d.ts +4 -0
- package/dist/application/use-cases/spawn-partner.d.ts.map +1 -0
- package/dist/application/use-cases/unfreeze-vpet.d.ts +4 -0
- package/dist/application/use-cases/unfreeze-vpet.d.ts.map +1 -0
- package/dist/cli/config.d.ts +17 -0
- package/dist/cli/config.d.ts.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +147 -0
- package/dist/cli.js.map +11 -0
- package/dist/commands/vpet-command-result.d.ts +18 -0
- package/dist/commands/vpet-command-result.d.ts.map +1 -0
- package/dist/commands/vpet-freeze.d.ts +8 -0
- package/dist/commands/vpet-freeze.d.ts.map +1 -0
- package/dist/commands/vpet-set.d.ts +11 -0
- package/dist/commands/vpet-set.d.ts.map +1 -0
- package/dist/commands/vpet-spawn.d.ts +9 -0
- package/dist/commands/vpet-spawn.d.ts.map +1 -0
- package/dist/commands/vpet-unfreeze.d.ts +8 -0
- package/dist/commands/vpet-unfreeze.d.ts.map +1 -0
- package/dist/config/defaults.d.ts +69 -0
- package/dist/config/defaults.d.ts.map +1 -0
- package/dist/config/global-vpet-settings.d.ts +17 -0
- package/dist/config/global-vpet-settings.d.ts.map +1 -0
- package/dist/config/normalize.d.ts +3 -0
- package/dist/config/normalize.d.ts.map +1 -0
- package/dist/config/types.d.ts +14 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/data/catalog.d.ts +15 -0
- package/dist/data/catalog.d.ts.map +1 -0
- package/dist/data/digimon-data.d.ts +13 -0
- package/dist/data/digimon-data.d.ts.map +1 -0
- package/dist/data/monster-frame-catalog.d.ts +17 -0
- package/dist/data/monster-frame-catalog.d.ts.map +1 -0
- package/dist/data/monster-frame-data.d.ts +3 -0
- package/dist/data/monster-frame-data.d.ts.map +1 -0
- package/dist/data/stages.d.ts +17 -0
- package/dist/data/stages.d.ts.map +1 -0
- package/dist/domain/digimon-node.d.ts +15 -0
- package/dist/domain/digimon-node.d.ts.map +1 -0
- package/dist/domain/evolution.d.ts +21 -0
- package/dist/domain/evolution.d.ts.map +1 -0
- package/dist/domain/partner.d.ts +15 -0
- package/dist/domain/partner.d.ts.map +1 -0
- package/dist/domain/stage.d.ts +4 -0
- package/dist/domain/stage.d.ts.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7265 -0
- package/dist/index.js.map +36 -0
- package/dist/tui/dex-view-model.d.ts +20 -0
- package/dist/tui/dex-view-model.d.ts.map +1 -0
- package/dist/tui/history-view-model.d.ts +21 -0
- package/dist/tui/history-view-model.d.ts.map +1 -0
- package/dist/tui/monster-action-policy.d.ts +7 -0
- package/dist/tui/monster-action-policy.d.ts.map +1 -0
- package/dist/tui/monster-animation.d.ts +72 -0
- package/dist/tui/monster-animation.d.ts.map +1 -0
- package/dist/tui/monster-artwork-mirror.d.ts +23 -0
- package/dist/tui/monster-artwork-mirror.d.ts.map +1 -0
- package/dist/tui/monster-walking-policy.d.ts +43 -0
- package/dist/tui/monster-walking-policy.d.ts.map +1 -0
- package/dist/tui/open-in-browser.d.ts +3 -0
- package/dist/tui/open-in-browser.d.ts.map +1 -0
- package/dist/tui/sidebar-card.d.ts +10 -0
- package/dist/tui/sidebar-card.d.ts.map +1 -0
- package/dist/tui/sidebar-poll-loop.d.ts +14 -0
- package/dist/tui/sidebar-poll-loop.d.ts.map +1 -0
- package/dist/tui/sidebar-view-model.d.ts +20 -0
- package/dist/tui/sidebar-view-model.d.ts.map +1 -0
- package/dist/tui/vpet-command-layer.d.ts +21 -0
- package/dist/tui/vpet-command-layer.d.ts.map +1 -0
- package/dist/tui/vpet-dex-dialog.d.ts +12 -0
- package/dist/tui/vpet-dex-dialog.d.ts.map +1 -0
- package/dist/tui/vpet-history-dialog.d.ts +12 -0
- package/dist/tui/vpet-history-dialog.d.ts.map +1 -0
- package/dist/tui.d.ts +50 -0
- package/dist/tui.d.ts.map +1 -0
- package/dist/tui.js +59241 -0
- package/dist/tui.js.map +38 -0
- package/package.json +84 -5
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Hooks } from "@opencode-ai/plugin";
|
|
2
|
+
import type { VpetLanguage } from "../../config/types.ts";
|
|
3
|
+
import type { DigimonCatalog } from "../../data/catalog.ts";
|
|
4
|
+
import type { PartnerLifecycle } from "../../application/ports/partner-lifecycle.ts";
|
|
5
|
+
import type { UsageLedger } from "../../application/ports/usage-ledger.ts";
|
|
6
|
+
import type { VpetControl } from "../../application/ports/vpet-control.ts";
|
|
7
|
+
import { type EvolutionSelector, type StageThresholds } from "../../domain/evolution.ts";
|
|
8
|
+
import type { SessionMessagesFetcher } from "./session-messages.ts";
|
|
9
|
+
import { type VpetToastNotifier } from "./vpet-toast.ts";
|
|
10
|
+
export type ServerResource = {
|
|
11
|
+
close(): Promise<void>;
|
|
12
|
+
};
|
|
13
|
+
export type ServerHookDependencies = {
|
|
14
|
+
readonly repository: PartnerLifecycle & UsageLedger & VpetControl;
|
|
15
|
+
readonly resource: ServerResource;
|
|
16
|
+
readonly evolutionSelector?: EvolutionSelector;
|
|
17
|
+
readonly evolutionThresholds?: StageThresholds;
|
|
18
|
+
readonly fetchMessages?: SessionMessagesFetcher;
|
|
19
|
+
readonly language?: VpetLanguage;
|
|
20
|
+
readonly notificationsEnabled?: boolean;
|
|
21
|
+
readonly loadCatalog?: () => Promise<DigimonCatalog>;
|
|
22
|
+
readonly notify?: VpetToastNotifier;
|
|
23
|
+
};
|
|
24
|
+
export declare const createCommandConfig: () => {
|
|
25
|
+
"vpet-spawn": {
|
|
26
|
+
template: string;
|
|
27
|
+
};
|
|
28
|
+
"vpet-freeze": {
|
|
29
|
+
template: string;
|
|
30
|
+
};
|
|
31
|
+
"vpet-unfreeze": {
|
|
32
|
+
template: string;
|
|
33
|
+
};
|
|
34
|
+
"vpet-set": {
|
|
35
|
+
template: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export declare const createServerHooks: ({ repository, resource, evolutionSelector, evolutionThresholds, fetchMessages, language, notificationsEnabled, loadCatalog, notify, }: ServerHookDependencies) => Hooks;
|
|
39
|
+
//# sourceMappingURL=create-server-hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-server-hooks.d.ts","sourceRoot":"","sources":["../../../src/adapters/opencode/create-server-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAQhD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAA;AACpF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAA;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAA;AAI1E,OAAO,EAA0B,KAAK,iBAAiB,EAAE,KAAK,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAChH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAEnE,OAAO,EAAwC,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAE9F,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,CAAC,UAAU,EAAE,gBAAgB,GAAG,WAAW,GAAG,WAAW,CAAA;IACjE,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAA;IACjC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;IAC9C,QAAQ,CAAC,mBAAmB,CAAC,EAAE,eAAe,CAAA;IAC9C,QAAQ,CAAC,aAAa,CAAC,EAAE,sBAAsB,CAAA;IAC/C,QAAQ,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAA;IAChC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAA;IACvC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC,cAAc,CAAC,CAAA;IACpD,QAAQ,CAAC,MAAM,CAAC,EAAE,iBAAiB,CAAA;CACpC,CAAA;AA4CD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;CAK9B,CAAA;AAEF,eAAO,MAAM,iBAAiB,GAAI,uIAU/B,sBAAsB,KAAG,KAqH3B,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Message, SessionMessagesResponse } from "@opencode-ai/sdk";
|
|
2
|
+
export type SessionMessagesFetcher = (sessionID: string) => Promise<readonly Message[]>;
|
|
3
|
+
export type SessionMessagesClient = {
|
|
4
|
+
readonly session: {
|
|
5
|
+
messages: (options: {
|
|
6
|
+
readonly path: {
|
|
7
|
+
readonly id: string;
|
|
8
|
+
};
|
|
9
|
+
}) => Promise<{
|
|
10
|
+
readonly data: SessionMessagesResponse | undefined;
|
|
11
|
+
}>;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare const createSessionMessagesFetcher: (client: SessionMessagesClient) => SessionMessagesFetcher;
|
|
15
|
+
//# sourceMappingURL=session-messages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-messages.d.ts","sourceRoot":"","sources":["../../../src/adapters/opencode/session-messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAExE,MAAM,MAAM,sBAAsB,GAAG,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,OAAO,EAAE,CAAC,CAAA;AAEvF,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,CAAC,OAAO,EAAE;QAChB,QAAQ,EAAE,CAAC,OAAO,EAAE;YAAE,QAAQ,CAAC,IAAI,EAAE;gBAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;aAAE,CAAA;SAAE,KAAK,OAAO,CAAC;YACzE,QAAQ,CAAC,IAAI,EAAE,uBAAuB,GAAG,SAAS,CAAA;SACnD,CAAC,CAAA;KACH,CAAA;CACF,CAAA;AAED,eAAO,MAAM,4BAA4B,GAAI,QAAQ,qBAAqB,KAAG,sBAM5E,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Event, Message } from "@opencode-ai/sdk";
|
|
2
|
+
import type { CompletedUsage } from "../../application/use-cases/record-usage.ts";
|
|
3
|
+
export declare const toCompletedUsageFromMessage: (message: Message) => CompletedUsage | null;
|
|
4
|
+
export declare const toCompletedUsageFromEvent: (event: Event) => CompletedUsage | null;
|
|
5
|
+
//# sourceMappingURL=usage-event-mapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-event-mapper.d.ts","sourceRoot":"","sources":["../../../src/adapters/opencode/usage-event-mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAExE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAA;AAMjF,eAAO,MAAM,2BAA2B,GAAI,SAAS,OAAO,KAAG,cAAc,GAAG,IAiB/E,CAAA;AAED,eAAO,MAAM,yBAAyB,GAAI,OAAO,KAAK,KAAG,cAAc,GAAG,IAGzE,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { VpetLanguage } from "../../config/types.ts";
|
|
2
|
+
import type { DigimonCatalog } from "../../data/catalog.ts";
|
|
3
|
+
export type VpetToastPayload = Readonly<{
|
|
4
|
+
readonly title: string;
|
|
5
|
+
readonly message: string;
|
|
6
|
+
readonly variant: "info" | "success";
|
|
7
|
+
readonly duration: number;
|
|
8
|
+
}>;
|
|
9
|
+
export type VpetToastEvent = Readonly<{
|
|
10
|
+
readonly kind: "spawn";
|
|
11
|
+
readonly nodeId: string;
|
|
12
|
+
readonly generation: number;
|
|
13
|
+
}> | Readonly<{
|
|
14
|
+
readonly kind: "freeze";
|
|
15
|
+
}> | Readonly<{
|
|
16
|
+
readonly kind: "unfreeze";
|
|
17
|
+
}> | Readonly<{
|
|
18
|
+
readonly kind: "set";
|
|
19
|
+
readonly nodeId: string;
|
|
20
|
+
}> | Readonly<{
|
|
21
|
+
readonly kind: "evolution";
|
|
22
|
+
readonly fromNodeId: string;
|
|
23
|
+
readonly toNodeId: string;
|
|
24
|
+
}>;
|
|
25
|
+
export type VpetToastNotifier = (payload: VpetToastPayload) => Promise<void>;
|
|
26
|
+
export type VpetToastTransport = (payload: VpetToastPayload) => boolean | Promise<boolean>;
|
|
27
|
+
export declare const formatVpetToast: (event: VpetToastEvent, language: VpetLanguage, catalog: DigimonCatalog) => VpetToastPayload | undefined;
|
|
28
|
+
export declare const createBestEffortVpetToastNotifier: (transport: VpetToastTransport) => VpetToastNotifier;
|
|
29
|
+
//# sourceMappingURL=vpet-toast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vpet-toast.d.ts","sourceRoot":"","sources":["../../../src/adapters/opencode/vpet-toast.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,KAAK,EAAE,cAAc,EAAe,MAAM,uBAAuB,CAAA;AAExE,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC;IACtC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;IACpC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAC1B,CAAC,CAAA;AAEF,MAAM,MAAM,cAAc,GACtB,QAAQ,CAAC;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC,GAC1F,QAAQ,CAAC;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,GACrC,QAAQ,CAAC;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC,GACvC,QAAQ,CAAC;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,GAC3D,QAAQ,CAAC;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AAEpG,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;AAE5E,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,EAAE,gBAAgB,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;AAsB1F,eAAO,MAAM,eAAe,GAC1B,OAAO,cAAc,EACrB,UAAU,YAAY,EACtB,SAAS,cAAc,KACtB,gBAAgB,GAAG,SA2CrB,CAAA;AAED,eAAO,MAAM,iCAAiC,GAAI,WAAW,kBAAkB,KAAG,iBAQjF,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type HostPathOptions = {
|
|
2
|
+
readonly appDataRoot?: string;
|
|
3
|
+
};
|
|
4
|
+
export declare const resolveHostDataDirectory: (options?: HostPathOptions) => string;
|
|
5
|
+
export declare const resolveHostDatabasePath: (options?: HostPathOptions) => string;
|
|
6
|
+
//# sourceMappingURL=app-data-path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-data-path.d.ts","sourceRoot":"","sources":["../../../src/adapters/sqlite/app-data-path.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAC9B,CAAA;AAeD,eAAO,MAAM,wBAAwB,GAAI,UAAS,eAAoB,KAAG,MAExE,CAAA;AAED,eAAO,MAAM,uBAAuB,GAAI,UAAS,eAAoB,KAAG,MAEvE,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Database } from "bun:sqlite";
|
|
2
|
+
export type QueryValue = string | number | boolean | null;
|
|
3
|
+
export type SqliteExecutor = {
|
|
4
|
+
run: (sql: string, params?: readonly QueryValue[]) => void;
|
|
5
|
+
get: <TRow extends Record<string, QueryValue>>(sql: string, params?: readonly QueryValue[]) => TRow | null;
|
|
6
|
+
all: <TRow extends Record<string, QueryValue>>(sql: string, params?: readonly QueryValue[]) => readonly TRow[];
|
|
7
|
+
transaction: <TReturn>(operation: () => TReturn) => TReturn;
|
|
8
|
+
};
|
|
9
|
+
export declare const createExecutor: (database: Database) => SqliteExecutor;
|
|
10
|
+
export declare const openWritableDatabase: (databasePath: string) => Database;
|
|
11
|
+
export declare const openReadonlyDatabase: (databasePath: string) => Database;
|
|
12
|
+
//# sourceMappingURL=bun-sqlite-driver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bun-sqlite-driver.d.ts","sourceRoot":"","sources":["../../../src/adapters/sqlite/bun-sqlite-driver.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAA;AAEzD,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,UAAU,EAAE,KAAK,IAAI,CAAA;IAC1D,GAAG,EAAE,CAAC,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,UAAU,EAAE,KAAK,IAAI,GAAG,IAAI,CAAA;IAC1G,GAAG,EAAE,CAAC,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,UAAU,EAAE,KAAK,SAAS,IAAI,EAAE,CAAA;IAC9G,WAAW,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,KAAK,OAAO,CAAA;CAC5D,CAAA;AAED,eAAO,MAAM,cAAc,GAAI,UAAU,QAAQ,KAAG,cAalD,CAAA;AAaF,eAAO,MAAM,oBAAoB,GAAI,cAAc,MAAM,KAAG,QAK3D,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,cAAc,MAAM,KAAG,QAI3D,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type QueryValue = string | number | null;
|
|
2
|
+
type SqliteMigrationExecutor = {
|
|
3
|
+
run: (sql: string, params?: readonly QueryValue[]) => void;
|
|
4
|
+
all: <TRow extends Record<string, QueryValue>>(sql: string, params?: readonly QueryValue[]) => readonly TRow[];
|
|
5
|
+
transaction: <TReturn>(operation: () => TReturn) => TReturn;
|
|
6
|
+
};
|
|
7
|
+
export declare const runMigrations: (database: SqliteMigrationExecutor) => readonly number[];
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=sqlite-migrations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqlite-migrations.d.ts","sourceRoot":"","sources":["../../../src/adapters/sqlite/sqlite-migrations.ts"],"names":[],"mappings":"AAAA,KAAK,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;AAExC,KAAK,uBAAuB,GAAG;IAC7B,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,UAAU,EAAE,KAAK,IAAI,CAAA;IAC1D,GAAG,EAAE,CAAC,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,UAAU,EAAE,KAAK,SAAS,IAAI,EAAE,CAAA;IAC9G,WAAW,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,KAAK,OAAO,CAAA;CAC5D,CAAA;AAgHD,eAAO,MAAM,aAAa,GAAI,UAAU,uBAAuB,KAAG,SAAS,MAAM,EAgChF,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SidebarSnapshotReader } from "../../application/ports/sidebar-snapshot.ts";
|
|
2
|
+
import { type HostPathOptions } from "./app-data-path.ts";
|
|
3
|
+
export type CreateSqliteSidebarSnapshotReaderOptions = HostPathOptions & {
|
|
4
|
+
readonly databasePath?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const createSqliteSidebarSnapshotReader: (options?: CreateSqliteSidebarSnapshotReaderOptions) => SidebarSnapshotReader;
|
|
7
|
+
//# sourceMappingURL=sqlite-sidebar-snapshot-reader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqlite-sidebar-snapshot-reader.d.ts","sourceRoot":"","sources":["../../../src/adapters/sqlite/sqlite-sidebar-snapshot-reader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAmB,qBAAqB,EAAE,MAAM,6CAA6C,CAAA;AACzG,OAAO,EAA2B,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAA;AASlF,MAAM,MAAM,wCAAwC,GAAG,eAAe,GAAG;IAAE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAiB3G,eAAO,MAAM,iCAAiC,GAC5C,UAAS,wCAA6C,KACrD,qBA6CF,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SQLiteError } from "bun:sqlite";
|
|
2
|
+
import type { VpetArchiveResult } from "../../application/models/vpet-archive.ts";
|
|
3
|
+
import type { VpetArchiveReader } from "../../application/ports/vpet-archive.ts";
|
|
4
|
+
import { type HostPathOptions } from "./app-data-path.ts";
|
|
5
|
+
import { type SqliteExecutor } from "./bun-sqlite-driver.ts";
|
|
6
|
+
export type CreateSqliteVpetArchiveReaderOptions = HostPathOptions & {
|
|
7
|
+
readonly databasePath?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const isRecoverableSqliteReadError: (error: unknown) => error is SQLiteError;
|
|
10
|
+
export declare const readSqliteVpetArchive: (executor: Pick<SqliteExecutor, "all">, close: () => void) => VpetArchiveResult;
|
|
11
|
+
export declare const createSqliteVpetArchiveReader: (options?: CreateSqliteVpetArchiveReaderOptions) => VpetArchiveReader;
|
|
12
|
+
//# sourceMappingURL=sqlite-vpet-archive-reader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqlite-vpet-archive-reader.d.ts","sourceRoot":"","sources":["../../../src/adapters/sqlite/sqlite-vpet-archive-reader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAExC,OAAO,KAAK,EAAwC,iBAAiB,EAAE,MAAM,0CAA0C,CAAA;AACvH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAA;AAChF,OAAO,EAA2B,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAClF,OAAO,EAAwC,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAQlG,MAAM,MAAM,oCAAoC,GAAG,eAAe,GAAG;IAAE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAIvG,eAAO,MAAM,4BAA4B,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,WAMtE,CAAA;AA+BD,eAAO,MAAM,qBAAqB,GAAI,UAAU,IAAI,CAAC,cAAc,EAAE,KAAK,CAAC,EAAE,OAAO,MAAM,IAAI,KAAG,iBAkBhG,CAAA;AAED,eAAO,MAAM,6BAA6B,GACxC,UAAS,oCAAyC,KACjD,iBAgBF,CAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { Partner } from "../../domain/partner.ts";
|
|
2
|
+
import type { PersistedPartnerEvent, PersistedPartnerEventKind, UsageReceiptRecord } from "./sqlite-vpet-types.ts";
|
|
3
|
+
export type PersistedPartnerRow = {
|
|
4
|
+
readonly partner_id: string;
|
|
5
|
+
readonly generation: number;
|
|
6
|
+
readonly current_node_id: string;
|
|
7
|
+
readonly gauge: number;
|
|
8
|
+
readonly is_terminal: number;
|
|
9
|
+
readonly created_at: string;
|
|
10
|
+
readonly retired_at: string | null;
|
|
11
|
+
};
|
|
12
|
+
export type PersistedPartnerEventRow = {
|
|
13
|
+
readonly event_id: string;
|
|
14
|
+
readonly partner_id: string;
|
|
15
|
+
readonly kind: PersistedPartnerEventKind;
|
|
16
|
+
readonly current_node_id: string;
|
|
17
|
+
readonly gauge: number;
|
|
18
|
+
readonly is_terminal: number;
|
|
19
|
+
readonly token_delta: number | null;
|
|
20
|
+
readonly receipt_key: string | null;
|
|
21
|
+
readonly created_at: string;
|
|
22
|
+
};
|
|
23
|
+
export type UsageReceiptRow = {
|
|
24
|
+
readonly receipt_key: string;
|
|
25
|
+
readonly partner_id: string;
|
|
26
|
+
readonly event_id: string;
|
|
27
|
+
readonly token_delta: number;
|
|
28
|
+
readonly cost: number | null;
|
|
29
|
+
readonly created_at: string;
|
|
30
|
+
};
|
|
31
|
+
export type TrainerStateRow = {
|
|
32
|
+
readonly total_tokens: number;
|
|
33
|
+
};
|
|
34
|
+
export type MigrationRow = {
|
|
35
|
+
readonly version: number;
|
|
36
|
+
};
|
|
37
|
+
export declare const ACTIVE_PARTNER_SELECT = "\n SELECT\n partner_id,\n generation,\n current_node_id,\n gauge,\n is_terminal,\n created_at,\n retired_at\n FROM partners\n WHERE retired_at IS NULL\n LIMIT 1\n";
|
|
38
|
+
export declare const PARTNERS_SELECT = "\n SELECT\n partner_id,\n generation,\n current_node_id,\n gauge,\n is_terminal,\n created_at,\n retired_at\n FROM partners\n ORDER BY generation ASC, created_at ASC, partner_id ASC\n";
|
|
39
|
+
export declare const ARCHIVE_PARTNERS_SELECT = "\n SELECT\n partner_id,\n generation,\n current_node_id,\n gauge,\n is_terminal,\n created_at,\n retired_at\n FROM partners\n ORDER BY partner_id ASC\n";
|
|
40
|
+
export declare const PARTNER_BY_GENERATION_SELECT = "\n SELECT\n partner_id,\n generation,\n current_node_id,\n gauge,\n is_terminal,\n created_at,\n retired_at\n FROM partners\n WHERE generation = ?\n LIMIT 1\n";
|
|
41
|
+
export declare const PARTNER_EVENTS_SELECT = "\n SELECT\n event_id,\n partner_id,\n kind,\n current_node_id,\n gauge,\n is_terminal,\n token_delta,\n receipt_key,\n created_at\n FROM partner_events\n WHERE partner_id = ?\n ORDER BY created_at ASC, event_id ASC\n";
|
|
42
|
+
export declare const ARCHIVE_PARTNER_EVENTS_SELECT = "\n SELECT\n event_id,\n partner_id,\n kind,\n current_node_id,\n gauge,\n is_terminal,\n token_delta,\n receipt_key,\n created_at\n FROM partner_events\n ORDER BY partner_id ASC, created_at ASC, event_id ASC\n";
|
|
43
|
+
export declare const USAGE_RECEIPTS_SELECT = "\n SELECT receipt_key, partner_id, event_id, token_delta, cost, created_at\n FROM usage_receipts\n ORDER BY created_at ASC, receipt_key ASC\n";
|
|
44
|
+
export declare const toPartner: (row: PersistedPartnerRow) => Partner;
|
|
45
|
+
export declare const toPersistedPartnerEvent: (row: PersistedPartnerEventRow) => PersistedPartnerEvent;
|
|
46
|
+
export declare const toUsageReceiptRecord: (row: UsageReceiptRow) => UsageReceiptRecord;
|
|
47
|
+
//# sourceMappingURL=sqlite-vpet-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqlite-vpet-schema.d.ts","sourceRoot":"","sources":["../../../src/adapters/sqlite/sqlite-vpet-schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,KAAK,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAElH,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;IAChC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CACnC,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,IAAI,EAAE,yBAAyB,CAAA;IACxC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;IAChC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IACnC,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IACnC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAC5B,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAC5B,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAC9B,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB,CAAA;AAED,eAAO,MAAM,qBAAqB,gMAYjC,CAAA;AAED,eAAO,MAAM,eAAe,oNAW3B,CAAA;AAED,eAAO,MAAM,uBAAuB,oLAWnC,CAAA;AAED,eAAO,MAAM,4BAA4B,4LAYxC,CAAA;AAED,eAAO,MAAM,qBAAqB,4PAcjC,CAAA;AAED,eAAO,MAAM,6BAA6B,oPAazC,CAAA;AAED,eAAO,MAAM,qBAAqB,qJAIjC,CAAA;AAED,eAAO,MAAM,SAAS,GAAI,KAAK,mBAAmB,KAAG,OAUpD,CAAA;AAED,eAAO,MAAM,uBAAuB,GAAI,KAAK,wBAAwB,KAAG,qBAYvE,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,KAAK,eAAe,KAAG,kBAQ3D,CAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { Partner, PartnerProgression } from "../../domain/partner.ts";
|
|
2
|
+
import type { SpawnPartnerInput } from "../../application/models/spawn-partner.ts";
|
|
3
|
+
import type { ApplyUsageReceiptOutcome, UsageReceiptMetadata } from "../../application/models/usage.ts";
|
|
4
|
+
import type { PartnerLifecycle } from "../../application/ports/partner-lifecycle.ts";
|
|
5
|
+
import type { UsageLedger } from "../../application/ports/usage-ledger.ts";
|
|
6
|
+
import type { VpetControl } from "../../application/ports/vpet-control.ts";
|
|
7
|
+
export type PersistedPartner = Partner;
|
|
8
|
+
export type PersistedPartnerEventKind = "spawned" | "usage_applied" | "retired";
|
|
9
|
+
export type PersistedPartnerEvent = {
|
|
10
|
+
readonly eventId: string;
|
|
11
|
+
readonly partnerId: string;
|
|
12
|
+
readonly kind: PersistedPartnerEventKind;
|
|
13
|
+
readonly currentNodeId: string;
|
|
14
|
+
readonly gauge: number;
|
|
15
|
+
readonly isTerminal: boolean;
|
|
16
|
+
readonly tokenDelta: number | null;
|
|
17
|
+
readonly receiptKey: string | null;
|
|
18
|
+
readonly createdAt: string;
|
|
19
|
+
};
|
|
20
|
+
export type UsageReceiptRecord = {
|
|
21
|
+
readonly receiptKey: string;
|
|
22
|
+
readonly partnerId: string;
|
|
23
|
+
readonly eventId: string;
|
|
24
|
+
readonly tokenDelta: number;
|
|
25
|
+
readonly createdAt: string;
|
|
26
|
+
};
|
|
27
|
+
export type TrainerState = {
|
|
28
|
+
readonly totalTokens: number;
|
|
29
|
+
};
|
|
30
|
+
export type PersistedPartnerSummary = Partner;
|
|
31
|
+
export type SqliteVpetWriteStore = PartnerLifecycle & UsageLedger & VpetControl & {
|
|
32
|
+
close: () => Promise<void>;
|
|
33
|
+
readonly databasePath: string;
|
|
34
|
+
getAppliedMigrations: () => readonly number[];
|
|
35
|
+
getTrainerState: () => TrainerState;
|
|
36
|
+
getActivePartner: () => PersistedPartner | null;
|
|
37
|
+
listPartners: () => readonly PersistedPartnerSummary[];
|
|
38
|
+
getPartnerByGeneration: (generation: number) => PersistedPartnerSummary | null;
|
|
39
|
+
listPartnerEvents: (partnerId: string) => readonly PersistedPartnerEvent[];
|
|
40
|
+
listUsageReceipts: () => readonly UsageReceiptRecord[];
|
|
41
|
+
};
|
|
42
|
+
export type { ApplyUsageReceiptOutcome, PartnerProgression, SpawnPartnerInput, UsageReceiptMetadata };
|
|
43
|
+
//# sourceMappingURL=sqlite-vpet-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqlite-vpet-types.d.ts","sourceRoot":"","sources":["../../../src/adapters/sqlite/sqlite-vpet-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC1E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAClF,OAAO,KAAK,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AACvG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAA;AACpF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAA;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAA;AAE1E,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAA;AAEtC,MAAM,MAAM,yBAAyB,GAAG,SAAS,GAAG,eAAe,GAAG,SAAS,CAAA;AAE/E,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,IAAI,EAAE,yBAAyB,CAAA;IACxC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IAClC,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAC7B,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG,OAAO,CAAA;AAE7C,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,GACjD,WAAW,GACX,WAAW,GAAG;IACZ,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IAC1B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,oBAAoB,EAAE,MAAM,SAAS,MAAM,EAAE,CAAA;IAC7C,eAAe,EAAE,MAAM,YAAY,CAAA;IACnC,gBAAgB,EAAE,MAAM,gBAAgB,GAAG,IAAI,CAAA;IAC/C,YAAY,EAAE,MAAM,SAAS,uBAAuB,EAAE,CAAA;IACtD,sBAAsB,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,uBAAuB,GAAG,IAAI,CAAA;IAC9E,iBAAiB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,SAAS,qBAAqB,EAAE,CAAA;IAC1E,iBAAiB,EAAE,MAAM,SAAS,kBAAkB,EAAE,CAAA;CACvD,CAAA;AAEH,YAAY,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { resolveHostDatabasePath, type HostPathOptions } from "./app-data-path.ts";
|
|
2
|
+
import type { SqliteVpetWriteStore } from "./sqlite-vpet-types.ts";
|
|
3
|
+
export type CreateSqliteVpetRepositoryOptions = HostPathOptions & {
|
|
4
|
+
readonly databasePath?: string;
|
|
5
|
+
};
|
|
6
|
+
export { resolveHostDatabasePath };
|
|
7
|
+
export type { PersistedPartnerEvent, SqliteVpetWriteStore } from "./sqlite-vpet-types.ts";
|
|
8
|
+
export declare const createSqliteVpetRepository: (options?: CreateSqliteVpetRepositoryOptions) => Promise<SqliteVpetWriteStore>;
|
|
9
|
+
//# sourceMappingURL=sqlite-vpet-write-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqlite-vpet-write-store.d.ts","sourceRoot":"","sources":["../../../src/adapters/sqlite/sqlite-vpet-write-store.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAAE,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAiBlF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAElE,MAAM,MAAM,iCAAiC,GAAG,eAAe,GAAG;IAAE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAWpG,OAAO,EAAE,uBAAuB,EAAE,CAAA;AAClC,YAAY,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAEzF,eAAO,MAAM,0BAA0B,GACrC,UAAS,iCAAsC,KAC9C,OAAO,CAAC,oBAAoB,CA6L9B,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { DigimonNode } from "../../domain/digimon-node.ts";
|
|
2
|
+
export type SidebarCardInputs = {
|
|
3
|
+
readonly kind: "no_partner";
|
|
4
|
+
} | {
|
|
5
|
+
readonly kind: "partner";
|
|
6
|
+
readonly node: DigimonNode;
|
|
7
|
+
readonly gauge: number;
|
|
8
|
+
readonly isTerminal: boolean;
|
|
9
|
+
readonly frozen: boolean;
|
|
10
|
+
readonly isSetOverride: boolean;
|
|
11
|
+
readonly trainerTotalTokens: number;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=sidebar-card-inputs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar-card-inputs.d.ts","sourceRoot":"","sources":["../../../src/application/models/sidebar-card-inputs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAE/D,MAAM,MAAM,iBAAiB,GACzB;IAAE,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAA;CAAE,GAC/B;IACE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;IACxB,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;IAC5B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAA;IAC/B,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAA;CACpC,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type SpawnPartnerInput = {
|
|
2
|
+
readonly currentNodeId: string;
|
|
3
|
+
readonly gauge: number;
|
|
4
|
+
readonly isTerminal: boolean;
|
|
5
|
+
readonly createdAt: string;
|
|
6
|
+
};
|
|
7
|
+
export type SpawnPartnerResult = {
|
|
8
|
+
readonly generation: number;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=spawn-partner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spawn-partner.d.ts","sourceRoot":"","sources":["../../../src/application/models/spawn-partner.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAC5B,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export type UsageReceiptMetadata = {
|
|
2
|
+
readonly receiptKey: string;
|
|
3
|
+
readonly eventId: string;
|
|
4
|
+
readonly tokenDelta: number;
|
|
5
|
+
readonly cost?: number | null;
|
|
6
|
+
readonly createdAt: string;
|
|
7
|
+
};
|
|
8
|
+
export type ApplyUsageReceiptOutcome = {
|
|
9
|
+
readonly kind: "applied";
|
|
10
|
+
} | {
|
|
11
|
+
readonly kind: "duplicate";
|
|
12
|
+
} | {
|
|
13
|
+
readonly kind: "no_active_partner";
|
|
14
|
+
};
|
|
15
|
+
export type UsageEvolutionTransition = {
|
|
16
|
+
readonly fromNodeId: string;
|
|
17
|
+
readonly toNodeId: string;
|
|
18
|
+
};
|
|
19
|
+
export type UsageProcessingResult = {
|
|
20
|
+
readonly kind: "applied";
|
|
21
|
+
readonly receiptKey: string;
|
|
22
|
+
readonly evolution?: UsageEvolutionTransition;
|
|
23
|
+
} | {
|
|
24
|
+
readonly kind: "duplicate";
|
|
25
|
+
readonly receiptKey: string;
|
|
26
|
+
} | {
|
|
27
|
+
readonly kind: "no_active_partner";
|
|
28
|
+
readonly receiptKey: string;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=usage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../../src/application/models/usage.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,wBAAwB,GAChC;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;CAAE,GAC5B;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;CAAE,GAC9B;IAAE,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAA;CAAE,CAAA;AAE1C,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,qBAAqB,GAC7B;IACE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;IACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,wBAAwB,CAAA;CAC9C,GACD;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAC3D;IAAE,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC;IAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type VpetArchiveEvent = {
|
|
2
|
+
readonly eventId: string;
|
|
3
|
+
readonly currentNodeId: string;
|
|
4
|
+
readonly createdAt: string;
|
|
5
|
+
};
|
|
6
|
+
export type VpetArchivePartner = {
|
|
7
|
+
readonly partnerId: string;
|
|
8
|
+
readonly generation: number;
|
|
9
|
+
readonly createdAt: string;
|
|
10
|
+
readonly retiredAt: string | null;
|
|
11
|
+
readonly events: readonly VpetArchiveEvent[];
|
|
12
|
+
};
|
|
13
|
+
export type VpetArchiveResult = {
|
|
14
|
+
readonly kind: "available";
|
|
15
|
+
readonly partners: readonly VpetArchivePartner[];
|
|
16
|
+
} | {
|
|
17
|
+
readonly kind: "empty";
|
|
18
|
+
} | {
|
|
19
|
+
readonly kind: "unavailable";
|
|
20
|
+
readonly message: string;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=vpet-archive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vpet-archive.d.ts","sourceRoot":"","sources":["../../../src/application/models/vpet-archive.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,QAAQ,CAAC,MAAM,EAAE,SAAS,gBAAgB,EAAE,CAAA;CAC7C,CAAA;AAED,MAAM,MAAM,iBAAiB,GACzB;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,kBAAkB,EAAE,CAAA;CAAE,GAChF;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;CAAE,GAC1B;IAAE,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type FreezeVpetOutcome = {
|
|
2
|
+
readonly kind: "frozen";
|
|
3
|
+
} | {
|
|
4
|
+
readonly kind: "already_frozen";
|
|
5
|
+
};
|
|
6
|
+
export type UnfreezeVpetOutcome = {
|
|
7
|
+
readonly kind: "unfrozen";
|
|
8
|
+
} | {
|
|
9
|
+
readonly kind: "already_unfrozen";
|
|
10
|
+
};
|
|
11
|
+
export type SetCheatNodeOutcome = {
|
|
12
|
+
readonly kind: "set";
|
|
13
|
+
readonly cheatNodeId: string;
|
|
14
|
+
} | {
|
|
15
|
+
readonly kind: "already_set";
|
|
16
|
+
readonly cheatNodeId: string;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=vpet-control.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vpet-control.d.ts","sourceRoot":"","sources":["../../../src/application/models/vpet-control.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAA;CAAE,CAAA;AAEjG,MAAM,MAAM,mBAAmB,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;CAAE,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAA;CAAE,CAAA;AAEvG,MAAM,MAAM,mBAAmB,GAC3B;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GACtD;IAAE,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Partner } from "../../domain/partner.ts";
|
|
2
|
+
import type { SpawnPartnerInput } from "../models/spawn-partner.ts";
|
|
3
|
+
export type PartnerLifecycle = {
|
|
4
|
+
spawnPartner: (input: SpawnPartnerInput) => Partner;
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=partner-lifecycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"partner-lifecycle.d.ts","sourceRoot":"","sources":["../../../src/application/ports/partner-lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAEnE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,YAAY,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,OAAO,CAAA;CACpD,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type SidebarSnapshot = {
|
|
2
|
+
readonly currentNodeId: string;
|
|
3
|
+
readonly gauge: number;
|
|
4
|
+
readonly isTerminal: boolean;
|
|
5
|
+
readonly frozen: boolean;
|
|
6
|
+
readonly isSetOverride: boolean;
|
|
7
|
+
readonly trainerTotalTokens: number;
|
|
8
|
+
};
|
|
9
|
+
export type SidebarSnapshotReader = {
|
|
10
|
+
getSidebarSnapshot: () => SidebarSnapshot | null;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=sidebar-snapshot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar-snapshot.d.ts","sourceRoot":"","sources":["../../../src/application/ports/sidebar-snapshot.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;IAC5B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAA;IAC/B,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAA;CACpC,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,kBAAkB,EAAE,MAAM,eAAe,GAAG,IAAI,CAAA;CACjD,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Partner, PartnerProgression } from "../../domain/partner.ts";
|
|
2
|
+
import type { ApplyUsageReceiptOutcome, UsageReceiptMetadata } from "../models/usage.ts";
|
|
3
|
+
export type UsageLedger = {
|
|
4
|
+
applyUsageReceipt: (metadata: UsageReceiptMetadata, evolve: (partner: Partner) => PartnerProgression) => ApplyUsageReceiptOutcome;
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=usage-ledger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-ledger.d.ts","sourceRoot":"","sources":["../../../src/application/ports/usage-ledger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC1E,OAAO,KAAK,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAExF,MAAM,MAAM,WAAW,GAAG;IACxB,iBAAiB,EAAE,CACjB,QAAQ,EAAE,oBAAoB,EAC9B,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,kBAAkB,KAC7C,wBAAwB,CAAA;CAC9B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vpet-archive.d.ts","sourceRoot":"","sources":["../../../src/application/ports/vpet-archive.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAElE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,EAAE,MAAM,iBAAiB,CAAA;CACpC,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FreezeVpetOutcome, SetCheatNodeOutcome, UnfreezeVpetOutcome } from "../models/vpet-control.ts";
|
|
2
|
+
export type VpetControl = {
|
|
3
|
+
freeze: () => FreezeVpetOutcome;
|
|
4
|
+
unfreeze: () => UnfreezeVpetOutcome;
|
|
5
|
+
setCheatNode: (validatedNodeId: string) => SetCheatNodeOutcome;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=vpet-control.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vpet-control.d.ts","sourceRoot":"","sources":["../../../src/application/ports/vpet-control.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAE5G,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,MAAM,iBAAiB,CAAA;IAC/B,QAAQ,EAAE,MAAM,mBAAmB,CAAA;IACnC,YAAY,EAAE,CAAC,eAAe,EAAE,MAAM,KAAK,mBAAmB,CAAA;CAC/D,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"freeze-vpet.d.ts","sourceRoot":"","sources":["../../../src/application/use-cases/freeze-vpet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAE3D,eAAO,MAAM,UAAU,GAAI,SAAS,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,KAAG,iBAAqC,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DigimonCatalog } from "../../domain/digimon-node.ts";
|
|
2
|
+
import type { SidebarCardInputs } from "../models/sidebar-card-inputs.ts";
|
|
3
|
+
import type { SidebarSnapshotReader } from "../ports/sidebar-snapshot.ts";
|
|
4
|
+
export declare const getSidebarCardInputs: (reader: SidebarSnapshotReader, catalog: DigimonCatalog) => SidebarCardInputs;
|
|
5
|
+
//# sourceMappingURL=get-sidebar-card-inputs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-sidebar-card-inputs.d.ts","sourceRoot":"","sources":["../../../src/application/use-cases/get-sidebar-card-inputs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAClE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AACzE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AAIzE,eAAO,MAAM,oBAAoB,GAAI,QAAQ,qBAAqB,EAAE,SAAS,cAAc,KAAG,iBAgB7F,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DigimonNode } from "../../domain/digimon-node.ts";
|
|
2
|
+
import type { EvolutionSelector, StageThresholds } from "../../domain/evolution.ts";
|
|
3
|
+
import type { UsageProcessingResult } from "../models/usage.ts";
|
|
4
|
+
import type { UsageLedger } from "../ports/usage-ledger.ts";
|
|
5
|
+
import { type CompletedUsage } from "./record-usage.ts";
|
|
6
|
+
export type ReconcileUsageInput = {
|
|
7
|
+
readonly usages: readonly CompletedUsage[];
|
|
8
|
+
readonly ledger: UsageLedger;
|
|
9
|
+
readonly digimonById: ReadonlyMap<string, DigimonNode>;
|
|
10
|
+
readonly selector: EvolutionSelector;
|
|
11
|
+
readonly thresholds: StageThresholds;
|
|
12
|
+
};
|
|
13
|
+
export declare const reconcileUsage: ({ usages, ledger, digimonById, selector, thresholds, }: ReconcileUsageInput) => readonly UsageProcessingResult[];
|
|
14
|
+
//# sourceMappingURL=reconcile-usage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reconcile-usage.d.ts","sourceRoot":"","sources":["../../../src/application/use-cases/reconcile-usage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AACnF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAe,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAEpE,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,MAAM,EAAE,SAAS,cAAc,EAAE,CAAA;IAC1C,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;IAC5B,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;IACtD,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAA;IACpC,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAA;CACrC,CAAA;AAED,eAAO,MAAM,cAAc,GAAI,wDAM5B,mBAAmB,KAAG,SAAS,qBAAqB,EAMtD,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DigimonNode } from "../../domain/digimon-node.ts";
|
|
2
|
+
import { type EvolutionSelector, type StageThresholds } from "../../domain/evolution.ts";
|
|
3
|
+
import type { UsageProcessingResult, UsageReceiptMetadata } from "../models/usage.ts";
|
|
4
|
+
import type { UsageLedger } from "../ports/usage-ledger.ts";
|
|
5
|
+
export type CompletedUsage = UsageReceiptMetadata;
|
|
6
|
+
export type RecordUsageInput = {
|
|
7
|
+
readonly usage: CompletedUsage;
|
|
8
|
+
readonly ledger: UsageLedger;
|
|
9
|
+
readonly digimonById: ReadonlyMap<string, DigimonNode>;
|
|
10
|
+
readonly selector: EvolutionSelector;
|
|
11
|
+
readonly thresholds: StageThresholds;
|
|
12
|
+
};
|
|
13
|
+
export declare const recordUsage: ({ usage, ledger, digimonById, selector, thresholds, }: RecordUsageInput) => UsageProcessingResult;
|
|
14
|
+
//# sourceMappingURL=record-usage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-usage.d.ts","sourceRoot":"","sources":["../../../src/application/use-cases/record-usage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC/D,OAAO,EAAsB,KAAK,iBAAiB,EAAE,KAAK,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC5G,OAAO,KAAK,EAA4B,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAC/G,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAE3D,MAAM,MAAM,cAAc,GAAG,oBAAoB,CAAA;AAEjD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAA;IAC9B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;IAC5B,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;IACtD,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAA;IACpC,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAA;CACrC,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,uDAMzB,gBAAgB,KAAG,qBAgCrB,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SetCheatNodeOutcome } from "../models/vpet-control.ts";
|
|
2
|
+
import type { VpetControl } from "../ports/vpet-control.ts";
|
|
3
|
+
export declare const setVpetCheatNode: (control: Pick<VpetControl, "setCheatNode">, validatedNodeId: string) => SetCheatNodeOutcome;
|
|
4
|
+
//# sourceMappingURL=set-vpet-cheat-node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-vpet-cheat-node.d.ts","sourceRoot":"","sources":["../../../src/application/use-cases/set-vpet-cheat-node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAE3D,eAAO,MAAM,gBAAgB,GAC3B,SAAS,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,EAC1C,iBAAiB,MAAM,KACtB,mBAA4D,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { PartnerLifecycle } from "../ports/partner-lifecycle.ts";
|
|
2
|
+
import type { SpawnPartnerResult } from "../models/spawn-partner.ts";
|
|
3
|
+
export declare const spawnPartner: (lifecycle: PartnerLifecycle, createdAt: string) => SpawnPartnerResult;
|
|
4
|
+
//# sourceMappingURL=spawn-partner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spawn-partner.d.ts","sourceRoot":"","sources":["../../../src/application/use-cases/spawn-partner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AACrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAEpE,eAAO,MAAM,YAAY,GAAI,WAAW,gBAAgB,EAAE,WAAW,MAAM,KAAG,kBAS7E,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { UnfreezeVpetOutcome } from "../models/vpet-control.ts";
|
|
2
|
+
import type { VpetControl } from "../ports/vpet-control.ts";
|
|
3
|
+
export declare const unfreezeVpet: (control: Pick<VpetControl, "unfreeze">) => UnfreezeVpetOutcome;
|
|
4
|
+
//# sourceMappingURL=unfreeze-vpet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unfreeze-vpet.d.ts","sourceRoot":"","sources":["../../../src/application/use-cases/unfreeze-vpet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAE3D,eAAO,MAAM,YAAY,GAAI,SAAS,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,KAAG,mBAAyC,CAAA"}
|