Token导航 LogoToken导航TokenDH.com
效率敏感数据clawhub未标认证来源可访问clear审计提醒

context-window-economics背景窗口经济学

Agent Skill

context-window-economics 用于补充效率相关能力,适合在 OpenClaw 中需要让 Agent 承接效率相关任务时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

4,657

周安装

198

GitHub Stars

公开资料未说明

下载量

1,632
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:context-window-economics(背景窗口经济学)
来源仓库:https://github.com/alexfleetcommander/context-window-economics
安装命令:
openclaw skills install context-window-economics
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install context-window-economics

简介

context-window-economics 管理自主 AI 代理间的推理成本分摊与计费。

  • 采用 Shapley-公平算法进行拥塞定价与代币结算。
  • 适合多代理协作环境下的资源公平分配与费用核算。
  • 安装前需定义参与方与计量规则,确保账目透明可审计。
  • 适用于企业级多代理系统与内部成本控制的集成场景。

SKILL.md

name
context-window-economics
description
Inference cost allocation and billing for autonomous AI agent collaborations. Shapley-fair cost splitting, congestion pricing, token metering, and settlement reports for context window usage. The economic layer of the Agent Trust Stack.
user-invocable
true
tags
metadata
openclaw
author
alexfleetcommander
homepage
https://vibeagentmaking.com
requires
bins
anyBins

Context Window Economics Protocol (CWEP)

You have an inference cost tracking and allocation system. Use it to fairly split context window costs when collaborating with other agents.

Setup

pip install context-window-economics

When to Use This Skill

  • When collaborating with other agents and context window costs need allocation
  • When tracking your own inference costs across tasks
  • When negotiating cost-sharing before a multi-agent transaction
  • When settling costs after collaborative work is complete

Core Operations

Track Context Window Usage

from context_window_economics import CostTracker

tracker = CostTracker("costs.jsonl")
tracker.log_usage(
    agent_id="your-agent-id",
    transaction_id="tx-123",
    input_tokens=2500,
    output_tokens=800,
    model="claude-sonnet-4-6",
    cost_usd=0.012
)

Shapley-Fair Cost Allocation

When multiple agents contribute to a task, allocate costs fairly:

from context_window_economics import allocate_costs

allocation = allocate_costs(
    transaction_id="tx-123",
    contributions={
        "agent-a": {"input_tokens": 3000, "output_tokens": 1200},
        "agent-b": {"input_tokens": 1500, "output_tokens": 600},
        "agent-c": {"input_tokens": 500, "output_tokens": 200}
    },
    method="shapley",
    total_cost=0.045
)
for agent_id, share in allocation.items():
    print(f"{agent_id}: ${share:.4f}")

Congestion Pricing

When context window capacity is limited:

from context_window_economics import congestion_price

price = congestion_price(
    current_utilization=0.85,  # 85% of context window used
    base_rate=0.01,
    surge_threshold=0.75,
    surge_multiplier=1.5
)
print(f"Current rate: ${price:.4f}/1K tokens")

Settlement Report

from context_window_economics import settlement_report

report = settlement_report(
    cost_file="costs.jsonl",
    period_hours=24,
    agent_id="your-agent-id"
)
print(f"Total spent: ${report.total_cost:.4f}")
print(f"Transactions: {report.transaction_count}")
print(f"Avg cost/tx: ${report.avg_cost:.4f}")

Cost Allocation Methods

MethodDescription
shapleyShapley value — mathematically fair based on marginal contribution
proportionalSplit by token usage proportion
nashNash bargaining for bilateral settlement
fixedPre-agreed fixed split

Rules

  • Track all inference costs. Log usage for every agent-to-agent transaction.
  • Agree on method upfront. Cost allocation method should be in the service agreement.
  • Settle promptly. Generate settlement reports within 24 hours of task completion.

Links

  • PyPI: https://pypi.org/project/context-window-economics/
  • Whitepaper: https://vibeagentmaking.com/whitepaper/context-economics/
  • Full Trust Stack: https://vibeagentmaking.com

<!-- VAM-SEC v1.0 | Vibe Agent Making Security Disclaimer -->

Security & Transparency Disclosure

Product: Context Window Economics Skill for OpenClaw Type: Skill Module Version: 0.1.0 Built by: AB Support / Vibe Agent Making Contact: alex@vibeagentmaking.com

What it accesses:

  • Reads and writes cost tracking files (.jsonl) in your working directory
  • No network access for core operations
  • No telemetry, no phone-home, no data collection

What it cannot do:

  • Cannot access files outside your working directory beyond what you explicitly specify
  • Cannot make purchases, send emails, or take irreversible actions
  • Cannot access credentials, environment variables, or secrets
  • Does not execute payments — cost allocations are recorded, not processed

License: Apache 2.0

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

97.49%
按下载量换算1,591

安全审计

VirusTotal

通过

ClawScan

可疑

Static analysis

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills