@easynet/agent-runtime 1.0.3 → 1.0.5
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 +9 -24
- package/.github/workflows/release.yml +14 -35
- package/agent-runtime/.github/workflows/ci.yml +68 -0
- package/agent-runtime/.github/workflows/release.yml +95 -0
- package/agent-runtime/.releaserc.cjs +26 -0
- package/agent-runtime/config/agent.deep.yaml +25 -0
- package/agent-runtime/config/agent.react.yaml +24 -0
- package/agent-runtime/example/basic-usage.ts +49 -0
- package/agent-runtime/package-lock.json +7740 -0
- package/agent-runtime/package.json +49 -0
- package/agent-runtime/pnpm-lock.yaml +3712 -0
- package/agent-runtime/scripts/resolve-deps.js +54 -0
- package/agent-runtime/src/agents/deep-agent.ts +165 -0
- package/agent-runtime/src/agents/react-agent.helpers.ts +227 -0
- package/agent-runtime/src/agents/react-agent.ts +584 -0
- package/{src → agent-runtime/src/agents}/sub-agent.ts +2 -2
- package/agent-runtime/src/cli/args.ts +15 -0
- package/agent-runtime/src/cli/event-listener.ts +162 -0
- package/agent-runtime/src/cli/interactive.ts +144 -0
- package/agent-runtime/src/cli/runtime.ts +31 -0
- package/agent-runtime/src/cli/spinner.ts +23 -0
- package/agent-runtime/src/cli/terminal-render.ts +322 -0
- package/agent-runtime/src/cli/types.ts +33 -0
- package/agent-runtime/src/cli.ts +134 -0
- package/agent-runtime/src/config/helpers.ts +179 -0
- package/agent-runtime/src/config/index.ts +245 -0
- package/agent-runtime/src/config/types.ts +62 -0
- package/agent-runtime/src/core/context.ts +266 -0
- package/agent-runtime/src/index.ts +55 -0
- package/agent-runtime/tsconfig.json +18 -0
- package/apps/imessagebot/README.md +38 -0
- package/apps/imessagebot/config/.agent/cache/easynet/agent-tool-buildin/0.0.45/README.md +33 -0
- package/apps/imessagebot/config/.agent/cache/easynet/agent-tool-buildin/0.0.45/package-lock.json +15257 -0
- package/apps/imessagebot/config/.agent/cache/easynet/agent-tool-buildin/0.0.45/package.json +55 -0
- package/apps/imessagebot/config/agents/deep/agent.yaml +31 -0
- package/apps/imessagebot/config/agents/react/agent.yaml +58 -0
- package/apps/imessagebot/config/agents/shared/.agent/cache/easynet/agent-tool-buildin/0.0.43/README.md +33 -0
- package/apps/imessagebot/config/agents/shared/.agent/cache/easynet/agent-tool-buildin/0.0.43/package-lock.json +15457 -0
- package/apps/imessagebot/config/agents/shared/.agent/cache/easynet/agent-tool-buildin/0.0.43/package.json +55 -0
- package/apps/imessagebot/config/agents/shared/.agent/cache/easynet/agent-tool-buildin/0.0.46/README.md +33 -0
- package/apps/imessagebot/config/agents/shared/.agent/cache/easynet/agent-tool-buildin/0.0.46/package-lock.json +15257 -0
- package/apps/imessagebot/config/agents/shared/.agent/cache/easynet/agent-tool-buildin/0.0.46/package.json +62 -0
- package/apps/imessagebot/config/agents/shared/memory.yaml +31 -0
- package/apps/imessagebot/config/agents/shared/model.yaml +23 -0
- package/apps/imessagebot/config/agents/shared/tool.yaml +13 -0
- package/apps/imessagebot/config/app.yaml +14 -0
- package/apps/imessagebot/package-lock.json +53695 -0
- package/apps/imessagebot/package.json +41 -0
- package/apps/imessagebot/pnpm-lock.yaml +1589 -0
- package/apps/imessagebot/scripts/resolve-deps.js +41 -0
- package/apps/imessagebot/scripts/test-llm.mjs +27 -0
- package/apps/imessagebot/scripts/validate-tools-config.mjs +174 -0
- package/apps/imessagebot/src/app/config.ts +76 -0
- package/apps/imessagebot/src/app/context.ts +39 -0
- package/apps/imessagebot/src/config.ts +76 -0
- package/apps/imessagebot/src/context.ts +35 -0
- package/apps/imessagebot/src/index.ts +17 -0
- package/apps/imessagebot/tsconfig.json +18 -0
- package/apps/itermbot/.github/workflows/ci.yml +61 -0
- package/apps/itermbot/.github/workflows/release.yml +80 -0
- package/apps/itermbot/.releaserc.cjs +26 -0
- package/apps/itermbot/README.md +82 -0
- package/apps/itermbot/config/app.yaml +29 -0
- package/apps/itermbot/config/tool.yaml +19 -0
- package/apps/itermbot/config/tsconfig.json +18 -0
- package/apps/itermbot/macos_disk_usage_agent_plan.md +244 -0
- package/apps/itermbot/package-lock.json +53697 -0
- package/apps/itermbot/package.json +57 -0
- package/apps/itermbot/pnpm-lock.yaml +3966 -0
- package/apps/itermbot/scripts/patch-buildin-cache.sh +25 -0
- package/apps/itermbot/scripts/resolve-deps.js +41 -0
- package/apps/itermbot/scripts/test-llm.mjs +32 -0
- package/apps/itermbot/skills/command-explain-and-guard/SKILL.md +39 -0
- package/apps/itermbot/skills/command-explain-and-guard/handler.js +86 -0
- package/apps/itermbot/skills/disk-usage-investigate/SKILL.md +44 -0
- package/apps/itermbot/skills/disk-usage-investigate/handler.js +12 -0
- package/apps/itermbot/skills/gpu-ssh-monitor/SKILL.md +64 -0
- package/apps/itermbot/skills/repo-triage/SKILL.md +40 -0
- package/apps/itermbot/skills/repo-triage/handler.js +56 -0
- package/apps/itermbot/skills/test-failure-diagnose/SKILL.md +43 -0
- package/apps/itermbot/skills/test-failure-diagnose/handler.js +107 -0
- package/apps/itermbot/src/app/config.ts +117 -0
- package/apps/itermbot/src/app/context.ts +39 -0
- package/apps/itermbot/src/config.ts +95 -0
- package/apps/itermbot/src/context.ts +35 -0
- package/apps/itermbot/src/index.ts +223 -0
- package/apps/itermbot/src/iterm/session-hint.ts +40 -0
- package/apps/itermbot/src/iterm/target-panel-policy.ts +220 -0
- package/apps/itermbot/src/iterm/target-routing.ts +419 -0
- package/apps/itermbot/src/startup/colors.ts +317 -0
- package/apps/itermbot/src/startup/diagnostics.ts +97 -0
- package/apps/itermbot/src/startup/ui.ts +141 -0
- package/apps/itermbot/test/target-panel-policy.test.mjs +60 -0
- package/config/agent.deep.yaml +25 -0
- package/config/agent.react.yaml +24 -0
- package/dist/agents/deep-agent.d.ts +37 -0
- package/dist/agents/deep-agent.d.ts.map +1 -0
- package/dist/agents/deep-agent.js +115 -0
- package/dist/agents/deep-agent.js.map +1 -0
- package/dist/agents/react-agent.d.ts +40 -0
- package/dist/agents/react-agent.d.ts.map +1 -0
- package/dist/agents/react-agent.helpers.d.ts +40 -0
- package/dist/agents/react-agent.helpers.d.ts.map +1 -0
- package/dist/agents/react-agent.helpers.js +196 -0
- package/dist/agents/react-agent.helpers.js.map +1 -0
- package/dist/agents/react-agent.js +400 -0
- package/dist/agents/react-agent.js.map +1 -0
- package/dist/agents/sub-agent.d.ts +34 -0
- package/dist/agents/sub-agent.d.ts.map +1 -0
- package/dist/agents/sub-agent.js +53 -0
- package/dist/agents/sub-agent.js.map +1 -0
- package/dist/cli/args.d.ts +8 -0
- package/dist/cli/args.d.ts.map +1 -0
- package/dist/cli/args.js +9 -0
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/event-listener.d.ts +3 -0
- package/dist/cli/event-listener.d.ts.map +1 -0
- package/dist/cli/event-listener.js +131 -0
- package/dist/cli/event-listener.js.map +1 -0
- package/dist/cli/interactive.d.ts +4 -0
- package/dist/cli/interactive.d.ts.map +1 -0
- package/dist/cli/interactive.js +118 -0
- package/dist/cli/interactive.js.map +1 -0
- package/dist/cli/runtime.d.ts +8 -0
- package/dist/cli/runtime.d.ts.map +1 -0
- package/dist/cli/runtime.js +27 -0
- package/dist/cli/runtime.js.map +1 -0
- package/dist/cli/spinner.d.ts +2 -0
- package/dist/cli/spinner.d.ts.map +1 -0
- package/dist/cli/spinner.js +22 -0
- package/dist/cli/spinner.js.map +1 -0
- package/dist/cli/terminal-render.d.ts +7 -0
- package/dist/cli/terminal-render.d.ts.map +1 -0
- package/dist/cli/terminal-render.js +282 -0
- package/dist/cli/terminal-render.js.map +1 -0
- package/dist/cli/types.d.ts +29 -0
- package/dist/cli/types.d.ts.map +1 -0
- package/dist/cli/types.js +3 -0
- package/dist/cli/types.js.map +1 -0
- package/dist/cli.d.ts +4 -41
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +84 -588
- package/dist/cli.js.map +1 -1
- package/dist/config/helpers.d.ts +6 -0
- package/dist/config/helpers.d.ts.map +1 -0
- package/dist/config/helpers.js +164 -0
- package/dist/config/helpers.js.map +1 -0
- package/dist/config/index.d.ts +15 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +160 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/types.d.ts +57 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +2 -0
- package/dist/config/types.js.map +1 -0
- package/dist/context.d.ts +8 -69
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +44 -24
- package/dist/context.js.map +1 -1
- package/dist/core/context.d.ts +66 -0
- package/dist/core/context.d.ts.map +1 -0
- package/dist/core/context.js +149 -0
- package/dist/core/context.js.map +1 -0
- package/dist/deep-agent.d.ts +5 -2
- package/dist/deep-agent.d.ts.map +1 -1
- package/dist/deep-agent.js +44 -11
- package/dist/deep-agent.js.map +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/middleware/malformed-tool-call-middleware.d.ts +8 -0
- package/dist/middleware/malformed-tool-call-middleware.d.ts.map +1 -0
- package/dist/middleware/malformed-tool-call-middleware.js +191 -0
- package/dist/middleware/malformed-tool-call-middleware.js.map +1 -0
- package/dist/react-agent.d.ts +2 -2
- package/dist/react-agent.d.ts.map +1 -1
- package/dist/react-agent.js +28 -9
- package/dist/react-agent.js.map +1 -1
- package/package.json +1 -1
- package/scripts/resolve-deps.js +54 -0
- package/src/agents/deep-agent.ts +165 -0
- package/src/agents/react-agent.helpers.ts +227 -0
- package/src/agents/react-agent.ts +584 -0
- package/src/agents/sub-agent.ts +82 -0
- package/src/cli/args.ts +15 -0
- package/src/cli/event-listener.ts +162 -0
- package/src/cli/interactive.ts +144 -0
- package/src/cli/runtime.ts +31 -0
- package/src/cli/spinner.ts +23 -0
- package/src/cli/terminal-render.ts +322 -0
- package/src/cli/types.ts +33 -0
- package/src/cli.ts +91 -702
- package/src/config/helpers.ts +179 -0
- package/src/config/index.ts +245 -0
- package/src/config/types.ts +62 -0
- package/src/core/context.ts +266 -0
- package/src/index.ts +13 -11
- package/src/middleware/malformed-tool-call-middleware.ts +239 -0
- package/src/types/markdown-it-terminal.d.ts +4 -0
- package/src/types/marked-terminal.d.ts +16 -0
- package/dist/config.d.ts +0 -86
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -84
- package/dist/config.js.map +0 -1
- package/src/config.ts +0 -177
- package/src/context.ts +0 -247
- package/src/deep-agent.ts +0 -104
- package/src/react-agent.ts +0 -576
- /package/{src → agent-runtime/src/middleware}/malformed-tool-call-middleware.ts +0 -0
- /package/{src → agent-runtime/src/types}/markdown-it-terminal.d.ts +0 -0
- /package/{src → agent-runtime/src/types}/marked-terminal.d.ts +0 -0
package/.github/workflows/ci.yml
CHANGED
|
@@ -26,8 +26,6 @@ jobs:
|
|
|
26
26
|
uses: actions/setup-node@v4
|
|
27
27
|
with:
|
|
28
28
|
node-version: '20'
|
|
29
|
-
cache: 'npm'
|
|
30
|
-
registry-url: 'https://registry.npmjs.org'
|
|
31
29
|
|
|
32
30
|
- name: Force npm registry to npmjs.org
|
|
33
31
|
run: |
|
|
@@ -36,32 +34,19 @@ jobs:
|
|
|
36
34
|
grep -q '@easynet:registry=' .npmrc || echo "@easynet:registry=https://registry.npmjs.org/" >> .npmrc
|
|
37
35
|
grep -q '@wallee:registry=' .npmrc || echo "@wallee:registry=https://registry.npmjs.org/" >> .npmrc
|
|
38
36
|
|
|
39
|
-
- name:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const p = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
45
|
-
let changed = false;
|
|
46
|
-
for (const section of ['dependencies', 'devDependencies']) {
|
|
47
|
-
if (!p[section]) continue;
|
|
48
|
-
for (const [name, v] of Object.entries(p[section])) {
|
|
49
|
-
if (name.startsWith('@easynet/') && typeof v === 'string' && v.startsWith('file:')) {
|
|
50
|
-
p[section][name] = 'latest';
|
|
51
|
-
changed = true;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
if (changed) fs.writeFileSync(pkgPath, JSON.stringify(p, null, 2) + '\n');
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
- name: Remove lockfile to avoid stale local/git refs
|
|
59
|
-
run: rm -f package-lock.json
|
|
37
|
+
- name: Rewrite file deps to npm/git refs for CI
|
|
38
|
+
env:
|
|
39
|
+
AGENT_SKILL_READ_TOKEN: ${{ secrets.AGENT_SKILL_READ_TOKEN }}
|
|
40
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
41
|
+
run: node scripts/resolve-deps.js
|
|
60
42
|
|
|
61
43
|
- name: Install dependencies
|
|
62
44
|
env:
|
|
63
45
|
NPM_CONFIG_REGISTRY: "https://registry.npmjs.org/"
|
|
64
|
-
run:
|
|
46
|
+
run: |
|
|
47
|
+
rm -rf node_modules package-lock.json
|
|
48
|
+
unset NPM_CONFIG_USERCONFIG NODE_AUTH_TOKEN
|
|
49
|
+
npm install --legacy-peer-deps --ignore-scripts
|
|
65
50
|
|
|
66
51
|
- name: Build
|
|
67
52
|
run: npm run build --if-present
|
|
@@ -32,8 +32,6 @@ jobs:
|
|
|
32
32
|
uses: actions/setup-node@v4
|
|
33
33
|
with:
|
|
34
34
|
node-version: '20'
|
|
35
|
-
cache: 'npm'
|
|
36
|
-
registry-url: 'https://registry.npmjs.org'
|
|
37
35
|
|
|
38
36
|
- name: Force npm registry to npmjs.org
|
|
39
37
|
run: |
|
|
@@ -42,40 +40,19 @@ jobs:
|
|
|
42
40
|
grep -q '@easynet:registry=' .npmrc || echo "@easynet:registry=https://registry.npmjs.org/" >> .npmrc
|
|
43
41
|
grep -q '@wallee:registry=' .npmrc || echo "@wallee:registry=https://registry.npmjs.org/" >> .npmrc
|
|
44
42
|
|
|
45
|
-
- name:
|
|
43
|
+
- name: Rewrite file deps to npm/git refs for CI
|
|
46
44
|
env:
|
|
47
45
|
AGENT_SKILL_READ_TOKEN: ${{ secrets.AGENT_SKILL_READ_TOKEN }}
|
|
48
46
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
49
|
-
run:
|
|
50
|
-
node -e "
|
|
51
|
-
const fs = require('fs');
|
|
52
|
-
const pkgPath = 'package.json';
|
|
53
|
-
const p = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
54
|
-
const deps = { ...p.dependencies, ...p.devDependencies };
|
|
55
|
-
const token = process.env.AGENT_SKILL_READ_TOKEN || process.env.GITHUB_TOKEN || '';
|
|
56
|
-
if (!token) {
|
|
57
|
-
console.error('Missing AGENT_SKILL_READ_TOKEN (or GITHUB_TOKEN) for @easynet/agent-skill private dependency.');
|
|
58
|
-
process.exit(1);
|
|
59
|
-
}
|
|
60
|
-
let changed = false;
|
|
61
|
-
for (const [name, v] of Object.entries(deps)) {
|
|
62
|
-
if (name.startsWith('@easynet/') && typeof v === 'string' && v.startsWith('file:')) {
|
|
63
|
-
const resolved = name === '@easynet/agent-skill'
|
|
64
|
-
? ('git+https://x-access-token:' + token + '@github.com/easynet-world/agent-skill.git#master')
|
|
65
|
-
: 'latest';
|
|
66
|
-
if (p.dependencies[name]) { p.dependencies[name] = resolved; changed = true; }
|
|
67
|
-
if (p.devDependencies[name]) { p.devDependencies[name] = resolved; changed = true; }
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
if (changed) fs.writeFileSync(pkgPath, JSON.stringify(p, null, 2) + '\n');
|
|
71
|
-
"
|
|
72
|
-
- name: Remove lockfile to avoid stale ssh git refs
|
|
73
|
-
run: rm -f package-lock.json
|
|
47
|
+
run: node scripts/resolve-deps.js
|
|
74
48
|
|
|
75
49
|
- name: Install dependencies
|
|
76
50
|
env:
|
|
77
51
|
NPM_CONFIG_REGISTRY: "https://registry.npmjs.org/"
|
|
78
|
-
run:
|
|
52
|
+
run: |
|
|
53
|
+
rm -rf node_modules package-lock.json
|
|
54
|
+
unset NPM_CONFIG_USERCONFIG NODE_AUTH_TOKEN
|
|
55
|
+
npm install --legacy-peer-deps --ignore-scripts
|
|
79
56
|
|
|
80
57
|
- name: Build
|
|
81
58
|
run: npm run build --if-present
|
|
@@ -89,8 +66,10 @@ jobs:
|
|
|
89
66
|
- name: Release
|
|
90
67
|
env:
|
|
91
68
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
92
|
-
|
|
93
|
-
run:
|
|
69
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
70
|
+
run: |
|
|
71
|
+
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc
|
|
72
|
+
npx semantic-release
|
|
94
73
|
|
|
95
74
|
notify-itermbot:
|
|
96
75
|
name: Trigger botbotgo/iTermBot
|
|
@@ -100,11 +79,11 @@ jobs:
|
|
|
100
79
|
steps:
|
|
101
80
|
- name: Dispatch iTermBot rebuild/release
|
|
102
81
|
env:
|
|
103
|
-
|
|
82
|
+
DOWNSTREAM_TRIGGER_TOKEN: ${{ secrets.DOWNSTREAM_TRIGGER_TOKEN }}
|
|
104
83
|
run: |
|
|
105
84
|
set -euo pipefail
|
|
106
|
-
if [ -z "${
|
|
107
|
-
echo "Skipping downstream dispatch:
|
|
85
|
+
if [ -z "${DOWNSTREAM_TRIGGER_TOKEN:-}" ]; then
|
|
86
|
+
echo "Skipping downstream dispatch: DOWNSTREAM_TRIGGER_TOKEN not set."
|
|
108
87
|
exit 0
|
|
109
88
|
fi
|
|
110
89
|
|
|
@@ -112,7 +91,7 @@ jobs:
|
|
|
112
91
|
|
|
113
92
|
curl -fsSL -X POST \
|
|
114
93
|
-H "Accept: application/vnd.github+json" \
|
|
115
|
-
-H "Authorization: Bearer ${
|
|
94
|
+
-H "Authorization: Bearer ${DOWNSTREAM_TRIGGER_TOKEN}" \
|
|
116
95
|
-H "X-GitHub-Api-Version: 2022-11-28" \
|
|
117
96
|
"https://api.github.com/repos/botbotgo/iTermBot/dispatches" \
|
|
118
97
|
-d "${payload}"
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: ['**']
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: ['**']
|
|
8
|
+
repository_dispatch:
|
|
9
|
+
types:
|
|
10
|
+
- easynet-package-updated
|
|
11
|
+
|
|
12
|
+
concurrency:
|
|
13
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
14
|
+
cancel-in-progress: true
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
test:
|
|
18
|
+
name: Test & Build
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
timeout-minutes: 25
|
|
21
|
+
steps:
|
|
22
|
+
- name: Checkout
|
|
23
|
+
uses: actions/checkout@v4
|
|
24
|
+
|
|
25
|
+
- name: Setup Node.js
|
|
26
|
+
uses: actions/setup-node@v4
|
|
27
|
+
with:
|
|
28
|
+
node-version: '20'
|
|
29
|
+
|
|
30
|
+
- name: Force npm registry to npmjs.org
|
|
31
|
+
run: |
|
|
32
|
+
touch .npmrc
|
|
33
|
+
grep -q '^registry=https://registry.npmjs.org' .npmrc || echo "registry=https://registry.npmjs.org/" >> .npmrc
|
|
34
|
+
grep -q '@easynet:registry=' .npmrc || echo "@easynet:registry=https://registry.npmjs.org/" >> .npmrc
|
|
35
|
+
grep -q '@wallee:registry=' .npmrc || echo "@wallee:registry=https://registry.npmjs.org/" >> .npmrc
|
|
36
|
+
|
|
37
|
+
- name: Rewrite file deps to npm/git refs for CI
|
|
38
|
+
env:
|
|
39
|
+
AGENT_SKILL_READ_TOKEN: ${{ secrets.AGENT_SKILL_READ_TOKEN }}
|
|
40
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
41
|
+
run: node scripts/resolve-deps.js
|
|
42
|
+
|
|
43
|
+
- name: Install dependencies
|
|
44
|
+
env:
|
|
45
|
+
NPM_CONFIG_REGISTRY: "https://registry.npmjs.org/"
|
|
46
|
+
run: |
|
|
47
|
+
rm -f package-lock.json
|
|
48
|
+
unset NPM_CONFIG_USERCONFIG NODE_AUTH_TOKEN
|
|
49
|
+
npm install --legacy-peer-deps --ignore-scripts
|
|
50
|
+
|
|
51
|
+
- name: Build
|
|
52
|
+
run: npm run build --if-present
|
|
53
|
+
|
|
54
|
+
- name: Typecheck
|
|
55
|
+
run: npm run typecheck --if-present
|
|
56
|
+
|
|
57
|
+
- name: Test
|
|
58
|
+
run: npm test --if-present
|
|
59
|
+
|
|
60
|
+
- name: Diagnostics (on failure)
|
|
61
|
+
if: failure()
|
|
62
|
+
run: |
|
|
63
|
+
echo "Node: $(node -v) | npm: $(npm -v)"
|
|
64
|
+
echo "--- .npmrc ---"
|
|
65
|
+
cat .npmrc 2>&1 || true
|
|
66
|
+
echo "--- npm config ---"
|
|
67
|
+
npm config list 2>&1 || true
|
|
68
|
+
npm ls --depth=0 2>&1 | head -50
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
repository_dispatch:
|
|
9
|
+
types:
|
|
10
|
+
- easynet-package-updated
|
|
11
|
+
|
|
12
|
+
concurrency:
|
|
13
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
14
|
+
cancel-in-progress: true
|
|
15
|
+
|
|
16
|
+
permissions:
|
|
17
|
+
contents: write
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
release:
|
|
21
|
+
name: Release
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
timeout-minutes: 30
|
|
24
|
+
steps:
|
|
25
|
+
- name: Checkout
|
|
26
|
+
uses: actions/checkout@v4
|
|
27
|
+
with:
|
|
28
|
+
fetch-depth: 0
|
|
29
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
30
|
+
|
|
31
|
+
- name: Setup Node.js
|
|
32
|
+
uses: actions/setup-node@v4
|
|
33
|
+
with:
|
|
34
|
+
node-version: '20'
|
|
35
|
+
|
|
36
|
+
- name: Force npm registry to npmjs.org
|
|
37
|
+
run: |
|
|
38
|
+
touch .npmrc
|
|
39
|
+
grep -q '^registry=https://registry.npmjs.org' .npmrc || echo "registry=https://registry.npmjs.org/" >> .npmrc
|
|
40
|
+
grep -q '@easynet:registry=' .npmrc || echo "@easynet:registry=https://registry.npmjs.org/" >> .npmrc
|
|
41
|
+
grep -q '@wallee:registry=' .npmrc || echo "@wallee:registry=https://registry.npmjs.org/" >> .npmrc
|
|
42
|
+
|
|
43
|
+
- name: Rewrite file deps to npm/git refs for CI
|
|
44
|
+
env:
|
|
45
|
+
AGENT_SKILL_READ_TOKEN: ${{ secrets.AGENT_SKILL_READ_TOKEN }}
|
|
46
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
47
|
+
run: node scripts/resolve-deps.js
|
|
48
|
+
|
|
49
|
+
- name: Install dependencies
|
|
50
|
+
env:
|
|
51
|
+
NPM_CONFIG_REGISTRY: "https://registry.npmjs.org/"
|
|
52
|
+
run: |
|
|
53
|
+
rm -f package-lock.json
|
|
54
|
+
unset NPM_CONFIG_USERCONFIG NODE_AUTH_TOKEN
|
|
55
|
+
npm install --legacy-peer-deps --ignore-scripts
|
|
56
|
+
|
|
57
|
+
- name: Build
|
|
58
|
+
run: npm run build --if-present
|
|
59
|
+
|
|
60
|
+
- name: Typecheck
|
|
61
|
+
run: npm run typecheck --if-present
|
|
62
|
+
|
|
63
|
+
- name: Test
|
|
64
|
+
run: npm test --if-present
|
|
65
|
+
|
|
66
|
+
- name: Release
|
|
67
|
+
env:
|
|
68
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
69
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
70
|
+
run: npx semantic-release
|
|
71
|
+
|
|
72
|
+
notify-itermbot:
|
|
73
|
+
name: Trigger botbotgo/iTermBot
|
|
74
|
+
runs-on: ubuntu-latest
|
|
75
|
+
needs: release
|
|
76
|
+
if: success()
|
|
77
|
+
steps:
|
|
78
|
+
- name: Dispatch iTermBot rebuild/release
|
|
79
|
+
env:
|
|
80
|
+
DOWNSTREAM_TRIGGER_TOKEN: ${{ secrets.DOWNSTREAM_TRIGGER_TOKEN }}
|
|
81
|
+
run: |
|
|
82
|
+
set -euo pipefail
|
|
83
|
+
if [ -z "${DOWNSTREAM_TRIGGER_TOKEN:-}" ]; then
|
|
84
|
+
echo "Skipping downstream dispatch: DOWNSTREAM_TRIGGER_TOKEN not set."
|
|
85
|
+
exit 0
|
|
86
|
+
fi
|
|
87
|
+
|
|
88
|
+
payload=$(printf '{"event_type":"easynet-package-updated","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 }}")
|
|
89
|
+
|
|
90
|
+
curl -fsSL -X POST \
|
|
91
|
+
-H "Accept: application/vnd.github+json" \
|
|
92
|
+
-H "Authorization: Bearer ${DOWNSTREAM_TRIGGER_TOKEN}" \
|
|
93
|
+
-H "X-GitHub-Api-Version: 2022-11-28" \
|
|
94
|
+
"https://api.github.com/repos/botbotgo/iTermBot/dispatches" \
|
|
95
|
+
-d "${payload}"
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** @type {import('semantic-release').GlobalConfig} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
branches: ['master'],
|
|
4
|
+
plugins: [
|
|
5
|
+
[
|
|
6
|
+
'@semantic-release/commit-analyzer',
|
|
7
|
+
{
|
|
8
|
+
releaseRules: [
|
|
9
|
+
{ type: 'feat', release: 'patch' },
|
|
10
|
+
{ type: 'fix', release: 'patch' },
|
|
11
|
+
{ type: 'docs', release: 'patch' },
|
|
12
|
+
{ type: 'chore', release: 'patch' },
|
|
13
|
+
{ type: 'refactor', release: 'patch' },
|
|
14
|
+
{ type: 'perf', release: 'patch' },
|
|
15
|
+
{ type: 'test', release: 'patch' },
|
|
16
|
+
{ type: 'ci', release: 'patch' },
|
|
17
|
+
{ type: 'build', release: 'patch' },
|
|
18
|
+
{ message: '*', release: 'patch' },
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
'@semantic-release/release-notes-generator',
|
|
23
|
+
'@semantic-release/npm',
|
|
24
|
+
'@semantic-release/git',
|
|
25
|
+
],
|
|
26
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
apiVersion: easynet.world/v1
|
|
2
|
+
kind: AgentConfig
|
|
3
|
+
metadata:
|
|
4
|
+
name: runtime-deep-default
|
|
5
|
+
spec:
|
|
6
|
+
systemPrompt: |
|
|
7
|
+
You are an assistant running in Deep Agent mode.
|
|
8
|
+
Domain rules are provided by app-level prompt templates.
|
|
9
|
+
|
|
10
|
+
## Execution Rules
|
|
11
|
+
- Solve tasks in clear multi-step order.
|
|
12
|
+
- Use available tools as the source of truth.
|
|
13
|
+
- Prefer low-cost actions first; escalate only when needed.
|
|
14
|
+
|
|
15
|
+
## Response Rules
|
|
16
|
+
- Keep responses concise, structured, and evidence-based.
|
|
17
|
+
- Do not invent facts not present in observations.
|
|
18
|
+
- Keep internal reasoning private.
|
|
19
|
+
|
|
20
|
+
## Memory Rules
|
|
21
|
+
- Use `thread` for session context and transient details.
|
|
22
|
+
- Use `cross_thread` for durable preferences/facts.
|
|
23
|
+
- Never store secrets.
|
|
24
|
+
recursionLimit: 8
|
|
25
|
+
memoriesPath: /memories/
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
apiVersion: easynet.world/v1
|
|
2
|
+
kind: AgentConfig
|
|
3
|
+
metadata:
|
|
4
|
+
name: runtime-react-default
|
|
5
|
+
spec:
|
|
6
|
+
systemPrompt: |
|
|
7
|
+
You are an assistant running in ReAct mode.
|
|
8
|
+
Domain rules are provided by app-level prompt templates.
|
|
9
|
+
|
|
10
|
+
## Tool Calls
|
|
11
|
+
- When taking an action, output exactly one tool call line: `toolName({ ... })`.
|
|
12
|
+
- The parentheses must contain exactly one valid JSON object.
|
|
13
|
+
- No extra wrapper text around tool-call JSON.
|
|
14
|
+
|
|
15
|
+
## Response Rules
|
|
16
|
+
- Be concise, structured, and evidence-based.
|
|
17
|
+
- Do not invent facts not present in tool outputs.
|
|
18
|
+
- Keep internal reasoning private.
|
|
19
|
+
|
|
20
|
+
## Memory Rules
|
|
21
|
+
- Use `thread` for session context and transient details.
|
|
22
|
+
- Use `cross_thread` for durable preferences/facts.
|
|
23
|
+
- Never store secrets.
|
|
24
|
+
maxSteps: 40
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createAppContext,
|
|
3
|
+
createContextBuilders,
|
|
4
|
+
createConfigApi,
|
|
5
|
+
loadAppConfig,
|
|
6
|
+
getModelsConfigPath,
|
|
7
|
+
getMemoryConfigPath,
|
|
8
|
+
getToolConfigPath,
|
|
9
|
+
createReactAgent,
|
|
10
|
+
printReactSteps,
|
|
11
|
+
createDeepAgent,
|
|
12
|
+
malformedToolCallMiddleware,
|
|
13
|
+
createSubAgentRunner,
|
|
14
|
+
runAppCli,
|
|
15
|
+
} from "@easynet/agent-runtime";
|
|
16
|
+
|
|
17
|
+
async function runOnce(): Promise<void> {
|
|
18
|
+
const { createAgent } = createAppContext();
|
|
19
|
+
const ctx = await createAgent({ configPath: "./config/app.yaml", agentName: "react" });
|
|
20
|
+
|
|
21
|
+
const react = createReactAgent(ctx, { maxSteps: 6 });
|
|
22
|
+
const result = await react.run("Summarize this repository in one sentence.");
|
|
23
|
+
console.log(result.text);
|
|
24
|
+
printReactSteps(result.messages ?? []);
|
|
25
|
+
|
|
26
|
+
const sub = createSubAgentRunner(ctx);
|
|
27
|
+
const subResult = await sub.run("List risks in this codebase.", { kind: "react" });
|
|
28
|
+
console.log(subResult.text);
|
|
29
|
+
|
|
30
|
+
const deep = createDeepAgent(ctx, { maxSteps: 4 });
|
|
31
|
+
void deep;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function runCli(): void {
|
|
35
|
+
const configApi = createConfigApi();
|
|
36
|
+
const config = { app: { agent: { react: {} } } };
|
|
37
|
+
void loadAppConfig("./config/app.yaml");
|
|
38
|
+
void getModelsConfigPath(config, "react");
|
|
39
|
+
void getMemoryConfigPath(config, "react");
|
|
40
|
+
void getToolConfigPath(config, "react");
|
|
41
|
+
void createContextBuilders({ configApi });
|
|
42
|
+
void malformedToolCallMiddleware({ maxRetries: 1, verbose: false });
|
|
43
|
+
|
|
44
|
+
const { createBotContext } = createAppContext();
|
|
45
|
+
runAppCli({ appName: "demo-app", createBotContext: () => createBotContext("./config/app.yaml") });
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
void runOnce();
|
|
49
|
+
// runCli();
|