@jangts/agent-core 0.1.0 → 0.1.1
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
CHANGED
|
@@ -1,5 +1,64 @@
|
|
|
1
|
+
[English](#english) | [中文](#中文)
|
|
2
|
+
|
|
3
|
+
<a id="english"></a>
|
|
4
|
+
|
|
5
|
+
# @jangts/agent-core
|
|
6
|
+
|
|
7
|
+
<img src="https://agent-core-docs.pages.jangts.cafe/branding/agent-core-logo.png" alt="Agent Core" width="420">
|
|
8
|
+
|
|
9
|
+
A platform-independent agent runtime with a runtime API, companion Support utilities, and optional Kits. Supports ESM, CommonJS, browsers, and Node.js.
|
|
10
|
+
|
|
11
|
+
[Full developer documentation](https://agent-core-docs.pages.jangts.cafe)
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
npm install @jangts/agent-core
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
A minimal Core call needs only a Provider and raw input. Support is optional:
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { CompatibleModelProvider, ModelRunner } from '@jangts/agent-core';
|
|
21
|
+
|
|
22
|
+
const provider = new CompatibleModelProvider({ config: {
|
|
23
|
+
baseUrl: process.env.AI_BASE_URL!,
|
|
24
|
+
apiKey: process.env.AI_API_KEY!,
|
|
25
|
+
model: process.env.AI_MODEL!,
|
|
26
|
+
} });
|
|
27
|
+
const model = new ModelRunner({ provider });
|
|
28
|
+
const text = (await model.invoke('Hello')).value;
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
This connects to a real Chat Completions-compatible model; the application supplies all three connection settings. See [Basic usage](development/docs/basic-usage.md) to override settings or add tools, context policies, and workflows.
|
|
32
|
+
|
|
33
|
+
- [How it works](development/docs/mechanisms.md): collaboration, tasks, execution flow, model/tool sequences, and an application knowledge-answering example.
|
|
34
|
+
- [Developer guide](development/docs/README.md): new applications, existing project integration, manual and agent-assisted development, knowledge resources, and runtime growth.
|
|
35
|
+
- [API reference](development/docs/api/README.md): examples, parameters, return values, and exceptions.
|
|
36
|
+
- [Complete knowledge-answering example](development/docs/api/knowledge-answering.md): reading sources, context, generation, checking, and template-based delivery.
|
|
37
|
+
|
|
38
|
+
[MockGPT Kit](development/docs/api/mock.md) provides direct mock generation, Provider protocol injection, a minimal Node server, and web text sources through `@jangts/agent-core/mock`, `/mock/node`, and `/mock/web`, without a separate mock dependency import.
|
|
39
|
+
|
|
40
|
+
Import Core and Support from the package root. Import Kits by module, or use the aggregate `/kits` entry point.
|
|
41
|
+
|
|
42
|
+
The package manager installs streaming, mock-gpt, and other runtime dependencies automatically. See [Installation](development/docs/getting-started.md).
|
|
43
|
+
|
|
44
|
+
The `agent-core-app` Skill provides resource preparation and validation tools. See [Agent-assisted development](development/docs/agent-development.md).
|
|
45
|
+
|
|
46
|
+
Regular Workflow nodes assemble, select, trim, or compress context, with replaceable implementations from Support. Core retains generic trust/structure auditing, actual request measurement, budgets, and cancellation guarantees. To retain recent verbatim messages or ongoing task summaries, apply a recommended Support policy to the same configuration and override individual parameters. See [Context nodes](development/docs/api/context-processing.md).
|
|
47
|
+
|
|
48
|
+
Bind fixed model definitions, Workflows, and tools ahead of time, passing only per-request state. Existing request-level Runners can join the same Engine through `bindModelRuntime` and reuse its budget and scope. Applications register `execution.observe.event` to receive execution facts; persistent logging is independently optional.
|
|
49
|
+
|
|
50
|
+
`ModelRunner.sink.output` receives actual generated chunks while preserving call budgets, cancellation, and protocol validation; `invoke` still returns the complete result. Applications can use `Support.createReplyPreview` to register previewable functions and body JSON paths, then send in-progress previews with `Support.streamEvents`. Confirm the final body after business validation, or retract it on failure. Previews cannot serve as authorization, tool execution, or official history. See [Core API](development/docs/api/core.md).
|
|
51
|
+
|
|
52
|
+
In this repository, `npm run test:agent-audit` builds Agent Core and MockGPT and runs logic, security, and performance regressions. Use `-- --repeat=2` for two consecutive rounds or `--no-build` to reuse existing builds. Coverage merges V8 ranges with c8/Istanbul and includes every generated ESM module, including modules not imported by existing tests. Statements, lines, functions, and branches must all reach 100%; uncovered logic fails the audit even if assertions pass. Reports are written to root `.tmp/agent-audit/`. Builds remove stale package output so moved sources cannot leave obsolete modules. Regressions use offline resources, injected ports, and loopback HTTP, without real models or public websites; they do not verify real-model comprehension or decision quality.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
<a id="中文"></a>
|
|
57
|
+
|
|
1
58
|
# @jangts/agent-core
|
|
2
59
|
|
|
60
|
+
<img src="https://agent-core-docs.pages.jangts.cafe/branding/agent-core-logo.png" alt="Agent Core" width="420">
|
|
61
|
+
|
|
3
62
|
平台无关的 Agent 运行库,提供运行 API、配套 Support 与可选 Kit。支持 ESM、CommonJS,以及浏览器/Node 环境。
|
|
4
63
|
|
|
5
64
|
[完整网页开发文档](https://agent-core-docs.pages.jangts.cafe)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jangts/agent-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"description": "Platform-independent agent runtime and configurable modules for evidence, delivery, policies and interactions",
|
|
6
6
|
"homepage": "https://agent-core-docs.pages.jangts.cafe/",
|
|
@@ -251,5 +251,24 @@
|
|
|
251
251
|
},
|
|
252
252
|
"devDependencies": {
|
|
253
253
|
"typescript": "~6.0.2"
|
|
254
|
-
}
|
|
254
|
+
},
|
|
255
|
+
"keywords": [
|
|
256
|
+
"ai",
|
|
257
|
+
"agent",
|
|
258
|
+
"ai-agent",
|
|
259
|
+
"ai-agents",
|
|
260
|
+
"llm",
|
|
261
|
+
"agent-framework",
|
|
262
|
+
"agent-runtime",
|
|
263
|
+
"workflow",
|
|
264
|
+
"tool-calling",
|
|
265
|
+
"function-calling",
|
|
266
|
+
"chat-completions",
|
|
267
|
+
"openai-compatible",
|
|
268
|
+
"context-management",
|
|
269
|
+
"streaming",
|
|
270
|
+
"typescript",
|
|
271
|
+
"nodejs",
|
|
272
|
+
"browser"
|
|
273
|
+
]
|
|
255
274
|
}
|