pantheon-opencode 1.6.2-beta.1 → 1.6.2-beta.10
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 +163 -0
- package/README.md +236 -60
- package/README.pt-BR.md +19 -1
- package/bin/pantheon-init.mjs +195 -13
- package/package.json +11 -3
- package/plugin.json +1 -1
- package/prompts/README.md +58 -0
- package/prompts/debug-issue.prompt.md +46 -0
- package/prompts/dynamic/agora-generated.txt +38 -0
- package/prompts/dynamic/orchestrate-generated.txt +51 -0
- package/prompts/focus.prompt.md +42 -0
- package/prompts/implement-feature.prompt.md +39 -0
- package/prompts/optimize-database.prompt.md +58 -0
- package/prompts/orchestrate-with-zeus.prompt.md +441 -0
- package/prompts/plan-architecture.prompt.md +59 -0
- package/prompts/quick-discovery-large-codebase.prompt.md +294 -0
- package/prompts/quick-plan-large-feature.prompt.md +197 -0
- package/prompts/semantic-summarize.md +50 -0
- package/prompts/sketch.prompt.md +91 -0
- package/prompts/subtask.prompt.md +131 -0
- package/pyproject.toml +1 -1
- package/scripts/decision-router-budget.mjs +780 -0
- package/scripts/decision-router-v2-budget.mjs +218 -0
- package/scripts/decision-router-v2-egress.mjs +272 -0
- package/scripts/decision-router.mjs +758 -0
- package/scripts/docs-check-changelog.mjs +5 -3
- package/scripts/install/component-selection.mjs +9 -4
- package/scripts/install/decision-layer-preview.mjs +376 -0
- package/scripts/install/decision-router-config.mjs +560 -0
- package/scripts/install/health-check.mjs +20 -11
- package/scripts/install/interactive.mjs +103 -14
- package/scripts/install/interrupt.mjs +4 -3
- package/scripts/install/migrate.mjs +123 -72
- package/scripts/install/opencode.mjs +178 -122
- package/scripts/install/plan.mjs +8 -1
- package/scripts/install/plugin.mjs +4 -3
- package/scripts/install/state.mjs +12 -0
- package/scripts/install/strings.mjs +22 -0
- package/scripts/install/venv.mjs +34 -17
- package/scripts/mcp_resources.py +11 -9
- package/scripts/release-notes.mjs +30 -7
- package/scripts/restore.mjs +22 -10
- package/scripts/sync-tui.mjs +3 -3
- package/scripts/test-opencode-v2-sandbox.sh +10 -6
- package/scripts/versioning.mjs +41 -5
- package/src/agents/aphrodite.md +6 -1
- package/src/agents/apollo.md +1 -0
- package/src/agents/athena.md +1 -0
- package/src/agents/demeter.md +1 -1
- package/src/agents/gaia.md +1 -0
- package/src/agents/hephaestus.md +1 -1
- package/src/agents/hermes.md +8 -10
- package/src/agents/iris.md +1 -1
- package/src/agents/mnemosyne.md +1 -0
- package/src/agents/nyx.md +1 -1
- package/src/agents/prometheus.md +1 -1
- package/src/agents/talos.md +6 -1
- package/src/agents/themis.md +1 -1
- package/src/agents/zeus.md +52 -62
- package/src/mcp/eval_store.py +11 -4
- package/src/mcp/mcp_resources.py +11 -9
- package/src/mcp/memory_mcp.py +293 -150
- package/src/pantheon/cost-command.ts +30 -133
- package/src/pantheon/jev-decision-tool.ts +347 -0
- package/src/pantheon/jev-decisions.ts +625 -0
- package/src/pantheon/local-decision-agents.ts +170 -0
- package/src/pantheon/local-decision-budget.ts +1046 -0
- package/src/pantheon/local-decision-egress-gate.ts +144 -0
- package/src/pantheon/local-decision-prompt.ts +256 -0
- package/src/pantheon/local-decision-provider-matrix.ts +44 -0
- package/src/pantheon/local-decision-router.ts +225 -0
- package/src/pantheon/local-decision-skills.ts +281 -0
- package/src/pantheon/local-decision-tool.ts +160 -0
- package/src/pantheon/local-decision-turn.ts +101 -0
- package/src/pantheon/local-decision-usage-evidence.internal.ts +168 -0
- package/src/pantheon/local-orchestration.ts +322 -0
- package/src/pantheon/model-pricing.ts +1 -536
- package/src/pantheon/pantheon-decision-catalog.ts +101 -0
- package/src/pantheon/v2-decision-budget.ts +456 -0
- package/src/pantheon/v2-decision-contracts.ts +300 -0
- package/src/pantheon/v2-decision-egress.ts +203 -0
- package/src/pantheon/v2-decision-events.ts +180 -0
- package/src/pantheon/v2-decision-heuristic.ts +121 -0
- package/src/pantheon/v2-decision-points/p1-agent.ts +91 -0
- package/src/pantheon/v2-decision-points/p10-claims.ts +243 -0
- package/src/pantheon/v2-decision-points/p11-catalog.ts +220 -0
- package/src/pantheon/v2-decision-points/p2-skill.ts +83 -0
- package/src/pantheon/v2-decision-points/p3-complexity.ts +108 -0
- package/src/pantheon/v2-decision-points/p4-memory.ts +137 -0
- package/src/pantheon/v2-decision-points/p5-themis-verify.ts +190 -0
- package/src/pantheon/v2-decision-points/p6-council.ts +161 -0
- package/src/pantheon/v2-decision-points/p7-loop.ts +263 -0
- package/src/pantheon/v2-decision-points/p8-guardrail.ts +367 -0
- package/src/pantheon/v2-decision-points/p9-memory-compaction.ts +304 -0
- package/src/pantheon/v2-decision-points.ts +242 -0
- package/src/pantheon/v2-decision-policy.ts +166 -0
- package/src/pantheon/v2-decision-premises.ts +146 -0
- package/src/pantheon/v2-decision-prompt-surface.ts +115 -0
- package/src/pantheon/v2-decision-rank.ts +91 -0
- package/src/pantheon/v2-decision-registry.ts +391 -0
- package/src/pantheon/v2-decision-resource-ids.ts +127 -0
- package/src/pantheon/v2-decision-shadow.ts +123 -0
- package/src/pantheon/v2-decision-telemetry.ts +214 -0
- package/src/pantheon/v2-decision-verify.ts +51 -0
- package/src/pantheon/v2-hook-engine.ts +307 -0
- package/src/pantheon/v2-native-decisions.ts +365 -0
- package/src/pantheon/v2-shell-hooks.ts +66 -2
- package/src/pantheon/v2-tools.ts +38 -15
- package/src/plugin-v2.ts +419 -26
- package/src/plugin.ts +4 -0
- package/src/plugins/tui/THIRD_PARTY_NOTICES.md +24 -0
- package/src/plugins/tui/dist/server-v2.d.ts +19 -11
- package/src/plugins/tui/dist/server-v2.d.ts.map +1 -1
- package/src/plugins/tui/dist/server-v2.js +19 -666
- package/src/plugins/tui/dist/server-v2.js.map +1 -1
- package/src/plugins/tui/dist/tui-v2.d.ts +11 -203
- package/src/plugins/tui/dist/tui-v2.d.ts.map +1 -1
- package/src/plugins/tui/dist/tui-v2.js +187 -1917
- package/src/plugins/tui/dist/tui-v2.js.map +1 -1
- package/src/plugins/tui/dist/tui.js +1 -1
- package/src/plugins/tui/package-lock.json +17 -2
- package/src/plugins/tui/package.json +4 -2
- package/src/plugins/tui/src/cost-data.ts +607 -0
- package/src/plugins/tui/src/index-v2.tsx +213 -54
- package/src/plugins/tui/src/model-pricing.ts +536 -0
- package/src/plugins/tui/src/server-v2.ts +18 -838
- package/src/plugins/tui/tsdown.config.ts +28 -6
- package/src/plugins/tui/dist/quota-adapters.d.ts +0 -89
- package/src/plugins/tui/dist/quota-adapters.d.ts.map +0 -1
- package/src/plugins/tui/dist/quota-adapters.js +0 -1142
- package/src/plugins/tui/dist/quota-adapters.js.map +0 -1
- package/src/plugins/tui/dist/quota-cli.d.ts +0 -17
- package/src/plugins/tui/dist/quota-cli.d.ts.map +0 -1
- package/src/plugins/tui/dist/quota-cli.js +0 -184
- package/src/plugins/tui/dist/quota-cli.js.map +0 -1
- package/src/plugins/tui/dist/quota-rpc-UL2HuFRJ.js +0 -390
- package/src/plugins/tui/dist/quota-rpc-UL2HuFRJ.js.map +0 -1
- package/src/plugins/tui/src/go-key-diagnostic-ui.ts +0 -100
- package/src/plugins/tui/src/go-key-diagnostic.ts +0 -125
- package/src/plugins/tui/src/quota-adapters.ts +0 -1598
- package/src/plugins/tui/src/quota-cli.ts +0 -237
- package/src/plugins/tui/src/quota-rpc.ts +0 -209
- package/src/plugins/tui/src/quota-v2-model.ts +0 -1032
- package/src/plugins/tui/src/quota-v2.tsx +0 -986
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { readFileSync } from 'node:fs'
|
|
2
|
-
import {
|
|
2
|
+
import { readdir, readFile, writeFile } from 'node:fs/promises'
|
|
3
3
|
import { join } from 'node:path'
|
|
4
4
|
import { fileURLToPath } from 'node:url'
|
|
5
5
|
import solid from 'rolldown-plugin-solid'
|
|
@@ -10,7 +10,7 @@ const pkg = JSON.parse(readFileSync(join(__dirname, 'package.json'), 'utf8')) as
|
|
|
10
10
|
version: string
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
async function
|
|
13
|
+
async function finalizeDistArtifacts(): Promise<void> {
|
|
14
14
|
const dist = join(__dirname, 'dist')
|
|
15
15
|
const entries = await readdir(dist, { withFileTypes: true })
|
|
16
16
|
|
|
@@ -20,19 +20,39 @@ async function ensureDistArtifactsEndWithNewline(): Promise<void> {
|
|
|
20
20
|
.map(async ({ name }) => {
|
|
21
21
|
const path = join(dist, name)
|
|
22
22
|
const contents = await readFile(path, 'utf8')
|
|
23
|
-
|
|
23
|
+
const normalized = normalizeHqtuiBundlePaths(name, contents)
|
|
24
|
+
const finalContents = normalized.endsWith('\n') ? normalized : `${normalized}\n`
|
|
25
|
+
if (contents !== finalContents) await writeFile(path, finalContents)
|
|
24
26
|
}),
|
|
25
27
|
)
|
|
26
28
|
}
|
|
27
29
|
|
|
30
|
+
/** Keep Rolldown's vendor source labels stable when a clean build uses a node_modules symlink. */
|
|
31
|
+
function normalizeHqtuiBundlePaths(name: string, contents: string): string {
|
|
32
|
+
if (name === 'tui-v2.js') {
|
|
33
|
+
return contents.replace(
|
|
34
|
+
/\/\/#region [^\n]*node_modules\/@profullstack\/hqtui\/dist\//g,
|
|
35
|
+
'//#region ../../../node_modules/@profullstack/hqtui/dist/',
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
if (name !== 'tui-v2.js.map') return contents
|
|
39
|
+
|
|
40
|
+
const map = JSON.parse(contents) as { sources?: string[]; [key: string]: unknown }
|
|
41
|
+
if (!Array.isArray(map.sources)) return contents
|
|
42
|
+
map.sources = map.sources.map((source) => {
|
|
43
|
+
const packagePath = 'node_modules/@profullstack/hqtui/'
|
|
44
|
+
const packageIndex = source.lastIndexOf(packagePath)
|
|
45
|
+
return packageIndex < 0 ? source : `../../../../${source.slice(packageIndex)}`
|
|
46
|
+
})
|
|
47
|
+
return JSON.stringify(map)
|
|
48
|
+
}
|
|
49
|
+
|
|
28
50
|
export default defineConfig({
|
|
29
51
|
entry: {
|
|
30
52
|
tui: 'src/index.tsx',
|
|
31
53
|
'tui-v2': 'src/index-v2.tsx',
|
|
32
54
|
server: 'src/server.ts',
|
|
33
55
|
'server-v2': 'src/server-v2.ts',
|
|
34
|
-
'quota-cli': 'src/quota-cli.ts',
|
|
35
|
-
'quota-adapters': 'src/quota-adapters.ts',
|
|
36
56
|
},
|
|
37
57
|
format: ['esm'],
|
|
38
58
|
platform: 'node',
|
|
@@ -41,6 +61,7 @@ export default defineConfig({
|
|
|
41
61
|
outExtensions: () => ({ js: '.js' }),
|
|
42
62
|
dts: {
|
|
43
63
|
tsconfig: join(__dirname, 'tsconfig.build.json'),
|
|
64
|
+
entry: ['src/index.tsx', 'src/index-v2.tsx', 'src/server.ts', 'src/server-v2.ts'],
|
|
44
65
|
},
|
|
45
66
|
define: {
|
|
46
67
|
__PANTHEON_VERSION__: JSON.stringify(pkg.version),
|
|
@@ -55,6 +76,7 @@ export default defineConfig({
|
|
|
55
76
|
],
|
|
56
77
|
deps: {
|
|
57
78
|
neverBundle: [/^@opencode-ai\//, /^@opencode\//, /^@opentui\//, /^solid-js/],
|
|
79
|
+
alwaysBundle: [/^@profullstack\/hqtui$/],
|
|
58
80
|
},
|
|
59
|
-
onSuccess:
|
|
81
|
+
onSuccess: finalizeDistArtifacts,
|
|
60
82
|
})
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { queryAlibabaTokenPlanUsage } from "./quota-cli.js";
|
|
2
|
-
//#region src/quota-rpc.d.ts
|
|
3
|
-
/** Full provider matrix approved for the V2 quota surface. */
|
|
4
|
-
declare const QUOTA_PROVIDER_IDS: readonly ['anthropic', 'chutes', 'cursor', 'github-copilot', 'google-agy', 'kilo-gateway', 'nanogpt', 'ollama-cloud', 'openai', 'opencode-go', 'opencode-zen', 'openrouter', 'synthetic', 'xai-supergrok', 'gemini-cli', 'alibaba-coding-plan', 'alibaba-token-plan', 'deepseek', 'kimi-code-global', 'kimi-code-cn', 'minimax-plan-global', 'minimax-plan-cn', 'xiaomi-mimo', 'zai-coding-plan', 'zhipu-coding-plan'];
|
|
5
|
-
type QuotaProviderId = (typeof QUOTA_PROVIDER_IDS)[number];
|
|
6
|
-
//#endregion
|
|
7
|
-
//#region src/quota-adapters.d.ts
|
|
8
|
-
export declare const OPENAI_CODEX_OAUTH_METHOD_IDS: readonly ['chatgpt-browser', 'chatgpt-headless'];
|
|
9
|
-
type OpenAICodexOAuthMethodID = (typeof OPENAI_CODEX_OAUTH_METHOD_IDS)[number];
|
|
10
|
-
export declare function isOpenAICodexOAuthMethod(value: unknown): value is OpenAICodexOAuthMethodID;
|
|
11
|
-
export declare const OPENCODE_CONSOLE_OAUTH_METHOD_IDS: readonly ['device'];
|
|
12
|
-
type OpenCodeConsoleOAuthMethodID = (typeof OPENCODE_CONSOLE_OAUTH_METHOD_IDS)[number];
|
|
13
|
-
export declare function isOpenCodeConsoleOAuthMethod(value: unknown): value is OpenCodeConsoleOAuthMethodID;
|
|
14
|
-
type OAuthMethodID = OpenAICodexOAuthMethodID | OpenCodeConsoleOAuthMethodID;
|
|
15
|
-
export type QuotaAdapterContext = {
|
|
16
|
-
readonly projectId?: string;
|
|
17
|
-
readonly accountId?: string;
|
|
18
|
-
readonly orgId?: string;
|
|
19
|
-
readonly methodID?: OAuthMethodID;
|
|
20
|
-
};
|
|
21
|
-
export type QuotaAudience = 'us_personal' | 'us_business' | 'china_personal' | 'china_business';
|
|
22
|
-
export type QuotaMetric = {
|
|
23
|
-
kind: 'provider_quota';
|
|
24
|
-
used: number;
|
|
25
|
-
remaining: number;
|
|
26
|
-
unit: string;
|
|
27
|
-
label: string;
|
|
28
|
-
period?: string;
|
|
29
|
-
resetsAt?: number;
|
|
30
|
-
} | {
|
|
31
|
-
kind: 'balance';
|
|
32
|
-
amount: number;
|
|
33
|
-
currency: 'USD' | 'CNY';
|
|
34
|
-
label: string;
|
|
35
|
-
status?: 'available' | 'unavailable' | 'active' | 'inactive';
|
|
36
|
-
} | {
|
|
37
|
-
kind: 'estimate';
|
|
38
|
-
amount: number;
|
|
39
|
-
unit: string;
|
|
40
|
-
label: string;
|
|
41
|
-
} | {
|
|
42
|
-
kind: 'provider_status';
|
|
43
|
-
status: 'available' | 'unavailable' | 'active' | 'inactive';
|
|
44
|
-
label: string;
|
|
45
|
-
} | {
|
|
46
|
-
kind: 'key_usage';
|
|
47
|
-
amount: number;
|
|
48
|
-
currency: 'USD' | 'CNY';
|
|
49
|
-
label: string;
|
|
50
|
-
period?: string;
|
|
51
|
-
} | {
|
|
52
|
-
kind: 'session_usage';
|
|
53
|
-
amount: number;
|
|
54
|
-
unit: string;
|
|
55
|
-
label: string;
|
|
56
|
-
};
|
|
57
|
-
export type AdapterFailureReason = 'provider_error' | 'not_subscribed' | 'rate_limited' | 'unauthorized' | 'forbidden' | 'timeout' | 'network_error' | 'invalid_response' | 'cli_identity_unavailable' | 'eligibility_unverified';
|
|
58
|
-
export type AdapterFailure = {
|
|
59
|
-
readonly reason: AdapterFailureReason;
|
|
60
|
-
readonly retryAfterMs?: number;
|
|
61
|
-
};
|
|
62
|
-
type ProviderDefinition = {
|
|
63
|
-
readonly label: string;
|
|
64
|
-
readonly integrationID: string;
|
|
65
|
-
readonly fallbackIntegrationIDs?: readonly string[];
|
|
66
|
-
readonly audiences: readonly QuotaAudience[];
|
|
67
|
-
readonly scope: 'account' | 'selected_key' | 'team' | 'session';
|
|
68
|
-
readonly methods: readonly ('key' | 'oauth' | 'cli')[];
|
|
69
|
-
readonly source?: 'integration' | 'local-cli';
|
|
70
|
-
readonly adapter?: 'anthropic' | 'chutes' | 'copilot' | 'deepseek' | 'google-agy' | 'alibaba-token-plan-cli' | 'kilo-gateway' | 'kimi-global' | 'kimi-cn' | 'minimax-global' | 'minimax-cn' | 'nanogpt' | 'ollama-cloud' | 'openai' | 'openrouter' | 'opencode-go' | 'opencode-zen' | 'synthetic' | 'xai-supergrok' | 'zai' | 'zhipu';
|
|
71
|
-
readonly blockedReason?: 'unsupported' | 'private_endpoint' | 'eligibility_unverified' | 'runtime_accounting_unavailable' | 'cli_identity_unavailable';
|
|
72
|
-
};
|
|
73
|
-
/**
|
|
74
|
-
* Closed provider/integration/method allowlist. Only rows with a reviewed
|
|
75
|
-
* adapter may make a network request; remaining rows are explicitly blocked.
|
|
76
|
-
* Audience lists describe the approved matrix and do not claim that account
|
|
77
|
-
* type was inferred from credentials.
|
|
78
|
-
*/
|
|
79
|
-
export declare const QUOTA_PROVIDER_CATALOG: Record<QuotaProviderId, ProviderDefinition>;
|
|
80
|
-
export type AdapterResult = {
|
|
81
|
-
readonly state: 'available';
|
|
82
|
-
readonly metrics: QuotaMetric[];
|
|
83
|
-
readonly routeKind?: 'api_key' | 'console_oauth';
|
|
84
|
-
} | (AdapterFailure & {
|
|
85
|
-
readonly routeKind?: 'api_key' | 'console_oauth';
|
|
86
|
-
});
|
|
87
|
-
export declare function runQuotaAdapter(provider: QuotaProviderId, secret: string | undefined, shutdownSignal: AbortSignal, queryCli?: typeof queryAlibabaTokenPlanUsage, adapterContext?: QuotaAdapterContext, fallbackSecret?: string): Promise<AdapterResult>;
|
|
88
|
-
//#endregion
|
|
89
|
-
//# sourceMappingURL=quota-adapters.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"quota-adapters.d.ts","names":[],"sources":["../src/quota-rpc.ts","../src/quota-adapters.ts"],"mappings":";;;cAGa;KA4BD,0BAA0B;;;qBC1BzB;KACR,mCAAmC;wBAExB,yBAAyB,iBAAiB,SAAS;qBAQtD;KACR,uCAAuC;wBAE5B,6BACd,iBACC,SAAS;KAOP,gBAAgB,2BAA2B;YAEpC;WACD;WACA;WACA;WACA,WAAW;;YAGV;YACA;EAEN;EACA;EACA;EACA;EACA;EACA;EACA;;EAGA;EACA;EACA;EACA;EACA;;EAEA;EAAkB;EAAgB;EAAc;;EAEhD;EACA;EACA;;EAGA;EACA;EACA;EACA;EACA;;EAEA;EAAuB;EAAgB;EAAc;;YAE/C;YAWA;WACD,QAAQ;WACR;;KAGN;WACM;WACA;WACA;WACA,oBAAoB;WACpB;WACA;WACA;WACA;WAsBA;;;;;;;;qBAsBE,wBAAwB,OAAO,iBAAiB;YAqNjD;WAEG;WACA,SAAS;WACT;KAEV;WAA4B;;wBA2/BX,gBACpB,UAAU,iBACV,4BACA,gBAAgB,aAChB,kBAAiB,4BACjB,iBAAgB,qBAChB,0BACC,QAAQ"}
|