@pi-unipi/background-tasks 2.6.2 → 2.6.3
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/package.json +1 -1
- package/src/__tests__/scripted-provider/delegate-ambient-provider.test.ts +1 -1
- package/src/__tests__/scripted-provider/delegate-child-guard.test.ts +1 -1
- package/src/__tests__/scripted-provider/follow-up.test.ts +3 -3
- package/src/__tests__/scripted-provider/fusion-output-recovery.test.ts +1 -1
- package/src/__tests__/scripted-provider/fusion-reason.test.ts +2 -2
- package/src/__tests__/scripted-provider/fusion-runtime-guard.test.ts +2 -2
- package/src/__tests__/scripted-provider/pi-hook-contract.test.ts +4 -4
- package/src/tools.ts +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-unipi/background-tasks",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.3",
|
|
4
4
|
"description": "Background tasks for UniPi \u2014 durable shell jobs, delegated agents, attested Pi runs, and fixed-purpose Fusion workflows",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -21,7 +21,7 @@ import { isolatedTestEnv } from '../helpers/normalize.js';
|
|
|
21
21
|
* production argv builder.
|
|
22
22
|
*/
|
|
23
23
|
const roots: string[] = [];
|
|
24
|
-
const providerExtension = resolve('
|
|
24
|
+
const providerExtension = resolve('src/__tests__/scripted-provider/delegate-guard-provider.ts');
|
|
25
25
|
const piExecutable = resolve('node_modules/.bin/pi');
|
|
26
26
|
|
|
27
27
|
async function runChild(
|
|
@@ -27,7 +27,7 @@ import { sessionWith, userMessage } from '../helpers/fusion-canonical.js';
|
|
|
27
27
|
* rather than by calling handlers directly.
|
|
28
28
|
*/
|
|
29
29
|
const guardExtensionPath = resolve('extensions/delegate-child.ts');
|
|
30
|
-
const providerPath = resolve('
|
|
30
|
+
const providerPath = resolve('src/__tests__/scripted-provider/delegate-guard-provider.ts');
|
|
31
31
|
|
|
32
32
|
const roots: string[] = [];
|
|
33
33
|
|
|
@@ -16,8 +16,8 @@ import {
|
|
|
16
16
|
import { parseJsonText } from '../../types.js';
|
|
17
17
|
import { isolatedTestEnv } from '../helpers/normalize.js';
|
|
18
18
|
|
|
19
|
-
const backgroundExtensionPath = resolve('
|
|
20
|
-
const scriptedProviderPath = resolve('
|
|
19
|
+
const backgroundExtensionPath = resolve('src/index.ts');
|
|
20
|
+
const scriptedProviderPath = resolve('src/__tests__/scripted-provider/scripted-provider-extension.ts');
|
|
21
21
|
const roots: string[] = [];
|
|
22
22
|
|
|
23
23
|
type Scenario =
|
|
@@ -423,7 +423,7 @@ void describe('scripted-provider completion follow-up behavior', { concurrency:
|
|
|
423
423
|
const h = await harness('display-only-bg');
|
|
424
424
|
try {
|
|
425
425
|
await h.session.prompt(
|
|
426
|
-
'/bg --name "Display Only Scripted" node -e "setTimeout(() => { console.log(\'display done\'); }, 80);"',
|
|
426
|
+
'/unipi:bg --name "Display Only Scripted" node -e "setTimeout(() => { console.log(\'display done\'); }, 80);"',
|
|
427
427
|
);
|
|
428
428
|
await waitFor(
|
|
429
429
|
() => customNotifications(h.session).length === 1,
|
|
@@ -59,7 +59,7 @@ void describe('Fusion same-session candidate output recovery', { concurrency: fa
|
|
|
59
59
|
roots.push(root);
|
|
60
60
|
const logPath = join(root, 'provider.jsonl');
|
|
61
61
|
const recoveryPath = join(root, 'candidate.response.oversized.md');
|
|
62
|
-
const providerPath = resolve('
|
|
62
|
+
const providerPath = resolve('src/__tests__/scripted-provider/output-recovery-provider.ts');
|
|
63
63
|
const result = await runPi(
|
|
64
64
|
[
|
|
65
65
|
'--mode',
|
|
@@ -17,8 +17,8 @@ import { parseJsonText } from '../../types.js';
|
|
|
17
17
|
import { installFusionFakePi } from '../helpers/fusion-fake-pi.js';
|
|
18
18
|
import { isolatedTestEnv } from '../helpers/normalize.js';
|
|
19
19
|
|
|
20
|
-
const backgroundTasksExtensionPath = resolve('
|
|
21
|
-
const scriptedProviderPath = resolve('
|
|
20
|
+
const backgroundTasksExtensionPath = resolve('src/index.ts');
|
|
21
|
+
const scriptedProviderPath = resolve('src/__tests__/scripted-provider/scripted-provider-extension.ts');
|
|
22
22
|
const roots: string[] = [];
|
|
23
23
|
const savedEnv = new Map<string, string | undefined>();
|
|
24
24
|
const envKeys = [
|
|
@@ -15,8 +15,8 @@ import {
|
|
|
15
15
|
import { isolatedTestEnv } from '../helpers/normalize.js';
|
|
16
16
|
import { RUNTIME_GUARD_MODEL, RUNTIME_GUARD_PROVIDER } from './runtime-guard-provider.js';
|
|
17
17
|
|
|
18
|
-
const providerPath = resolve('
|
|
19
|
-
const governorPath = resolve('
|
|
18
|
+
const providerPath = resolve('src/__tests__/scripted-provider/runtime-guard-provider.ts');
|
|
19
|
+
const governorPath = resolve('src/__tests__/scripted-provider/runtime-guard-probe.ts');
|
|
20
20
|
const roots: string[] = [];
|
|
21
21
|
const servers: Server[] = [];
|
|
22
22
|
|
|
@@ -33,10 +33,10 @@ import {
|
|
|
33
33
|
* a real Pi agent loop against a deterministic provider and records the observed
|
|
34
34
|
* guarantees as durable evidence consumed by the delegate launch preflight.
|
|
35
35
|
*/
|
|
36
|
-
const providerPath = resolve('
|
|
37
|
-
const probeAPath = resolve('
|
|
38
|
-
const probeBPath = resolve('
|
|
39
|
-
const evidencePath = resolve('
|
|
36
|
+
const providerPath = resolve('src/__tests__/scripted-provider/hook-contract-provider.ts');
|
|
37
|
+
const probeAPath = resolve('src/__tests__/scripted-provider/hook-probe-a.ts');
|
|
38
|
+
const probeBPath = resolve('src/__tests__/scripted-provider/hook-probe-b.ts');
|
|
39
|
+
const evidencePath = resolve('src/__tests__/scripted-provider/pi-hook-contract-evidence.json');
|
|
40
40
|
|
|
41
41
|
const roots: string[] = [];
|
|
42
42
|
|
package/src/tools.ts
CHANGED
|
@@ -330,7 +330,9 @@ export function registerToolsAndCommands(options: RegisterSurfaceOptions): void
|
|
|
330
330
|
"Use bg_run instead of bash for commands expected to run for a long time, such as test suites, dev servers, watchers, or builds.",
|
|
331
331
|
"Set isAgent:true only when the background task launches an LLM/agent process; false for scripts, tests, dev servers, sleeps.",
|
|
332
332
|
"Always set name to a concise 2-6 word human-readable label; do not use the raw command as the name.",
|
|
333
|
-
"
|
|
333
|
+
"bg_run returns immediately. With notifyOnCompletion:true and triggerOnCompletion:true (both defaults), completed, failed, or killed terminal state is delivered as <background-task-notification> and automatically starts a follow-up agent turn.",
|
|
334
|
+
"After a default bg_run launch, continue only independent useful work that does not merely wait for the task; otherwise briefly acknowledge it if useful, then end the current turn. Do not call sleep, bg_status, or bg_logs merely to wait; the terminal notification will wake you.",
|
|
335
|
+
"A running result is not an instruction to poll again.",
|
|
334
336
|
"Treat <background-task-notification> as durable terminal truth. Do not call bg_status to reconfirm it.",
|
|
335
337
|
"Do not set notifyOnCompletion:false or triggerOnCompletion:false unless intentionally opting out.",
|
|
336
338
|
],
|