@t2000/engine 1.17.1 → 1.18.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/dist/index.d.ts +21 -20
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -96,10 +96,10 @@ interface RecipeStep {
|
|
|
96
96
|
cost_per_unit?: string;
|
|
97
97
|
/**
|
|
98
98
|
* [SPEC 7 P2.5 Layer 4] When true, this step is part of a multi-write
|
|
99
|
-
* Payment
|
|
99
|
+
* Payment Intent compile group. Steps with `bundle: true` MUST resolve
|
|
100
100
|
* to confirm-tier write tools that carry `bundleable: true` in
|
|
101
101
|
* `TOOL_FLAGS` (validated at recipe load time). The loader fails fast
|
|
102
|
-
* on auto-tier writes / read-only tools / non
|
|
102
|
+
* on auto-tier writes / read-only tools / non-`bundleable` confirm tools
|
|
103
103
|
* (`pay_api`, `save_contact`) inside a `bundle: true` group.
|
|
104
104
|
*
|
|
105
105
|
* The engine emits parallel `tool_use` blocks for `bundle: true`
|
|
@@ -915,7 +915,7 @@ interface PendingActionModifiableField {
|
|
|
915
915
|
asset?: string;
|
|
916
916
|
}
|
|
917
917
|
/**
|
|
918
|
-
* [SPEC 7 v0.4 Layer 2] One step inside a multi-write Payment
|
|
918
|
+
* [SPEC 7 v0.4 Layer 2] One step inside a multi-write Payment Intent
|
|
919
919
|
* `PendingAction`. Single-write actions never carry `steps[]`; the
|
|
920
920
|
* legacy `toolName`/`toolUseId`/`input`/`attemptId` fields cover them.
|
|
921
921
|
*/
|
|
@@ -1005,7 +1005,7 @@ interface PendingAction {
|
|
|
1005
1005
|
* exists to kill. Also survives session persistence so the resume call
|
|
1006
1006
|
* can read it back from the rehydrated `PendingAction`.
|
|
1007
1007
|
*
|
|
1008
|
-
* **Bundles:** when `steps !== undefined` (multi-write Payment
|
|
1008
|
+
* **Bundles:** when `steps !== undefined` (multi-write Payment Intent),
|
|
1009
1009
|
* the top-level `attemptId` mirrors `steps[0].attemptId` per SPEC 7
|
|
1010
1010
|
* § Layer 2 line 463 ("`steps[0]` mirrors the top-level
|
|
1011
1011
|
* toolName/toolUseId/input/attemptId for hosts that haven't been
|
|
@@ -1019,7 +1019,7 @@ interface PendingAction {
|
|
|
1019
1019
|
attemptId: string;
|
|
1020
1020
|
/**
|
|
1021
1021
|
* [SPEC 7 v0.4 Layer 2] When set, this `pending_action` represents a
|
|
1022
|
-
* multi-write Payment
|
|
1022
|
+
* multi-write Payment Intent. Single-step bundles are NOT created — the
|
|
1023
1023
|
* engine emits the legacy single-write shape when N=1. Hosts that haven't
|
|
1024
1024
|
* been updated read `toolName`/`toolUseId`/`input` (which mirror
|
|
1025
1025
|
* `steps[0]`); newer hosts iterate `steps`.
|
|
@@ -1091,7 +1091,7 @@ interface PermissionResponse {
|
|
|
1091
1091
|
* Each carries the step's `toolUseId` + `attemptId` so the host's resume
|
|
1092
1092
|
* route can update the matching `TurnMetrics` row.
|
|
1093
1093
|
*
|
|
1094
|
-
* **Atomic semantics:**
|
|
1094
|
+
* **Atomic semantics:** Payment Intent execution is atomic at the Sui layer. If the
|
|
1095
1095
|
* host detects a bundle-level failure, it should populate every entry
|
|
1096
1096
|
* with `isError: true` carrying the same error message (so the LLM
|
|
1097
1097
|
* narrates the failure once, not N times).
|
|
@@ -1204,7 +1204,7 @@ interface ToolFlags {
|
|
|
1204
1204
|
maxRetries?: number;
|
|
1205
1205
|
/**
|
|
1206
1206
|
* [SPEC 7 v0.4 Layer 2] Opt-in: this write tool can participate in a
|
|
1207
|
-
* multi-write Payment
|
|
1207
|
+
* multi-write Payment Intent. When the LLM emits ≥2 `tool_use` blocks
|
|
1208
1208
|
* in a single assistant turn AND every block resolves to a `confirm`-tier
|
|
1209
1209
|
* write tool with `bundleable: true`, the engine collapses them into one
|
|
1210
1210
|
* `pending_action` with `steps[]` instead of yielding N times. Default
|
|
@@ -1215,8 +1215,8 @@ interface ToolFlags {
|
|
|
1215
1215
|
* **Permanently non-bundleable:**
|
|
1216
1216
|
* - `pay_api` — recipient/amount/currency aren't known at LLM intent
|
|
1217
1217
|
* time (gateway 402 challenge resolves them at route time, after a
|
|
1218
|
-
* network round-trip the engine has no knowledge of).
|
|
1219
|
-
* composed at compose time.
|
|
1218
|
+
* network round-trip the engine has no knowledge of). Payment Intent
|
|
1219
|
+
* cannot be composed at compose time.
|
|
1220
1220
|
* - `save_contact` — Postgres-only, no on-chain effect.
|
|
1221
1221
|
*/
|
|
1222
1222
|
bundleable?: boolean;
|
|
@@ -1690,7 +1690,7 @@ declare function validateHistory(messages: Message[]): Message[];
|
|
|
1690
1690
|
/**
|
|
1691
1691
|
* SPEC 7 v0.3 Quote-Refresh ReviewCard — per-tool result freshness budgets.
|
|
1692
1692
|
*
|
|
1693
|
-
* When a Payment
|
|
1693
|
+
* When a Payment Intent `pending_action` is composed at T=0 from upstream
|
|
1694
1694
|
* read results, the user may take 30–60s to read + tap APPROVE. By that
|
|
1695
1695
|
* time some upstream results have drifted (Cetus quotes refresh in
|
|
1696
1696
|
* ~30s; NAVI APYs change slower). The host renders a "QUOTE Ns OLD"
|
|
@@ -1755,15 +1755,15 @@ declare const REGENERATABLE_READ_TOOLS: ReadonlySet<string>;
|
|
|
1755
1755
|
* relaxed to DAG-aware: only pairs that actually chain via
|
|
1756
1756
|
* `inputCoinFromStep` need whitelist checking. Standalone steps
|
|
1757
1757
|
* interleaved between chained steps run wallet-mode independently
|
|
1758
|
-
* inside the same atomic
|
|
1758
|
+
* inside the same atomic Payment Intent.** This unlocks Demo 1 ("swap 10% to
|
|
1759
1759
|
* SUI, save 50% as USDsui, send $100 to Mom" — 4-op DAG with one
|
|
1760
1760
|
* chain at step 1→2, three standalone wallet-mode steps).
|
|
1761
1761
|
*
|
|
1762
1762
|
* **DAG-aware semantics.** Pre-3a: every adjacent pair gates the entire
|
|
1763
1763
|
* bundle. Phase 3a+: each (i, i+1) pair contributes IF a chain is wired
|
|
1764
1764
|
* (via `shouldChainCoin`). Non-chained pairs are independent — they
|
|
1765
|
-
* each pre-fetch their own coin from the wallet inside the
|
|
1766
|
-
* settlement at the
|
|
1765
|
+
* each pre-fetch their own coin from the wallet inside the Payment Intent.
|
|
1766
|
+
* Atomic settlement at the Payment Intent level holds either way.
|
|
1767
1767
|
*
|
|
1768
1768
|
* **Phase 3b (deferred):** `swap_execute → swap_execute` whitelist add
|
|
1769
1769
|
* for explicit multi-hop swap chains (rare; flag-gated when shipped).
|
|
@@ -1785,7 +1785,7 @@ declare const MAX_BUNDLE_OPS = 4;
|
|
|
1785
1785
|
*
|
|
1786
1786
|
* | Pair | Why it works at compose time today |
|
|
1787
1787
|
* |---|---|
|
|
1788
|
-
* | `swap_execute → send_transfer` | Swap's `tx.transferObjects([result.coin], sender)` lands the swap output in the wallet for the same
|
|
1788
|
+
* | `swap_execute → send_transfer` | Swap's `tx.transferObjects([result.coin], sender)` lands the swap output in the wallet for the same Payment Intent; send's `selectAndSplitCoin` finds it. |
|
|
1789
1789
|
* | `swap_execute → save_deposit` | Same mechanism — swap output is back in wallet for save's coin fetch. (P0 caveat: this currently *fails* if the wallet has zero of `swap.to` BEFORE the swap step. Phase 1's `inputCoinFromStep` fixes that. For now we accept the pair but warn the LLM in the prompt rule that wallet must hold ≥0 of target asset.) |
|
|
1790
1790
|
* | `swap_execute → repay_debt` | Same as save. Same caveat. |
|
|
1791
1791
|
* | `withdraw → swap_execute` | Withdraw's output is transferred to user; swap's coin fetch finds it. Same wallet caveat in reverse. |
|
|
@@ -1913,7 +1913,7 @@ declare function composeBundleFromToolResults(input: BundleCompositionInput): Pe
|
|
|
1913
1913
|
/**
|
|
1914
1914
|
* SPEC 7 v0.3 Quote-Refresh ReviewCard — engine-side bundle regeneration.
|
|
1915
1915
|
*
|
|
1916
|
-
* When a user takes 30–60s to read a multi-step Payment
|
|
1916
|
+
* When a user takes 30–60s to read a multi-step Payment Intent
|
|
1917
1917
|
* `pending_action`, the upstream read results that fed bundle composition
|
|
1918
1918
|
* (Cetus quotes, NAVI APYs, wallet balances) drift. Today the user has to
|
|
1919
1919
|
* either approve with stale data (Sui dry-run is the safety gate, but the
|
|
@@ -2179,11 +2179,12 @@ declare class MemorySessionStore implements SessionStore {
|
|
|
2179
2179
|
* producesArtifact — returns images, documents, generated content
|
|
2180
2180
|
* costAware — has a monetary cost the user should know about
|
|
2181
2181
|
* maxRetries — max calls with same input (default: unlimited for reads, 1 for writes)
|
|
2182
|
-
* bundleable — [SPEC 7 Layer 2] can participate in a multi-write Payment
|
|
2183
|
-
*
|
|
2184
|
-
* fully expressible at compose time. Excluded: `pay_api`
|
|
2185
|
-
* amount/currency unknown until gateway 402 challenge
|
|
2186
|
-
* route time) and `save_contact` (Postgres-only, no
|
|
2182
|
+
* bundleable — [SPEC 7 Layer 2] can participate in a multi-write Payment
|
|
2183
|
+
* Intent. Set on every confirm-tier write whose on-chain effect
|
|
2184
|
+
* is fully expressible at compose time. Excluded: `pay_api`
|
|
2185
|
+
* (recipient/amount/currency unknown until gateway 402 challenge
|
|
2186
|
+
* resolves at route time) and `save_contact` (Postgres-only, no
|
|
2187
|
+
* on-chain effect).
|
|
2187
2188
|
*/
|
|
2188
2189
|
declare const TOOL_FLAGS: Record<string, ToolFlags>;
|
|
2189
2190
|
/**
|