@dexto/image-local 1.6.2 → 1.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/dist/index.cjs +63 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +58 -6
- package/package.json +12 -12
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
var index_exports = {};
|
|
20
30
|
__export(index_exports, {
|
|
@@ -22,7 +32,9 @@ __export(index_exports, {
|
|
|
22
32
|
});
|
|
23
33
|
module.exports = __toCommonJS(index_exports);
|
|
24
34
|
var import_agent_config = require("@dexto/agent-config");
|
|
25
|
-
var
|
|
35
|
+
var import_node_fs = require("node:fs");
|
|
36
|
+
var import_node_path = __toESM(require("node:path"), 1);
|
|
37
|
+
var import_node_url = require("node:url");
|
|
26
38
|
var import_zod = require("zod");
|
|
27
39
|
var import_core = require("@dexto/core");
|
|
28
40
|
var import_storage = require("@dexto/storage");
|
|
@@ -35,8 +47,54 @@ var import_tools_scheduler = require("@dexto/tools-scheduler");
|
|
|
35
47
|
var import_tools_lifecycle = require("@dexto/tools-lifecycle");
|
|
36
48
|
var import_agent_management = require("@dexto/agent-management");
|
|
37
49
|
const import_meta = {};
|
|
38
|
-
|
|
39
|
-
|
|
50
|
+
function readPackageJson(packageJsonPath) {
|
|
51
|
+
if (!(0, import_node_fs.existsSync)(packageJsonPath)) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
try {
|
|
55
|
+
return JSON.parse((0, import_node_fs.readFileSync)(packageJsonPath, "utf-8"));
|
|
56
|
+
} catch {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function resolveModuleDir() {
|
|
61
|
+
const importMetaUrl = typeof import_meta !== "undefined" ? import_meta.url : void 0;
|
|
62
|
+
if (importMetaUrl) {
|
|
63
|
+
return import_node_path.default.dirname((0, import_node_url.fileURLToPath)(importMetaUrl));
|
|
64
|
+
}
|
|
65
|
+
const filenameFromGlobal = globalThis.__filename;
|
|
66
|
+
if (typeof filenameFromGlobal === "string" && filenameFromGlobal.length > 0) {
|
|
67
|
+
return import_node_path.default.dirname(filenameFromGlobal);
|
|
68
|
+
}
|
|
69
|
+
return void 0;
|
|
70
|
+
}
|
|
71
|
+
function resolveImageMetadata(defaultName) {
|
|
72
|
+
const moduleDir = resolveModuleDir();
|
|
73
|
+
if (moduleDir) {
|
|
74
|
+
const localPackageJson = readPackageJson(import_node_path.default.resolve(moduleDir, "..", "package.json"));
|
|
75
|
+
if (localPackageJson) {
|
|
76
|
+
return {
|
|
77
|
+
name: localPackageJson.name ?? defaultName,
|
|
78
|
+
version: localPackageJson.version ?? "0.0.0"
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
const packageRoot = (0, import_agent_management.getDextoPackageRoot)();
|
|
83
|
+
if (packageRoot) {
|
|
84
|
+
const bundledPackageJson = readPackageJson(import_node_path.default.join(packageRoot, "package.json"));
|
|
85
|
+
if (bundledPackageJson) {
|
|
86
|
+
return {
|
|
87
|
+
name: defaultName,
|
|
88
|
+
version: bundledPackageJson.version ?? "0.0.0"
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return {
|
|
93
|
+
name: defaultName,
|
|
94
|
+
version: process.env.DEXTO_CLI_VERSION || "0.0.0"
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
const imageMetadata = resolveImageMetadata("@dexto/image-local");
|
|
40
98
|
const contentPolicyConfigSchema = import_zod.z.object({
|
|
41
99
|
type: import_zod.z.literal("content-policy"),
|
|
42
100
|
maxInputChars: import_zod.z.number().int().positive().optional(),
|
|
@@ -80,8 +138,8 @@ const reactiveOverflowCompactionFactory = {
|
|
|
80
138
|
};
|
|
81
139
|
const imageLocal = {
|
|
82
140
|
metadata: {
|
|
83
|
-
name:
|
|
84
|
-
version:
|
|
141
|
+
name: imageMetadata.name,
|
|
142
|
+
version: imageMetadata.version,
|
|
85
143
|
description: "Local development image with filesystem and process tools",
|
|
86
144
|
target: "local-development",
|
|
87
145
|
constraints: ["filesystem-required", "offline-capable"]
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,UAAU,EAOlB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,UAAU,EAOlB,MAAM,qBAAqB,CAAC;AAmJ7B,QAAA,MAAM,UAAU,EAAE,UA0FjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,9 @@ import {
|
|
|
2
2
|
NoOpCompactionConfigSchema,
|
|
3
3
|
ReactiveOverflowCompactionConfigSchema
|
|
4
4
|
} from "@dexto/agent-config";
|
|
5
|
-
import {
|
|
5
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
6
|
+
import path from "node:path";
|
|
7
|
+
import { fileURLToPath } from "node:url";
|
|
6
8
|
import { z } from "zod";
|
|
7
9
|
import {
|
|
8
10
|
ContentPolicyHook,
|
|
@@ -27,9 +29,59 @@ import { todoToolsFactory } from "@dexto/tools-todo";
|
|
|
27
29
|
import { planToolsFactory } from "@dexto/tools-plan";
|
|
28
30
|
import { schedulerToolsFactory } from "@dexto/tools-scheduler";
|
|
29
31
|
import { lifecycleToolsFactory } from "@dexto/tools-lifecycle";
|
|
30
|
-
import {
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
import {
|
|
33
|
+
agentSpawnerToolsFactory,
|
|
34
|
+
creatorToolsFactory,
|
|
35
|
+
getDextoPackageRoot
|
|
36
|
+
} from "@dexto/agent-management";
|
|
37
|
+
function readPackageJson(packageJsonPath) {
|
|
38
|
+
if (!existsSync(packageJsonPath)) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
try {
|
|
42
|
+
return JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
43
|
+
} catch {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function resolveModuleDir() {
|
|
48
|
+
const importMetaUrl = typeof import.meta !== "undefined" ? import.meta.url : void 0;
|
|
49
|
+
if (importMetaUrl) {
|
|
50
|
+
return path.dirname(fileURLToPath(importMetaUrl));
|
|
51
|
+
}
|
|
52
|
+
const filenameFromGlobal = globalThis.__filename;
|
|
53
|
+
if (typeof filenameFromGlobal === "string" && filenameFromGlobal.length > 0) {
|
|
54
|
+
return path.dirname(filenameFromGlobal);
|
|
55
|
+
}
|
|
56
|
+
return void 0;
|
|
57
|
+
}
|
|
58
|
+
function resolveImageMetadata(defaultName) {
|
|
59
|
+
const moduleDir = resolveModuleDir();
|
|
60
|
+
if (moduleDir) {
|
|
61
|
+
const localPackageJson = readPackageJson(path.resolve(moduleDir, "..", "package.json"));
|
|
62
|
+
if (localPackageJson) {
|
|
63
|
+
return {
|
|
64
|
+
name: localPackageJson.name ?? defaultName,
|
|
65
|
+
version: localPackageJson.version ?? "0.0.0"
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
const packageRoot = getDextoPackageRoot();
|
|
70
|
+
if (packageRoot) {
|
|
71
|
+
const bundledPackageJson = readPackageJson(path.join(packageRoot, "package.json"));
|
|
72
|
+
if (bundledPackageJson) {
|
|
73
|
+
return {
|
|
74
|
+
name: defaultName,
|
|
75
|
+
version: bundledPackageJson.version ?? "0.0.0"
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
name: defaultName,
|
|
81
|
+
version: process.env.DEXTO_CLI_VERSION || "0.0.0"
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
const imageMetadata = resolveImageMetadata("@dexto/image-local");
|
|
33
85
|
const contentPolicyConfigSchema = z.object({
|
|
34
86
|
type: z.literal("content-policy"),
|
|
35
87
|
maxInputChars: z.number().int().positive().optional(),
|
|
@@ -73,8 +125,8 @@ const reactiveOverflowCompactionFactory = {
|
|
|
73
125
|
};
|
|
74
126
|
const imageLocal = {
|
|
75
127
|
metadata: {
|
|
76
|
-
name:
|
|
77
|
-
version:
|
|
128
|
+
name: imageMetadata.name,
|
|
129
|
+
version: imageMetadata.version,
|
|
78
130
|
description: "Local development image with filesystem and process tools",
|
|
79
131
|
target: "local-development",
|
|
80
132
|
constraints: ["filesystem-required", "offline-capable"]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dexto/image-local",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.3",
|
|
4
4
|
"description": "Local development base image for Dexto agents with filesystem and process tools",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -21,17 +21,17 @@
|
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"zod": "^3.25.0",
|
|
24
|
-
"@dexto/agent-config": "1.6.
|
|
25
|
-
"@dexto/agent-management": "1.6.
|
|
26
|
-
"@dexto/core": "1.6.
|
|
27
|
-
"@dexto/storage": "1.6.
|
|
28
|
-
"@dexto/tools-builtins": "1.6.
|
|
29
|
-
"@dexto/tools-filesystem": "1.6.
|
|
30
|
-
"@dexto/tools-lifecycle": "1.6.
|
|
31
|
-
"@dexto/tools-plan": "1.6.
|
|
32
|
-
"@dexto/tools-process": "1.6.
|
|
33
|
-
"@dexto/tools-scheduler": "1.6.
|
|
34
|
-
"@dexto/tools-todo": "1.6.
|
|
24
|
+
"@dexto/agent-config": "1.6.3",
|
|
25
|
+
"@dexto/agent-management": "1.6.3",
|
|
26
|
+
"@dexto/core": "1.6.3",
|
|
27
|
+
"@dexto/storage": "1.6.3",
|
|
28
|
+
"@dexto/tools-builtins": "1.6.3",
|
|
29
|
+
"@dexto/tools-filesystem": "1.6.3",
|
|
30
|
+
"@dexto/tools-lifecycle": "1.6.3",
|
|
31
|
+
"@dexto/tools-plan": "1.6.3",
|
|
32
|
+
"@dexto/tools-process": "1.6.3",
|
|
33
|
+
"@dexto/tools-scheduler": "1.6.3",
|
|
34
|
+
"@dexto/tools-todo": "1.6.3"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"tsup": "^8.0.0",
|