pantheon-opencode 1.6.1 → 1.6.2-beta.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/AGENTS.global.md +11 -11
- package/AGENTS.md +2 -2
- package/CHANGELOG.md +29 -0
- package/README.md +100 -19
- package/README.pt-BR.md +27 -11
- package/bin/pantheon-init.mjs +106 -19
- package/package.json +3 -2
- package/plugin.json +1 -1
- package/pyproject.toml +1 -1
- package/scripts/build-agents-md.mjs +1 -1
- package/scripts/doctor.mjs +213 -45
- package/scripts/install/agents-md.mjs +2 -1
- package/scripts/install/config-migration.mjs +344 -393
- package/scripts/install/config-paths.mjs +15 -0
- package/scripts/install/mcp-permissions.mjs +164 -0
- package/scripts/install/opencode-version.mjs +31 -13
- package/scripts/install/opencode-wildcard.mjs +106 -0
- package/scripts/install/opencode.mjs +240 -69
- package/scripts/install/plan-artifact.mjs +12 -1
- package/scripts/install/plugin.mjs +17 -1
- package/scripts/install/v2-capabilities.mjs +5 -6
- package/scripts/package-evidence.mjs +1 -0
- package/scripts/sandbox-env.sh +174 -0
- package/scripts/setup-v2-config.mjs +1703 -0
- package/scripts/setup.mjs +415 -0
- package/scripts/sync-tui.mjs +9 -1
- package/scripts/test-opencode-v2-sandbox.sh +438 -151
- package/scripts/update-skills-lock.mjs +30 -0
- package/skills-lock.json +10 -10
- package/src/agents/aphrodite.md +5 -2
- package/src/agents/apollo.md +5 -0
- package/src/agents/athena.md +6 -1
- package/src/agents/demeter.md +5 -1
- package/src/agents/gaia.md +4 -0
- package/src/agents/hephaestus.md +6 -1
- package/src/agents/hermes.md +6 -3
- package/src/agents/iris.md +5 -1
- package/src/agents/mnemosyne.md +20 -50
- package/src/agents/nyx.md +5 -1
- package/src/agents/prometheus.md +4 -0
- package/src/agents/talos.md +4 -0
- package/src/agents/themis.md +4 -0
- package/src/agents/zeus.md +9 -3
- package/src/instructions/agent-return-format.instructions.md +1 -1
- package/src/instructions/memory-protocol.instructions.md +3 -3
- package/src/instructions/test-economy.instructions.md +6 -6
- package/src/mcp/pantheon_vision.py +37 -36
- package/src/pantheon/cost-command.ts +30 -133
- package/src/pantheon/model-pricing.ts +1 -536
- package/src/pantheon/v2-vision.ts +34 -29
- package/src/pantheon/vision.ts +43 -10
- package/src/plugin-v2.ts +30 -53
- package/src/plugins/tui/THIRD_PARTY_NOTICES.md +24 -0
- package/src/plugins/tui/dist/cost-data-CCZUs1aJ.js +749 -0
- package/src/plugins/tui/dist/cost-data-CCZUs1aJ.js.map +1 -0
- package/src/plugins/tui/dist/quota-adapters.d.ts +89 -0
- package/src/plugins/tui/dist/quota-adapters.d.ts.map +1 -0
- package/src/plugins/tui/dist/quota-adapters.js +1142 -0
- package/src/plugins/tui/dist/quota-adapters.js.map +1 -0
- package/src/plugins/tui/dist/quota-cli.d.ts +17 -0
- package/src/plugins/tui/dist/quota-cli.d.ts.map +1 -0
- package/src/plugins/tui/dist/quota-cli.js +184 -0
- package/src/plugins/tui/dist/quota-cli.js.map +1 -0
- package/src/plugins/tui/dist/quota-rpc-DMmXBhBe.js +684 -0
- package/src/plugins/tui/dist/quota-rpc-DMmXBhBe.js.map +1 -0
- package/src/plugins/tui/dist/server-v2.d.ts +14 -0
- package/src/plugins/tui/dist/server-v2.d.ts.map +1 -0
- package/src/plugins/tui/dist/server-v2.js +796 -0
- package/src/plugins/tui/dist/server-v2.js.map +1 -0
- package/src/plugins/tui/dist/tui-v2.d.ts +375 -53
- package/src/plugins/tui/dist/tui-v2.d.ts.map +1 -1
- package/src/plugins/tui/dist/tui-v2.js +5876 -530
- package/src/plugins/tui/dist/tui-v2.js.map +1 -1
- package/src/plugins/tui/dist/tui.js +1 -1
- package/src/plugins/tui/dist/usage-history-contract-nt1rnBPE.js +118 -0
- package/src/plugins/tui/dist/usage-history-contract-nt1rnBPE.js.map +1 -0
- package/src/plugins/tui/dist/usage-history-worker.js +25 -0
- package/src/plugins/tui/dist/usage-history-worker.js.map +1 -0
- package/src/plugins/tui/index-v2.ts +3 -6
- package/src/plugins/tui/package-lock.json +17 -2
- package/src/plugins/tui/package.json +6 -3
- package/src/plugins/tui/src/context-gauge.ts +59 -0
- package/src/plugins/tui/src/cost-data.ts +607 -0
- package/src/plugins/tui/src/go-key-diagnostic-ui.ts +100 -0
- package/src/plugins/tui/src/go-key-diagnostic.ts +125 -0
- package/src/plugins/tui/src/index-v2.tsx +231 -240
- package/src/plugins/tui/src/model-pricing.ts +536 -0
- package/src/plugins/tui/src/model-usage-limits.ts +4 -0
- package/src/plugins/tui/src/quota-adapters.ts +1598 -0
- package/src/plugins/tui/src/quota-cli.ts +237 -0
- package/src/plugins/tui/src/quota-rpc.ts +373 -0
- package/src/plugins/tui/src/quota-v2-model.ts +1032 -0
- package/src/plugins/tui/src/quota-v2.tsx +1238 -0
- package/src/plugins/tui/src/server-v2.ts +985 -0
- package/src/plugins/tui/src/sidebar-width.ts +129 -0
- package/src/plugins/tui/src/usage-history-contract.ts +217 -0
- package/src/plugins/tui/src/usage-history-validation.ts +104 -0
- package/src/plugins/tui/src/usage-history-view.tsx +236 -0
- package/src/plugins/tui/src/usage-history-worker.ts +25 -0
- package/src/plugins/tui/src/usage-view-model.ts +272 -0
- package/src/plugins/tui/tsconfig.typecheck.json +6 -1
- package/src/plugins/tui/tsdown.config.ts +44 -5
- package/src/routing.yml +72 -13
- package/src/skills/README.md +4 -0
- package/src/skills/agent-coordination/SKILL.md +0 -3
- package/src/skills/artifact-management/SKILL.md +0 -3
- package/src/skills/auto-continue/SKILL.md +0 -3
- package/src/skills/code-review-checklist/SKILL.md +0 -3
- package/src/skills/context-compression/SKILL.md +0 -3
- package/src/skills/memory-bank/SKILL.md +6 -28
- package/src/skills/session-goal/SKILL.md +0 -3
- package/src/skills/simplify/SKILL.md +5 -4
- package/src/skills/tdd-with-agents/SKILL.md +0 -3
- package/src/skills/visual-review-pipeline/SKILL.md +0 -1
- package/src/pantheon/memory-context.ts +0 -1017
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quota-rpc-DMmXBhBe.js","names":[],"sources":["../src/quota-rpc.ts"],"sourcesContent":["import { Rpc } from '@opencode/plugin/promise/index'\nimport {\n MAX_HISTORY_BUCKETS,\n MAX_HISTORY_MODELS,\n USAGE_HISTORY_PERIODS,\n} from './usage-history-contract'\n\n/** Full provider matrix approved for the V2 quota surface. */\nexport const QUOTA_PROVIDER_IDS = [\n 'anthropic',\n 'chutes',\n 'cursor',\n 'github-copilot',\n 'google-agy',\n 'kilo-gateway',\n 'nanogpt',\n 'ollama-cloud',\n 'openai',\n 'opencode-go',\n 'opencode-zen',\n 'openrouter',\n 'synthetic',\n 'xai-supergrok',\n 'gemini-cli',\n 'alibaba-coding-plan',\n 'alibaba-token-plan',\n 'deepseek',\n 'kimi-code-global',\n 'kimi-code-cn',\n 'minimax-plan-global',\n 'minimax-plan-cn',\n 'xiaomi-mimo',\n 'zai-coding-plan',\n 'zhipu-coding-plan',\n] as const\n\nexport type QuotaProviderId = (typeof QUOTA_PROVIDER_IDS)[number]\n\n/** Safe route labels are limited to OpenCode Go and never contain request data. */\nexport type OpenCodeGoRouteKind = 'api_key' | 'console_oauth' | 'none' | 'unsupported'\n\n/** GLM plans may report up to 16 distinct quota windows in one response. */\nexport const MAX_PROVIDER_METRICS = 16\n\nconst metricSchema = {\n oneOf: [\n {\n type: 'object',\n properties: {\n kind: { const: 'provider_quota' },\n used: { type: 'number', minimum: 0 },\n remaining: { type: 'number', minimum: 0 },\n unit: { type: 'string', minLength: 1, maxLength: 16 },\n label: { type: 'string', minLength: 1, maxLength: 48 },\n period: { type: 'string', maxLength: 32 },\n resetsAt: { type: 'number', minimum: 0, maximum: 8_640_000_000_000_000 },\n },\n required: ['kind', 'used', 'remaining', 'unit', 'label'],\n additionalProperties: false,\n },\n {\n type: 'object',\n properties: {\n kind: { const: 'balance' },\n amount: { type: 'number', minimum: 0 },\n currency: { type: 'string', enum: ['USD', 'CNY'] },\n label: { type: 'string', minLength: 1, maxLength: 48 },\n status: { type: 'string', enum: ['available', 'unavailable', 'active', 'inactive'] },\n },\n required: ['kind', 'amount', 'currency', 'label'],\n additionalProperties: false,\n },\n {\n type: 'object',\n properties: {\n kind: { const: 'estimate' },\n amount: { type: 'number', minimum: 0 },\n unit: { type: 'string', minLength: 1, maxLength: 16 },\n label: { type: 'string', minLength: 1, maxLength: 48 },\n },\n required: ['kind', 'amount', 'unit', 'label'],\n additionalProperties: false,\n },\n {\n type: 'object',\n properties: {\n kind: { const: 'key_usage' },\n amount: { type: 'number', minimum: 0 },\n currency: { type: 'string', enum: ['USD', 'CNY'] },\n label: { type: 'string', minLength: 1, maxLength: 48 },\n period: { type: 'string', maxLength: 32 },\n },\n required: ['kind', 'amount', 'currency', 'label'],\n additionalProperties: false,\n },\n {\n type: 'object',\n properties: {\n kind: { const: 'session_usage' },\n amount: { type: 'number', minimum: 0 },\n unit: { type: 'string', minLength: 1, maxLength: 16 },\n label: { type: 'string', minLength: 1, maxLength: 48 },\n },\n required: ['kind', 'amount', 'unit', 'label'],\n additionalProperties: false,\n },\n {\n type: 'object',\n properties: {\n kind: { const: 'provider_status' },\n status: { type: 'string', enum: ['available', 'unavailable', 'active', 'inactive'] },\n label: { type: 'string', minLength: 1, maxLength: 48 },\n },\n required: ['kind', 'status', 'label'],\n additionalProperties: false,\n },\n ],\n} as const\n\nconst providerStatusSchema = {\n type: 'object',\n properties: {\n provider: { type: 'string', enum: QUOTA_PROVIDER_IDS },\n label: { type: 'string', minLength: 1, maxLength: 48 },\n scope: { type: 'string', enum: ['account', 'selected_key', 'team', 'session'] },\n authentication: { type: 'string', enum: ['connected', 'not_connected', 'unavailable'] },\n state: { type: 'string', enum: ['available', 'needs_setup', 'unavailable'] },\n reason: {\n type: 'string',\n enum: [\n 'none',\n 'not_connected',\n 'unsupported',\n 'private_endpoint',\n 'eligibility_unverified',\n 'runtime_accounting_unavailable',\n 'cli_identity_unavailable',\n 'unsupported_credential_method',\n 'provider_error',\n 'not_subscribed',\n 'rate_limited',\n 'unauthorized',\n 'forbidden',\n 'timeout',\n 'network_error',\n 'invalid_response',\n ],\n },\n route_kind: {\n type: 'string',\n enum: ['api_key', 'console_oauth', 'none', 'unsupported'],\n },\n retry_after_ms: { type: 'integer', minimum: 0, maximum: 3_600_000 },\n metrics: { type: 'array', items: metricSchema, maxItems: MAX_PROVIDER_METRICS },\n },\n required: ['provider', 'label', 'scope', 'authentication', 'state', 'reason', 'metrics'],\n additionalProperties: false,\n} as const\n\nconst usageHistoryTotalsSchema = {\n type: 'object',\n properties: {\n input: { type: 'integer', minimum: 0, maximum: Number.MAX_SAFE_INTEGER },\n output: { type: 'integer', minimum: 0, maximum: Number.MAX_SAFE_INTEGER },\n cacheRead: { type: 'integer', minimum: 0, maximum: Number.MAX_SAFE_INTEGER },\n cacheWrite: { type: 'integer', minimum: 0, maximum: Number.MAX_SAFE_INTEGER },\n total: { type: 'integer', minimum: 0, maximum: Number.MAX_SAFE_INTEGER },\n },\n required: ['input', 'output', 'cacheRead', 'cacheWrite', 'total'],\n additionalProperties: false,\n} as const\n\nconst usageHistoryBucketSchema = {\n type: 'object',\n properties: {\n date: { type: 'string', pattern: '^\\\\d{4}-\\\\d{2}-\\\\d{2}$' },\n input: { type: 'integer', minimum: 0, maximum: Number.MAX_SAFE_INTEGER },\n output: { type: 'integer', minimum: 0, maximum: Number.MAX_SAFE_INTEGER },\n cacheRead: { type: 'integer', minimum: 0, maximum: Number.MAX_SAFE_INTEGER },\n cacheWrite: { type: 'integer', minimum: 0, maximum: Number.MAX_SAFE_INTEGER },\n total: { type: 'integer', minimum: 0, maximum: Number.MAX_SAFE_INTEGER },\n estimatedUsd: { type: 'number', minimum: 0 },\n pricingComplete: { type: 'boolean' },\n },\n required: ['date', 'input', 'output', 'cacheRead', 'cacheWrite', 'total', 'pricingComplete'],\n additionalProperties: false,\n} as const\n\nconst usageHistoryAvailableSchema = {\n type: 'object',\n properties: {\n status: { type: 'string', enum: ['available', 'partial'] },\n period: { type: 'string', enum: USAGE_HISTORY_PERIODS },\n coverageStart: { type: ['string', 'null'], pattern: '^\\\\d{4}-\\\\d{2}-\\\\d{2}$' },\n partial: { type: 'boolean' },\n truncated: { type: 'boolean' },\n rows: { type: 'integer', minimum: 0, maximum: Number.MAX_SAFE_INTEGER },\n buckets: { type: 'array', items: usageHistoryBucketSchema, maxItems: MAX_HISTORY_BUCKETS },\n totals: usageHistoryTotalsSchema,\n models: {\n type: 'array',\n maxItems: MAX_HISTORY_MODELS,\n items: {\n type: 'object',\n properties: {\n providerID: { type: 'string', minLength: 1, maxLength: 128 },\n modelID: { type: 'string', minLength: 1, maxLength: 128 },\n totals: usageHistoryTotalsSchema,\n estimatedUsd: { type: 'number', minimum: 0 },\n pricingComplete: { type: 'boolean' },\n },\n required: ['providerID', 'modelID', 'totals', 'pricingComplete'],\n additionalProperties: false,\n },\n },\n pricing: {\n type: 'object',\n properties: {\n status: { type: 'string', enum: ['empty', 'unavailable', 'partial', 'complete'] },\n complete: { type: 'boolean' },\n billed: { const: false },\n estimatedUsd: { type: 'number', minimum: 0 },\n unpricedModels: { type: 'integer', minimum: 0, maximum: Number.MAX_SAFE_INTEGER },\n },\n required: ['status', 'complete', 'billed', 'unpricedModels'],\n additionalProperties: false,\n },\n },\n required: [\n 'status',\n 'period',\n 'coverageStart',\n 'partial',\n 'truncated',\n 'rows',\n 'buckets',\n 'totals',\n 'models',\n 'pricing',\n ],\n additionalProperties: false,\n} as const\n\nconst usageHistoryUnavailableSchema = {\n type: 'object',\n properties: {\n status: { const: 'unavailable' },\n reason: { type: 'string', enum: ['invalid_period', 'history_unavailable', 'history_timeout'] },\n },\n required: ['status', 'reason'],\n additionalProperties: false,\n} as const\n\nconst activeContextCostInputSchema = {\n type: 'object',\n properties: {\n providerID: { type: ['string', 'null'], minLength: 1, maxLength: 128 },\n modelID: { type: ['string', 'null'], minLength: 1, maxLength: 128 },\n contextTokens: { type: ['number', 'null'] },\n },\n required: ['providerID', 'modelID', 'contextTokens'],\n additionalProperties: false,\n} as const\n\nconst activeContextCostSchema = {\n oneOf: [\n {\n type: 'object',\n properties: {\n status: { const: 'estimated' },\n estimatedUsd: { type: 'number', minimum: 0 },\n billed: { const: false },\n basis: { const: 'pre-cache-context-tokens-times-input-price' },\n cacheDiscountApplied: { const: false },\n },\n required: ['status', 'estimatedUsd', 'billed', 'basis', 'cacheDiscountApplied'],\n additionalProperties: false,\n },\n {\n type: 'object',\n properties: {\n status: { const: 'unavailable' },\n billed: { const: false },\n basis: { const: 'pre-cache-context-tokens-times-input-price' },\n cacheDiscountApplied: { const: false },\n reason: {\n type: 'string',\n enum: [\n 'invalid-context-token-count',\n 'missing-model-identity',\n 'no-pricing',\n 'unknown-model',\n 'ambiguous-model',\n 'missing-cache-price',\n ],\n },\n },\n required: ['status', 'billed', 'basis', 'cacheDiscountApplied', 'reason'],\n additionalProperties: false,\n },\n ],\n} as const\n\n/** Shared definition keeps the TUI RPC client aligned with the server contract. */\nexport const quotaRpc = Rpc.define({\n id: 'pantheon.quota',\n methods: {\n go_key_diagnostic: {\n input: { type: 'object', properties: {}, additionalProperties: false },\n output: {\n type: 'object',\n properties: {\n category: {\n type: 'string',\n enum: [\n 'not_run',\n 'already_used',\n 'success',\n 'unauthorized',\n 'redirect',\n 'http_error',\n 'timeout',\n 'network_error',\n ],\n },\n status: { type: 'integer', minimum: 100, maximum: 599 },\n content_type: {\n type: 'string',\n enum: ['application/json', 'text/plain', 'text/html', 'other', 'missing'],\n },\n error_structure: {\n type: 'string',\n enum: ['present', 'absent', 'unavailable'],\n },\n },\n required: ['category'],\n additionalProperties: false,\n },\n },\n status: {\n input: { type: 'object', properties: {}, additionalProperties: false },\n output: {\n type: 'object',\n properties: {\n providers: { type: 'array', items: providerStatusSchema },\n credential_resolution_failed: { const: true },\n },\n required: ['providers'],\n additionalProperties: false,\n },\n },\n usage_history: {\n input: {\n type: 'object',\n properties: { period: { type: 'string', enum: USAGE_HISTORY_PERIODS } },\n required: ['period'],\n additionalProperties: false,\n },\n output: {\n oneOf: [usageHistoryAvailableSchema, usageHistoryUnavailableSchema],\n },\n },\n active_context_cost: {\n input: activeContextCostInputSchema,\n output: activeContextCostSchema,\n },\n },\n events: {\n credentials_changed: {\n schema: { type: 'object', properties: {}, additionalProperties: false },\n },\n },\n})\n"],"mappings":";;;;AAQA,MAAa,qBAAqB;CAChC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAqFA,MAAM,uBAAuB;CAC3B,MAAM;CACN,YAAY;EACV,UAAU;GAAE,MAAM;GAAU,MAAM;EAAmB;EACrD,OAAO;GAAE,MAAM;GAAU,WAAW;GAAG,WAAW;EAAG;EACrD,OAAO;GAAE,MAAM;GAAU,MAAM;IAAC;IAAW;IAAgB;IAAQ;GAAS;EAAE;EAC9E,gBAAgB;GAAE,MAAM;GAAU,MAAM;IAAC;IAAa;IAAiB;GAAa;EAAE;EACtF,OAAO;GAAE,MAAM;GAAU,MAAM;IAAC;IAAa;IAAe;GAAa;EAAE;EAC3E,QAAQ;GACN,MAAM;GACN,MAAM;IACJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;EACF;EACA,YAAY;GACV,MAAM;GACN,MAAM;IAAC;IAAW;IAAiB;IAAQ;GAAa;EAC1D;EACA,gBAAgB;GAAE,MAAM;GAAW,SAAS;GAAG,SAAS;EAAU;EAClE,SAAS;GAAE,MAAM;GAAS,OAAO,EA5GnC,OAAO;IACL;KACE,MAAM;KACN,YAAY;MACV,MAAM,EAAE,OAAO,iBAAiB;MAChC,MAAM;OAAE,MAAM;OAAU,SAAS;MAAE;MACnC,WAAW;OAAE,MAAM;OAAU,SAAS;MAAE;MACxC,MAAM;OAAE,MAAM;OAAU,WAAW;OAAG,WAAW;MAAG;MACpD,OAAO;OAAE,MAAM;OAAU,WAAW;OAAG,WA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
|
+
import { queryAlibabaTokenPlanUsage } from "./quota-cli.js";
|
|
2
|
+
import { Context } from "@opencode/plugin/promise/plugin";
|
|
3
|
+
//#region src/server-v2.d.ts
|
|
4
|
+
export declare function createQuotaPlugin(queryCli?: typeof queryAlibabaTokenPlanUsage): {
|
|
5
|
+
id: string;
|
|
6
|
+
setup(context: Context): Promise<() => Promise<void>>;
|
|
7
|
+
};
|
|
8
|
+
declare const _default: {
|
|
9
|
+
id: string;
|
|
10
|
+
setup(context: Context): Promise<() => Promise<void>>;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { _default as default };
|
|
14
|
+
//# sourceMappingURL=server-v2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-v2.d.ts","names":[],"sources":["../src/server-v2.ts"],"mappings":";;;wBA23BgB,kBACd,kBAAiB;;EAKM,MAAA,SAAA,UAAO,cAAA;;;;EAAP,MAAA,SAAA,UAAO,cAAA"}
|