pi-var 1.0.12 → 1.0.13
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/CHANGELOG.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 1.0.13
|
|
4
|
+
|
|
5
|
+
- Validate against Pi 0.99.0, including an offline real-host package-loading probe.
|
|
6
|
+
- Declare imported host packages as wildcard peers and pin development dependencies to Pi 0.99.0.
|
|
7
|
+
- Use the host TypeBox schema package for variation tools.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import type { ExtensionAPI, ExtensionContext } from '@earendil-works/pi-coding-agent';
|
|
6
|
-
import { Type } from '
|
|
6
|
+
import { Type } from 'typebox';
|
|
7
7
|
import type { VarRuntime } from '../../types/index';
|
|
8
8
|
import { createVariation } from '../../variation/create';
|
|
9
9
|
import { setupVariationEnvironment, DEFAULT_CONFIG } from '../../environment/index';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import type { ExtensionAPI, ExtensionContext } from '@earendil-works/pi-coding-agent';
|
|
6
|
-
import { Type } from '
|
|
6
|
+
import { Type } from 'typebox';
|
|
7
7
|
import type { VarRuntime } from '../../types/index';
|
|
8
8
|
import { mergeVariation } from '../../variation/merge/index.js';
|
|
9
9
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-var",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"description": "Copy-on-write variations for pi — work on multiple features simultaneously with isolated workspaces",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
"test:coverage": "vitest run --coverage",
|
|
17
17
|
"typecheck": "tsc --noEmit",
|
|
18
18
|
"lint:dead": "knip --no-gitignore",
|
|
19
|
-
"postinstall": "simple-git-hooks 2>/dev/null || true"
|
|
19
|
+
"postinstall": "simple-git-hooks 2>/dev/null || true",
|
|
20
|
+
"test:pi": "node scripts/test-pi-compat.mjs"
|
|
20
21
|
},
|
|
21
22
|
"pi": {
|
|
22
23
|
"extensions": [
|
|
@@ -47,20 +48,22 @@
|
|
|
47
48
|
"simple-git-hooks": "2.13.1",
|
|
48
49
|
"typescript": "6.0.3",
|
|
49
50
|
"vitest": "4.1.7",
|
|
50
|
-
"@earendil-works/pi-coding-agent": "0.
|
|
51
|
+
"@earendil-works/pi-coding-agent": "0.99.0",
|
|
52
|
+
"@earendil-works/pi-ai": "0.99.0",
|
|
53
|
+
"typebox": "1.3.27"
|
|
51
54
|
},
|
|
52
55
|
"peerDependencies": {
|
|
53
|
-
"@earendil-works/pi-ai": "
|
|
54
|
-
"@earendil-works/pi-coding-agent": "
|
|
55
|
-
"
|
|
56
|
+
"@earendil-works/pi-ai": "*",
|
|
57
|
+
"@earendil-works/pi-coding-agent": "*",
|
|
58
|
+
"typebox": "*"
|
|
56
59
|
},
|
|
57
60
|
"overrides": {
|
|
58
61
|
"brace-expansion": "5.0.6",
|
|
59
62
|
"fast-xml-builder": "1.2.0",
|
|
60
63
|
"protobufjs": "8.4.0",
|
|
61
64
|
"ws": "8.20.1",
|
|
62
|
-
"@earendil-works/pi-ai": "0.
|
|
63
|
-
"@earendil-works/pi-coding-agent": "0.
|
|
64
|
-
"@earendil-works/pi-tui": "0.
|
|
65
|
+
"@earendil-works/pi-ai": "0.99.0",
|
|
66
|
+
"@earendil-works/pi-coding-agent": "0.99.0",
|
|
67
|
+
"@earendil-works/pi-tui": "0.99.0"
|
|
65
68
|
}
|
|
66
69
|
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
import { mkdtemp, readFile, rm } from 'node:fs/promises';
|
|
3
|
+
import { tmpdir } from 'node:os';
|
|
4
|
+
import { dirname, join, resolve } from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
|
|
7
|
+
const root = resolve(dirname(fileURLToPath(import.meta.url)), '..');
|
|
8
|
+
const home = await mkdtemp(join(tmpdir(), 'pi-extension-compat-'));
|
|
9
|
+
const previousHome = process.env.PI_CODING_AGENT_DIR;
|
|
10
|
+
const previousFetch = globalThis.fetch;
|
|
11
|
+
process.env.PI_CODING_AGENT_DIR = home;
|
|
12
|
+
globalThis.fetch = async () => new Response('', { status: 503 });
|
|
13
|
+
let session;
|
|
14
|
+
try {
|
|
15
|
+
const { createAgentSession, DefaultResourceLoader, ModelRuntime, SessionManager, SettingsManager, VERSION } = await import('@earendil-works/pi-coding-agent');
|
|
16
|
+
assert.equal(VERSION, '0.99.0', 'test the actual pinned Pi host, not a stale override');
|
|
17
|
+
const manifest = JSON.parse(await readFile(join(root, 'package.json'), 'utf8'));
|
|
18
|
+
for (const name of ['@earendil-works/pi-ai', '@earendil-works/pi-agent-core', '@earendil-works/pi-coding-agent', '@earendil-works/pi-tui', 'typebox']) {
|
|
19
|
+
assert.equal(manifest.dependencies?.[name], undefined, `${name}: host packages must not be runtime dependencies`);
|
|
20
|
+
if (manifest.peerDependencies?.[name] !== undefined) assert.equal(manifest.peerDependencies[name], '*');
|
|
21
|
+
}
|
|
22
|
+
const settingsManager = SettingsManager.inMemory({ packages: [root], compaction: { enabled: false }, retry: { enabled: false } });
|
|
23
|
+
const resourceLoader = new DefaultResourceLoader({ cwd: home, agentDir: home, settingsManager,
|
|
24
|
+
noSkills: true, noPromptTemplates: true, noThemes: true, noContextFiles: true });
|
|
25
|
+
await resourceLoader.reload();
|
|
26
|
+
const loaded = resourceLoader.getExtensions();
|
|
27
|
+
assert.deepEqual(loaded.errors, []);
|
|
28
|
+
assert.deepEqual(loaded.warnings ?? [], []);
|
|
29
|
+
assert.ok(loaded.extensions.length > 0, 'manifest entrypoints must load');
|
|
30
|
+
const modelRuntime = await ModelRuntime.create({ authPath: join(home, 'auth.json'), modelsPath: null, modelsStorePath: join(home, 'models-cache'), allowModelNetwork: false });
|
|
31
|
+
({ session } = await createAgentSession({ cwd: home, agentDir: home, resourceLoader, modelRuntime, settingsManager, sessionManager: SessionManager.inMemory(home) }));
|
|
32
|
+
const names = new Set();
|
|
33
|
+
for (const extension of loaded.extensions) {
|
|
34
|
+
for (const [name, { definition }] of extension.tools) {
|
|
35
|
+
assert.equal(definition.name, name);
|
|
36
|
+
assert.equal(typeof definition.execute, 'function');
|
|
37
|
+
assert.equal(typeof definition.parameters, 'object');
|
|
38
|
+
assert.ok(!names.has(name), `duplicate tool ${name}`);
|
|
39
|
+
names.add(name);
|
|
40
|
+
assert.ok(session.getAllTools().some(tool => tool.name === name), `${name}: tool must be installed in the real session`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
console.log(`${manifest.name}: Pi ${VERSION} warning-free manifest load; ${loaded.extensions.length} extensions, ${names.size} tools registered`);
|
|
44
|
+
} finally {
|
|
45
|
+
session?.dispose();
|
|
46
|
+
globalThis.fetch = previousFetch;
|
|
47
|
+
if (previousHome === undefined) delete process.env.PI_CODING_AGENT_DIR;
|
|
48
|
+
else process.env.PI_CODING_AGENT_DIR = previousHome;
|
|
49
|
+
await rm(home, { recursive: true, force: true });
|
|
50
|
+
}
|