pi-background-tasks 2.5.0 → 2.6.0
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/BACKGROUND-TASKS-INSTRUCTIONS.md +1 -1
- package/README.md +70 -25
- package/TESTING.md +42 -2
- package/TEST_PLAN.md +7 -4
- package/dist/extensions/anthropic-attribution-child.js +4 -0
- package/dist/extensions/anthropic-attribution-child.js.map +1 -0
- package/dist/extensions/anthropic-attribution.js +107 -0
- package/dist/extensions/anthropic-attribution.js.map +1 -0
- package/dist/extensions/background-tasks.js +2 -0
- package/dist/extensions/background-tasks.js.map +1 -0
- package/dist/extensions/delegate-child.js +2 -0
- package/dist/extensions/delegate-child.js.map +1 -0
- package/dist/extensions/fusion-child.js +2 -0
- package/dist/extensions/fusion-child.js.map +1 -0
- package/dist/package.json +5 -0
- package/dist/src/core/anthropic-attribution-path.js +24 -0
- package/dist/src/core/anthropic-attribution-path.js.map +1 -0
- package/dist/src/core/anthropic-attribution.js +2247 -0
- package/dist/src/core/anthropic-attribution.js.map +1 -0
- package/dist/src/core/attested-pi-contract.js +5 -0
- package/dist/src/core/attested-pi-contract.js.map +1 -0
- package/dist/src/core/attested-pi-run.js +749 -0
- package/dist/src/core/attested-pi-run.js.map +1 -0
- package/dist/src/core/canonical-json.js +19 -0
- package/dist/src/core/canonical-json.js.map +1 -0
- package/dist/src/core/common.js +787 -0
- package/dist/src/core/common.js.map +1 -0
- package/dist/src/core/config.js +78 -0
- package/dist/src/core/config.js.map +1 -0
- package/dist/src/core/context/parent-snapshot.js +75 -0
- package/dist/src/core/context/parent-snapshot.js.map +1 -0
- package/dist/src/core/context/token-budget.js +631 -0
- package/dist/src/core/context/token-budget.js.map +1 -0
- package/dist/src/core/context/visible-conversation-v2.js +390 -0
- package/dist/src/core/context/visible-conversation-v2.js.map +1 -0
- package/dist/src/core/delegate/artifacts.js +357 -0
- package/dist/src/core/delegate/artifacts.js.map +1 -0
- package/dist/src/core/delegate/budget.js +266 -0
- package/dist/src/core/delegate/budget.js.map +1 -0
- package/dist/src/core/delegate/facade-contract.js +7 -0
- package/dist/src/core/delegate/facade-contract.js.map +1 -0
- package/dist/src/core/delegate/hook-contract-evidence.json +18 -0
- package/dist/src/core/delegate/hook-contract.js +124 -0
- package/dist/src/core/delegate/hook-contract.js.map +1 -0
- package/dist/src/core/delegate/launch.js +366 -0
- package/dist/src/core/delegate/launch.js.map +1 -0
- package/dist/src/core/delegate/result-package.js +293 -0
- package/dist/src/core/delegate/result-package.js.map +1 -0
- package/dist/src/core/delegate/runner.js +398 -0
- package/dist/src/core/delegate/runner.js.map +1 -0
- package/dist/src/core/delegate/seed.js +334 -0
- package/dist/src/core/delegate/seed.js.map +1 -0
- package/dist/src/core/delegate/types.js +103 -0
- package/dist/src/core/delegate/types.js.map +1 -0
- package/dist/src/core/durable-fs.js +372 -0
- package/dist/src/core/durable-fs.js.map +1 -0
- package/dist/src/core/extension-api.js +382 -0
- package/dist/src/core/extension-api.js.map +1 -0
- package/dist/src/core/fusion/artifacts.js +654 -0
- package/dist/src/core/fusion/artifacts.js.map +1 -0
- package/dist/src/core/fusion/budget.js +949 -0
- package/dist/src/core/fusion/budget.js.map +1 -0
- package/dist/src/core/fusion/child-protocol.js +176 -0
- package/dist/src/core/fusion/child-protocol.js.map +1 -0
- package/dist/src/core/fusion/claude-cache.js +156 -0
- package/dist/src/core/fusion/claude-cache.js.map +1 -0
- package/dist/src/core/fusion/clean-context.js +64 -0
- package/dist/src/core/fusion/clean-context.js.map +1 -0
- package/dist/src/core/fusion/config.js +349 -0
- package/dist/src/core/fusion/config.js.map +1 -0
- package/dist/src/core/fusion/context.js +184 -0
- package/dist/src/core/fusion/context.js.map +1 -0
- package/dist/src/core/fusion/evaluation.js +696 -0
- package/dist/src/core/fusion/evaluation.js.map +1 -0
- package/dist/src/core/fusion/facade-contract.js +3 -0
- package/dist/src/core/fusion/facade-contract.js.map +1 -0
- package/dist/src/core/fusion/orchestrator.js +867 -0
- package/dist/src/core/fusion/orchestrator.js.map +1 -0
- package/dist/src/core/fusion/output-contract.js +27 -0
- package/dist/src/core/fusion/output-contract.js.map +1 -0
- package/dist/src/core/fusion/pi-child.js +1741 -0
- package/dist/src/core/fusion/pi-child.js.map +1 -0
- package/dist/src/core/fusion/prompts.js +260 -0
- package/dist/src/core/fusion/prompts.js.map +1 -0
- package/dist/src/core/fusion/result-package.js +857 -0
- package/dist/src/core/fusion/result-package.js.map +1 -0
- package/dist/src/core/fusion/source-policy.js +259 -0
- package/dist/src/core/fusion/source-policy.js.map +1 -0
- package/dist/src/core/fusion/types.js +207 -0
- package/dist/src/core/fusion/types.js.map +1 -0
- package/dist/src/core/fusion/web-fetch.js +777 -0
- package/dist/src/core/fusion/web-fetch.js.map +1 -0
- package/dist/src/core/fusion/workflows.js +126 -0
- package/dist/src/core/fusion/workflows.js.map +1 -0
- package/dist/src/core/lazy-module.js +181 -0
- package/dist/src/core/lazy-module.js.map +1 -0
- package/dist/src/core/pi-launch.js +431 -0
- package/dist/src/core/pi-launch.js.map +1 -0
- package/dist/src/core/registry.js +3331 -0
- package/dist/src/core/registry.js.map +1 -0
- package/dist/src/core/reload-shell-owner.js +1396 -0
- package/dist/src/core/reload-shell-owner.js.map +1 -0
- package/dist/src/core/shell-policy.js +80 -0
- package/dist/src/core/shell-policy.js.map +1 -0
- package/dist/src/core/task-durable.js +51 -0
- package/dist/src/core/task-durable.js.map +1 -0
- package/dist/src/core/update-check.js +92 -0
- package/dist/src/core/update-check.js.map +1 -0
- package/dist/src/core/windows-taskkill.js +185 -0
- package/dist/src/core/windows-taskkill.js.map +1 -0
- package/dist/src/delegate-child-extension.js +776 -0
- package/dist/src/delegate-child-extension.js.map +1 -0
- package/dist/src/delegate-extension.js +746 -0
- package/dist/src/delegate-extension.js.map +1 -0
- package/dist/src/extension.js +953 -0
- package/dist/src/extension.js.map +1 -0
- package/dist/src/fusion-child-extension.js +760 -0
- package/dist/src/fusion-child-extension.js.map +1 -0
- package/dist/src/fusion-extension.js +1030 -0
- package/dist/src/fusion-extension.js.map +1 -0
- package/dist/src/ui/background-tasks-manager.js +689 -0
- package/dist/src/ui/background-tasks-manager.js.map +1 -0
- package/dist/src/ui/fusion-model-selector.js +277 -0
- package/dist/src/ui/fusion-model-selector.js.map +1 -0
- package/docs/INDEX.md +35 -33
- package/docs/api/eventbus-v1.md +21 -5
- package/docs/choose-a-workflow.md +2 -0
- package/docs/commands/bg-clear.md +3 -3
- package/docs/commands/bg-update.md +3 -3
- package/docs/commands/bg.md +18 -6
- package/docs/commands/claude-cache.md +4 -4
- package/docs/commands/fusion-models.md +49 -4
- package/docs/commands/fusion.md +3 -3
- package/docs/commands/jobs.md +3 -3
- package/docs/commands/kill.md +3 -3
- package/docs/commands/logs.md +3 -3
- package/docs/commands/task-manager.md +5 -5
- package/docs/concepts/completion-delivery.md +6 -2
- package/docs/getting-started.md +7 -1
- package/docs/manifest.json +228 -42
- package/docs/operations/configuration.md +58 -5
- package/docs/operations/releasing.md +4 -2
- package/docs/operations/testing.md +22 -0
- package/docs/operations/troubleshooting.md +6 -2
- package/docs/read-before-edit.md +44 -31
- package/docs/reference/runtime-contracts.md +87 -51
- package/docs/reference/shortcuts-and-dock.md +28 -14
- package/docs/subsystems/anthropic-attribution.md +23 -11
- package/docs/subsystems/attested-pi-runs.md +12 -7
- package/docs/subsystems/background-task-runtime.md +53 -11
- package/docs/subsystems/child-launch-durability-and-safety.md +28 -9
- package/docs/subsystems/delegation.md +16 -3
- package/docs/subsystems/docs-freshness-gate.md +14 -7
- package/docs/subsystems/fusion.md +36 -11
- package/docs/subsystems/host-ui-and-telemetry.md +22 -9
- package/docs/tools/bg_delegate.md +3 -1
- package/docs/tools/bg_kill.md +3 -1
- package/docs/tools/bg_logs.md +3 -1
- package/docs/tools/bg_result.md +5 -3
- package/docs/tools/bg_run.md +31 -5
- package/docs/tools/bg_run_pi_attested.md +3 -1
- package/docs/tools/bg_status.md +3 -1
- package/docs/tools/fusion_investigate.md +3 -1
- package/docs/tools/fusion_reason.md +3 -1
- package/docs/tools/fusion_research.md +3 -1
- package/docs/tools/fusion_validate.md +3 -1
- package/extensions/anthropic-attribution-child.ts +3 -0
- package/extensions/anthropic-attribution.ts +166 -1
- package/package.json +12 -10
- package/src/core/anthropic-attribution-path.ts +5 -4
- package/src/core/anthropic-attribution.ts +293 -113
- package/src/core/attested-pi-contract.ts +4 -0
- package/src/core/attested-pi-run.ts +468 -81
- package/src/core/canonical-json.ts +21 -0
- package/src/core/common.ts +450 -40
- package/src/core/config.ts +121 -0
- package/src/core/context/visible-conversation-v2.ts +3 -6
- package/src/core/delegate/artifacts.ts +13 -9
- package/src/core/delegate/budget.ts +13 -6
- package/src/core/delegate/facade-contract.ts +6 -0
- package/src/core/delegate/result-package.ts +32 -14
- package/src/core/delegate/runner.ts +129 -58
- package/src/core/delegate/seed.ts +5 -7
- package/src/core/durable-fs.ts +178 -30
- package/src/core/extension-api.ts +36 -8
- package/src/core/fusion/artifacts.ts +17 -16
- package/src/core/fusion/clean-context.ts +8 -5
- package/src/core/fusion/config.ts +2 -1
- package/src/core/fusion/context.ts +2 -6
- package/src/core/fusion/facade-contract.ts +2 -0
- package/src/core/fusion/orchestrator.ts +3 -3
- package/src/core/fusion/prompts.ts +1 -1
- package/src/core/fusion/result-package.ts +259 -72
- package/src/core/fusion/source-policy.ts +43 -17
- package/src/core/lazy-module.ts +215 -0
- package/src/core/pi-launch.ts +390 -65
- package/src/core/registry.ts +2010 -381
- package/src/core/reload-shell-owner.ts +1662 -0
- package/src/core/shell-policy.ts +134 -0
- package/src/core/task-durable.ts +67 -0
- package/src/delegate-extension.ts +404 -144
- package/src/extension.ts +387 -114
- package/src/fusion-extension.ts +202 -96
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-background-tasks",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "Pi extension for durable background shell tasks, read-only delegated agents, local attested Pi runs, and fixed-purpose Fusion workflows through child Pi processes.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "ISC",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"url": "https://github.com/ismailsaleekh/pi-background-tasks/issues"
|
|
36
36
|
},
|
|
37
37
|
"files": [
|
|
38
|
+
"dist/",
|
|
38
39
|
"extensions/",
|
|
39
40
|
"src/",
|
|
40
41
|
"README.md",
|
|
@@ -48,25 +49,26 @@
|
|
|
48
49
|
"logo.png"
|
|
49
50
|
],
|
|
50
51
|
"scripts": {
|
|
52
|
+
"build:runtime": "node scripts/build-runtime.mjs",
|
|
51
53
|
"typecheck": "tsc --noEmit",
|
|
52
54
|
"test:type-safety": "tsx --test tests/package/type-safety.test.ts",
|
|
53
55
|
"test:unit": "tsx --test tests/unit/**/*.test.ts",
|
|
54
|
-
"test:sdk": "tsx --test --test-concurrency=1 tests/sdk/**/*.test.ts",
|
|
56
|
+
"test:sdk": "npm run build:runtime && tsx --test --test-concurrency=1 tests/sdk/**/*.test.ts",
|
|
55
57
|
"test:rpc": "tsx --test tests/rpc/**/*.test.ts",
|
|
56
58
|
"test:component": "tsx --test tests/component/**/*.test.ts",
|
|
57
|
-
"test:package": "tsx --test tests/package/**/*.test.ts",
|
|
59
|
+
"test:package": "npm run build:runtime && tsx --test tests/package/**/*.test.ts",
|
|
58
60
|
"test": "npm run typecheck && npm run test:type-safety && npm run test:unit && npm run test:sdk && npm run test:rpc && npm run test:component && npm run test:package && npm run test:hook-contract",
|
|
59
61
|
"test:pty": "tsx --test tests/pty/**/*.test.ts",
|
|
60
62
|
"test:windows": "tsx --test tests/windows/**/*.test.ts",
|
|
61
63
|
"test:agent-loop": "tsx --test --test-concurrency=1 tests/scripted-provider/**/*.test.ts",
|
|
62
64
|
"test:full": "npm run test && npm run test:pty && npm run test:agent-loop",
|
|
63
|
-
"smoke": "tsx scripts/smoke.ts",
|
|
65
|
+
"smoke": "npm run build:runtime && tsx scripts/smoke.ts",
|
|
64
66
|
"smoke:large-context": "tsx scripts/large-context-smoke.ts",
|
|
65
67
|
"pack:dry-run": "npm pack --dry-run",
|
|
66
68
|
"lint": "cd ../.. && npm run quality:ts:lint",
|
|
67
69
|
"format:check": "cd ../.. && npm run quality:ts:format",
|
|
68
|
-
"test:compat": "tsx scripts/test-compat.ts",
|
|
69
|
-
"test:pnpm-pack": "node scripts/test-pnpm-pack-install.mjs",
|
|
70
|
+
"test:compat": "npm run build:runtime && tsx scripts/test-compat.ts",
|
|
71
|
+
"test:pnpm-pack": "npm run build:runtime && node scripts/test-pnpm-pack-install.mjs",
|
|
70
72
|
"test:hook-contract": "tsx --test --test-concurrency=1 tests/scripted-provider/pi-hook-contract.test.ts",
|
|
71
73
|
"docs:generate": "node scripts/docs/generate.mjs",
|
|
72
74
|
"docs:verify": "node scripts/docs/verify.mjs",
|
|
@@ -74,15 +76,15 @@
|
|
|
74
76
|
"docs:attest/record": "node scripts/docs/attest.mjs",
|
|
75
77
|
"docs:attest": "npm run docs:attest/record",
|
|
76
78
|
"test:docs": "tsx --test tests/unit/docs-gate.test.ts tests/package/docs-contract.test.ts",
|
|
77
|
-
"payload:check": "node scripts/check-package-payload.mjs",
|
|
79
|
+
"payload:check": "npm run build:runtime && node scripts/check-package-payload.mjs",
|
|
78
80
|
"release:check-version": "node scripts/check-release-version.mjs",
|
|
79
|
-
"prepack": "npm run
|
|
81
|
+
"prepack": "npm run build:runtime && npm run docs:verify && node scripts/check-package-payload.mjs"
|
|
80
82
|
},
|
|
81
83
|
"pi": {
|
|
82
84
|
"image": "https://raw.githubusercontent.com/ismailsaleekh/pi-background-tasks/main/logo.png",
|
|
83
85
|
"extensions": [
|
|
84
|
-
"./extensions/anthropic-attribution.
|
|
85
|
-
"./extensions/background-tasks.
|
|
86
|
+
"./dist/extensions/anthropic-attribution.js",
|
|
87
|
+
"./dist/extensions/background-tasks.js"
|
|
86
88
|
]
|
|
87
89
|
},
|
|
88
90
|
"peerDependencies": {
|
|
@@ -3,10 +3,11 @@ import { dirname, resolve } from 'node:path';
|
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* Resolve the package-owned
|
|
6
|
+
* Resolve the package-owned always-on Anthropic child attribution extension.
|
|
7
7
|
*
|
|
8
8
|
* Package-owned child Pi processes disable ambient extension discovery, so they
|
|
9
|
-
* must explicitly load this
|
|
9
|
+
* must explicitly load this safety entrypoint. It deliberately bypasses the
|
|
10
|
+
* independently selectable ambient parent capability. Keeping path resolution
|
|
10
11
|
* in one module prevents Fusion, delegation, and attested runs from deriving
|
|
11
12
|
* different package paths.
|
|
12
13
|
*/
|
|
@@ -16,8 +17,8 @@ export function resolveAnthropicAttributionExtensionPath(
|
|
|
16
17
|
): string {
|
|
17
18
|
const modulePath = fileURLToPath(moduleUrl);
|
|
18
19
|
const extension = modulePath.endsWith('.ts')
|
|
19
|
-
? 'anthropic-attribution.ts'
|
|
20
|
-
: 'anthropic-attribution.js';
|
|
20
|
+
? 'anthropic-attribution-child.ts'
|
|
21
|
+
: 'anthropic-attribution-child.js';
|
|
21
22
|
const candidate = resolve(dirname(modulePath), '../../extensions', extension);
|
|
22
23
|
if (!pathExists(candidate)) {
|
|
23
24
|
throw new Error(`Anthropic attribution extension is missing: ${candidate}`);
|