@adonis-agora/agent 0.92.0 → 0.93.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/assets/spa/assets/index-DUq09Q_k.js +9 -0
- package/dist/assets/spa/index.html +1 -1
- package/dist/providers/agent_provider.d.ts.map +1 -1
- package/dist/providers/agent_provider.js +33 -0
- package/dist/providers/agent_provider.js.map +1 -1
- package/dist/src/agent-loop.d.ts +8 -0
- package/dist/src/agent-loop.d.ts.map +1 -1
- package/dist/src/agent-loop.js +196 -87
- package/dist/src/agent-loop.js.map +1 -1
- package/dist/src/agent-service.d.ts +66 -1
- package/dist/src/agent-service.d.ts.map +1 -1
- package/dist/src/agent-service.js +102 -0
- package/dist/src/agent-service.js.map +1 -1
- package/dist/src/diagnostics.d.ts +65 -0
- package/dist/src/diagnostics.d.ts.map +1 -1
- package/dist/src/diagnostics.js +18 -4
- package/dist/src/diagnostics.js.map +1 -1
- package/dist/src/durable/agent-run-workflow.d.ts.map +1 -1
- package/dist/src/durable/agent-run-workflow.js +11 -0
- package/dist/src/durable/agent-run-workflow.js.map +1 -1
- package/dist/src/index.d.ts +4 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +3 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/opencode/turn.d.ts.map +1 -1
- package/dist/src/opencode/turn.js +4 -1
- package/dist/src/opencode/turn.js.map +1 -1
- package/dist/src/run-timings.d.ts +16 -0
- package/dist/src/run-timings.d.ts.map +1 -0
- package/dist/src/run-timings.js +59 -0
- package/dist/src/run-timings.js.map +1 -0
- package/dist/src/runners/inline-agent-runner.d.ts.map +1 -1
- package/dist/src/runners/inline-agent-runner.js +5 -1
- package/dist/src/runners/inline-agent-runner.js.map +1 -1
- package/dist/src/spi/agent-store.d.ts +84 -1
- package/dist/src/spi/agent-store.d.ts.map +1 -1
- package/dist/src/spi/agent-store.js +7 -0
- package/dist/src/spi/agent-store.js.map +1 -1
- package/dist/src/spi/governance-queries.d.ts +81 -0
- package/dist/src/spi/governance-queries.d.ts.map +1 -1
- package/dist/src/stores/lucid-governance-queries.d.ts +18 -1
- package/dist/src/stores/lucid-governance-queries.d.ts.map +1 -1
- package/dist/src/stores/lucid-governance-queries.js +176 -2
- package/dist/src/stores/lucid-governance-queries.js.map +1 -1
- package/dist/src/stores/lucid-schema.d.ts +20 -0
- package/dist/src/stores/lucid-schema.d.ts.map +1 -1
- package/dist/src/stores/lucid-schema.js +172 -20
- package/dist/src/stores/lucid-schema.js.map +1 -1
- package/dist/src/stores/lucid.d.ts +7 -0
- package/dist/src/stores/lucid.d.ts.map +1 -1
- package/dist/src/stores/lucid.js +38 -2
- package/dist/src/stores/lucid.js.map +1 -1
- package/dist/src/testing/in-memory-governance-queries.d.ts +11 -1
- package/dist/src/testing/in-memory-governance-queries.d.ts.map +1 -1
- package/dist/src/testing/in-memory-governance-queries.js +86 -2
- package/dist/src/testing/in-memory-governance-queries.js.map +1 -1
- package/dist/src/testing/in-memory-store.d.ts +13 -2
- package/dist/src/testing/in-memory-store.d.ts.map +1 -1
- package/dist/src/testing/in-memory-store.js +18 -1
- package/dist/src/testing/in-memory-store.js.map +1 -1
- package/dist/src/types.d.ts +6 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/usage-attribution.d.ts +10 -0
- package/dist/src/usage-attribution.d.ts.map +1 -0
- package/dist/src/usage-attribution.js +12 -0
- package/dist/src/usage-attribution.js.map +1 -0
- package/dist/src/usage-ledger.d.ts +9 -0
- package/dist/src/usage-ledger.d.ts.map +1 -0
- package/dist/src/usage-ledger.js +35 -0
- package/dist/src/usage-ledger.js.map +1 -0
- package/package.json +1 -1
- package/skills/agent-governance/SKILL.md +1 -1
- package/dist/assets/spa/assets/index-BsGunSCg.js +0 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @adonis-agora/agent
|
|
2
2
|
|
|
3
|
+
## 0.93.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#509](https://github.com/DavideCarvalho/adonis-agora-agent/pull/509) [`6dd2933`](https://github.com/DavideCarvalho/adonis-agora-agent/commit/6dd293330760da5ceddd03d4b3245a405ed2f109) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - One usage ledger for every AI cost, and where a run's time goes.
|
|
8
|
+
|
|
9
|
+
- `AgentService.recordUsage(input, { throwOnError? })` records AI spend from outside agent turns (transcription, TTS, batch embeddings, direct SDK calls) on `agent_token_usage`: `actorRef` (`null` → `PLATFORM_ACTOR_REF`, `'@platform'`), free-form `feature`, `modelId`, `provider`, tokens, `audioSeconds` / `characters` / `requests`, `costUsd` / `costSource`, optional `threadId` / `runId` / `tenantRef` / `metadata`. Never throws unless `throwOnError`; answers `{ recorded }`. Counts against the actor's quota (tokens in the token windows, cost in the USD windows, tokens bumped on the `QuotaStore`); platform cost counts against nobody.
|
|
10
|
+
- The ledger gains `feature`, `provider`, `tenant_ref`, `audio_seconds`, `characters`, `requests`, `metadata`, and a nullable `thread_id` (made nullable in place on Postgres/MySQL, by a table rebuild on SQLite; the foreign key and cascade stay). Agent-turn rows are labelled `agent:<agent name>`. `RecordUsageInput.threadId` is now optional and `UsagePurpose` gains `'external'`.
|
|
11
|
+
- Every ledger row is published as `agora:agent:usage.recorded` (amounts and attribution, never content).
|
|
12
|
+
- Governance: `spendByFeature` / `usageBreakdown` (cost by actor × feature) on `AgentGovernanceQueries`, `GET <path>/governance/spend/feature` and `/governance/usage/breakdown`; `RunUsageRow.feature`.
|
|
13
|
+
- Run timings: `agent_run` gains `queue_ms`, `model_ms`, `tools_ms`, `model_calls`, `tool_calls` and a per-step `timings` JSON. Queue time comes from the durable engine's run `createdAt` (≈0 inline), model time from the `llm.turn` span, tool time from the `tool.execution` measurement (`execution_ms`), wall-clock per step so parallel calls count once. Each figure is journaled with the step that measured it, so a resumed durable run counts every step once. `run.finished` carries `queueMs`, `modelMs`, `toolsMs`, `modelCalls`, `toolCalls`, `stepTimings`; `run.failed` / `run.cancelled` carry `queueMs` (and `run.failed` what it measured). `RunSummaryRow` and `RunDetail.timings` expose them.
|
|
14
|
+
- Dashboard: a "Spend by feature" panel on the Overview (agent turns and recorded usage side by side) and a "Where the time went" panel on the run trace (queue / model / tools / other, and each step).
|
|
15
|
+
|
|
3
16
|
## 0.92.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|