@agent-native/core 0.52.0 → 0.53.0
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/README.md +41 -95
- package/blueprints/action/crud.md +98 -0
- package/blueprints/channel/discord.md +74 -0
- package/blueprints/provider/stripe.md +87 -0
- package/blueprints/sandbox/docker.md +78 -0
- package/dist/action.d.ts +24 -0
- package/dist/action.d.ts.map +1 -1
- package/dist/action.js +4 -0
- package/dist/action.js.map +1 -1
- package/dist/agent/observational-memory/compactor.d.ts +43 -0
- package/dist/agent/observational-memory/compactor.d.ts.map +1 -0
- package/dist/agent/observational-memory/compactor.js +50 -0
- package/dist/agent/observational-memory/compactor.js.map +1 -0
- package/dist/agent/observational-memory/config.d.ts +37 -0
- package/dist/agent/observational-memory/config.d.ts.map +1 -0
- package/dist/agent/observational-memory/config.js +48 -0
- package/dist/agent/observational-memory/config.js.map +1 -0
- package/dist/agent/observational-memory/index.d.ts +26 -0
- package/dist/agent/observational-memory/index.d.ts.map +1 -0
- package/dist/agent/observational-memory/index.js +25 -0
- package/dist/agent/observational-memory/index.js.map +1 -0
- package/dist/agent/observational-memory/internal-run.d.ts +37 -0
- package/dist/agent/observational-memory/internal-run.d.ts.map +1 -0
- package/dist/agent/observational-memory/internal-run.js +59 -0
- package/dist/agent/observational-memory/internal-run.js.map +1 -0
- package/dist/agent/observational-memory/message-text.d.ts +13 -0
- package/dist/agent/observational-memory/message-text.d.ts.map +1 -0
- package/dist/agent/observational-memory/message-text.js +46 -0
- package/dist/agent/observational-memory/message-text.js.map +1 -0
- package/dist/agent/observational-memory/migrations.d.ts +13 -0
- package/dist/agent/observational-memory/migrations.d.ts.map +1 -0
- package/dist/agent/observational-memory/migrations.js +43 -0
- package/dist/agent/observational-memory/migrations.js.map +1 -0
- package/dist/agent/observational-memory/observer.d.ts +37 -0
- package/dist/agent/observational-memory/observer.d.ts.map +1 -0
- package/dist/agent/observational-memory/observer.js +82 -0
- package/dist/agent/observational-memory/observer.js.map +1 -0
- package/dist/agent/observational-memory/plugin.d.ts +16 -0
- package/dist/agent/observational-memory/plugin.d.ts.map +1 -0
- package/dist/agent/observational-memory/plugin.js +26 -0
- package/dist/agent/observational-memory/plugin.js.map +1 -0
- package/dist/agent/observational-memory/prompts.d.ts +27 -0
- package/dist/agent/observational-memory/prompts.d.ts.map +1 -0
- package/dist/agent/observational-memory/prompts.js +42 -0
- package/dist/agent/observational-memory/prompts.js.map +1 -0
- package/dist/agent/observational-memory/read.d.ts +47 -0
- package/dist/agent/observational-memory/read.d.ts.map +1 -0
- package/dist/agent/observational-memory/read.js +99 -0
- package/dist/agent/observational-memory/read.js.map +1 -0
- package/dist/agent/observational-memory/reflector.d.ts +31 -0
- package/dist/agent/observational-memory/reflector.d.ts.map +1 -0
- package/dist/agent/observational-memory/reflector.js +76 -0
- package/dist/agent/observational-memory/reflector.js.map +1 -0
- package/dist/agent/observational-memory/schema.d.ts +267 -0
- package/dist/agent/observational-memory/schema.d.ts.map +1 -0
- package/dist/agent/observational-memory/schema.js +48 -0
- package/dist/agent/observational-memory/schema.js.map +1 -0
- package/dist/agent/observational-memory/store.d.ts +52 -0
- package/dist/agent/observational-memory/store.d.ts.map +1 -0
- package/dist/agent/observational-memory/store.js +197 -0
- package/dist/agent/observational-memory/store.js.map +1 -0
- package/dist/agent/observational-memory/types.d.ts +61 -0
- package/dist/agent/observational-memory/types.d.ts.map +1 -0
- package/dist/agent/observational-memory/types.js +9 -0
- package/dist/agent/observational-memory/types.js.map +1 -0
- package/dist/agent/production-agent.d.ts +15 -0
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +240 -1
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/run-loop-with-resume.d.ts.map +1 -1
- package/dist/agent/run-loop-with-resume.js +49 -0
- package/dist/agent/run-loop-with-resume.js.map +1 -1
- package/dist/agent/run-store.d.ts +17 -0
- package/dist/agent/run-store.d.ts.map +1 -1
- package/dist/agent/run-store.js +55 -0
- package/dist/agent/run-store.js.map +1 -1
- package/dist/agent/runtime-context.d.ts +30 -0
- package/dist/agent/runtime-context.d.ts.map +1 -1
- package/dist/agent/runtime-context.js +54 -1
- package/dist/agent/runtime-context.js.map +1 -1
- package/dist/agent/tool-call-journal.d.ts +101 -0
- package/dist/agent/tool-call-journal.d.ts.map +1 -0
- package/dist/agent/tool-call-journal.js +214 -0
- package/dist/agent/tool-call-journal.js.map +1 -0
- package/dist/agent/types.d.ts +24 -0
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/types.js.map +1 -1
- package/dist/cli/add.d.ts +109 -0
- package/dist/cli/add.d.ts.map +1 -0
- package/dist/cli/add.js +352 -0
- package/dist/cli/add.js.map +1 -0
- package/dist/cli/connect.d.ts +2 -2
- package/dist/cli/connect.d.ts.map +1 -1
- package/dist/cli/connect.js +92 -24
- package/dist/cli/connect.js.map +1 -1
- package/dist/cli/eval.d.ts +17 -0
- package/dist/cli/eval.d.ts.map +1 -0
- package/dist/cli/eval.js +121 -0
- package/dist/cli/eval.js.map +1 -0
- package/dist/cli/index.js +44 -3
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/mcp.d.ts.map +1 -1
- package/dist/cli/mcp.js +11 -5
- package/dist/cli/mcp.js.map +1 -1
- package/dist/cli/plan-local.d.ts +66 -5
- package/dist/cli/plan-local.d.ts.map +1 -1
- package/dist/cli/plan-local.js +495 -19
- package/dist/cli/plan-local.js.map +1 -1
- package/dist/cli/skills.d.ts +2 -2
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +70 -59
- package/dist/cli/skills.js.map +1 -1
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +118 -92
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/agent-chat-adapter.d.ts.map +1 -1
- package/dist/client/agent-chat-adapter.js +16 -0
- package/dist/client/agent-chat-adapter.js.map +1 -1
- package/dist/client/chat/tool-call-display.d.ts +20 -1
- package/dist/client/chat/tool-call-display.d.ts.map +1 -1
- package/dist/client/chat/tool-call-display.js +32 -7
- package/dist/client/chat/tool-call-display.js.map +1 -1
- package/dist/client/sse-event-processor.d.ts +13 -0
- package/dist/client/sse-event-processor.d.ts.map +1 -1
- package/dist/client/sse-event-processor.js +21 -0
- package/dist/client/sse-event-processor.js.map +1 -1
- package/dist/db/client.d.ts +4 -2
- package/dist/db/client.d.ts.map +1 -1
- package/dist/db/client.js +6 -4
- package/dist/db/client.js.map +1 -1
- package/dist/deploy/route-discovery.d.ts.map +1 -1
- package/dist/deploy/route-discovery.js +1 -0
- package/dist/deploy/route-discovery.js.map +1 -1
- package/dist/eval/agent-runner.d.ts +63 -0
- package/dist/eval/agent-runner.d.ts.map +1 -0
- package/dist/eval/agent-runner.js +142 -0
- package/dist/eval/agent-runner.js.map +1 -0
- package/dist/eval/define-eval.d.ts +29 -0
- package/dist/eval/define-eval.d.ts.map +1 -0
- package/dist/eval/define-eval.js +43 -0
- package/dist/eval/define-eval.js.map +1 -0
- package/dist/eval/index.d.ts +18 -0
- package/dist/eval/index.d.ts.map +1 -0
- package/dist/eval/index.js +17 -0
- package/dist/eval/index.js.map +1 -0
- package/dist/eval/report.d.ts +8 -0
- package/dist/eval/report.d.ts.map +1 -0
- package/dist/eval/report.js +44 -0
- package/dist/eval/report.js.map +1 -0
- package/dist/eval/runner.d.ts +67 -0
- package/dist/eval/runner.d.ts.map +1 -0
- package/dist/eval/runner.js +256 -0
- package/dist/eval/runner.js.map +1 -0
- package/dist/eval/scorer.d.ts +83 -0
- package/dist/eval/scorer.d.ts.map +1 -0
- package/dist/eval/scorer.js +195 -0
- package/dist/eval/scorer.js.map +1 -0
- package/dist/eval/types.d.ts +162 -0
- package/dist/eval/types.d.ts.map +1 -0
- package/dist/eval/types.js +20 -0
- package/dist/eval/types.js.map +1 -0
- package/dist/observability/traces.d.ts.map +1 -1
- package/dist/observability/traces.js +100 -1
- package/dist/observability/traces.js.map +1 -1
- package/dist/observability/tracing.d.ts +73 -0
- package/dist/observability/tracing.d.ts.map +1 -0
- package/dist/observability/tracing.js +126 -0
- package/dist/observability/tracing.js.map +1 -0
- package/dist/onboarding/default-steps.d.ts.map +1 -1
- package/dist/onboarding/default-steps.js +4 -1
- package/dist/onboarding/default-steps.js.map +1 -1
- package/dist/provider-api/actions/query-staged-dataset.d.ts +1 -1
- package/dist/scripts/agent-engines/list-agent-engines.d.ts.map +1 -1
- package/dist/scripts/agent-engines/list-agent-engines.js +10 -3
- package/dist/scripts/agent-engines/list-agent-engines.js.map +1 -1
- package/dist/server/action-discovery.d.ts.map +1 -1
- package/dist/server/action-discovery.js +4 -0
- package/dist/server/action-discovery.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts +9 -0
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +118 -110
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/agent-teams.d.ts +62 -0
- package/dist/server/agent-teams.d.ts.map +1 -1
- package/dist/server/agent-teams.js +99 -2
- package/dist/server/agent-teams.js.map +1 -1
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +7 -4
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/credential-provider.d.ts.map +1 -1
- package/dist/server/credential-provider.js +2 -0
- package/dist/server/credential-provider.js.map +1 -1
- package/dist/server/framework-request-handler.d.ts.map +1 -1
- package/dist/server/framework-request-handler.js +33 -1
- package/dist/server/framework-request-handler.js.map +1 -1
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +1 -0
- package/dist/server/index.js.map +1 -1
- package/dist/templates/workspace-core/.agents/skills/external-agents/SKILL.md +10 -0
- package/dist/templates/workspace-core/.agents/skills/harness-agents/SKILL.md +20 -0
- package/dist/templates/workspace-core/.agents/skills/observability/SKILL.md +20 -0
- package/docs/content/agent-teams.md +32 -0
- package/docs/content/blueprint-installer.md +73 -0
- package/docs/content/evals.md +141 -0
- package/docs/content/pr-visual-recap.md +7 -4
- package/docs/content/sandbox-adapters.md +134 -0
- package/docs/content/template-plan.md +20 -8
- package/package.json +5 -1
- package/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +10 -0
- package/src/templates/workspace-core/.agents/skills/harness-agents/SKILL.md +20 -0
- package/src/templates/workspace-core/.agents/skills/observability/SKILL.md +20 -0
|
@@ -180,22 +180,34 @@ or set the convention for your agent environment:
|
|
|
180
180
|
export AGENT_NATIVE_PLANS_MODE=local-files
|
|
181
181
|
```
|
|
182
182
|
|
|
183
|
-
In this mode the agent writes a local MDX folder
|
|
184
|
-
|
|
183
|
+
In this mode the agent writes a local MDX folder and must not call the hosted
|
|
184
|
+
Plan MCP tools. Use a repo folder such as `plans/<slug>/` when you want the plan
|
|
185
|
+
checked in with the code. Use a temp or ignored folder, such as
|
|
186
|
+
`/tmp/agent-native-plans/<slug>/` or `.agent-native/plans/<slug>/`, when the
|
|
187
|
+
plan should stay out of git. The folder contains:
|
|
185
188
|
|
|
186
189
|
- `plan.mdx`
|
|
187
190
|
- optional `canvas.mdx`
|
|
188
191
|
- optional `prototype.mdx`
|
|
189
192
|
- optional `.plan-state.json`
|
|
190
193
|
|
|
191
|
-
After writing the folder, the agent
|
|
194
|
+
After writing the folder, the agent starts a tiny localhost bridge and opens the
|
|
195
|
+
hosted Plan UI against that local-only source:
|
|
192
196
|
|
|
193
197
|
```bash
|
|
194
|
-
npx @agent-native/core@latest plan local
|
|
198
|
+
npx @agent-native/core@latest plan local serve --dir plans/<slug> --kind plan --open
|
|
195
199
|
```
|
|
196
200
|
|
|
197
|
-
|
|
198
|
-
|
|
201
|
+
The bridge URL looks like
|
|
202
|
+
`https://plan.agent-native.com/local-plans/<slug>?bridge=http://127.0.0.1:...`.
|
|
203
|
+
The page is the normal Plan viewer, but the browser fetches `plan.mdx`,
|
|
204
|
+
`canvas.mdx`, `prototype.mdx`, `.plan-state.json`, and local image assets from
|
|
205
|
+
the localhost bridge. Plan content is not written to the hosted database and is
|
|
206
|
+
not sent through hosted Plan actions. Keep the bridge process running while you
|
|
207
|
+
review; the URL is local to your machine and is not a shareable team link.
|
|
208
|
+
|
|
209
|
+
If you run the Plan app locally with the same `PLAN_LOCAL_DIR`, you can also
|
|
210
|
+
open the read-only app route:
|
|
199
211
|
|
|
200
212
|
```text
|
|
201
213
|
http://localhost:<port>/local-plans/<slug>
|
|
@@ -206,8 +218,8 @@ Plan database. It also disables hosted sharing, browser comments, plan history,
|
|
|
206
218
|
and publish/export receipts until you explicitly opt into publishing. To move a
|
|
207
219
|
local plan into the hosted database, call `publish-visual-plan` with the local
|
|
208
220
|
MDX folder path; this uploads the plan, assigns it a hosted ID, enables sharing
|
|
209
|
-
and commenting, and returns the hosted URL.
|
|
210
|
-
|
|
221
|
+
and commenting, and returns the hosted URL. Local-files mode does not
|
|
222
|
+
automatically make your coding agent's LLM local; choose a local or approved
|
|
211
223
|
model if that privacy boundary matters too.
|
|
212
224
|
|
|
213
225
|
## Desktop local file sync {#desktop-local-sync}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.53.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=22"
|
|
@@ -74,6 +74,7 @@
|
|
|
74
74
|
"./agent/context-xray/actions/context-evict": "./dist/agent/context-xray/actions/context-evict.js",
|
|
75
75
|
"./agent/context-xray/actions/context-restore": "./dist/agent/context-xray/actions/context-restore.js",
|
|
76
76
|
"./agent/context-xray/actions/context-report": "./dist/agent/context-xray/actions/context-report.js",
|
|
77
|
+
"./agent/observational-memory": "./dist/agent/observational-memory/index.js",
|
|
77
78
|
"./resources": "./dist/resources/index.js",
|
|
78
79
|
"./resources/store": "./dist/resources/store.js",
|
|
79
80
|
"./resources/metadata": "./dist/resources/metadata.js",
|
|
@@ -135,6 +136,7 @@
|
|
|
135
136
|
"./styles/agent-native.css": "./dist/styles/agent-native.css",
|
|
136
137
|
"./agent/engine": "./dist/agent/engine/index.js",
|
|
137
138
|
"./agent/harness": "./dist/agent/harness/index.js",
|
|
139
|
+
"./eval": "./dist/eval/index.js",
|
|
138
140
|
"./tsconfig.base.json": "./tsconfig.base.json"
|
|
139
141
|
},
|
|
140
142
|
"sideEffects": [
|
|
@@ -142,6 +144,7 @@
|
|
|
142
144
|
],
|
|
143
145
|
"files": [
|
|
144
146
|
"bin",
|
|
147
|
+
"blueprints",
|
|
145
148
|
"dist",
|
|
146
149
|
"docs",
|
|
147
150
|
"tsconfig.base.json",
|
|
@@ -264,6 +267,7 @@
|
|
|
264
267
|
"ws": ">=8"
|
|
265
268
|
},
|
|
266
269
|
"optionalDependencies": {
|
|
270
|
+
"@opentelemetry/api": "^1.9.1",
|
|
267
271
|
"playwright": "^1.60.0"
|
|
268
272
|
},
|
|
269
273
|
"peerDependenciesMeta": {
|
|
@@ -416,3 +416,13 @@ before telling the user they are unauthenticated.
|
|
|
416
416
|
- **a2a-protocol** — the `ask-agent` meta-tool and JSON-RPC peer calls
|
|
417
417
|
- **adding-a-feature** — the four-area checklist (add a `link` builder when a
|
|
418
418
|
feature produces a navigable resource)
|
|
419
|
+
|
|
420
|
+
## Blueprint installer
|
|
421
|
+
|
|
422
|
+
To add a whole new integration the agent-native way, `agent-native add <kind>
|
|
423
|
+
<name|url>` prints a curated Markdown blueprint to stdout — pipe it into the
|
|
424
|
+
external coding agent you connected (`agent-native add provider stripe |
|
|
425
|
+
claude`) and it applies the changes against the live repo. A URL emits a
|
|
426
|
+
generic research-and-integrate blueprint instead. Seeded kinds:
|
|
427
|
+
`provider` / `channel` / `sandbox` / `action`. Add your own by dropping a
|
|
428
|
+
`.md` in `packages/core/blueprints/<kind>/`. See the Blueprint Installer doc.
|
|
@@ -80,6 +80,26 @@ existing run routes as `goalId=agent-harness`.
|
|
|
80
80
|
Preserve `defineAction` auth, request context, timeouts, truncation, and
|
|
81
81
|
read-only metadata.
|
|
82
82
|
|
|
83
|
+
## Code Execution Sandbox
|
|
84
|
+
|
|
85
|
+
- The `run-code` tool executes through a pluggable `SandboxAdapter`
|
|
86
|
+
(`packages/core/src/coding-tools/sandbox/`). The default
|
|
87
|
+
`LocalChildProcessAdapter` spawns a locked-down local Node child process;
|
|
88
|
+
swap it via `AGENT_NATIVE_SANDBOX` or `registerSandboxAdapter()` for a
|
|
89
|
+
Docker/remote/durable backend (the lever to exceed the hosted ~40s code-exec
|
|
90
|
+
ceiling). An adapter only runs the already-prepared, non-secret module source
|
|
91
|
+
— it never sees app secrets. See the Sandbox Adapters doc; `agent-native add
|
|
92
|
+
sandbox docker` emits a full Docker-adapter recipe.
|
|
93
|
+
|
|
94
|
+
## Sub-Agent Delegation Depth
|
|
95
|
+
|
|
96
|
+
- Sub-agent spawning is capped server-side (default depth `2`) so delegation
|
|
97
|
+
chains can't fan out indefinitely. Override at deploy time with
|
|
98
|
+
`AGENT_NATIVE_MAX_SUBAGENT_DEPTH` (`0` disables sub-agents; clamped to `16`).
|
|
99
|
+
Enforcement is ambient via `evaluateSubagentDepth` in
|
|
100
|
+
`packages/core/src/server/agent-teams.ts` — independent of any tool-level
|
|
101
|
+
guard. See the Agent Teams doc for the depth model.
|
|
102
|
+
|
|
83
103
|
## Don't
|
|
84
104
|
|
|
85
105
|
- Don't add Claude Code, Codex, Cursor, Mastra, or Pi as an `AgentEngine`.
|
|
@@ -75,6 +75,26 @@ const criteria: EvalCriteria = {
|
|
|
75
75
|
};
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
+
#### Evals (CI gate)
|
|
79
|
+
|
|
80
|
+
The three layers above score *real production runs* after the fact. For an active, deterministic gate, use the first-class `*.eval.ts` primitive from `@agent-native/core/eval` (source: `packages/core/src/eval/*`). It runs the actual agent loop against fixed inputs and exits non-zero below threshold, so it gates CI/deploys.
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
// evals/faq.eval.ts
|
|
84
|
+
import { defineEval, contains, llmJudge } from "@agent-native/core/eval";
|
|
85
|
+
|
|
86
|
+
export default defineEval({
|
|
87
|
+
name: "answers the FAQ",
|
|
88
|
+
input: { prompt: "What is your return policy?" },
|
|
89
|
+
threshold: 0.7,
|
|
90
|
+
scorers: [contains("30 days"), llmJudge({ criteria: "accuracy" })],
|
|
91
|
+
});
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
- Built-in scorers: `exactMatch` / `contains` / `usesTool` (pure JS) and `llmJudge` (provider-agnostic judge).
|
|
95
|
+
- Custom scorers: `createScorer` with the 4-step `preprocess → analyze → generateScore → generateReason` pipeline (only `generateScore` is required).
|
|
96
|
+
- Run as a gate: `agent-native eval [pattern] [--json] [--threshold N]` — discovers `**/*.eval.ts` and `evals/*.ts`, runs the agent, and exits non-zero if any eval is below its threshold. An app with no eval files exits `0`. Complements (does not replace) the post-hoc scoring in `evals.ts`. See the Evals doc.
|
|
97
|
+
|
|
78
98
|
### 4. Experiments
|
|
79
99
|
|
|
80
100
|
A/B testing with sticky user-level assignment:
|