portable-agent-layer 0.53.0 → 0.54.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.
|
@@ -21,6 +21,7 @@ Assign ONE tier at the start of OBSERVE. Default is Standard — only escalate i
|
|
|
21
21
|
| Plan Mode (EnterPlanMode) | Skip | Use for user alignment |
|
|
22
22
|
| LEARN phase | Reflection log + threads | + Wisdom frame |
|
|
23
23
|
| Constraint extraction | Inline in reverse engineering | Numbered [EX-N] list |
|
|
24
|
+
| Criteria tracking | Inline checklist only | + TaskCreate one task per criterion at end of OBSERVE |
|
|
24
25
|
|
|
25
26
|
## The Five Phases
|
|
26
27
|
|
|
@@ -208,6 +209,8 @@ For EACH criterion:
|
|
|
208
209
|
|
|
209
210
|
**Demonstrate, don't assert.** When verifying a new check / rule / behavior on a system that already passes, "existing inputs still pass" is not evidence the new logic works — the existing inputs would pass even if your code did nothing. Construct a deliberately-broken minimal example (a fake bad slide, a known-failing input, a unit test that should now fail without your change) and run it through to prove the new behavior actually fires. Show the failure happening in the verification output, not just the success case.
|
|
210
211
|
|
|
212
|
+
**Evidence gate:** A criterion with no evidence line is an automatic FAIL — list it explicitly, fix it, then re-verify. Do not advance to LEARN with any criterion unevidenced. "Looks correct" or "should work" does not count as evidence.
|
|
213
|
+
|
|
211
214
|
If any criteria failed, fix and re-verify before completing.
|
|
212
215
|
|
|
213
216
|
### ━━━ 📚 LEARN ━━━ 5/5
|
|
@@ -293,7 +296,7 @@ bun ~/.pal/tools/handoff-note.ts --done --title "what we completed"
|
|
|
293
296
|
**Project work** — use ISCs, not threads:
|
|
294
297
|
```bash
|
|
295
298
|
# Close completed ISCs:
|
|
296
|
-
bun ~/.pal/tools/project.ts
|
|
299
|
+
bun ~/.pal/tools/project.ts complete-isc <project-name> <id>
|
|
297
300
|
|
|
298
301
|
# Open new ISCs for unfinished work:
|
|
299
302
|
bun ~/.pal/tools/project.ts add-isc <project-name> "what remains"
|
|
@@ -43,7 +43,10 @@
|
|
|
43
43
|
"Need something reusable? Use the /create-skill command.",
|
|
44
44
|
"PAL learns from your feedback and improves over time. Don't be shy to give feedback!",
|
|
45
45
|
"For simple PDFs use the /create-pdf skill. Need a styled one? Use /consulting-report instead.",
|
|
46
|
-
"Use the /research skill to run comprehensive web research with multiple parallel agents."
|
|
46
|
+
"Use the /research skill to run comprehensive web research with multiple parallel agents.",
|
|
47
|
+
"Create presentations in HTML using the /presentation skill.",
|
|
48
|
+
"PAL can \"see\" what you are doing in the browser with the /playwright skill.",
|
|
49
|
+
"Want PAL to watch a youtube video? There's /analyze-youtube for that."
|
|
47
50
|
]
|
|
48
51
|
},
|
|
49
52
|
"hooks": {
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Update checker — detects if a newer version of PAL is available.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Repo mode: auto-detected when a .git directory exists at palPkg() root.
|
|
5
|
+
* Package mode: fallback when no .git is present (global bun install).
|
|
6
6
|
*
|
|
7
7
|
* Caches result in state/update-available.json. Checked at most once per hour.
|
|
8
8
|
*/
|
|
@@ -47,7 +47,7 @@ function writeCache(cache: UpdateCache): void {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
function isRepoMode(): boolean {
|
|
50
|
-
return
|
|
50
|
+
return existsSync(resolve(palPkg(), ".git"));
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
function getInstalledVersion(): string {
|
package/src/targets/lib.ts
CHANGED
|
@@ -346,13 +346,25 @@ export function mergeCursorHooks(
|
|
|
346
346
|
|
|
347
347
|
if (template.hooks) {
|
|
348
348
|
result.hooks ??= {};
|
|
349
|
+
|
|
350
|
+
// Collect canonical forms of all template hook commands
|
|
351
|
+
const palCanonical = new Set<string>();
|
|
352
|
+
for (const entries of Object.values(template.hooks)) {
|
|
353
|
+
for (const entry of entries) palCanonical.add(canonicalPalCmd(entry.command));
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
// Strip existing PAL hooks that match canonically (removes old-path duplicates)
|
|
357
|
+
for (const [event, entries] of Object.entries(result.hooks)) {
|
|
358
|
+
result.hooks[event] = entries.filter(
|
|
359
|
+
(e) => !palCanonical.has(canonicalPalCmd(e.command))
|
|
360
|
+
);
|
|
361
|
+
if (result.hooks[event].length === 0) delete result.hooks[event];
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
// Insert template entries (old-path versions were just stripped)
|
|
349
365
|
for (const [event, entries] of Object.entries(template.hooks)) {
|
|
350
366
|
const current = result.hooks[event] ?? [];
|
|
351
|
-
for (const entry of entries)
|
|
352
|
-
if (!current.some((e) => e.command === entry.command)) {
|
|
353
|
-
current.push(entry);
|
|
354
|
-
}
|
|
355
|
-
}
|
|
367
|
+
for (const entry of entries) current.push(entry);
|
|
356
368
|
result.hooks[event] = current;
|
|
357
369
|
}
|
|
358
370
|
}
|
|
@@ -378,9 +378,9 @@ function cmdAddIsc(args: string[]): void {
|
|
|
378
378
|
ok({ added: true, id, title });
|
|
379
379
|
}
|
|
380
380
|
|
|
381
|
-
function
|
|
382
|
-
const name = args[0] ?? fail("Usage:
|
|
383
|
-
const id = Number(args[1] ?? fail("Usage:
|
|
381
|
+
function cmdCompleteIsc(args: string[]): void {
|
|
382
|
+
const name = args[0] ?? fail("Usage: complete-isc <name> <id>");
|
|
383
|
+
const id = Number(args[1] ?? fail("Usage: complete-isc <name> <id>"));
|
|
384
384
|
if (!Number.isInteger(id) || id < 1) fail("ISC id must be a positive integer");
|
|
385
385
|
const p = requireProject(name);
|
|
386
386
|
const current = p.criteria ?? "";
|
|
@@ -396,6 +396,24 @@ function cmdCheckIsc(args: string[]): void {
|
|
|
396
396
|
ok({ checked: true, id });
|
|
397
397
|
}
|
|
398
398
|
|
|
399
|
+
function cmdReopenIsc(args: string[]): void {
|
|
400
|
+
const name = args[0] ?? fail("Usage: reopen-isc <name> <id>");
|
|
401
|
+
const id = Number(args[1] ?? fail("Usage: reopen-isc <name> <id>"));
|
|
402
|
+
if (!Number.isInteger(id) || id < 1) fail("ISC id must be a positive integer");
|
|
403
|
+
const p = requireProject(name);
|
|
404
|
+
const current = p.criteria ?? "";
|
|
405
|
+
const existing = parseIscs(current).find((i) => i.id === id);
|
|
406
|
+
if (!existing) fail(`ISC-${id} not found in project "${name}"`);
|
|
407
|
+
if (!existing.checked) {
|
|
408
|
+
ok({ checked: false, id, alreadyOpen: true });
|
|
409
|
+
return;
|
|
410
|
+
}
|
|
411
|
+
p.criteria = patchIsc(current, id, false);
|
|
412
|
+
p.updated = now();
|
|
413
|
+
writeProject(p);
|
|
414
|
+
ok({ checked: false, id });
|
|
415
|
+
}
|
|
416
|
+
|
|
399
417
|
function cmdListIsc(args: string[]): void {
|
|
400
418
|
const name = args[0] ?? fail("Usage: list-isc <name>");
|
|
401
419
|
const p = requireProject(name);
|
|
@@ -482,7 +500,8 @@ Commands:
|
|
|
482
500
|
update-section <name> <section> "content" set an ISA body section
|
|
483
501
|
criteria <name> print the Criteria section
|
|
484
502
|
add-isc <name> "title" append a new open ISC to Criteria
|
|
485
|
-
|
|
503
|
+
complete-isc <name> <id> mark ISC-N as done
|
|
504
|
+
reopen-isc <name> <id> reopen ISC-N (mark not done)
|
|
486
505
|
list-isc <name> list all ISCs with open/done status
|
|
487
506
|
isa-init <name> mark project as ISA-initialized
|
|
488
507
|
scaffold-task-isa <title> create a one-shot task ISA in memory/work/
|
|
@@ -566,8 +585,11 @@ function run(): void {
|
|
|
566
585
|
case "add-isc":
|
|
567
586
|
cmdAddIsc(rest);
|
|
568
587
|
return;
|
|
569
|
-
case "
|
|
570
|
-
|
|
588
|
+
case "complete-isc":
|
|
589
|
+
cmdCompleteIsc(rest);
|
|
590
|
+
return;
|
|
591
|
+
case "reopen-isc":
|
|
592
|
+
cmdReopenIsc(rest);
|
|
571
593
|
return;
|
|
572
594
|
case "list-isc":
|
|
573
595
|
cmdListIsc(rest);
|