@jcendal/opencode-digital-pet 0.2.0-dev.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/CHANGELOG.md +45 -0
- package/LICENSE +201 -0
- package/README.md +843 -0
- package/dist/adapters/opencode/create-server-hooks.d.ts +38 -0
- package/dist/adapters/opencode/digital-pet-toast.d.ts +33 -0
- package/dist/adapters/opencode/session-messages.d.ts +14 -0
- package/dist/adapters/opencode/usage-event-mapper.d.ts +4 -0
- package/dist/adapters/sqlite/bun-sqlite-driver.d.ts +6 -0
- package/dist/adapters/sqlite/sqlite-digital-pet-archive-reader.d.ts +11 -0
- package/dist/adapters/sqlite/sqlite-digital-pet-write-store.d.ts +11 -0
- package/dist/adapters/sqlite/sqlite-sidebar-snapshot-reader.d.ts +8 -0
- package/dist/cli/install.d.ts +8 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +92 -0
- package/dist/commands/digital-pet-command-result.d.ts +17 -0
- package/dist/commands/digital-pet-freeze.d.ts +7 -0
- package/dist/commands/digital-pet-set.d.ts +10 -0
- package/dist/commands/digital-pet-spawn.d.ts +8 -0
- package/dist/commands/digital-pet-unfreeze.d.ts +7 -0
- package/dist/config/global-digital-pet-settings.d.ts +14 -0
- package/dist/dev/attach-dev-tools.js +6465 -0
- package/dist/digital-pet-animation/constants/evolution-battle.d.ts +5 -0
- package/dist/digital-pet-animation/constants/monster-artwork.d.ts +4 -0
- package/dist/digital-pet-animation/constants/presentation-timing.d.ts +19 -0
- package/dist/digital-pet-animation/idle/monster-action-policy.d.ts +7 -0
- package/dist/digital-pet-animation/idle/monster-animation.d.ts +73 -0
- package/dist/digital-pet-animation/idle/monster-artwork-mirror.d.ts +22 -0
- package/dist/digital-pet-animation/idle/monster-walking-policy.d.ts +42 -0
- package/dist/digital-pet-animation/render/positioned-artwork.d.ts +3 -0
- package/dist/digital-pet-animation/sequences/defeat-artwork.d.ts +7 -0
- package/dist/digital-pet-animation/sequences/evolution-artwork.d.ts +8 -0
- package/dist/digital-pet-animation/sequences/evolution-battle-artwork.d.ts +33 -0
- package/dist/digital-pet-animation/sessions/evolution-battle-session.d.ts +14 -0
- package/dist/digital-pet-animation/sessions/evolution-reveal-session.d.ts +9 -0
- package/dist/digital-pet-animation/utils/assert-never.d.ts +1 -0
- package/dist/digital-pet-animation/utils/random.d.ts +2 -0
- package/dist/digital-pet-animation/utils/sleep.d.ts +1 -0
- package/dist/digital-pet-core/adapters/sqlite/app-data-path.d.ts +5 -0
- package/dist/digital-pet-core/adapters/sqlite/sqlite-digital-pet-schema.d.ts +48 -0
- package/dist/digital-pet-core/adapters/sqlite/sqlite-digital-pet-types.d.ts +43 -0
- package/dist/digital-pet-core/adapters/sqlite/sqlite-digital-pet-write-store.d.ts +8 -0
- package/dist/digital-pet-core/adapters/sqlite/sqlite-migrations.d.ts +4 -0
- package/dist/digital-pet-core/application/models/digital-pet-archive.d.ts +21 -0
- package/dist/digital-pet-core/application/models/digital-pet-control.d.ts +17 -0
- package/dist/digital-pet-core/application/models/sidebar-card-inputs.d.ts +13 -0
- package/dist/digital-pet-core/application/models/spawn-partner.d.ts +9 -0
- package/dist/digital-pet-core/application/models/usage.d.ts +42 -0
- package/dist/digital-pet-core/application/ports/digital-pet-archive.d.ts +4 -0
- package/dist/digital-pet-core/application/ports/digital-pet-control.d.ts +6 -0
- package/dist/digital-pet-core/application/ports/partner-lifecycle.d.ts +5 -0
- package/dist/digital-pet-core/application/ports/sidebar-snapshot.d.ts +13 -0
- package/dist/digital-pet-core/application/ports/usage-ledger.d.ts +5 -0
- package/dist/digital-pet-core/application/use-cases/freeze-digital-pet.d.ts +3 -0
- package/dist/digital-pet-core/application/use-cases/get-sidebar-card-inputs.d.ts +4 -0
- package/dist/digital-pet-core/application/use-cases/reconcile-usage.d.ts +14 -0
- package/dist/digital-pet-core/application/use-cases/record-usage.d.ts +14 -0
- package/dist/digital-pet-core/application/use-cases/resolve-evolution-battle.d.ts +8 -0
- package/dist/digital-pet-core/application/use-cases/set-digital-pet-cheat-node.d.ts +3 -0
- package/dist/digital-pet-core/application/use-cases/spawn-partner.d.ts +3 -0
- package/dist/digital-pet-core/application/use-cases/unfreeze-digital-pet.d.ts +3 -0
- package/dist/digital-pet-core/config/defaults.d.ts +68 -0
- package/dist/digital-pet-core/config/normalize.d.ts +2 -0
- package/dist/digital-pet-core/config/types.d.ts +13 -0
- package/dist/digital-pet-core/data/catalog.d.ts +14 -0
- package/dist/digital-pet-core/data/digimon-data.d.ts +12 -0
- package/dist/digital-pet-core/data/monster-frame-catalog.d.ts +16 -0
- package/dist/digital-pet-core/data/monster-frame-data.d.ts +2 -0
- package/dist/digital-pet-core/data/stages.d.ts +16 -0
- package/dist/digital-pet-core/domain/digimon-node.d.ts +14 -0
- package/dist/digital-pet-core/domain/evolution-battle.d.ts +4 -0
- package/dist/digital-pet-core/domain/evolution.d.ts +23 -0
- package/dist/digital-pet-core/domain/partner.d.ts +18 -0
- package/dist/digital-pet-core/domain/stage.d.ts +3 -0
- package/dist/digital-pet-core/ports/sqlite-executor.d.ts +7 -0
- package/dist/digital-pet-core/view-models/dex-view-model.d.ts +19 -0
- package/dist/digital-pet-core/view-models/history-view-model.d.ts +20 -0
- package/dist/digital-pet-core/view-models/sidebar-view-model.d.ts +20 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +7461 -0
- package/dist/tui/digital-pet-command-layer.d.ts +20 -0
- package/dist/tui/digital-pet-dex-dialog.d.ts +11 -0
- package/dist/tui/digital-pet-history-dialog.d.ts +11 -0
- package/dist/tui/open-in-browser.d.ts +2 -0
- package/dist/tui/sidebar-card.d.ts +10 -0
- package/dist/tui/sidebar-poll-loop.d.ts +13 -0
- package/dist/tui.d.ts +56 -0
- package/dist/tui.js +9720 -0
- package/package.json +106 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Hooks } from "@opencode-ai/plugin";
|
|
2
|
+
import type { DigitalPetLanguage } from "../../digital-pet-core/config/types.js";
|
|
3
|
+
import type { DigimonCatalog } from "../../digital-pet-core/data/catalog.js";
|
|
4
|
+
import type { PartnerLifecycle } from "../../digital-pet-core/application/ports/partner-lifecycle.js";
|
|
5
|
+
import type { UsageLedger } from "../../digital-pet-core/application/ports/usage-ledger.js";
|
|
6
|
+
import type { DigitalPetControl } from "../../digital-pet-core/application/ports/digital-pet-control.js";
|
|
7
|
+
import { type EvolutionSelector, type StageThresholds } from "../../digital-pet-core/domain/evolution.js";
|
|
8
|
+
import type { SessionMessagesFetcher } from "./session-messages.js";
|
|
9
|
+
import { type DigitalPetToastNotifier } from "./digital-pet-toast.js";
|
|
10
|
+
export type ServerResource = {
|
|
11
|
+
close(): Promise<void>;
|
|
12
|
+
};
|
|
13
|
+
export type ServerHookDependencies = {
|
|
14
|
+
readonly repository: PartnerLifecycle & UsageLedger & DigitalPetControl;
|
|
15
|
+
readonly resource: ServerResource;
|
|
16
|
+
readonly evolutionSelector?: EvolutionSelector;
|
|
17
|
+
readonly evolutionThresholds?: StageThresholds;
|
|
18
|
+
readonly fetchMessages?: SessionMessagesFetcher;
|
|
19
|
+
readonly language?: DigitalPetLanguage;
|
|
20
|
+
readonly notificationsEnabled?: boolean;
|
|
21
|
+
readonly loadCatalog?: () => Promise<DigimonCatalog>;
|
|
22
|
+
readonly notify?: DigitalPetToastNotifier;
|
|
23
|
+
};
|
|
24
|
+
export declare const createCommandConfig: () => {
|
|
25
|
+
"digital-pet-spawn": {
|
|
26
|
+
template: string;
|
|
27
|
+
};
|
|
28
|
+
"digital-pet-freeze": {
|
|
29
|
+
template: string;
|
|
30
|
+
};
|
|
31
|
+
"digital-pet-unfreeze": {
|
|
32
|
+
template: string;
|
|
33
|
+
};
|
|
34
|
+
"digital-pet-set": {
|
|
35
|
+
template: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export declare const createServerHooks: ({ repository, resource, evolutionSelector, evolutionThresholds, fetchMessages, language, notificationsEnabled, loadCatalog, notify, }: ServerHookDependencies) => Hooks;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { DigitalPetLanguage } from "../../digital-pet-core/config/types.js";
|
|
2
|
+
import type { DigimonCatalog } from "../../digital-pet-core/data/catalog.js";
|
|
3
|
+
export type DigitalPetToastPayload = Readonly<{
|
|
4
|
+
readonly title: string;
|
|
5
|
+
readonly message: string;
|
|
6
|
+
readonly variant: "info" | "success";
|
|
7
|
+
readonly duration: number;
|
|
8
|
+
}>;
|
|
9
|
+
export type DigitalPetToastEvent = 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
|
+
}> | Readonly<{
|
|
25
|
+
readonly kind: "evolution_battle";
|
|
26
|
+
readonly opponentNodeId: string;
|
|
27
|
+
}> | Readonly<{
|
|
28
|
+
readonly kind: "defeat";
|
|
29
|
+
}>;
|
|
30
|
+
export type DigitalPetToastNotifier = (payload: DigitalPetToastPayload) => Promise<void>;
|
|
31
|
+
export type DigitalPetToastTransport = (payload: DigitalPetToastPayload) => boolean | Promise<boolean>;
|
|
32
|
+
export declare const formatDigitalPetToast: (event: DigitalPetToastEvent, language: DigitalPetLanguage, catalog: DigimonCatalog) => DigitalPetToastPayload | undefined;
|
|
33
|
+
export declare const createBestEffortDigitalPetToastNotifier: (transport: DigitalPetToastTransport) => DigitalPetToastNotifier;
|
|
@@ -0,0 +1,14 @@
|
|
|
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;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Event, Message } from "@opencode-ai/sdk";
|
|
2
|
+
import type { CompletedUsage } from "../../digital-pet-core/application/use-cases/record-usage.js";
|
|
3
|
+
export declare const toCompletedUsageFromMessage: (message: Message) => CompletedUsage | null;
|
|
4
|
+
export declare const toCompletedUsageFromEvent: (event: Event) => CompletedUsage | null;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Database } from "bun:sqlite";
|
|
2
|
+
import type { SqliteExecutor } from "../../digital-pet-core/ports/sqlite-executor.js";
|
|
3
|
+
export type { QueryValue, SqliteExecutor } from "../../digital-pet-core/ports/sqlite-executor.js";
|
|
4
|
+
export declare const createExecutor: (database: Database) => SqliteExecutor;
|
|
5
|
+
export declare const openWritableDatabase: (databasePath: string) => Database;
|
|
6
|
+
export declare const openReadonlyDatabase: (databasePath: string) => Database;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SQLiteError } from "bun:sqlite";
|
|
2
|
+
import type { DigitalPetArchiveResult } from "../../digital-pet-core/application/models/digital-pet-archive.js";
|
|
3
|
+
import type { DigitalPetArchiveReader } from "../../digital-pet-core/application/ports/digital-pet-archive.js";
|
|
4
|
+
import { type HostPathOptions } from "../../digital-pet-core/adapters/sqlite/app-data-path.js";
|
|
5
|
+
import { type SqliteExecutor } from "./bun-sqlite-driver.js";
|
|
6
|
+
export type CreateSqliteDigitalPetArchiveReaderOptions = HostPathOptions & {
|
|
7
|
+
readonly databasePath?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const isRecoverableSqliteReadError: (error: unknown) => error is SQLiteError;
|
|
10
|
+
export declare const readSqliteDigitalPetArchive: (executor: Pick<SqliteExecutor, "all">, close: () => void) => DigitalPetArchiveResult;
|
|
11
|
+
export declare const createSqliteDigitalPetArchiveReader: (options?: CreateSqliteDigitalPetArchiveReaderOptions) => DigitalPetArchiveReader;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SqliteDigitalPetWriteStore } from "../../digital-pet-core/adapters/sqlite/sqlite-digital-pet-types.js";
|
|
2
|
+
import { resolveHostDatabasePath, type HostPathOptions } from "../../digital-pet-core/adapters/sqlite/app-data-path.js";
|
|
3
|
+
import type { SidebarSnapshotReader } from "../../digital-pet-core/application/ports/sidebar-snapshot.js";
|
|
4
|
+
export type CreateSqliteDigitalPetRepositoryOptions = HostPathOptions & {
|
|
5
|
+
readonly databasePath?: string;
|
|
6
|
+
};
|
|
7
|
+
export { resolveHostDatabasePath };
|
|
8
|
+
export type { HostPathOptions } from "../../digital-pet-core/adapters/sqlite/app-data-path.js";
|
|
9
|
+
export type { PersistedPartnerEvent, SqliteDigitalPetWriteStore, } from "../../digital-pet-core/adapters/sqlite/sqlite-digital-pet-types.js";
|
|
10
|
+
export type OpencodeSqliteDigitalPetRepository = SqliteDigitalPetWriteStore & SidebarSnapshotReader;
|
|
11
|
+
export declare const createSqliteDigitalPetRepository: (options?: CreateSqliteDigitalPetRepositoryOptions) => Promise<OpencodeSqliteDigitalPetRepository>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SidebarSnapshot, SidebarSnapshotReader } from "../../digital-pet-core/application/ports/sidebar-snapshot.js";
|
|
2
|
+
import { type HostPathOptions } from "../../digital-pet-core/adapters/sqlite/app-data-path.js";
|
|
3
|
+
import type { SqliteExecutor } from "../../digital-pet-core/ports/sqlite-executor.js";
|
|
4
|
+
export type CreateSqliteSidebarSnapshotReaderOptions = HostPathOptions & {
|
|
5
|
+
readonly databasePath?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const readSidebarSnapshotFromExecutor: (executor: Pick<SqliteExecutor, "get">) => SidebarSnapshot | null;
|
|
8
|
+
export declare const createSqliteSidebarSnapshotReader: (options?: CreateSqliteSidebarSnapshotReaderOptions) => SidebarSnapshotReader;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare class OpenCodePluginInstallError extends Error {
|
|
2
|
+
readonly exitCode: number | null;
|
|
3
|
+
readonly name = "OpenCodePluginInstallError";
|
|
4
|
+
constructor(exitCode: number | null);
|
|
5
|
+
}
|
|
6
|
+
export type CommandExecutor = (command: string, arguments_: readonly string[]) => Promise<void>;
|
|
7
|
+
export declare const runCommand: CommandExecutor;
|
|
8
|
+
export declare const installGlobalPlugin: (packageSpec: string, execute?: CommandExecutor) => Promise<void>;
|
package/dist/cli.d.ts
ADDED
package/dist/cli.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/cli.ts
|
|
4
|
+
import { readFile } from "node:fs/promises";
|
|
5
|
+
|
|
6
|
+
// src/cli/install.ts
|
|
7
|
+
import { spawn } from "node:child_process";
|
|
8
|
+
var OpenCodePluginInstallError = class extends Error {
|
|
9
|
+
constructor(exitCode) {
|
|
10
|
+
super(
|
|
11
|
+
exitCode === null ? "OpenCode plugin installer exited without a status." : `OpenCode plugin installer exited with status ${exitCode}.`
|
|
12
|
+
);
|
|
13
|
+
this.exitCode = exitCode;
|
|
14
|
+
}
|
|
15
|
+
exitCode;
|
|
16
|
+
name = "OpenCodePluginInstallError";
|
|
17
|
+
};
|
|
18
|
+
var runCommand = (command, arguments_) => new Promise((resolve, reject) => {
|
|
19
|
+
const child = spawn(command, arguments_, { shell: false, stdio: "inherit" });
|
|
20
|
+
child.once("error", reject);
|
|
21
|
+
child.once("close", (exitCode) => {
|
|
22
|
+
if (exitCode === 0) resolve();
|
|
23
|
+
else reject(new OpenCodePluginInstallError(exitCode));
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
var installGlobalPlugin = async (packageSpec, execute = runCommand) => execute("opencode", ["plugin", packageSpec, "--global", "--force"]);
|
|
27
|
+
|
|
28
|
+
// src/cli.ts
|
|
29
|
+
var HELP = `Usage: opencode-digital-pet <init|update> [--dry-run]
|
|
30
|
+
|
|
31
|
+
Commands:
|
|
32
|
+
init Install the current package version through OpenCode's global plugin installer.
|
|
33
|
+
update Reinstall the current package version through the same installer.
|
|
34
|
+
|
|
35
|
+
Options:
|
|
36
|
+
--dry-run Show the native OpenCode command without running it.
|
|
37
|
+
--help Show this help text.
|
|
38
|
+
`;
|
|
39
|
+
var EXACT_SEMVER = /^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(?:-(?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*)(?:\.(?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*))*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;
|
|
40
|
+
var isPackageManifest = (value) => {
|
|
41
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
|
|
42
|
+
if (!("name" in value) || !("version" in value)) return false;
|
|
43
|
+
const { name, version } = value;
|
|
44
|
+
return name === "@jcendal/opencode-digital-pet" && typeof version === "string" && EXACT_SEMVER.test(version);
|
|
45
|
+
};
|
|
46
|
+
var readPackageManifest = async () => {
|
|
47
|
+
const source = await readFile(new URL("../package.json", import.meta.url), "utf8");
|
|
48
|
+
const manifest = JSON.parse(source);
|
|
49
|
+
if (!isPackageManifest(manifest)) throw new Error("Invalid opencode-digital-pet package manifest.");
|
|
50
|
+
return manifest;
|
|
51
|
+
};
|
|
52
|
+
var parseArguments = (arguments_) => {
|
|
53
|
+
if (arguments_.length === 1 && arguments_[0] === "--help") return { kind: "help" };
|
|
54
|
+
const [command, ...options] = arguments_;
|
|
55
|
+
if (command !== "init" && command !== "update") return { kind: "invalid", message: "Expected init or update." };
|
|
56
|
+
if (options.length === 0) return { kind: "command", command, dryRun: false };
|
|
57
|
+
if (options.length === 1 && options[0] === "--dry-run") return { kind: "command", command, dryRun: true };
|
|
58
|
+
return { kind: "invalid", message: "Only --dry-run is supported after a command." };
|
|
59
|
+
};
|
|
60
|
+
var run = async () => {
|
|
61
|
+
const parsed = parseArguments(process.argv.slice(2));
|
|
62
|
+
switch (parsed.kind) {
|
|
63
|
+
case "help":
|
|
64
|
+
process.stdout.write(HELP);
|
|
65
|
+
return 0;
|
|
66
|
+
case "invalid":
|
|
67
|
+
process.stderr.write(`${parsed.message}
|
|
68
|
+
|
|
69
|
+
${HELP}`);
|
|
70
|
+
return 2;
|
|
71
|
+
case "command": {
|
|
72
|
+
const manifest = await readPackageManifest();
|
|
73
|
+
const packageSpec = `${manifest.name}@${manifest.version}`;
|
|
74
|
+
if (parsed.dryRun) {
|
|
75
|
+
process.stdout.write(`opencode plugin ${packageSpec} --global --force
|
|
76
|
+
`);
|
|
77
|
+
return 0;
|
|
78
|
+
}
|
|
79
|
+
await installGlobalPlugin(packageSpec);
|
|
80
|
+
process.stdout.write("OpenCode plugin installation completed. Restart OpenCode.\n");
|
|
81
|
+
return 0;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
run().then((exitCode) => {
|
|
86
|
+
process.exitCode = exitCode;
|
|
87
|
+
}).catch((error) => {
|
|
88
|
+
const message = error instanceof Error ? error.message : "Unexpected CLI failure.";
|
|
89
|
+
process.stderr.write(`${message}
|
|
90
|
+
`);
|
|
91
|
+
process.exitCode = 1;
|
|
92
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Part } from "@opencode-ai/sdk";
|
|
2
|
+
export type DigitalPetCommandEvent = {
|
|
3
|
+
readonly kind: "spawned";
|
|
4
|
+
readonly nodeId: string;
|
|
5
|
+
readonly generation: number;
|
|
6
|
+
} | {
|
|
7
|
+
readonly kind: "frozen";
|
|
8
|
+
} | {
|
|
9
|
+
readonly kind: "unfrozen";
|
|
10
|
+
} | {
|
|
11
|
+
readonly kind: "set";
|
|
12
|
+
readonly nodeId: string;
|
|
13
|
+
};
|
|
14
|
+
export type DigitalPetCommandResult = {
|
|
15
|
+
readonly parts: readonly Part[];
|
|
16
|
+
readonly event?: DigitalPetCommandEvent;
|
|
17
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DigitalPetControl } from "../digital-pet-core/application/ports/digital-pet-control.js";
|
|
2
|
+
import type { DigitalPetCommandResult } from "./digital-pet-command-result.js";
|
|
3
|
+
export type DigitalPetFreezeContext = {
|
|
4
|
+
readonly sessionID: string;
|
|
5
|
+
readonly messageID: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const runDigitalPetFreezeCommand: (control: Pick<DigitalPetControl, "freeze">, context: DigitalPetFreezeContext) => Promise<DigitalPetCommandResult>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DigitalPetControl } from "../digital-pet-core/application/ports/digital-pet-control.js";
|
|
2
|
+
import type { DigimonCatalog } from "../digital-pet-core/data/catalog.js";
|
|
3
|
+
import type { DigitalPetCommandResult } from "./digital-pet-command-result.js";
|
|
4
|
+
export type DigitalPetSetContext = {
|
|
5
|
+
readonly sessionID: string;
|
|
6
|
+
readonly messageID: string;
|
|
7
|
+
readonly arguments: string;
|
|
8
|
+
};
|
|
9
|
+
export type DigimonCatalogLoader = () => Promise<DigimonCatalog>;
|
|
10
|
+
export declare const runDigitalPetSetCommand: (control: Pick<DigitalPetControl, "setCheatNode">, context: DigitalPetSetContext, loadCatalog: DigimonCatalogLoader) => Promise<DigitalPetCommandResult>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PartnerLifecycle } from "../digital-pet-core/application/ports/partner-lifecycle.js";
|
|
2
|
+
import type { DigitalPetCommandResult } from "./digital-pet-command-result.js";
|
|
3
|
+
export type DigitalPetSpawnContext = {
|
|
4
|
+
readonly sessionID: string;
|
|
5
|
+
readonly messageID: string;
|
|
6
|
+
readonly createdAt: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const runDigitalPetSpawnCommand: (lifecycle: PartnerLifecycle, context: DigitalPetSpawnContext) => Promise<DigitalPetCommandResult>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DigitalPetControl } from "../digital-pet-core/application/ports/digital-pet-control.js";
|
|
2
|
+
import type { DigitalPetCommandResult } from "./digital-pet-command-result.js";
|
|
3
|
+
export type DigitalPetUnfreezeContext = {
|
|
4
|
+
readonly sessionID: string;
|
|
5
|
+
readonly messageID: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const runDigitalPetUnfreezeCommand: (control: Pick<DigitalPetControl, "unfreeze">, context: DigitalPetUnfreezeContext) => Promise<DigitalPetCommandResult>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ResolvedDigitalPetSettings } from "../digital-pet-core/config/types.js";
|
|
2
|
+
type PathApi = Readonly<{
|
|
3
|
+
join: (...paths: readonly string[]) => string;
|
|
4
|
+
}>;
|
|
5
|
+
export type GlobalDigitalPetConfigOptions = Readonly<{
|
|
6
|
+
readonly env?: NodeJS.ProcessEnv;
|
|
7
|
+
readonly home?: string;
|
|
8
|
+
readonly pathApi?: PathApi;
|
|
9
|
+
readonly platform?: NodeJS.Platform;
|
|
10
|
+
}>;
|
|
11
|
+
export declare const resolveGlobalDigitalPetConfigPath: (options?: GlobalDigitalPetConfigOptions) => string;
|
|
12
|
+
export declare const loadGlobalDigitalPetSettings: (options?: GlobalDigitalPetConfigOptions) => Promise<ResolvedDigitalPetSettings>;
|
|
13
|
+
export declare const loadGlobalDigitalPetSettingsSync: (options?: GlobalDigitalPetConfigOptions) => ResolvedDigitalPetSettings;
|
|
14
|
+
export {};
|