gcf-aif-ext 0.26.0 → 0.26.1
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/README.md +1 -1
- package/extension.json +1 -1
- package/lib/play.js +4 -0
- package/lib/shell-env.js +33 -0
- package/lib/verify.js +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -338,7 +338,7 @@ The run layer of the methodology. Update both extensions together — `gcf-harne
|
|
|
338
338
|
- `gcf phase` and `gcf phase next [--reason]` — the project phase (prototype → vertical-slice → alpha → beta → release → live), kept as `phase:` in the `LIVE.md` frontmatter, with exit criteria checked in code. `item new` and `take` refuse a type the phase does not take. **A project with no phase yet is in prototype, and a prototype takes no `asset` item**: move the phase on (`gcf phase next --reason "…"`) if your game is past it. A `phases:` list in `config.yml` replaces the set.
|
|
339
339
|
- A release item carries `version:` and `channel:` (`item new <id> --type release --release 1.0.0 --channel steam`); its end writes the `release:` block of `LIVE.md`. `item new --milestone <name>` tags an item with a milestone of `game.md` (any slug without `game.md`); `design check` reports (does not block) an item whose milestone `game.md` does not list, and the board read gives the list as `design.milestones`.
|
|
340
340
|
- `gcf playtest session` — where main stands and a checklist per item: its build, what to check, how to get there, what to feel.
|
|
341
|
-
- `gcf playtest build <id> [--from <worktree>] [--fresh]`, `build --main [--fresh]`, `start <id>|--main --target <name>`, `stop`, `status`, `setup` — one build per code under `.gcf-session/snaps/<key>/`, held by a card's link `.gcf-session/builds/<id>.json` or the checkout's `snaps/main.link.json`, and its player, from `play:` in `gcf/config.yml`; a verdict stops the card's player and removes the build once no other card holds it. `setup` refuses an output git does not ignore. The deny group `run-play` keeps a run's agent from building; a chat thread may build on the human's ask.
|
|
341
|
+
- `gcf playtest build <id> [--from <worktree>] [--fresh]`, `build --main [--fresh]`, `start <id>|--main --target <name>`, `stop`, `status`, `setup` — one build per code under `.gcf-session/snaps/<key>/`, held by a card's link `.gcf-session/builds/<id>.json` or the checkout's `snaps/main.link.json`, and its player, from `play:` in `gcf/config.yml`; a verdict stops the card's player and removes the build once no other card holds it. `setup` refuses an output git does not ignore. On Windows the project's commands (`play:`, `dod.*`) run with Git's `bin` first in PATH, so `bash` is Git's, not System32's WSL launcher. The deny group `run-play` keeps a run's agent from building; a chat thread may build on the human's ask.
|
|
342
342
|
- `gcf worktree <id>`, `gcf verify <id> --mark`, `gcf integrate [<id>…]` — an item in its own worktree, the `GCF-Verified` trailer, the merge into main and the item's move. Every committed move now holds `.gcf-session/main.lock`.
|
|
343
343
|
- `gcf board [--json]` — everything a board shows in one read.
|
|
344
344
|
|
package/extension.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/lee-to/ai-factory/2.x/schemas/extension.schema.json",
|
|
3
3
|
"name": "gcf-aif-ext",
|
|
4
|
-
"version": "0.26.
|
|
4
|
+
"version": "0.26.1",
|
|
5
5
|
"description": "Game Context Framework for AI Factory",
|
|
6
6
|
"skills": [
|
|
7
7
|
"skills/gcf-init",
|
package/lib/play.js
CHANGED
|
@@ -20,6 +20,7 @@ import { buildLedger } from './ledger.js';
|
|
|
20
20
|
import { alive, claimMainRun, MAIN_RUN, runHolder, withMainLock } from './main-lock.js';
|
|
21
21
|
import { atomicWrite, renameRetrying } from './safe-path.js';
|
|
22
22
|
import { commitMove } from './unit-ops.js';
|
|
23
|
+
import { commandEnv } from './shell-env.js';
|
|
23
24
|
import { failureOf, killTree, runCommand } from './verify.js';
|
|
24
25
|
|
|
25
26
|
export const NOT_SET_UP =
|
|
@@ -683,6 +684,7 @@ const runStop = (dir, command) =>
|
|
|
683
684
|
spawnSync(command, {
|
|
684
685
|
cwd: dir,
|
|
685
686
|
shell: true,
|
|
687
|
+
env: commandEnv(),
|
|
686
688
|
stdio: 'ignore',
|
|
687
689
|
timeout: STOP_WAIT_MS,
|
|
688
690
|
windowsHide: true,
|
|
@@ -771,6 +773,8 @@ function launch(dir, command) {
|
|
|
771
773
|
const child = spawn(process.execPath, ['-e', KEEPER, command], {
|
|
772
774
|
cwd: dir,
|
|
773
775
|
detached: true,
|
|
776
|
+
// The keeper's shell takes it: the start finds the `bash` its agent tried.
|
|
777
|
+
env: commandEnv(),
|
|
774
778
|
stdio: ['ignore', log, log],
|
|
775
779
|
windowsHide: true,
|
|
776
780
|
});
|
package/lib/shell-env.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// The environment a project's command runs in (`dod.*`, `play.build`, a target's start and stop).
|
|
2
|
+
// On Windows cmd.exe finds `bash` by PATH, and outside Git Bash the first one is System32's WSL
|
|
3
|
+
// launcher, which fails with no distribution. The agent finds and tries the project's commands in
|
|
4
|
+
// Git Bash: Git's own `bin` first in PATH gives them the same `bash` and `sh` from a board started
|
|
5
|
+
// in PowerShell, from a console and from a run. That folder holds bash, sh and git alone, so a
|
|
6
|
+
// command written for cmd.exe finds nothing else in it.
|
|
7
|
+
import { spawnSync } from 'node:child_process';
|
|
8
|
+
import { existsSync } from 'node:fs';
|
|
9
|
+
import path from 'node:path';
|
|
10
|
+
|
|
11
|
+
let gitBin;
|
|
12
|
+
|
|
13
|
+
/** Git for Windows' `bin`, found by the git on PATH; null off Windows or with no such Git. */
|
|
14
|
+
export function gitBinDir() {
|
|
15
|
+
if (process.platform !== 'win32') return null;
|
|
16
|
+
if (gitBin !== undefined) return gitBin;
|
|
17
|
+
const res = spawnSync('git', ['--exec-path'], { encoding: 'utf8', windowsHide: true });
|
|
18
|
+
// `<git>/mingw64/libexec/git-core`: its `bin` is three folders up.
|
|
19
|
+
const exec = res.status === 0 ? res.stdout.trim() : '';
|
|
20
|
+
const bin = exec ? path.resolve(exec, '..', '..', '..', 'bin') : null;
|
|
21
|
+
gitBin = bin && existsSync(path.join(bin, 'bash.exe')) ? bin : null;
|
|
22
|
+
|
|
23
|
+
return gitBin;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** `env` with Git's `bin` first in its PATH on Windows; as it is elsewhere. */
|
|
27
|
+
export function commandEnv(env = process.env) {
|
|
28
|
+
const bin = gitBinDir();
|
|
29
|
+
if (!bin) return env;
|
|
30
|
+
const key = Object.keys(env).find((k) => k.toUpperCase() === 'PATH') ?? 'PATH';
|
|
31
|
+
|
|
32
|
+
return { ...env, [key]: `${bin}${path.delimiter}${env[key] ?? ''}` };
|
|
33
|
+
}
|
package/lib/verify.js
CHANGED
|
@@ -7,6 +7,7 @@ import path from 'node:path';
|
|
|
7
7
|
import { readConfig } from './gcf-paths.js';
|
|
8
8
|
import { readLive, applyDelta } from './live.js';
|
|
9
9
|
import { gateProblems } from './gate.js';
|
|
10
|
+
import { commandEnv } from './shell-env.js';
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* Every process's parent, `[pid, ppid]` (POSIX): from /proc on Linux, which a slim image has
|
|
@@ -83,7 +84,7 @@ function stopChildren(doomed) {
|
|
|
83
84
|
*/
|
|
84
85
|
export function runCommand(cmd, cwd, stdio, ms) {
|
|
85
86
|
return new Promise((resolve) => {
|
|
86
|
-
const child = spawn(cmd, { cwd, shell: true, stdio });
|
|
87
|
+
const child = spawn(cmd, { cwd, shell: true, stdio, env: commandEnv() });
|
|
87
88
|
let timedOut = false;
|
|
88
89
|
const timer =
|
|
89
90
|
ms > 0
|