qlogicagent 2.11.2 → 2.11.4
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 +278 -270
- package/dist/index.js +277 -269
- 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/permission-bootstrap.d.ts +7 -0
- package/dist/types/cli/pet-runtime.d.ts +1 -3
- package/dist/types/cli/session-coordinator.d.ts +9 -0
- package/dist/types/cli/session-query-service.d.ts +1 -0
- package/dist/types/cli/tool-bootstrap.d.ts +31 -2
- package/dist/types/cli/turn-permission-sync.d.ts +1 -2
- package/dist/types/protocol/wire/acp-protocol.d.ts +7 -0
- package/dist/types/protocol/wire/chat-types.d.ts +6 -0
- package/dist/types/protocol/wire/gateway-rpc.d.ts +1 -0
- package/dist/types/protocol/wire/notification-payloads.d.ts +12 -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/default-path-service.d.ts +3 -0
- package/dist/types/runtime/infra/project-store.d.ts +1 -0
- package/dist/types/runtime/permission-model.d.ts +19 -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/ports/path-service.d.ts +10 -0
- package/dist/types/runtime/ports/permission-contracts.d.ts +20 -3
- package/dist/types/runtime/ports/tool-contracts.d.ts +3 -0
- package/dist/types/runtime/ports/tool-risk.d.ts +7 -0
- 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/permissions/hook-runner.d.ts +3 -0
- package/dist/types/skills/permissions/operation-classifier.d.ts +36 -0
- package/dist/types/skills/permissions/rule-engine.d.ts +19 -14
- package/dist/types/skills/portable-tool.d.ts +18 -0
- package/dist/types/skills/tools/exec-tool.d.ts +7 -0
- package/dist/types/skills/tools/patch-tool.d.ts +7 -0
- package/dist/types/skills/tools/petdex-create-tool.d.ts +2 -16
- package/dist/types/skills/tools/shell/sandbox/helper-resolver.d.ts +7 -0
- package/dist/types/skills/tools/shell/sandbox/landlock-argv.d.ts +6 -0
- package/dist/types/skills/tools/shell/sandbox/platform.d.ts +3 -0
- package/dist/types/skills/tools/shell/sandbox/sandbox-launcher.d.ts +15 -0
- package/dist/types/skills/tools/shell/sandbox/sandbox-scope.d.ts +6 -0
- package/dist/types/skills/tools/shell/sandbox/sandbox-types.d.ts +47 -0
- package/dist/types/skills/tools/shell/sandbox/seatbelt-profile.d.ts +6 -0
- package/dist/types/skills/tools/shell/shell-exec.d.ts +3 -0
- 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,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,6 @@
|
|
|
1
|
+
import type { NetPolicy } from "./sandbox-types.js";
|
|
2
|
+
/**
|
|
3
|
+
* 构造 landlock helper 调用:`<helper> --allow-write R ... [--deny-net] -- <bin> <args>`。
|
|
4
|
+
* helper 在真实路径上加 landlock 写限制(读不 handle=放开),restrict_self 后 execve 原命令。
|
|
5
|
+
*/
|
|
6
|
+
export declare function buildLandlockArgv(helperPath: string, writableRoots: string[], netPolicy: NetPolicy, bin: string, args: string[]): string[];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { DecideSandboxInput, SandboxConfig, SandboxDecision } from "./sandbox-types.js";
|
|
2
|
+
import type { SandboxPlatform } from "./platform.js";
|
|
3
|
+
/**
|
|
4
|
+
* 纯决策:平台 + 模式 + 可用性 → 包裹或降级。
|
|
5
|
+
* 降级永不抛、永不拒执行(spec「降级安全」)。
|
|
6
|
+
*/
|
|
7
|
+
export declare function decideSandbox(input: DecideSandboxInput): SandboxDecision;
|
|
8
|
+
/** shell-exec 单次入口:派生 scope → 决策 → 返回 spawn 应用的 bin/args + useSandbox。 */
|
|
9
|
+
export declare function applySandboxToSpawn(platform: SandboxPlatform, config: SandboxConfig, bin: string, args: string[]): {
|
|
10
|
+
bin: string;
|
|
11
|
+
args: string[];
|
|
12
|
+
useSandbox: boolean;
|
|
13
|
+
sandboxTmpDir?: string;
|
|
14
|
+
reason: string;
|
|
15
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { PermissionMode } from "../../../../runtime/ports/permission-contracts.js";
|
|
2
|
+
import type { SandboxPlatform } from "./platform.js";
|
|
3
|
+
/** 网络出站策略:allow=放开;deny=禁非回环出站(细粒度留后)。 */
|
|
4
|
+
export type NetPolicy = "allow" | "deny";
|
|
5
|
+
/**
|
|
6
|
+
* Host 在每次 exec 前注入的沙箱上下文(权限单一真相的快照)。
|
|
7
|
+
* undefined 表示 host 不启用沙箱(由调用方决定)。
|
|
8
|
+
*/
|
|
9
|
+
export interface SandboxConfig {
|
|
10
|
+
mode: PermissionMode;
|
|
11
|
+
/** active workdir(pathService.getActiveWorkdir()),恒为可写根。 */
|
|
12
|
+
workdir: string;
|
|
13
|
+
/** 已批准/持久 allow 的目录(rule-engine.getAllowedWriteDirectories())。 */
|
|
14
|
+
allowedDirs: string[];
|
|
15
|
+
/** 工具记账可写目录(taskOutputDir + snapshot 目录),恒可写。 */
|
|
16
|
+
bookkeepingDirs: string[];
|
|
17
|
+
/** 沙箱内 cwd/snapshot 临时目录(可写;= sandboxTmpDir)。 */
|
|
18
|
+
tmpDir: string;
|
|
19
|
+
/** Linux landlock helper 路径(null=不可用→降级)。 */
|
|
20
|
+
helperPath: string | null;
|
|
21
|
+
/** sandbox-exec 是否可用(macOS;由 host 探测)。 */
|
|
22
|
+
sandboxExecAvailable: boolean;
|
|
23
|
+
netPolicy: NetPolicy;
|
|
24
|
+
}
|
|
25
|
+
/** decideSandbox 的输出:是否包裹 + 最终 spawn 的 bin/args。 */
|
|
26
|
+
export interface SandboxDecision {
|
|
27
|
+
/** 是否实际包裹(false=降级,直接用原 bin/args)。 */
|
|
28
|
+
wrapped: boolean;
|
|
29
|
+
bin: string;
|
|
30
|
+
args: string[];
|
|
31
|
+
/** 传给 provider.buildExecCommand 的 useSandbox。 */
|
|
32
|
+
useSandbox: boolean;
|
|
33
|
+
/** 包裹时的可写临时目录(cwdFile 落点);未包裹=undefined。 */
|
|
34
|
+
sandboxTmpDir?: string;
|
|
35
|
+
/** 决策原因(日志/可观测;降级时写 warn)。 */
|
|
36
|
+
reason: string;
|
|
37
|
+
}
|
|
38
|
+
/** decideSandbox 的纯输入(平台/可用性显式传入以便跨平台单测)。 */
|
|
39
|
+
export interface DecideSandboxInput {
|
|
40
|
+
platform: SandboxPlatform;
|
|
41
|
+
config: SandboxConfig;
|
|
42
|
+
/** 原始 spawn 目标。 */
|
|
43
|
+
bin: string;
|
|
44
|
+
args: string[];
|
|
45
|
+
/** 派生好的可写根(deriveWritableRoots 结果)。 */
|
|
46
|
+
writableRoots: string[];
|
|
47
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ShellProvider, ShellType } from "./shell-provider.js";
|
|
2
2
|
import { type ShellCommand } from "./shell-command.js";
|
|
3
3
|
import { type ProgressCallback } from "./task-output.js";
|
|
4
|
+
import type { SandboxConfig } from "./sandbox/sandbox-types.js";
|
|
4
5
|
export type { ExecResult } from "./shell-command.js";
|
|
5
6
|
export declare function getCwd(): string;
|
|
6
7
|
export declare function setCwd(path: string, relativeTo?: string): void;
|
|
@@ -16,6 +17,8 @@ export interface ExecOptions {
|
|
|
16
17
|
onStdout?: (data: string) => void;
|
|
17
18
|
/** Per-call CWD override. When set, spawn uses this instead of the session CWD. */
|
|
18
19
|
cwd?: string;
|
|
20
|
+
/** Sandbox context injected by the host; absent = no OS sandbox (degrade). */
|
|
21
|
+
sandbox?: SandboxConfig;
|
|
19
22
|
}
|
|
20
23
|
/**
|
|
21
24
|
* Set the shell provider for this session.
|
|
@@ -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.
|