itermbot 1.0.21 → 1.0.22

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.
@@ -66,6 +66,8 @@ jobs:
66
66
  NPM_CONFIG_REGISTRY: "https://registry.npmjs.org/"
67
67
  run: |
68
68
  rm -rf node_modules
69
+ rm -f package-lock.json
70
+ npm cache clean --force || true
69
71
  unset NPM_CONFIG_USERCONFIG NODE_AUTH_TOKEN
70
72
  for i in 1 2 3; do
71
73
  if npm install --legacy-peer-deps --ignore-scripts; then exit 0; fi
@@ -75,6 +75,8 @@ jobs:
75
75
  NPM_CONFIG_REGISTRY: "https://registry.npmjs.org/"
76
76
  run: |
77
77
  rm -rf node_modules
78
+ rm -f package-lock.json
79
+ npm cache clean --force || true
78
80
  unset NPM_CONFIG_USERCONFIG NODE_AUTH_TOKEN
79
81
  for i in 1 2 3; do
80
82
  if npm install --legacy-peer-deps --ignore-scripts; then exit 0; fi
@@ -5,10 +5,10 @@ metadata:
5
5
  spec:
6
6
  sandboxedPath: .
7
7
  paths:
8
- file:../../../framework/toolkit-builtin: {}
8
+ npm:@botbotgo/toolkit-builtin: {}
9
9
  tools:
10
10
  customized:
11
- file:../../../framework/toolkit-builtin:
11
+ npm:@botbotgo/toolkit-builtin:
12
12
  itermRunCommandInSession:
13
13
  allowedCommandPrefixes:
14
14
  - cat
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itermbot",
3
- "version": "1.0.21",
3
+ "version": "1.0.22",
4
4
  "description": "iTermBot: ReAct agent (LangChain) + DeepAgent (DeepAgents) using BotBotGo packages",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -8,6 +8,14 @@ import { fileURLToPath } from "node:url";
8
8
  const DEP_SECTIONS = ["dependencies", "devDependencies", "optionalDependencies"];
9
9
  const SCOPES = ["@botbotgo/", "@wallee/"];
10
10
  const SKIP_DIRS = new Set(["node_modules", ".git", "dist", "coverage"]);
11
+ const INTERNAL_NAME_BY_DIR = new Map([
12
+ ["common", "@botbotgo/common"],
13
+ ["memory", "@botbotgo/memory"],
14
+ ["model", "@botbotgo/model"],
15
+ ["agent", "@botbotgo/agent"],
16
+ ["toolkit", "@botbotgo/toolkit"],
17
+ ["toolkit-builtin", "@botbotgo/toolkit-builtin"],
18
+ ]);
11
19
 
12
20
  function readJson(path) { return JSON.parse(readFileSync(path, "utf8")); }
13
21
  function writeJson(path, value) { writeFileSync(path, `${JSON.stringify(value, null, 2)}\n`); }
@@ -49,6 +57,24 @@ function collectPackageJsonPaths(rootDir) {
49
57
  return out.sort();
50
58
  }
51
59
 
60
+ function collectToolkitYamlPaths(rootDir) {
61
+ const out = [];
62
+ function walk(currentDir) {
63
+ for (const entry of readdirSync(currentDir)) {
64
+ if (SKIP_DIRS.has(entry)) continue;
65
+ const abs = join(currentDir, entry);
66
+ const st = statSync(abs);
67
+ if (st.isDirectory()) {
68
+ walk(abs);
69
+ continue;
70
+ }
71
+ if (entry === "toolkit.yaml") out.push(abs);
72
+ }
73
+ }
74
+ walk(rootDir);
75
+ return out.sort();
76
+ }
77
+
52
78
  function rewritePackageJson(pkgPath) {
53
79
  const pkg = readJson(pkgPath);
54
80
  const pkgDir = dirname(pkgPath);
@@ -76,6 +102,24 @@ function rewritePackageJson(pkgPath) {
76
102
  return changed;
77
103
  }
78
104
 
105
+ function rewriteToolkitYaml(toolkitPath) {
106
+ const raw = readFileSync(toolkitPath, "utf8");
107
+ const next = raw.replace(
108
+ /^(\s*)file:[^\s:#]*?(?:framework\/)?(common|memory|model|agent|toolkit|toolkit-builtin)\s*:/gm,
109
+ (full, indent, repoDir) => {
110
+ const pkgName = INTERNAL_NAME_BY_DIR.get(repoDir);
111
+ if (!pkgName) return full;
112
+ return `${indent}npm:${pkgName}:`;
113
+ },
114
+ );
115
+ if (next !== raw) {
116
+ writeFileSync(toolkitPath, next);
117
+ console.log(`[resolve-deps] ${toolkitPath}: rewrote file:* toolkit sources to npm:*`);
118
+ return true;
119
+ }
120
+ return false;
121
+ }
122
+
79
123
  function main() {
80
124
  if (!process.env.CI) {
81
125
  console.log("[resolve-deps] skipping because CI is not set");
@@ -83,8 +127,10 @@ function main() {
83
127
  }
84
128
  const repoRoot = resolve(dirname(fileURLToPath(import.meta.url)), "..");
85
129
  const packageJsonPaths = collectPackageJsonPaths(repoRoot);
130
+ const toolkitYamlPaths = collectToolkitYamlPaths(repoRoot);
86
131
  let changed = false;
87
132
  for (const pkgPath of packageJsonPaths) changed = rewritePackageJson(pkgPath) || changed;
133
+ for (const toolkitPath of toolkitYamlPaths) changed = rewriteToolkitYaml(toolkitPath) || changed;
88
134
  if (!changed) console.log("[resolve-deps] no file-based internal deps to rewrite");
89
135
  }
90
136