@jangts/agent-core 0.1.1 → 0.2.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/CHANGELOG.md +25 -0
- package/LICENSE +55 -0
- package/NOTICE +6 -0
- package/README.md +8 -0
- package/development/docs/README.en.md +70 -0
- package/development/docs/README.md +1 -1
- package/development/docs/acceptance.en.md +34 -0
- package/development/docs/agent-development.en.md +42 -0
- package/development/docs/api/README.en.md +62 -0
- package/development/docs/api/advanced-agents.en.md +135 -0
- package/development/docs/api/context-processing.en.md +110 -0
- package/development/docs/api/core.en.md +274 -0
- package/development/docs/api/examples.en.md +118 -0
- package/development/docs/api/kits.en.md +183 -0
- package/development/docs/api/knowledge-answering.en.md +166 -0
- package/development/docs/api/mock.en.md +186 -0
- package/development/docs/api/observability.en.md +166 -0
- package/development/docs/api/reference.en.md +2235 -0
- package/development/docs/api/reference.md +1907 -1874
- package/development/docs/api/support.en.md +252 -0
- package/development/docs/api/support.md +27 -0
- package/development/docs/api/types.en.md +181 -0
- package/development/docs/api/workflow.en.md +188 -0
- package/development/docs/basic-usage.en.md +78 -0
- package/development/docs/create-app.en.md +76 -0
- package/development/docs/examples/offline-agent.en.md +273 -0
- package/development/docs/examples.en.md +36 -0
- package/development/docs/flows/knowledge-maintenance.en.md +38 -0
- package/development/docs/getting-started.en.md +71 -0
- package/development/docs/knowledge.en.md +89 -0
- package/development/docs/maintenance.en.md +62 -0
- package/development/docs/materials.en.md +38 -0
- package/development/docs/mechanisms.en.md +227 -0
- package/development/docs/memory-and-learning.en.md +42 -0
- package/development/docs/operations.en.md +51 -0
- package/development/docs/records.en.md +63 -0
- package/development/docs/registration.en.md +63 -0
- package/development/skills/agent-core-app/scripts/create-app.mjs +286 -70
- package/development/skills/agent-core-app/scripts/lib/knowledge.mjs +77 -16
- package/development/skills/agent-core-app/scripts/lib/source.mjs +30 -2
- package/development/skills/agent-core-app/scripts/plan.mjs +46 -12
- package/development/skills/agent-core-app/scripts/prepare-source.mjs +61 -10
- package/development/skills/agent-core-app/scripts/resources.mjs +62 -17
- package/development/skills/agent-core-app/scripts/validate-knowledge.mjs +18 -1
- package/development/skills/agent-core-app/templates/catalog.json +36 -22
- package/dist/cjs/capabilities/index.js +13 -0
- package/dist/cjs/capabilities/invocation.js +80 -10
- package/dist/cjs/capabilities/model.js +126 -13
- package/dist/cjs/capabilities/tool-runtime.js +64 -12
- package/dist/cjs/capabilities/tools.js +266 -31
- package/dist/cjs/context/assembly.js +46 -5
- package/dist/cjs/context/audit.js +31 -6
- package/dist/cjs/context/fragments.js +54 -11
- package/dist/cjs/context/index.js +12 -0
- package/dist/cjs/context/journal.js +84 -7
- package/dist/cjs/context/plan.js +30 -2
- package/dist/cjs/diagnostics/catalog.js +17 -3
- package/dist/cjs/diagnostics/index.js +149 -29
- package/dist/cjs/diagnostics/sub-flow.js +240 -40
- package/dist/cjs/errors.js +99 -17
- package/dist/cjs/execution/branch.js +20 -4
- package/dist/cjs/execution/engine.js +470 -56
- package/dist/cjs/execution/events.js +136 -18
- package/dist/cjs/execution/index.js +7 -0
- package/dist/cjs/execution/reporting.js +75 -6
- package/dist/cjs/execution/state.js +161 -22
- package/dist/cjs/execution/workflow.js +224 -32
- package/dist/cjs/index.js +18 -0
- package/dist/cjs/kits/aggregation.js +45 -3
- package/dist/cjs/kits/answering/batch.js +23 -4
- package/dist/cjs/kits/answering/check-result.js +31 -8
- package/dist/cjs/kits/answering/checks.js +24 -3
- package/dist/cjs/kits/answering/flow.js +192 -36
- package/dist/cjs/kits/answering/index.js +19 -1
- package/dist/cjs/kits/answering/tasks.js +88 -13
- package/dist/cjs/kits/artifacts.js +36 -4
- package/dist/cjs/kits/candidates.js +47 -5
- package/dist/cjs/kits/delivery.js +40 -5
- package/dist/cjs/kits/durable.js +155 -31
- package/dist/cjs/kits/evidence.js +66 -15
- package/dist/cjs/kits/family.js +152 -22
- package/dist/cjs/kits/index.js +12 -1
- package/dist/cjs/kits/inference.js +104 -16
- package/dist/cjs/kits/intents/catalog.js +67 -16
- package/dist/cjs/kits/intents/index.js +11 -0
- package/dist/cjs/kits/intents/registry.js +188 -43
- package/dist/cjs/kits/intents/scopes.js +215 -46
- package/dist/cjs/kits/interaction/command.js +140 -36
- package/dist/cjs/kits/interaction/commands.js +86 -11
- package/dist/cjs/kits/interaction/handlers.js +27 -10
- package/dist/cjs/kits/interaction/index.js +10 -0
- package/dist/cjs/kits/interaction/transfer.js +80 -14
- package/dist/cjs/kits/knowledge/catalog.js +62 -11
- package/dist/cjs/kits/knowledge/index.js +16 -1
- package/dist/cjs/kits/knowledge/publication.js +99 -23
- package/dist/cjs/kits/knowledge/sections.js +33 -4
- package/dist/cjs/kits/normalization.js +51 -7
- package/dist/cjs/kits/policies.js +79 -15
- package/dist/cjs/kits/presentation/events.js +54 -10
- package/dist/cjs/kits/presentation/index.js +24 -1
- package/dist/cjs/kits/presentation/outputs.js +176 -38
- package/dist/cjs/kits/presentation/templates.js +33 -5
- package/dist/cjs/kits/presentation/variants.js +31 -2
- package/dist/cjs/kits/projection.js +63 -8
- package/dist/cjs/kits/rank-fusion.js +27 -4
- package/dist/cjs/kits/reflection-log-source.js +89 -16
- package/dist/cjs/kits/reflection.js +234 -60
- package/dist/cjs/kits/retrieval.js +98 -18
- package/dist/cjs/kits/search.js +180 -27
- package/dist/cjs/kits/text-skills.js +104 -19
- package/dist/cjs/kits/tools.js +415 -74
- package/dist/cjs/kits/vector-search.js +50 -16
- package/dist/cjs/mock/node.js +7 -1
- package/dist/cjs/mock/web.js +7 -1
- package/dist/cjs/mock.js +7 -1
- package/dist/cjs/model/binding.js +68 -17
- package/dist/cjs/model/call-budget.js +45 -4
- package/dist/cjs/model/decision-retry.js +19 -1
- package/dist/cjs/model/defaults.js +27 -4
- package/dist/cjs/model/index.js +7 -0
- package/dist/cjs/model/interactions/arguments.js +36 -1
- package/dist/cjs/model/interactions/json-object.js +48 -12
- package/dist/cjs/model/interactions/native-functions.js +52 -10
- package/dist/cjs/model/message-diagnostics.js +17 -4
- package/dist/cjs/model/options.js +9 -1
- package/dist/cjs/model/preparation.js +86 -12
- package/dist/cjs/model/runner.js +413 -79
- package/dist/cjs/model/selection-transport.js +48 -8
- package/dist/cjs/model/settings.js +67 -13
- package/dist/cjs/model/token-budget.js +69 -11
- package/dist/cjs/model/transports.js +59 -6
- package/dist/cjs/structs/common.js +11 -0
- package/dist/cjs/structs/debug.js +34 -5
- package/dist/cjs/structs/errors.js +26 -1
- package/dist/cjs/structs/index.js +11 -1
- package/dist/cjs/structs/kits/durable.js +7 -0
- package/dist/cjs/structs/kits/family.js +1 -0
- package/dist/cjs/structs/kits/interaction.js +8 -1
- package/dist/cjs/structs/kits/knowledge-publication.js +1 -0
- package/dist/cjs/structs/kits/reflection.js +18 -3
- package/dist/cjs/structs/model/chat-provider.js +6 -0
- package/dist/cjs/structs/support/model/completion.js +2 -0
- package/dist/cjs/structs/support/model/messages.js +2 -0
- package/dist/cjs/support/capabilities.js +43 -6
- package/dist/cjs/support/context/assembly.js +88 -16
- package/dist/cjs/support/context/compression.js +48 -6
- package/dist/cjs/support/context/fragments.js +6 -0
- package/dist/cjs/support/context/history.js +36 -1
- package/dist/cjs/support/context/index.js +11 -0
- package/dist/cjs/support/context/nodes.js +164 -35
- package/dist/cjs/support/context/processing.js +319 -61
- package/dist/cjs/support/context/selection-policy.js +98 -21
- package/dist/cjs/support/context/selection.js +61 -10
- package/dist/cjs/support/context/snapshot.js +29 -7
- package/dist/cjs/support/context/strategies.js +120 -28
- package/dist/cjs/support/index.js +9 -1
- package/dist/cjs/support/model/capabilities.js +20 -1
- package/dist/cjs/support/model/chat-completions.js +92 -20
- package/dist/cjs/support/model/children.js +34 -6
- package/dist/cjs/support/model/compatible-provider.js +189 -59
- package/dist/cjs/support/model/completion/calls.js +61 -0
- package/dist/cjs/support/model/completion/default.js +33 -0
- package/dist/cjs/support/model/completion/index.js +28 -0
- package/dist/cjs/support/model/completion/session.js +107 -0
- package/dist/cjs/support/model/index.js +12 -0
- package/dist/cjs/support/model/interactions/index.js +12 -1
- package/dist/cjs/support/model/interactions/json-object.js +6 -0
- package/dist/cjs/support/model/interactions/native-functions.js +6 -0
- package/dist/cjs/support/model/observer.js +32 -6
- package/dist/cjs/support/model/preview-rules.js +66 -16
- package/dist/cjs/support/model/reply-preview.js +77 -17
- package/dist/cjs/support/model/stage-transport.js +33 -7
- package/dist/cjs/support/model/strategies.js +75 -14
- package/dist/cjs/support/model/transports.js +53 -11
- package/dist/cjs/support/registration.js +49 -7
- package/dist/cjs/support/schema.js +46 -4
- package/dist/cjs/support/stream-events.js +60 -8
- package/dist/cjs/support/tool-runtime.js +6 -0
- package/dist/cjs/support/tools.js +79 -10
- package/dist/cjs/support/transport/index.js +7 -0
- package/dist/cjs/support/transport/json.js +28 -4
- package/dist/cjs/support/transport/sse.js +25 -2
- package/dist/cjs/utils/break-observer.js +20 -2
- package/dist/cjs/utils/cancellation.js +77 -9
- package/dist/cjs/utils/catalog.js +19 -4
- package/dist/cjs/utils/debug.js +14 -2
- package/dist/cjs/utils/index.js +8 -0
- package/dist/cjs/utils/interaction-definition.js +26 -6
- package/dist/cjs/utils/invocation.js +42 -4
- package/dist/cjs/utils/model-protocol.js +20 -1
- package/dist/cjs/utils/object.js +16 -0
- package/dist/cjs/utils/observer.js +22 -2
- package/dist/cjs/utils/protocol-registry.js +47 -4
- package/dist/cjs/utils/query-key.js +21 -2
- package/dist/cjs/utils/registration.js +18 -2
- package/dist/cjs/utils/rules.js +39 -11
- package/dist/cjs/utils/schema-adapter.js +25 -2
- package/dist/cjs/utils/synchronous.js +64 -7
- package/dist/cjs/utils/text.js +15 -1
- package/dist/esm/capabilities/index.d.ts +13 -0
- package/dist/esm/capabilities/index.js +13 -0
- package/dist/esm/capabilities/invocation.d.ts +16 -2
- package/dist/esm/capabilities/invocation.js +80 -10
- package/dist/esm/capabilities/model.d.ts +68 -1
- package/dist/esm/capabilities/model.js +126 -13
- package/dist/esm/capabilities/tool-runtime.d.ts +11 -0
- package/dist/esm/capabilities/tool-runtime.js +64 -12
- package/dist/esm/capabilities/tools.d.ts +96 -3
- package/dist/esm/capabilities/tools.js +267 -32
- package/dist/esm/context/assembly.d.ts +13 -2
- package/dist/esm/context/assembly.js +46 -5
- package/dist/esm/context/audit.d.ts +23 -1
- package/dist/esm/context/audit.js +31 -6
- package/dist/esm/context/fragments.d.ts +37 -3
- package/dist/esm/context/fragments.js +54 -11
- package/dist/esm/context/index.d.ts +12 -0
- package/dist/esm/context/index.js +12 -0
- package/dist/esm/context/journal.d.ts +32 -1
- package/dist/esm/context/journal.js +84 -7
- package/dist/esm/context/plan.d.ts +11 -1
- package/dist/esm/context/plan.js +30 -2
- package/dist/esm/diagnostics/catalog.d.ts +6 -0
- package/dist/esm/diagnostics/catalog.js +17 -3
- package/dist/esm/diagnostics/index.d.ts +30 -2
- package/dist/esm/diagnostics/index.js +149 -29
- package/dist/esm/diagnostics/sub-flow.d.ts +41 -3
- package/dist/esm/diagnostics/sub-flow.js +240 -40
- package/dist/esm/errors.d.ts +22 -2
- package/dist/esm/errors.js +99 -17
- package/dist/esm/execution/branch.d.ts +19 -1
- package/dist/esm/execution/branch.js +20 -4
- package/dist/esm/execution/engine.d.ts +291 -5
- package/dist/esm/execution/engine.js +471 -57
- package/dist/esm/execution/events.d.ts +16 -2
- package/dist/esm/execution/events.js +136 -18
- package/dist/esm/execution/index.d.ts +7 -0
- package/dist/esm/execution/index.js +7 -0
- package/dist/esm/execution/reporting.d.ts +49 -1
- package/dist/esm/execution/reporting.js +75 -6
- package/dist/esm/execution/state.d.ts +126 -10
- package/dist/esm/execution/state.js +161 -22
- package/dist/esm/execution/workflow.d.ts +121 -3
- package/dist/esm/execution/workflow.js +224 -32
- package/dist/esm/index.d.ts +17 -1
- package/dist/esm/index.js +18 -0
- package/dist/esm/kits/aggregation.d.ts +34 -2
- package/dist/esm/kits/aggregation.js +45 -3
- package/dist/esm/kits/answering/batch.d.ts +17 -0
- package/dist/esm/kits/answering/batch.js +23 -4
- package/dist/esm/kits/answering/check-result.d.ts +18 -1
- package/dist/esm/kits/answering/check-result.js +31 -8
- package/dist/esm/kits/answering/checks.d.ts +11 -0
- package/dist/esm/kits/answering/checks.js +24 -3
- package/dist/esm/kits/answering/flow.d.ts +25 -2
- package/dist/esm/kits/answering/flow.js +192 -36
- package/dist/esm/kits/answering/index.d.ts +12 -0
- package/dist/esm/kits/answering/index.js +19 -1
- package/dist/esm/kits/answering/tasks.d.ts +32 -1
- package/dist/esm/kits/answering/tasks.js +88 -13
- package/dist/esm/kits/artifacts.d.ts +11 -0
- package/dist/esm/kits/artifacts.js +36 -4
- package/dist/esm/kits/candidates.d.ts +23 -1
- package/dist/esm/kits/candidates.js +47 -5
- package/dist/esm/kits/delivery.d.ts +34 -0
- package/dist/esm/kits/delivery.js +40 -5
- package/dist/esm/kits/durable.d.ts +19 -0
- package/dist/esm/kits/durable.js +155 -31
- package/dist/esm/kits/evidence.d.ts +28 -5
- package/dist/esm/kits/evidence.js +66 -15
- package/dist/esm/kits/family.d.ts +17 -1
- package/dist/esm/kits/family.js +152 -22
- package/dist/esm/kits/index.d.ts +12 -1
- package/dist/esm/kits/index.js +12 -1
- package/dist/esm/kits/inference.d.ts +64 -0
- package/dist/esm/kits/inference.js +104 -16
- package/dist/esm/kits/intents/catalog.d.ts +13 -1
- package/dist/esm/kits/intents/catalog.js +67 -16
- package/dist/esm/kits/intents/index.d.ts +11 -0
- package/dist/esm/kits/intents/index.js +11 -0
- package/dist/esm/kits/intents/registry.d.ts +61 -3
- package/dist/esm/kits/intents/registry.js +188 -43
- package/dist/esm/kits/intents/scopes.d.ts +73 -3
- package/dist/esm/kits/intents/scopes.js +215 -46
- package/dist/esm/kits/interaction/command.d.ts +38 -4
- package/dist/esm/kits/interaction/command.js +140 -36
- package/dist/esm/kits/interaction/commands.d.ts +66 -2
- package/dist/esm/kits/interaction/commands.js +86 -11
- package/dist/esm/kits/interaction/handlers.d.ts +19 -2
- package/dist/esm/kits/interaction/handlers.js +27 -10
- package/dist/esm/kits/interaction/index.d.ts +10 -0
- package/dist/esm/kits/interaction/index.js +10 -0
- package/dist/esm/kits/interaction/transfer.d.ts +39 -2
- package/dist/esm/kits/interaction/transfer.js +80 -14
- package/dist/esm/kits/knowledge/catalog.d.ts +13 -0
- package/dist/esm/kits/knowledge/catalog.js +62 -11
- package/dist/esm/kits/knowledge/index.d.ts +11 -0
- package/dist/esm/kits/knowledge/index.js +16 -1
- package/dist/esm/kits/knowledge/publication.d.ts +15 -1
- package/dist/esm/kits/knowledge/publication.js +99 -23
- package/dist/esm/kits/knowledge/sections.d.ts +31 -1
- package/dist/esm/kits/knowledge/sections.js +33 -4
- package/dist/esm/kits/normalization.d.ts +25 -2
- package/dist/esm/kits/normalization.js +51 -7
- package/dist/esm/kits/policies.d.ts +26 -3
- package/dist/esm/kits/policies.js +79 -15
- package/dist/esm/kits/presentation/events.d.ts +51 -4
- package/dist/esm/kits/presentation/events.js +54 -10
- package/dist/esm/kits/presentation/index.d.ts +12 -0
- package/dist/esm/kits/presentation/index.js +25 -2
- package/dist/esm/kits/presentation/outputs.d.ts +30 -1
- package/dist/esm/kits/presentation/outputs.js +176 -38
- package/dist/esm/kits/presentation/templates.d.ts +32 -3
- package/dist/esm/kits/presentation/templates.js +33 -5
- package/dist/esm/kits/presentation/variants.d.ts +29 -0
- package/dist/esm/kits/presentation/variants.js +31 -2
- package/dist/esm/kits/projection.d.ts +42 -5
- package/dist/esm/kits/projection.js +63 -8
- package/dist/esm/kits/rank-fusion.d.ts +21 -1
- package/dist/esm/kits/rank-fusion.js +28 -5
- package/dist/esm/kits/reflection-log-source.d.ts +28 -1
- package/dist/esm/kits/reflection-log-source.js +89 -16
- package/dist/esm/kits/reflection.d.ts +17 -1
- package/dist/esm/kits/reflection.js +235 -61
- package/dist/esm/kits/retrieval.d.ts +18 -2
- package/dist/esm/kits/retrieval.js +98 -18
- package/dist/esm/kits/search.d.ts +56 -3
- package/dist/esm/kits/search.js +180 -27
- package/dist/esm/kits/text-skills.d.ts +16 -2
- package/dist/esm/kits/text-skills.js +104 -19
- package/dist/esm/kits/tools.d.ts +122 -2
- package/dist/esm/kits/tools.js +416 -74
- package/dist/esm/kits/vector-search.d.ts +47 -1
- package/dist/esm/kits/vector-search.js +51 -17
- package/dist/esm/mock/node.d.ts +7 -0
- package/dist/esm/mock/node.js +7 -1
- package/dist/esm/mock/web.d.ts +7 -0
- package/dist/esm/mock/web.js +7 -1
- package/dist/esm/mock.d.ts +7 -0
- package/dist/esm/mock.js +7 -1
- package/dist/esm/model/binding.d.ts +32 -3
- package/dist/esm/model/binding.js +68 -17
- package/dist/esm/model/call-budget.d.ts +30 -2
- package/dist/esm/model/call-budget.js +45 -4
- package/dist/esm/model/decision-retry.d.ts +10 -1
- package/dist/esm/model/decision-retry.js +19 -1
- package/dist/esm/model/defaults.d.ts +13 -2
- package/dist/esm/model/defaults.js +27 -4
- package/dist/esm/model/index.d.ts +7 -0
- package/dist/esm/model/index.js +7 -0
- package/dist/esm/model/interactions/arguments.d.ts +27 -0
- package/dist/esm/model/interactions/arguments.js +36 -1
- package/dist/esm/model/interactions/json-object.d.ts +7 -1
- package/dist/esm/model/interactions/json-object.js +48 -12
- package/dist/esm/model/interactions/native-functions.d.ts +6 -0
- package/dist/esm/model/interactions/native-functions.js +52 -10
- package/dist/esm/model/message-diagnostics.d.ts +17 -1
- package/dist/esm/model/message-diagnostics.js +17 -4
- package/dist/esm/model/options.d.ts +18 -1
- package/dist/esm/model/options.js +9 -1
- package/dist/esm/model/preparation.d.ts +30 -2
- package/dist/esm/model/preparation.js +86 -12
- package/dist/esm/model/runner.d.ts +129 -5
- package/dist/esm/model/runner.js +414 -80
- package/dist/esm/model/selection-transport.d.ts +14 -1
- package/dist/esm/model/selection-transport.js +48 -8
- package/dist/esm/model/settings.d.ts +11 -0
- package/dist/esm/model/settings.js +67 -13
- package/dist/esm/model/token-budget.d.ts +59 -1
- package/dist/esm/model/token-budget.js +69 -11
- package/dist/esm/model/transports.d.ts +20 -2
- package/dist/esm/model/transports.js +59 -6
- package/dist/esm/structs/capabilities/invocation.d.ts +36 -0
- package/dist/esm/structs/capabilities/model.d.ts +27 -0
- package/dist/esm/structs/capabilities/tools.d.ts +38 -0
- package/dist/esm/structs/common.d.ts +62 -2
- package/dist/esm/structs/common.js +11 -0
- package/dist/esm/structs/context/fragments.d.ts +28 -0
- package/dist/esm/structs/context/journal.d.ts +28 -3
- package/dist/esm/structs/context/processing.d.ts +11 -0
- package/dist/esm/structs/debug.d.ts +58 -1
- package/dist/esm/structs/debug.js +34 -5
- package/dist/esm/structs/diagnostics.d.ts +119 -1
- package/dist/esm/structs/errors.d.ts +42 -1
- package/dist/esm/structs/errors.js +26 -1
- package/dist/esm/structs/execution/engine.d.ts +24 -1
- package/dist/esm/structs/execution/events.d.ts +12 -0
- package/dist/esm/structs/execution/workflow.d.ts +71 -0
- package/dist/esm/structs/index.d.ts +11 -1
- package/dist/esm/structs/index.js +11 -1
- package/dist/esm/structs/invocation.d.ts +30 -0
- package/dist/esm/structs/kits/aggregation.d.ts +12 -0
- package/dist/esm/structs/kits/answering/checks.d.ts +11 -0
- package/dist/esm/structs/kits/answering/flow.d.ts +35 -1
- package/dist/esm/structs/kits/answering/state.d.ts +21 -0
- package/dist/esm/structs/kits/answering/tasks.d.ts +21 -0
- package/dist/esm/structs/kits/artifacts.d.ts +14 -0
- package/dist/esm/structs/kits/candidates.d.ts +19 -0
- package/dist/esm/structs/kits/delivery.d.ts +22 -0
- package/dist/esm/structs/kits/durable.d.ts +56 -3
- package/dist/esm/structs/kits/durable.js +7 -0
- package/dist/esm/structs/kits/evidence.d.ts +23 -0
- package/dist/esm/structs/kits/family.d.ts +49 -1
- package/dist/esm/structs/kits/family.js +1 -0
- package/dist/esm/structs/kits/intents/catalog.d.ts +26 -0
- package/dist/esm/structs/kits/intents/registry.d.ts +34 -0
- package/dist/esm/structs/kits/intents/scopes.d.ts +36 -1
- package/dist/esm/structs/kits/interaction.d.ts +64 -0
- package/dist/esm/structs/kits/interaction.js +8 -1
- package/dist/esm/structs/kits/knowledge-publication.d.ts +43 -1
- package/dist/esm/structs/kits/knowledge-publication.js +1 -0
- package/dist/esm/structs/kits/knowledge.d.ts +39 -2
- package/dist/esm/structs/kits/normalization.d.ts +15 -0
- package/dist/esm/structs/kits/policies.d.ts +25 -1
- package/dist/esm/structs/kits/presentation/events.d.ts +28 -4
- package/dist/esm/structs/kits/presentation/outputs.d.ts +38 -1
- package/dist/esm/structs/kits/presentation/templates.d.ts +15 -0
- package/dist/esm/structs/kits/projection.d.ts +21 -0
- package/dist/esm/structs/kits/reflection.d.ts +61 -2
- package/dist/esm/structs/kits/reflection.js +18 -3
- package/dist/esm/structs/kits/retrieval.d.ts +39 -0
- package/dist/esm/structs/kits/search.d.ts +24 -0
- package/dist/esm/structs/kits/text-skills.d.ts +36 -0
- package/dist/esm/structs/kits/tools.d.ts +87 -0
- package/dist/esm/structs/model/chat-provider.d.ts +24 -1
- package/dist/esm/structs/model/chat-provider.js +6 -0
- package/dist/esm/structs/model/interactions.d.ts +38 -0
- package/dist/esm/structs/model/messages.d.ts +34 -0
- package/dist/esm/structs/model/runtime.d.ts +104 -6
- package/dist/esm/structs/support/capabilities.d.ts +19 -2
- package/dist/esm/structs/support/context-processing.d.ts +88 -9
- package/dist/esm/structs/support/context.d.ts +29 -1
- package/dist/esm/structs/support/model/completion.d.ts +50 -0
- package/dist/esm/structs/support/model/completion.js +1 -0
- package/dist/esm/structs/support/model/interactions.d.ts +13 -1
- package/dist/esm/structs/support/model/messages.d.ts +54 -0
- package/dist/esm/structs/support/model/messages.js +1 -0
- package/dist/esm/structs/support/model/provider-observer.d.ts +22 -1
- package/dist/esm/structs/support/model/provider.d.ts +71 -6
- package/dist/esm/structs/support/registration.d.ts +13 -0
- package/dist/esm/structs/support/schema.d.ts +14 -0
- package/dist/esm/structs/support/tools.d.ts +28 -0
- package/dist/esm/structs/support/transport/json.d.ts +16 -0
- package/dist/esm/structs/support/transport/sse.d.ts +15 -0
- package/dist/esm/structs/utils/rules.d.ts +19 -0
- package/dist/esm/support/capabilities.d.ts +25 -2
- package/dist/esm/support/capabilities.js +43 -6
- package/dist/esm/support/context/assembly.d.ts +35 -4
- package/dist/esm/support/context/assembly.js +88 -16
- package/dist/esm/support/context/compression.d.ts +17 -1
- package/dist/esm/support/context/compression.js +48 -6
- package/dist/esm/support/context/fragments.d.ts +6 -0
- package/dist/esm/support/context/fragments.js +6 -0
- package/dist/esm/support/context/history.d.ts +43 -0
- package/dist/esm/support/context/history.js +36 -1
- package/dist/esm/support/context/index.d.ts +13 -2
- package/dist/esm/support/context/index.js +12 -1
- package/dist/esm/support/context/nodes.d.ts +65 -3
- package/dist/esm/support/context/nodes.js +165 -36
- package/dist/esm/support/context/processing.d.ts +152 -1
- package/dist/esm/support/context/processing.js +320 -62
- package/dist/esm/support/context/selection-policy.d.ts +42 -2
- package/dist/esm/support/context/selection-policy.js +98 -21
- package/dist/esm/support/context/selection.d.ts +14 -1
- package/dist/esm/support/context/selection.js +61 -10
- package/dist/esm/support/context/snapshot.d.ts +23 -1
- package/dist/esm/support/context/snapshot.js +29 -7
- package/dist/esm/support/context/strategies.d.ts +35 -2
- package/dist/esm/support/context/strategies.js +120 -28
- package/dist/esm/support/index.d.ts +9 -1
- package/dist/esm/support/index.js +9 -1
- package/dist/esm/support/model/capabilities.d.ts +10 -0
- package/dist/esm/support/model/capabilities.js +20 -1
- package/dist/esm/support/model/chat-completions.d.ts +44 -15
- package/dist/esm/support/model/chat-completions.js +92 -20
- package/dist/esm/support/model/children.d.ts +34 -2
- package/dist/esm/support/model/children.js +34 -6
- package/dist/esm/support/model/compatible-provider.d.ts +29 -3
- package/dist/esm/support/model/compatible-provider.js +190 -60
- package/dist/esm/support/model/completion/calls.d.ts +40 -0
- package/dist/esm/support/model/completion/calls.js +58 -0
- package/dist/esm/support/model/completion/default.d.ts +11 -0
- package/dist/esm/support/model/completion/default.js +30 -0
- package/dist/esm/support/model/completion/index.d.ts +10 -0
- package/dist/esm/support/model/completion/index.js +22 -0
- package/dist/esm/support/model/completion/session.d.ts +16 -0
- package/dist/esm/support/model/completion/session.js +104 -0
- package/dist/esm/support/model/index.d.ts +14 -0
- package/dist/esm/support/model/index.js +12 -0
- package/dist/esm/support/model/interactions/index.d.ts +1 -1
- package/dist/esm/support/model/interactions/index.js +12 -1
- package/dist/esm/support/model/interactions/json-object.d.ts +6 -0
- package/dist/esm/support/model/interactions/json-object.js +6 -0
- package/dist/esm/support/model/interactions/native-functions.d.ts +6 -0
- package/dist/esm/support/model/interactions/native-functions.js +6 -0
- package/dist/esm/support/model/observer.d.ts +25 -2
- package/dist/esm/support/model/observer.js +32 -6
- package/dist/esm/support/model/preview-rules.d.ts +26 -2
- package/dist/esm/support/model/preview-rules.js +66 -16
- package/dist/esm/support/model/reply-preview.d.ts +22 -1
- package/dist/esm/support/model/reply-preview.js +77 -17
- package/dist/esm/support/model/stage-transport.d.ts +9 -1
- package/dist/esm/support/model/stage-transport.js +33 -7
- package/dist/esm/support/model/strategies.d.ts +28 -2
- package/dist/esm/support/model/strategies.js +75 -14
- package/dist/esm/support/model/transports.d.ts +17 -1
- package/dist/esm/support/model/transports.js +53 -11
- package/dist/esm/support/registration.d.ts +20 -1
- package/dist/esm/support/registration.js +49 -7
- package/dist/esm/support/schema.d.ts +31 -1
- package/dist/esm/support/schema.js +46 -4
- package/dist/esm/support/stream-events.d.ts +22 -1
- package/dist/esm/support/stream-events.js +60 -8
- package/dist/esm/support/tool-runtime.d.ts +6 -0
- package/dist/esm/support/tool-runtime.js +6 -0
- package/dist/esm/support/tools.d.ts +22 -0
- package/dist/esm/support/tools.js +79 -10
- package/dist/esm/support/transport/index.d.ts +7 -0
- package/dist/esm/support/transport/index.js +7 -0
- package/dist/esm/support/transport/json.d.ts +29 -2
- package/dist/esm/support/transport/json.js +28 -4
- package/dist/esm/support/transport/sse.d.ts +31 -1
- package/dist/esm/support/transport/sse.js +25 -2
- package/dist/esm/types.d.ts +9 -1
- package/dist/esm/utils/break-observer.d.ts +27 -2
- package/dist/esm/utils/break-observer.js +20 -2
- package/dist/esm/utils/cancellation.d.ts +56 -5
- package/dist/esm/utils/cancellation.js +77 -9
- package/dist/esm/utils/catalog.d.ts +20 -1
- package/dist/esm/utils/catalog.js +19 -4
- package/dist/esm/utils/debug.d.ts +20 -1
- package/dist/esm/utils/debug.js +14 -2
- package/dist/esm/utils/index.d.ts +8 -0
- package/dist/esm/utils/index.js +8 -0
- package/dist/esm/utils/interaction-definition.d.ts +18 -1
- package/dist/esm/utils/interaction-definition.js +26 -6
- package/dist/esm/utils/invocation.d.ts +36 -1
- package/dist/esm/utils/invocation.js +42 -4
- package/dist/esm/utils/model-protocol.d.ts +8 -0
- package/dist/esm/utils/model-protocol.js +20 -1
- package/dist/esm/utils/object.d.ts +16 -0
- package/dist/esm/utils/object.js +16 -0
- package/dist/esm/utils/observer.d.ts +19 -1
- package/dist/esm/utils/observer.js +22 -2
- package/dist/esm/utils/protocol-registry.d.ts +38 -1
- package/dist/esm/utils/protocol-registry.js +47 -4
- package/dist/esm/utils/query-key.d.ts +11 -1
- package/dist/esm/utils/query-key.js +21 -2
- package/dist/esm/utils/registration.d.ts +34 -2
- package/dist/esm/utils/registration.js +18 -2
- package/dist/esm/utils/rules.d.ts +81 -4
- package/dist/esm/utils/rules.js +39 -11
- package/dist/esm/utils/schema-adapter.d.ts +12 -1
- package/dist/esm/utils/schema-adapter.js +25 -2
- package/dist/esm/utils/synchronous.d.ts +60 -4
- package/dist/esm/utils/synchronous.js +64 -7
- package/dist/esm/utils/text.d.ts +15 -1
- package/dist/esm/utils/text.js +15 -1
- package/package.json +7 -3
|
@@ -1,64 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Diagnostic envelope, event catalog and recording context for agent-core.
|
|
3
|
+
*
|
|
4
|
+
* One execution fact is produced once; it may be observed live and, when enabled, projected into a
|
|
5
|
+
* log sink. This module declares the names, payload shapes, identity fields and content classes
|
|
6
|
+
* that both paths share, so a consumer never needs a parallel event description.
|
|
7
|
+
*
|
|
8
|
+
* Exports: `CoreEventPayloads`, `CoreEventName`, `CoreEventDescriptor`, `DiagnosticIdentity`,
|
|
9
|
+
* `DiagnosticSpanFields`, `CoreEvent`, `CoreLogOutput`, `DiagnosticContext`,
|
|
10
|
+
* `CreateDiagnosticsOptions`, `CoreDiagnosticRecord`.
|
|
11
|
+
*/
|
|
1
12
|
import type { DebugStepsOutput, RecordedSubStep } from './debug.js';
|
|
2
13
|
import type { WorkflowEvent } from './execution/workflow.js';
|
|
3
14
|
import type { ModelCallTrace } from './model/runtime.js';
|
|
4
15
|
import type { ModelMessage } from './model/messages.js';
|
|
16
|
+
/** Payload of every Core event, keyed by event name. Fields are the event's own facts only. */
|
|
5
17
|
export interface CoreEventPayloads {
|
|
18
|
+
/** One loop round transition raised by the engine. */
|
|
6
19
|
'loop.event': import('./execution/engine.js').LoopEvent;
|
|
20
|
+
/** Model binding selection and its per-phase timing; recorded around one model invocation. */
|
|
7
21
|
'model.binding': {
|
|
22
|
+
/** Configured model binding id. */
|
|
8
23
|
modelId: string;
|
|
24
|
+
/** Invocation the binding served. */
|
|
9
25
|
invocationId: string;
|
|
26
|
+
/** Phase outcome: `running` while active, otherwise terminal. */
|
|
10
27
|
status: 'running' | 'success' | 'error' | 'cancelled';
|
|
28
|
+
/** Lifecycle phase this fact belongs to. */
|
|
11
29
|
phase: 'input' | 'invoke' | 'output';
|
|
30
|
+
/** Elapsed milliseconds for the phase; absent while running. */
|
|
12
31
|
durationMs?: number;
|
|
32
|
+
/** Error classification when the phase failed. */
|
|
13
33
|
errorCode?: string;
|
|
14
34
|
};
|
|
35
|
+
/** Snapshot of the prepared request, emitted before the provider is called. */
|
|
15
36
|
'model.prepare': {
|
|
16
37
|
stageId: string;
|
|
38
|
+
/** Transport selected for the call. */
|
|
17
39
|
transportId: string;
|
|
40
|
+
/** Messages actually sent, after context assembly and budget checks. */
|
|
18
41
|
messages: readonly ModelMessage[];
|
|
42
|
+
/** Transport-specific request options; opaque to Core consumers. */
|
|
19
43
|
options: unknown;
|
|
44
|
+
/** Context measurement or projection attached by the caller. */
|
|
20
45
|
context?: unknown;
|
|
21
46
|
};
|
|
47
|
+
/** One streamed model part, in arrival order. */
|
|
22
48
|
'model.output': {
|
|
23
49
|
stageId: string;
|
|
50
|
+
/** Position of the call within its runner. */
|
|
24
51
|
callSequence: number;
|
|
52
|
+
/** Zero-based index of the part within the response. */
|
|
25
53
|
partIndex: number;
|
|
26
54
|
part: import('./model/messages.js').ModelPart;
|
|
27
55
|
};
|
|
56
|
+
/** Parsed output of a response, once the collector resolved it. */
|
|
28
57
|
'model.parsed': {
|
|
29
58
|
stageId: string;
|
|
30
59
|
callSequence: number;
|
|
31
60
|
value?: unknown;
|
|
32
61
|
};
|
|
62
|
+
/** End of a model call, successful or not, with its accumulated trace. */
|
|
33
63
|
'model.end': {
|
|
34
64
|
stageId: string;
|
|
35
65
|
state: Readonly<ModelCallTrace>;
|
|
66
|
+
/** Failure that ended the call; absent on success. */
|
|
36
67
|
error?: unknown;
|
|
68
|
+
/** Number of parts actually received, for truncated-stream detection. */
|
|
37
69
|
receivedParts: number;
|
|
38
70
|
};
|
|
71
|
+
/** A Core input or state condition rejected execution. */
|
|
39
72
|
'runtime.rejected': {
|
|
40
73
|
stageId?: string;
|
|
41
74
|
error: unknown;
|
|
42
75
|
};
|
|
76
|
+
/** Progress reported by an active workflow node. */
|
|
43
77
|
'node.progress': {
|
|
44
78
|
payload?: unknown;
|
|
79
|
+
/** Sub-step delivery fact; separate from the node's own payload. */
|
|
45
80
|
subStep?: import('./debug.js').SubStepProgress;
|
|
81
|
+
/** Set when the node's report violated the reporting contract. */
|
|
46
82
|
reportError?: 'INVALID_NODE_REPORT';
|
|
47
83
|
};
|
|
84
|
+
/** Start of one model call, emitted before any output part. */
|
|
48
85
|
'model.start': {
|
|
49
86
|
stageId: string;
|
|
50
87
|
callSequence: number;
|
|
51
88
|
transportId: string;
|
|
52
89
|
};
|
|
90
|
+
/** Workflow lifecycle fact raised by the engine. */
|
|
53
91
|
'workflow.event': {
|
|
54
92
|
event: WorkflowEvent;
|
|
55
93
|
payload?: unknown;
|
|
56
94
|
};
|
|
95
|
+
/** A tool call was accepted for execution. */
|
|
57
96
|
'tool.call': {
|
|
58
97
|
toolId: string;
|
|
59
98
|
invocationId: string;
|
|
60
99
|
input?: unknown;
|
|
61
100
|
};
|
|
101
|
+
/** A tool call settled, successfully or not. */
|
|
62
102
|
'tool.result': {
|
|
63
103
|
toolId: string;
|
|
64
104
|
invocationId: string;
|
|
@@ -66,88 +106,166 @@ export interface CoreEventPayloads {
|
|
|
66
106
|
error?: unknown;
|
|
67
107
|
errorCode?: string;
|
|
68
108
|
status: import('./common.js').InvocationStatus;
|
|
109
|
+
/** Elapsed milliseconds for the tool execution. */
|
|
69
110
|
durationMs: number;
|
|
70
111
|
};
|
|
112
|
+
/** A declarative rule rejected processing, with its ownership tags. */
|
|
71
113
|
'rule.result': {
|
|
72
114
|
tags: readonly string[];
|
|
73
115
|
error: unknown;
|
|
74
116
|
};
|
|
75
117
|
}
|
|
118
|
+
/** Union of every Core event name; the key set of `CoreEventPayloads`. */
|
|
76
119
|
export type CoreEventName = keyof CoreEventPayloads;
|
|
120
|
+
/**
|
|
121
|
+
* Event classification used when deciding whether a sink accepts an event.
|
|
122
|
+
*
|
|
123
|
+
* `metadata` events carry identity, timing and status only; `content` events may carry user,
|
|
124
|
+
* model or tool content and therefore require an explicit acceptance decision.
|
|
125
|
+
*/
|
|
77
126
|
export interface CoreEventDescriptor {
|
|
78
127
|
event: CoreEventName;
|
|
79
128
|
content: 'metadata' | 'content';
|
|
80
129
|
}
|
|
81
130
|
/** Execution identity only: never message, account or HTTP identity. */
|
|
82
131
|
export interface DiagnosticIdentity {
|
|
132
|
+
/** Root run id shared by every fact of one logical run. */
|
|
83
133
|
readonly runId: string;
|
|
134
|
+
/** Span that produced the fact. */
|
|
84
135
|
readonly spanId: string;
|
|
136
|
+
/** Enclosing span; absent for a root span. */
|
|
85
137
|
readonly parentSpanId?: string;
|
|
138
|
+
/** Invocation that produced the fact, when the fact belongs to one. */
|
|
86
139
|
readonly invocationId?: string;
|
|
140
|
+
/** Enclosing invocation, when one invocation triggers another. */
|
|
87
141
|
readonly parentInvocationId?: string;
|
|
142
|
+
/** Role the emitting span plays in the execution graph. */
|
|
88
143
|
readonly nodeRole?: 'workflow-node' | 'workflow-boundary' | 'invocation' | 'loop-step';
|
|
144
|
+
/** App-owned agent identity. */
|
|
89
145
|
readonly agentId?: string;
|
|
146
|
+
/** App-owned branch identity. */
|
|
90
147
|
readonly branchId?: string;
|
|
148
|
+
/** App-owned immutable version identity of the agent definition. */
|
|
91
149
|
readonly agentVersionId?: string;
|
|
150
|
+
/** Branch this branch was forked from, when applicable. */
|
|
92
151
|
readonly parentBranchId?: string;
|
|
152
|
+
/** Version of the parent branch at the fork point. */
|
|
93
153
|
readonly parentAgentVersionId?: string;
|
|
154
|
+
/** App-owned fork marker shared by the forked branch and its origin. */
|
|
94
155
|
readonly forkPointId?: string;
|
|
156
|
+
/** Workflow invocation the fact belongs to. */
|
|
95
157
|
readonly workflowInvocationId?: string;
|
|
158
|
+
/** Workflow node invocation the fact belongs to. */
|
|
96
159
|
readonly workflowNodeId?: string;
|
|
160
|
+
/** Kind of the workflow/agent definition that dispatched the node. */
|
|
97
161
|
readonly definitionKind?: string;
|
|
162
|
+
/** Id of that definition. */
|
|
98
163
|
readonly definitionId?: string;
|
|
164
|
+
/** Revision of that definition; distinguishes executions of different definition states. */
|
|
99
165
|
readonly definitionRevision?: string;
|
|
166
|
+
/** Node id inside the workflow. */
|
|
100
167
|
readonly nodeId?: string;
|
|
168
|
+
/** Human-readable node name. */
|
|
101
169
|
readonly nodeName?: string;
|
|
170
|
+
/** Node kind as declared by the App. */
|
|
102
171
|
readonly nodeKind?: string;
|
|
172
|
+
/** Optional node description for diagnostics display. */
|
|
103
173
|
readonly nodeDescription?: string;
|
|
174
|
+
/** Model stage that produced the fact. */
|
|
104
175
|
readonly stageId?: string;
|
|
176
|
+
/** Model binding used, when the fact concerns a model call. */
|
|
105
177
|
readonly modelId?: string;
|
|
106
178
|
}
|
|
179
|
+
/** Identity fields a child span may override; the parent supplies run, span and parent span. */
|
|
107
180
|
export type DiagnosticSpanFields = Omit<DiagnosticIdentity, 'runId' | 'spanId' | 'parentSpanId'>;
|
|
181
|
+
/**
|
|
182
|
+
* A recorded Core fact.
|
|
183
|
+
*
|
|
184
|
+
* Every variant carries the same envelope: a version marker, unique event id, producing span's
|
|
185
|
+
* identity, a per-producer monotonic sequence, the occurrence instant and optional reported
|
|
186
|
+
* sub-steps. `subStepsDropped`/`subStepsTruncated` state that reported detail was bounded.
|
|
187
|
+
*/
|
|
108
188
|
export type CoreEvent = {
|
|
109
189
|
[K in CoreEventName]: DiagnosticIdentity & {
|
|
190
|
+
/** Envelope version; consumers must reject anything else. */
|
|
110
191
|
version: 2;
|
|
192
|
+
/** Unique id of this fact, stable across observers and log writers. */
|
|
111
193
|
eventId: string;
|
|
194
|
+
/** Discriminator matching `payload`. */
|
|
112
195
|
type: K;
|
|
196
|
+
/** Monotonic counter owned by the producing scope; starts at 1 for each producer. */
|
|
113
197
|
producerSequence: number;
|
|
198
|
+
/** Instant the fact occurred, in epoch milliseconds. */
|
|
114
199
|
occurredAtMs: number;
|
|
200
|
+
/** Event-specific facts. */
|
|
115
201
|
payload: CoreEventPayloads[K];
|
|
202
|
+
/** Whether the reported step used a model; omitted when the producer did not state it. */
|
|
116
203
|
usedModel?: boolean;
|
|
204
|
+
/** Reported sub-steps attached to this fact, bounded and already validated. */
|
|
117
205
|
subSteps: readonly RecordedSubStep[];
|
|
206
|
+
/** Number of reported sub-steps omitted by the recorder's bounds. */
|
|
118
207
|
subStepsDropped: number;
|
|
208
|
+
/** True when reported sub-steps were truncated, so the attached list is incomplete. */
|
|
119
209
|
subStepsTruncated: boolean;
|
|
120
210
|
};
|
|
121
211
|
}[CoreEventName];
|
|
212
|
+
/** Destination for recorded facts; implementations decide filtering and durability. */
|
|
122
213
|
export interface CoreLogOutput {
|
|
214
|
+
/** Returns false to skip an event entirely; absent means accept every event. */
|
|
123
215
|
accepts?(descriptor: CoreEventDescriptor): boolean;
|
|
216
|
+
/** Persists one fact. Rejections propagate to the emitting call. */
|
|
124
217
|
write(event: CoreEvent): void | Promise<void>;
|
|
125
218
|
}
|
|
219
|
+
/**
|
|
220
|
+
* Recording scope bound to one execution identity.
|
|
221
|
+
*
|
|
222
|
+
* A child scope inherits the sink and observer of its parent; only identity changes.
|
|
223
|
+
*/
|
|
126
224
|
export interface DiagnosticContext {
|
|
225
|
+
/** Identity of the current scope, when the scope is bound to an execution. */
|
|
127
226
|
readonly identity?: Readonly<DiagnosticIdentity>;
|
|
227
|
+
/** Cheap pre-check so callers can skip building expensive payloads. */
|
|
128
228
|
enabled(event: CoreEventName, content?: 'metadata' | 'content'): boolean;
|
|
229
|
+
/**
|
|
230
|
+
* Records one fact.
|
|
231
|
+
*
|
|
232
|
+
* @param event - Event name; determines the payload type.
|
|
233
|
+
* @param payload - Thunk invoked only when the event is enabled.
|
|
234
|
+
* @param debug - Optional reported debug material attached to the fact.
|
|
235
|
+
*/
|
|
129
236
|
emit<K extends CoreEventName>(event: K, payload: () => CoreEventPayloads[K], debug?: DebugStepsOutput): void;
|
|
130
237
|
/** Ordered content delivery uses the same fact, while consumer failures propagate. */
|
|
131
238
|
deliver<K extends CoreEventName>(event: K, payload: () => CoreEventPayloads[K], sink: (event: Extract<CoreEvent, {
|
|
132
239
|
type: K;
|
|
133
240
|
}>) => void | Promise<void>): Promise<void>;
|
|
241
|
+
/** Derives a child span; `fields` fills values the child knows but the parent does not. */
|
|
134
242
|
child(spanId: string, fields?: Readonly<DiagnosticSpanFields>): DiagnosticContext;
|
|
135
243
|
/** Bind live observation without changing the log destination or request identity. */
|
|
136
244
|
withObserver(observer: import('./execution/events.js').ExecutionObserver): DiagnosticContext;
|
|
137
245
|
}
|
|
246
|
+
/** Options for creating a root diagnostic scope. */
|
|
138
247
|
export interface CreateDiagnosticsOptions {
|
|
248
|
+
/** Log destination; omission disables persistence while observation can still work. */
|
|
139
249
|
readonly output?: CoreLogOutput;
|
|
250
|
+
/** Live observer of the same facts, independent of `output`. */
|
|
140
251
|
readonly observe?: import('./execution/events.js').ExecutionObserver;
|
|
252
|
+
/** Root run id; generated when omitted. */
|
|
141
253
|
readonly runId?: string;
|
|
254
|
+
/** Root span id; generated when omitted. */
|
|
142
255
|
readonly spanId?: string;
|
|
143
256
|
}
|
|
144
|
-
/**
|
|
257
|
+
/**
|
|
258
|
+
* Persisted data is untrusted: normalization checks the current envelope, not arbitrary payloads.
|
|
259
|
+
*/
|
|
145
260
|
export interface CoreDiagnosticRecord extends DiagnosticIdentity {
|
|
261
|
+
/** Envelope version this record was written with. */
|
|
146
262
|
readonly version: 2;
|
|
147
263
|
readonly eventId: string;
|
|
148
264
|
readonly type: CoreEventName;
|
|
265
|
+
/** Per-producer monotonic sequence; at least 1. */
|
|
149
266
|
readonly producerSequence: number;
|
|
150
267
|
readonly occurredAtMs: number;
|
|
268
|
+
/** Unvalidated payload; only the envelope above is checked during normalization. */
|
|
151
269
|
readonly payload: unknown;
|
|
152
270
|
readonly usedModel?: boolean;
|
|
153
271
|
readonly subSteps: readonly RecordedSubStep[];
|
|
@@ -1,27 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error types and error-metadata contracts used by agent-core.
|
|
3
|
+
*
|
|
4
|
+
* Errors remain plain `Error` subclasses so hosts can catch them without importing a hierarchy;
|
|
5
|
+
* stage and retryability metadata is attached beside the value (see `src/errors.ts`) instead of
|
|
6
|
+
* replacing the original thrown value or its identity.
|
|
7
|
+
*
|
|
8
|
+
* Exports: `ValidationError`, `BudgetError`, `WorkflowContractError`, `AgentErrorInfo`,
|
|
9
|
+
* `ErrorContext`.
|
|
10
|
+
*/
|
|
1
11
|
import type { Issue } from './common.js';
|
|
12
|
+
/**
|
|
13
|
+
* Rejected input or output that failed one or more registered checks.
|
|
14
|
+
*
|
|
15
|
+
* The message is fixed; consumers should read `issues` for the actual reasons.
|
|
16
|
+
*/
|
|
2
17
|
export declare class ValidationError extends Error {
|
|
3
18
|
readonly issues: readonly Issue[];
|
|
19
|
+
/**
|
|
20
|
+
* @param issues - Validation problems, stored verbatim and exposed to the catcher.
|
|
21
|
+
*/
|
|
4
22
|
constructor(issues: readonly Issue[]);
|
|
5
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* A configured allowance (rounds, model calls, attempts) is exhausted.
|
|
26
|
+
*
|
|
27
|
+
* The optional message states which allowance ran out; `code` is the stable marker.
|
|
28
|
+
*/
|
|
6
29
|
export declare class BudgetError extends Error {
|
|
7
30
|
readonly code = "BUDGET";
|
|
8
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* The workflow definition violates Core's execution contract, as opposed to failing business logic.
|
|
34
|
+
*
|
|
35
|
+
* Examples: unknown model binding, asynchronous predicate, unmatched route, missing state field.
|
|
36
|
+
* It is a programming error, so callers should not treat it as retryable.
|
|
37
|
+
*/
|
|
9
38
|
export declare class WorkflowContractError extends Error {
|
|
10
39
|
readonly code = "WORKFLOW_CONTRACT";
|
|
40
|
+
/**
|
|
41
|
+
* @param message - Human-readable contract violation; preserved by `Error`.
|
|
42
|
+
*/
|
|
11
43
|
constructor(message: string);
|
|
12
44
|
}
|
|
13
|
-
/** Stable metadata for App diagnostics. Unknown retryability is deliberately omitted. */
|
|
45
|
+
/** Stable error metadata for App diagnostics. Unknown retryability is deliberately omitted. */
|
|
14
46
|
export interface AgentErrorInfo {
|
|
47
|
+
/** Primary code: the error's own `code`, or a derived/fallback classification. */
|
|
15
48
|
readonly code: string;
|
|
49
|
+
/** Every code observed while inspecting the error and its causes, primary code first. */
|
|
16
50
|
readonly codes: readonly string[];
|
|
51
|
+
/** Structured issues found on the error; empty when the source reported none. */
|
|
17
52
|
readonly issues: readonly Readonly<Issue>[];
|
|
53
|
+
/** Execution stage that recorded the error, when the boundary annotated it. */
|
|
18
54
|
readonly stageId?: string;
|
|
55
|
+
/** Present only when the source stated retryability; absence means unknown. */
|
|
19
56
|
readonly isRetryable?: boolean;
|
|
57
|
+
/** Original thrown value, kept for identity and host-specific handling. */
|
|
20
58
|
readonly cause: unknown;
|
|
21
59
|
}
|
|
22
60
|
/** Boundary metadata is recorded internally, without replacing the original thrown value. */
|
|
23
61
|
export interface ErrorContext {
|
|
62
|
+
/** Stage that first observed the error; later annotations keep the earliest value. */
|
|
24
63
|
readonly stageId?: string;
|
|
64
|
+
/** Codes contributed by the boundary, merged with those found on the error itself. */
|
|
25
65
|
readonly codes?: readonly string[];
|
|
66
|
+
/** Retryability asserted by the boundary; omitted when it cannot be determined. */
|
|
26
67
|
readonly isRetryable?: boolean;
|
|
27
68
|
}
|
|
@@ -1,14 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rejected input or output that failed one or more registered checks.
|
|
3
|
+
*
|
|
4
|
+
* The message is fixed; consumers should read `issues` for the actual reasons.
|
|
5
|
+
*/
|
|
1
6
|
export class ValidationError extends Error {
|
|
2
7
|
issues;
|
|
8
|
+
/**
|
|
9
|
+
* @param issues - Validation problems, stored verbatim and exposed to the catcher.
|
|
10
|
+
*/
|
|
3
11
|
constructor(issues) {
|
|
4
12
|
super('Agent validation failed');
|
|
5
13
|
this.issues = issues;
|
|
6
14
|
}
|
|
7
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* A configured allowance (rounds, model calls, attempts) is exhausted.
|
|
18
|
+
*
|
|
19
|
+
* The optional message states which allowance ran out; `code` is the stable marker.
|
|
20
|
+
*/
|
|
8
21
|
export class BudgetError extends Error {
|
|
9
22
|
code = 'BUDGET';
|
|
10
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* The workflow definition violates Core's execution contract, as opposed to failing business logic.
|
|
26
|
+
*
|
|
27
|
+
* Examples: unknown model binding, asynchronous predicate, unmatched route, missing state field.
|
|
28
|
+
* It is a programming error, so callers should not treat it as retryable.
|
|
29
|
+
*/
|
|
11
30
|
export class WorkflowContractError extends Error {
|
|
12
31
|
code = 'WORKFLOW_CONTRACT';
|
|
13
|
-
|
|
32
|
+
/**
|
|
33
|
+
* @param message - Human-readable contract violation; preserved by `Error`.
|
|
34
|
+
*/
|
|
35
|
+
constructor(message) {
|
|
36
|
+
super(message);
|
|
37
|
+
this.name = 'WorkflowContractError';
|
|
38
|
+
}
|
|
14
39
|
}
|
|
@@ -1,21 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent loop contract: one bounded step executed repeatedly until it completes.
|
|
3
|
+
*
|
|
4
|
+
* The engine owns round counting, cancellation and budget exhaustion; the App supplies a `CoreStep`
|
|
5
|
+
* that decides whether the loop continues or finishes. Loop facts are emitted as `loop.event` so
|
|
6
|
+
* a host can observe progress without reading engine internals.
|
|
7
|
+
*
|
|
8
|
+
* Exports: `LoopEvent`, `StepOutcome`, `CoreStep`, `AgentCoreEngineOptions`.
|
|
9
|
+
*/
|
|
1
10
|
import type { ExecutionContext, ExecutionOptions, MaybePromise } from '../common.js';
|
|
11
|
+
/** Progress fact for one loop round, correlated with the enclosing diagnostics span. */
|
|
2
12
|
export interface LoopEvent {
|
|
13
|
+
/** Unique id of this fact. */
|
|
3
14
|
readonly eventId: string;
|
|
15
|
+
/** `enter` opens a round, `continue`/`complete` close it, `error` reports failure. */
|
|
4
16
|
readonly type: 'enter' | 'continue' | 'complete' | 'error';
|
|
17
|
+
/** Zero-based round index; a new round starts only when the step asks to continue. */
|
|
5
18
|
readonly roundIndex: number;
|
|
19
|
+
/** Phase that failed on `error`: boundary checks, the step itself, or budget accounting. */
|
|
6
20
|
readonly phase?: 'boundary' | 'run' | 'budget';
|
|
21
|
+
/** Stable error classification when `type` is `error`. */
|
|
7
22
|
readonly errorCode?: string;
|
|
8
23
|
}
|
|
9
|
-
|
|
24
|
+
/** Decision a step returns to the engine. */
|
|
25
|
+
export type StepOutcome<Value> =
|
|
26
|
+
/** Run another round; consumes one round from the budget. */
|
|
27
|
+
{
|
|
10
28
|
readonly type: 'continue';
|
|
11
29
|
} | {
|
|
12
30
|
readonly type: 'complete';
|
|
13
31
|
readonly value: Value;
|
|
14
32
|
};
|
|
33
|
+
/** One loop iteration. Must be re-entrant: the same step object runs every round. */
|
|
15
34
|
export type CoreStep<Result> = (roundIndex: number, context: ExecutionContext & import('../debug.js').NodeReportingContext) => MaybePromise<StepOutcome<Result>>;
|
|
35
|
+
/** Engine construction options. */
|
|
16
36
|
export interface AgentCoreEngineOptions {
|
|
37
|
+
/** Round budget; must be a positive safe integer. Defaults to 8 rounds. */
|
|
17
38
|
maxRounds?: number;
|
|
39
|
+
/** Cancellation and diagnostics shared by every round. */
|
|
18
40
|
execution?: ExecutionOptions;
|
|
41
|
+
/** Builds the error thrown when the round budget is exhausted (defaults to a `BudgetError`). */
|
|
19
42
|
errors?: {
|
|
20
43
|
exhausted?: () => Error;
|
|
21
44
|
};
|
|
@@ -1,10 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Live execution observation contract.
|
|
3
|
+
*
|
|
4
|
+
* The same fact that diagnostics may persist can also be observed while it happens. Observers
|
|
5
|
+
* receive metadata by default; content-bearing events require an explicit `accepts` decision so a
|
|
6
|
+
* host cannot leak user or model content by accident.
|
|
7
|
+
*
|
|
8
|
+
* Exports: `CoreEvent` (type re-export), `ExecutionEventDescriptor`, `ExecutionObserver`.
|
|
9
|
+
*/
|
|
1
10
|
import type { CoreEvent, CoreEventDescriptor, DiagnosticIdentity } from '../diagnostics.js';
|
|
2
11
|
/** The same execution fact is observed live and optionally projected into a log. */
|
|
3
12
|
export type { CoreEvent } from '../diagnostics.js';
|
|
13
|
+
/** Event name, content class and the producing execution identity. */
|
|
4
14
|
export interface ExecutionEventDescriptor extends CoreEventDescriptor, DiagnosticIdentity {
|
|
5
15
|
}
|
|
16
|
+
/** Live consumer of Core facts. */
|
|
6
17
|
export interface ExecutionObserver {
|
|
7
18
|
/** Metadata-only by default. Content requires an explicit accepts decision. */
|
|
8
19
|
accepts?(descriptor: Readonly<ExecutionEventDescriptor>): boolean;
|
|
20
|
+
/** Handles one fact; a rejected promise propagates to the emitting call. */
|
|
9
21
|
event(event: Readonly<CoreEvent>): void | Promise<void>;
|
|
10
22
|
}
|
|
@@ -1,29 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow contract: a state graph whose nodes report their own use of model and tools.
|
|
3
|
+
*
|
|
4
|
+
* A definition declares nodes, ordered routes and an optional result predicate. The engine walks
|
|
5
|
+
* the graph, validates `requires`/`provides`, applies route order and records one `WorkflowEvent`
|
|
6
|
+
* per decision. All declarations here are metadata; execution stays in the engine so Core remains
|
|
7
|
+
* the only place that owns round budgets, cancellation and state commits.
|
|
8
|
+
*
|
|
9
|
+
* Exports: `WorkflowContext`, `WorkflowRoute`, `WorkflowNodeReport`, `WorkflowNode`,
|
|
10
|
+
* `AgentWorkflowDefinition`, `WorkflowEvent`, `WorkflowFailure`, `WorkflowExtension`,
|
|
11
|
+
* `WorkflowModel`.
|
|
12
|
+
*/
|
|
1
13
|
import type { OperationContext } from '../common.js';
|
|
2
14
|
import type { DiagnosticContext } from '../diagnostics.js';
|
|
3
15
|
import type { ModelTransportDefinition } from '../model/runtime.js';
|
|
4
16
|
import type { NodeReportingContext } from '../debug.js';
|
|
17
|
+
/** Model request for a workflow: diagnostics arrive through the node context, never per call. */
|
|
5
18
|
type WorkflowModelRequest<Transport> = import('../model/runtime.js').ModelCallRequest<Transport> & {
|
|
6
19
|
readonly diagnostics?: never;
|
|
7
20
|
readonly modelId?: string;
|
|
8
21
|
};
|
|
22
|
+
/** Execution facts available to every node of a running workflow. */
|
|
9
23
|
export interface WorkflowContext<Runtime = undefined> extends OperationContext<Runtime>, NodeReportingContext {
|
|
10
24
|
/** Zero-based bounded round; phases within a round do not consume another round. */
|
|
11
25
|
readonly roundIndex: number;
|
|
12
26
|
/** Report progress while this node is active; Core supplies its execution identity. */
|
|
13
27
|
report(update: WorkflowNodeReport): void;
|
|
28
|
+
/** Diagnostic scope of this node visit, when recording is enabled. */
|
|
14
29
|
readonly diagnostics?: DiagnosticContext;
|
|
30
|
+
/** Model access limited by the workflow's configured calls and budget. */
|
|
15
31
|
readonly model: WorkflowModel;
|
|
16
32
|
readonly tools: {
|
|
17
33
|
/** Per-call cancellation can shorten, never replace, the Workflow lifetime. */
|
|
18
34
|
invoke(request: Omit<import('../capabilities/tools.js').ToolInvocationRequest, 'diagnostics'>): Promise<import('../invocation.js').ToolResult<unknown>>;
|
|
19
35
|
};
|
|
36
|
+
/** Failure that led into this node, present only while entering an `onErrorNodeId` target. */
|
|
20
37
|
readonly error?: unknown;
|
|
38
|
+
/** Event id of that failure, for correlation in host logs. */
|
|
21
39
|
readonly errorEventId?: string;
|
|
22
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* One route out of a node.
|
|
43
|
+
*
|
|
44
|
+
* Routes are evaluated in array order and the first match wins. A route either continues at
|
|
45
|
+
* `targetNodeId` or completes the workflow through `complete`; declaring both is invalid.
|
|
46
|
+
*/
|
|
23
47
|
export type WorkflowRoute<State, Result, Runtime = undefined> = {
|
|
48
|
+
/** Stable route id reported in events; required only when hosts need to audit the choice. */
|
|
24
49
|
readonly id?: string;
|
|
25
50
|
readonly description?: string;
|
|
51
|
+
/** Stable condition id reported when this route was selected. */
|
|
26
52
|
readonly conditionId?: string;
|
|
53
|
+
/** Omission means unconditional selection at this position; otherwise must return boolean now. */
|
|
27
54
|
readonly when?: (state: Readonly<State>, context: WorkflowContext<Runtime>) => boolean;
|
|
28
55
|
} & ({
|
|
29
56
|
readonly targetNodeId: string;
|
|
@@ -32,37 +59,61 @@ export type WorkflowRoute<State, Result, Runtime = undefined> = {
|
|
|
32
59
|
readonly targetNodeId?: never;
|
|
33
60
|
readonly complete: (state: Readonly<State>, context: WorkflowContext<Runtime>) => Result;
|
|
34
61
|
});
|
|
62
|
+
/** Detail an App node reports about its current visit. */
|
|
35
63
|
export interface WorkflowNodeReport {
|
|
36
64
|
/** This visit's own use only; omitted means unknown. */
|
|
37
65
|
readonly usedModel?: boolean;
|
|
66
|
+
/** App-defined progress detail; collected only when content logging is enabled. */
|
|
38
67
|
readonly payload?: unknown;
|
|
68
|
+
/** Logger owned by this visit, used to report sub-steps. */
|
|
39
69
|
readonly subs?: import('../debug.js').SubFlowLogger;
|
|
40
70
|
}
|
|
71
|
+
/** One node of the graph. */
|
|
41
72
|
export type WorkflowNode<State, Result, Runtime = undefined> = {
|
|
73
|
+
/** Stable node id referenced by routes and error handling. */
|
|
42
74
|
readonly id: string;
|
|
75
|
+
/** Required explanation of what the node does; also used in diagnostics. */
|
|
43
76
|
readonly description: string;
|
|
77
|
+
/** Display name; defaults to `id` when omitted. */
|
|
44
78
|
readonly name?: string;
|
|
45
79
|
/** Optional application-reported detail, collected only when content logging is enabled. */
|
|
46
80
|
readonly report?: (update: Readonly<Partial<State>> | void, context: NodeReportingContext) => WorkflowNodeReport;
|
|
81
|
+
/**
|
|
82
|
+
* Reserves a fresh round on entry.
|
|
83
|
+
*
|
|
84
|
+
* Use it for steps that may legitimately repeat; entering such a node when the round budget is
|
|
85
|
+
* exhausted fails with the configured exhausted error.
|
|
86
|
+
*/
|
|
47
87
|
readonly startsRound?: boolean;
|
|
88
|
+
/** Node entered when `run`/`provides`/`route` fails; contract errors always propagate instead. */
|
|
48
89
|
readonly onErrorNodeId?: string;
|
|
90
|
+
/** Route id reported with the recovery transition. */
|
|
49
91
|
readonly onErrorRouteId?: string;
|
|
92
|
+
/** State keys that must be present before this node runs; enforced by the engine. */
|
|
50
93
|
readonly requires?: readonly (keyof State & string)[];
|
|
94
|
+
/** State keys this node is expected to produce; validated after `run`. */
|
|
51
95
|
readonly provides?: readonly (keyof State & string)[];
|
|
96
|
+
/** Candidate successors, evaluated in order. */
|
|
52
97
|
readonly routes: readonly WorkflowRoute<State, Result, Runtime>[];
|
|
53
98
|
/** Return only changed fields. Core commits them after cancellation and output checks. */
|
|
54
99
|
readonly run?: (state: Readonly<State>, context: WorkflowContext<Runtime>) => void | Partial<State> | Promise<void | Partial<State>>;
|
|
55
100
|
};
|
|
101
|
+
/** The graph an engine executes. */
|
|
56
102
|
export type AgentWorkflowDefinition<State, Result, Runtime = undefined> = {
|
|
103
|
+
/** Stable workflow id, also reported in every event. */
|
|
57
104
|
readonly id: string;
|
|
105
|
+
/** Definition revision; lets hosts distinguish executions of different graph versions. */
|
|
58
106
|
readonly revision?: string;
|
|
59
107
|
readonly nodes: readonly WorkflowNode<State, Result, Runtime>[];
|
|
108
|
+
/** Synchronous result adjudicator; returning anything other than `true` is a contract error. */
|
|
60
109
|
readonly isResult?: (result: Result) => boolean;
|
|
110
|
+
/** First node to enter; defaults to the first declared node, which must start a round. */
|
|
61
111
|
readonly entryNodeId?: string;
|
|
62
112
|
};
|
|
63
113
|
/** Metadata only: never includes state, prompt, parameters, results or raw errors. */
|
|
64
114
|
export interface WorkflowEvent {
|
|
65
115
|
readonly eventId: string;
|
|
116
|
+
/** Id of the failure that caused this transition, when recovering from an error. */
|
|
66
117
|
readonly errorEventId?: string;
|
|
67
118
|
readonly workflowId: string;
|
|
68
119
|
readonly agentId?: string;
|
|
@@ -78,15 +129,22 @@ export interface WorkflowEvent {
|
|
|
78
129
|
readonly roundIndex: number;
|
|
79
130
|
readonly targetNodeId?: string;
|
|
80
131
|
readonly type: 'enter' | 'transition' | 'complete' | 'error';
|
|
132
|
+
/** Elapsed milliseconds for the phase the event reports. */
|
|
81
133
|
readonly durationMs?: number;
|
|
134
|
+
/** Zero-based index of the selected route in `node.routes`. */
|
|
82
135
|
readonly route?: number;
|
|
136
|
+
/** Id of the selected route, when it declared one. */
|
|
83
137
|
readonly routeId?: string;
|
|
138
|
+
/** Id of the selected condition, when the route declared one. */
|
|
84
139
|
readonly conditionId?: string;
|
|
140
|
+
/** Logical phase that produced the event. */
|
|
85
141
|
readonly phase?: 'boundary' | 'requires' | 'run' | 'provides' | 'route' | 'complete' | 'result';
|
|
142
|
+
/** Route that failed on `route`, `complete` or `result` phases. */
|
|
86
143
|
readonly failedRouteId?: string;
|
|
87
144
|
readonly runId?: string;
|
|
88
145
|
readonly spanId?: string;
|
|
89
146
|
readonly parentSpanId?: string;
|
|
147
|
+
/** Error classification for `error` events. */
|
|
90
148
|
readonly errorCode?: string;
|
|
91
149
|
}
|
|
92
150
|
/** Error retained only while entering a registered failure phase. */
|
|
@@ -94,11 +152,21 @@ export interface WorkflowFailure {
|
|
|
94
152
|
error: unknown;
|
|
95
153
|
errorEventId?: string;
|
|
96
154
|
}
|
|
155
|
+
/** Additional nodes and routes merged into an existing definition. */
|
|
97
156
|
export interface WorkflowExtension<State, Result, App> {
|
|
157
|
+
/** Nodes appended to the definition; ids must not collide with existing nodes. */
|
|
98
158
|
readonly nodes: readonly WorkflowNode<State, Result, App>[];
|
|
159
|
+
/** Replacement route lists keyed by node id; other nodes keep their declared routes. */
|
|
99
160
|
readonly routes?: Readonly<Record<string, readonly WorkflowRoute<State, Result, App>[]>>;
|
|
161
|
+
/** Extension revision, recorded so mixed definitions remain auditable. */
|
|
100
162
|
readonly revision?: string;
|
|
101
163
|
}
|
|
164
|
+
/**
|
|
165
|
+
* Model and tool access for one workflow invocation.
|
|
166
|
+
*
|
|
167
|
+
* Every call is charged to the workflow's shared budget. Overloads select the transport: a prepared
|
|
168
|
+
* call, the default plain-text transport, or one registered transport with its typed result.
|
|
169
|
+
*/
|
|
102
170
|
export interface WorkflowModel {
|
|
103
171
|
invoke<Result>(request: WorkflowModelRequest<never> & {
|
|
104
172
|
readonly prepared: import('../model/runtime.js').PreparedModelCall<Result>;
|
|
@@ -118,8 +186,11 @@ export interface WorkflowModel {
|
|
|
118
186
|
prepare(request: import('../model/runtime.js').ModelPrepareRequest<string | ModelTransportDefinition> & {
|
|
119
187
|
readonly modelId?: string;
|
|
120
188
|
}): import('../model/runtime.js').PreparedModelCall;
|
|
189
|
+
/** Calls still available to this workflow after ancestor reservations. */
|
|
121
190
|
readonly remainingCalls: number;
|
|
191
|
+
/** Calls completed by this workflow's own runner. */
|
|
122
192
|
readonly callCount: number;
|
|
193
|
+
/** Calls consumed across this workflow and its descendants. */
|
|
123
194
|
readonly totalCallCount: number;
|
|
124
195
|
}
|
|
125
196
|
export {};
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Public entry of the structs layer.
|
|
3
|
+
*
|
|
4
|
+
* Structs are the shape-only half of agent-core: declarations and frozen constant catalogs that the
|
|
5
|
+
* runtime modules (`capabilities`, `context`, `execution`, `model`, `kits`, `support`) both
|
|
6
|
+
* implement and consume. Runtime classes declared here only describe shape or initialize fields,
|
|
7
|
+
* so importing this barrel never starts execution.
|
|
8
|
+
*
|
|
9
|
+
* Exports: a curated re-export of the shared vocabulary, error classes, diagnostics/event
|
|
10
|
+
* envelopes, model and workflow contracts, and the optional Kit protocol definitions.
|
|
11
|
+
*/
|
|
2
12
|
export * from './capabilities/model.js';
|
|
3
13
|
export * from './model/chat-provider.js';
|
|
4
14
|
export * from './context/fragments.js';
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Public entry of the structs layer.
|
|
3
|
+
*
|
|
4
|
+
* Structs are the shape-only half of agent-core: declarations and frozen constant catalogs that the
|
|
5
|
+
* runtime modules (`capabilities`, `context`, `execution`, `model`, `kits`, `support`) both
|
|
6
|
+
* implement and consume. Runtime classes declared here only describe shape or initialize fields,
|
|
7
|
+
* so importing this barrel never starts execution.
|
|
8
|
+
*
|
|
9
|
+
* Exports: a curated re-export of the shared vocabulary, error classes, diagnostics/event
|
|
10
|
+
* envelopes, model and workflow contracts, and the optional Kit protocol definitions.
|
|
11
|
+
*/
|
|
2
12
|
export * from './capabilities/model.js';
|
|
3
13
|
export * from './model/chat-provider.js';
|
|
4
14
|
export * from './context/fragments.js';
|