qlogicagent 2.19.8 → 2.19.10
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/agent-contract.js +1 -1
- package/dist/agent.js +26 -26
- package/dist/cli.js +1 -1
- package/dist/default-project-knowledge/INSTRUCTIONS.md +7 -7
- package/dist/default-project-knowledge/rules/project-workflow.md +6 -6
- package/dist/host-contract.js +1 -1
- package/dist/index.js +443 -465
- package/dist/protocol.js +1 -1
- package/dist/skills/builtin/desktop-screenshot/SKILL.md +62 -62
- package/dist/skills/builtin/office-doc-reading/SKILL.md +19 -19
- package/dist/types/cli/agent-runtime-bootstrap.d.ts +0 -1
- package/dist/types/cli/community-resource-installer.d.ts +10 -1
- package/dist/types/cli/handlers/community-handler.d.ts +0 -8
- package/dist/types/cli/handlers/files-handler.d.ts +2 -30
- package/dist/types/cli/industrial-runtime-store.d.ts +1 -14
- package/dist/types/cli/permission-approval-bridge.d.ts +0 -1
- package/dist/types/cli/permission-bootstrap.d.ts +0 -1
- package/dist/types/cli/stdio-acp-request-host.d.ts +1 -2
- package/dist/types/cli/stdio-agent-session-bootstrap.d.ts +0 -1
- package/dist/types/cli/stdio-runtime-bootstrap.d.ts +0 -2
- package/dist/types/cli/stdio-runtime-services.d.ts +1 -13
- package/dist/types/cli/stdio-server.d.ts +0 -5
- package/dist/types/cli/turn-media-setup.d.ts +15 -0
- package/dist/types/host-contract/index.d.ts +2 -18
- package/dist/types/protocol/agent-contract.d.ts +7 -7
- package/dist/types/protocol/wire/agent-methods.d.ts +0 -115
- package/dist/types/protocol/wire/index.d.ts +1 -2
- package/dist/types/protocol/wire/notification-payloads.d.ts +0 -87
- package/package.json +3 -21
- package/dist/pet-contracts.js +0 -1
- package/dist/pet-host.js +0 -19
- package/dist/types/cli/handlers/pet-confirm-handler.d.ts +0 -7
- package/dist/types/cli/industrial-runtime-archive.d.ts +0 -14
- package/dist/types/cli/pet-confirm-coordinator.d.ts +0 -20
- package/dist/types/cli/pet-runtime.d.ts +0 -61
- package/dist/types/cli/runtime-dependency-catalog.d.ts +0 -112
- package/dist/types/cli/windows-authenticode.d.ts +0 -18
- package/dist/types/pet-contracts.d.ts +0 -1
- package/dist/types/pet-host.d.ts +0 -9
- package/dist/types/protocol/wire/pet-contracts.d.ts +0 -76
- package/dist/types/runtime/pet/daily-journey-summarizer.d.ts +0 -25
- package/dist/types/runtime/pet/hatch-pet-runner.d.ts +0 -18
- package/dist/types/runtime/pet/index.d.ts +0 -19
- package/dist/types/runtime/pet/journey-catchup.d.ts +0 -14
- package/dist/types/runtime/pet/journey-day-aggregator.d.ts +0 -27
- package/dist/types/runtime/pet/journey-narrative-prompt.d.ts +0 -8
- package/dist/types/runtime/pet/pet-community-assets.d.ts +0 -21
- package/dist/types/runtime/pet/pet-file-loader.d.ts +0 -5
- package/dist/types/runtime/pet/pet-growth-engine.d.ts +0 -2
- package/dist/types/runtime/pet/pet-profile-service.d.ts +0 -111
- package/dist/types/runtime/pet/pet-reaction-engine.d.ts +0 -11
- package/dist/types/runtime/pet/pet-soul-service.d.ts +0 -21
- package/dist/types/runtime/pet/pet-types.d.ts +0 -1
- package/dist/types/runtime/pet/petdex-asset.d.ts +0 -60
- package/dist/types/runtime/pet/petdex-forge-service.d.ts +0 -21
- package/dist/types/runtime/pet/petdex-vision-qa.d.ts +0 -12
- package/dist/types/transport/host-pet-client.d.ts +0 -20
- package/dist/vendor/hatch-pet/LICENSE.txt +0 -201
- package/dist/vendor/hatch-pet/NOTICE.md +0 -25
- package/dist/vendor/hatch-pet/references/animation-rows.md +0 -29
- package/dist/vendor/hatch-pet/references/codex-pet-contract.md +0 -35
- package/dist/vendor/hatch-pet/references/qa-rubric.md +0 -66
- package/dist/vendor/hatch-pet/scripts/compose_atlas.py +0 -169
- package/dist/vendor/hatch-pet/scripts/derive_running_left_from_running_right.py +0 -150
- package/dist/vendor/hatch-pet/scripts/extract_strip_frames.py +0 -408
- package/dist/vendor/hatch-pet/scripts/inspect_frames.py +0 -256
- package/dist/vendor/hatch-pet/scripts/make_contact_sheet.py +0 -96
- package/dist/vendor/hatch-pet/scripts/prepare_pet_run.py +0 -834
- package/dist/vendor/hatch-pet/scripts/render_animation_previews.py +0 -78
- package/dist/vendor/hatch-pet/scripts/validate_atlas.py +0 -157
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export interface IndustrialRuntimeArchiveInput {
|
|
2
|
-
archivePath: string;
|
|
3
|
-
targetDir: string;
|
|
4
|
-
runtimeId: string;
|
|
5
|
-
version: string;
|
|
6
|
-
entrypoint: string;
|
|
7
|
-
}
|
|
8
|
-
export interface ValidatedIndustrialRuntimePackage {
|
|
9
|
-
runtimeId: string;
|
|
10
|
-
version: string;
|
|
11
|
-
entrypoint: string;
|
|
12
|
-
signedFiles: string[];
|
|
13
|
-
}
|
|
14
|
-
export declare function extractIndustrialRuntimeArchive(input: IndustrialRuntimeArchiveInput): Promise<ValidatedIndustrialRuntimePackage>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { NotificationMethod, NotificationMethodMap } from "../protocol/notifications.js";
|
|
2
|
-
import type { ApprovalResponse, PermissionRiskLevel } from "../runtime/ports/index.js";
|
|
3
|
-
export interface PetConfirmPermissionResolver {
|
|
4
|
-
resolveApproval(response: ApprovalResponse): void;
|
|
5
|
-
}
|
|
6
|
-
export interface PetConfirmCoordinatorDeps {
|
|
7
|
-
getPermissionResolver(): PetConfirmPermissionResolver | null | undefined;
|
|
8
|
-
sendNotification<M extends NotificationMethod>(method: M, params: NotificationMethodMap[M]): void;
|
|
9
|
-
}
|
|
10
|
-
export interface PetConfirmResponse {
|
|
11
|
-
confirmId: string;
|
|
12
|
-
approved: boolean;
|
|
13
|
-
}
|
|
14
|
-
export declare class PetConfirmCoordinator {
|
|
15
|
-
private readonly deps;
|
|
16
|
-
private readonly pendingConfirms;
|
|
17
|
-
constructor(deps: PetConfirmCoordinatorDeps);
|
|
18
|
-
requestConfirm(toolName: string, description: string, risk: PermissionRiskLevel, timeoutMs?: number): Promise<boolean>;
|
|
19
|
-
handleResponse({ confirmId, approved }: PetConfirmResponse): void;
|
|
20
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import type { ChatMessage } from "../agent/types.js";
|
|
2
|
-
import type { ModelPurpose } from "../runtime/infra/model-registry.js";
|
|
3
|
-
import { type PetStats, type PetdexPetAsset, type PetdexValidationReport } from "../runtime/pet/index.js";
|
|
4
|
-
import { type PetdexProductionRun } from "../runtime/pet/petdex-forge-service.js";
|
|
5
|
-
import type { HostPetClient } from "../transport/host-pet-client.js";
|
|
6
|
-
import type { LLMTransport } from "./provider-core-facade.js";
|
|
7
|
-
export type PetSoulGenerator = (rarity: string, stats: PetStats) => Promise<{
|
|
8
|
-
name: string;
|
|
9
|
-
personality: string;
|
|
10
|
-
catchphrase: string;
|
|
11
|
-
}>;
|
|
12
|
-
export type SmallLlmCall = (prompt: string, maxTokens: number) => Promise<string | null>;
|
|
13
|
-
export interface PetdexForgeInput {
|
|
14
|
-
id?: string;
|
|
15
|
-
name: string;
|
|
16
|
-
description: string;
|
|
17
|
-
prompt?: string | null;
|
|
18
|
-
referenceImageUrl?: string;
|
|
19
|
-
referenceMode?: "identity" | "refine";
|
|
20
|
-
baseSpritesheet?: Buffer;
|
|
21
|
-
}
|
|
22
|
-
export interface PetdexForgeOutput {
|
|
23
|
-
asset: PetdexPetAsset;
|
|
24
|
-
spritesheet: Buffer;
|
|
25
|
-
validation: PetdexValidationReport;
|
|
26
|
-
productionRun?: PetdexProductionRun;
|
|
27
|
-
/** Jobs accepted WITHOUT a working vision-QA verdict (QA call failed → fail-open, but traced). */
|
|
28
|
-
qaSkippedJobs?: string[];
|
|
29
|
-
mediaUsage?: {
|
|
30
|
-
provider: string;
|
|
31
|
-
model: string;
|
|
32
|
-
billingUnit: string;
|
|
33
|
-
billingQuantity: number;
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
export interface PetLlmClient {
|
|
37
|
-
transport: LLMTransport;
|
|
38
|
-
apiKey: string;
|
|
39
|
-
model: string;
|
|
40
|
-
}
|
|
41
|
-
export interface PetRuntime {
|
|
42
|
-
createPetSoulGenerator(): PetSoulGenerator | undefined;
|
|
43
|
-
createSmallLLMCall(): SmallLlmCall | undefined;
|
|
44
|
-
isImageGenerationAvailable(): boolean;
|
|
45
|
-
isPetdexForgeAvailable(): boolean;
|
|
46
|
-
forgeGeneratePetdexAtlas(input: PetdexForgeInput): Promise<PetdexForgeOutput>;
|
|
47
|
-
awardXp(event: string): Promise<void>;
|
|
48
|
-
reactAfterTurn(messages: ChatMessage[]): Promise<void>;
|
|
49
|
-
/** Backfill missing daily journey summaries (per-owner, cross-project, idempotent, best-effort).
|
|
50
|
-
* Owns the LLM + project-listing side effects so stdio-server doesn't reach into runtime/infra. */
|
|
51
|
-
catchUpJourney(): Promise<string[]>;
|
|
52
|
-
refreshActive(): Promise<boolean>;
|
|
53
|
-
isActive(): boolean;
|
|
54
|
-
}
|
|
55
|
-
export interface PetRuntimeDeps {
|
|
56
|
-
resolveClientForPurpose(purpose: ModelPurpose): PetLlmClient | null;
|
|
57
|
-
sendNotification(method: string, params: Record<string, unknown>): void;
|
|
58
|
-
getCurrentSessionId?(): string | undefined;
|
|
59
|
-
resolveHostPetClient?(): HostPetClient | undefined;
|
|
60
|
-
}
|
|
61
|
-
export declare function createPetRuntime(deps: PetRuntimeDeps): PetRuntime;
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { type VerifyAuthenticodeInput } from "./windows-authenticode.js";
|
|
2
|
-
/**
|
|
3
|
-
* Vetted runtime-dependency catalog for community skills.
|
|
4
|
-
*
|
|
5
|
-
* A skill manifest may declare `runtime: ["officecli"]` — bare ids only. The
|
|
6
|
-
* registry stays declarative: WHAT a skill needs lives in Hub data, but HOW to
|
|
7
|
-
* probe/install it lives here, reviewed in code. A runtime is a single-file
|
|
8
|
-
* binary mirrored to our OSS; the installer resolves a Hub-signed download URL,
|
|
9
|
-
* verifies its sha256 BEFORE placing the file, and never executes registry
|
|
10
|
-
* payloads — so a compromised registry row cannot turn "install runtime" into
|
|
11
|
-
* arbitrary code execution. Unknown ids surface as "manual" in the handshake UI
|
|
12
|
-
* instead of running anything. CN-reliable: no dependency on foreign mirrors.
|
|
13
|
-
*/
|
|
14
|
-
export interface RuntimeDependencySpec {
|
|
15
|
-
id: string;
|
|
16
|
-
/** Human-facing name shown in the handshake card. */
|
|
17
|
-
label: string;
|
|
18
|
-
/** Executable probed on PATH (and known-location fallbacks). */
|
|
19
|
-
bin: string;
|
|
20
|
-
probeArgs: string[];
|
|
21
|
-
/** Known install locations not yet on PATH in this process (fresh installs). */
|
|
22
|
-
extraWindowsPaths?: string[];
|
|
23
|
-
/**
|
|
24
|
-
* quick=true → the handshake auto-installs without an extra consent step
|
|
25
|
-
* (small, single-artifact). quick=false → the client must show a consent
|
|
26
|
-
* card first (large download / system-level changes).
|
|
27
|
-
*/
|
|
28
|
-
quick: boolean;
|
|
29
|
-
/** Honest size estimate surfaced in the consent card. */
|
|
30
|
-
estSizeMB?: number;
|
|
31
|
-
install: RuntimeInstallMode;
|
|
32
|
-
installTimeoutMs: number;
|
|
33
|
-
docsUrl?: string;
|
|
34
|
-
}
|
|
35
|
-
export interface UserBinaryInstall {
|
|
36
|
-
kind: "user-binary";
|
|
37
|
-
/** Resolve id for the Hub (GET /api/v15/runtime/:id/resolve?platform=…). */
|
|
38
|
-
resourceId: string;
|
|
39
|
-
/** Absolute path the per-platform binary is written to (matches upstream layout). */
|
|
40
|
-
dest(): string;
|
|
41
|
-
/** Directory appended to the persistent user PATH so the agent shell finds `bin`. */
|
|
42
|
-
pathDir(): string;
|
|
43
|
-
/** chmod 0o755 after writing (POSIX). */
|
|
44
|
-
posixExecutable: boolean;
|
|
45
|
-
/** Verified release archives expose exactly one executable entry per host family. */
|
|
46
|
-
archiveEntries?: {
|
|
47
|
-
win32: string;
|
|
48
|
-
default: string;
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
export interface AstraClawPrivateZipInstall {
|
|
52
|
-
kind: "astraclaw-private-zip";
|
|
53
|
-
runtimeId: string;
|
|
54
|
-
}
|
|
55
|
-
export type RuntimeInstallMode = UserBinaryInstall | AstraClawPrivateZipInstall;
|
|
56
|
-
export declare const RUNTIME_DEPENDENCIES: Record<string, RuntimeDependencySpec>;
|
|
57
|
-
export interface RuntimeDependencyStatus {
|
|
58
|
-
id: string;
|
|
59
|
-
/** false → not in the vetted catalog: the client can only show guidance. */
|
|
60
|
-
known: boolean;
|
|
61
|
-
label?: string;
|
|
62
|
-
present: boolean;
|
|
63
|
-
version?: string;
|
|
64
|
-
/** Absolute path when found via a known location instead of PATH. */
|
|
65
|
-
binPath?: string;
|
|
66
|
-
quick?: boolean;
|
|
67
|
-
estSizeMB?: number;
|
|
68
|
-
docsUrl?: string;
|
|
69
|
-
}
|
|
70
|
-
/** Resolved download for a hub-binary runtime (signed URL + integrity metadata). */
|
|
71
|
-
export interface ResolvedRuntimeBinary {
|
|
72
|
-
id: string;
|
|
73
|
-
platform: string;
|
|
74
|
-
version: string;
|
|
75
|
-
downloadUrl: string;
|
|
76
|
-
/** sha256 hex digest — the integrity anchor verified before placing the file. */
|
|
77
|
-
checksum: string;
|
|
78
|
-
sizeBytes: number;
|
|
79
|
-
format: "executable" | "zip" | "tar.gz";
|
|
80
|
-
entrypoint?: string;
|
|
81
|
-
}
|
|
82
|
-
export type RuntimeExecFile = (file: string, args: string[], options: {
|
|
83
|
-
timeout: number;
|
|
84
|
-
windowsHide: boolean;
|
|
85
|
-
encoding: "utf8";
|
|
86
|
-
}, callback: (error: Error | null, stdout: string, stderr: string) => void) => unknown;
|
|
87
|
-
export interface RuntimeInstallDeps {
|
|
88
|
-
/** Resolve a hub-binary runtime via the Hub (community client). */
|
|
89
|
-
resolveBinary(id: string, platform: string): Promise<ResolvedRuntimeBinary>;
|
|
90
|
-
/** Injectable for tests. */
|
|
91
|
-
fetchFn?: typeof fetch;
|
|
92
|
-
hostPlatform?: string;
|
|
93
|
-
hostArch?: string;
|
|
94
|
-
rootDir?: string;
|
|
95
|
-
verifyAuthenticodeFiles?: (input: VerifyAuthenticodeInput) => Promise<void>;
|
|
96
|
-
execFileFn?: RuntimeExecFile;
|
|
97
|
-
}
|
|
98
|
-
/** Map this host to the officecli asset platform key (`<os>-<arch>`). */
|
|
99
|
-
export declare function runtimePlatformKey(platform?: string, architecture?: string): string;
|
|
100
|
-
export declare function probeRuntimeDependency(id: string): Promise<RuntimeDependencyStatus>;
|
|
101
|
-
export interface RuntimeInstallResult {
|
|
102
|
-
id: string;
|
|
103
|
-
ok: true;
|
|
104
|
-
version?: string;
|
|
105
|
-
binPath?: string;
|
|
106
|
-
}
|
|
107
|
-
export declare function installRuntimeDependency(id: string, deps: RuntimeInstallDeps): Promise<RuntimeInstallResult>;
|
|
108
|
-
/**
|
|
109
|
-
* Read only the allowlisted executable from a checksum-verified release archive. `tar -xOf`
|
|
110
|
-
* streams the named entry without unpacking sibling files or trusting archive paths.
|
|
111
|
-
*/
|
|
112
|
-
export declare function extractRuntimeArchive(archiveBytes: Buffer, executableEntry: string): Buffer;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export type AuthenticodeExecFile = (file: string, args: string[], options: {
|
|
2
|
-
encoding: "utf8";
|
|
3
|
-
timeout: number;
|
|
4
|
-
maxBuffer: number;
|
|
5
|
-
windowsHide: boolean;
|
|
6
|
-
}, callback: (error: Error | null, stdout: string, stderr: string) => void) => unknown;
|
|
7
|
-
export interface AuthenticodeFile {
|
|
8
|
-
absolutePath: string;
|
|
9
|
-
relativePath: string;
|
|
10
|
-
}
|
|
11
|
-
export interface VerifyAuthenticodeInput {
|
|
12
|
-
files: AuthenticodeFile[];
|
|
13
|
-
execFileFn?: AuthenticodeExecFile;
|
|
14
|
-
platform?: string;
|
|
15
|
-
arch?: string;
|
|
16
|
-
}
|
|
17
|
-
export declare function assertIndustrialRuntimePlatform(platform?: string, arch?: string): void;
|
|
18
|
-
export declare function verifyWindowsAuthenticodeFiles(input: VerifyAuthenticodeInput): Promise<void>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { PETDEX_ANIMATION_IDS, PETDEX_ATLAS_CONTRACT, PETDEX_SCHEMA, PETDEX_VALIDATION_SCHEMA, type PetdexAnimation, type PetdexAnimationId, type PetdexAnimationMap, type PetdexAssetManifest, type PetdexAssetSummary, type PetdexAssetValidation, type PetdexAtlasManifest, } from "./protocol/wire/pet-contracts.js";
|
package/dist/types/pet-host.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Host-owned PET module surface.
|
|
3
|
-
*
|
|
4
|
-
* This entry point contains reusable domain and persistence components only. Importing it does not
|
|
5
|
-
* create a profile service or touch disk; the gateway is responsible for constructing the single
|
|
6
|
-
* production owner for a resolved owner id.
|
|
7
|
-
*/
|
|
8
|
-
export { PetProfileService, PetSoulService, PetGrowthEngine, catchUpJourney, createPetdexAssetFromSpritesheet, forgePetdexAsset, forgePetdexAssetPackage, listBuiltinPetdexAssetIds, listBuiltinPetdexAssets, loadPetFile, petReactionEngine, petdexImageDataUrl, readGeneratedPetdexImage, toPetdexAssetSummary, validatePetManifest, writePetdexAssetPackage, } from "./runtime/pet/index.js";
|
|
9
|
-
export type { CatchUpJourneyOptions, JourneySnapshot, JourneyStats, PetFileBundle, PetManifest, PetPreferences, PetProfile, PetSoul, PetStats, PetdexPetAsset, PetdexPetAssetSummary, } from "./runtime/pet/index.js";
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
export declare const PETDEX_ANIMATION_IDS: readonly ["idle", "running-right", "running-left", "waving", "jumping", "failed", "waiting", "running", "review"];
|
|
2
|
-
export type PetdexAnimationId = typeof PETDEX_ANIMATION_IDS[number];
|
|
3
|
-
export declare const PETDEX_SCHEMA: "qlogic.petdex.asset.v1";
|
|
4
|
-
export declare const PETDEX_VALIDATION_SCHEMA: "qlogic.petdex.validation.v1";
|
|
5
|
-
export declare const PETDEX_ATLAS_CONTRACT: {
|
|
6
|
-
readonly format: "webp";
|
|
7
|
-
readonly columns: 8;
|
|
8
|
-
readonly rows: 9;
|
|
9
|
-
readonly frameCount: 72;
|
|
10
|
-
readonly cellWidth: 192;
|
|
11
|
-
readonly cellHeight: 208;
|
|
12
|
-
readonly width: 1536;
|
|
13
|
-
readonly height: 1872;
|
|
14
|
-
};
|
|
15
|
-
export interface PetdexAnimation {
|
|
16
|
-
row: number;
|
|
17
|
-
frames: number[];
|
|
18
|
-
durations: number[];
|
|
19
|
-
loop: boolean;
|
|
20
|
-
}
|
|
21
|
-
export type PetdexAnimationMap = Record<PetdexAnimationId, PetdexAnimation>;
|
|
22
|
-
export interface PetdexAtlasManifest {
|
|
23
|
-
image: "spritesheet.webp";
|
|
24
|
-
format: "webp";
|
|
25
|
-
columns: 8;
|
|
26
|
-
rows: 9;
|
|
27
|
-
frameCount: 72;
|
|
28
|
-
cellWidth: 192;
|
|
29
|
-
cellHeight: 208;
|
|
30
|
-
width: 1536;
|
|
31
|
-
height: 1872;
|
|
32
|
-
sha256: string;
|
|
33
|
-
}
|
|
34
|
-
export interface PetdexAssetManifest {
|
|
35
|
-
schema: typeof PETDEX_SCHEMA;
|
|
36
|
-
id: string;
|
|
37
|
-
name: string;
|
|
38
|
-
description: string;
|
|
39
|
-
createdAt: string;
|
|
40
|
-
updatedAt: string;
|
|
41
|
-
source: {
|
|
42
|
-
kind: "upload" | "forge";
|
|
43
|
-
prompt: string | null;
|
|
44
|
-
};
|
|
45
|
-
atlas: PetdexAtlasManifest;
|
|
46
|
-
animations: PetdexAnimationMap;
|
|
47
|
-
thumbnail: {
|
|
48
|
-
frame: number;
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
export interface PetdexAssetSummary {
|
|
52
|
-
id: string;
|
|
53
|
-
assetKind: "petdex";
|
|
54
|
-
name: string;
|
|
55
|
-
description: string;
|
|
56
|
-
createdAt: string;
|
|
57
|
-
updatedAt: string;
|
|
58
|
-
atlas: Omit<PetdexAtlasManifest, "image"> & {
|
|
59
|
-
imageUrl?: string;
|
|
60
|
-
};
|
|
61
|
-
sourcePrompt?: string;
|
|
62
|
-
}
|
|
63
|
-
export interface PetdexAssetValidation {
|
|
64
|
-
schema: typeof PETDEX_VALIDATION_SCHEMA;
|
|
65
|
-
assetId: string;
|
|
66
|
-
valid: boolean;
|
|
67
|
-
validatedAt: string;
|
|
68
|
-
errors: string[];
|
|
69
|
-
warnings: string[];
|
|
70
|
-
atlas: Omit<PetdexAtlasManifest, "image">;
|
|
71
|
-
animations: {
|
|
72
|
-
ids: PetdexAnimationId[];
|
|
73
|
-
minFrame: number;
|
|
74
|
-
maxFrame: number;
|
|
75
|
-
};
|
|
76
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Daily journey summarizer — orchestrates the day's local-work summary:
|
|
3
|
-
* aggregate → deterministic stats → pet-voice prompt → LLM narrative → JourneySnapshot.
|
|
4
|
-
*
|
|
5
|
-
* IO (aggregation, soul, LLM) is injected so this stays unit-testable. The LLM call
|
|
6
|
-
* signature is declared locally (not imported from cli/pet-runtime) to keep the
|
|
7
|
-
* runtime layer free of a cli dependency; the caller passes petRuntime.createSmallLLMCall().
|
|
8
|
-
* If the LLM is unavailable or fails, a deterministic templated narrative is used so the
|
|
9
|
-
* journey always renders.
|
|
10
|
-
*/
|
|
11
|
-
import type { PetSoul } from "./pet-types.js";
|
|
12
|
-
import type { DayDigest } from "./journey-day-aggregator.js";
|
|
13
|
-
import type { JourneySnapshot } from "./pet-profile-service.js";
|
|
14
|
-
export type JourneyLlmCall = (prompt: string, maxTokens: number) => Promise<string | null>;
|
|
15
|
-
export interface SummarizeDayOptions {
|
|
16
|
-
date: string;
|
|
17
|
-
petName: string;
|
|
18
|
-
aggregate: () => Promise<DayDigest>;
|
|
19
|
-
resolveSoul: () => PetSoul | null;
|
|
20
|
-
llmCall: JourneyLlmCall | undefined;
|
|
21
|
-
generator?: "auto" | "manual";
|
|
22
|
-
/** Injectable clock (ISO) for deterministic tests. */
|
|
23
|
-
now?: () => string;
|
|
24
|
-
}
|
|
25
|
-
export declare function summarizeDay(opts: SummarizeDayOptions): Promise<JourneySnapshot | null>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export interface HatchPetResult {
|
|
2
|
-
ok: boolean;
|
|
3
|
-
stdout: string;
|
|
4
|
-
stderr: string;
|
|
5
|
-
code: number | null;
|
|
6
|
-
}
|
|
7
|
-
/** A python executable that can import Pillow, or null if none is available. Cached. */
|
|
8
|
-
export declare function resolveHatchPetPython(): Promise<string | null>;
|
|
9
|
-
/** The vendored hatch-pet/scripts directory, or null if missing. Cached. */
|
|
10
|
-
export declare function resolveHatchPetScriptsDir(): string | null;
|
|
11
|
-
/** True when both a Pillow-capable python and the vendored scripts are present. */
|
|
12
|
-
export declare function isHatchPetAvailable(): Promise<boolean>;
|
|
13
|
-
/** Run a vendored hatch-pet script. Throws if python/scripts are unavailable or the script is unknown. */
|
|
14
|
-
export declare function runHatchPetScript(script: string, args: string[], opts?: {
|
|
15
|
-
timeoutMs?: number;
|
|
16
|
-
}): Promise<HatchPetResult>;
|
|
17
|
-
/** Test seam: reset memoized python/scripts resolution. */
|
|
18
|
-
export declare function _resetHatchPetRunnerCache(): void;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pet module — barrel export.
|
|
3
|
-
* Pure domain logic (types/soul/growth/reaction/petdex contract) comes from
|
|
4
|
-
* @xiaozhiclaw/pet-core; host keeps IO services + the shared reaction engine.
|
|
5
|
-
* Forge prompts live in the vendored Hatch-Pet Python pipeline, not in TS.
|
|
6
|
-
*/
|
|
7
|
-
export type { PetStats, PetSoul, PetBreed } from "@xiaozhiclaw/pet-core";
|
|
8
|
-
export { PetGrowthEngine } from "@xiaozhiclaw/pet-core";
|
|
9
|
-
export type { GrowthEvent, MoltResult, PetDisplayTrait } from "@xiaozhiclaw/pet-core";
|
|
10
|
-
export { PETDEX_ANIMATION_IDS, petdexImageDataUrl, toPetdexAssetSummary } from "@xiaozhiclaw/pet-core";
|
|
11
|
-
export type { PetdexAnimationId, PetdexValidationReport } from "@xiaozhiclaw/pet-core";
|
|
12
|
-
export type { ReactionPool, LLMReactionContext, ReactionStyle } from "@xiaozhiclaw/pet-core";
|
|
13
|
-
export { PetSoulService } from "./pet-soul-service.js";
|
|
14
|
-
export { petReactionEngine } from "./pet-reaction-engine.js";
|
|
15
|
-
export { PetProfileService, type PetProfile, type PetPreferences, type PetdexPetAsset, type PetdexPetAssetSummary, type JourneySnapshot, type JourneyStats } from "./pet-profile-service.js";
|
|
16
|
-
export { catchUpJourney, readTurnTelemetryDir, type CatchUpJourneyOptions } from "./journey-catchup.js";
|
|
17
|
-
export { createPetdexAssetFromSpritesheet, listBuiltinPetdexAssetIds, listBuiltinPetdexAssets, writePetdexAssetPackage } from "./petdex-asset.js";
|
|
18
|
-
export { forgePetdexAsset, forgePetdexAssetPackage, readGeneratedPetdexImage } from "./petdex-forge-service.js";
|
|
19
|
-
export { loadPetFile, validatePetManifest, type PetManifest, type PetFileBundle } from "./pet-file-loader.js";
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { TurnTelemetrySnapshot } from "../infra/turn-telemetry-store.js";
|
|
2
|
-
import { type JourneyLlmCall } from "./daily-journey-summarizer.js";
|
|
3
|
-
/** All persisted turn-telemetry records for one project (best-effort; missing/corrupt → skip). */
|
|
4
|
-
export declare function readTurnTelemetryDir(projectId: string): TurnTelemetrySnapshot[];
|
|
5
|
-
export interface CatchUpJourneyOptions {
|
|
6
|
-
/** Look-back window of completed days (default 7, capped at retention). */
|
|
7
|
-
maxDays?: number;
|
|
8
|
-
generator?: "auto" | "manual";
|
|
9
|
-
llmCall: JourneyLlmCall | undefined;
|
|
10
|
-
listProjectIds: () => string[];
|
|
11
|
-
log?: (message: string) => void;
|
|
12
|
-
}
|
|
13
|
-
/** Backfill missing completed-day journey snapshots. Returns the dates generated this run. */
|
|
14
|
-
export declare function catchUpJourney(ownerUserId: string, opts: CatchUpJourneyOptions): Promise<string[]>;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Journey day aggregator — collapses a day's turn telemetry (across all of an owner's
|
|
3
|
-
* projects) into a deterministic DayDigest. IO is injected (project list + per-project
|
|
4
|
-
* telemetry reader) so this stays pure and unit-testable; the caller wires the real
|
|
5
|
-
* project store + filesystem reader.
|
|
6
|
-
*
|
|
7
|
-
* Stats are computed here deterministically (never by an LLM) so the journey never
|
|
8
|
-
* shows invented numbers — the LLM only writes the narrative prose from these facts.
|
|
9
|
-
*/
|
|
10
|
-
import type { TurnTelemetrySnapshot } from "../infra/turn-telemetry-store.js";
|
|
11
|
-
export interface DayDigest {
|
|
12
|
-
date: string;
|
|
13
|
-
turns: number;
|
|
14
|
-
filesChanged: number;
|
|
15
|
-
toolsUsed: string[];
|
|
16
|
-
projects: string[];
|
|
17
|
-
models: string[];
|
|
18
|
-
modes: Record<string, number>;
|
|
19
|
-
topChangedPaths: string[];
|
|
20
|
-
}
|
|
21
|
-
export interface JourneyDayDeps {
|
|
22
|
-
/** All registered project ids for the owner. */
|
|
23
|
-
listProjectIds(): string[];
|
|
24
|
-
/** All persisted turn-telemetry records for one project (any date). */
|
|
25
|
-
readProjectTurns(projectId: string): Promise<TurnTelemetrySnapshot[]>;
|
|
26
|
-
}
|
|
27
|
-
export declare function aggregateOwnerDay(date: string, deps: JourneyDayDeps): Promise<DayDigest>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Journey narrative prompt — composes the pet-voice prompt from the pet's soul + the
|
|
3
|
-
* day's deterministic digest. Pure/testable. The LLM only writes prose from these facts;
|
|
4
|
-
* it is explicitly told not to invent numbers, file names, or events.
|
|
5
|
-
*/
|
|
6
|
-
import type { PetSoul } from "./pet-types.js";
|
|
7
|
-
import type { DayDigest } from "./journey-day-aggregator.js";
|
|
8
|
-
export declare function buildNarrativePrompt(soul: PetSoul | null, digest: DayDigest): string;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { CommunityInstallResolution } from "../community/community-consent-client.js";
|
|
2
|
-
export interface CommunityPetAdoptionProposal {
|
|
3
|
-
kind: "pet";
|
|
4
|
-
mode: "gateway-adoption";
|
|
5
|
-
resourceId: string;
|
|
6
|
-
version: string;
|
|
7
|
-
checksum: string;
|
|
8
|
-
assetId: string;
|
|
9
|
-
name: string;
|
|
10
|
-
fileName: string;
|
|
11
|
-
/** Validated, provenance-normalized .petdex bytes. Only Gateway may adopt these bytes. */
|
|
12
|
-
packageBase64: string;
|
|
13
|
-
}
|
|
14
|
-
export interface InstallCommunityPetOptions {
|
|
15
|
-
fetchFn?: typeof fetch;
|
|
16
|
-
/** Replace an existing install in place (update flow). Petdex upsert is idempotent, so this is accepted for dispatcher parity. */
|
|
17
|
-
allowReplace?: boolean;
|
|
18
|
-
}
|
|
19
|
-
/** Download, verify, validate, and normalize a community PET into an inert Gateway adoption proposal. */
|
|
20
|
-
export declare function installCommunityPetResource(install: CommunityInstallResolution, options?: InstallCommunityPetOptions): Promise<CommunityPetAdoptionProposal>;
|
|
21
|
-
export declare function assertPetInstall(install: CommunityInstallResolution): void;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { type PetdexAssetManifest, type PetdexAssetPackage, type PetdexAssetValidation } from "@xiaozhiclaw/pet-core";
|
|
2
|
-
export type PetManifest = PetdexAssetManifest;
|
|
3
|
-
export type PetFileBundle = PetdexAssetPackage;
|
|
4
|
-
export declare function loadPetFile(filePath: string): Promise<PetFileBundle>;
|
|
5
|
-
export declare function validatePetManifest(manifest: unknown, spritesheet?: Buffer): PetdexAssetValidation;
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import type { PetdexAnimation, PetdexAnimationId } from "@xiaozhiclaw/pet-core";
|
|
2
|
-
import type { PetSoul } from "./pet-types.js";
|
|
3
|
-
export interface PetPreferences {
|
|
4
|
-
enabled: boolean;
|
|
5
|
-
selectedPetAssetId: string;
|
|
6
|
-
}
|
|
7
|
-
export interface PetdexPetAssetSummary {
|
|
8
|
-
id: string;
|
|
9
|
-
assetKind: "petdex";
|
|
10
|
-
sourceKind?: "builtin" | "upload" | "forge" | "community";
|
|
11
|
-
name: string;
|
|
12
|
-
description: string;
|
|
13
|
-
createdAt: string;
|
|
14
|
-
updatedAt: string;
|
|
15
|
-
atlas: PetdexPetAssetSummaryAtlas;
|
|
16
|
-
animations?: Record<PetdexAnimationId, PetdexPetAnimation>;
|
|
17
|
-
thumbnail?: {
|
|
18
|
-
frame: number;
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
export interface PetdexPetAssetSummaryAtlas {
|
|
22
|
-
format: "webp";
|
|
23
|
-
columns: 8;
|
|
24
|
-
rows: 9;
|
|
25
|
-
frameCount: 72;
|
|
26
|
-
cellWidth: 192;
|
|
27
|
-
cellHeight: 208;
|
|
28
|
-
width: 1536;
|
|
29
|
-
height: 1872;
|
|
30
|
-
sha256: string;
|
|
31
|
-
}
|
|
32
|
-
export interface PetdexPetAssetAtlas extends PetdexPetAssetSummaryAtlas {
|
|
33
|
-
image: "spritesheet.webp";
|
|
34
|
-
}
|
|
35
|
-
/** Re-uses the pet-core contract animation shape (row + per-frame durations, Codex-aligned). */
|
|
36
|
-
export type PetdexPetAnimation = PetdexAnimation;
|
|
37
|
-
export interface PetdexPetAsset extends Omit<PetdexPetAssetSummary, "atlas"> {
|
|
38
|
-
schema: "qlogic.petdex.asset.v1";
|
|
39
|
-
atlas: PetdexPetAssetAtlas;
|
|
40
|
-
source: {
|
|
41
|
-
kind: "builtin" | "upload" | "forge" | "community";
|
|
42
|
-
prompt: string | null;
|
|
43
|
-
};
|
|
44
|
-
animations: Record<PetdexAnimationId, PetdexPetAnimation>;
|
|
45
|
-
thumbnail: {
|
|
46
|
-
frame: number;
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
export interface JourneyStats {
|
|
50
|
-
turns: number;
|
|
51
|
-
filesChanged: number;
|
|
52
|
-
toolsUsed: string[];
|
|
53
|
-
projects: string[];
|
|
54
|
-
}
|
|
55
|
-
export interface JourneySnapshot {
|
|
56
|
-
date: string;
|
|
57
|
-
day: number;
|
|
58
|
-
petName: string;
|
|
59
|
-
stateLabel: string;
|
|
60
|
-
/** Pet-voice narrative of the day's local work (LLM-written from deterministic facts). */
|
|
61
|
-
narrative?: string;
|
|
62
|
-
/** Deterministic day stats (computed, never LLM-invented). */
|
|
63
|
-
stats?: JourneyStats;
|
|
64
|
-
generatedAt?: string;
|
|
65
|
-
generator?: "auto" | "manual";
|
|
66
|
-
/** Legacy mock entries — optional, superseded by narrative/stats. */
|
|
67
|
-
entries?: Array<Record<string, unknown>>;
|
|
68
|
-
}
|
|
69
|
-
export interface PetProfile {
|
|
70
|
-
version: 1;
|
|
71
|
-
ownerUserId: string;
|
|
72
|
-
soul: PetSoul | null;
|
|
73
|
-
preferences: PetPreferences;
|
|
74
|
-
customPets: PetdexPetAssetSummary[];
|
|
75
|
-
journeyDates: string[];
|
|
76
|
-
updatedAt: string;
|
|
77
|
-
}
|
|
78
|
-
export declare class PetProfileService {
|
|
79
|
-
private readonly ownerUserId;
|
|
80
|
-
private readonly petDir;
|
|
81
|
-
private readonly profilePath;
|
|
82
|
-
constructor(ownerUserId: string);
|
|
83
|
-
loadProfile(): PetProfile;
|
|
84
|
-
/**
|
|
85
|
-
* Load the profile for a read-modify-write cycle. A corrupt profile file must
|
|
86
|
-
* never be replaced by a rebuilt default — throw so the caller fails loudly
|
|
87
|
-
* instead of silently destroying the user's pet data.
|
|
88
|
-
*/
|
|
89
|
-
private loadProfileForWrite;
|
|
90
|
-
private readProfileState;
|
|
91
|
-
updateSoul(soul: PetSoul | null): PetProfile;
|
|
92
|
-
updatePreferences(update: Partial<PetPreferences>): PetProfile;
|
|
93
|
-
saveJourneySnapshot(snapshot: JourneySnapshot): PetProfile;
|
|
94
|
-
listJourneyDates(): string[];
|
|
95
|
-
getJourneySnapshot(date: string): JourneySnapshot | null;
|
|
96
|
-
upsertCustomPet(pet: PetdexPetAsset): PetProfile;
|
|
97
|
-
deleteCustomPet(id: string): PetProfile;
|
|
98
|
-
listCustomPets(): PetdexPetAssetSummary[];
|
|
99
|
-
getCustomPet(id: string): PetdexPetAsset | null;
|
|
100
|
-
getCustomPetSpritesheet(id: string): Buffer | null;
|
|
101
|
-
findReusableCustomPetId(params: {
|
|
102
|
-
sourceKind: "upload" | "forge";
|
|
103
|
-
name: string;
|
|
104
|
-
description: string;
|
|
105
|
-
}): string | null;
|
|
106
|
-
compactDuplicateCustomPets(): PetProfile;
|
|
107
|
-
writeCustomPetAssetFiles(pet: PetdexPetAsset, spritesheet: Buffer, validation: unknown, productionRun?: unknown): PetProfile;
|
|
108
|
-
private defaultProfile;
|
|
109
|
-
private normalizeProfile;
|
|
110
|
-
private writeProfile;
|
|
111
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ReactionEngine } from "@xiaozhiclaw/pet-core";
|
|
2
|
-
/**
|
|
3
|
-
* Host-side shared ReactionEngine singleton.
|
|
4
|
-
*
|
|
5
|
-
* pet-core moved the original module-level `recentReactions` dedup buffer to a
|
|
6
|
-
* ReactionEngine instance field. The original behaviour was a module singleton
|
|
7
|
-
* shared by the PET host/runtime surfaces, so the host keeps exactly one
|
|
8
|
-
* shared instance here (seeded with defaultPetRng = Math.random) to preserve the
|
|
9
|
-
* cross-call dedup semantics byte-for-byte.
|
|
10
|
-
*/
|
|
11
|
-
export declare const petReactionEngine: ReactionEngine;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { hasPetAgentBoundaryViolationText, type PetSoul, type PetStats } from "@xiaozhiclaw/pet-core";
|
|
2
|
-
export { hasPetAgentBoundaryViolationText };
|
|
3
|
-
export declare class PetSoulService {
|
|
4
|
-
private soul;
|
|
5
|
-
private profileService;
|
|
6
|
-
constructor(_workspaceDir: string, ownerUserId?: string);
|
|
7
|
-
load(): PetSoul | null;
|
|
8
|
-
ensureSoul(userId: string, generateSoul?: (rarity: string, stats: PetStats) => Promise<{
|
|
9
|
-
name: string;
|
|
10
|
-
personality: string;
|
|
11
|
-
catchphrase: string;
|
|
12
|
-
}>, requestedBreedId?: string): Promise<PetSoul>;
|
|
13
|
-
addExperience(xp: number): {
|
|
14
|
-
leveledUp: boolean;
|
|
15
|
-
level: number;
|
|
16
|
-
experience: number;
|
|
17
|
-
};
|
|
18
|
-
getSoul(): PetSoul | null;
|
|
19
|
-
updateSoul(soul: PetSoul): void;
|
|
20
|
-
private persist;
|
|
21
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { PetStats, PetSoul, PetBreed } from "@xiaozhiclaw/pet-core";
|