itermbot 1.0.20 → 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.
package/.github/workflows/ci.yml
CHANGED
|
@@ -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
|
|
@@ -114,3 +116,26 @@ jobs:
|
|
|
114
116
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
115
117
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
116
118
|
run: npx semantic-release
|
|
119
|
+
|
|
120
|
+
notify-root:
|
|
121
|
+
name: Notify root orchestrator
|
|
122
|
+
runs-on: ubuntu-latest
|
|
123
|
+
needs: release
|
|
124
|
+
if: ${{ success() && github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
|
125
|
+
steps:
|
|
126
|
+
- name: Dispatch root orchestration event
|
|
127
|
+
env:
|
|
128
|
+
DOWNSTREAM_TRIGGER_TOKEN: ${{ secrets.DOWNSTREAM_TRIGGER_TOKEN }}
|
|
129
|
+
run: |
|
|
130
|
+
set -euo pipefail
|
|
131
|
+
if [ -z "${DOWNSTREAM_TRIGGER_TOKEN:-}" ]; then
|
|
132
|
+
echo "Skipping root notify: DOWNSTREAM_TRIGGER_TOKEN not set."
|
|
133
|
+
exit 0
|
|
134
|
+
fi
|
|
135
|
+
payload=$(printf '{"event_type":"botbotgo-repo-released","client_payload":{"source_repo":"%s","source_ref":"%s","source_sha":"%s","source_run_id":"%s"}}' "${{ github.repository }}" "${{ github.ref_name }}" "${{ github.sha }}" "${{ github.run_id }}")
|
|
136
|
+
curl -fsSL -X POST \
|
|
137
|
+
-H "Accept: application/vnd.github+json" \
|
|
138
|
+
-H "Authorization: Bearer ${DOWNSTREAM_TRIGGER_TOKEN}" \
|
|
139
|
+
-H "X-GitHub-Api-Version: 2022-11-28" \
|
|
140
|
+
"https://api.github.com/repos/botbotgo/botbotgo/dispatches" \
|
|
141
|
+
-d "${payload}"
|
package/config/toolkit.yaml
CHANGED
|
@@ -5,10 +5,10 @@ metadata:
|
|
|
5
5
|
spec:
|
|
6
6
|
sandboxedPath: .
|
|
7
7
|
paths:
|
|
8
|
-
|
|
8
|
+
npm:@botbotgo/toolkit-builtin: {}
|
|
9
9
|
tools:
|
|
10
10
|
customized:
|
|
11
|
-
|
|
11
|
+
npm:@botbotgo/toolkit-builtin:
|
|
12
12
|
itermRunCommandInSession:
|
|
13
13
|
allowedCommandPrefixes:
|
|
14
14
|
- cat
|
package/package.json
CHANGED
package/scripts/resolve-deps.js
CHANGED
|
@@ -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
|
|