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.
Files changed (70) hide show
  1. package/dist/agent-contract.js +1 -1
  2. package/dist/agent.js +26 -26
  3. package/dist/cli.js +1 -1
  4. package/dist/default-project-knowledge/INSTRUCTIONS.md +7 -7
  5. package/dist/default-project-knowledge/rules/project-workflow.md +6 -6
  6. package/dist/host-contract.js +1 -1
  7. package/dist/index.js +443 -465
  8. package/dist/protocol.js +1 -1
  9. package/dist/skills/builtin/desktop-screenshot/SKILL.md +62 -62
  10. package/dist/skills/builtin/office-doc-reading/SKILL.md +19 -19
  11. package/dist/types/cli/agent-runtime-bootstrap.d.ts +0 -1
  12. package/dist/types/cli/community-resource-installer.d.ts +10 -1
  13. package/dist/types/cli/handlers/community-handler.d.ts +0 -8
  14. package/dist/types/cli/handlers/files-handler.d.ts +2 -30
  15. package/dist/types/cli/industrial-runtime-store.d.ts +1 -14
  16. package/dist/types/cli/permission-approval-bridge.d.ts +0 -1
  17. package/dist/types/cli/permission-bootstrap.d.ts +0 -1
  18. package/dist/types/cli/stdio-acp-request-host.d.ts +1 -2
  19. package/dist/types/cli/stdio-agent-session-bootstrap.d.ts +0 -1
  20. package/dist/types/cli/stdio-runtime-bootstrap.d.ts +0 -2
  21. package/dist/types/cli/stdio-runtime-services.d.ts +1 -13
  22. package/dist/types/cli/stdio-server.d.ts +0 -5
  23. package/dist/types/cli/turn-media-setup.d.ts +15 -0
  24. package/dist/types/host-contract/index.d.ts +2 -18
  25. package/dist/types/protocol/agent-contract.d.ts +7 -7
  26. package/dist/types/protocol/wire/agent-methods.d.ts +0 -115
  27. package/dist/types/protocol/wire/index.d.ts +1 -2
  28. package/dist/types/protocol/wire/notification-payloads.d.ts +0 -87
  29. package/package.json +3 -21
  30. package/dist/pet-contracts.js +0 -1
  31. package/dist/pet-host.js +0 -19
  32. package/dist/types/cli/handlers/pet-confirm-handler.d.ts +0 -7
  33. package/dist/types/cli/industrial-runtime-archive.d.ts +0 -14
  34. package/dist/types/cli/pet-confirm-coordinator.d.ts +0 -20
  35. package/dist/types/cli/pet-runtime.d.ts +0 -61
  36. package/dist/types/cli/runtime-dependency-catalog.d.ts +0 -112
  37. package/dist/types/cli/windows-authenticode.d.ts +0 -18
  38. package/dist/types/pet-contracts.d.ts +0 -1
  39. package/dist/types/pet-host.d.ts +0 -9
  40. package/dist/types/protocol/wire/pet-contracts.d.ts +0 -76
  41. package/dist/types/runtime/pet/daily-journey-summarizer.d.ts +0 -25
  42. package/dist/types/runtime/pet/hatch-pet-runner.d.ts +0 -18
  43. package/dist/types/runtime/pet/index.d.ts +0 -19
  44. package/dist/types/runtime/pet/journey-catchup.d.ts +0 -14
  45. package/dist/types/runtime/pet/journey-day-aggregator.d.ts +0 -27
  46. package/dist/types/runtime/pet/journey-narrative-prompt.d.ts +0 -8
  47. package/dist/types/runtime/pet/pet-community-assets.d.ts +0 -21
  48. package/dist/types/runtime/pet/pet-file-loader.d.ts +0 -5
  49. package/dist/types/runtime/pet/pet-growth-engine.d.ts +0 -2
  50. package/dist/types/runtime/pet/pet-profile-service.d.ts +0 -111
  51. package/dist/types/runtime/pet/pet-reaction-engine.d.ts +0 -11
  52. package/dist/types/runtime/pet/pet-soul-service.d.ts +0 -21
  53. package/dist/types/runtime/pet/pet-types.d.ts +0 -1
  54. package/dist/types/runtime/pet/petdex-asset.d.ts +0 -60
  55. package/dist/types/runtime/pet/petdex-forge-service.d.ts +0 -21
  56. package/dist/types/runtime/pet/petdex-vision-qa.d.ts +0 -12
  57. package/dist/types/transport/host-pet-client.d.ts +0 -20
  58. package/dist/vendor/hatch-pet/LICENSE.txt +0 -201
  59. package/dist/vendor/hatch-pet/NOTICE.md +0 -25
  60. package/dist/vendor/hatch-pet/references/animation-rows.md +0 -29
  61. package/dist/vendor/hatch-pet/references/codex-pet-contract.md +0 -35
  62. package/dist/vendor/hatch-pet/references/qa-rubric.md +0 -66
  63. package/dist/vendor/hatch-pet/scripts/compose_atlas.py +0 -169
  64. package/dist/vendor/hatch-pet/scripts/derive_running_left_from_running_right.py +0 -150
  65. package/dist/vendor/hatch-pet/scripts/extract_strip_frames.py +0 -408
  66. package/dist/vendor/hatch-pet/scripts/inspect_frames.py +0 -256
  67. package/dist/vendor/hatch-pet/scripts/make_contact_sheet.py +0 -96
  68. package/dist/vendor/hatch-pet/scripts/prepare_pet_run.py +0 -834
  69. package/dist/vendor/hatch-pet/scripts/render_animation_previews.py +0 -78
  70. package/dist/vendor/hatch-pet/scripts/validate_atlas.py +0 -157
@@ -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 {};
@@ -1,201 +0,0 @@
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.
@@ -1,25 +0,0 @@
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.
@@ -1,29 +0,0 @@
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.
@@ -1,35 +0,0 @@
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/`.
@@ -1,66 +0,0 @@
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.
@@ -1,169 +0,0 @@
1
- #!/usr/bin/env python3
2
- """Compose or normalize a Codex pet spritesheet atlas."""
3
-
4
- from __future__ import annotations
5
-
6
- import argparse
7
- from pathlib import Path
8
-
9
- from PIL import Image
10
-
11
- COLUMNS = 8
12
- ROWS = 9
13
- CELL_WIDTH = 192
14
- CELL_HEIGHT = 208
15
- ATLAS_WIDTH = COLUMNS * CELL_WIDTH
16
- ATLAS_HEIGHT = ROWS * CELL_HEIGHT
17
- ATLAS_ASPECT_RATIO = ATLAS_WIDTH / ATLAS_HEIGHT
18
- ROW_SPECS = [
19
- ("idle", 0, 6),
20
- ("running-right", 1, 8),
21
- ("running-left", 2, 8),
22
- ("waving", 3, 4),
23
- ("jumping", 4, 5),
24
- ("failed", 5, 8),
25
- ("waiting", 6, 6),
26
- ("running", 7, 6),
27
- ("review", 8, 6),
28
- ]
29
- IMAGE_SUFFIXES = {".png", ".webp", ".jpg", ".jpeg"}
30
-
31
-
32
- def image_files(path: Path) -> list[Path]:
33
- return sorted(p for p in path.iterdir() if p.suffix.lower() in IMAGE_SUFFIXES)
34
-
35
-
36
- def find_row_frames(root: Path, state: str, row_index: int) -> list[Path]:
37
- candidates = [
38
- root / state,
39
- root / f"row-{row_index}",
40
- root / f"row{row_index}",
41
- root / f"{row_index}-{state}",
42
- ]
43
- for candidate in candidates:
44
- if candidate.is_dir():
45
- files = image_files(candidate)
46
- if files:
47
- return files
48
- globs = [
49
- f"{state}_*",
50
- f"{state}-*",
51
- f"row{row_index}_*",
52
- f"row-{row_index}-*",
53
- ]
54
- files: list[Path] = []
55
- for pattern in globs:
56
- files.extend(p for p in root.glob(pattern) if p.suffix.lower() in IMAGE_SUFFIXES)
57
- return sorted(set(files))
58
-
59
-
60
- def paste_centered(atlas: Image.Image, source: Image.Image, row: int, column: int) -> None:
61
- frame = source.convert("RGBA")
62
- if frame.size != (CELL_WIDTH, CELL_HEIGHT):
63
- frame.thumbnail((CELL_WIDTH, CELL_HEIGHT), Image.Resampling.LANCZOS)
64
- left = column * CELL_WIDTH + (CELL_WIDTH - frame.width) // 2
65
- top = row * CELL_HEIGHT + (CELL_HEIGHT - frame.height) // 2
66
- atlas.alpha_composite(frame, (left, top))
67
-
68
-
69
- def compose_from_source_atlas(path: Path, resize_source: bool) -> Image.Image:
70
- with Image.open(path) as opened:
71
- source = opened.convert("RGBA")
72
- if source.size != (ATLAS_WIDTH, ATLAS_HEIGHT):
73
- if not resize_source:
74
- raise SystemExit(
75
- f"source atlas must be {ATLAS_WIDTH}x{ATLAS_HEIGHT}; got {source.width}x{source.height}"
76
- )
77
- source_ratio = source.width / source.height
78
- if abs(source_ratio - ATLAS_ASPECT_RATIO) > 0.02:
79
- raise SystemExit(
80
- "refusing to resize source atlas because its aspect ratio does not match "
81
- f"the Codex atlas ratio {ATLAS_ASPECT_RATIO:.3f}; got {source_ratio:.3f}. "
82
- "Generate exact atlas dimensions or use --frames-root."
83
- )
84
- source = source.resize((ATLAS_WIDTH, ATLAS_HEIGHT), Image.Resampling.LANCZOS)
85
-
86
- atlas = Image.new("RGBA", (ATLAS_WIDTH, ATLAS_HEIGHT), (0, 0, 0, 0))
87
- for _state, row, frame_count in ROW_SPECS:
88
- for column in range(frame_count):
89
- left = column * CELL_WIDTH
90
- top = row * CELL_HEIGHT
91
- cell = source.crop((left, top, left + CELL_WIDTH, top + CELL_HEIGHT))
92
- atlas.alpha_composite(cell, (left, top))
93
- return atlas
94
-
95
-
96
- def compose_from_frames(root: Path) -> Image.Image:
97
- atlas = Image.new("RGBA", (ATLAS_WIDTH, ATLAS_HEIGHT), (0, 0, 0, 0))
98
- for state, row, frame_count in ROW_SPECS:
99
- files = find_row_frames(root, state, row)
100
- if len(files) < frame_count:
101
- raise SystemExit(
102
- f"{state} row needs {frame_count} frames, found {len(files)} under {root}"
103
- )
104
- for column, frame_path in enumerate(files[:frame_count]):
105
- with Image.open(frame_path) as frame:
106
- paste_centered(atlas, frame, row, column)
107
- return atlas
108
-
109
-
110
- def clear_transparent_rgb(image: Image.Image) -> Image.Image:
111
- rgba = image.convert("RGBA")
112
- data = bytearray(rgba.tobytes())
113
- for index in range(0, len(data), 4):
114
- if data[index + 3] == 0:
115
- data[index] = 0
116
- data[index + 1] = 0
117
- data[index + 2] = 0
118
- return Image.frombytes("RGBA", rgba.size, bytes(data))
119
-
120
-
121
- def save_outputs(atlas: Image.Image, output: Path, webp_output: Path | None) -> None:
122
- atlas = clear_transparent_rgb(atlas)
123
- output.parent.mkdir(parents=True, exist_ok=True)
124
- atlas.save(output)
125
- if webp_output is not None:
126
- webp_output.parent.mkdir(parents=True, exist_ok=True)
127
- atlas.save(
128
- webp_output,
129
- format="WEBP",
130
- lossless=True,
131
- quality=100,
132
- method=6,
133
- exact=True,
134
- )
135
-
136
-
137
- def main() -> None:
138
- parser = argparse.ArgumentParser(description=__doc__)
139
- source = parser.add_mutually_exclusive_group(required=True)
140
- source.add_argument("--source-atlas")
141
- source.add_argument("--frames-root")
142
- parser.add_argument("--output", required=True)
143
- parser.add_argument("--webp-output")
144
- parser.add_argument(
145
- "--resize-source",
146
- action="store_true",
147
- help="Resize a lower-resolution source atlas only when it already has the Codex atlas aspect ratio.",
148
- )
149
- args = parser.parse_args()
150
-
151
- if args.source_atlas:
152
- atlas = compose_from_source_atlas(
153
- Path(args.source_atlas).expanduser().resolve(), args.resize_source
154
- )
155
- else:
156
- atlas = compose_from_frames(Path(args.frames_root).expanduser().resolve())
157
-
158
- save_outputs(
159
- atlas,
160
- Path(args.output).expanduser().resolve(),
161
- Path(args.webp_output).expanduser().resolve() if args.webp_output else None,
162
- )
163
- print(f"wrote {Path(args.output).expanduser().resolve()}")
164
- if args.webp_output:
165
- print(f"wrote {Path(args.webp_output).expanduser().resolve()}")
166
-
167
-
168
- if __name__ == "__main__":
169
- main()