@flop-labs/sdk 0.0.0-stage → 0.5.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 +391 -0
- package/LICENSE +238 -0
- package/README.md +673 -2
- package/dist/a2a/agent-card.d.ts +106 -0
- package/dist/a2a/agent-card.d.ts.map +1 -0
- package/dist/a2a/agent-card.js +131 -0
- package/dist/a2a/agent-card.js.map +1 -0
- package/dist/a2a/index.d.ts +11 -0
- package/dist/a2a/index.d.ts.map +1 -0
- package/dist/a2a/index.js +11 -0
- package/dist/a2a/index.js.map +1 -0
- package/dist/a2a/task-lifecycle.d.ts +41 -0
- package/dist/a2a/task-lifecycle.d.ts.map +1 -0
- package/dist/a2a/task-lifecycle.js +60 -0
- package/dist/a2a/task-lifecycle.js.map +1 -0
- package/dist/a2a/types.d.ts +96 -0
- package/dist/a2a/types.d.ts.map +1 -0
- package/dist/a2a/types.js +23 -0
- package/dist/a2a/types.js.map +1 -0
- package/dist/a2a-cjs/agent-card.js +137 -0
- package/dist/a2a-cjs/agent-card.js.map +1 -0
- package/dist/a2a-cjs/index.js +23 -0
- package/dist/a2a-cjs/index.js.map +1 -0
- package/dist/a2a-cjs/package.json +1 -0
- package/dist/a2a-cjs/task-lifecycle.js +64 -0
- package/dist/a2a-cjs/task-lifecycle.js.map +1 -0
- package/dist/a2a-cjs/types.js +26 -0
- package/dist/a2a-cjs/types.js.map +1 -0
- package/dist/adaptor.d.ts +39 -0
- package/dist/adaptor.d.ts.map +1 -0
- package/dist/adaptor.js +130 -0
- package/dist/adaptor.js.map +1 -0
- package/dist/agent/errors.d.ts +95 -0
- package/dist/agent/errors.d.ts.map +1 -0
- package/dist/agent/errors.js +132 -0
- package/dist/agent/errors.js.map +1 -0
- package/dist/agent/task-delegation.d.ts +283 -0
- package/dist/agent/task-delegation.d.ts.map +1 -0
- package/dist/agent/task-delegation.js +413 -0
- package/dist/agent/task-delegation.js.map +1 -0
- package/dist/agent/types.d.ts +19 -0
- package/dist/agent/types.d.ts.map +1 -0
- package/dist/agent/types.js +7 -0
- package/dist/agent/types.js.map +1 -0
- package/dist/agent-wallet.d.ts +197 -0
- package/dist/agent-wallet.d.ts.map +1 -0
- package/dist/agent-wallet.js +391 -0
- package/dist/agent-wallet.js.map +1 -0
- package/dist/amhl.d.ts +61 -0
- package/dist/amhl.d.ts.map +1 -0
- package/dist/amhl.js +161 -0
- package/dist/amhl.js.map +1 -0
- package/dist/attestation.d.ts +126 -0
- package/dist/attestation.d.ts.map +1 -0
- package/dist/attestation.js +287 -0
- package/dist/attestation.js.map +1 -0
- package/dist/bip340-adaptor.d.ts +8 -0
- package/dist/bip340-adaptor.d.ts.map +1 -0
- package/dist/bip340-adaptor.js +129 -0
- package/dist/bip340-adaptor.js.map +1 -0
- package/dist/btc-relayer.d.ts +42 -0
- package/dist/btc-relayer.d.ts.map +1 -0
- package/dist/btc-relayer.js +40 -0
- package/dist/btc-relayer.js.map +1 -0
- package/dist/bundle/index.esm.js +2 -0
- package/dist/bundle/index.esm.js.map +1 -0
- package/dist/bundle/index.umd.cjs +2 -0
- package/dist/bundle/index.umd.cjs.map +1 -0
- package/dist/capability-claim-sink.d.ts +5 -0
- package/dist/capability-claim-sink.d.ts.map +1 -0
- package/dist/capability-claim-sink.js +6 -0
- package/dist/capability-claim-sink.js.map +1 -0
- package/dist/chain-text.d.ts +3 -0
- package/dist/chain-text.d.ts.map +1 -0
- package/dist/chain-text.js +27 -0
- package/dist/chain-text.js.map +1 -0
- package/dist/chain.d.ts +63 -0
- package/dist/chain.d.ts.map +1 -0
- package/dist/chain.js +100 -0
- package/dist/chain.js.map +1 -0
- package/dist/client.d.ts +368 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +870 -0
- package/dist/client.js.map +1 -0
- package/dist/compute-channel/adaptor-settlement.d.ts +19 -0
- package/dist/compute-channel/adaptor-settlement.d.ts.map +1 -0
- package/dist/compute-channel/adaptor-settlement.js +40 -0
- package/dist/compute-channel/adaptor-settlement.js.map +1 -0
- package/dist/compute-channel/agent-client.d.ts +141 -0
- package/dist/compute-channel/agent-client.d.ts.map +1 -0
- package/dist/compute-channel/agent-client.js +265 -0
- package/dist/compute-channel/agent-client.js.map +1 -0
- package/dist/compute-channel/agent-driver.d.ts +59 -0
- package/dist/compute-channel/agent-driver.d.ts.map +1 -0
- package/dist/compute-channel/agent-driver.js +351 -0
- package/dist/compute-channel/agent-driver.js.map +1 -0
- package/dist/compute-channel/chain.d.ts +245 -0
- package/dist/compute-channel/chain.d.ts.map +1 -0
- package/dist/compute-channel/chain.js +490 -0
- package/dist/compute-channel/chain.js.map +1 -0
- package/dist/compute-channel/chat-render.d.ts +21 -0
- package/dist/compute-channel/chat-render.d.ts.map +1 -0
- package/dist/compute-channel/chat-render.js +87 -0
- package/dist/compute-channel/chat-render.js.map +1 -0
- package/dist/compute-channel/crypto.d.ts +19 -0
- package/dist/compute-channel/crypto.d.ts.map +1 -0
- package/dist/compute-channel/crypto.js +52 -0
- package/dist/compute-channel/crypto.js.map +1 -0
- package/dist/compute-channel/da.d.ts +111 -0
- package/dist/compute-channel/da.d.ts.map +1 -0
- package/dist/compute-channel/da.js +320 -0
- package/dist/compute-channel/da.js.map +1 -0
- package/dist/compute-channel/deepseek-v41.d.ts +56 -0
- package/dist/compute-channel/deepseek-v41.d.ts.map +1 -0
- package/dist/compute-channel/deepseek-v41.js +267 -0
- package/dist/compute-channel/deepseek-v41.js.map +1 -0
- package/dist/compute-channel/direct-session-chain.d.ts +3 -0
- package/dist/compute-channel/direct-session-chain.d.ts.map +1 -0
- package/dist/compute-channel/direct-session-chain.js +271 -0
- package/dist/compute-channel/direct-session-chain.js.map +1 -0
- package/dist/compute-channel/direct-session.d.ts +78 -0
- package/dist/compute-channel/direct-session.d.ts.map +1 -0
- package/dist/compute-channel/direct-session.js +241 -0
- package/dist/compute-channel/direct-session.js.map +1 -0
- package/dist/compute-channel/dispute.d.ts +103 -0
- package/dist/compute-channel/dispute.d.ts.map +1 -0
- package/dist/compute-channel/dispute.js +314 -0
- package/dist/compute-channel/dispute.js.map +1 -0
- package/dist/compute-channel/fcu-admission.d.ts +37 -0
- package/dist/compute-channel/fcu-admission.d.ts.map +1 -0
- package/dist/compute-channel/fcu-admission.js +53 -0
- package/dist/compute-channel/fcu-admission.js.map +1 -0
- package/dist/compute-channel/fcu-agent.d.ts +27 -0
- package/dist/compute-channel/fcu-agent.d.ts.map +1 -0
- package/dist/compute-channel/fcu-agent.js +35 -0
- package/dist/compute-channel/fcu-agent.js.map +1 -0
- package/dist/compute-channel/fcu-policy.d.ts +67 -0
- package/dist/compute-channel/fcu-policy.d.ts.map +1 -0
- package/dist/compute-channel/fcu-policy.js +121 -0
- package/dist/compute-channel/fcu-policy.js.map +1 -0
- package/dist/compute-channel/fcu-profile.d.ts +56 -0
- package/dist/compute-channel/fcu-profile.d.ts.map +1 -0
- package/dist/compute-channel/fcu-profile.js +100 -0
- package/dist/compute-channel/fcu-profile.js.map +1 -0
- package/dist/compute-channel/fcu-serving.d.ts +146 -0
- package/dist/compute-channel/fcu-serving.d.ts.map +1 -0
- package/dist/compute-channel/fcu-serving.js +350 -0
- package/dist/compute-channel/fcu-serving.js.map +1 -0
- package/dist/compute-channel/fcu-sla.d.ts +88 -0
- package/dist/compute-channel/fcu-sla.d.ts.map +1 -0
- package/dist/compute-channel/fcu-sla.js +154 -0
- package/dist/compute-channel/fcu-sla.js.map +1 -0
- package/dist/compute-channel/fcu-store-node.d.ts +10 -0
- package/dist/compute-channel/fcu-store-node.d.ts.map +1 -0
- package/dist/compute-channel/fcu-store-node.js +98 -0
- package/dist/compute-channel/fcu-store-node.js.map +1 -0
- package/dist/compute-channel/fcu-timing.d.ts +34 -0
- package/dist/compute-channel/fcu-timing.d.ts.map +1 -0
- package/dist/compute-channel/fcu-timing.js +79 -0
- package/dist/compute-channel/fcu-timing.js.map +1 -0
- package/dist/compute-channel/flop-meter.d.ts +96 -0
- package/dist/compute-channel/flop-meter.d.ts.map +1 -0
- package/dist/compute-channel/flop-meter.js +210 -0
- package/dist/compute-channel/flop-meter.js.map +1 -0
- package/dist/compute-channel/flop-submitter.d.ts +40 -0
- package/dist/compute-channel/flop-submitter.d.ts.map +1 -0
- package/dist/compute-channel/flop-submitter.js +124 -0
- package/dist/compute-channel/flop-submitter.js.map +1 -0
- package/dist/compute-channel/hybrid-candidate.d.ts +22 -0
- package/dist/compute-channel/hybrid-candidate.d.ts.map +1 -0
- package/dist/compute-channel/hybrid-candidate.js +155 -0
- package/dist/compute-channel/hybrid-candidate.js.map +1 -0
- package/dist/compute-channel/hybrid-metering.d.ts +36 -0
- package/dist/compute-channel/hybrid-metering.d.ts.map +1 -0
- package/dist/compute-channel/hybrid-metering.js +69 -0
- package/dist/compute-channel/hybrid-metering.js.map +1 -0
- package/dist/compute-channel/hybrid.d.ts +16 -0
- package/dist/compute-channel/hybrid.d.ts.map +1 -0
- package/dist/compute-channel/hybrid.js +98 -0
- package/dist/compute-channel/hybrid.js.map +1 -0
- package/dist/compute-channel/index.d.ts +55 -0
- package/dist/compute-channel/index.d.ts.map +1 -0
- package/dist/compute-channel/index.js +56 -0
- package/dist/compute-channel/index.js.map +1 -0
- package/dist/compute-channel/lane-producer.d.ts +92 -0
- package/dist/compute-channel/lane-producer.d.ts.map +1 -0
- package/dist/compute-channel/lane-producer.js +265 -0
- package/dist/compute-channel/lane-producer.js.map +1 -0
- package/dist/compute-channel/layered.d.ts +77 -0
- package/dist/compute-channel/layered.d.ts.map +1 -0
- package/dist/compute-channel/layered.js +220 -0
- package/dist/compute-channel/layered.js.map +1 -0
- package/dist/compute-channel/lineage.d.ts +19 -0
- package/dist/compute-channel/lineage.d.ts.map +1 -0
- package/dist/compute-channel/lineage.js +28 -0
- package/dist/compute-channel/lineage.js.map +1 -0
- package/dist/compute-channel/miner-host.d.ts +329 -0
- package/dist/compute-channel/miner-host.d.ts.map +1 -0
- package/dist/compute-channel/miner-host.js +880 -0
- package/dist/compute-channel/miner-host.js.map +1 -0
- package/dist/compute-channel/model-config.d.ts +87 -0
- package/dist/compute-channel/model-config.d.ts.map +1 -0
- package/dist/compute-channel/model-config.js +697 -0
- package/dist/compute-channel/model-config.js.map +1 -0
- package/dist/compute-channel/offers.d.ts +57 -0
- package/dist/compute-channel/offers.d.ts.map +1 -0
- package/dist/compute-channel/offers.js +182 -0
- package/dist/compute-channel/offers.js.map +1 -0
- package/dist/compute-channel/peer-info.d.ts +15 -0
- package/dist/compute-channel/peer-info.d.ts.map +1 -0
- package/dist/compute-channel/peer-info.js +33 -0
- package/dist/compute-channel/peer-info.js.map +1 -0
- package/dist/compute-channel/point-claim-sink.d.ts +5 -0
- package/dist/compute-channel/point-claim-sink.d.ts.map +1 -0
- package/dist/compute-channel/point-claim-sink.js +6 -0
- package/dist/compute-channel/point-claim-sink.js.map +1 -0
- package/dist/compute-channel/protocol.d.ts +243 -0
- package/dist/compute-channel/protocol.d.ts.map +1 -0
- package/dist/compute-channel/protocol.js +249 -0
- package/dist/compute-channel/protocol.js.map +1 -0
- package/dist/compute-channel/runtime-storage.d.ts +6 -0
- package/dist/compute-channel/runtime-storage.d.ts.map +1 -0
- package/dist/compute-channel/runtime-storage.js +11 -0
- package/dist/compute-channel/runtime-storage.js.map +1 -0
- package/dist/compute-channel/sampled-audit.d.ts +24 -0
- package/dist/compute-channel/sampled-audit.d.ts.map +1 -0
- package/dist/compute-channel/sampled-audit.js +97 -0
- package/dist/compute-channel/sampled-audit.js.map +1 -0
- package/dist/compute-channel/session-auth.d.ts +6 -0
- package/dist/compute-channel/session-auth.d.ts.map +1 -0
- package/dist/compute-channel/session-auth.js +23 -0
- package/dist/compute-channel/session-auth.js.map +1 -0
- package/dist/compute-channel/session-estimate.d.ts +103 -0
- package/dist/compute-channel/session-estimate.d.ts.map +1 -0
- package/dist/compute-channel/session-estimate.js +140 -0
- package/dist/compute-channel/session-estimate.js.map +1 -0
- package/dist/compute-channel/session-prior-bank.d.ts +61 -0
- package/dist/compute-channel/session-prior-bank.d.ts.map +1 -0
- package/dist/compute-channel/session-prior-bank.js +74 -0
- package/dist/compute-channel/session-prior-bank.js.map +1 -0
- package/dist/compute-channel/session-prior.d.ts +145 -0
- package/dist/compute-channel/session-prior.d.ts.map +1 -0
- package/dist/compute-channel/session-prior.js +325 -0
- package/dist/compute-channel/session-prior.js.map +1 -0
- package/dist/compute-channel/session-store.d.ts +51 -0
- package/dist/compute-channel/session-store.d.ts.map +1 -0
- package/dist/compute-channel/session-store.js +186 -0
- package/dist/compute-channel/session-store.js.map +1 -0
- package/dist/compute-channel/session.d.ts +120 -0
- package/dist/compute-channel/session.d.ts.map +1 -0
- package/dist/compute-channel/session.js +232 -0
- package/dist/compute-channel/session.js.map +1 -0
- package/dist/compute-channel/toploc-checker.d.ts +384 -0
- package/dist/compute-channel/toploc-checker.d.ts.map +1 -0
- package/dist/compute-channel/toploc-checker.js +794 -0
- package/dist/compute-channel/toploc-checker.js.map +1 -0
- package/dist/compute-channel/toploc-completion-rpc.d.ts +26 -0
- package/dist/compute-channel/toploc-completion-rpc.d.ts.map +1 -0
- package/dist/compute-channel/toploc-completion-rpc.js +391 -0
- package/dist/compute-channel/toploc-completion-rpc.js.map +1 -0
- package/dist/compute-channel/toploc-completion.d.ts +109 -0
- package/dist/compute-channel/toploc-completion.d.ts.map +1 -0
- package/dist/compute-channel/toploc-completion.js +301 -0
- package/dist/compute-channel/toploc-completion.js.map +1 -0
- package/dist/compute-channel/toploc-evidence.d.ts +185 -0
- package/dist/compute-channel/toploc-evidence.d.ts.map +1 -0
- package/dist/compute-channel/toploc-evidence.js +299 -0
- package/dist/compute-channel/toploc-evidence.js.map +1 -0
- package/dist/compute-channel/toploc-gumbel.d.ts +149 -0
- package/dist/compute-channel/toploc-gumbel.d.ts.map +1 -0
- package/dist/compute-channel/toploc-gumbel.js +245 -0
- package/dist/compute-channel/toploc-gumbel.js.map +1 -0
- package/dist/compute-channel/toploc.d.ts +63 -0
- package/dist/compute-channel/toploc.d.ts.map +1 -0
- package/dist/compute-channel/toploc.js +197 -0
- package/dist/compute-channel/toploc.js.map +1 -0
- package/dist/compute-channel/transcript.d.ts +127 -0
- package/dist/compute-channel/transcript.d.ts.map +1 -0
- package/dist/compute-channel/transcript.js +279 -0
- package/dist/compute-channel/transcript.js.map +1 -0
- package/dist/compute-channel/transport-http.d.ts +223 -0
- package/dist/compute-channel/transport-http.d.ts.map +1 -0
- package/dist/compute-channel/transport-http.js +661 -0
- package/dist/compute-channel/transport-http.js.map +1 -0
- package/dist/connect.d.ts +4 -0
- package/dist/connect.d.ts.map +1 -0
- package/dist/connect.js +24 -0
- package/dist/connect.js.map +1 -0
- package/dist/coordination.d.ts +341 -0
- package/dist/coordination.d.ts.map +1 -0
- package/dist/coordination.js +483 -0
- package/dist/coordination.js.map +1 -0
- package/dist/da-client.d.ts +124 -0
- package/dist/da-client.d.ts.map +1 -0
- package/dist/da-client.js +127 -0
- package/dist/da-client.js.map +1 -0
- package/dist/discovery/capabilities.d.ts +129 -0
- package/dist/discovery/capabilities.d.ts.map +1 -0
- package/dist/discovery/capabilities.js +398 -0
- package/dist/discovery/capabilities.js.map +1 -0
- package/dist/discovery/discovery-service.d.ts +476 -0
- package/dist/discovery/discovery-service.d.ts.map +1 -0
- package/dist/discovery/discovery-service.js +996 -0
- package/dist/discovery/discovery-service.js.map +1 -0
- package/dist/discovery/examples.d.ts +50 -0
- package/dist/discovery/examples.d.ts.map +1 -0
- package/dist/discovery/examples.js +163 -0
- package/dist/discovery/examples.js.map +1 -0
- package/dist/discovery/fee-estimation.d.ts +550 -0
- package/dist/discovery/fee-estimation.d.ts.map +1 -0
- package/dist/discovery/fee-estimation.js +921 -0
- package/dist/discovery/fee-estimation.js.map +1 -0
- package/dist/discovery/index.d.ts +38 -0
- package/dist/discovery/index.d.ts.map +1 -0
- package/dist/discovery/index.js +32 -0
- package/dist/discovery/index.js.map +1 -0
- package/dist/discovery/metered-pricing.d.ts +100 -0
- package/dist/discovery/metered-pricing.d.ts.map +1 -0
- package/dist/discovery/metered-pricing.js +150 -0
- package/dist/discovery/metered-pricing.js.map +1 -0
- package/dist/discovery/priority.d.ts +16 -0
- package/dist/discovery/priority.d.ts.map +1 -0
- package/dist/discovery/priority.js +17 -0
- package/dist/discovery/priority.js.map +1 -0
- package/dist/discovery/scoring.d.ts +231 -0
- package/dist/discovery/scoring.d.ts.map +1 -0
- package/dist/discovery/scoring.js +354 -0
- package/dist/discovery/scoring.js.map +1 -0
- package/dist/ecdsa-adaptor.d.ts +72 -0
- package/dist/ecdsa-adaptor.d.ts.map +1 -0
- package/dist/ecdsa-adaptor.js +351 -0
- package/dist/ecdsa-adaptor.js.map +1 -0
- package/dist/errors.d.ts +98 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +190 -0
- package/dist/errors.js.map +1 -0
- package/dist/escrow.d.ts +116 -0
- package/dist/escrow.d.ts.map +1 -0
- package/dist/escrow.js +172 -0
- package/dist/escrow.js.map +1 -0
- package/dist/evm-relayer.d.ts +12 -0
- package/dist/evm-relayer.d.ts.map +1 -0
- package/dist/evm-relayer.js +25 -0
- package/dist/evm-relayer.js.map +1 -0
- package/dist/experimental.d.ts +3 -0
- package/dist/experimental.d.ts.map +1 -0
- package/dist/experimental.js +3 -0
- package/dist/experimental.js.map +1 -0
- package/dist/faucet.d.ts +146 -0
- package/dist/faucet.d.ts.map +1 -0
- package/dist/faucet.js +300 -0
- package/dist/faucet.js.map +1 -0
- package/dist/finality-status.d.ts +21 -0
- package/dist/finality-status.d.ts.map +1 -0
- package/dist/finality-status.js +10 -0
- package/dist/finality-status.js.map +1 -0
- package/dist/generated-client/capabilities.d.ts +83 -0
- package/dist/generated-client/capabilities.d.ts.map +1 -0
- package/dist/generated-client/capabilities.js +87 -0
- package/dist/generated-client/capabilities.js.map +1 -0
- package/dist/generated-client/cli.d.ts +3 -0
- package/dist/generated-client/cli.d.ts.map +1 -0
- package/dist/generated-client/cli.js +33 -0
- package/dist/generated-client/cli.js.map +1 -0
- package/dist/generated-client/errors.d.ts +13 -0
- package/dist/generated-client/errors.d.ts.map +1 -0
- package/dist/generated-client/errors.js +23 -0
- package/dist/generated-client/errors.js.map +1 -0
- package/dist/generated-client/factory.d.ts +28 -0
- package/dist/generated-client/factory.d.ts.map +1 -0
- package/dist/generated-client/factory.js +182 -0
- package/dist/generated-client/factory.js.map +1 -0
- package/dist/generated-client/generator.d.ts +9 -0
- package/dist/generated-client/generator.d.ts.map +1 -0
- package/dist/generated-client/generator.js +80 -0
- package/dist/generated-client/generator.js.map +1 -0
- package/dist/generated-client/index.d.ts +11 -0
- package/dist/generated-client/index.d.ts.map +1 -0
- package/dist/generated-client/index.js +6 -0
- package/dist/generated-client/index.js.map +1 -0
- package/dist/generated-client/profile.d.ts +166 -0
- package/dist/generated-client/profile.d.ts.map +1 -0
- package/dist/generated-client/profile.js +158 -0
- package/dist/generated-client/profile.js.map +1 -0
- package/dist/generated-client/templates/agent-chat.d.ts +16 -0
- package/dist/generated-client/templates/agent-chat.d.ts.map +1 -0
- package/dist/generated-client/templates/agent-chat.js +12 -0
- package/dist/generated-client/templates/agent-chat.js.map +1 -0
- package/dist/generated-client/templates/index.d.ts +4 -0
- package/dist/generated-client/templates/index.d.ts.map +1 -0
- package/dist/generated-client/templates/index.js +4 -0
- package/dist/generated-client/templates/index.js.map +1 -0
- package/dist/generated-client/templates/miner-operator.d.ts +16 -0
- package/dist/generated-client/templates/miner-operator.d.ts.map +1 -0
- package/dist/generated-client/templates/miner-operator.js +12 -0
- package/dist/generated-client/templates/miner-operator.js.map +1 -0
- package/dist/generated-client/templates/model-publisher.d.ts +21 -0
- package/dist/generated-client/templates/model-publisher.d.ts.map +1 -0
- package/dist/generated-client/templates/model-publisher.js +13 -0
- package/dist/generated-client/templates/model-publisher.js.map +1 -0
- package/dist/hardware.d.ts +68 -0
- package/dist/hardware.d.ts.map +1 -0
- package/dist/hardware.js +222 -0
- package/dist/hardware.js.map +1 -0
- package/dist/htlc-appraisal.d.ts +4 -0
- package/dist/htlc-appraisal.d.ts.map +1 -0
- package/dist/htlc-appraisal.js +25 -0
- package/dist/htlc-appraisal.js.map +1 -0
- package/dist/index.d.ts +114 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +144 -0
- package/dist/index.js.map +1 -0
- package/dist/inference-purchase.d.ts +40 -0
- package/dist/inference-purchase.d.ts.map +1 -0
- package/dist/inference-purchase.js +43 -0
- package/dist/inference-purchase.js.map +1 -0
- package/dist/miner-admission.d.ts +124 -0
- package/dist/miner-admission.d.ts.map +1 -0
- package/dist/miner-admission.js +259 -0
- package/dist/miner-admission.js.map +1 -0
- package/dist/model-loader/canonical.d.ts +79 -0
- package/dist/model-loader/canonical.d.ts.map +1 -0
- package/dist/model-loader/canonical.js +116 -0
- package/dist/model-loader/canonical.js.map +1 -0
- package/dist/model-loader/dir.d.ts +26 -0
- package/dist/model-loader/dir.d.ts.map +1 -0
- package/dist/model-loader/dir.js +109 -0
- package/dist/model-loader/dir.js.map +1 -0
- package/dist/model-loader/dmverity.d.ts +78 -0
- package/dist/model-loader/dmverity.d.ts.map +1 -0
- package/dist/model-loader/dmverity.js +141 -0
- package/dist/model-loader/dmverity.js.map +1 -0
- package/dist/model-loader/download-state.d.ts +24 -0
- package/dist/model-loader/download-state.d.ts.map +1 -0
- package/dist/model-loader/download-state.js +99 -0
- package/dist/model-loader/download-state.js.map +1 -0
- package/dist/model-loader/fetch.d.ts +51 -0
- package/dist/model-loader/fetch.d.ts.map +1 -0
- package/dist/model-loader/fetch.js +410 -0
- package/dist/model-loader/fetch.js.map +1 -0
- package/dist/model-loader/file-table.d.ts +38 -0
- package/dist/model-loader/file-table.d.ts.map +1 -0
- package/dist/model-loader/file-table.js +106 -0
- package/dist/model-loader/file-table.js.map +1 -0
- package/dist/model-loader/hf-preflight.d.ts +65 -0
- package/dist/model-loader/hf-preflight.d.ts.map +1 -0
- package/dist/model-loader/hf-preflight.js +179 -0
- package/dist/model-loader/hf-preflight.js.map +1 -0
- package/dist/model-loader/index.d.ts +27 -0
- package/dist/model-loader/index.d.ts.map +1 -0
- package/dist/model-loader/index.js +21 -0
- package/dist/model-loader/index.js.map +1 -0
- package/dist/model-loader/registry.d.ts +24 -0
- package/dist/model-loader/registry.d.ts.map +1 -0
- package/dist/model-loader/registry.js +99 -0
- package/dist/model-loader/registry.js.map +1 -0
- package/dist/model-loader/types.d.ts +101 -0
- package/dist/model-loader/types.d.ts.map +1 -0
- package/dist/model-loader/types.js +13 -0
- package/dist/model-loader/types.js.map +1 -0
- package/dist/model-loader/verify.d.ts +83 -0
- package/dist/model-loader/verify.d.ts.map +1 -0
- package/dist/model-loader/verify.js +138 -0
- package/dist/model-loader/verify.js.map +1 -0
- package/dist/model-qualification.d.ts +79 -0
- package/dist/model-qualification.d.ts.map +1 -0
- package/dist/model-qualification.js +135 -0
- package/dist/model-qualification.js.map +1 -0
- package/dist/near-relayer.d.ts +30 -0
- package/dist/near-relayer.d.ts.map +1 -0
- package/dist/near-relayer.js +81 -0
- package/dist/near-relayer.js.map +1 -0
- package/dist/paid-storage/bytes.d.ts +21 -0
- package/dist/paid-storage/bytes.d.ts.map +1 -0
- package/dist/paid-storage/bytes.js +71 -0
- package/dist/paid-storage/bytes.js.map +1 -0
- package/dist/paid-storage/chain.d.ts +20 -0
- package/dist/paid-storage/chain.d.ts.map +1 -0
- package/dist/paid-storage/chain.js +182 -0
- package/dist/paid-storage/chain.js.map +1 -0
- package/dist/paid-storage/client.d.ts +161 -0
- package/dist/paid-storage/client.d.ts.map +1 -0
- package/dist/paid-storage/client.js +1038 -0
- package/dist/paid-storage/client.js.map +1 -0
- package/dist/paid-storage/cloudflare.d.ts +4 -0
- package/dist/paid-storage/cloudflare.d.ts.map +1 -0
- package/dist/paid-storage/cloudflare.js +9 -0
- package/dist/paid-storage/cloudflare.js.map +1 -0
- package/dist/paid-storage/codec.d.ts +8 -0
- package/dist/paid-storage/codec.d.ts.map +1 -0
- package/dist/paid-storage/codec.js +92 -0
- package/dist/paid-storage/codec.js.map +1 -0
- package/dist/paid-storage/crypto.d.ts +27 -0
- package/dist/paid-storage/crypto.d.ts.map +1 -0
- package/dist/paid-storage/crypto.js +91 -0
- package/dist/paid-storage/crypto.js.map +1 -0
- package/dist/paid-storage/heads.d.ts +26 -0
- package/dist/paid-storage/heads.d.ts.map +1 -0
- package/dist/paid-storage/heads.js +208 -0
- package/dist/paid-storage/heads.js.map +1 -0
- package/dist/paid-storage/index.d.ts +14 -0
- package/dist/paid-storage/index.d.ts.map +1 -0
- package/dist/paid-storage/index.js +7 -0
- package/dist/paid-storage/index.js.map +1 -0
- package/dist/paid-storage/memory-wire.d.ts +85 -0
- package/dist/paid-storage/memory-wire.d.ts.map +1 -0
- package/dist/paid-storage/memory-wire.js +147 -0
- package/dist/paid-storage/memory-wire.js.map +1 -0
- package/dist/paid-storage/node-store.d.ts +9 -0
- package/dist/paid-storage/node-store.d.ts.map +1 -0
- package/dist/paid-storage/node-store.js +34 -0
- package/dist/paid-storage/node-store.js.map +1 -0
- package/dist/paid-storage/profile.d.ts +21 -0
- package/dist/paid-storage/profile.d.ts.map +1 -0
- package/dist/paid-storage/profile.js +22 -0
- package/dist/paid-storage/profile.js.map +1 -0
- package/dist/paid-storage/store.d.ts +18 -0
- package/dist/paid-storage/store.d.ts.map +1 -0
- package/dist/paid-storage/store.js +32 -0
- package/dist/paid-storage/store.js.map +1 -0
- package/dist/paid-storage/transport.d.ts +70 -0
- package/dist/paid-storage/transport.d.ts.map +1 -0
- package/dist/paid-storage/transport.js +140 -0
- package/dist/paid-storage/transport.js.map +1 -0
- package/dist/paid-storage/vouchers.d.ts +75 -0
- package/dist/paid-storage/vouchers.d.ts.map +1 -0
- package/dist/paid-storage/vouchers.js +239 -0
- package/dist/paid-storage/vouchers.js.map +1 -0
- package/dist/paid-storage-wire.d.ts +11 -0
- package/dist/paid-storage-wire.d.ts.map +1 -0
- package/dist/paid-storage-wire.js +184 -0
- package/dist/paid-storage-wire.js.map +1 -0
- package/dist/point-claims.d.ts +40 -0
- package/dist/point-claims.d.ts.map +1 -0
- package/dist/point-claims.js +98 -0
- package/dist/point-claims.js.map +1 -0
- package/dist/quickstart.d.ts +307 -0
- package/dist/quickstart.d.ts.map +1 -0
- package/dist/quickstart.js +536 -0
- package/dist/quickstart.js.map +1 -0
- package/dist/react/context.d.ts +10 -0
- package/dist/react/context.d.ts.map +1 -0
- package/dist/react/context.js +16 -0
- package/dist/react/context.js.map +1 -0
- package/dist/react/hooks.d.ts +206 -0
- package/dist/react/hooks.d.ts.map +1 -0
- package/dist/react/hooks.js +560 -0
- package/dist/react/hooks.js.map +1 -0
- package/dist/react/index.d.ts +4 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +4 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/provider.d.ts +18 -0
- package/dist/react/provider.d.ts.map +1 -0
- package/dist/react/provider.js +17 -0
- package/dist/react/provider.js.map +1 -0
- package/dist/relayer.d.ts +122 -0
- package/dist/relayer.d.ts.map +1 -0
- package/dist/relayer.js +203 -0
- package/dist/relayer.js.map +1 -0
- package/dist/runtime-compatibility.d.ts +8 -0
- package/dist/runtime-compatibility.d.ts.map +1 -0
- package/dist/runtime-compatibility.js +23 -0
- package/dist/runtime-compatibility.js.map +1 -0
- package/dist/session-manager.d.ts +197 -0
- package/dist/session-manager.d.ts.map +1 -0
- package/dist/session-manager.js +429 -0
- package/dist/session-manager.js.map +1 -0
- package/dist/solana-ptlc.d.ts +64 -0
- package/dist/solana-ptlc.d.ts.map +1 -0
- package/dist/solana-ptlc.js +137 -0
- package/dist/solana-ptlc.js.map +1 -0
- package/dist/staking-client.d.ts +103 -0
- package/dist/staking-client.d.ts.map +1 -0
- package/dist/staking-client.js +308 -0
- package/dist/staking-client.js.map +1 -0
- package/dist/staking-types.d.ts +203 -0
- package/dist/staking-types.d.ts.map +1 -0
- package/dist/staking-types.js +16 -0
- package/dist/staking-types.js.map +1 -0
- package/dist/submit-tx.d.ts +14 -0
- package/dist/submit-tx.d.ts.map +1 -0
- package/dist/submit-tx.js +25 -0
- package/dist/submit-tx.js.map +1 -0
- package/dist/templates/index.d.ts +52 -0
- package/dist/templates/index.d.ts.map +1 -0
- package/dist/templates/index.js +123 -0
- package/dist/templates/index.js.map +1 -0
- package/dist/ton/index.d.ts +52 -0
- package/dist/ton/index.d.ts.map +1 -0
- package/dist/ton/index.js +163 -0
- package/dist/ton/index.js.map +1 -0
- package/dist/ton-relayer.d.ts +26 -0
- package/dist/ton-relayer.d.ts.map +1 -0
- package/dist/ton-relayer.js +22 -0
- package/dist/ton-relayer.js.map +1 -0
- package/dist/tracing.d.ts +48 -0
- package/dist/tracing.d.ts.map +1 -0
- package/dist/tracing.js +108 -0
- package/dist/tracing.js.map +1 -0
- package/dist/transaction-signer.d.ts +13 -0
- package/dist/transaction-signer.d.ts.map +1 -0
- package/dist/transaction-signer.js +13 -0
- package/dist/transaction-signer.js.map +1 -0
- package/dist/trust-root.d.ts +56 -0
- package/dist/trust-root.d.ts.map +1 -0
- package/dist/trust-root.js +28 -0
- package/dist/trust-root.js.map +1 -0
- package/dist/types.d.ts +201 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/validator-staking-client.d.ts +87 -0
- package/dist/validator-staking-client.d.ts.map +1 -0
- package/dist/validator-staking-client.js +226 -0
- package/dist/validator-staking-client.js.map +1 -0
- package/dist/virtuals-acp.d.ts +149 -0
- package/dist/virtuals-acp.d.ts.map +1 -0
- package/dist/virtuals-acp.js +418 -0
- package/dist/virtuals-acp.js.map +1 -0
- package/dist/wallet-manager.d.ts +199 -0
- package/dist/wallet-manager.d.ts.map +1 -0
- package/dist/wallet-manager.js +425 -0
- package/dist/wallet-manager.js.map +1 -0
- package/dist/wallets/burner.d.ts +45 -0
- package/dist/wallets/burner.d.ts.map +1 -0
- package/dist/wallets/burner.js +58 -0
- package/dist/wallets/burner.js.map +1 -0
- package/dist/wallets/index.d.ts +26 -0
- package/dist/wallets/index.d.ts.map +1 -0
- package/dist/wallets/index.js +20 -0
- package/dist/wallets/index.js.map +1 -0
- package/dist/wallets/injected.d.ts +22 -0
- package/dist/wallets/injected.d.ts.map +1 -0
- package/dist/wallets/injected.js +45 -0
- package/dist/wallets/injected.js.map +1 -0
- package/dist/wallets/ledger.d.ts +76 -0
- package/dist/wallets/ledger.d.ts.map +1 -0
- package/dist/wallets/ledger.js +106 -0
- package/dist/wallets/ledger.js.map +1 -0
- package/dist/wallets/near.d.ts +69 -0
- package/dist/wallets/near.d.ts.map +1 -0
- package/dist/wallets/near.js +101 -0
- package/dist/wallets/near.js.map +1 -0
- package/dist/wallets/types.d.ts +42 -0
- package/dist/wallets/types.d.ts.map +1 -0
- package/dist/wallets/types.js +31 -0
- package/dist/wallets/types.js.map +1 -0
- package/dist/wallets/walletconnect.d.ts +38 -0
- package/dist/wallets/walletconnect.d.ts.map +1 -0
- package/dist/wallets/walletconnect.js +94 -0
- package/dist/wallets/walletconnect.js.map +1 -0
- package/dist/watch-transaction.d.ts +26 -0
- package/dist/watch-transaction.d.ts.map +1 -0
- package/dist/watch-transaction.js +91 -0
- package/dist/watch-transaction.js.map +1 -0
- package/dist/weak-subjectivity.d.ts +213 -0
- package/dist/weak-subjectivity.d.ts.map +1 -0
- package/dist/weak-subjectivity.js +389 -0
- package/dist/weak-subjectivity.js.map +1 -0
- package/dist/x402-types/channel-types.d.ts +78 -0
- package/dist/x402-types/channel-types.d.ts.map +1 -0
- package/dist/x402-types/channel-types.js +5 -0
- package/dist/x402-types/channel-types.js.map +1 -0
- package/dist/x402-types/exact-flop.d.ts +29 -0
- package/dist/x402-types/exact-flop.d.ts.map +1 -0
- package/dist/x402-types/exact-flop.js +64 -0
- package/dist/x402-types/exact-flop.js.map +1 -0
- package/dist/x402-types/index.d.ts +65 -0
- package/dist/x402-types/index.d.ts.map +1 -0
- package/dist/x402-types/index.js +26 -0
- package/dist/x402-types/index.js.map +1 -0
- package/dist/x402.d.ts +113 -0
- package/dist/x402.d.ts.map +1 -0
- package/dist/x402.js +218 -0
- package/dist/x402.js.map +1 -0
- package/package.json +172 -3
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
// Copyright 2026 FLOP Network
|
|
2
|
+
// SPDX-License-Identifier: MIT OR Apache-2.0
|
|
3
|
+
import { u8aToHex } from "@polkadot/util";
|
|
4
|
+
import { submitTx } from "./submit-tx.js";
|
|
5
|
+
import { RetentionClass, PROVIDER_SOVEREIGN_VALIDATORS, } from "./compute-channel/da.js";
|
|
6
|
+
export { RetentionClass, PROVIDER_SOVEREIGN_VALIDATORS };
|
|
7
|
+
function toHex(c) {
|
|
8
|
+
return typeof c === "string" ? c : u8aToHex(c);
|
|
9
|
+
}
|
|
10
|
+
/** camelCase {@link DataRef} → the pallet's snake-cased struct fields. */
|
|
11
|
+
function toExtrinsicDataRef(d) {
|
|
12
|
+
return { commitment: d.commitment, provider_id: d.providerId, retention: d.retention };
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The **effective**, governable per-byte deposit (smallest unit / plancks).
|
|
16
|
+
* Prefers the live on-chain storage value `daRegistry.depositPerByteValue`, which
|
|
17
|
+
* tracks governance's `set_deposit_per_byte`; falls back to the genesis const
|
|
18
|
+
* `daRegistry.depositPerByte` on runtimes that predate the storage item. Fails
|
|
19
|
+
* closed if neither is present — never defaults to 0.
|
|
20
|
+
*/
|
|
21
|
+
export async function effectiveDepositPerByte(api) {
|
|
22
|
+
const storage = api.query?.daRegistry?.depositPerByteValue;
|
|
23
|
+
if (storage !== undefined) {
|
|
24
|
+
const v = await storage();
|
|
25
|
+
return v.toBigInt();
|
|
26
|
+
}
|
|
27
|
+
const c = api.consts?.daRegistry?.depositPerByte;
|
|
28
|
+
if (c !== undefined) {
|
|
29
|
+
return c.toBigInt();
|
|
30
|
+
}
|
|
31
|
+
throw new Error("daRegistry.depositPerByteValue / depositPerByte not found in runtime metadata");
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Refundable anti-spam deposit (smallest unit / plancks) a `Leased` blob of
|
|
35
|
+
* `sizeBytes` locks at registration: `sizeBytes × DepositPerByte` (D-0412).
|
|
36
|
+
* Held under a hold reason and returned **in full** on prune/withdrawal — it is
|
|
37
|
+
* **not** a fee and **not** validator revenue. Uses the **effective** governable
|
|
38
|
+
* value ({@link effectiveDepositPerByte}), so estimates track a governance
|
|
39
|
+
* override rather than the stale genesis const.
|
|
40
|
+
*/
|
|
41
|
+
export async function leaseDeposit(api, sizeBytes) {
|
|
42
|
+
return BigInt(sizeBytes) * (await effectiveDepositPerByte(api));
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Register a `Leased` blob (e.g. model weights) on-chain: locks the refundable
|
|
46
|
+
* deposit and assigns the stake-weighted validator subset. The bytes must
|
|
47
|
+
* already be erasure-coded and pushed to the assigned validators off-chain
|
|
48
|
+
* (`services/da-validator`); only `commitment` + `sizeBytes` go on-chain.
|
|
49
|
+
* Resolves to the tx hash and the resulting {@link DataRef}.
|
|
50
|
+
*/
|
|
51
|
+
export async function registerBlob(api, signer, params) {
|
|
52
|
+
const commitment = toHex(params.commitment);
|
|
53
|
+
const txHash = await submitTx(api.tx.daRegistry.registerBlob(commitment, params.sizeBytes), signer);
|
|
54
|
+
return {
|
|
55
|
+
txHash,
|
|
56
|
+
dataRef: { commitment, providerId: PROVIDER_SOVEREIGN_VALIDATORS, retention: RetentionClass.Leased },
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Extend a `Leased` blob's storage term by `additionalTerm` blocks (a positive
|
|
61
|
+
* whole multiple of the runtime's `LeaseTermUnit`). Permissionless — anyone may
|
|
62
|
+
* top up, paying only the tx fee (the deposit is term-independent).
|
|
63
|
+
*/
|
|
64
|
+
export async function topUpLease(api, signer, params) {
|
|
65
|
+
return submitTx(api.tx.daRegistry.topUpLease(toHex(params.commitment), params.additionalTerm), signer);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Withdraw a `Leased` blob's deposit (publisher-only, when no usage pin is
|
|
69
|
+
* held): prunes the blob and refunds the deposit in full.
|
|
70
|
+
*/
|
|
71
|
+
export async function withdrawLease(api, signer, params) {
|
|
72
|
+
return submitTx(api.tx.daRegistry.withdrawLease(toHex(params.commitment)), signer);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Re-register a pruned `Leased` blob under the **same** commitment (the bytes
|
|
76
|
+
* are deterministic, so re-upload ⇒ same identity), re-locking the deposit and
|
|
77
|
+
* buying a fresh `leaseTerm`.
|
|
78
|
+
*/
|
|
79
|
+
export async function reactivateBlob(api, signer, params) {
|
|
80
|
+
const commitment = toHex(params.commitment);
|
|
81
|
+
const txHash = await submitTx(api.tx.daRegistry.reactivateBlob(commitment, params.sizeBytes, params.leaseTerm), signer);
|
|
82
|
+
return {
|
|
83
|
+
txHash,
|
|
84
|
+
dataRef: { commitment, providerId: PROVIDER_SOVEREIGN_VALIDATORS, retention: RetentionClass.Leased },
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Bind a `Leased` {@link DataRef} as a registered model's weights reference
|
|
89
|
+
* (publisher-only). The model must already exist (`register_model`).
|
|
90
|
+
*/
|
|
91
|
+
export async function setModelWeightsRef(api, signer, params) {
|
|
92
|
+
return submitTx(api.tx.modelRegistry.setModelWeightsRef(toHex(params.modelHash), toExtrinsicDataRef(params.weightsRef)), signer);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* End-to-end model-weights upload (on-chain side): register the `Leased`
|
|
96
|
+
* weights blob, then bind its {@link DataRef} to an already-registered model.
|
|
97
|
+
* Pass the image's DA `commitment` (`da-validator commit`; `blake2_256` of the bytes
|
|
98
|
+
* for an image of at most one 64 MiB chunk, a Merkle root over its chunks above that)
|
|
99
|
+
* and `sizeBytes`, then push the bytes off-chain (`services/da-validator submit`) after
|
|
100
|
+
* this resolves: a validator drops shards of an unregistered commitment at its next poll.
|
|
101
|
+
* Resolves to the bound {@link DataRef} and both tx hashes.
|
|
102
|
+
*
|
|
103
|
+
* Not atomic (two extrinsics): if the bind step fails (e.g. caller is not the
|
|
104
|
+
* model publisher, or `modelHash` is unregistered), the blob is already
|
|
105
|
+
* registered and its deposit locked — the thrown error names {@link withdrawLease}
|
|
106
|
+
* as the recovery path.
|
|
107
|
+
*/
|
|
108
|
+
export async function uploadModelWeights(api, signer, params) {
|
|
109
|
+
const { txHash: registerTxHash, dataRef } = await registerBlob(api, signer, {
|
|
110
|
+
commitment: params.commitment,
|
|
111
|
+
sizeBytes: params.sizeBytes,
|
|
112
|
+
});
|
|
113
|
+
let bindTxHash;
|
|
114
|
+
try {
|
|
115
|
+
bindTxHash = await setModelWeightsRef(api, signer, {
|
|
116
|
+
modelHash: params.modelHash,
|
|
117
|
+
weightsRef: dataRef,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
catch (e) {
|
|
121
|
+
throw new Error(`weights registered (tx ${registerTxHash}, deposit locked) but model bind failed; ` +
|
|
122
|
+
`recover with withdrawLease({ commitment: "${dataRef.commitment}" }). ` +
|
|
123
|
+
`Cause: ${e.message}`);
|
|
124
|
+
}
|
|
125
|
+
return { dataRef, registerTxHash, bindTxHash };
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=da-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"da-client.js","sourceRoot":"","sources":["../src/da-client.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,6CAA6C;AAkB7C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EACL,cAAc,EACd,6BAA6B,GAC9B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,cAAc,EAAE,6BAA6B,EAAE,CAAC;AAkBzD,SAAS,KAAK,CAAC,CAAa;IAC1B,OAAO,OAAO,CAAC,KAAK,QAAQ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B,CACtC,GAAe,EACf,MAAmB,EACnB,MAAsD;IAEtD,OAAO,QAAQ,CACb,GAAG,CAAC,EAAE,CAAC,aAAa,CAAC,kBAAkB,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,kBAAkB,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,EACvG,MAAM,CACP,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,GAAe,EACf,MAAmB,EACnB,MAAqF;IAErF,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,MAAM,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE;QAC1E,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,SAAS,EAAE,MAAM,CAAC,SAAS;KAC5B,CAAC,CAAC;IACH,IAAI,UAAkB,CAAC;IACvB,IAAI,CAAC;QACH,UAAU,GAAG,MAAM,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE;YACjD,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,UAAU,EAAE,OAAO;SACpB,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CACb,0BAA0B,cAAc,2CAA2C;YACjF,6CAA6C,OAAO,CAAC,UAAU,QAAQ;YACvE,UAAW,CAAW,CAAC,OAAO,EAAE,CACnC,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capability Taxonomy for Model Discovery
|
|
3
|
+
*
|
|
4
|
+
* This module defines the capability taxonomy used for model discovery
|
|
5
|
+
* in the FLOP Network. Models are tagged with capabilities and quality
|
|
6
|
+
* scores to enable intelligent model selection.
|
|
7
|
+
*
|
|
8
|
+
* @module discovery/capabilities
|
|
9
|
+
* @see docs/research/r0009-agent-onboarding-recommendations.md section 2
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Model capability identifiers.
|
|
13
|
+
*
|
|
14
|
+
* Capabilities are grouped into categories:
|
|
15
|
+
* - Text: Basic text processing capabilities
|
|
16
|
+
* - Reasoning: Advanced reasoning and planning
|
|
17
|
+
* - Multimodal: Image, audio, video processing
|
|
18
|
+
* - Specialized: Domain-specific or advanced features
|
|
19
|
+
*/
|
|
20
|
+
export type ModelCapability = 'text_generation' | 'code_generation' | 'code_completion' | 'code_review' | 'translation' | 'summarization' | 'question_answering' | 'chat' | 'roleplay' | 'creative_writing' | 'mathematical_reasoning' | 'logical_reasoning' | 'planning' | 'tool_use' | 'function_calling' | 'image_generation' | 'image_understanding' | 'audio_generation' | 'audio_transcription' | 'video_understanding' | 'embeddings' | 'fine_tuning' | 'structured_output' | 'long_context' | 'multilingual';
|
|
21
|
+
/**
|
|
22
|
+
* Capability category for grouping related capabilities.
|
|
23
|
+
*/
|
|
24
|
+
export type CapabilityCategory = 'text' | 'reasoning' | 'multimodal' | 'specialized';
|
|
25
|
+
/**
|
|
26
|
+
* Mapping of capabilities to their categories.
|
|
27
|
+
*/
|
|
28
|
+
export declare const CAPABILITY_CATEGORIES: Record<ModelCapability, CapabilityCategory>;
|
|
29
|
+
/**
|
|
30
|
+
* Capability metadata including display name and description.
|
|
31
|
+
*/
|
|
32
|
+
export interface CapabilityInfo {
|
|
33
|
+
/** Capability identifier */
|
|
34
|
+
id: ModelCapability;
|
|
35
|
+
/** Human-readable display name */
|
|
36
|
+
name: string;
|
|
37
|
+
/** Brief description of the capability */
|
|
38
|
+
description: string;
|
|
39
|
+
/** Category this capability belongs to */
|
|
40
|
+
category: CapabilityCategory;
|
|
41
|
+
/** Related capabilities that often overlap */
|
|
42
|
+
relatedCapabilities: ModelCapability[];
|
|
43
|
+
/** Typical use cases */
|
|
44
|
+
useCases: string[];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Complete capability registry with metadata.
|
|
48
|
+
*/
|
|
49
|
+
export declare const CAPABILITY_REGISTRY: Record<ModelCapability, CapabilityInfo>;
|
|
50
|
+
/**
|
|
51
|
+
* Benchmark result for a specific test.
|
|
52
|
+
*/
|
|
53
|
+
export interface BenchmarkResult {
|
|
54
|
+
/** Benchmark name (e.g., "humaneval", "mbpp", "gsm8k") */
|
|
55
|
+
benchmark: string;
|
|
56
|
+
/** Score (typically 0-100) */
|
|
57
|
+
score: number;
|
|
58
|
+
/** Optional date when benchmark was run */
|
|
59
|
+
date?: string;
|
|
60
|
+
/** Optional source URL for benchmark results */
|
|
61
|
+
source?: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Capability profile for a model.
|
|
65
|
+
*
|
|
66
|
+
* Describes what a model can do and how well it does it.
|
|
67
|
+
*/
|
|
68
|
+
export interface CapabilityProfile {
|
|
69
|
+
/** Model identifier (hash or name) */
|
|
70
|
+
modelId: string;
|
|
71
|
+
/** Human-readable model name */
|
|
72
|
+
modelName: string;
|
|
73
|
+
/** Primary capability this model is optimized for */
|
|
74
|
+
primaryCapability: ModelCapability;
|
|
75
|
+
/** Secondary capabilities with quality scores */
|
|
76
|
+
secondaryCapabilities: Map<ModelCapability, number>;
|
|
77
|
+
/** Quality score for primary capability (0-100) */
|
|
78
|
+
qualityScore: number;
|
|
79
|
+
/** Benchmark results that inform quality scores */
|
|
80
|
+
benchmarks: BenchmarkResult[];
|
|
81
|
+
/** When this profile was last updated */
|
|
82
|
+
lastUpdated: string;
|
|
83
|
+
/** Source of the profile (e.g., "official", "community", "estimated") */
|
|
84
|
+
source: 'official' | 'community' | 'estimated';
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Create an empty capability profile.
|
|
88
|
+
*/
|
|
89
|
+
export declare function createEmptyProfile(modelId: string, modelName: string): CapabilityProfile;
|
|
90
|
+
/**
|
|
91
|
+
* Get the quality score for a specific capability.
|
|
92
|
+
*/
|
|
93
|
+
export declare function getCapabilityScore(profile: CapabilityProfile, capability: ModelCapability): number;
|
|
94
|
+
/**
|
|
95
|
+
* Check if a model has a capability above a threshold.
|
|
96
|
+
*/
|
|
97
|
+
export declare function hasCapability(profile: CapabilityProfile, capability: ModelCapability, minScore?: number): boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Get all capabilities a model supports above a threshold.
|
|
100
|
+
*/
|
|
101
|
+
export declare function getSupportedCapabilities(profile: CapabilityProfile, minScore?: number): ModelCapability[];
|
|
102
|
+
/**
|
|
103
|
+
* Get capability info by ID.
|
|
104
|
+
*/
|
|
105
|
+
export declare function getCapabilityInfo(capability: ModelCapability): CapabilityInfo;
|
|
106
|
+
/**
|
|
107
|
+
* Get all capabilities in a category.
|
|
108
|
+
*/
|
|
109
|
+
export declare function getCapabilitiesByCategory(category: CapabilityCategory): ModelCapability[];
|
|
110
|
+
/**
|
|
111
|
+
* Check if a string is a valid capability.
|
|
112
|
+
*/
|
|
113
|
+
export declare function isValidCapability(value: string): value is ModelCapability;
|
|
114
|
+
/**
|
|
115
|
+
* Parse capability from string, with fallback.
|
|
116
|
+
*/
|
|
117
|
+
export declare function parseCapability(value: string, fallback?: ModelCapability): ModelCapability;
|
|
118
|
+
/**
|
|
119
|
+
* Get related capabilities for a given capability.
|
|
120
|
+
*/
|
|
121
|
+
export declare function getRelatedCapabilities(capability: ModelCapability): ModelCapability[];
|
|
122
|
+
/**
|
|
123
|
+
* Infer capability from prompt content.
|
|
124
|
+
*
|
|
125
|
+
* Simple heuristic-based classification for auto-detection.
|
|
126
|
+
* For production use, consider a trained classifier.
|
|
127
|
+
*/
|
|
128
|
+
export declare function inferCapabilityFromPrompt(prompt: string): ModelCapability;
|
|
129
|
+
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../src/discovery/capabilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH;;;;;;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AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,eAAe,GAAG,eAAe,EAAE,CAErF;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,GAAG,eAAe,CAmEzE"}
|
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capability Taxonomy for Model Discovery
|
|
3
|
+
*
|
|
4
|
+
* This module defines the capability taxonomy used for model discovery
|
|
5
|
+
* in the FLOP Network. Models are tagged with capabilities and quality
|
|
6
|
+
* scores to enable intelligent model selection.
|
|
7
|
+
*
|
|
8
|
+
* @module discovery/capabilities
|
|
9
|
+
* @see docs/research/r0009-agent-onboarding-recommendations.md section 2
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Mapping of capabilities to their categories.
|
|
13
|
+
*/
|
|
14
|
+
export const CAPABILITY_CATEGORIES = {
|
|
15
|
+
// Text
|
|
16
|
+
text_generation: 'text',
|
|
17
|
+
code_generation: 'text',
|
|
18
|
+
code_completion: 'text',
|
|
19
|
+
code_review: 'text',
|
|
20
|
+
translation: 'text',
|
|
21
|
+
summarization: 'text',
|
|
22
|
+
question_answering: 'text',
|
|
23
|
+
chat: 'text',
|
|
24
|
+
roleplay: 'text',
|
|
25
|
+
creative_writing: 'text',
|
|
26
|
+
// Reasoning
|
|
27
|
+
mathematical_reasoning: 'reasoning',
|
|
28
|
+
logical_reasoning: 'reasoning',
|
|
29
|
+
planning: 'reasoning',
|
|
30
|
+
tool_use: 'reasoning',
|
|
31
|
+
function_calling: 'reasoning',
|
|
32
|
+
// Multimodal
|
|
33
|
+
image_generation: 'multimodal',
|
|
34
|
+
image_understanding: 'multimodal',
|
|
35
|
+
audio_generation: 'multimodal',
|
|
36
|
+
audio_transcription: 'multimodal',
|
|
37
|
+
video_understanding: 'multimodal',
|
|
38
|
+
// Specialized
|
|
39
|
+
embeddings: 'specialized',
|
|
40
|
+
fine_tuning: 'specialized',
|
|
41
|
+
structured_output: 'specialized',
|
|
42
|
+
long_context: 'specialized',
|
|
43
|
+
multilingual: 'specialized',
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Complete capability registry with metadata.
|
|
47
|
+
*/
|
|
48
|
+
export const CAPABILITY_REGISTRY = {
|
|
49
|
+
// Text capabilities
|
|
50
|
+
text_generation: {
|
|
51
|
+
id: 'text_generation',
|
|
52
|
+
name: 'Text Generation',
|
|
53
|
+
description: 'General-purpose text generation and completion',
|
|
54
|
+
category: 'text',
|
|
55
|
+
relatedCapabilities: ['creative_writing', 'chat'],
|
|
56
|
+
useCases: ['Content creation', 'Draft generation', 'General completion'],
|
|
57
|
+
},
|
|
58
|
+
code_generation: {
|
|
59
|
+
id: 'code_generation',
|
|
60
|
+
name: 'Code Generation',
|
|
61
|
+
description: 'Generate code from natural language descriptions',
|
|
62
|
+
category: 'text',
|
|
63
|
+
relatedCapabilities: ['code_completion', 'code_review'],
|
|
64
|
+
useCases: ['Writing functions', 'Creating applications', 'Code scaffolding'],
|
|
65
|
+
},
|
|
66
|
+
code_completion: {
|
|
67
|
+
id: 'code_completion',
|
|
68
|
+
name: 'Code Completion',
|
|
69
|
+
description: 'Complete partial code with context awareness',
|
|
70
|
+
category: 'text',
|
|
71
|
+
relatedCapabilities: ['code_generation', 'code_review'],
|
|
72
|
+
useCases: ['IDE completion', 'Code suggestions', 'Snippet expansion'],
|
|
73
|
+
},
|
|
74
|
+
code_review: {
|
|
75
|
+
id: 'code_review',
|
|
76
|
+
name: 'Code Review',
|
|
77
|
+
description: 'Analyze code for issues, improvements, and best practices',
|
|
78
|
+
category: 'text',
|
|
79
|
+
relatedCapabilities: ['code_generation', 'logical_reasoning'],
|
|
80
|
+
useCases: ['PR reviews', 'Security audits', 'Code quality checks'],
|
|
81
|
+
},
|
|
82
|
+
translation: {
|
|
83
|
+
id: 'translation',
|
|
84
|
+
name: 'Translation',
|
|
85
|
+
description: 'Translate text between languages',
|
|
86
|
+
category: 'text',
|
|
87
|
+
relatedCapabilities: ['multilingual', 'text_generation'],
|
|
88
|
+
useCases: ['Document translation', 'Real-time translation', 'Localization'],
|
|
89
|
+
},
|
|
90
|
+
summarization: {
|
|
91
|
+
id: 'summarization',
|
|
92
|
+
name: 'Summarization',
|
|
93
|
+
description: 'Condense long texts into shorter summaries',
|
|
94
|
+
category: 'text',
|
|
95
|
+
relatedCapabilities: ['text_generation', 'question_answering'],
|
|
96
|
+
useCases: ['Article summaries', 'Meeting notes', 'Document condensation'],
|
|
97
|
+
},
|
|
98
|
+
question_answering: {
|
|
99
|
+
id: 'question_answering',
|
|
100
|
+
name: 'Question Answering',
|
|
101
|
+
description: 'Answer questions based on context or knowledge',
|
|
102
|
+
category: 'text',
|
|
103
|
+
relatedCapabilities: ['text_generation', 'logical_reasoning'],
|
|
104
|
+
useCases: ['FAQ bots', 'Knowledge base queries', 'Research assistance'],
|
|
105
|
+
},
|
|
106
|
+
chat: {
|
|
107
|
+
id: 'chat',
|
|
108
|
+
name: 'Chat',
|
|
109
|
+
description: 'Conversational dialogue with context retention',
|
|
110
|
+
category: 'text',
|
|
111
|
+
relatedCapabilities: ['text_generation', 'roleplay'],
|
|
112
|
+
useCases: ['Chatbots', 'Virtual assistants', 'Customer support'],
|
|
113
|
+
},
|
|
114
|
+
roleplay: {
|
|
115
|
+
id: 'roleplay',
|
|
116
|
+
name: 'Roleplay',
|
|
117
|
+
description: 'Adopt personas and engage in character-based dialogue',
|
|
118
|
+
category: 'text',
|
|
119
|
+
relatedCapabilities: ['chat', 'creative_writing'],
|
|
120
|
+
useCases: ['Game NPCs', 'Training scenarios', 'Creative storytelling'],
|
|
121
|
+
},
|
|
122
|
+
creative_writing: {
|
|
123
|
+
id: 'creative_writing',
|
|
124
|
+
name: 'Creative Writing',
|
|
125
|
+
description: 'Generate creative content like stories and poetry',
|
|
126
|
+
category: 'text',
|
|
127
|
+
relatedCapabilities: ['text_generation', 'roleplay'],
|
|
128
|
+
useCases: ['Story generation', 'Marketing copy', 'Script writing'],
|
|
129
|
+
},
|
|
130
|
+
// Reasoning capabilities
|
|
131
|
+
mathematical_reasoning: {
|
|
132
|
+
id: 'mathematical_reasoning',
|
|
133
|
+
name: 'Mathematical Reasoning',
|
|
134
|
+
description: 'Solve mathematical problems and equations',
|
|
135
|
+
category: 'reasoning',
|
|
136
|
+
relatedCapabilities: ['logical_reasoning', 'code_generation'],
|
|
137
|
+
useCases: ['Math problems', 'Scientific computing', 'Data analysis'],
|
|
138
|
+
},
|
|
139
|
+
logical_reasoning: {
|
|
140
|
+
id: 'logical_reasoning',
|
|
141
|
+
name: 'Logical Reasoning',
|
|
142
|
+
description: 'Apply logic to solve complex problems',
|
|
143
|
+
category: 'reasoning',
|
|
144
|
+
relatedCapabilities: ['mathematical_reasoning', 'planning'],
|
|
145
|
+
useCases: ['Problem solving', 'Decision trees', 'Logical proofs'],
|
|
146
|
+
},
|
|
147
|
+
planning: {
|
|
148
|
+
id: 'planning',
|
|
149
|
+
name: 'Planning',
|
|
150
|
+
description: 'Create step-by-step plans to achieve goals',
|
|
151
|
+
category: 'reasoning',
|
|
152
|
+
relatedCapabilities: ['logical_reasoning', 'tool_use'],
|
|
153
|
+
useCases: ['Task planning', 'Project management', 'Strategic planning'],
|
|
154
|
+
},
|
|
155
|
+
tool_use: {
|
|
156
|
+
id: 'tool_use',
|
|
157
|
+
name: 'Tool Use',
|
|
158
|
+
description: 'Use external tools and APIs effectively',
|
|
159
|
+
category: 'reasoning',
|
|
160
|
+
relatedCapabilities: ['function_calling', 'planning'],
|
|
161
|
+
useCases: ['API orchestration', 'Multi-tool workflows', 'Agent systems'],
|
|
162
|
+
},
|
|
163
|
+
function_calling: {
|
|
164
|
+
id: 'function_calling',
|
|
165
|
+
name: 'Function Calling',
|
|
166
|
+
description: 'Structured function calling with parameter extraction',
|
|
167
|
+
category: 'reasoning',
|
|
168
|
+
relatedCapabilities: ['tool_use', 'structured_output'],
|
|
169
|
+
useCases: ['API integration', 'Structured outputs', 'Agent actions'],
|
|
170
|
+
},
|
|
171
|
+
// Multimodal capabilities
|
|
172
|
+
image_generation: {
|
|
173
|
+
id: 'image_generation',
|
|
174
|
+
name: 'Image Generation',
|
|
175
|
+
description: 'Generate images from text descriptions',
|
|
176
|
+
category: 'multimodal',
|
|
177
|
+
relatedCapabilities: ['creative_writing'],
|
|
178
|
+
useCases: ['Art generation', 'Product images', 'Design assets'],
|
|
179
|
+
},
|
|
180
|
+
image_understanding: {
|
|
181
|
+
id: 'image_understanding',
|
|
182
|
+
name: 'Image Understanding',
|
|
183
|
+
description: 'Analyze and describe images',
|
|
184
|
+
category: 'multimodal',
|
|
185
|
+
relatedCapabilities: ['question_answering', 'text_generation'],
|
|
186
|
+
useCases: ['Image captions', 'Visual Q&A', 'Content moderation'],
|
|
187
|
+
},
|
|
188
|
+
audio_generation: {
|
|
189
|
+
id: 'audio_generation',
|
|
190
|
+
name: 'Audio Generation',
|
|
191
|
+
description: 'Generate audio, speech, or music from text',
|
|
192
|
+
category: 'multimodal',
|
|
193
|
+
relatedCapabilities: ['text_generation'],
|
|
194
|
+
useCases: ['TTS', 'Music generation', 'Sound effects'],
|
|
195
|
+
},
|
|
196
|
+
audio_transcription: {
|
|
197
|
+
id: 'audio_transcription',
|
|
198
|
+
name: 'Audio Transcription',
|
|
199
|
+
description: 'Transcribe speech to text',
|
|
200
|
+
category: 'multimodal',
|
|
201
|
+
relatedCapabilities: ['translation'],
|
|
202
|
+
useCases: ['Transcription', 'Subtitles', 'Voice logging'],
|
|
203
|
+
},
|
|
204
|
+
video_understanding: {
|
|
205
|
+
id: 'video_understanding',
|
|
206
|
+
name: 'Video Understanding',
|
|
207
|
+
description: 'Analyze and describe video content',
|
|
208
|
+
category: 'multimodal',
|
|
209
|
+
relatedCapabilities: ['image_understanding', 'question_answering'],
|
|
210
|
+
useCases: ['Video analysis', 'Content moderation', 'Highlight detection'],
|
|
211
|
+
},
|
|
212
|
+
// Specialized capabilities
|
|
213
|
+
embeddings: {
|
|
214
|
+
id: 'embeddings',
|
|
215
|
+
name: 'Embeddings',
|
|
216
|
+
description: 'Generate dense vector representations of text',
|
|
217
|
+
category: 'specialized',
|
|
218
|
+
relatedCapabilities: ['question_answering'],
|
|
219
|
+
useCases: ['Semantic search', 'Clustering', 'Similarity'],
|
|
220
|
+
},
|
|
221
|
+
fine_tuning: {
|
|
222
|
+
id: 'fine_tuning',
|
|
223
|
+
name: 'Fine-Tuning',
|
|
224
|
+
description: 'Support for fine-tuning on custom data',
|
|
225
|
+
category: 'specialized',
|
|
226
|
+
relatedCapabilities: [],
|
|
227
|
+
useCases: ['Custom models', 'Domain adaptation', 'Style transfer'],
|
|
228
|
+
},
|
|
229
|
+
structured_output: {
|
|
230
|
+
id: 'structured_output',
|
|
231
|
+
name: 'Structured Output',
|
|
232
|
+
description: 'Generate outputs in structured formats (JSON, XML)',
|
|
233
|
+
category: 'specialized',
|
|
234
|
+
relatedCapabilities: ['function_calling'],
|
|
235
|
+
useCases: ['Data extraction', 'API responses', 'Schema generation'],
|
|
236
|
+
},
|
|
237
|
+
long_context: {
|
|
238
|
+
id: 'long_context',
|
|
239
|
+
name: 'Long Context',
|
|
240
|
+
description: 'Handle very long contexts (100K+ tokens)',
|
|
241
|
+
category: 'specialized',
|
|
242
|
+
relatedCapabilities: ['text_generation', 'summarization'],
|
|
243
|
+
useCases: ['Document analysis', 'Codebase understanding', 'Book processing'],
|
|
244
|
+
},
|
|
245
|
+
multilingual: {
|
|
246
|
+
id: 'multilingual',
|
|
247
|
+
name: 'Multilingual',
|
|
248
|
+
description: 'Strong performance across many languages',
|
|
249
|
+
category: 'specialized',
|
|
250
|
+
relatedCapabilities: ['translation'],
|
|
251
|
+
useCases: ['Multi-language support', 'Global applications', 'Localization'],
|
|
252
|
+
},
|
|
253
|
+
};
|
|
254
|
+
/**
|
|
255
|
+
* Create an empty capability profile.
|
|
256
|
+
*/
|
|
257
|
+
export function createEmptyProfile(modelId, modelName) {
|
|
258
|
+
return {
|
|
259
|
+
modelId,
|
|
260
|
+
modelName,
|
|
261
|
+
primaryCapability: 'text_generation',
|
|
262
|
+
secondaryCapabilities: new Map(),
|
|
263
|
+
qualityScore: 50,
|
|
264
|
+
benchmarks: [],
|
|
265
|
+
lastUpdated: new Date().toISOString(),
|
|
266
|
+
source: 'estimated',
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Get the quality score for a specific capability.
|
|
271
|
+
*/
|
|
272
|
+
export function getCapabilityScore(profile, capability) {
|
|
273
|
+
if (capability === profile.primaryCapability) {
|
|
274
|
+
return profile.qualityScore;
|
|
275
|
+
}
|
|
276
|
+
return profile.secondaryCapabilities.get(capability) ?? 0;
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Check if a model has a capability above a threshold.
|
|
280
|
+
*/
|
|
281
|
+
export function hasCapability(profile, capability, minScore = 50) {
|
|
282
|
+
return getCapabilityScore(profile, capability) >= minScore;
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Get all capabilities a model supports above a threshold.
|
|
286
|
+
*/
|
|
287
|
+
export function getSupportedCapabilities(profile, minScore = 50) {
|
|
288
|
+
const capabilities = [];
|
|
289
|
+
if (profile.qualityScore >= minScore) {
|
|
290
|
+
capabilities.push(profile.primaryCapability);
|
|
291
|
+
}
|
|
292
|
+
for (const [cap, score] of profile.secondaryCapabilities) {
|
|
293
|
+
if (score >= minScore && !capabilities.includes(cap)) {
|
|
294
|
+
capabilities.push(cap);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
return capabilities;
|
|
298
|
+
}
|
|
299
|
+
// ── Helper Functions ─────────────────────────────────────────────────────
|
|
300
|
+
/**
|
|
301
|
+
* Get capability info by ID.
|
|
302
|
+
*/
|
|
303
|
+
export function getCapabilityInfo(capability) {
|
|
304
|
+
return CAPABILITY_REGISTRY[capability];
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Get all capabilities in a category.
|
|
308
|
+
*/
|
|
309
|
+
export function getCapabilitiesByCategory(category) {
|
|
310
|
+
return Object.entries(CAPABILITY_CATEGORIES)
|
|
311
|
+
.filter(([_, cat]) => cat === category)
|
|
312
|
+
.map(([cap]) => cap);
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Check if a string is a valid capability.
|
|
316
|
+
*/
|
|
317
|
+
export function isValidCapability(value) {
|
|
318
|
+
return value in CAPABILITY_REGISTRY;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Parse capability from string, with fallback.
|
|
322
|
+
*/
|
|
323
|
+
export function parseCapability(value, fallback = 'text_generation') {
|
|
324
|
+
if (isValidCapability(value)) {
|
|
325
|
+
return value;
|
|
326
|
+
}
|
|
327
|
+
return fallback;
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Get related capabilities for a given capability.
|
|
331
|
+
*/
|
|
332
|
+
export function getRelatedCapabilities(capability) {
|
|
333
|
+
return CAPABILITY_REGISTRY[capability]?.relatedCapabilities ?? [];
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Infer capability from prompt content.
|
|
337
|
+
*
|
|
338
|
+
* Simple heuristic-based classification for auto-detection.
|
|
339
|
+
* For production use, consider a trained classifier.
|
|
340
|
+
*/
|
|
341
|
+
export function inferCapabilityFromPrompt(prompt) {
|
|
342
|
+
const lower = prompt.toLowerCase();
|
|
343
|
+
// Code-related patterns
|
|
344
|
+
if (/\b(code|function|program|script|implement|debug|fix\s*bug|refactor)\b/.test(lower)) {
|
|
345
|
+
if (/\b(review|audit)\b/.test(lower)) {
|
|
346
|
+
return 'code_review';
|
|
347
|
+
}
|
|
348
|
+
if (/\b(complete|finish|continue)\b/.test(lower)) {
|
|
349
|
+
return 'code_completion';
|
|
350
|
+
}
|
|
351
|
+
return 'code_generation';
|
|
352
|
+
}
|
|
353
|
+
// Code review (explicit)
|
|
354
|
+
if (/\b(review.*code|code.*review)\b/.test(lower) || /\b(analyze.*pr|pr.*analyze|audit)\b/.test(lower)) {
|
|
355
|
+
return 'code_review';
|
|
356
|
+
}
|
|
357
|
+
// Translation (match translat as prefix)
|
|
358
|
+
if (/\btranslat/.test(lower) || /\b(to|from)\s+(spanish|french|german|chinese|japanese|korean|russian)\b/.test(lower)) {
|
|
359
|
+
return 'translation';
|
|
360
|
+
}
|
|
361
|
+
// Summarization (match summariz as prefix, or summary/tldr)
|
|
362
|
+
if (/\bsummar/.test(lower) || /\b(tldr|condense)\b/.test(lower)) {
|
|
363
|
+
return 'summarization';
|
|
364
|
+
}
|
|
365
|
+
// Math/Reasoning
|
|
366
|
+
if (/\b(math|calculat|equation|solve|proof|algebra|geometry|theorem|integral|derivative)\b/.test(lower)) {
|
|
367
|
+
return 'mathematical_reasoning';
|
|
368
|
+
}
|
|
369
|
+
// Image
|
|
370
|
+
if (/\b(image|picture|draw|generate\s+image|create\s+image|visual|dalle|midjourney)\b/.test(lower)) {
|
|
371
|
+
if (/\b(describ|analyz|what.*in.*image|caption)\b/.test(lower)) {
|
|
372
|
+
return 'image_understanding';
|
|
373
|
+
}
|
|
374
|
+
return 'image_generation';
|
|
375
|
+
}
|
|
376
|
+
// Audio
|
|
377
|
+
if (/\b(audio|speech|voice|transcrib|speak|pronunci)\b/.test(lower)) {
|
|
378
|
+
if (/\btranscrib/.test(lower)) {
|
|
379
|
+
return 'audio_transcription';
|
|
380
|
+
}
|
|
381
|
+
return 'audio_generation';
|
|
382
|
+
}
|
|
383
|
+
// Chat/Conversation (check before question_answering)
|
|
384
|
+
if (/^(hello|hi|hey|good\s*morning|good\s*evening|how\s*are\s*you)\b/.test(lower) || /\b(chat|talk|convers)\b/.test(lower)) {
|
|
385
|
+
return 'chat';
|
|
386
|
+
}
|
|
387
|
+
// Question answering
|
|
388
|
+
if (/^(what|who|when|where|why|how|which)\b/.test(lower) || /\?/.test(prompt)) {
|
|
389
|
+
return 'question_answering';
|
|
390
|
+
}
|
|
391
|
+
// Creative writing
|
|
392
|
+
if (/\b(write|story|poem|creative|fiction|novel|blog|article)\b/.test(lower)) {
|
|
393
|
+
return 'creative_writing';
|
|
394
|
+
}
|
|
395
|
+
// Default
|
|
396
|
+
return 'text_generation';
|
|
397
|
+
}
|
|
398
|
+
//# sourceMappingURL=capabilities.js.map
|