@easynet/agent-runtime 1.0.2 → 1.0.4
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 +38 -26
- package/agent-runtime/.github/workflows/ci.yml +69 -0
- package/agent-runtime/.github/workflows/release.yml +118 -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/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/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/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-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/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,32 +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:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const p = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
51
|
-
let changed = false;
|
|
52
|
-
for (const section of ['dependencies', 'devDependencies']) {
|
|
53
|
-
if (!p[section]) continue;
|
|
54
|
-
for (const [name, v] of Object.entries(p[section])) {
|
|
55
|
-
if (name.startsWith('@easynet/') && typeof v === 'string' && v.startsWith('file:')) {
|
|
56
|
-
p[section][name] = 'latest';
|
|
57
|
-
changed = true;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
if (changed) fs.writeFileSync(pkgPath, JSON.stringify(p, null, 2) + '\n');
|
|
62
|
-
"
|
|
63
|
-
|
|
64
|
-
- name: Remove lockfile to avoid stale local/git refs
|
|
65
|
-
run: rm -f package-lock.json
|
|
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
|
|
66
48
|
|
|
67
49
|
- name: Install dependencies
|
|
68
50
|
env:
|
|
69
51
|
NPM_CONFIG_REGISTRY: "https://registry.npmjs.org/"
|
|
70
|
-
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
|
|
71
56
|
|
|
72
57
|
- name: Build
|
|
73
58
|
run: npm run build --if-present
|
|
@@ -81,5 +66,32 @@ jobs:
|
|
|
81
66
|
- name: Release
|
|
82
67
|
env:
|
|
83
68
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
84
|
-
|
|
85
|
-
run:
|
|
69
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
70
|
+
run: |
|
|
71
|
+
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc
|
|
72
|
+
npx semantic-release
|
|
73
|
+
|
|
74
|
+
notify-itermbot:
|
|
75
|
+
name: Trigger botbotgo/iTermBot
|
|
76
|
+
runs-on: ubuntu-latest
|
|
77
|
+
needs: release
|
|
78
|
+
if: success()
|
|
79
|
+
steps:
|
|
80
|
+
- name: Dispatch iTermBot rebuild/release
|
|
81
|
+
env:
|
|
82
|
+
DOWNSTREAM_TRIGGER_TOKEN: ${{ secrets.DOWNSTREAM_TRIGGER_TOKEN }}
|
|
83
|
+
run: |
|
|
84
|
+
set -euo pipefail
|
|
85
|
+
if [ -z "${DOWNSTREAM_TRIGGER_TOKEN:-}" ]; then
|
|
86
|
+
echo "Skipping downstream dispatch: DOWNSTREAM_TRIGGER_TOKEN not set."
|
|
87
|
+
exit 0
|
|
88
|
+
fi
|
|
89
|
+
|
|
90
|
+
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 }}")
|
|
91
|
+
|
|
92
|
+
curl -fsSL -X POST \
|
|
93
|
+
-H "Accept: application/vnd.github+json" \
|
|
94
|
+
-H "Authorization: Bearer ${DOWNSTREAM_TRIGGER_TOKEN}" \
|
|
95
|
+
-H "X-GitHub-Api-Version: 2022-11-28" \
|
|
96
|
+
"https://api.github.com/repos/botbotgo/iTermBot/dispatches" \
|
|
97
|
+
-d "${payload}"
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
cache: 'npm'
|
|
30
|
+
registry-url: 'https://registry.npmjs.org'
|
|
31
|
+
|
|
32
|
+
- name: Force npm registry to npmjs.org
|
|
33
|
+
run: |
|
|
34
|
+
touch .npmrc
|
|
35
|
+
grep -q '^registry=https://registry.npmjs.org' .npmrc || echo "registry=https://registry.npmjs.org/" >> .npmrc
|
|
36
|
+
grep -q '@easynet:registry=' .npmrc || echo "@easynet:registry=https://registry.npmjs.org/" >> .npmrc
|
|
37
|
+
grep -q '@wallee:registry=' .npmrc || echo "@wallee:registry=https://registry.npmjs.org/" >> .npmrc
|
|
38
|
+
|
|
39
|
+
- name: Rewrite file deps to npm/git refs for CI
|
|
40
|
+
env:
|
|
41
|
+
AGENT_SKILL_READ_TOKEN: ${{ secrets.AGENT_SKILL_READ_TOKEN }}
|
|
42
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
43
|
+
run: node scripts/resolve-deps.js
|
|
44
|
+
|
|
45
|
+
- name: Install dependencies
|
|
46
|
+
env:
|
|
47
|
+
NPM_CONFIG_REGISTRY: "https://registry.npmjs.org/"
|
|
48
|
+
run: |
|
|
49
|
+
rm -f package-lock.json
|
|
50
|
+
npm install --legacy-peer-deps --ignore-scripts
|
|
51
|
+
|
|
52
|
+
- name: Build
|
|
53
|
+
run: npm run build --if-present
|
|
54
|
+
|
|
55
|
+
- name: Typecheck
|
|
56
|
+
run: npm run typecheck --if-present
|
|
57
|
+
|
|
58
|
+
- name: Test
|
|
59
|
+
run: npm test --if-present
|
|
60
|
+
|
|
61
|
+
- name: Diagnostics (on failure)
|
|
62
|
+
if: failure()
|
|
63
|
+
run: |
|
|
64
|
+
echo "Node: $(node -v) | npm: $(npm -v)"
|
|
65
|
+
echo "--- .npmrc ---"
|
|
66
|
+
cat .npmrc 2>&1 || true
|
|
67
|
+
echo "--- npm config ---"
|
|
68
|
+
npm config list 2>&1 || true
|
|
69
|
+
npm ls --depth=0 2>&1 | head -50
|
|
@@ -0,0 +1,118 @@
|
|
|
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
|
+
cache: 'npm'
|
|
36
|
+
registry-url: 'https://registry.npmjs.org'
|
|
37
|
+
|
|
38
|
+
- name: Force npm registry to npmjs.org
|
|
39
|
+
run: |
|
|
40
|
+
touch .npmrc
|
|
41
|
+
grep -q '^registry=https://registry.npmjs.org' .npmrc || echo "registry=https://registry.npmjs.org/" >> .npmrc
|
|
42
|
+
grep -q '@easynet:registry=' .npmrc || echo "@easynet:registry=https://registry.npmjs.org/" >> .npmrc
|
|
43
|
+
grep -q '@wallee:registry=' .npmrc || echo "@wallee:registry=https://registry.npmjs.org/" >> .npmrc
|
|
44
|
+
|
|
45
|
+
- name: Use @easynet deps from npm (CI has no file:../)
|
|
46
|
+
env:
|
|
47
|
+
AGENT_SKILL_READ_TOKEN: ${{ secrets.AGENT_SKILL_READ_TOKEN }}
|
|
48
|
+
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
|
|
74
|
+
|
|
75
|
+
- name: Install dependencies
|
|
76
|
+
env:
|
|
77
|
+
NPM_CONFIG_REGISTRY: "https://registry.npmjs.org/"
|
|
78
|
+
run: npm install --legacy-peer-deps
|
|
79
|
+
|
|
80
|
+
- name: Build
|
|
81
|
+
run: npm run build --if-present
|
|
82
|
+
|
|
83
|
+
- name: Typecheck
|
|
84
|
+
run: npm run typecheck --if-present
|
|
85
|
+
|
|
86
|
+
- name: Test
|
|
87
|
+
run: npm test --if-present
|
|
88
|
+
|
|
89
|
+
- name: Release
|
|
90
|
+
env:
|
|
91
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
92
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
93
|
+
run: npx semantic-release
|
|
94
|
+
|
|
95
|
+
notify-itermbot:
|
|
96
|
+
name: Trigger botbotgo/iTermBot
|
|
97
|
+
runs-on: ubuntu-latest
|
|
98
|
+
needs: release
|
|
99
|
+
if: success()
|
|
100
|
+
steps:
|
|
101
|
+
- name: Dispatch iTermBot rebuild/release
|
|
102
|
+
env:
|
|
103
|
+
DOWNSTREAM_TRIGGER_TOKEN: ${{ secrets.DOWNSTREAM_TRIGGER_TOKEN }}
|
|
104
|
+
run: |
|
|
105
|
+
set -euo pipefail
|
|
106
|
+
if [ -z "${DOWNSTREAM_TRIGGER_TOKEN:-}" ]; then
|
|
107
|
+
echo "Skipping downstream dispatch: DOWNSTREAM_TRIGGER_TOKEN not set."
|
|
108
|
+
exit 0
|
|
109
|
+
fi
|
|
110
|
+
|
|
111
|
+
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 }}")
|
|
112
|
+
|
|
113
|
+
curl -fsSL -X POST \
|
|
114
|
+
-H "Accept: application/vnd.github+json" \
|
|
115
|
+
-H "Authorization: Bearer ${DOWNSTREAM_TRIGGER_TOKEN}" \
|
|
116
|
+
-H "X-GitHub-Api-Version: 2022-11-28" \
|
|
117
|
+
"https://api.github.com/repos/botbotgo/iTermBot/dispatches" \
|
|
118
|
+
-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();
|