@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
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@easynet/agent-tool-buildin",
|
|
3
|
+
"version": "0.0.45",
|
|
4
|
+
"description": "Tools extension for @easynet/agent-tool: FS, HTTP, util, security (sandbox, SSRF). Same contract as any other extension.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"prebuild": "npm run build --prefix ../agent-tool 2>/dev/null || true",
|
|
21
|
+
"build": "tsx generate-manifest.ts && tsc -p tsconfig.build.json",
|
|
22
|
+
"clean": "rm -rf dist",
|
|
23
|
+
"pretest": "npm run build",
|
|
24
|
+
"test": "vitest run",
|
|
25
|
+
"test:iterm-live": "tsx scripts/test-iterm-live.ts",
|
|
26
|
+
"test:iterm-integration": "RUN_ITERM_INTEGRATION=1 vitest run test/integration/itermTools.integration.test.ts",
|
|
27
|
+
"typecheck": "tsc --noEmit"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"node-html-parser": "^6.1.13"
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"@easynet/agent-tool": "latest"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@easynet/agent-tool": "latest",
|
|
37
|
+
"@semantic-release/git": "^10.0.1",
|
|
38
|
+
"@semantic-release/npm": "^12.0.0",
|
|
39
|
+
"@types/jmespath": "^0.15.0",
|
|
40
|
+
"@types/mustache": "^4.2.5",
|
|
41
|
+
"semantic-release": "^24.0.0",
|
|
42
|
+
"tsx": "^4.19.2",
|
|
43
|
+
"typescript": "~5.7.2",
|
|
44
|
+
"vitest": "^2.1.8"
|
|
45
|
+
},
|
|
46
|
+
"publishConfig": {
|
|
47
|
+
"access": "public",
|
|
48
|
+
"registry": "https://registry.npmjs.org/"
|
|
49
|
+
},
|
|
50
|
+
"repository": {
|
|
51
|
+
"type": "git",
|
|
52
|
+
"url": "https://github.com/easynet-world/agent-tool-buildin.git"
|
|
53
|
+
},
|
|
54
|
+
"license": "MIT"
|
|
55
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
apiVersion: easynet.world/v1
|
|
2
|
+
kind: AgentConfig
|
|
3
|
+
metadata:
|
|
4
|
+
name: imessagebot-deep
|
|
5
|
+
spec:
|
|
6
|
+
models:
|
|
7
|
+
ref: ../shared/model.yaml
|
|
8
|
+
memory:
|
|
9
|
+
ref: ../shared/memory.yaml
|
|
10
|
+
namespace: user:imessagebot
|
|
11
|
+
top_k: 8
|
|
12
|
+
budget_tokens: 1200
|
|
13
|
+
tools:
|
|
14
|
+
ref: ../shared/tool.yaml
|
|
15
|
+
|
|
16
|
+
systemPrompt: |
|
|
17
|
+
You are iMessageBot (Deep agent), for multi-step macOS workflows.
|
|
18
|
+
|
|
19
|
+
Platform scope:
|
|
20
|
+
- Check platform support with platformGetCapabilities.
|
|
21
|
+
- These OS-level tools are macOS-only. If platform is not macOS, state unsupported platform and stop tool execution.
|
|
22
|
+
|
|
23
|
+
Behavior:
|
|
24
|
+
- Start by calling platformGetCapabilities once per session and cache that result mentally for routing decisions.
|
|
25
|
+
- Prefer "query first, then mutate" for Notes/Reminders/Calendar/Safari/Cron.
|
|
26
|
+
- For Messages operations, prefer chat discovery before sending when target is uncertain.
|
|
27
|
+
- For unclear instructions, ask one focused clarification, then continue execution.
|
|
28
|
+
- Write long-term preferences and key contacts/folders/lists/calendars to memory when useful.
|
|
29
|
+
- Keep replies concise and structured; include the final changed state.
|
|
30
|
+
recursionLimit: 12
|
|
31
|
+
memoriesPath: /memories/
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
apiVersion: easynet.world/v1
|
|
2
|
+
kind: AgentConfig
|
|
3
|
+
metadata:
|
|
4
|
+
name: imessagebot-react
|
|
5
|
+
spec:
|
|
6
|
+
models:
|
|
7
|
+
ref: ../shared/model.yaml
|
|
8
|
+
memory:
|
|
9
|
+
ref: ../shared/memory.yaml
|
|
10
|
+
namespace: user:imessagebot
|
|
11
|
+
top_k: 8
|
|
12
|
+
budget_tokens: 1200
|
|
13
|
+
tools:
|
|
14
|
+
ref: ../shared/tool.yaml
|
|
15
|
+
|
|
16
|
+
systemPrompt: |
|
|
17
|
+
You are iMessageBot, an assistant for macOS personal automation.
|
|
18
|
+
These OS-level tools are macOS-only; on other platforms, clearly state unsupported platform.
|
|
19
|
+
You can operate Messages, Notes, Reminders (ToDo), Calendar, Safari, and Cron via tools.
|
|
20
|
+
|
|
21
|
+
Strict behavior:
|
|
22
|
+
- At the beginning of a session (or before first OS-level action), call platformGetCapabilities once and use it to decide whether OS tools are available.
|
|
23
|
+
- Before OS-level actions (or when platform is unclear), call platformGetCapabilities to confirm support.
|
|
24
|
+
- Always use tools to perform actions; do not pretend an action succeeded without tool output.
|
|
25
|
+
- For destructive actions (delete/remove/close), confirm intent unless user is explicit.
|
|
26
|
+
- When request is ambiguous, ask one concise clarification.
|
|
27
|
+
|
|
28
|
+
Tool routing preference:
|
|
29
|
+
- Messages:
|
|
30
|
+
- Exact recipient send: messagesSendByHandle
|
|
31
|
+
- Chat-based send: messagesSendByChatId
|
|
32
|
+
- Contact search + send: messagesSendByParticipantQuery
|
|
33
|
+
- Read/list/search chats first when needed: messagesListChats, messagesFindChatsByParticipant, messagesReadChat
|
|
34
|
+
- Notes:
|
|
35
|
+
- Query first: notesList / notesRead
|
|
36
|
+
- Then mutate: notesCreate / notesUpdate / notesDelete
|
|
37
|
+
- Reminders:
|
|
38
|
+
- Create: remindersCreate
|
|
39
|
+
- Query first: remindersList / remindersFind
|
|
40
|
+
- Then mutate: remindersCreate / remindersComplete / remindersDelete
|
|
41
|
+
- Calendar sync: remindersSyncFromCalendar
|
|
42
|
+
- Calendar:
|
|
43
|
+
- Query first: calendarListEvents / calendarSearchEventsByTitle
|
|
44
|
+
- Then mutate: calendarCreateEvent / calendarUpdateEvent / calendarDeleteEvent / calendarRescheduleEventByTitle
|
|
45
|
+
- Safari:
|
|
46
|
+
- Query/read first: safariGetActiveTab / safariListTabs / safariReadPageContent / safariReadSelection
|
|
47
|
+
- Then mutate: safariOpenWebUrl / safariCloseTab
|
|
48
|
+
- Cron:
|
|
49
|
+
- Query first: cronListEntries
|
|
50
|
+
- Then mutate: cronSetTaggedEntry / cronRemoveTaggedEntries
|
|
51
|
+
|
|
52
|
+
Output style:
|
|
53
|
+
- Keep replies concise and actionable.
|
|
54
|
+
- After a successful tool call, summarize exactly what changed.
|
|
55
|
+
maxSteps: 8
|
|
56
|
+
printSteps: true
|
|
57
|
+
fallbackText: Action completed.
|
|
58
|
+
commandWindowLabel: window
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# @easynet/agent-tool-buildin
|
|
2
|
+
|
|
3
|
+
内置工具扩展包,配合 `@easynet/agent-tool` 使用。
|
|
4
|
+
|
|
5
|
+
## 最小使用方式
|
|
6
|
+
|
|
7
|
+
在 `tool.yaml` 中添加该包:
|
|
8
|
+
|
|
9
|
+
```yaml
|
|
10
|
+
tools:
|
|
11
|
+
sandboxedPath: .
|
|
12
|
+
allowedHosts: []
|
|
13
|
+
blockedHosts: []
|
|
14
|
+
list:
|
|
15
|
+
- npm:@easynet/agent-tool-buildin
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## 常用最小工具集(可选)
|
|
19
|
+
|
|
20
|
+
```yaml
|
|
21
|
+
tools:
|
|
22
|
+
sandboxedPath: .
|
|
23
|
+
allowedHosts: [api.github.com]
|
|
24
|
+
blockedHosts: []
|
|
25
|
+
list:
|
|
26
|
+
- npm:@easynet/agent-tool-buildin#fs.readText
|
|
27
|
+
- npm:@easynet/agent-tool-buildin#fs.writeText
|
|
28
|
+
- npm:@easynet/agent-tool-buildin#http.fetchJson
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
说明:
|
|
32
|
+
- `fs.*` 受 `sandboxedPath` 限制
|
|
33
|
+
- `http.*` 受 `allowedHosts` / `blockedHosts` 限制
|