pi-codex-image-gen 0.1.4 → 0.1.6

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/CHANGELOG.md ADDED
@@ -0,0 +1,67 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ This project follows the spirit of [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and uses semantic versioning for releases.
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.1.6] - 2026-05-09
10
+
11
+ ### Changed
12
+
13
+ - Switched development, CI, and publish workflows from Bun to npm with `package-lock.json` for better Pi package consistency.
14
+
15
+ ## [0.1.5] - 2026-05-07
16
+
17
+ ### Added
18
+
19
+ - CI workflow running type-check and `pack:dry-run` on every push and PR.
20
+ - `CHANGELOG.md`, `CONTRIBUTING.md`, `CODE_OF_CONDUCT.md`, `SECURITY.md`.
21
+ - GitHub PR template and issue templates (bug report, feature request).
22
+ - `.editorconfig` for consistent editor settings.
23
+
24
+ ### Changed
25
+
26
+ - `peerDependencies` relaxed to `"*"`; pinned versions moved to `devDependencies`.
27
+ - `tsconfig.json` module resolution updated from `Node16` to `NodeNext`.
28
+ - `package.json`: added `author`, `bugs`, `homepage`, `publishConfig.access`, `engines`, `pi-extension` keyword; community docs included in published `files`.
29
+
30
+ ## [0.1.4] - 2026-05-07
31
+
32
+ ### Fixed
33
+
34
+ - Added `repository.url` to `package.json`, required by npm provenance (sigstore) verification.
35
+
36
+ ## [0.1.3] - 2026-05-07
37
+
38
+ ### Changed
39
+
40
+ - Migrated peer dependencies from `@mariozechner` to `@earendil-works` scope (`@earendil-works/pi-ai`, `@earendil-works/pi-coding-agent` v0.74.0).
41
+
42
+ ### Added
43
+
44
+ - `.github/workflows/publish.yml`: OIDC-based npm publish triggered on GitHub release.
45
+ - `scripts.check` and `scripts.pack:dry-run` in `package.json`.
46
+
47
+ ## [0.1.2] - 2025
48
+
49
+ ### Changed
50
+
51
+ - Moved extension entry point to `index.ts` at the package root for a cleaner npm package name display in Pi.
52
+
53
+ ## [0.1.1] - 2025
54
+
55
+ ### Fixed
56
+
57
+ - Fixed extension identifier to use the package name instead of `package:file`.
58
+
59
+ ## [0.1.0] - 2025
60
+
61
+ ### Added
62
+
63
+ - Initial release.
64
+ - `codex_generate_image` Pi extension using the OpenAI Codex ChatGPT backend (`gpt-image-2`). Piggybacks on Pi's `openai-codex` login — no `OPENAI_API_KEY` required.
65
+ - `skills/imagegen` Pi skill with prompting playbook, chroma-key transparency workflow, and Python CLI fallback (`image_gen.py`).
66
+ - Save-mode configuration (`none`, `project`, `global`, `custom`) with env and config-file overrides.
67
+ - SSE stream parsing with exponential backoff retry on transient errors.
@@ -0,0 +1,35 @@
1
+ # Code of Conduct
2
+
3
+ This project follows the Contributor Covenant Code of Conduct, version 2.1.
4
+
5
+ ## Our pledge
6
+
7
+ We pledge to make participation in this project a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
8
+
9
+ ## Our standards
10
+
11
+ Examples of behavior that contributes to a positive environment include:
12
+
13
+ - demonstrating empathy and kindness toward other people;
14
+ - being respectful of differing opinions, viewpoints, and experiences;
15
+ - giving and gracefully accepting constructive feedback;
16
+ - accepting responsibility and apologizing to those affected by mistakes;
17
+ - focusing on what is best for the overall community.
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ - sexualized language or imagery, and sexual attention or advances;
22
+ - trolling, insulting or derogatory comments, and personal or political attacks;
23
+ - public or private harassment;
24
+ - publishing others' private information without explicit permission;
25
+ - other conduct that could reasonably be considered inappropriate in a professional setting.
26
+
27
+ ## Enforcement
28
+
29
+ Project maintainers are responsible for clarifying and enforcing standards of acceptable behavior and may remove, edit, or reject comments, commits, code, issues, and other contributions that are not aligned with this Code of Conduct.
30
+
31
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project maintainer through GitHub. All reports will be reviewed and investigated promptly and fairly.
32
+
33
+ ## Attribution
34
+
35
+ This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), version 2.1.
@@ -0,0 +1,61 @@
1
+ # Contributing
2
+
3
+ Thanks for your interest in contributing to `pi-codex-image-gen`.
4
+
5
+ ## Development setup
6
+
7
+ ```bash
8
+ npm install
9
+ npm run check
10
+ ```
11
+
12
+ The package is source-distributed: Pi loads the TypeScript extension file directly. There is no build step for runtime use.
13
+
14
+ ## Local testing
15
+
16
+ Install this checkout into a temporary Pi project:
17
+
18
+ ```bash
19
+ mkdir -p <test-project>
20
+ cd <test-project>
21
+ pi package add -l /path/to/pi-codex-image-gen
22
+ pi
23
+ ```
24
+
25
+ Then run `/login` for `openai-codex` and ask Pi to generate an image.
26
+
27
+ For a one-off run without changing settings:
28
+
29
+ ```bash
30
+ pi -e /path/to/pi-codex-image-gen/index.ts
31
+ ```
32
+
33
+ To validate the Python CLI fallback without an API key:
34
+
35
+ ```bash
36
+ python3 skills/imagegen/scripts/image_gen.py generate --prompt "Test" --out /tmp/test.png --dry-run
37
+ python3 skills/imagegen/scripts/remove_chroma_key.py --help
38
+ ```
39
+
40
+ ## Pull request checklist
41
+
42
+ Before opening a pull request:
43
+
44
+ - Run `npm run check`.
45
+ - Run `npm run pack:dry-run` and confirm the package contents are intentional.
46
+ - Update `README.md` if user-facing behavior changes.
47
+ - Update `CHANGELOG.md` for notable changes.
48
+ - Keep examples and paths generic; do not commit machine-specific paths or credentials.
49
+
50
+ ## Coding guidelines
51
+
52
+ - Keep extension logic in `index.ts` unless there is a clear reason to split.
53
+ - When changing tool parameters, update both the Typebox `TOOL_PARAMS` schema and the `promptGuidelines` strings — Pi surfaces both to the model.
54
+ - Treat save-mode names, config file keys, and auth flow as public interface; changes to defaults or precedence are breaking changes.
55
+ - Do not modify `skills/imagegen/scripts/image_gen.py` without a documented reason; it is a vendored fallback.
56
+ - The Codex Responses SSE contract is undocumented and may change. If generation breaks, log raw events before assuming a code bug.
57
+ - Avoid requiring `OPENAI_API_KEY` for the normal Pi tool path; auth piggybacks on Pi's `openai-codex` login.
58
+
59
+ ## Code of conduct
60
+
61
+ This project follows the [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md).
package/SECURITY.md ADDED
@@ -0,0 +1,24 @@
1
+ # Security Policy
2
+
3
+ ## Supported versions
4
+
5
+ Security fixes are provided for the latest released version of `pi-codex-image-gen`.
6
+
7
+ ## Reporting a vulnerability
8
+
9
+ Please do not open a public issue for suspected security vulnerabilities.
10
+
11
+ Report privately by contacting the repository maintainer through GitHub. Include:
12
+
13
+ - a description of the issue;
14
+ - steps to reproduce;
15
+ - affected versions or commits, if known;
16
+ - any suggested mitigation.
17
+
18
+ The maintainer will acknowledge reports as soon as practical and coordinate disclosure once a fix or mitigation is available.
19
+
20
+ ## Security model
21
+
22
+ `pi-codex-image-gen` is a Pi package. Pi extensions execute with the same permissions as the local user running Pi. Users should review installed Pi packages and only install packages from sources they trust.
23
+
24
+ The extension uses Pi's existing `openai-codex` login to obtain a short-lived JWT. The token is used only for requests to the Codex Responses API and is never written to disk or logged. Do not commit API keys, tokens, or decoded JWT payloads.
package/package.json CHANGED
@@ -1,30 +1,60 @@
1
1
  {
2
2
  "name": "pi-codex-image-gen",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "Image generation for Pi using the ChatGPT Images 2.0 model.",
5
+ "type": "module",
5
6
  "license": "Apache-2.0",
6
- "files": ["index.ts", "skills", "README.md", "LICENSE"],
7
- "keywords": ["pi-package", "pi", "codex", "image-generation", "gpt-image-2"],
7
+ "author": "jvm",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+https://github.com/jvm/pi-codex-image-gen.git"
11
11
  },
12
- "type": "module",
12
+ "bugs": {
13
+ "url": "https://github.com/jvm/pi-codex-image-gen/issues"
14
+ },
15
+ "homepage": "https://github.com/jvm/pi-codex-image-gen#readme",
16
+ "keywords": [
17
+ "pi-package",
18
+ "pi-extension",
19
+ "pi",
20
+ "codex",
21
+ "image-generation",
22
+ "gpt-image-2"
23
+ ],
24
+ "files": [
25
+ "index.ts",
26
+ "skills",
27
+ "README.md",
28
+ "LICENSE",
29
+ "CHANGELOG.md",
30
+ "SECURITY.md",
31
+ "CONTRIBUTING.md",
32
+ "CODE_OF_CONDUCT.md"
33
+ ],
13
34
  "scripts": {
14
35
  "check": "tsc --noEmit",
15
36
  "pack:dry-run": "npm pack --dry-run"
16
37
  },
17
- "peerDependencies": {
18
- "@earendil-works/pi-ai": "^0.74.0",
19
- "@earendil-works/pi-coding-agent": "^0.74.0",
20
- "typebox": "^1.1.33"
21
- },
22
38
  "pi": {
23
39
  "extensions": ["./index.ts"],
24
40
  "skills": ["./skills"]
25
41
  },
42
+ "peerDependencies": {
43
+ "@earendil-works/pi-ai": "*",
44
+ "@earendil-works/pi-coding-agent": "*",
45
+ "typebox": "*"
46
+ },
26
47
  "devDependencies": {
48
+ "@earendil-works/pi-ai": "^0.74.0",
49
+ "@earendil-works/pi-coding-agent": "^0.74.0",
50
+ "typebox": "^1.1.33",
27
51
  "@types/node": "^25.6.0",
28
52
  "typescript": "^6.0.3"
53
+ },
54
+ "publishConfig": {
55
+ "access": "public"
56
+ },
57
+ "engines": {
58
+ "node": ">=20.6.0"
29
59
  }
30
60
  }