gcf-aif-ext 0.22.0 → 0.22.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 +4 -0
- package/extension.json +1 -1
- package/lib/agent-permissions.js +16 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -50,6 +50,10 @@ Updating preserves `gcf/`, `cnlp.config.json` and the pre-commit hook. Run `ai-f
|
|
|
50
50
|
|
|
51
51
|
On Windows, run `extension add` and `extension update` from PowerShell or cmd, not Git Bash: the installer unpacks with `tar`, and Git Bash's GNU tar reads `C:\…` as a remote host (`Cannot connect to C: resolve failed`). The Windows `tar.exe` handles it.
|
|
52
52
|
|
|
53
|
+
### 0.22.1
|
|
54
|
+
|
|
55
|
+
- An agent may read the history of past runs: the deny group `human-moves` held `ai-factory gcf-harness run*`, which also caught `gcf-harness runs`, the very command `AGENTS.md` tells it to use. The rule is now `ai-factory gcf-harness run *`. A session started after the update takes it; nothing to re-run in the project.
|
|
56
|
+
|
|
53
57
|
### 0.22.0
|
|
54
58
|
|
|
55
59
|
- **`gcf changes`**: what is not committed, anywhere in the project, read only. `gcf changes [--worktree <id>] [--json]` lists the main checkout or a run's worktree: each file's status against the base (a worktree's base is where it left the main checkout, so what the run committed on its branch shows too, with its state `branch`, `open` or `both`), and what a board's click does (`text`, `image`, `binary`, `listed`). `gcf changes diff --path <p>` gives a text file's diff, and `gcf changes file --path <p> --side base|now --json` a picture's bytes as base64. `gcf/.metrics/` and `.gcf-session/` are never listed.
|
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.22.
|
|
4
|
+
"version": "0.22.1",
|
|
5
5
|
"description": "Game Context Framework for AI Factory",
|
|
6
6
|
"skills": [
|
|
7
7
|
"skills/gcf-init",
|
package/lib/agent-permissions.js
CHANGED
|
@@ -130,7 +130,8 @@ export const DENY_GROUPS = [
|
|
|
130
130
|
// The stash stack is the checkout's and every worktree's: a pop may take the operator's.
|
|
131
131
|
id: 'git-discard',
|
|
132
132
|
label:
|
|
133
|
-
'uncommitted work: reset --hard, clean, checkout or restore of all, stash
|
|
133
|
+
'uncommitted work: reset --hard, clean, checkout or restore of all, stash ' +
|
|
134
|
+
'(list and show are free)',
|
|
134
135
|
on: true,
|
|
135
136
|
rules: shell(
|
|
136
137
|
'git reset --hard*',
|
|
@@ -196,7 +197,8 @@ export const DENY_GROUPS = [
|
|
|
196
197
|
'ai-factory gcf edits commit*',
|
|
197
198
|
'ai-factory gcf edits discard*',
|
|
198
199
|
'ai-factory gcf-harness init*',
|
|
199
|
-
|
|
200
|
+
// The space keeps `gcf-harness runs`, the history of past runs, a read the agent may make.
|
|
201
|
+
'ai-factory gcf-harness run *',
|
|
200
202
|
// The autopilot's card session: an agent starts none.
|
|
201
203
|
'ai-factory gcf-harness card*',
|
|
202
204
|
'ai-factory gcf-harness stop*',
|
|
@@ -365,6 +367,17 @@ function checkChange(change, current) {
|
|
|
365
367
|
if (missing) throw new Error(`${missing} is not one of your own deny rules: turn its group off`);
|
|
366
368
|
}
|
|
367
369
|
|
|
370
|
+
/** An old group id in the file gives its value to the parts not written yet, and leaves. */
|
|
371
|
+
function retireAliases(doc) {
|
|
372
|
+
for (const old of Object.keys(ALIASES)) {
|
|
373
|
+
if (!doc.hasIn(['agent', 'groups', old])) continue;
|
|
374
|
+
for (const p of ALIASES[old])
|
|
375
|
+
if (!doc.hasIn(['agent', 'groups', p]))
|
|
376
|
+
doc.setIn(['agent', 'groups', p], doc.getIn(['agent', 'groups', old]));
|
|
377
|
+
doc.deleteIn(['agent', 'groups', old]);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
|
|
368
381
|
/**
|
|
369
382
|
* Turn groups on or off, add or remove a custom rule; commit gcf(permissions). Only the
|
|
370
383
|
* `agent:` section changes: the rest of config.yml keeps its keys and comments. The file is
|
|
@@ -386,13 +399,7 @@ export async function setPermissions(projectDir, change, { commit = true } = {})
|
|
|
386
399
|
for (const p of partsOf(id)) doc.setIn(['agent', 'groups', p], true);
|
|
387
400
|
for (const id of change.off ?? [])
|
|
388
401
|
for (const p of partsOf(id)) doc.setIn(['agent', 'groups', p], false);
|
|
389
|
-
|
|
390
|
-
if (doc.hasIn(['agent', 'groups', old])) {
|
|
391
|
-
for (const p of ALIASES[old])
|
|
392
|
-
if (!doc.hasIn(['agent', 'groups', p]))
|
|
393
|
-
doc.setIn(['agent', 'groups', p], doc.getIn(['agent', 'groups', old]));
|
|
394
|
-
doc.deleteIn(['agent', 'groups', old]);
|
|
395
|
-
}
|
|
402
|
+
retireAliases(doc);
|
|
396
403
|
|
|
397
404
|
const deny = [...new Set([...current.deny_extra, ...(change.deny ?? [])])].filter(
|
|
398
405
|
(r) => !change.undeny?.some((u) => sameRule(parseRule(u), parseRule(r))),
|