@capekai/core 1.0.2 → 1.0.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
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capekai/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Bun-native composable agent runtime and framework for Capek.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
|
-
"url": "git+https://github.com/capek-dev/
|
|
8
|
+
"url": "git+https://github.com/capek-dev/capek.git",
|
|
9
9
|
"directory": "packages/capek"
|
|
10
10
|
},
|
|
11
11
|
"type": "module",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"@ai-sdk/deepseek": "^2.0.35",
|
|
79
79
|
"@ai-sdk/openai": "^3.0.84",
|
|
80
|
-
"@capekai/tool": "^1.0.
|
|
80
|
+
"@capekai/tool": "^1.0.2",
|
|
81
81
|
"@capekai/types": "^1.0.1",
|
|
82
82
|
"@openrouter/ai-sdk-provider": "^2.3.3",
|
|
83
83
|
"@zip.js/zip.js": "^2.7.60",
|
package/src/tools/executor.ts
CHANGED
|
@@ -205,6 +205,7 @@ export async function executeTool(options: ExecuteToolOptions): Promise<ToolResu
|
|
|
205
205
|
logger: createLogger(tool.definition.name, sessionId),
|
|
206
206
|
fetch: globalThis.fetch.bind(globalThis),
|
|
207
207
|
resolvePath: workspace.resolvePath,
|
|
208
|
+
resolvePathFrom: workspace.resolvePathFrom,
|
|
208
209
|
isWithinWorkspace: workspace.isWithinWorkspace,
|
|
209
210
|
isSensitivePath: workspace.isSensitivePath,
|
|
210
211
|
isBlockedPath: workspace.isBlockedPath,
|
|
@@ -41,6 +41,7 @@ export interface WorkspaceCapability {
|
|
|
41
41
|
allowedRoots: string[];
|
|
42
42
|
tempDir: string;
|
|
43
43
|
resolvePath(path: string): string;
|
|
44
|
+
resolvePathFrom(path: string, basePath: string): string;
|
|
44
45
|
isWithinWorkspace(path: string): boolean;
|
|
45
46
|
isSensitivePath(path: string): boolean;
|
|
46
47
|
isBlockedPath(path: string): boolean;
|
package/src/workspace/policy.ts
CHANGED
|
@@ -78,14 +78,18 @@ export function createWorkspaceCapabilityWithOptions(
|
|
|
78
78
|
const additionalRoots = (host.additionalRoots ?? []).map((path) => resolve(path));
|
|
79
79
|
const allowedRoots = (host.allowedRoots ?? []).map((path) => resolve(path));
|
|
80
80
|
|
|
81
|
-
function
|
|
81
|
+
function resolvePathFrom(path: string, basePath: string): string {
|
|
82
82
|
if (path === '~' || path.startsWith('~/')) {
|
|
83
83
|
return join(options.homeDir, path.slice(1));
|
|
84
84
|
}
|
|
85
85
|
if (isAbsolute(path)) {
|
|
86
86
|
return resolve(path);
|
|
87
87
|
}
|
|
88
|
-
return resolve(
|
|
88
|
+
return resolve(basePath, path);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function resolvePath(path: string): string {
|
|
92
|
+
return resolvePathFrom(path, effectiveRoot);
|
|
89
93
|
}
|
|
90
94
|
|
|
91
95
|
return {
|
|
@@ -94,6 +98,7 @@ export function createWorkspaceCapabilityWithOptions(
|
|
|
94
98
|
allowedRoots,
|
|
95
99
|
tempDir: host.tempDir,
|
|
96
100
|
resolvePath,
|
|
101
|
+
resolvePathFrom,
|
|
97
102
|
isWithinWorkspace(path: string): boolean {
|
|
98
103
|
const resolvedPath = resolvePath(path);
|
|
99
104
|
return [effectiveRoot, ...additionalRoots]
|