@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,3 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core diagnostics surface: one execution fact source shared by live observers and an optional
|
|
3
|
+
* log consumer.
|
|
4
|
+
*
|
|
5
|
+
* `createDiagnostics` configures the consumer, `diagnosticError` turns an arbitrary thrown value
|
|
6
|
+
* into a loggable record, and `normalizeDiagnosticEvent` re-validates a persisted record before
|
|
7
|
+
* it is trusted. Payload visibility comes from the event catalog, and a failing consumer never
|
|
8
|
+
* changes execution.
|
|
9
|
+
*
|
|
10
|
+
* Exports: the factory and helpers above, the event catalog, and the diagnostic types.
|
|
11
|
+
*/
|
|
1
12
|
import { createEventScope } from '../execution/events.js';
|
|
2
13
|
import { reportedStepStatuses } from '../structs/debug.js';
|
|
3
14
|
import { getErrorInfo } from '../errors.js';
|
|
@@ -7,10 +18,26 @@ import { breakWhile } from '../utils/rules.js';
|
|
|
7
18
|
export * from '../structs/diagnostics.js';
|
|
8
19
|
export * from './catalog.js';
|
|
9
20
|
export { reportedStepStatusCatalog, reportedStepStatuses } from '../structs/debug.js';
|
|
10
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* Configure the optional log consumer of the shared execution fact source.
|
|
23
|
+
*
|
|
24
|
+
* @param options.output Log consumer. Without it, events are still observable but not persisted.
|
|
25
|
+
* @param options.observe Live observer applied to this scope and every child scope.
|
|
26
|
+
* @param options.runId Run identity; a random id is generated when omitted.
|
|
27
|
+
* @param options.spanId Root span id; defaults to `run`.
|
|
28
|
+
* @returns A diagnostic context whose children share the run, sequence and consumers.
|
|
29
|
+
*/
|
|
11
30
|
export function createDiagnostics(options = {}) {
|
|
12
31
|
return createEventScope(options);
|
|
13
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Convert a thrown value into a plain record suitable as a log payload.
|
|
35
|
+
*
|
|
36
|
+
* @param error Any thrown value. Non-Errors are reported as `NonError` with their string form
|
|
37
|
+
* and no issue details.
|
|
38
|
+
* @returns A record with name, message, stack, code, issues and whatever boundary metadata was
|
|
39
|
+
* recorded. It never throws: an uninspectable value becomes `UninspectableError`.
|
|
40
|
+
*/
|
|
14
41
|
export function diagnosticError(error) {
|
|
15
42
|
const info = getErrorInfo(error);
|
|
16
43
|
let detail;
|
|
@@ -18,43 +45,96 @@ export function diagnosticError(error) {
|
|
|
18
45
|
if (!(error instanceof Error))
|
|
19
46
|
return { name: 'NonError', message: String(error) };
|
|
20
47
|
const { name, message, stack, code } = error;
|
|
21
|
-
detail = {
|
|
48
|
+
detail = {
|
|
49
|
+
name,
|
|
50
|
+
message,
|
|
51
|
+
stack,
|
|
52
|
+
code: code ?? (info.code === 'UNKNOWN_ERROR' ? undefined : info.code),
|
|
53
|
+
};
|
|
22
54
|
}
|
|
23
55
|
catch {
|
|
24
|
-
detail = {
|
|
56
|
+
detail = {
|
|
57
|
+
name: 'UninspectableError',
|
|
58
|
+
message: 'Error details unavailable',
|
|
59
|
+
code: info.code === 'UNKNOWN_ERROR' ? undefined : info.code,
|
|
60
|
+
};
|
|
25
61
|
}
|
|
26
|
-
return {
|
|
62
|
+
return {
|
|
63
|
+
...detail,
|
|
64
|
+
issues: info.issues,
|
|
27
65
|
...(info.stageId === undefined ? {} : { stageId: info.stageId }),
|
|
28
|
-
...(info.isRetryable === undefined ? {} : { isRetryable: info.isRetryable })
|
|
66
|
+
...(info.isRetryable === undefined ? {} : { isRetryable: info.isRetryable }),
|
|
67
|
+
};
|
|
29
68
|
}
|
|
30
|
-
/**
|
|
69
|
+
/**
|
|
70
|
+
* Validate a persisted diagnostic record and return a detached copy.
|
|
71
|
+
*
|
|
72
|
+
* Persisted data is untrusted, so the envelope version, event type, identity, ordering and the
|
|
73
|
+
* bounded sub-step shape are checked; the payload itself is not interpreted. The copy is deep
|
|
74
|
+
* cloned, so a store cannot hand back a record that later shares structure with the caller.
|
|
75
|
+
*
|
|
76
|
+
* @param input Candidate record, typically parsed JSON from a log store.
|
|
77
|
+
* @returns A normalized record with `subSteps`, `subStepsDropped` and `subStepsTruncated`
|
|
78
|
+
* defaulted.
|
|
79
|
+
* @throws TypeError when the envelope, identity, node role or reported steps are invalid.
|
|
80
|
+
* @throws RangeError when a reported payload is too large or too deeply nested.
|
|
81
|
+
*/
|
|
31
82
|
export function normalizeDiagnosticEvent(input) {
|
|
32
83
|
if (!input || typeof input !== 'object')
|
|
33
84
|
throw new TypeError('Invalid diagnostic record');
|
|
34
85
|
const raw = input;
|
|
86
|
+
// The version gates the whole layout: an older record may use different fields, so it is
|
|
87
|
+
// rejected instead of best-effort coerced.
|
|
35
88
|
if (raw.version !== 2)
|
|
36
89
|
throw new TypeError('Unsupported diagnostic version');
|
|
37
90
|
const { type, producerSequence, occurredAtMs } = raw;
|
|
38
|
-
if (typeof type !== 'string' ||
|
|
39
|
-
|
|
40
|
-
|
|
91
|
+
if (typeof type !== 'string' ||
|
|
92
|
+
!Object.hasOwn(coreEventCatalog, type) ||
|
|
93
|
+
typeof raw.runId !== 'string' ||
|
|
94
|
+
!raw.runId ||
|
|
95
|
+
typeof raw.spanId !== 'string' ||
|
|
96
|
+
!raw.spanId ||
|
|
97
|
+
!Number.isSafeInteger(producerSequence) ||
|
|
98
|
+
Number(producerSequence) < 1 ||
|
|
99
|
+
typeof occurredAtMs !== 'number' ||
|
|
100
|
+
!Number.isFinite(occurredAtMs) ||
|
|
101
|
+
!Object.hasOwn(raw, 'payload'))
|
|
41
102
|
throw new TypeError('Invalid diagnostic envelope');
|
|
42
103
|
const { eventId } = raw;
|
|
43
104
|
if (typeof eventId !== 'string' || !eventId)
|
|
44
105
|
throw new TypeError('Invalid diagnostic event identity');
|
|
45
106
|
const steps = raw.subSteps ?? [];
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
107
|
+
// The count and size bounds match what the sub-flow logger enforces, so a record produced by
|
|
108
|
+
// Core can never be rejected here; only hand-edited or foreign records can.
|
|
109
|
+
if (!Array.isArray(steps) ||
|
|
110
|
+
steps.length > 256 ||
|
|
111
|
+
new Set(steps.map((step) => step?.stepId)).size !== steps.length ||
|
|
112
|
+
steps.some((step) => !step ||
|
|
113
|
+
step.origin !== 'reported' ||
|
|
114
|
+
typeof step.stepId !== 'string' ||
|
|
115
|
+
!step.stepId.trim() ||
|
|
116
|
+
typeof step.name !== 'string' ||
|
|
117
|
+
typeof step.kind !== 'string' ||
|
|
118
|
+
!Number.isSafeInteger(step.sequence) ||
|
|
119
|
+
step.sequence < 1 ||
|
|
120
|
+
(step.status !== undefined && !reportedStepStatuses.includes(step.status)) ||
|
|
121
|
+
['parentStepId', 'relatedDefinitionId', 'caseId', 'summary'].some((key) => step[key] !== undefined && typeof step[key] !== 'string') ||
|
|
122
|
+
(step.usedModel !== undefined && typeof step.usedModel !== 'boolean') ||
|
|
123
|
+
(step.revision !== undefined &&
|
|
124
|
+
(!Number.isSafeInteger(step.revision) ||
|
|
125
|
+
step.revision < 1 ||
|
|
126
|
+
!Number.isFinite(step.createdAtMs))) ||
|
|
127
|
+
['createdAtMs', 'startedAtMs', 'endedAtMs'].some((key) => step[key] !== undefined &&
|
|
128
|
+
(typeof step[key] !== 'number' || !Number.isFinite(step[key]) || step[key] < 0)) ||
|
|
129
|
+
(step.nextStepIds !== undefined &&
|
|
130
|
+
(!Array.isArray(step.nextStepIds) ||
|
|
131
|
+
step.nextStepIds.some((id) => typeof id !== 'string')))) ||
|
|
132
|
+
(raw.subStepsDropped !== undefined &&
|
|
133
|
+
(!Number.isSafeInteger(raw.subStepsDropped) || Number(raw.subStepsDropped) < 0)) ||
|
|
134
|
+
(raw.subStepsTruncated !== undefined && typeof raw.subStepsTruncated !== 'boolean'))
|
|
57
135
|
throw new TypeError('Invalid reported diagnostic steps');
|
|
136
|
+
// Structural check only: the returned snapshot is discarded because the clone below already
|
|
137
|
+
// produces the detached copy kept by the normalized record.
|
|
58
138
|
for (const step of steps)
|
|
59
139
|
if (step.payload !== undefined)
|
|
60
140
|
payloadSnapshot(step.payload);
|
|
@@ -62,19 +142,59 @@ export function normalizeDiagnosticEvent(input) {
|
|
|
62
142
|
breakWhile(raw.usedModel !== undefined && typeof raw.usedModel !== 'boolean', () => new TypeError('Invalid reported model use'));
|
|
63
143
|
if (type === 'node.progress') {
|
|
64
144
|
const progress = raw.payload?.subStep;
|
|
65
|
-
breakWhile(progress !== undefined &&
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
145
|
+
breakWhile(progress !== undefined &&
|
|
146
|
+
(!progress ||
|
|
147
|
+
!['write', 'fix'].includes(progress.operation) ||
|
|
148
|
+
typeof progress.stepId !== 'string' ||
|
|
149
|
+
!progress.stepId ||
|
|
150
|
+
!Number.isSafeInteger(progress.sequence) ||
|
|
151
|
+
progress.sequence < 1 ||
|
|
152
|
+
!Number.isSafeInteger(progress.revision) ||
|
|
153
|
+
progress.revision < 1 ||
|
|
154
|
+
!Number.isFinite(progress.createdAtMs) ||
|
|
155
|
+
progress.createdAtMs < 0 ||
|
|
156
|
+
!reportedStepStatuses.includes(progress.status) ||
|
|
157
|
+
(progress.usedModel !== undefined && typeof progress.usedModel !== 'boolean')), () => new TypeError('Invalid reported sub-step progress'));
|
|
69
158
|
}
|
|
70
|
-
for (const key of [
|
|
159
|
+
for (const key of [
|
|
160
|
+
'parentSpanId',
|
|
161
|
+
'invocationId',
|
|
162
|
+
'parentInvocationId',
|
|
163
|
+
'workflowInvocationId',
|
|
164
|
+
'workflowNodeId',
|
|
165
|
+
'agentId',
|
|
166
|
+
'branchId',
|
|
167
|
+
'agentVersionId',
|
|
168
|
+
'parentBranchId',
|
|
169
|
+
'parentAgentVersionId',
|
|
170
|
+
'forkPointId',
|
|
171
|
+
'definitionId',
|
|
172
|
+
'definitionKind',
|
|
173
|
+
'definitionRevision',
|
|
174
|
+
'nodeId',
|
|
175
|
+
'nodeName',
|
|
176
|
+
'nodeKind',
|
|
177
|
+
'nodeDescription',
|
|
178
|
+
'stageId',
|
|
179
|
+
'modelId',
|
|
180
|
+
]) {
|
|
71
181
|
if (raw[key] !== undefined && typeof raw[key] !== 'string')
|
|
72
182
|
throw new TypeError('Invalid diagnostic identity');
|
|
73
183
|
}
|
|
74
|
-
if (raw.nodeRole !== undefined &&
|
|
184
|
+
if (raw.nodeRole !== undefined &&
|
|
185
|
+
!['workflow-node', 'workflow-boundary', 'invocation', 'loop-step'].includes(String(raw.nodeRole)))
|
|
75
186
|
throw new TypeError('Invalid diagnostic node role');
|
|
187
|
+
// Detached copy: the caller's object may be reused, frozen or backed by a store buffer.
|
|
76
188
|
const copy = structuredClone(raw);
|
|
77
|
-
return {
|
|
78
|
-
|
|
79
|
-
|
|
189
|
+
return {
|
|
190
|
+
...copy,
|
|
191
|
+
version: 2,
|
|
192
|
+
eventId,
|
|
193
|
+
type,
|
|
194
|
+
producerSequence,
|
|
195
|
+
occurredAtMs,
|
|
196
|
+
subSteps: copy.subSteps ?? [],
|
|
197
|
+
subStepsDropped: copy.subStepsDropped ?? 0,
|
|
198
|
+
subStepsTruncated: copy.subStepsTruncated ?? false,
|
|
199
|
+
};
|
|
80
200
|
}
|
|
@@ -1,8 +1,46 @@
|
|
|
1
1
|
import type { RecordedSubStep, SubFlowLogger, SubStepProgress, SubFlowValue } from '../structs/debug.js';
|
|
2
2
|
import type { DiagnosticIdentity } from '../structs/diagnostics.js';
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Validate and deep-copy a reported payload.
|
|
5
|
+
*
|
|
6
|
+
* Accessors, class instances, cycles and non-JSON values are rejected without evaluating
|
|
7
|
+
* application getters, so a payload can neither run code nor alias live state. Accepted data is
|
|
8
|
+
* frozen.
|
|
9
|
+
*
|
|
10
|
+
* @param input Object to snapshot. It must be a plain object, not an array.
|
|
11
|
+
* @returns A deeply frozen JSON-shaped copy.
|
|
12
|
+
* @throws TypeError when the value is not plain JSON data, contains a getter, or is cyclic.
|
|
13
|
+
* @throws RangeError when node count, nesting depth, string length or array length exceeds the
|
|
14
|
+
* limits below.
|
|
15
|
+
*/
|
|
4
16
|
export declare function payloadSnapshot(input: unknown): Readonly<Record<string, SubFlowValue>>;
|
|
5
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* Create a logger bound to one active execution visit.
|
|
19
|
+
*
|
|
20
|
+
* Only execution contexts inside this package should call it: the resulting object is the sole
|
|
21
|
+
* way to append reported steps to the current record.
|
|
22
|
+
*
|
|
23
|
+
* @param owner Object that owns the visit. `readSubFlowLogger` compares this identity before
|
|
24
|
+
* returning any step.
|
|
25
|
+
* @param active Reports whether the visit is still open; a closed logger rejects writes.
|
|
26
|
+
* @param content Reports whether content-level detail is enabled. When false, summaries and
|
|
27
|
+
* payloads are dropped before anything is stored.
|
|
28
|
+
* @param changed Called after each accepted write or fix with the progress delta to publish.
|
|
29
|
+
* @param identity Diagnostic run and span the logger belongs to; used to reject cross-scope reads.
|
|
30
|
+
* @returns A frozen logger instance.
|
|
31
|
+
*/
|
|
6
32
|
export declare function createSubFlowLogger(owner: object, active: () => boolean, content: () => boolean, changed: (logger: SubFlowLogger, progress: SubStepProgress) => void, identity?: Readonly<DiagnosticIdentity>): SubFlowLogger;
|
|
7
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* Read the steps recorded by a logger issued by this module.
|
|
35
|
+
*
|
|
36
|
+
* The instance is resolved through the private registry, so a lookalike's `readAll` method is
|
|
37
|
+
* never called and a logger cannot be borrowed across executions.
|
|
38
|
+
*
|
|
39
|
+
* @param input Candidate logger; must be an instance created by `createSubFlowLogger`.
|
|
40
|
+
* @param owner Expected owning execution visit. Omit to accept any owner.
|
|
41
|
+
* @param identity Expected run and span. Omit to accept any diagnostic scope.
|
|
42
|
+
* @returns The recorded steps in write order, as an immutable list shared with the logger.
|
|
43
|
+
* @throws TypeError when the value is not a registered logger, belongs to another owner, or
|
|
44
|
+
* belongs to another diagnostic scope.
|
|
45
|
+
*/
|
|
8
46
|
export declare function readSubFlowLogger(input: unknown, owner?: object, identity?: Readonly<DiagnosticIdentity>): readonly Readonly<RecordedSubStep>[];
|