@nebutra/agents 1.0.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/AGENTS.md +63 -0
- package/LICENSE +676 -0
- package/README.md +78 -0
- package/package.json +71 -0
- package/src/__tests__/cost-observability.test.ts +172 -0
- package/src/__tests__/fallback-wiring.test.ts +313 -0
- package/src/__tests__/public-api.test.ts +114 -0
- package/src/agent.ts +117 -0
- package/src/context.ts +99 -0
- package/src/env.ts +79 -0
- package/src/fallback.ts +358 -0
- package/src/index.ts +86 -0
- package/src/memory.ts +126 -0
- package/src/observability.ts +102 -0
- package/src/orchestrator.ts +147 -0
- package/src/providers/langchain.ts +28 -0
- package/src/providers/vercel-ai.ts +114 -0
- package/src/router.ts +158 -0
- package/src/sdk/config.ts +73 -0
- package/src/sdk/index.ts +214 -0
- package/src/sdk/models.ts +57 -0
- package/src/sdk/provider.ts +80 -0
- package/src/tenant.ts +52 -0
- package/src/tools.ts +65 -0
- package/src/types.ts +114 -0
- package/tsconfig.json +12 -0
- package/tsup.config.ts +21 -0
package/AGENTS.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# AGENTS.md — packages/agents
|
|
2
|
+
|
|
3
|
+
Execution contract for Nebutra's multi-agent runtime package.
|
|
4
|
+
|
|
5
|
+
## Scope
|
|
6
|
+
|
|
7
|
+
Applies to everything under `packages/ai/agents/`.
|
|
8
|
+
|
|
9
|
+
This package owns agent lifecycle, orchestration, routing, tenant-aware memory,
|
|
10
|
+
built-in tool stubs, and the shared AI SDK wrapper surface exported to the rest
|
|
11
|
+
of the repo. It is the runtime layer for agent execution, not the place for
|
|
12
|
+
app-specific prompts, UI behavior, or direct provider-specific business logic.
|
|
13
|
+
|
|
14
|
+
## Source Of Truth
|
|
15
|
+
|
|
16
|
+
- Public package surface and subpath exports: `package.json`, `src/index.ts`
|
|
17
|
+
- Canonical agent and orchestration contracts: `src/types.ts`
|
|
18
|
+
- Base agent lifecycle, memory loading, usage emission, and billing hook:
|
|
19
|
+
`src/agent.ts`
|
|
20
|
+
- Multi-agent routing, quota checks, chat/pipeline/broadcast semantics:
|
|
21
|
+
`src/orchestrator.ts`, `src/router.ts`, `src/tenant.ts`
|
|
22
|
+
- Built-in tool catalog and current stub behavior: `src/tools.ts`
|
|
23
|
+
- Shared AI SDK wrapper config, model resolution, and provider helpers:
|
|
24
|
+
`src/sdk/`
|
|
25
|
+
- Provider-specific runtime adapters: `src/providers/`
|
|
26
|
+
- Public API coverage for exported surface: `src/__tests__/public-api.test.ts`
|
|
27
|
+
|
|
28
|
+
Treat `README.md` as descriptive only. If docs drift, update the source files
|
|
29
|
+
above instead of preserving outdated examples.
|
|
30
|
+
|
|
31
|
+
## Contract Boundaries
|
|
32
|
+
|
|
33
|
+
- Keep `package.json` exports and `src/index.ts` aligned. Do not ask consumers
|
|
34
|
+
to deep-import internals when a supported subpath export already exists.
|
|
35
|
+
- Treat `src/types.ts` as the canonical contract for agent config, context,
|
|
36
|
+
memory, tool, usage, and orchestration semantics. Tightening these shapes is
|
|
37
|
+
a cross-package compatibility change.
|
|
38
|
+
- Preserve the split between core runtime and provider adapters:
|
|
39
|
+
`src/agent.ts`, `src/orchestrator.ts`, and `src/router.ts` own generic agent
|
|
40
|
+
lifecycle semantics; `src/providers/` and `src/sdk/` own provider-specific
|
|
41
|
+
runtime behavior.
|
|
42
|
+
- Keep quota and usage semantics centralized in `src/tenant.ts` and
|
|
43
|
+
`src/agent.ts`. Do not scatter billing deduction or quota checks into callers.
|
|
44
|
+
- Keep built-in tools honest about current capability. `src/tools.ts` is still
|
|
45
|
+
stub-oriented; do not document or code against live search, RAG, or SQL
|
|
46
|
+
access unless the actual implementation is being added.
|
|
47
|
+
- Memory semantics belong in `src/memory.ts` and the base lifecycle in
|
|
48
|
+
`src/agent.ts`. Do not invent parallel persistence paths in downstream apps.
|
|
49
|
+
|
|
50
|
+
## Generated And Derived Files
|
|
51
|
+
|
|
52
|
+
- Treat future `dist/` output from `tsup` as derived build output.
|
|
53
|
+
- Do not hand-edit temporary runtime logs, cached memory snapshots, or ad hoc
|
|
54
|
+
generated provider metadata.
|
|
55
|
+
- If public runtime behavior changes, update the source files above and rebuild
|
|
56
|
+
rather than patching emitted output.
|
|
57
|
+
|
|
58
|
+
## Validation
|
|
59
|
+
|
|
60
|
+
- Public API, routing, tool, or lifecycle changes:
|
|
61
|
+
`pnpm --filter @nebutra/agents test`
|
|
62
|
+
- Export, type, or provider-surface changes:
|
|
63
|
+
`pnpm --filter @nebutra/agents typecheck`
|