qlogicagent 2.11.2 → 2.11.3
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/cli.js +290 -289
- package/dist/index.js +292 -291
- package/dist/pet-contracts.js +1 -1
- package/dist/protocol.js +1 -1
- package/dist/types/cli/handlers/session-handler.d.ts +3 -3
- package/dist/types/cli/media-runtime-facade.d.ts +8 -0
- package/dist/types/cli/pet-runtime.d.ts +1 -3
- package/dist/types/cli/session-query-service.d.ts +1 -0
- package/dist/types/protocol/wire/acp-protocol.d.ts +6 -0
- package/dist/types/protocol/wire/gateway-rpc.d.ts +1 -0
- package/dist/types/protocol/wire/pet-contracts.d.ts +3 -2
- package/dist/types/runtime/infra/acp-detector.d.ts +21 -0
- package/dist/types/runtime/infra/project-store.d.ts +1 -0
- package/dist/types/runtime/pet/hatch-pet-runner.d.ts +18 -0
- package/dist/types/runtime/pet/index.d.ts +12 -5
- package/dist/types/runtime/pet/pet-file-loader.d.ts +1 -1
- package/dist/types/runtime/pet/pet-growth-engine.d.ts +2 -58
- package/dist/types/runtime/pet/pet-profile-service.d.ts +5 -7
- package/dist/types/runtime/pet/pet-reaction-engine.d.ts +11 -0
- package/dist/types/runtime/pet/pet-soul-service.d.ts +2 -2
- package/dist/types/runtime/pet/pet-types.d.ts +1 -32
- package/dist/types/runtime/pet/petdex-asset.d.ts +3 -109
- package/dist/types/runtime/pet/petdex-forge-service.d.ts +3 -94
- package/dist/types/runtime/prompt/fresh-workspace-evidence.d.ts +1 -0
- package/dist/types/runtime/session/session-locator.d.ts +2 -0
- package/dist/types/runtime/session/session-persistence.d.ts +17 -3
- package/dist/types/skills/tools/petdex-create-tool.d.ts +2 -16
- package/dist/vendor/hatch-pet/LICENSE.txt +201 -0
- package/dist/vendor/hatch-pet/NOTICE.md +25 -0
- package/dist/vendor/hatch-pet/references/animation-rows.md +29 -0
- package/dist/vendor/hatch-pet/references/codex-pet-contract.md +35 -0
- package/dist/vendor/hatch-pet/references/qa-rubric.md +66 -0
- package/dist/vendor/hatch-pet/scripts/compose_atlas.py +169 -0
- package/dist/vendor/hatch-pet/scripts/derive_running_left_from_running_right.py +150 -0
- package/dist/vendor/hatch-pet/scripts/extract_strip_frames.py +408 -0
- package/dist/vendor/hatch-pet/scripts/inspect_frames.py +256 -0
- package/dist/vendor/hatch-pet/scripts/make_contact_sheet.py +96 -0
- package/dist/vendor/hatch-pet/scripts/prepare_pet_run.py +830 -0
- package/dist/vendor/hatch-pet/scripts/render_animation_previews.py +78 -0
- package/dist/vendor/hatch-pet/scripts/validate_atlas.py +157 -0
- package/package.json +5 -3
- package/dist/types/runtime/pet/pet-reaction-service.d.ts +0 -33
|
@@ -1,84 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
name: string;
|
|
5
|
-
description: string;
|
|
6
|
-
prompt?: string | null;
|
|
7
|
-
referenceImageUrl?: string;
|
|
8
|
-
referenceMode?: "identity" | "refine";
|
|
9
|
-
baseSpritesheet?: Buffer;
|
|
10
|
-
refineAnimationId?: PetdexAnimationId;
|
|
11
|
-
refineFrameIndexes?: number[];
|
|
12
|
-
}
|
|
13
|
-
export interface PetdexImageGenerationRequest {
|
|
14
|
-
prompt: string;
|
|
15
|
-
purpose: "petdex-reference" | "petdex-row-strip";
|
|
16
|
-
animationId?: PetdexAnimationId;
|
|
17
|
-
style: string;
|
|
18
|
-
size: string;
|
|
19
|
-
imageUrl?: string;
|
|
20
|
-
referenceImages?: PetdexProductionReferenceImage[];
|
|
21
|
-
n: 1;
|
|
22
|
-
quality: "auto";
|
|
23
|
-
}
|
|
24
|
-
export interface PetdexImageGenerationResult {
|
|
25
|
-
mediaUrls: string[];
|
|
26
|
-
model?: string;
|
|
27
|
-
size?: string;
|
|
28
|
-
durationMs?: number;
|
|
29
|
-
provider?: string;
|
|
30
|
-
billingUnit?: string;
|
|
31
|
-
billingQuantity?: number;
|
|
32
|
-
}
|
|
33
|
-
export interface PetdexForgeOutput {
|
|
34
|
-
asset: PetdexPetAsset;
|
|
35
|
-
spritesheet: Buffer;
|
|
36
|
-
validation: PetdexValidationReport;
|
|
37
|
-
prompt: string;
|
|
38
|
-
productionRun: PetdexProductionRun;
|
|
39
|
-
model?: string;
|
|
40
|
-
size?: string;
|
|
41
|
-
durationMs?: number;
|
|
42
|
-
mediaUsage?: {
|
|
43
|
-
provider: string;
|
|
44
|
-
model: string;
|
|
45
|
-
billingUnit: string;
|
|
46
|
-
billingQuantity: number;
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
export declare const PETDEX_PRODUCTION_SCHEMA: "qlogic.petdex.production.v1";
|
|
50
|
-
export interface PetdexProductionReferenceImage {
|
|
51
|
-
role: "canonical-reference" | "layout-guide" | "existing-atlas";
|
|
52
|
-
imageUrl: string;
|
|
53
|
-
}
|
|
54
|
-
export interface PetdexProductionJob {
|
|
55
|
-
id: string;
|
|
56
|
-
kind: "reference" | "row-strip";
|
|
57
|
-
status: "complete";
|
|
58
|
-
animationId?: PetdexAnimationId;
|
|
59
|
-
prompt: string;
|
|
60
|
-
inputImages: PetdexProductionReferenceImage[];
|
|
61
|
-
outputUrl: string;
|
|
62
|
-
}
|
|
63
|
-
export interface PetdexProductionRun {
|
|
64
|
-
schema: typeof PETDEX_PRODUCTION_SCHEMA;
|
|
65
|
-
status: "complete";
|
|
66
|
-
sourceMode: "text" | "reference" | "refine";
|
|
67
|
-
contract: typeof PETDEX_ATLAS_CONTRACT;
|
|
68
|
-
jobs: PetdexProductionJob[];
|
|
69
|
-
qa: {
|
|
70
|
-
contactSheet: {
|
|
71
|
-
rows: typeof PETDEX_ATLAS_CONTRACT.rows;
|
|
72
|
-
columns: typeof PETDEX_ATLAS_CONTRACT.columns;
|
|
73
|
-
frameCount: typeof PETDEX_ATLAS_CONTRACT.frameCount;
|
|
74
|
-
};
|
|
75
|
-
rowReports: Array<{
|
|
76
|
-
animationId: PetdexAnimationId;
|
|
77
|
-
status: "pass";
|
|
78
|
-
frames: typeof PETDEX_ATLAS_CONTRACT.columns;
|
|
79
|
-
}>;
|
|
80
|
-
};
|
|
81
|
-
}
|
|
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";
|
|
82
4
|
export interface PetdexForgePackageOutput extends PetdexForgeOutput {
|
|
83
5
|
packagePath: string;
|
|
84
6
|
assetDir: string;
|
|
@@ -87,15 +9,6 @@ export interface PetdexForgePackageOutput extends PetdexForgeOutput {
|
|
|
87
9
|
validationPath: string;
|
|
88
10
|
productionRunPath: string;
|
|
89
11
|
}
|
|
90
|
-
export type GeneratePetdexImage = (request: PetdexImageGenerationRequest) => Promise<PetdexImageGenerationResult>;
|
|
91
|
-
export type UploadPetdexReferenceImage = (input: {
|
|
92
|
-
buffer: Buffer;
|
|
93
|
-
mimeType: string;
|
|
94
|
-
filename: string;
|
|
95
|
-
}) => Promise<string>;
|
|
96
|
-
export interface PetdexProductionOptions {
|
|
97
|
-
uploadReferenceImage?: UploadPetdexReferenceImage;
|
|
98
|
-
}
|
|
99
12
|
export declare function forgePetdexAsset(input: PetdexForgeRequest, generateImage: GeneratePetdexImage, options?: PetdexProductionOptions): Promise<PetdexForgeOutput>;
|
|
100
13
|
export declare function forgePetdexAssetPackage(params: {
|
|
101
14
|
input: PetdexForgeRequest;
|
|
@@ -103,8 +16,4 @@ export declare function forgePetdexAssetPackage(params: {
|
|
|
103
16
|
generateImage: GeneratePetdexImage;
|
|
104
17
|
uploadReferenceImage?: UploadPetdexReferenceImage;
|
|
105
18
|
}): Promise<PetdexForgePackageOutput>;
|
|
106
|
-
export declare function buildPetdexAtlasPrompt(description: string, prompt?: string | null, referenceMode?: "identity" | "refine"): string;
|
|
107
|
-
export declare function buildPetdexCharacterPrompt(description: string, prompt?: string | null, referenceMode?: "identity" | "refine"): string;
|
|
108
|
-
export declare function buildPetdexReferencePrompt(description: string, prompt?: string | null, referenceMode?: "identity" | "refine"): string;
|
|
109
|
-
export declare function buildPetdexRowPrompt(animationId: PetdexAnimationId, description: string, prompt?: string | null, referenceMode?: "identity" | "refine"): string;
|
|
110
19
|
export declare function readGeneratedPetdexImage(mediaUrl: string): Promise<Buffer>;
|
|
@@ -15,5 +15,6 @@ export interface FreshWorkspaceEvidencePolicy {
|
|
|
15
15
|
allowedToolNames: string[];
|
|
16
16
|
}
|
|
17
17
|
export declare function getFreshWorkspaceEvidencePolicy(messages: readonly PromptMessageLike[] | string): FreshWorkspaceEvidencePolicy;
|
|
18
|
+
export declare function isLightweightChatTurn(messages: readonly PromptMessageLike[] | string): boolean;
|
|
18
19
|
export declare function selectFreshWorkspaceEvidenceTools<TTool extends ToolNameLike>(tools: readonly TTool[], policy: FreshWorkspaceEvidencePolicy): TTool[];
|
|
19
20
|
export declare function createFreshWorkspaceEvidenceSection(policy: FreshWorkspaceEvidencePolicy): SystemPromptSection | null;
|
|
@@ -21,4 +21,6 @@ export declare class SessionLocator {
|
|
|
21
21
|
getActiveProjectWorkspaceDir(): string;
|
|
22
22
|
/** Get the active project's ID. */
|
|
23
23
|
getActiveProjectId(): string;
|
|
24
|
+
/** Get the default project's ID for external personal channel sessions. */
|
|
25
|
+
getDefaultProjectId(): string;
|
|
24
26
|
}
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
* 3. Feed messages as initial context to agent
|
|
17
17
|
*/
|
|
18
18
|
import type { ChatMessage } from "../../protocol/wire/index.js";
|
|
19
|
+
import type { TokenUsage } from "../../agent/types.js";
|
|
19
20
|
import type { SessionUsageSnapshot } from "./session-state.js";
|
|
20
21
|
export interface SessionMetadata {
|
|
21
22
|
sessionId: string;
|
|
@@ -35,6 +36,7 @@ export interface SessionMetadata {
|
|
|
35
36
|
previousSessionId?: string;
|
|
36
37
|
carryoverSummary?: string;
|
|
37
38
|
type?: "personal" | "group";
|
|
39
|
+
ownerPlatform?: string;
|
|
38
40
|
ownerId?: string;
|
|
39
41
|
groupKey?: string;
|
|
40
42
|
groupName?: string;
|
|
@@ -52,7 +54,12 @@ export interface SessionMetadata {
|
|
|
52
54
|
}
|
|
53
55
|
export interface PersistedSession {
|
|
54
56
|
metadata: SessionMetadata;
|
|
55
|
-
messages:
|
|
57
|
+
messages: PersistedChatMessage[];
|
|
58
|
+
}
|
|
59
|
+
export interface PersistedChatMessage extends ChatMessage {
|
|
60
|
+
timestamp?: string;
|
|
61
|
+
turnId?: string;
|
|
62
|
+
usage?: TokenUsage;
|
|
56
63
|
}
|
|
57
64
|
export interface SessionListEntry {
|
|
58
65
|
sessionId: string;
|
|
@@ -84,7 +91,9 @@ export declare function getSessionMetadata(sessionId: string, projectRoot: strin
|
|
|
84
91
|
* Robustness: catches disk-full and I/O errors without crashing the agent.
|
|
85
92
|
* Returns false if the write fails.
|
|
86
93
|
*/
|
|
87
|
-
export declare function appendMessage(sessionId: string, message: ChatMessage, projectRoot: string, turnId?: string
|
|
94
|
+
export declare function appendMessage(sessionId: string, message: ChatMessage, projectRoot: string, turnId?: string, metadata?: {
|
|
95
|
+
usage?: TokenUsage;
|
|
96
|
+
}): Promise<boolean>;
|
|
88
97
|
/**
|
|
89
98
|
* Save session metadata + usage stats atomically (flat structure).
|
|
90
99
|
*/
|
|
@@ -92,6 +101,9 @@ export declare function saveSessionState(sessionId: string, usageSnapshot: Sessi
|
|
|
92
101
|
/**
|
|
93
102
|
* Update specific metadata fields of a session without touching cost data.
|
|
94
103
|
* Used by session CRUD RPC (rename, pin, archive, move-to-project).
|
|
104
|
+
*
|
|
105
|
+
* Concurrency-bounded via withSessionWriteLimit (see above) so a burst of parallel
|
|
106
|
+
* updates cannot exhaust the fs thread pool and wedge the RPC channel.
|
|
95
107
|
*/
|
|
96
108
|
export declare function updateSessionMetadata(sessionId: string, patch: Partial<Record<keyof SessionMetadata, SessionMetadata[keyof SessionMetadata] | null>>, projectRoot: string): Promise<SessionMetadata | null>;
|
|
97
109
|
/**
|
|
@@ -99,7 +111,9 @@ export declare function updateSessionMetadata(sessionId: string, patch: Partial<
|
|
|
99
111
|
*
|
|
100
112
|
* Returns null if the session doesn't exist or is corrupted.
|
|
101
113
|
*/
|
|
102
|
-
export declare function loadSessionForResume(sessionId: string, projectRoot: string
|
|
114
|
+
export declare function loadSessionForResume(sessionId: string, projectRoot: string, options?: {
|
|
115
|
+
includeDisplayMetadata?: boolean;
|
|
116
|
+
}): Promise<PersistedSession | null>;
|
|
103
117
|
/**
|
|
104
118
|
* List available sessions for resume CC ResumeConversation picker.
|
|
105
119
|
* Returns most-recent-first, up to `limit` entries.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PortableTool } from "../portable-tool.js";
|
|
2
|
-
import {
|
|
2
|
+
import type { GeneratePetdexImage, UploadPetdexReferenceImage } from "@xiaozhiclaw/pet-core";
|
|
3
3
|
export declare const PETDEX_CREATE_TOOL_NAME: "petdex_create";
|
|
4
4
|
export interface PetdexCreateToolParams {
|
|
5
5
|
name?: string;
|
|
@@ -7,8 +7,6 @@ export interface PetdexCreateToolParams {
|
|
|
7
7
|
prompt?: string;
|
|
8
8
|
reference_image_url?: string;
|
|
9
9
|
base_spritesheet_path?: string;
|
|
10
|
-
refine_animation_id?: string;
|
|
11
|
-
refine_frame_indexes?: number[];
|
|
12
10
|
output_dir?: string;
|
|
13
11
|
}
|
|
14
12
|
export interface PetdexCreateToolDeps {
|
|
@@ -37,19 +35,7 @@ export declare const PETDEX_CREATE_TOOL_SCHEMA: {
|
|
|
37
35
|
};
|
|
38
36
|
readonly base_spritesheet_path: {
|
|
39
37
|
readonly type: "string";
|
|
40
|
-
readonly description: "Optional existing spritesheet.webp path
|
|
41
|
-
};
|
|
42
|
-
readonly refine_animation_id: {
|
|
43
|
-
readonly type: "string";
|
|
44
|
-
readonly enum: readonly ["idle", "thinking", "working", "done", "happy", "error", "attention", "dragging", "sleeping"];
|
|
45
|
-
readonly description: "Optional canonical animation id to regenerate against base_spritesheet_path.";
|
|
46
|
-
};
|
|
47
|
-
readonly refine_frame_indexes: {
|
|
48
|
-
readonly type: "array";
|
|
49
|
-
readonly items: {
|
|
50
|
-
readonly type: "number";
|
|
51
|
-
};
|
|
52
|
-
readonly description: "Optional frame indexes to replace for targeted refinement. Accepts row-local 0..7, global 0..71, or global 1..72.";
|
|
38
|
+
readonly description: "Optional existing spritesheet.webp path; used as the identity reference to regenerate the whole atlas while keeping the same character.";
|
|
53
39
|
};
|
|
54
40
|
readonly output_dir: {
|
|
55
41
|
readonly type: "string";
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf of
|
|
171
|
+
any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don\'t include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Vendored: OpenAI Codex Hatch-Pet pipeline
|
|
2
|
+
|
|
3
|
+
This directory vendors the deterministic image-processing pipeline from the
|
|
4
|
+
OpenAI Skills repository, used by qlogicagent's Petdex forge to produce
|
|
5
|
+
Codex-compatible animated pet sprite sheets.
|
|
6
|
+
|
|
7
|
+
- **Source:** https://github.com/openai/skills — `skills/.curated/hatch-pet/`
|
|
8
|
+
- **License:** Apache License 2.0 (see `LICENSE.txt`)
|
|
9
|
+
- **Vendored on:** 2026-06-05
|
|
10
|
+
|
|
11
|
+
## Contents
|
|
12
|
+
|
|
13
|
+
- `scripts/*.py` — pipeline scripts (chroma-key frame extraction, frame QA,
|
|
14
|
+
atlas composition, atlas validation, contact sheet, animation GIF previews,
|
|
15
|
+
running-left mirror derivation, run preparation). Invoked as subprocesses by
|
|
16
|
+
`src/runtime/pet/` — qlogicagent does **not** import them.
|
|
17
|
+
- `references/*.md` — Codex pet contract / animation-rows / QA rubric, kept for
|
|
18
|
+
reference and prompt alignment.
|
|
19
|
+
- `LICENSE.txt` — Apache License 2.0.
|
|
20
|
+
|
|
21
|
+
## Modifications
|
|
22
|
+
|
|
23
|
+
None. Files are vendored verbatim and executed via a Python subprocess
|
|
24
|
+
(Pillow is the only third-party dependency). Any future local change must be
|
|
25
|
+
recorded here per the Apache-2.0 NOTICE requirement.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Animation Rows
|
|
2
|
+
|
|
3
|
+
The Codex app reads one fixed atlas: 8 columns, 9 rows, 192x208 pixels per cell.
|
|
4
|
+
|
|
5
|
+
| Row | State | Used columns | Durations |
|
|
6
|
+
| --- | --- | ---: | --- |
|
|
7
|
+
| 0 | idle | 0-5 | 280, 110, 110, 140, 140, 320 ms |
|
|
8
|
+
| 1 | running-right | 0-7 | 120 ms each, final 220 ms |
|
|
9
|
+
| 2 | running-left | 0-7 | 120 ms each, final 220 ms |
|
|
10
|
+
| 3 | waving | 0-3 | 140 ms each, final 280 ms |
|
|
11
|
+
| 4 | jumping | 0-4 | 140 ms each, final 280 ms |
|
|
12
|
+
| 5 | failed | 0-7 | 140 ms each, final 240 ms |
|
|
13
|
+
| 6 | waiting | 0-5 | 150 ms each, final 260 ms |
|
|
14
|
+
| 7 | running | 0-5 | 120 ms each, final 220 ms |
|
|
15
|
+
| 8 | review | 0-5 | 150 ms each, final 280 ms |
|
|
16
|
+
|
|
17
|
+
Unused cells after each row's final used column must be fully transparent.
|
|
18
|
+
|
|
19
|
+
## Row Purposes
|
|
20
|
+
|
|
21
|
+
- `idle`: calm, low-distraction breathing/blinking loop; use as the reduced-motion first frame. Keep motion subtle and persona-preserving.
|
|
22
|
+
- `running-right`: locomotion to the right; 8-frame loop should read directionally.
|
|
23
|
+
- `running-left`: mirrored or redrawn locomotion to the left; do not simply reuse right-facing frames unless the design is symmetric, and any mirror derivation must preserve frame order and timing semantics.
|
|
24
|
+
- `waving`: greeting or attention gesture; clear start, raised gesture, return.
|
|
25
|
+
- `jumping`: anticipation, lift, peak, descent, settle.
|
|
26
|
+
- `failed`: error/sad/deflated reaction; readable but not visually noisy.
|
|
27
|
+
- `waiting`: blocked-on-user-input state; expectant asking pose for approval, help, or user input.
|
|
28
|
+
- `running`: active task work state; focused processing, thinking, scanning, typing, or effortful concentration. This row is not foot-running; avoid jogging, sprinting, treadmill motion, raised knees, long steps, pumping arms, or directional travel.
|
|
29
|
+
- `review`: focused/inspecting/thinking loop suitable for review state.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Codex Pet Contract
|
|
2
|
+
|
|
3
|
+
## Sprite Atlas
|
|
4
|
+
|
|
5
|
+
- Format: PNG or WebP.
|
|
6
|
+
- Dimensions: `1536x1872`.
|
|
7
|
+
- Grid: 8 columns x 9 rows.
|
|
8
|
+
- Cell: `192x208`.
|
|
9
|
+
- Background: transparent.
|
|
10
|
+
- Unused cells: fully transparent.
|
|
11
|
+
|
|
12
|
+
The webview animation uses CSS background positions from the fixed row and column counts. Do not add labels, gutters, borders, grid lines, shadows outside the cell, or extra frames.
|
|
13
|
+
|
|
14
|
+
## Local Custom Pet Package
|
|
15
|
+
|
|
16
|
+
Place files under:
|
|
17
|
+
|
|
18
|
+
```text
|
|
19
|
+
${CODEX_HOME:-$HOME/.codex}/pets/<pet-name>/
|
|
20
|
+
├── pet.json
|
|
21
|
+
└── spritesheet.webp
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Manifest shape:
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"id": "pet-name",
|
|
29
|
+
"displayName": "Pet Name",
|
|
30
|
+
"description": "One short sentence.",
|
|
31
|
+
"spritesheetPath": "spritesheet.webp"
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The app loads custom pets from the folder name under `${CODEX_HOME:-$HOME/.codex}/pets/`.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# QA Rubric
|
|
2
|
+
|
|
3
|
+
Do not accept an atlas until all checks pass.
|
|
4
|
+
|
|
5
|
+
## Geometry
|
|
6
|
+
|
|
7
|
+
- Exact `1536x1872` dimensions.
|
|
8
|
+
- 8 columns x 9 rows.
|
|
9
|
+
- Each frame fits inside its `192x208` cell.
|
|
10
|
+
- Unused cells are transparent.
|
|
11
|
+
- Fully transparent atlas pixels do not retain non-zero RGB residue after export.
|
|
12
|
+
- `qa/review.json` has no errors.
|
|
13
|
+
- `frames/frames-manifest.json` records component extraction for production rows unless `stable-slots` was intentionally chosen to preserve row-level playback stability after visual inspection.
|
|
14
|
+
|
|
15
|
+
## Character Consistency
|
|
16
|
+
|
|
17
|
+
- Same silhouette and proportions across every row.
|
|
18
|
+
- Same face and expression language.
|
|
19
|
+
- Same style, material, palette, lighting, and prop design.
|
|
20
|
+
- No frame introduces a new unintended character or object.
|
|
21
|
+
|
|
22
|
+
## Pet-Safe Style
|
|
23
|
+
|
|
24
|
+
- Art reads as a Codex app pet, not a scene, app icon, logo sheet, or standalone illustration.
|
|
25
|
+
- Silhouette is compact and clear enough to read inside a `192x208` cell.
|
|
26
|
+
- The chosen style is consistent across every row, including edge treatment, material, lighting, and palette.
|
|
27
|
+
- Pixel, plush, clay, sticker, flat vector, 3D toy, painterly mascot, ink, and brand-inspired styles are all acceptable when readable at pet size.
|
|
28
|
+
- No tiny accessories, texture detail, logo detail, or text that disappears or becomes noisy at pet size.
|
|
29
|
+
|
|
30
|
+
## Animation Completeness
|
|
31
|
+
|
|
32
|
+
- Each row uses the exact expected number of frames.
|
|
33
|
+
- The first and last frames can loop without an obvious pop.
|
|
34
|
+
- Directional rows read as the intended direction.
|
|
35
|
+
- Mirrored directional rows preserve temporal frame order rather than reversing the cadence.
|
|
36
|
+
- State-specific actions are recognizable at pet size.
|
|
37
|
+
- Poses are generated animation variants, not repeated copies of the same source image.
|
|
38
|
+
- Preview GIFs do not show unintended size popping, extraction-induced baseline jumps, or wrong directional facing.
|
|
39
|
+
|
|
40
|
+
## App Fitness
|
|
41
|
+
|
|
42
|
+
- First idle frame works as a static reduced-motion pet.
|
|
43
|
+
- The `idle` row should be calm and low-distraction; reject it if it reads as waving, walking, running, jumping, talking, working, reviewing, reacting dramatically, changing props, or making large pose/silhouette changes.
|
|
44
|
+
- No important detail is too small to read.
|
|
45
|
+
- No frame is clipped by the cell.
|
|
46
|
+
- Failed/review/waiting states are distinct from ordinary idle.
|
|
47
|
+
- Contact sheets must show whole sprite poses inside cells, not cropped tiles from a larger reference image.
|
|
48
|
+
- Contact sheets must not be accepted if every used frame is just the reference image with small geometric transforms.
|
|
49
|
+
- Used cells must not have white or opaque rectangular backgrounds unless the pet intentionally fills the whole cell and the user accepts that tradeoff.
|
|
50
|
+
- The chroma key must be visually absent from the character. If extraction removes character regions, choose a different key and regenerate the affected base/rows.
|
|
51
|
+
- Contact sheets must not show edge slivers or partial neighboring sprites inside cells.
|
|
52
|
+
- Contact sheets must not show darker/lighter versions of the chroma key as shadows, dust, smears, glows, landing marks, or motion effects. These are background extraction failures and should trigger row repair.
|
|
53
|
+
- If `qa/review.json` reports edge pixels, sparse frames, size outliers, or slot-extraction fallback, inspect the row visually and repair it when the issue is visible.
|
|
54
|
+
- If `qa/review.json` reports chroma-adjacent non-transparent pixels, repair the row unless those pixels are an intentional character color and the selected key was manually accepted.
|
|
55
|
+
- If preview GIFs show size popping even though the generated strip itself had stable scale and placement, rerun extraction with `stable-slots` before regenerating the row.
|
|
56
|
+
- If previews show wrong facing direction, reversed cadence, non-alternating gait, or an effectively static idle loop, repair or regenerate the affected row.
|
|
57
|
+
|
|
58
|
+
## Repair Policy
|
|
59
|
+
|
|
60
|
+
Repair the smallest failing scope first:
|
|
61
|
+
|
|
62
|
+
1. Single bad frame.
|
|
63
|
+
2. One row.
|
|
64
|
+
3. Full atlas regeneration only when identity or layout is broadly broken.
|
|
65
|
+
|
|
66
|
+
The normal production path should regenerate only the affected row and copy the selected replacement into the same decoded output path unless the base character is wrong.
|