qlogicagent 2.19.7 → 2.19.9

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.
Files changed (85) hide show
  1. package/README.md +16 -5
  2. package/dist/agent-contract.js +1 -1
  3. package/dist/agent.js +26 -26
  4. package/dist/cli.js +1 -1
  5. package/dist/default-project-knowledge/INSTRUCTIONS.md +7 -7
  6. package/dist/default-project-knowledge/rules/project-workflow.md +6 -6
  7. package/dist/host-contract.js +1 -1
  8. package/dist/index.js +441 -455
  9. package/dist/protocol.js +1 -1
  10. package/dist/skills/builtin/desktop-screenshot/SKILL.md +62 -62
  11. package/dist/skills/builtin/office-doc-reading/SKILL.md +19 -19
  12. package/dist/skills/mcp/astraclaw-native-mcp-server.js +3 -3
  13. package/dist/types/cli/acp-session-host.d.ts +4 -0
  14. package/dist/types/cli/agent-runtime-bootstrap.d.ts +3 -1
  15. package/dist/types/cli/agent-runtime-session-state.d.ts +12 -4
  16. package/dist/types/cli/community-resource-installer.d.ts +10 -1
  17. package/dist/types/cli/industrial-runtime-archive.d.ts +14 -0
  18. package/dist/types/cli/industrial-runtime-store.d.ts +29 -0
  19. package/dist/types/cli/mcp-bootstrap.d.ts +11 -1
  20. package/dist/types/cli/permission-approval-bridge.d.ts +0 -1
  21. package/dist/types/cli/permission-bootstrap.d.ts +0 -1
  22. package/dist/types/cli/resolved-agent-cache.d.ts +7 -0
  23. package/dist/types/cli/runtime-dependency-catalog.d.ts +35 -5
  24. package/dist/types/cli/stdio-acp-request-host.d.ts +3 -4
  25. package/dist/types/cli/stdio-agent-session-bootstrap.d.ts +4 -2
  26. package/dist/types/cli/stdio-runtime-bootstrap.d.ts +0 -2
  27. package/dist/types/cli/stdio-runtime-services.d.ts +1 -13
  28. package/dist/types/cli/stdio-server.d.ts +6 -6
  29. package/dist/types/cli/tool-bootstrap-core-registration.d.ts +1 -0
  30. package/dist/types/cli/tool-registry-adapter.d.ts +9 -1
  31. package/dist/types/cli/turn-media-setup.d.ts +15 -0
  32. package/dist/types/cli/windows-authenticode.d.ts +18 -0
  33. package/dist/types/host-contract/index.d.ts +4 -24
  34. package/dist/types/protocol/agent-contract.d.ts +7 -7
  35. package/dist/types/protocol/wire/acp-protocol.d.ts +6 -5
  36. package/dist/types/protocol/wire/agent-methods.d.ts +0 -115
  37. package/dist/types/protocol/wire/index.d.ts +1 -2
  38. package/dist/types/protocol/wire/notification-payloads.d.ts +0 -87
  39. package/dist/types/runtime/community/community-consent-client.d.ts +3 -0
  40. package/dist/types/runtime/community/ranged-download.d.ts +6 -0
  41. package/dist/types/runtime/infra/industrial-runtime-session-server.d.ts +15 -0
  42. package/dist/types/runtime/infra/llmrouter-access-token.d.ts +13 -0
  43. package/dist/types/skills/tools/exec-tool.d.ts +4 -2
  44. package/dist/types/skills/tools/shell/shell-exec.d.ts +3 -0
  45. package/dist/types/skills/tools/shell/subprocess-env.d.ts +1 -1
  46. package/dist/types/test-support/project-store-fixture.d.ts +11 -0
  47. package/package.json +8 -18
  48. package/dist/pet-contracts.js +0 -1
  49. package/dist/pet-host.js +0 -19
  50. package/dist/types/cli/handlers/pet-confirm-handler.d.ts +0 -7
  51. package/dist/types/cli/pet-confirm-coordinator.d.ts +0 -20
  52. package/dist/types/cli/pet-runtime.d.ts +0 -61
  53. package/dist/types/pet-contracts.d.ts +0 -1
  54. package/dist/types/pet-host.d.ts +0 -9
  55. package/dist/types/protocol/wire/pet-contracts.d.ts +0 -76
  56. package/dist/types/runtime/pet/daily-journey-summarizer.d.ts +0 -25
  57. package/dist/types/runtime/pet/hatch-pet-runner.d.ts +0 -18
  58. package/dist/types/runtime/pet/index.d.ts +0 -19
  59. package/dist/types/runtime/pet/journey-catchup.d.ts +0 -14
  60. package/dist/types/runtime/pet/journey-day-aggregator.d.ts +0 -27
  61. package/dist/types/runtime/pet/journey-narrative-prompt.d.ts +0 -8
  62. package/dist/types/runtime/pet/pet-community-assets.d.ts +0 -21
  63. package/dist/types/runtime/pet/pet-file-loader.d.ts +0 -5
  64. package/dist/types/runtime/pet/pet-growth-engine.d.ts +0 -2
  65. package/dist/types/runtime/pet/pet-profile-service.d.ts +0 -111
  66. package/dist/types/runtime/pet/pet-reaction-engine.d.ts +0 -11
  67. package/dist/types/runtime/pet/pet-soul-service.d.ts +0 -21
  68. package/dist/types/runtime/pet/pet-types.d.ts +0 -1
  69. package/dist/types/runtime/pet/petdex-asset.d.ts +0 -60
  70. package/dist/types/runtime/pet/petdex-forge-service.d.ts +0 -21
  71. package/dist/types/runtime/pet/petdex-vision-qa.d.ts +0 -12
  72. package/dist/types/transport/host-pet-client.d.ts +0 -20
  73. package/dist/vendor/hatch-pet/LICENSE.txt +0 -201
  74. package/dist/vendor/hatch-pet/NOTICE.md +0 -25
  75. package/dist/vendor/hatch-pet/references/animation-rows.md +0 -29
  76. package/dist/vendor/hatch-pet/references/codex-pet-contract.md +0 -35
  77. package/dist/vendor/hatch-pet/references/qa-rubric.md +0 -66
  78. package/dist/vendor/hatch-pet/scripts/compose_atlas.py +0 -169
  79. package/dist/vendor/hatch-pet/scripts/derive_running_left_from_running_right.py +0 -150
  80. package/dist/vendor/hatch-pet/scripts/extract_strip_frames.py +0 -408
  81. package/dist/vendor/hatch-pet/scripts/inspect_frames.py +0 -256
  82. package/dist/vendor/hatch-pet/scripts/make_contact_sheet.py +0 -96
  83. package/dist/vendor/hatch-pet/scripts/prepare_pet_run.py +0 -834
  84. package/dist/vendor/hatch-pet/scripts/render_animation_previews.py +0 -78
  85. package/dist/vendor/hatch-pet/scripts/validate_atlas.py +0 -157
@@ -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 +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";
@@ -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,2 +0,0 @@
1
- export { PetGrowthEngine } from "@xiaozhiclaw/pet-core";
2
- export type { GrowthEvent, MoltResult, PetDisplayTrait } from "@xiaozhiclaw/pet-core";
@@ -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";
@@ -1,60 +0,0 @@
1
- import { type PetdexAssetSource, type PetdexPetAsset, type PetdexValidationReport, type LoadedPetdexPackage, type PetdexImportResult } from "@xiaozhiclaw/pet-core";
2
- export { PETDEX_SCHEMA, PETDEX_VALIDATION_SCHEMA, PETDEX_ATLAS_CONTRACT, PETDEX_ANIMATION_IDS, createDefaultPetdexAnimations, toPetdexAssetSummary, validatePetdexAssetManifest, petdexImageDataUrl, } from "@xiaozhiclaw/pet-core";
3
- export type { PetdexAnimationId, PetdexAnimation, PetdexAtlas, PetdexAssetSource, PetdexPetAsset, PetdexAssetManifest, PetdexPetAssetSummary, PetdexValidationReport, LoadedPetdexPackage, PetdexAssetPackage, PetdexAssetValidation, PetdexImportResult, } from "@xiaozhiclaw/pet-core";
4
- export declare function loadPetdexAssetPackage(filePath: string): Promise<LoadedPetdexPackage>;
5
- /** Load a `.petdex` package directly from its zip bytes (community install downloads it). */
6
- export declare function loadPetdexAssetPackageBytes(zip: Buffer): Promise<LoadedPetdexPackage>;
7
- export declare function buildPetdexAssetImport(filePath: string, targetDir: string): Promise<PetdexImportResult>;
8
- export declare function writePetdexAssetPackage(params: {
9
- asset: PetdexPetAsset;
10
- spritesheet: Buffer;
11
- validation: PetdexValidationReport;
12
- productionRun?: unknown;
13
- outputDir: string;
14
- fileName?: string;
15
- }): Promise<string>;
16
- /**
17
- * Build a `.petdex` zip in memory (single source of truth for the package layout).
18
- * Community publish gzips these bytes for Hub OSS; writePetdexAssetPackage lands them on disk.
19
- * Validation is recomputed from asset+spritesheet so the embedded validation.json always matches.
20
- */
21
- export declare function buildPetdexAssetPackageBytes(params: {
22
- asset: PetdexPetAsset;
23
- spritesheet: Buffer;
24
- productionRun?: unknown;
25
- }): Buffer;
26
- /**
27
- * Package a petdex asset for community publish: the gzipped `.petdex` blob (the exact wire
28
- * format Hub OSS serves at downloadUrl, which the installer gunzips) plus a v15 asset manifest
29
- * carrying the petdex asset descriptor. The hub derives checksum + sizeBytes from the decoded
30
- * blob server-side, so neither is sent here.
31
- */
32
- export declare function buildPetdexPublishPayload(params: {
33
- asset: PetdexPetAsset;
34
- spritesheet: Buffer;
35
- version?: string;
36
- tags?: string[];
37
- }): {
38
- manifest: Record<string, unknown>;
39
- version: string;
40
- packageGzipBase64: string;
41
- };
42
- export declare function createPetdexAssetFromSpritesheet(params: {
43
- id?: string;
44
- name: string;
45
- description: string;
46
- prompt?: string | null;
47
- spritesheet: Buffer;
48
- now?: string;
49
- sourceKind?: PetdexAssetSource["kind"];
50
- }): Promise<{
51
- asset: PetdexPetAsset;
52
- spritesheet: Buffer;
53
- validation: PetdexValidationReport;
54
- }>;
55
- export declare function listBuiltinPetdexAssetIds(): string[];
56
- export declare function listBuiltinPetdexAssets(): Promise<Array<{
57
- asset: PetdexPetAsset;
58
- spritesheet: Buffer;
59
- validation: PetdexValidationReport;
60
- }>>;
@@ -1,21 +0,0 @@
1
- import { type PetdexForgeRequest, type PetdexForgeOutput, type GeneratePetdexImage, type UploadPetdexReferenceImage, type PetdexProductionOptions } from "@xiaozhiclaw/pet-core";
2
- export { PETDEX_PRODUCTION_SCHEMA, } from "@xiaozhiclaw/pet-core";
3
- export type { PetdexForgeRequest, PetdexImageGenerationRequest, PetdexImageGenerationResult, PetdexForgeOutput, PetdexProductionRun, PetdexProductionJob, PetdexProductionReferenceImage, GeneratePetdexImage, UploadPetdexReferenceImage, PetdexProductionOptions, } from "@xiaozhiclaw/pet-core";
4
- export interface PetdexForgePackageOutput extends PetdexForgeOutput {
5
- packagePath: string;
6
- assetDir: string;
7
- manifestPath: string;
8
- spritesheetPath: string;
9
- validationPath: string;
10
- productionRunPath: string;
11
- }
12
- export declare function forgePetdexAsset(input: PetdexForgeRequest, generateImage: GeneratePetdexImage, options?: PetdexProductionOptions): Promise<PetdexForgeOutput & {
13
- qaSkippedJobs?: string[];
14
- }>;
15
- export declare function forgePetdexAssetPackage(params: {
16
- input: PetdexForgeRequest;
17
- outputDir: string;
18
- generateImage: GeneratePetdexImage;
19
- uploadReferenceImage?: UploadPetdexReferenceImage;
20
- }): Promise<PetdexForgePackageOutput>;
21
- export declare function readGeneratedPetdexImage(mediaUrl: string): Promise<Buffer>;
@@ -1,12 +0,0 @@
1
- export interface PetdexVisionVerdict {
2
- ok: boolean;
3
- reason: string;
4
- qaSkipped?: boolean;
5
- }
6
- export interface PetdexVisionQaContext {
7
- label: string;
8
- target: string;
9
- }
10
- /** Lenient parse: only an explicit FAIL blocks ambiguous model output. */
11
- export declare function parsePetdexVisionVerdict(text: string): PetdexVisionVerdict;
12
- export declare function runPetdexVisionQa(call: () => Promise<string>, context: PetdexVisionQaContext, log?: (message: string) => void): Promise<PetdexVisionVerdict>;
@@ -1,20 +0,0 @@
1
- import type { HostRequestParams } from "../host-contract/index.js";
2
- import type { PetSoul } from "../runtime/pet/pet-types.js";
3
- interface PetRequester {
4
- request(params: HostRequestParams): Promise<unknown>;
5
- }
6
- export interface HostPetAwardResult {
7
- active: boolean;
8
- soul?: PetSoul;
9
- growth?: Record<string, unknown>;
10
- events?: Array<Record<string, unknown>>;
11
- }
12
- export declare class HostPetClient {
13
- private readonly requester;
14
- constructor(requester: PetRequester);
15
- isActive(sessionId: string): Promise<boolean>;
16
- getSoul(sessionId: string): Promise<PetSoul | null>;
17
- awardXp(event: string, sessionId: string): Promise<HostPetAwardResult>;
18
- journeyCatchUp(sessionId: string): Promise<string[]>;
19
- }
20
- export {};