@stelis/say-ur-intent 0.0.0 → 0.0.2
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/README.md +4 -39
- package/dist/adapters/adapterLifecycleValidators.js +7 -0
- package/dist/adapters/adapterPromptSurfaces.js +71 -0
- package/dist/adapters/deepbook/deepbookHumanReviewProducer.js +175 -0
- package/dist/adapters/deepbook/deepbookQuotePolicy.js +112 -0
- package/dist/adapters/deepbook/deepbookReviewEvidence.js +507 -0
- package/dist/adapters/deepbook/deepbookReviewLifecycle.js +85 -0
- package/dist/adapters/deepbook/deepbookSwapIntent.js +79 -0
- package/dist/adapters/deepbook/deepbookTransactionMaterialProducer.js +269 -0
- package/dist/adapters/flowx/flowxSwapHumanReviewProducer.js +176 -0
- package/dist/adapters/flowx/flowxSwapIntent.js +79 -0
- package/dist/adapters/flowx/flowxSwapQuotePolicy.js +104 -0
- package/dist/adapters/flowx/flowxSwapReviewEvidence.js +468 -0
- package/dist/adapters/flowx/flowxSwapReviewLifecycle.js +85 -0
- package/dist/adapters/flowx/flowxSwapTransactionMaterialProducer.js +362 -0
- package/dist/adapters/intentPlanFactories.js +59 -0
- package/dist/adapters/reviewAdapters.js +81 -0
- package/dist/core/action/adapterLifecycleValidation.js +12 -0
- package/dist/core/action/forbiddenFields.js +43 -0
- package/dist/core/action/humanReadableReviewEvidence.js +203 -0
- package/dist/core/action/humanReadableReviewProjectionVerifier.js +29 -0
- package/dist/core/action/ptbVisualizationProducer.js +66 -0
- package/dist/core/action/reviewCheckResults.js +6 -0
- package/dist/core/action/reviewStateValidation.js +11 -0
- package/dist/core/action/reviewTimeSimulationEvidence.js +471 -0
- package/dist/core/action/schemas.js +529 -0
- package/dist/core/action/signableAdapterContract.js +993 -0
- package/dist/core/action/swapHumanReadableReviewProjection.js +124 -0
- package/dist/core/action/swapQuotePolicyEvidence.js +278 -0
- package/dist/core/action/transactionObjectOwnershipEvidence.js +247 -0
- package/dist/core/action/transactionObjectOwnershipProducer.js +329 -0
- package/dist/core/action/types.js +35 -0
- package/dist/core/action/walletReviewContractAssembler.js +282 -0
- package/dist/core/activity/activityStore.js +15 -0
- package/dist/core/activity/localDataService.js +258 -0
- package/dist/core/activity/localDataTypes.js +11 -0
- package/dist/core/activity/localDataValidation.js +396 -0
- package/dist/core/activity/schemaVersion.js +1 -0
- package/dist/core/activity/sqliteActivityStore.js +820 -0
- package/dist/core/activity/sqliteActivityStoreRows.js +430 -0
- package/dist/core/activity/sqliteActivityStoreSchema.js +258 -0
- package/dist/core/activity/sqliteActivityStoreTypes.js +5 -0
- package/dist/core/activity/suiFunctionTarget.js +43 -0
- package/dist/core/activity/transactionActivityAccountEffects.js +189 -0
- package/dist/core/activity/transactionActivityAnalysis.js +295 -0
- package/dist/core/activity/transactionActivityClassifier.js +306 -0
- package/dist/core/activity/transactionActivityDetails.js +229 -0
- package/dist/core/activity/transactionActivityProtocolRules.js +218 -0
- package/dist/core/activity/transactionActivityScanPolicy.js +170 -0
- package/dist/core/activity/transactionActivityService.js +379 -0
- package/dist/core/activity/transactionActivityTypes.js +18 -0
- package/dist/core/eventlog/sink.js +35 -0
- package/dist/core/evidence/settlementFamilies.js +87 -0
- package/dist/core/evidence/userAnswerUse.js +1 -0
- package/dist/core/numeric/rawU64.js +63 -0
- package/dist/core/preferences/preferencesStore.js +26 -0
- package/dist/core/preferences/sqlitePreferencesRepository.js +136 -0
- package/dist/core/proposal/externalProposalReview.js +347 -0
- package/dist/core/proposal/schemas.js +208 -0
- package/dist/core/proposal/types.js +35 -0
- package/dist/core/read/amounts.js +14 -0
- package/dist/core/read/coinMetadata.js +60 -0
- package/dist/core/read/deepbookRawQuoteClient.js +86 -0
- package/dist/core/read/deepbookReadHelpers.js +265 -0
- package/dist/core/read/deepbookRegistry.js +133 -0
- package/dist/core/read/flowxQuoteClient.js +117 -0
- package/dist/core/read/flowxReadHelpers.js +145 -0
- package/dist/core/read/flowxRegistry.js +174 -0
- package/dist/core/read/intentEvidenceResponseFormatting.js +228 -0
- package/dist/core/read/readResponseGuidance.js +451 -0
- package/dist/core/read/readService.js +1164 -0
- package/dist/core/read/readServiceTypes.js +59 -0
- package/dist/core/read/settlementParityFormatting.js +82 -0
- package/dist/core/read/walletReadHelpers.js +99 -0
- package/dist/core/review/reviewChecks.js +54 -0
- package/dist/core/review/reviewComputation.js +38 -0
- package/dist/core/review/reviewComputationResult.js +87 -0
- package/dist/core/session/localSession.js +31 -0
- package/dist/core/session/privateReviewArtifacts.js +73 -0
- package/dist/core/session/sessionErrors.js +9 -0
- package/dist/core/session/sessionStore.js +821 -0
- package/dist/core/session/settingsSession.js +1 -0
- package/dist/core/session/settingsSessions.js +43 -0
- package/dist/core/session/status.js +86 -0
- package/dist/core/session/transactionMaterialStore.js +205 -0
- package/dist/core/session/wait.js +102 -0
- package/dist/core/session/walletIdentity.js +103 -0
- package/dist/core/session/walletIdentitySessions.js +189 -0
- package/dist/core/suiAddress.js +18 -0
- package/dist/core/suiEndpoint.js +72 -0
- package/dist/mcp/activeAccountResponse.js +24 -0
- package/dist/mcp/prompts.js +146 -0
- package/dist/mcp/registerTool.js +19 -0
- package/dist/mcp/resources.js +72 -0
- package/dist/mcp/responseGuidance.js +381 -0
- package/dist/mcp/result.js +17 -0
- package/dist/mcp/schemas.js +8 -0
- package/dist/mcp/server.js +30 -0
- package/dist/mcp/serverInfo.js +123 -0
- package/dist/mcp/toolErrors.js +105 -0
- package/dist/mcp/toolNames.js +50 -0
- package/dist/mcp/tools/account/index.js +44 -0
- package/dist/mcp/tools/action/prepareSuiActionReview.js +120 -0
- package/dist/mcp/tools/read/commonSchemas.js +43 -0
- package/dist/mcp/tools/read/deepbookReadTools.js +453 -0
- package/dist/mcp/tools/read/flowxReadTools.js +135 -0
- package/dist/mcp/tools/read/index.js +16 -0
- package/dist/mcp/tools/read/readToolHelpers.js +68 -0
- package/dist/mcp/tools/read/reviewActivityTools.js +176 -0
- package/dist/mcp/tools/read/serverStatusTools.js +103 -0
- package/dist/mcp/tools/read/transactionActivityOutput.js +300 -0
- package/dist/mcp/tools/read/transactionActivityTools.js +544 -0
- package/dist/mcp/tools/read/walletReadTools.js +733 -0
- package/dist/mcp/tools/session/executionResultTools.js +92 -0
- package/dist/mcp/tools/session/index.js +8 -0
- package/dist/mcp/tools/session/shared.js +79 -0
- package/dist/mcp/tools/session/statusTools.js +134 -0
- package/dist/mcp/tools/session/walletIdentityTools.js +119 -0
- package/dist/mcp/tools/settings/index.js +64 -0
- package/dist/review-app/analysis.css +1 -0
- package/dist/review-app/analysis.js +1 -0
- package/dist/review-app/arc-BjIacwQm.js +1 -0
- package/dist/review-app/architecture-U656AL7Q-aSB9x1OK.js +1 -0
- package/dist/review-app/architectureDiagram-VXUJARFQ-C5W6re2I.js +36 -0
- package/dist/review-app/array-BmXUUrU6.js +1 -0
- package/dist/review-app/blockDiagram-VD42YOAC-20MLNcUm.js +122 -0
- package/dist/review-app/c4Diagram-YG6GDRKO-BZXRrcck.js +10 -0
- package/dist/review-app/channel-lk2p_CUu.js +1 -0
- package/dist/review-app/chunk-4BX2VUAB-BPITOdjX.js +1 -0
- package/dist/review-app/chunk-55IACEB6-Dz-pyw5k.js +1 -0
- package/dist/review-app/chunk-76Q3JFCE-cK_X1P_l.js +1 -0
- package/dist/review-app/chunk-ABZYJK2D-Dt4W53JI.js +81 -0
- package/dist/review-app/chunk-ATLVNIR6-fZHLXURb.js +1 -0
- package/dist/review-app/chunk-B4BG7PRW-BbgcjusC.js +165 -0
- package/dist/review-app/chunk-BJD4TVEz.js +1 -0
- package/dist/review-app/chunk-CVBHYZKI-CViawAKX.js +1 -0
- package/dist/review-app/chunk-DI55MBZ5-C5aoul-d.js +220 -0
- package/dist/review-app/chunk-FMBD7UC4-Chxmw62A.js +15 -0
- package/dist/review-app/chunk-FPAJGGOC-DDHjQ09H.js +80 -0
- package/dist/review-app/chunk-FWNWRKHM-CVVQUptk.js +1 -0
- package/dist/review-app/chunk-HN2XXSSU-yzNpjaSZ.js +1 -0
- package/dist/review-app/chunk-JA3XYJ7Z-C5ZJdU01.js +70 -0
- package/dist/review-app/chunk-JZLCHNYA-BBST4Cnk.js +54 -0
- package/dist/review-app/chunk-LBM3YZW2-CdwAPuHr.js +1 -0
- package/dist/review-app/chunk-LHMN2FUI-BtB5uDcp.js +1 -0
- package/dist/review-app/chunk-O7ZBX7Z2-pxdK4Sa3.js +1 -0
- package/dist/review-app/chunk-QN33PNHL-CbVv3uGK.js +1 -0
- package/dist/review-app/chunk-QXUST7PY-DKM2-t2c.js +7 -0
- package/dist/review-app/chunk-QZHKN3VN-C5ni2pN_.js +1 -0
- package/dist/review-app/chunk-S3R3BYOJ-BWvOhDs0.js +2 -0
- package/dist/review-app/chunk-S6J4BHB3-D9Fk0YeD.js +1 -0
- package/dist/review-app/chunk-T53DSG4Q-C1qEyzyV.js +1 -0
- package/dist/review-app/chunk-TZMSLE5B-B--7eU69.js +1 -0
- package/dist/review-app/classDiagram-2ON5EDUG-DlL1m2bp.js +1 -0
- package/dist/review-app/classDiagram-v2-WZHVMYZB-FXRskT1j.js +1 -0
- package/dist/review-app/clone-BZZb7gpZ.js +1 -0
- package/dist/review-app/cose-bilkent-S5V4N54A-CRIb8XEO.js +1 -0
- package/dist/review-app/cytoscape.esm-C7jYqDP5.js +321 -0
- package/dist/review-app/dagre-6UL2VRFP-FNCAXbdE.js +4 -0
- package/dist/review-app/dagre-Be46QtUd.js +1 -0
- package/dist/review-app/defaultLocale-BaWNtAUL.js +1 -0
- package/dist/review-app/diagram-PSM6KHXK-ylLWjiNM.js +24 -0
- package/dist/review-app/diagram-QEK2KX5R-BCDcESxs.js +43 -0
- package/dist/review-app/diagram-S2PKOQOG-Vdrc-vrO.js +24 -0
- package/dist/review-app/dist-WPc74x_f.js +1 -0
- package/dist/review-app/erDiagram-Q2GNP2WA-E5ZsUbDF.js +60 -0
- package/dist/review-app/flatten-DHf9IeNI.js +1 -0
- package/dist/review-app/flowDiagram-NV44I4VS-DBSQuj6x.js +162 -0
- package/dist/review-app/ganttDiagram-LVOFAZNH-CKUOsqwl.js +267 -0
- package/dist/review-app/gitGraph-F6HP7TQM-DsAD6qK1.js +1 -0
- package/dist/review-app/gitGraphDiagram-NY62KEGX-BCeIMWdl.js +65 -0
- package/dist/review-app/graphlib-CiX5CXxR.js +1 -0
- package/dist/review-app/http-DMvwuuFk.js +1 -0
- package/dist/review-app/identity-DY8PXc6t.js +1 -0
- package/dist/review-app/info-NVLQJR56-Dlx1nZic.js +1 -0
- package/dist/review-app/infoDiagram-F6ZHWCRC-CAuANIrz.js +2 -0
- package/dist/review-app/init-BvqephKz.js +1 -0
- package/dist/review-app/journeyDiagram-XKPGCS4Q-C-Z9phnx.js +139 -0
- package/dist/review-app/kanban-definition-3W4ZIXB7-DufgZABq.js +89 -0
- package/dist/review-app/katex-B-Z-NXXN.js +257 -0
- package/dist/review-app/line-DiIv3Jgw.js +1 -0
- package/dist/review-app/linear-Cv-UPvo1.js +1 -0
- package/dist/review-app/math-kmyYrkHL.js +1 -0
- package/dist/review-app/mermaid-parser.core-DkwUYTPl.js +4 -0
- package/dist/review-app/mindmap-definition-VGOIOE7T-TM_CqdmV.js +68 -0
- package/dist/review-app/ordinal-BliTlkoG.js +1 -0
- package/dist/review-app/packet-BFZMPI3H-DqbnU92v.js +1 -0
- package/dist/review-app/path-AEo9W6mQ.js +1 -0
- package/dist/review-app/pie-7BOR55EZ-LJzaLkgr.js +1 -0
- package/dist/review-app/pieDiagram-ADFJNKIX-BAs8OfRS.js +30 -0
- package/dist/review-app/quadrantDiagram-AYHSOK5B-CyUDZP5S.js +7 -0
- package/dist/review-app/radar-NHE76QYJ-DBpHc8_Y.js +1 -0
- package/dist/review-app/reduce-B-HuPpdd.js +1 -0
- package/dist/review-app/requirementDiagram-UZGBJVZJ-BEHix78P.js +64 -0
- package/dist/review-app/review.css +1 -0
- package/dist/review-app/review.js +43 -0
- package/dist/review-app/sankeyDiagram-TZEHDZUN-B2bKbmsm.js +10 -0
- package/dist/review-app/sequenceDiagram-WL72ISMW-DVLOORFJ.js +145 -0
- package/dist/review-app/settings.css +1 -0
- package/dist/review-app/settings.js +1 -0
- package/dist/review-app/src-Buml7cM5.js +1 -0
- package/dist/review-app/stateDiagram-FKZM4ZOC-sFGGp2kV.js +1 -0
- package/dist/review-app/stateDiagram-v2-4FDKWEC3-BHfCF4dX.js +1 -0
- package/dist/review-app/timeline-definition-IT6M3QCI-BESnBijC.js +61 -0
- package/dist/review-app/treemap-KMMF4GRG-wnVLBDeQ.js +1 -0
- package/dist/review-app/walletStatus-CcojOdGy.js +7 -0
- package/dist/review-app/xychartDiagram-PRI3JC2R-BGWVfCx4.js +7 -0
- package/dist/review-server/assets.js +48 -0
- package/dist/review-server/html.js +66 -0
- package/dist/review-server/http.js +47 -0
- package/dist/review-server/middleware/hostOrigin.js +48 -0
- package/dist/review-server/middleware/reviewToken.js +7 -0
- package/dist/review-server/reviewServerPolicy.js +10 -0
- package/dist/review-server/server.js +568 -0
- package/dist/review-server/settingsApi.js +182 -0
- package/dist/review-server/walletIdentityResponse.js +13 -0
- package/dist/runtime/config.js +103 -0
- package/dist/runtime/localSettingsService.js +198 -0
- package/dist/runtime/logger.js +50 -0
- package/dist/runtime/reviewServerAcquire.js +128 -0
- package/dist/runtime/smokeMainnetRead.js +529 -0
- package/dist/runtime/smokeMainnetReadAssertions.js +308 -0
- package/dist/runtime/start.js +295 -0
- package/dist/runtime/suiEndpoint.js +97 -0
- package/dist/runtime/suiTransactionGraphqlMapping.js +200 -0
- package/dist/runtime/suiTransactionGraphqlQueries.js +231 -0
- package/dist/runtime/suiTransactionGraphqlSource.js +148 -0
- package/docs/AGENT_BEHAVIOR.md +1 -1
- package/docs/AGENT_DEVELOPMENT_POLICY.md +20 -0
- package/docs/FRONTEND_POLICY.md +4 -3
- package/docs/MCP_SETUP.md +59 -7
- package/docs/MCP_TOOLS.md +1 -1
- package/docs/SDK_API.md +5 -1
- package/package.json +3 -2
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
const intentEvidenceConclusionRuleFields = [
|
|
2
|
+
"responseSummary.doNotCallQuoteToolsForThisQuestion",
|
|
3
|
+
"responseSummary.separateQuoteOutputs",
|
|
4
|
+
"responseSummary.doNotUseForConclusion",
|
|
5
|
+
"responseSummary.excludedFromConclusion",
|
|
6
|
+
"unsupportedClaims"
|
|
7
|
+
];
|
|
8
|
+
export function walletBalanceUserAnswerUse() {
|
|
9
|
+
return {
|
|
10
|
+
canAnswer: [
|
|
11
|
+
"current_coin_balance_snapshot",
|
|
12
|
+
"current_coin_balance_display_amount_when_balance_unit_status_is_available"
|
|
13
|
+
],
|
|
14
|
+
cannotAnswer: [
|
|
15
|
+
"transaction_history",
|
|
16
|
+
"specific_transaction_receipt",
|
|
17
|
+
"specific_transaction_balance_delta",
|
|
18
|
+
"acquisition_source",
|
|
19
|
+
"object_provenance",
|
|
20
|
+
"payment_coverage_or_shortfall",
|
|
21
|
+
"usd_denominated_settlement_asset_balance_total",
|
|
22
|
+
"fiat_usd_cash_out",
|
|
23
|
+
"profit_or_pnl",
|
|
24
|
+
"cost_basis",
|
|
25
|
+
"signing_data_or_readiness"
|
|
26
|
+
],
|
|
27
|
+
answerFields: [
|
|
28
|
+
"account",
|
|
29
|
+
"fetchedAt",
|
|
30
|
+
"balances[].coinType",
|
|
31
|
+
"balances[].balance",
|
|
32
|
+
"balances[].unit",
|
|
33
|
+
"balances[].display"
|
|
34
|
+
],
|
|
35
|
+
diagnosticOnlyFields: ["source", "quantitySemantics", "hasNextPage", "cursor"],
|
|
36
|
+
followUp: {
|
|
37
|
+
tool: "read.preview_intent_evidence",
|
|
38
|
+
inputFields: ["account"],
|
|
39
|
+
answerFields: ["responseSummary"],
|
|
40
|
+
reason: "Use for USD-denominated payment coverage, balance-total, or shortfall answers; wallet balances are current coin snapshots only."
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export function walletClassificationUserAnswerUse() {
|
|
45
|
+
return {
|
|
46
|
+
canAnswer: [
|
|
47
|
+
"current_coin_balance_classification",
|
|
48
|
+
"current_coin_balance_display_amount_when_balance_unit_status_is_available",
|
|
49
|
+
"which_asset_classes_were_not_inspected_by_this_classifier"
|
|
50
|
+
],
|
|
51
|
+
cannotAnswer: [
|
|
52
|
+
"complete_portfolio_inventory",
|
|
53
|
+
"transaction_history",
|
|
54
|
+
"specific_transaction_receipt",
|
|
55
|
+
"payment_coverage_or_shortfall",
|
|
56
|
+
"usd_denominated_settlement_asset_balance_total",
|
|
57
|
+
"route_or_funding_plan",
|
|
58
|
+
"fiat_usd_cash_out",
|
|
59
|
+
"profit_or_pnl",
|
|
60
|
+
"cost_basis",
|
|
61
|
+
"signing_data_or_readiness"
|
|
62
|
+
],
|
|
63
|
+
answerFields: [
|
|
64
|
+
"account",
|
|
65
|
+
"fetchedAt",
|
|
66
|
+
"classifiedAssets[].balance",
|
|
67
|
+
"classifiedAssets[].classification",
|
|
68
|
+
"uninspectedAssetClasses"
|
|
69
|
+
],
|
|
70
|
+
diagnosticOnlyFields: ["source", "quantitySemantics", "hasNextPage", "cursor"],
|
|
71
|
+
followUp: {
|
|
72
|
+
tool: "read.preview_intent_evidence",
|
|
73
|
+
inputFields: ["account"],
|
|
74
|
+
answerFields: ["responseSummary"],
|
|
75
|
+
reason: "Use for USD-denominated payment coverage, balance-total, or shortfall answers; classification labels are not payment evidence."
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
export function settlementAssetGroupParityUserAnswerUse() {
|
|
80
|
+
return {
|
|
81
|
+
canAnswer: [
|
|
82
|
+
"settlement_asset_group_internal_parity_statistics",
|
|
83
|
+
"highest_lowest_mean_or_median_parity_from_available_direct_deepbook_mid_price_snapshots"
|
|
84
|
+
],
|
|
85
|
+
cannotAnswer: [
|
|
86
|
+
"settlement_token_selection",
|
|
87
|
+
"payment_coverage_or_shortfall",
|
|
88
|
+
"fiat_usd_cash_out",
|
|
89
|
+
"external_market_price_conversion",
|
|
90
|
+
"usd_peg_assumption",
|
|
91
|
+
"payment_execution_readiness",
|
|
92
|
+
"route_recommendation",
|
|
93
|
+
"transaction_building",
|
|
94
|
+
"signing_data_or_readiness",
|
|
95
|
+
"profit_or_pnl",
|
|
96
|
+
"cost_basis"
|
|
97
|
+
],
|
|
98
|
+
answerFields: [
|
|
99
|
+
"responseSummary",
|
|
100
|
+
"responseSummary.min",
|
|
101
|
+
"responseSummary.max",
|
|
102
|
+
"responseSummary.mean",
|
|
103
|
+
"responseSummary.median",
|
|
104
|
+
"responseSummary.referenceAssetRole",
|
|
105
|
+
"fetchedAt"
|
|
106
|
+
],
|
|
107
|
+
conclusionRuleFields: ["responseSummary.excludedFromConclusion", "unsupportedClaims"],
|
|
108
|
+
diagnosticOnlyFields: ["assets", "statistics", "evidenceSources", "quantitySemantics"]
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
export function intentEvidenceUserAnswerUse(settlementAssetCoverageStatus, responseEvidence = "settlement_asset_only") {
|
|
112
|
+
const responseEvidenceMode = typeof responseEvidence === "string" ? responseEvidence : responseEvidence.mode;
|
|
113
|
+
const hasDirectQuoteEvidence = typeof responseEvidence !== "string" &&
|
|
114
|
+
responseEvidence.supportedResponseClaims.includes("direct_pool_quote_evidence");
|
|
115
|
+
if (settlementAssetCoverageStatus === "unavailable_mixed_decimals" ||
|
|
116
|
+
settlementAssetCoverageStatus === "unavailable_wallet_balance_scan_incomplete") {
|
|
117
|
+
return {
|
|
118
|
+
canAnswer: [
|
|
119
|
+
"why_usd_denominated_payment_coverage_is_unavailable",
|
|
120
|
+
"required_user_choices_for_the_supported_settlement_asset_group"
|
|
121
|
+
],
|
|
122
|
+
cannotAnswer: [
|
|
123
|
+
"usd_denominated_settlement_asset_balance_total",
|
|
124
|
+
"usd_denominated_payment_coverage_status",
|
|
125
|
+
"usd_denominated_payment_shortfall",
|
|
126
|
+
"settlement_token_selection",
|
|
127
|
+
"route_dependent_payment_support",
|
|
128
|
+
"gas_reserve_or_fee_readiness",
|
|
129
|
+
"payment_execution_readiness",
|
|
130
|
+
"transaction_building",
|
|
131
|
+
"signing_data_or_readiness",
|
|
132
|
+
"fiat_usd_cash_out",
|
|
133
|
+
"profit_or_pnl",
|
|
134
|
+
"cost_basis"
|
|
135
|
+
],
|
|
136
|
+
answerFields: [
|
|
137
|
+
"responseSummary",
|
|
138
|
+
"responseSummary.conclusionKind",
|
|
139
|
+
"responseSummary.requiredDisplayAmount",
|
|
140
|
+
"responseSummary.unavailableReason",
|
|
141
|
+
"responseSummary.requiredUserChoices",
|
|
142
|
+
"blockedReasons"
|
|
143
|
+
],
|
|
144
|
+
conclusionRuleFields: [...intentEvidenceConclusionRuleFields],
|
|
145
|
+
diagnosticOnlyFields: [
|
|
146
|
+
"evidenceSources",
|
|
147
|
+
"quantitySemantics",
|
|
148
|
+
"settlementAssetGroup",
|
|
149
|
+
"balances",
|
|
150
|
+
"aggregate",
|
|
151
|
+
"candidateConversions",
|
|
152
|
+
"uninspectedAssetClasses"
|
|
153
|
+
]
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
const selectedTargetAnswerFields = responseEvidenceMode === "selected_target_context"
|
|
157
|
+
? [
|
|
158
|
+
"selectedTarget",
|
|
159
|
+
"selectedTarget.selectionSource",
|
|
160
|
+
"selectedTarget.currentDisplayAmount",
|
|
161
|
+
"selectedTarget.shortfallDisplayAmount",
|
|
162
|
+
"candidateConversions",
|
|
163
|
+
"candidateConversions[].sourceSymbol",
|
|
164
|
+
"candidateConversions[].targetSymbol",
|
|
165
|
+
"candidateConversions[].sourceDisplayAmount",
|
|
166
|
+
"candidateConversions[].status",
|
|
167
|
+
"requiredUserChoices"
|
|
168
|
+
]
|
|
169
|
+
: [];
|
|
170
|
+
const selectedTargetCanAnswer = responseEvidenceMode === "selected_target_context"
|
|
171
|
+
? [
|
|
172
|
+
"selected_target_shortfall",
|
|
173
|
+
...(hasDirectQuoteEvidence ? ["direct_pool_quote_evidence_for_user_selected_target"] : [])
|
|
174
|
+
]
|
|
175
|
+
: [];
|
|
176
|
+
return {
|
|
177
|
+
canAnswer: [
|
|
178
|
+
"usd_denominated_settlement_asset_balance_total",
|
|
179
|
+
"usd_denominated_payment_coverage_status",
|
|
180
|
+
"usd_denominated_payment_shortfall",
|
|
181
|
+
"required_user_choices_for_the_supported_settlement_asset_group",
|
|
182
|
+
...selectedTargetCanAnswer
|
|
183
|
+
],
|
|
184
|
+
cannotAnswer: [
|
|
185
|
+
"settlement_token_selection",
|
|
186
|
+
"route_dependent_payment_support",
|
|
187
|
+
"gas_reserve_or_fee_readiness",
|
|
188
|
+
"payment_execution_readiness",
|
|
189
|
+
"transaction_building",
|
|
190
|
+
"signing_data_or_readiness",
|
|
191
|
+
"fiat_usd_cash_out",
|
|
192
|
+
"profit_or_pnl",
|
|
193
|
+
"cost_basis"
|
|
194
|
+
],
|
|
195
|
+
answerFields: [
|
|
196
|
+
"responseSummary",
|
|
197
|
+
"responseSummary.currentDisplayAmount",
|
|
198
|
+
"responseSummary.requiredDisplayAmount",
|
|
199
|
+
"responseSummary.shortfallDisplayAmount",
|
|
200
|
+
"responseSummary.amountsUsedForAnswer",
|
|
201
|
+
"responseSummary.requiredUserChoices",
|
|
202
|
+
...selectedTargetAnswerFields
|
|
203
|
+
],
|
|
204
|
+
conclusionRuleFields: [...intentEvidenceConclusionRuleFields],
|
|
205
|
+
diagnosticOnlyFields: [
|
|
206
|
+
"evidenceSources",
|
|
207
|
+
"quantitySemantics",
|
|
208
|
+
"settlementAssetGroup",
|
|
209
|
+
"balances",
|
|
210
|
+
"aggregate",
|
|
211
|
+
"blockedReasons",
|
|
212
|
+
"uninspectedAssetClasses"
|
|
213
|
+
]
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
export function deepbookOrderbookUserAnswerUse() {
|
|
217
|
+
return {
|
|
218
|
+
canAnswer: [
|
|
219
|
+
"deepbook_pool_orderbook_context_at_fetchedAt",
|
|
220
|
+
"deepbook_pool_mid_price_context_returned_with_the_orderbook_snapshot"
|
|
221
|
+
],
|
|
222
|
+
cannotAnswer: [
|
|
223
|
+
"live_orderbook_stream",
|
|
224
|
+
"global_market_price",
|
|
225
|
+
"indicative_quote_for_a_source_amount",
|
|
226
|
+
"payment_coverage_or_shortfall",
|
|
227
|
+
"liquidity_verdict",
|
|
228
|
+
"price_impact",
|
|
229
|
+
"venue_comparison",
|
|
230
|
+
"route_recommendation",
|
|
231
|
+
"transaction_building",
|
|
232
|
+
"signing_data_or_readiness",
|
|
233
|
+
"profit_or_pnl"
|
|
234
|
+
],
|
|
235
|
+
answerFields: [
|
|
236
|
+
"poolKey",
|
|
237
|
+
"ticks",
|
|
238
|
+
"fetchedAt",
|
|
239
|
+
"midPrice",
|
|
240
|
+
"poolBookParams",
|
|
241
|
+
"level2TicksFromMid"
|
|
242
|
+
],
|
|
243
|
+
diagnosticOnlyFields: ["source"],
|
|
244
|
+
followUp: {
|
|
245
|
+
tool: "read.quote_deepbook_display_amount",
|
|
246
|
+
inputFields: ["poolKey"],
|
|
247
|
+
answerFields: ["quote"],
|
|
248
|
+
reason: "Use for an indicative DeepBook quote after the user supplies an explicit source amount, pool, and direction."
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
export function deepbookMidPriceUserAnswerUse() {
|
|
253
|
+
return {
|
|
254
|
+
canAnswer: ["deepbook_pool_mid_price_context"],
|
|
255
|
+
cannotAnswer: [
|
|
256
|
+
"global_market_price",
|
|
257
|
+
"fiat_usd_cash_out",
|
|
258
|
+
"external_market_price_conversion",
|
|
259
|
+
"usd_peg_assumption",
|
|
260
|
+
"payment_coverage_or_shortfall",
|
|
261
|
+
"price_impact",
|
|
262
|
+
"quote_slippage",
|
|
263
|
+
"venue_comparison",
|
|
264
|
+
"route_recommendation",
|
|
265
|
+
"transaction_building",
|
|
266
|
+
"signing_data_or_readiness",
|
|
267
|
+
"profit_or_pnl",
|
|
268
|
+
"cost_basis"
|
|
269
|
+
],
|
|
270
|
+
answerFields: ["poolKey", "base", "quote", "price", "priceDirection", "priceType", "fetchedAt"],
|
|
271
|
+
diagnosticOnlyFields: ["source", "priceSemantics"],
|
|
272
|
+
followUp: {
|
|
273
|
+
tool: "read.preview_intent_evidence",
|
|
274
|
+
answerFields: ["responseSummary"],
|
|
275
|
+
reason: "Use for USD-denominated payment coverage, balance-total, or shortfall answers; mid price is pool price context only."
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
export function deepbookQuoteUserAnswerUse(summaryKind) {
|
|
280
|
+
return {
|
|
281
|
+
canAnswer: [
|
|
282
|
+
"indicative_deepbook_pool_quote_for_explicit_source_input",
|
|
283
|
+
"raw_sdk_quote_return_values_before_slippage_policy"
|
|
284
|
+
],
|
|
285
|
+
cannotAnswer: [
|
|
286
|
+
"payment_coverage",
|
|
287
|
+
"payment_shortfall",
|
|
288
|
+
"funding_source",
|
|
289
|
+
"route_dependent_payment_support",
|
|
290
|
+
"final_min_out",
|
|
291
|
+
"liquidity_verdict",
|
|
292
|
+
"price_impact",
|
|
293
|
+
"quote_vs_mid_slippage",
|
|
294
|
+
"effective_price",
|
|
295
|
+
"venue_comparison",
|
|
296
|
+
"route_recommendation",
|
|
297
|
+
"fiat_usd_cash_out",
|
|
298
|
+
"external_market_price_conversion",
|
|
299
|
+
"usd_peg_assumption",
|
|
300
|
+
"transaction_building",
|
|
301
|
+
"signing_data_or_readiness",
|
|
302
|
+
"profit_or_pnl",
|
|
303
|
+
"cost_basis"
|
|
304
|
+
],
|
|
305
|
+
answerFields: summaryKind === "raw"
|
|
306
|
+
? [
|
|
307
|
+
"poolKey",
|
|
308
|
+
"direction",
|
|
309
|
+
"amountRaw",
|
|
310
|
+
"quote.baseOut",
|
|
311
|
+
"quote.quoteOut",
|
|
312
|
+
"quote.deepRequired",
|
|
313
|
+
"rawQuote.directionalOutput",
|
|
314
|
+
"fetchedAt"
|
|
315
|
+
]
|
|
316
|
+
: [
|
|
317
|
+
"pool",
|
|
318
|
+
"direction",
|
|
319
|
+
"inputAmount",
|
|
320
|
+
"quote.baseOut",
|
|
321
|
+
"quote.quoteOut",
|
|
322
|
+
"quote.deepRequired",
|
|
323
|
+
"rawQuote.directionalOutput",
|
|
324
|
+
"fetchedAt"
|
|
325
|
+
],
|
|
326
|
+
diagnosticOnlyFields: ["source", "rawQuote.returnValueOrder", "rawQuote.boundary"],
|
|
327
|
+
conclusionRuleFields: [
|
|
328
|
+
"quantitySemantics.canUseForPaymentAnswer",
|
|
329
|
+
"quantitySemantics.canUseForShortfallAnswer",
|
|
330
|
+
"quantitySemantics.doNotCombineWithPaymentAnswer",
|
|
331
|
+
"quantitySemantics.requiredPaymentAnswerTool",
|
|
332
|
+
"quantitySemantics.requiredPaymentAnswerField",
|
|
333
|
+
"quantitySemantics.paymentAnswerUseBlockedReason"
|
|
334
|
+
],
|
|
335
|
+
followUp: {
|
|
336
|
+
tool: "read.preview_intent_evidence",
|
|
337
|
+
answerFields: ["responseSummary"],
|
|
338
|
+
reason: "Use responseSummary for payment coverage, balance-total, or shortfall answers; if this quote was called during a payment question, do not combine its numbers into the conclusion."
|
|
339
|
+
}
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
export function deepbookAccountInventoryUserAnswerUse(detailStatus) {
|
|
343
|
+
const poolAnswerFields = detailStatus === "manager_discovery_only" || detailStatus === "pool_key_required" ? [] : ["pool"];
|
|
344
|
+
const detailAnswerFields = detailStatus === "available"
|
|
345
|
+
? ["accountExists", "accountSummary", "lockedBalances", "openOrderIds", "openOrderCount"]
|
|
346
|
+
: detailStatus === "account_not_found"
|
|
347
|
+
? ["accountExists"]
|
|
348
|
+
: [];
|
|
349
|
+
const detailUnavailableCanAnswer = detailStatus === "pool_key_required" ||
|
|
350
|
+
detailStatus === "manager_address_required" ||
|
|
351
|
+
detailStatus === "manager_address_not_discovered_for_active_account"
|
|
352
|
+
? ["why_deepbook_pool_account_inventory_detail_is_unavailable"]
|
|
353
|
+
: [];
|
|
354
|
+
const accountNotFoundCanAnswer = detailStatus === "account_not_found"
|
|
355
|
+
? ["deepbook_pool_account_absence_when_pool_and_manager_are_supplied"]
|
|
356
|
+
: [];
|
|
357
|
+
const detailCanAnswer = detailStatus === "available"
|
|
358
|
+
? ["deepbook_pool_account_inventory_when_pool_and_manager_are_supplied"]
|
|
359
|
+
: [];
|
|
360
|
+
const detailUnavailableCannotAnswer = detailStatus === "available" ? [] : ["deepbook_pool_account_inventory_when_detailStatus_is_not_available"];
|
|
361
|
+
const diagnosticOnlyFields = detailStatus === "available"
|
|
362
|
+
? ["source", "quantitySemantics", "openOrderIdsTruncated"]
|
|
363
|
+
: ["source", "quantitySemantics"];
|
|
364
|
+
return {
|
|
365
|
+
canAnswer: [
|
|
366
|
+
"active_account_deepbook_balance_manager_discovery",
|
|
367
|
+
...detailUnavailableCanAnswer,
|
|
368
|
+
...accountNotFoundCanAnswer,
|
|
369
|
+
...detailCanAnswer
|
|
370
|
+
],
|
|
371
|
+
cannotAnswer: [
|
|
372
|
+
...detailUnavailableCannotAnswer,
|
|
373
|
+
"current_wallet_coin_balance",
|
|
374
|
+
"wallet_transaction_history",
|
|
375
|
+
"funding_source",
|
|
376
|
+
"route_liquidity",
|
|
377
|
+
"withdrawal_readiness",
|
|
378
|
+
"payment_coverage_or_shortfall",
|
|
379
|
+
"transaction_building",
|
|
380
|
+
"signing_data_or_readiness",
|
|
381
|
+
"profit_or_pnl",
|
|
382
|
+
"cost_basis"
|
|
383
|
+
],
|
|
384
|
+
answerFields: [
|
|
385
|
+
"account",
|
|
386
|
+
"fetchedAt",
|
|
387
|
+
"detailStatus",
|
|
388
|
+
"managerAddresses",
|
|
389
|
+
"requested",
|
|
390
|
+
...poolAnswerFields,
|
|
391
|
+
...detailAnswerFields
|
|
392
|
+
],
|
|
393
|
+
preconditionFields: ["detailStatus"],
|
|
394
|
+
diagnosticOnlyFields,
|
|
395
|
+
followUp: {
|
|
396
|
+
tool: "read.summarize_wallet_assets",
|
|
397
|
+
answerFields: ["balances"],
|
|
398
|
+
reason: "Use for current wallet coin-balance snapshots; DeepBook BalanceManager inventory is a separate account surface."
|
|
399
|
+
}
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
export function flowxQuoteUserAnswerUse() {
|
|
403
|
+
return {
|
|
404
|
+
canAnswer: [
|
|
405
|
+
"indicative_flowx_route_quote_for_explicit_source_input",
|
|
406
|
+
"flowx_router_selected_pools_as_reported_facts"
|
|
407
|
+
],
|
|
408
|
+
cannotAnswer: [
|
|
409
|
+
"payment_coverage",
|
|
410
|
+
"payment_shortfall",
|
|
411
|
+
"funding_source",
|
|
412
|
+
"route_dependent_payment_support",
|
|
413
|
+
"final_min_out",
|
|
414
|
+
"liquidity_verdict",
|
|
415
|
+
"price_impact",
|
|
416
|
+
"quote_vs_mid_slippage",
|
|
417
|
+
"effective_price",
|
|
418
|
+
"venue_comparison",
|
|
419
|
+
"route_recommendation",
|
|
420
|
+
"fiat_usd_cash_out",
|
|
421
|
+
"external_market_price_conversion",
|
|
422
|
+
"usd_peg_assumption",
|
|
423
|
+
"transaction_building",
|
|
424
|
+
"signing_data_or_readiness",
|
|
425
|
+
"profit_or_pnl",
|
|
426
|
+
"cost_basis"
|
|
427
|
+
],
|
|
428
|
+
answerFields: [
|
|
429
|
+
"pair",
|
|
430
|
+
"amountIn",
|
|
431
|
+
"amountOut",
|
|
432
|
+
"routeEvidence.pools",
|
|
433
|
+
"fetchedAt"
|
|
434
|
+
],
|
|
435
|
+
preconditionFields: ["routeEvidence.routeChosenBy", "source.chainVerified"],
|
|
436
|
+
diagnosticOnlyFields: ["source", "routeEvidence.protocolConfigPinMatch"],
|
|
437
|
+
conclusionRuleFields: [
|
|
438
|
+
"quantitySemantics.canUseForPaymentAnswer",
|
|
439
|
+
"quantitySemantics.canUseForShortfallAnswer",
|
|
440
|
+
"quantitySemantics.doNotCombineWithPaymentAnswer",
|
|
441
|
+
"quantitySemantics.requiredPaymentAnswerTool",
|
|
442
|
+
"quantitySemantics.requiredPaymentAnswerField",
|
|
443
|
+
"quantitySemantics.paymentAnswerUseBlockedReason"
|
|
444
|
+
],
|
|
445
|
+
followUp: {
|
|
446
|
+
tool: "read.preview_intent_evidence",
|
|
447
|
+
answerFields: ["responseSummary"],
|
|
448
|
+
reason: "Use responseSummary for payment coverage, balance-total, or shortfall answers; if this quote was called during a payment question, do not combine its numbers into the conclusion."
|
|
449
|
+
}
|
|
450
|
+
};
|
|
451
|
+
}
|