@jangts/agent-core 0.3.5 → 0.5.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/CHANGELOG.md +41 -0
- package/README.md +33 -31
- package/development/docs/README.en.md +2 -2
- package/development/docs/acceptance.en.md +2 -2
- package/development/docs/agent-development.en.md +1 -1
- package/development/docs/api/README.en.md +6 -2
- package/development/docs/api/README.md +4 -0
- package/development/docs/api/configuration-in-workflow.en.md +403 -0
- package/development/docs/api/configuration-in-workflow.md +403 -0
- package/development/docs/api/core.en.md +7 -7
- package/development/docs/api/core.md +6 -6
- package/development/docs/api/decorators.en.md +20 -0
- package/development/docs/api/decorators.md +20 -0
- package/development/docs/api/examples.en.md +1 -1
- package/development/docs/api/examples.md +1 -1
- package/development/docs/api/kits.en.md +22 -4
- package/development/docs/api/kits.md +22 -4
- package/development/docs/api/knowledge-answering.en.md +4 -1
- package/development/docs/api/knowledge-answering.md +4 -1
- package/development/docs/api/mock.en.md +2 -0
- package/development/docs/api/mock.md +2 -0
- package/development/docs/api/observability.en.md +37 -11
- package/development/docs/api/observability.md +64 -11
- package/development/docs/api/reference.en.md +876 -657
- package/development/docs/api/reference.md +662 -508
- package/development/docs/api/support.en.md +55 -9
- package/development/docs/api/support.md +53 -7
- package/development/docs/api/types.en.md +36 -1
- package/development/docs/api/types.md +44 -0
- package/development/docs/api/workflow-views.en.md +64 -0
- package/development/docs/api/workflow-views.md +78 -0
- package/development/docs/api/workflow.en.md +6 -2
- package/development/docs/api/workflow.md +6 -2
- package/development/docs/basic-usage.en.md +1 -1
- package/development/docs/basic-usage.md +1 -1
- package/development/docs/create-app.en.md +1 -1
- package/development/docs/examples/registration/associated.mjs +8 -0
- package/development/docs/examples/registration/independent.mjs +20 -0
- package/development/docs/examples/registration/protocol.mjs +48 -0
- package/development/docs/examples/registration/run.mjs +47 -0
- package/development/docs/examples/registration/tools.mjs +75 -0
- package/development/docs/examples/registration/workflow.mjs +109 -0
- package/development/docs/flows/knowledge-maintenance.en.md +1 -1
- package/development/docs/materials.en.md +1 -1
- package/development/docs/mechanisms.en.md +2 -2
- package/development/docs/mechanisms.md +1 -1
- package/development/docs/operations.en.md +1 -1
- package/development/docs/records.en.md +1 -1
- package/development/docs/registration.en.md +4 -4
- package/development/docs/registration.md +2 -2
- package/development/skills/agent-core-app/SKILL.md +16 -4
- package/development/skills/agent-core-app/templates/node-ts/README.md.tpl +1 -1
- package/development/skills/agent-core-app/templates/node-ts/src/catalog.ts.tpl +2 -2
- package/development/skills/agent-core-app/templates/node-ts/test/app.test.mjs.tpl +1 -1
- package/dist/cjs/capabilities/index.js +5 -12
- package/dist/cjs/capabilities/invocation.js +21 -1
- package/dist/cjs/capabilities/model.js +56 -12
- package/dist/cjs/capabilities/tool-conditions.js +65 -0
- package/dist/cjs/capabilities/tool-runtime.js +18 -4
- package/dist/cjs/capabilities/tools.js +12 -17
- package/dist/cjs/context/audit.js +5 -8
- package/dist/cjs/context/index.js +3 -4
- package/dist/cjs/diagnostics/index.js +51 -3
- package/dist/cjs/diagnostics/native-sub-flow.js +106 -0
- package/dist/cjs/diagnostics/sub-flow.js +278 -32
- package/dist/cjs/execution/engine.js +3 -2
- package/dist/cjs/execution/events.js +5 -5
- package/dist/cjs/execution/reporting.js +18 -28
- package/dist/cjs/execution/workflow-chain.js +211 -0
- package/dist/cjs/execution/workflow-graph.js +72 -0
- package/dist/cjs/execution/workflow.js +34 -6
- package/dist/cjs/index.js +21 -17
- package/dist/cjs/kits/aggregation.js +17 -14
- package/dist/cjs/kits/answering/checks.js +2 -1
- package/dist/cjs/kits/answering/flow.js +24 -21
- package/dist/cjs/kits/answering/tasks.js +30 -25
- package/dist/cjs/kits/delivery.js +36 -24
- package/dist/cjs/kits/domains/catalog.js +113 -0
- package/dist/cjs/kits/domains/index.js +20 -0
- package/dist/cjs/kits/{intents → domains}/registry.js +77 -31
- package/dist/cjs/kits/{intents → domains}/scopes.js +21 -21
- package/dist/cjs/kits/index.js +14 -13
- package/dist/cjs/kits/knowledge/catalog.js +33 -30
- package/dist/cjs/kits/policies.js +3 -2
- package/dist/cjs/kits/presentation/formats.js +110 -0
- package/dist/cjs/kits/presentation/index.js +10 -5
- package/dist/cjs/kits/presentation/outputs.js +2 -1
- package/dist/cjs/kits/reflection.js +2 -2
- package/dist/cjs/kits/retrieval.js +7 -1
- package/dist/cjs/kits/text-blocks.js +101 -0
- package/dist/cjs/kits/tools.js +247 -158
- package/dist/cjs/model/decision-retry.js +2 -1
- package/dist/cjs/model/index.js +2 -6
- package/dist/cjs/model/interactions/calls.js +61 -0
- package/dist/cjs/model/interactions/json-object.js +11 -11
- package/dist/cjs/model/interactions/native-functions.js +17 -23
- package/dist/cjs/model/message-diagnostics.js +13 -3
- package/dist/cjs/model/options.js +2 -0
- package/dist/cjs/model/preparation.js +39 -6
- package/dist/cjs/model/runner.js +34 -5
- package/dist/cjs/model/selection-transport.js +4 -4
- package/dist/cjs/model/token-budget.js +3 -0
- package/dist/cjs/model/transports.js +3 -2
- package/dist/cjs/structs/index.js +7 -6
- package/dist/cjs/structs/kits/domains/scopes.js +2 -0
- package/dist/cjs/structs/kits/presentation/formats.js +2 -0
- package/dist/cjs/structs/kits/text-blocks.js +11 -0
- package/dist/cjs/structs/model/session.js +11 -0
- package/dist/cjs/structs/support/associations.js +2 -0
- package/dist/cjs/support/associations.js +79 -0
- package/dist/cjs/support/context/nodes.js +48 -45
- package/dist/cjs/support/context/processing.js +6 -3
- package/dist/cjs/support/context/snapshot.js +11 -1
- package/dist/cjs/support/decorators/index.js +45 -3
- package/dist/cjs/support/index.js +1 -0
- package/dist/cjs/support/model/capabilities.js +35 -5
- package/dist/cjs/support/model/chat-completions.js +11 -2
- package/dist/cjs/support/model/completion/calls.js +10 -56
- package/dist/cjs/support/model/preview-rules.js +11 -11
- package/dist/cjs/support/model/reply-preview.js +3 -3
- package/dist/cjs/support/model/session.js +152 -0
- package/dist/cjs/support/model/stage-transport.js +8 -8
- package/dist/cjs/support/model/transports.js +5 -2
- package/dist/cjs/support/tools.js +42 -17
- package/dist/cjs/utils/invocation.js +1 -0
- package/dist/esm/capabilities/index.d.ts +5 -10
- package/dist/esm/capabilities/index.js +5 -9
- package/dist/esm/capabilities/invocation.js +21 -1
- package/dist/esm/capabilities/model.d.ts +17 -13
- package/dist/esm/capabilities/model.js +54 -10
- package/dist/esm/capabilities/tool-conditions.d.ts +9 -0
- package/dist/esm/capabilities/tool-conditions.js +59 -0
- package/dist/esm/capabilities/tool-runtime.js +18 -4
- package/dist/esm/capabilities/tools.d.ts +3 -3
- package/dist/esm/capabilities/tools.js +12 -17
- package/dist/esm/context/audit.js +5 -8
- package/dist/esm/context/index.d.ts +3 -4
- package/dist/esm/context/index.js +3 -4
- package/dist/esm/diagnostics/index.d.ts +1 -0
- package/dist/esm/diagnostics/index.js +48 -2
- package/dist/esm/diagnostics/native-sub-flow.d.ts +94 -0
- package/dist/esm/diagnostics/native-sub-flow.js +101 -0
- package/dist/esm/diagnostics/sub-flow.d.ts +56 -4
- package/dist/esm/diagnostics/sub-flow.js +271 -32
- package/dist/esm/execution/engine.d.ts +1 -0
- package/dist/esm/execution/engine.js +3 -2
- package/dist/esm/execution/events.js +5 -5
- package/dist/esm/execution/reporting.d.ts +6 -12
- package/dist/esm/execution/reporting.js +19 -29
- package/dist/esm/execution/workflow-chain.d.ts +3 -0
- package/dist/esm/execution/workflow-chain.js +208 -0
- package/dist/esm/execution/workflow-graph.d.ts +7 -0
- package/dist/esm/execution/workflow-graph.js +68 -0
- package/dist/esm/execution/workflow.d.ts +6 -0
- package/dist/esm/execution/workflow.js +34 -6
- package/dist/esm/index.d.ts +19 -13
- package/dist/esm/index.js +18 -15
- package/dist/esm/kits/aggregation.d.ts +1 -1
- package/dist/esm/kits/aggregation.js +17 -14
- package/dist/esm/kits/answering/checks.js +2 -1
- package/dist/esm/kits/answering/flow.js +24 -21
- package/dist/esm/kits/answering/tasks.d.ts +6 -6
- package/dist/esm/kits/answering/tasks.js +30 -25
- package/dist/esm/kits/delivery.d.ts +0 -9
- package/dist/esm/kits/delivery.js +36 -24
- package/dist/esm/kits/domains/catalog.d.ts +42 -0
- package/dist/esm/kits/domains/catalog.js +110 -0
- package/dist/esm/kits/domains/index.d.ts +4 -0
- package/dist/esm/kits/domains/index.js +4 -0
- package/dist/esm/kits/domains/registry.d.ts +100 -0
- package/dist/esm/kits/{intents → domains}/registry.js +77 -31
- package/dist/esm/kits/{intents → domains}/scopes.d.ts +18 -18
- package/dist/esm/kits/{intents → domains}/scopes.js +21 -21
- package/dist/esm/kits/index.d.ts +6 -5
- package/dist/esm/kits/index.js +6 -5
- package/dist/esm/kits/knowledge/catalog.js +33 -30
- package/dist/esm/kits/policies.d.ts +1 -1
- package/dist/esm/kits/policies.js +3 -2
- package/dist/esm/kits/presentation/formats.d.ts +42 -0
- package/dist/esm/kits/presentation/formats.js +105 -0
- package/dist/esm/kits/presentation/index.d.ts +14 -5
- package/dist/esm/kits/presentation/index.js +10 -5
- package/dist/esm/kits/presentation/outputs.js +2 -1
- package/dist/esm/kits/reflection.js +3 -3
- package/dist/esm/kits/retrieval.js +7 -1
- package/dist/esm/kits/text-blocks.d.ts +24 -0
- package/dist/esm/kits/text-blocks.js +97 -0
- package/dist/esm/kits/tools.d.ts +69 -52
- package/dist/esm/kits/tools.js +247 -158
- package/dist/esm/model/decision-retry.d.ts +2 -0
- package/dist/esm/model/decision-retry.js +2 -1
- package/dist/esm/model/index.d.ts +2 -6
- package/dist/esm/model/index.js +2 -6
- package/dist/esm/model/interactions/calls.d.ts +40 -0
- package/dist/esm/model/interactions/calls.js +58 -0
- package/dist/esm/model/interactions/json-object.js +11 -11
- package/dist/esm/model/interactions/native-functions.js +17 -23
- package/dist/esm/model/message-diagnostics.d.ts +6 -5
- package/dist/esm/model/message-diagnostics.js +13 -3
- package/dist/esm/model/options.js +2 -0
- package/dist/esm/model/preparation.js +39 -6
- package/dist/esm/model/runner.d.ts +2 -0
- package/dist/esm/model/runner.js +34 -5
- package/dist/esm/model/selection-transport.js +4 -4
- package/dist/esm/model/token-budget.js +3 -0
- package/dist/esm/model/transports.d.ts +2 -1
- package/dist/esm/model/transports.js +3 -2
- package/dist/esm/structs/capabilities/invocation.d.ts +3 -1
- package/dist/esm/structs/capabilities/model.d.ts +42 -11
- package/dist/esm/structs/capabilities/tools.d.ts +16 -7
- package/dist/esm/structs/common.d.ts +3 -1
- package/dist/esm/structs/debug.d.ts +36 -20
- package/dist/esm/structs/execution/workflow-views.d.ts +123 -0
- package/dist/esm/structs/execution/workflow.d.ts +4 -3
- package/dist/esm/structs/index.d.ts +8 -6
- package/dist/esm/structs/index.js +7 -6
- package/dist/esm/structs/kits/answering/tasks.d.ts +2 -2
- package/dist/esm/structs/kits/{intents → domains}/catalog.d.ts +20 -20
- package/dist/esm/structs/kits/{intents → domains}/registry.d.ts +24 -21
- package/dist/esm/structs/kits/{intents → domains}/scopes.d.ts +9 -9
- package/dist/esm/structs/kits/domains/scopes.js +1 -0
- package/dist/esm/structs/kits/presentation/formats.d.ts +42 -0
- package/dist/esm/structs/kits/presentation/formats.js +1 -0
- package/dist/esm/structs/kits/text-blocks.d.ts +25 -0
- package/dist/esm/structs/kits/text-blocks.js +10 -0
- package/dist/esm/structs/kits/tools.d.ts +82 -83
- package/dist/esm/structs/model/interactions.d.ts +18 -11
- package/dist/esm/structs/model/messages.d.ts +34 -2
- package/dist/esm/structs/model/runtime.d.ts +9 -0
- package/dist/esm/structs/model/session.d.ts +29 -0
- package/dist/esm/structs/model/session.js +10 -0
- package/dist/esm/structs/support/associations.d.ts +22 -0
- package/dist/esm/structs/support/associations.js +1 -0
- package/dist/esm/structs/support/model/interactions.d.ts +2 -2
- package/dist/esm/structs/support/model/messages.d.ts +6 -13
- package/dist/esm/structs/support/tools.d.ts +23 -23
- package/dist/esm/support/associations.d.ts +26 -0
- package/dist/esm/support/associations.js +76 -0
- package/dist/esm/support/context/nodes.js +48 -45
- package/dist/esm/support/context/processing.js +6 -3
- package/dist/esm/support/context/snapshot.js +11 -1
- package/dist/esm/support/decorators/index.d.ts +13 -2
- package/dist/esm/support/decorators/index.js +40 -3
- package/dist/esm/support/decorators/pool.d.ts +6 -5
- package/dist/esm/support/decorators/types.d.ts +3 -1
- package/dist/esm/support/index.d.ts +1 -0
- package/dist/esm/support/index.js +1 -0
- package/dist/esm/support/model/capabilities.d.ts +8 -3
- package/dist/esm/support/model/capabilities.js +35 -5
- package/dist/esm/support/model/chat-completions.js +11 -2
- package/dist/esm/support/model/completion/calls.d.ts +6 -34
- package/dist/esm/support/model/completion/calls.js +8 -55
- package/dist/esm/support/model/index.d.ts +1 -1
- package/dist/esm/support/model/preview-rules.d.ts +13 -8
- package/dist/esm/support/model/preview-rules.js +11 -11
- package/dist/esm/support/model/reply-preview.d.ts +2 -2
- package/dist/esm/support/model/reply-preview.js +3 -3
- package/dist/esm/support/model/session.d.ts +61 -0
- package/dist/esm/support/model/session.js +148 -0
- package/dist/esm/support/model/stage-transport.d.ts +1 -1
- package/dist/esm/support/model/stage-transport.js +9 -9
- package/dist/esm/support/model/transports.d.ts +2 -0
- package/dist/esm/support/model/transports.js +2 -1
- package/dist/esm/support/tools.d.ts +11 -3
- package/dist/esm/support/tools.js +43 -18
- package/dist/esm/utils/catalog.d.ts +1 -1
- package/dist/esm/utils/invocation.d.ts +1 -0
- package/dist/esm/utils/invocation.js +1 -0
- package/package.json +20 -6
- package/dist/cjs/execution/index.js +0 -30
- package/dist/cjs/kits/intents/catalog.js +0 -82
- package/dist/cjs/kits/intents/index.js +0 -35
- package/dist/cjs/utils/debug.js +0 -30
- package/dist/esm/execution/index.d.ts +0 -11
- package/dist/esm/execution/index.js +0 -11
- package/dist/esm/kits/intents/catalog.d.ts +0 -39
- package/dist/esm/kits/intents/catalog.js +0 -79
- package/dist/esm/kits/intents/index.d.ts +0 -22
- package/dist/esm/kits/intents/index.js +0 -18
- package/dist/esm/kits/intents/registry.d.ts +0 -88
- package/dist/esm/utils/debug.d.ts +0 -27
- package/dist/esm/utils/debug.js +0 -27
- /package/dist/cjs/structs/{kits/intents/catalog.js → execution/workflow-views.js} +0 -0
- /package/dist/cjs/structs/kits/{intents/registry.js → domains/catalog.js} +0 -0
- /package/dist/cjs/structs/kits/{intents/scopes.js → domains/registry.js} +0 -0
- /package/dist/esm/structs/{kits/intents/catalog.js → execution/workflow-views.js} +0 -0
- /package/dist/esm/structs/kits/{intents/registry.js → domains/catalog.js} +0 -0
- /package/dist/esm/structs/kits/{intents/scopes.js → domains/registry.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,47 @@
|
|
|
2
2
|
|
|
3
3
|
本文件记录 `@jangts/agent-core` 的行为变更。接口合同与使用方式见[API 手册](development/docs/api/README.md)。
|
|
4
4
|
|
|
5
|
+
## 0.5.0
|
|
6
|
+
|
|
7
|
+
- Add the optional `TextBlocks` Kit: structure-aware splitting of long plain text into numbered blocks with source offsets and exact reassembly; paging, search, storage and prompts stay with the App.
|
|
8
|
+
- Reject mutable context fragments whose declared field set changes through a `null` value, and merge tool model fields as own data properties so `__proto__`-like keys cannot rewrite the merged prototype.
|
|
9
|
+
- Keep Kit implementations out of Core barrels: `/context` and the capability registration surface expose Core helpers only, while Kit helpers remain available from `/kits/*` and the documented root convenience surface. Remove the unused execution barrel.
|
|
10
|
+
- Make `@jangts/mock-gpt` an optional peer dependency used only by the `/mock` entries instead of a production dependency; install it explicitly to use those entries.
|
|
11
|
+
- Support native tool threads in Core: `ModelMessage` accepts assistant `toolCalls` and `role: 'tool'` results; preparation preserves and counts them, and `ModelCallTrace.calls` records every completed call while `functionCall` keeps its single-call meaning.
|
|
12
|
+
- Add the opt-in `Support.createSessionModelTransport`: one response may contain prose and several tool calls. The resolved `toolId` / `input` / `problem` fields live in Support; Core only exposes raw `ModelSessionResult`. `nativeFunctionInteraction` and its single-proposal contract remain unchanged.
|
|
13
|
+
- Keep the Core `/model` barrel free of Support implementations; named Support exports remain available from the package root and `/support`.
|
|
14
|
+
- Keep Kits available from the root convenience surface and from `/kits` / `/kits/*` subpaths. Kits remain optional, not restricted; Apps may use whichever entry is convenient.
|
|
15
|
+
- Add `ModelOptions.toolChoice` and `parallelToolCalls`, including `'omit'` for leaving the wire field out; defaults keep `tool_choice: 'required'` and `parallel_tool_calls: false`.
|
|
16
|
+
- Unify model interfaces as ModelTool and ModelToolRegistry; transports use tools / toolIds, selections use toolId, and the JSON adapter uses a name/input envelope. Skip the 0.4 series.
|
|
17
|
+
- Add asIntent discovery metadata and active conditions, with node-owned withIntent(context) and explicit selection. Intent has no independent identity or aggregation registry.
|
|
18
|
+
- Preserve executable, lifecycle, domain-policy and preview extensions. Derive model interfaces from executable tools without parsing business arguments twice; retain authorization, cancellation, budgets and receipts.
|
|
19
|
+
- Add WorkflowTool / WorkflowNode names and separate Intent decorators for classes and methods, with order-independent ESM/CJS metadata. Tool decorators reject inline asIntent.
|
|
20
|
+
- Retain explicit owner-to-tool associations and local provenance without transmitting registration sources to the model. Domain delegates remain allowed sets with optional explicit overrides.
|
|
21
|
+
- Add one optional `lifecycle` block per tool in place of separate invocation and contribution objects, and one optional `delegate` field that claims a dispatch id. The registry keeps a unique `delegateId → tool` index, so `call(next, context)` stays the single dispatch path; `inspect` runs once for every tool and the remaining selected-only hooks run for the tool that owns the decision.
|
|
22
|
+
- Rename request-tool vocabulary to goals across the domain catalog: ports use `goalIds`/`goals`, projections expose `goalCatalog`/`goalDelegates`, and the model catalog returns `availableGoalIds`/`availableGoals`.
|
|
23
|
+
- Name lifecycle dispatch by `lifecycle.id`; `ToolsOptions.invocationId(decision)` selects the handler, `call(next, context)` routes on `next.type`, and the missing-handler factory is `unavailableInvocation(invocationId)`. No `step` field remains in the lifecycle contract.
|
|
24
|
+
|
|
25
|
+
## 0.3.6
|
|
26
|
+
|
|
27
|
+
- Preserve explicit recovery targets from workflow error events as execution-chain transitions linked to the original errorEventId.
|
|
28
|
+
|
|
29
|
+
- Export immutable Workflow topology with toGraph() and observed per-visit execution chains with toChain(runId); keep ordered append-only subflow records and App-owned authorized read sources.
|
|
30
|
+
- Snapshot routes getters exactly once during node registration for execution and graph export.
|
|
31
|
+
|
|
32
|
+
- Shorten registered subnode IDs to node-local kind/definition/ordinal identifiers; retain real call correlation in relatedInvocationId.
|
|
33
|
+
|
|
34
|
+
- Separate arbitrary business type from write/fix operation and add explicit subnodeId grouping.
|
|
35
|
+
- Independent full/scoped logger classes share one owning store and full readAll history. Scoped delegates bind writes, restrict fixes, cannot fork, and cannot invoke; actual invocations bind their existing execution identity.
|
|
36
|
+
- Rejected writes/fixes keep sentinel returns and emit safe, deduplicated developer warnings.
|
|
37
|
+
|
|
38
|
+
- Optional per-call logger for native model/tool/invocation and executable Kit boundaries; omitted loggers add no sub-logs and are never inferred or globally forwarded.
|
|
39
|
+
- Every accepted fix appends an independently identified record referencing the original write through targetStepId; readAll preserves the full write/fix ledger in append order.
|
|
40
|
+
|
|
41
|
+
- Bind each sub-flow logger to its execution context; write/fix commit immutable snapshots immediately to runtime and notify App observers through node.progress.
|
|
42
|
+
- Remove logger submission through report.subs; readAll remains a read-only local query. Terminal events use runtime-owned snapshots and detached visits return write=-1 / fix=false without throwing, while every holder retains readAll access.
|
|
43
|
+
- write returns the new ID on success and -1 on any failure; fix returns a success boolean for every attempt; invalid revisions and detached instances return false without throwing. Retained loggers remain readable across visits or external borrowing.
|
|
44
|
+
- Tool debugSteps hooks write through their bound context and no longer return a logger.
|
|
45
|
+
|
|
5
46
|
## 0.3.5
|
|
6
47
|
|
|
7
48
|
- Add decorators and typescript-decorators keywords for npm discovery; preserve the English-first getting-started README.
|
package/README.md
CHANGED
|
@@ -46,7 +46,7 @@ console.log(await agent.run({ question: 'Hello' }));
|
|
|
46
46
|
|
|
47
47
|
A node returns a state patch. After commit, routes read the updated state: `route.to('next')` continues to another node; `route.deliver('answer')` returns the final result. The first node is the default entry, and routes match in declaration order.
|
|
48
48
|
|
|
49
|
-
The Provider above returns fixed text. Replace it with a real Provider without changing the workflow. The [complete offline example](https://agent-core-docs.pages.jangts.cafe/en/manual/examples/offline-agent) adds tools, multiple nodes and progress observation.
|
|
49
|
+
The Provider above returns fixed text. Replace it with a real Provider without changing the workflow. The [complete offline example](https://agent-core-docs.pages.jangts.cafe/en/manual/examples/offline-agent.html) adds tools, multiple nodes and progress observation.
|
|
50
50
|
|
|
51
51
|
## Connect a real model
|
|
52
52
|
|
|
@@ -89,7 +89,7 @@ export AI_MODEL="your-model-id"
|
|
|
89
89
|
node model.mjs
|
|
90
90
|
```
|
|
91
91
|
|
|
92
|
-
To connect the first workflow, replace its offline provider declaration with `import { provider } from './provider.mjs'`. Model `invoke` returns `{ value, invocation }`; `value` contains the complete result and `invocation` records the call. Failures throw. Configure Runner `sink.output` to consume live chunks while retaining the complete `value`. See [Core model calls](https://agent-core-docs.pages.jangts.cafe/en/manual/api/core).
|
|
92
|
+
To connect the first workflow, replace its offline provider declaration with `import { provider } from './provider.mjs'`. Model `invoke` returns `{ value, invocation }`; `value` contains the complete result and `invocation` records the call. Failures throw. Configure Runner `sink.output` to consume live chunks while retaining the complete `value`. See [Core model calls](https://agent-core-docs.pages.jangts.cafe/en/manual/api/core.html).
|
|
93
93
|
|
|
94
94
|
## Define and execute a tool
|
|
95
95
|
|
|
@@ -127,14 +127,14 @@ console.log(result.value); // 42
|
|
|
127
127
|
|
|
128
128
|
Reuse static tool definitions and bind request dependencies and cancellation with `catalog.bind({ app, execution })`. Successful tool invocation also returns `{ value, invocation }`.
|
|
129
129
|
|
|
130
|
-
To let the model select a tool, append this to `tools.mjs` and use the `provider.mjs` above. The same catalog supplies model
|
|
130
|
+
To let the model select a tool, append this to `tools.mjs` and use the `provider.mjs` above. The same catalog supplies model tools and actual execution:
|
|
131
131
|
|
|
132
132
|
```js
|
|
133
133
|
import { ModelRunner } from '@jangts/agent-core';
|
|
134
134
|
import { provider } from './provider.mjs';
|
|
135
135
|
|
|
136
136
|
const selection = Support.createModelTransport({
|
|
137
|
-
id: 'choose-tool',
|
|
137
|
+
id: 'choose-tool', tools: catalog.tools,
|
|
138
138
|
});
|
|
139
139
|
const runner = new ModelRunner({ provider, transports: [selection], maxCalls: 1 });
|
|
140
140
|
const proposal = await runner.invoke({
|
|
@@ -146,7 +146,7 @@ const executed = await tools.invoke({
|
|
|
146
146
|
console.log(executed.value); // 42
|
|
147
147
|
```
|
|
148
148
|
|
|
149
|
-
The model proposes an id and arguments. `tools.invoke` performs parsing, authorization and business execution. For multi-step behavior, put selection, execution and reply into Workflow nodes using `context.model.invoke` and `context.tools.invoke`. See [model and tool integration](https://agent-core-docs.pages.jangts.cafe/en/manual/basic-usage).
|
|
149
|
+
The model proposes an id and arguments. `tools.invoke` performs parsing, authorization and business execution. For multi-step behavior, put selection, execution and reply into Workflow nodes using `context.model.invoke` and `context.tools.invoke`. See [model and tool integration](https://agent-core-docs.pages.jangts.cafe/en/manual/basic-usage.html).
|
|
150
150
|
|
|
151
151
|
## Organize handlers as classes
|
|
152
152
|
|
|
@@ -183,7 +183,7 @@ Install `npm install -D tsx typescript`, then run `npx tsx greeting.mts`. Existi
|
|
|
183
183
|
- `@tool` and `@fragment` support classes and existing instance methods; method decorators retain the original name and bind the real host. `@workflow`, `@agent` and `@model` define original options without creating Engines or Runners.
|
|
184
184
|
- Getters can organize routes and private helpers. The route table is fixed during assembly; `when/complete` callbacks receive the latest execution state.
|
|
185
185
|
|
|
186
|
-
The [decorator guide](https://agent-core-docs.pages.jangts.cafe/en/manual/api/decorators) covers host binding, namespace reads, multi-namespace registration and instance scope. Object definitions and decorator outputs use the same Core contracts.
|
|
186
|
+
The [decorator guide](https://agent-core-docs.pages.jangts.cafe/en/manual/api/decorators.html) covers host binding, namespace reads, multi-namespace registration and instance scope. Object definitions and decorator outputs use the same Core contracts.
|
|
187
187
|
|
|
188
188
|
## Add knowledge, context and caching
|
|
189
189
|
|
|
@@ -199,24 +199,25 @@ const snapshot = knowledge.read({ documentId: 'manual', selection: { mode: 'docu
|
|
|
199
199
|
console.log(snapshot);
|
|
200
200
|
```
|
|
201
201
|
|
|
202
|
-
App supplies the material; knowledge catalogs handle identity, versions and selection without automatically crawling websites or creating databases. The [knowledge-answering example](https://agent-core-docs.pages.jangts.cafe/en/manual/api/knowledge-answering) connects retrieval, evidence checking, generation, repair and delivery.
|
|
202
|
+
App supplies the material; knowledge catalogs handle identity, versions and selection without automatically crawling websites or creating databases. The [knowledge-answering example](https://agent-core-docs.pages.jangts.cafe/en/manual/api/knowledge-answering.html) connects retrieval, evidence checking, generation, repair and delivery.
|
|
203
203
|
|
|
204
|
-
Workflow `context.cache` provides synchronous Engine-lifetime memory partitioned by node, using `get/has/set/delete/clear`. App-owned asynchronous `context.agentCache` connects longer-lived storage; workflow state remains in state. Ordinary nodes and Support policies handle history selection, trimming and summaries. See [context processing](https://agent-core-docs.pages.jangts.cafe/en/manual/api/context-processing) and [cache contracts](https://agent-core-docs.pages.jangts.cafe/en/manual/api/workflow).
|
|
204
|
+
Workflow `context.cache` provides synchronous Engine-lifetime memory partitioned by node, using `get/has/set/delete/clear`. App-owned asynchronous `context.agentCache` connects longer-lived storage; workflow state remains in state. Ordinary nodes and Support policies handle history selection, trimming and summaries. See [context processing](https://agent-core-docs.pages.jangts.cafe/en/manual/api/context-processing.html) and [cache contracts](https://agent-core-docs.pages.jangts.cafe/en/manual/api/workflow.html).
|
|
205
205
|
|
|
206
206
|
## Continue by task
|
|
207
207
|
|
|
208
208
|
| Task | Documentation |
|
|
209
209
|
| --- | --- |
|
|
210
|
-
| Create an app or integrate with a project | [Developer guide](https://agent-core-docs.pages.jangts.cafe/en/manual/) · [Installation](https://agent-core-docs.pages.jangts.cafe/en/manual/getting-started) |
|
|
211
|
-
| Routes, models, budgets, cancellation and branches | [Workflow](https://agent-core-docs.pages.jangts.cafe/en/manual/api/workflow) · [Core](https://agent-core-docs.pages.jangts.cafe/en/manual/api/core) |
|
|
212
|
-
| Tools, schemas, context and integration policies | [Support](https://agent-core-docs.pages.jangts.cafe/en/manual/api/support) · [Context nodes](https://agent-core-docs.pages.jangts.cafe/en/manual/api/context-processing) |
|
|
213
|
-
| Knowledge, intents, retrieval, artifacts and persistent tasks | [Kits](https://agent-core-docs.pages.jangts.cafe/en/manual/api/kits) · [Recipes](https://agent-core-docs.pages.jangts.cafe/en/recipes/) |
|
|
214
|
-
| Mock model replies, tool proposals, streams and failures | [MockGPT Kit](https://agent-core-docs.pages.jangts.cafe/en/manual/api/mock) |
|
|
215
|
-
| Execution facts, call chains and Journal | [Observability](https://agent-core-docs.pages.jangts.cafe/en/manual/api/observability) |
|
|
216
|
-
|
|
|
210
|
+
| Create an app or integrate with a project | [Developer guide](https://agent-core-docs.pages.jangts.cafe/en/manual/) · [Installation](https://agent-core-docs.pages.jangts.cafe/en/manual/getting-started.html) |
|
|
211
|
+
| Routes, models, budgets, cancellation and branches | [Workflow](https://agent-core-docs.pages.jangts.cafe/en/manual/api/workflow.html) · [Core](https://agent-core-docs.pages.jangts.cafe/en/manual/api/core.html) |
|
|
212
|
+
| Tools, schemas, context and integration policies | [Support](https://agent-core-docs.pages.jangts.cafe/en/manual/api/support.html) · [Context nodes](https://agent-core-docs.pages.jangts.cafe/en/manual/api/context-processing.html) |
|
|
213
|
+
| Knowledge, intents, retrieval, artifacts and persistent tasks | [Kits](https://agent-core-docs.pages.jangts.cafe/en/manual/api/kits.html) · [Recipes](https://agent-core-docs.pages.jangts.cafe/en/recipes/) |
|
|
214
|
+
| Mock model replies, tool proposals, streams and failures | [MockGPT Kit](https://agent-core-docs.pages.jangts.cafe/en/manual/api/mock.html) |
|
|
215
|
+
| Execution facts, call chains and Journal | [Observability](https://agent-core-docs.pages.jangts.cafe/en/manual/api/observability.html) |
|
|
216
|
+
| Export workflow graphs and execution chains for developer views | [Graph and chain API](https://agent-core-docs.pages.jangts.cafe/en/manual/api/workflow-views.html) · [Further reading](https://agent-core-docs.pages.jangts.cafe/en/guide/extended/workflow-views.html) |
|
|
217
|
+
| Integrate with a development agent | [Agent-assisted development and Skill](https://agent-core-docs.pages.jangts.cafe/en/manual/agent-development.html) |
|
|
217
218
|
| Exact signatures, overloads and result types | [API directory](https://agent-core-docs.pages.jangts.cafe/en/api/) · [Local API handbook](development/docs/api/README.en.md) |
|
|
218
219
|
|
|
219
|
-
Import Core and Support from the package root, Kits from `/kits/<name>`, and decorators from `/support/decorators`. App owns identity, business permissions, external effects and storage; Core provides generic runtime guarantees. Support and Kits remain optional.
|
|
220
|
+
Import Core and Support from the package root, Kits from `/kits/<name>`, and decorators from `/support/decorators`. App owns identity, business permissions, external effects and storage; Core provides generic runtime guarantees. Support and Kits remain optional. The `/mock`, `/mock/node` and `/mock/web` entries require installing `@jangts/mock-gpt`, which is an optional peer dependency and is not installed with this package.
|
|
220
221
|
|
|
221
222
|
## License
|
|
222
223
|
|
|
@@ -270,7 +271,7 @@ console.log(await agent.run({ question: 'Hello' }));
|
|
|
270
271
|
|
|
271
272
|
节点的 `run` 返回状态补丁;Engine 提交后,路由读取更新后的状态。`route.to('next')` 跳到下一节点,`route.deliver('answer')` 交付结果并结束。入口默认是首节点。有多个分支时,`routes` 按声明顺序匹配。
|
|
272
273
|
|
|
273
|
-
这份 Provider 只返回固定文本;接入真实模型只需替换 provider,工作流不变。[完整离线示例](https://agent-core-docs.pages.jangts.cafe/zh/manual/examples/offline-agent)进一步展示工具查询、多个节点和过程监听。
|
|
274
|
+
这份 Provider 只返回固定文本;接入真实模型只需替换 provider,工作流不变。[完整离线示例](https://agent-core-docs.pages.jangts.cafe/zh/manual/examples/offline-agent.html)进一步展示工具查询、多个节点和过程监听。
|
|
274
275
|
|
|
275
276
|
## 接入真实模型
|
|
276
277
|
|
|
@@ -313,7 +314,7 @@ export AI_MODEL="your-model-id"
|
|
|
313
314
|
node model.mjs
|
|
314
315
|
```
|
|
315
316
|
|
|
316
|
-
接入首个工作流时,用 `import { provider } from './provider.mjs'` 替换其中的离线 provider 声明即可。模型 `invoke` 返回 `{ value, invocation }`:`value` 是完整结果,`invocation` 是调用记录;失败抛错。需要实时文本时配置 Runner 的 `sink.output`,完整结果仍从 `value` 读取。详见[模型调用](https://agent-core-docs.pages.jangts.cafe/zh/manual/api/core)。
|
|
317
|
+
接入首个工作流时,用 `import { provider } from './provider.mjs'` 替换其中的离线 provider 声明即可。模型 `invoke` 返回 `{ value, invocation }`:`value` 是完整结果,`invocation` 是调用记录;失败抛错。需要实时文本时配置 Runner 的 `sink.output`,完整结果仍从 `value` 读取。详见[模型调用](https://agent-core-docs.pages.jangts.cafe/zh/manual/api/core.html)。
|
|
317
318
|
|
|
318
319
|
## 定义工具并实际执行
|
|
319
320
|
|
|
@@ -358,7 +359,7 @@ import { ModelRunner } from '@jangts/agent-core';
|
|
|
358
359
|
import { provider } from './provider.mjs';
|
|
359
360
|
|
|
360
361
|
const selection = Support.createModelTransport({
|
|
361
|
-
id: 'choose-tool',
|
|
362
|
+
id: 'choose-tool', tools: catalog.tools,
|
|
362
363
|
});
|
|
363
364
|
const runner = new ModelRunner({ provider, transports: [selection], maxCalls: 1 });
|
|
364
365
|
const proposal = await runner.invoke({
|
|
@@ -370,7 +371,7 @@ const executed = await tools.invoke({
|
|
|
370
371
|
console.log(executed.value); // 42
|
|
371
372
|
```
|
|
372
373
|
|
|
373
|
-
模型只提出工具 ID 和参数,`tools.invoke` 才会执行解析、授权与业务操作。需要多步调用时,把选择、执行、回答组织成上面学过的 Workflow 节点,继续使用 `context.model.invoke` 与 `context.tools.invoke`。详见[模型与工具接入](https://agent-core-docs.pages.jangts.cafe/zh/manual/basic-usage)。
|
|
374
|
+
模型只提出工具 ID 和参数,`tools.invoke` 才会执行解析、授权与业务操作。需要多步调用时,把选择、执行、回答组织成上面学过的 Workflow 节点,继续使用 `context.model.invoke` 与 `context.tools.invoke`。详见[模型与工具接入](https://agent-core-docs.pages.jangts.cafe/zh/manual/basic-usage.html)。
|
|
374
375
|
|
|
375
376
|
## 用类组织节点与内部方法
|
|
376
377
|
|
|
@@ -407,7 +408,7 @@ console.log(await new AgentCoreEngine({ workflow }).run({ name: 'Ivan' }));
|
|
|
407
408
|
- `@tool`、`@fragment` 同时支持类和已有实例方法;方法装饰保留原方法名并绑定真实宿主。`@workflow`、`@agent`、`@model` 定义原配置,不创建 Engine 或 Runner。
|
|
408
409
|
- getter 可组织路由及私有辅助方法。路由表在装配时固定,`when/complete` 回调读取运行中的最新 state。
|
|
409
410
|
|
|
410
|
-
[装饰器完整合同与示例](https://agent-core-docs.pages.jangts.cafe/zh/manual/api/decorators)说明方法绑定、命名空间、多空间登记和实例作用域。对象写法与装饰器产物使用相同的 Core 接口。
|
|
411
|
+
[装饰器完整合同与示例](https://agent-core-docs.pages.jangts.cafe/zh/manual/api/decorators.html)说明方法绑定、命名空间、多空间登记和实例作用域。对象写法与装饰器产物使用相同的 Core 接口。
|
|
411
412
|
|
|
412
413
|
## 加入资料、上下文与缓存
|
|
413
414
|
|
|
@@ -423,24 +424,25 @@ const snapshot = knowledge.read({ documentId: 'manual', selection: { mode: 'docu
|
|
|
423
424
|
console.log(snapshot);
|
|
424
425
|
```
|
|
425
426
|
|
|
426
|
-
资料由 App 提供;知识目录负责标识、版本和选择,不自动抓取网站或建立数据库。需要检索、证据检查、生成、修正与交付时,按[知识回答完整示例](https://agent-core-docs.pages.jangts.cafe/zh/manual/api/knowledge-answering)组合。
|
|
427
|
+
资料由 App 提供;知识目录负责标识、版本和选择,不自动抓取网站或建立数据库。需要检索、证据检查、生成、修正与交付时,按[知识回答完整示例](https://agent-core-docs.pages.jangts.cafe/zh/manual/api/knowledge-answering.html)组合。
|
|
427
428
|
|
|
428
|
-
工作流节点的 `context.cache` 提供 Engine 生命周期内、按节点分区的同步缓存,可用 `get/has/set/delete/clear`。长期存储通过 App 提供的异步 `context.agentCache` 接入;工作流状态仍放在 state。历史消息的选择、裁切与摘要通过普通节点和 Support 策略组织,见[上下文处理](https://agent-core-docs.pages.jangts.cafe/zh/manual/api/context-processing)与[缓存合同](https://agent-core-docs.pages.jangts.cafe/zh/manual/api/workflow)。
|
|
429
|
+
工作流节点的 `context.cache` 提供 Engine 生命周期内、按节点分区的同步缓存,可用 `get/has/set/delete/clear`。长期存储通过 App 提供的异步 `context.agentCache` 接入;工作流状态仍放在 state。历史消息的选择、裁切与摘要通过普通节点和 Support 策略组织,见[上下文处理](https://agent-core-docs.pages.jangts.cafe/zh/manual/api/context-processing.html)与[缓存合同](https://agent-core-docs.pages.jangts.cafe/zh/manual/api/workflow.html)。
|
|
429
430
|
|
|
430
431
|
## 按任务继续阅读
|
|
431
432
|
|
|
432
433
|
| 要做什么 | 入口 |
|
|
433
434
|
| --- | --- |
|
|
434
|
-
| 从空项目开始或接入现有应用 | [开发指南](https://agent-core-docs.pages.jangts.cafe/zh/manual/) · [安装与配置](https://agent-core-docs.pages.jangts.cafe/zh/manual/getting-started) |
|
|
435
|
-
| 编排条件路由、多模型、预算、取消和分支 | [Workflow](https://agent-core-docs.pages.jangts.cafe/zh/manual/api/workflow) · [Core](https://agent-core-docs.pages.jangts.cafe/zh/manual/api/core) |
|
|
436
|
-
| 管理工具、schema、上下文与接入策略 | [Support](https://agent-core-docs.pages.jangts.cafe/zh/manual/api/support) · [上下文节点](https://agent-core-docs.pages.jangts.cafe/zh/manual/api/context-processing) |
|
|
437
|
-
| 使用知识、意图、检索、产物和持久任务 | [Kit 手册](https://agent-core-docs.pages.jangts.cafe/zh/manual/api/kits) · [场景示例](https://agent-core-docs.pages.jangts.cafe/zh/recipes/) |
|
|
438
|
-
| 模拟模型、工具提议、流式回复与故障 | [MockGPT Kit](https://agent-core-docs.pages.jangts.cafe/zh/manual/api/mock) |
|
|
439
|
-
| 接收执行事实、记录调用链和 Journal | [观察与日志](https://agent-core-docs.pages.jangts.cafe/zh/manual/api/observability) |
|
|
440
|
-
|
|
|
435
|
+
| 从空项目开始或接入现有应用 | [开发指南](https://agent-core-docs.pages.jangts.cafe/zh/manual/) · [安装与配置](https://agent-core-docs.pages.jangts.cafe/zh/manual/getting-started.html) |
|
|
436
|
+
| 编排条件路由、多模型、预算、取消和分支 | [Workflow](https://agent-core-docs.pages.jangts.cafe/zh/manual/api/workflow.html) · [Core](https://agent-core-docs.pages.jangts.cafe/zh/manual/api/core.html) |
|
|
437
|
+
| 管理工具、schema、上下文与接入策略 | [Support](https://agent-core-docs.pages.jangts.cafe/zh/manual/api/support.html) · [上下文节点](https://agent-core-docs.pages.jangts.cafe/zh/manual/api/context-processing.html) |
|
|
438
|
+
| 使用知识、意图、检索、产物和持久任务 | [Kit 手册](https://agent-core-docs.pages.jangts.cafe/zh/manual/api/kits.html) · [场景示例](https://agent-core-docs.pages.jangts.cafe/zh/recipes/) |
|
|
439
|
+
| 模拟模型、工具提议、流式回复与故障 | [MockGPT Kit](https://agent-core-docs.pages.jangts.cafe/zh/manual/api/mock.html) |
|
|
440
|
+
| 接收执行事实、记录调用链和 Journal | [观察与日志](https://agent-core-docs.pages.jangts.cafe/zh/manual/api/observability.html) |
|
|
441
|
+
| 导出工作流图、执行链并构建开发观测界面 | [图与执行链 API](https://agent-core-docs.pages.jangts.cafe/zh/manual/api/workflow-views.html) · [延伸阅读](https://agent-core-docs.pages.jangts.cafe/zh/guide/extended/workflow-views.html) |
|
|
442
|
+
| 让开发 Agent 辅助接入 SDK | [Agent 辅助开发与 Skill](https://agent-core-docs.pages.jangts.cafe/zh/manual/agent-development.html) |
|
|
441
443
|
| 查精确参数、重载和返回值 | [API 目录](https://agent-core-docs.pages.jangts.cafe/zh/api/) · [本地 API 手册](development/docs/api/README.md) |
|
|
442
444
|
|
|
443
|
-
Core 与 Support 从包根导入,Kit 从 `/kits/<name>` 导入,装饰器从 `/support/decorators` 导入。App 拥有身份、业务权限、外部副作用和存储;Core 提供通用运行保证,Support 与 Kit
|
|
445
|
+
Core 与 Support 从包根导入,Kit 从 `/kits/<name>` 导入,装饰器从 `/support/decorators` 导入。App 拥有身份、业务权限、外部副作用和存储;Core 提供通用运行保证,Support 与 Kit 按需使用。`/mock`、`/mock/node`、`/mock/web` 需要另行安装 `@jangts/mock-gpt`;它是可选 peer 依赖,不会随本包自动安装。
|
|
444
446
|
|
|
445
447
|
## 许可
|
|
446
448
|
|
|
@@ -51,11 +51,11 @@ Names, parameters, and conclusions proposed by the model are not authentication,
|
|
|
51
51
|
- **Basic run**: the Provider's model connection and the actual input. Core provides the default budget, single-call timeout, signals, and plain text transport; override as needed.
|
|
52
52
|
- **When enabling tools**: the business implementation plus the required identity, access control, parameter, and result constraints.
|
|
53
53
|
- **When enabling persistence**: sources, user ownership, storage and retention policy, and failure recovery.
|
|
54
|
-
- **When enabling complex orchestration**: associations among declared nodes, tools, model
|
|
54
|
+
- **When enabling complex orchestration**: associations among declared nodes, tools, model tools, knowledge, checks, and output.
|
|
55
55
|
|
|
56
56
|
No default need to enable long-term memory, user profiles, experience libraries, vector databases, or dynamic tool loading. Deliver a read-only, single-round App with explicit sources first, then integrate each item according to real requirements.
|
|
57
57
|
|
|
58
|
-
## Provided versus still-App-owned
|
|
58
|
+
## Provided versus still-App-owned tools
|
|
59
59
|
|
|
60
60
|
| Provided by the library | Still to be implemented by the App |
|
|
61
61
|
| --- | --- |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[Back to development handbook](README.md) · [API reference](api/README.md)
|
|
4
4
|
|
|
5
|
-
The following are the evidence expected for an integration, chosen by developers according to the
|
|
5
|
+
The following are the evidence expected for an integration, chosen by developers according to the tools actually enabled; they are not a full command suite to run on every change. Review what the source can confirm first, and run the minimum relevant checks when a concrete question exists. Success with an offline stand-in does not prove real model behavior, and being executable by the framework does not prove the business facts are correct.
|
|
6
6
|
|
|
7
7
|
| Boundary | What should be proven | Minimal example |
|
|
8
8
|
| --- | --- | --- |
|
|
@@ -21,7 +21,7 @@ The following are the evidence expected for an integration, chosen by developers
|
|
|
21
21
|
|
|
22
22
|
When long-term memory is chosen, additionally verify message watermarks, concurrent versions, lease recovery, idempotency, deletion propagation, and source priority; if not enabled, these services need not be built. When cross-end operation is chosen, verify the actual peer handler and receipts; not using the Interaction Kit does not prevent integration with Core.
|
|
23
23
|
|
|
24
|
-
When reviewing similar
|
|
24
|
+
When reviewing similar tools, compare horizontally the ordinary loop, Workflow, standalone Runner, tool catalog, hand-written port, and the Kit in use, and confirm the same guarantee is enforced by the actual entry, not only by validating the recommended Support style. For cancellation, check pre-cancellation, mid-flight cancellation, late returns, and cancellation during persistence separately; for input, check illegal budgets, replacement after registration, and mutable references across awaits; for publication, check validity before and after verification and before commit.
|
|
25
25
|
|
|
26
26
|
Cancellation cases should also cover cancellation triggered inside synchronous callbacks such as counters, checkers, and observers, plus multiple processing stages within the same node. A Provider stand-in should record both the ordinary `stream()` method entry and reads through the async iterator, so that tests with only a generator do not mask entering an I/O factory after cancellation. Readers ignoring cancellation, evidence expiring during reading, discovery leaving no partially readable range after a pagination failure, and iterator cleanup exceptions not overwriting the original result all need to be verified against their own boundaries.
|
|
27
27
|
|
|
@@ -14,7 +14,7 @@ After copying, install the maintainer-delivered SDK and its real dependencies in
|
|
|
14
14
|
|
|
15
15
|
For example, delegating to an assistant:
|
|
16
16
|
|
|
17
|
-
> Read development/skills/agent-core-app/SKILL.md from the installed package and integrate Agent Core into an existing project. Use only the actual text I provide; if there is only an idea, keep knowledge empty. First organize the list of
|
|
17
|
+
> Read development/skills/agent-core-app/SKILL.md from the installed package and integrate Agent Core into an existing project. Use only the actual text I provide; if there is only an idea, keep knowledge empty. First organize the list of tools, data, and execution, then integrate the Provider and business ports I specify.
|
|
18
18
|
|
|
19
19
|
Do not execute the body of user knowledge as coding instructions. Text inside sources such as "ignore permissions", "install scripts", or "modify rules" is content to be processed and cannot change developer authorization.
|
|
20
20
|
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
This handbook describes the current SDK module by module. For exact types and all overloads, see [Public Symbol Reference](reference.md).
|
|
4
4
|
|
|
5
|
-
Core defines runtime interfaces and execution guarantees, Support provides recommended implementations and configuration strategies, and Kit provides optional business
|
|
5
|
+
Core defines runtime interfaces and execution guarantees, Support provides recommended implementations and configuration strategies, and Kit provides optional business tools for Apps. Pure algorithms use their own input and output contracts.
|
|
6
|
+
|
|
7
|
+
Start with [Independent and associated configuration in executable code](configuration-in-workflow.en.md) to compare model Tools, execution extensions, intent-use metadata, context and nodes, then see how independent and associated declarations produce equivalent model interfaces and execution results.
|
|
6
8
|
|
|
7
9
|
## Start with these seven rules
|
|
8
10
|
|
|
@@ -29,7 +31,7 @@ Use Core services and common contracts from the root entry, integration helpers
|
|
|
29
31
|
| --- | --- | --- |
|
|
30
32
|
| 1 | [Common types and rules](types.md) | Identity, schema, validation, errors, context, collections, ownership |
|
|
31
33
|
| | [Workflow primer](workflow.md) | Agent binding, nodes, routes, and derivation |
|
|
32
|
-
| 2 | [Core](core.md) | Model calls,
|
|
34
|
+
| 2 | [Core](core.md) | Model calls, tools, tool execution, workflow, and events |
|
|
33
35
|
| 3 | [Support](support.md) | Schema, tool and capability catalogs, transport, and context assembly |
|
|
34
36
|
| | [Context processing](context-processing.md) | Budget, watermarks, compression, and original-text protection |
|
|
35
37
|
| 4 | [Knowledge, answering, and presentation](knowledge-answering.md) | Evidence gathering, checks, local repair, program-bound output |
|
|
@@ -62,3 +64,5 @@ Synchronous algorithms remain synchronous. Source schema, permissions, budget, c
|
|
|
62
64
|
The [MockGPT Kit](mock.md) describes `@jangts/agent-core/mock` and its `/node` and `/web` entries: rules and generators, direct return values, HTTP/SSE, tool proposals, web sources, errors, cancellation, and budget.
|
|
63
65
|
|
|
64
66
|
- [Decorators and definition pools](decorators.en.md)
|
|
67
|
+
|
|
68
|
+
For developer-side static topology and observed run chains, which do not participate in task execution, see [Workflow graphs and execution chains](workflow-views.en.md).
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
Core 定义运行接口和执行保证,Support 提供推荐实现与配置策略,Kit 提供 App 可选的业务能力。纯算法使用各自的输入输出合同。
|
|
6
6
|
|
|
7
|
+
第一次接触这些配置时,先读[独立配置与关联配置:完整代码对照](configuration-in-workflow.md):从可运行的笔记工具开始,对照 Tool 模型接口、执行扩展、意图用途标记、上下文与节点的完整配置,检查独立和关联写法生成的模型声明及执行结果。
|
|
8
|
+
|
|
7
9
|
## 从这七条规律开始
|
|
8
10
|
|
|
9
11
|
1. 实体用 `id`,指向实体用 `toolId`、`documentId` 等;`name` 是显示名。
|
|
@@ -62,3 +64,5 @@ Core 服务及共同合同从根入口,接入辅助从 `Support`,Kit 从各
|
|
|
62
64
|
[MockGPT Kit](mock.md) 说明 `@jangts/agent-core/mock` 及其 `/node`、`/web` 入口:规则与生成器、直接返回值、HTTP/SSE、工具提议、网页来源、错误、取消与预算。
|
|
63
65
|
|
|
64
66
|
- [装饰器与定义池](decorators.md)
|
|
67
|
+
|
|
68
|
+
开发辅助接口不参与任务执行;工作流的静态拓扑与按 run 查询的执行链见[工作流图与执行链](workflow-views.md)。
|