@ai-sdk/harness-pi 1.0.78 → 1.0.80
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 +18 -0
- package/dist/index.js +19 -11
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/pi-session.ts +20 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @ai-sdk/harness-pi
|
|
2
2
|
|
|
3
|
+
## 1.0.80
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- eace6fb: feat(harness): add experimental support for steering agent conversations mid-turn
|
|
8
|
+
- c0595b4: feat(harness): support passing a filesystem and process restricted sandbox session to `HarnessAgentSession`, using fallbacks in favor of the preferred network sandbox session methods
|
|
9
|
+
- Updated dependencies [eace6fb]
|
|
10
|
+
- Updated dependencies [c0595b4]
|
|
11
|
+
- @ai-sdk/harness@1.0.78
|
|
12
|
+
|
|
13
|
+
## 1.0.79
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [e6087c9]
|
|
18
|
+
- @ai-sdk/provider-utils@5.0.28
|
|
19
|
+
- @ai-sdk/harness@1.0.77
|
|
20
|
+
|
|
3
21
|
## 1.0.78
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -119,13 +119,16 @@ import { Type as Type2 } from "typebox";
|
|
|
119
119
|
import {
|
|
120
120
|
HarnessCapabilityUnsupportedError as HarnessCapabilityUnsupportedError2
|
|
121
121
|
} from "@ai-sdk/harness";
|
|
122
|
-
import {
|
|
122
|
+
import {
|
|
123
|
+
getRestrictedSandboxSession,
|
|
124
|
+
resolveSandboxHomeDir
|
|
125
|
+
} from "@ai-sdk/harness/utils";
|
|
123
126
|
|
|
124
127
|
// src/pi-auth.ts
|
|
125
128
|
import { getAiGatewayAuthFromEnv } from "@ai-sdk/harness/utils";
|
|
126
129
|
|
|
127
130
|
// src/version.ts
|
|
128
|
-
var VERSION = true ? "1.0.
|
|
131
|
+
var VERSION = true ? "1.0.80" : "0.0.0-test";
|
|
129
132
|
|
|
130
133
|
// src/pi-auth.ts
|
|
131
134
|
var DEFAULT_GATEWAY_BASE_URL = "https://ai-gateway.vercel.sh";
|
|
@@ -1890,9 +1893,11 @@ async function createPiSession(input) {
|
|
|
1890
1893
|
await mkdir3(hostWorkDir, { recursive: true });
|
|
1891
1894
|
await mkdir3(hostAgentDir, { recursive: true });
|
|
1892
1895
|
await mkdir3(hostSessionDir, { recursive: true });
|
|
1893
|
-
const
|
|
1896
|
+
const toolSafeSandboxSession = getRestrictedSandboxSession(
|
|
1897
|
+
input.sandboxSession
|
|
1898
|
+
);
|
|
1894
1899
|
const sandboxHomeDir = await resolveSandboxHomeDir({
|
|
1895
|
-
sandbox,
|
|
1900
|
+
sandbox: toolSafeSandboxSession,
|
|
1896
1901
|
...input.abortSignal ? { abortSignal: input.abortSignal } : {}
|
|
1897
1902
|
});
|
|
1898
1903
|
const privateSessionDir = resolvePiPrivateSessionDirectory({
|
|
@@ -1910,7 +1915,7 @@ async function createPiSession(input) {
|
|
|
1910
1915
|
sandboxSkillRootDir
|
|
1911
1916
|
});
|
|
1912
1917
|
await writePiSkills({
|
|
1913
|
-
sandbox,
|
|
1918
|
+
sandbox: toolSafeSandboxSession,
|
|
1914
1919
|
sandboxHomeDir,
|
|
1915
1920
|
skills: input.skills,
|
|
1916
1921
|
...input.abortSignal ? { abortSignal: input.abortSignal } : {}
|
|
@@ -1922,7 +1927,7 @@ async function createPiSession(input) {
|
|
|
1922
1927
|
input.resumeSessionFileName
|
|
1923
1928
|
);
|
|
1924
1929
|
resumeSessionFilePath = await pullSessionFileFromSandbox({
|
|
1925
|
-
sandbox,
|
|
1930
|
+
sandbox: toolSafeSandboxSession,
|
|
1926
1931
|
privateSessionDir,
|
|
1927
1932
|
hostSessionDir,
|
|
1928
1933
|
sessionFileName: resumeSessionFileName,
|
|
@@ -1930,7 +1935,7 @@ async function createPiSession(input) {
|
|
|
1930
1935
|
});
|
|
1931
1936
|
}
|
|
1932
1937
|
await syncHostWorkspaceFromSandbox({
|
|
1933
|
-
sandbox,
|
|
1938
|
+
sandbox: toolSafeSandboxSession,
|
|
1934
1939
|
sandboxWorkDir: input.sessionWorkDir,
|
|
1935
1940
|
hostWorkDir
|
|
1936
1941
|
});
|
|
@@ -2069,7 +2074,7 @@ async function createPiSession(input) {
|
|
|
2069
2074
|
piSession?.setActiveToolsByName(piSession.getActiveToolNames());
|
|
2070
2075
|
}
|
|
2071
2076
|
const remoteOps = createPiRemoteOps({
|
|
2072
|
-
sandbox,
|
|
2077
|
+
sandbox: toolSafeSandboxSession,
|
|
2073
2078
|
paths,
|
|
2074
2079
|
onFileChange: (event, relPath) => {
|
|
2075
2080
|
currentEmit?.({ type: "file-change", event, path: relPath });
|
|
@@ -2090,7 +2095,7 @@ async function createPiSession(input) {
|
|
|
2090
2095
|
async function persistSessionFile() {
|
|
2091
2096
|
if (!sessionFileName) return;
|
|
2092
2097
|
await persistSessionFileToSandbox({
|
|
2093
|
-
sandbox,
|
|
2098
|
+
sandbox: toolSafeSandboxSession,
|
|
2094
2099
|
privateSessionDir,
|
|
2095
2100
|
hostSessionDir,
|
|
2096
2101
|
sessionFileName
|
|
@@ -2281,7 +2286,10 @@ async function createPiSession(input) {
|
|
|
2281
2286
|
});
|
|
2282
2287
|
},
|
|
2283
2288
|
async submitUserMessage(text) {
|
|
2284
|
-
|
|
2289
|
+
if (piSession == null) {
|
|
2290
|
+
throw new Error("Pi has no active runtime session to steer.");
|
|
2291
|
+
}
|
|
2292
|
+
await piSession.steer(text);
|
|
2285
2293
|
},
|
|
2286
2294
|
done: input2.done
|
|
2287
2295
|
};
|
|
@@ -2433,7 +2441,7 @@ async function createPiSession(input) {
|
|
|
2433
2441
|
turnAbortController.signal.throwIfAborted();
|
|
2434
2442
|
}
|
|
2435
2443
|
await syncHostWorkspaceFromSandbox({
|
|
2436
|
-
sandbox,
|
|
2444
|
+
sandbox: toolSafeSandboxSession,
|
|
2437
2445
|
sandboxWorkDir: input.sessionWorkDir,
|
|
2438
2446
|
hostWorkDir
|
|
2439
2447
|
});
|