actoviq-agent-sdk 0.4.2 → 0.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README-zh.md +58 -62
- package/README.md +72 -22
- package/assets/actoviq-icon.png +0 -0
- package/bin/actoviq-gui.js +24 -0
- package/dist/src/cli/actoviq-react.js +31 -14
- package/dist/src/cli/actoviq-react.js.map +1 -1
- package/dist/src/cli/actoviq-tui.js +9 -0
- package/dist/src/cli/actoviq-tui.js.map +1 -1
- package/dist/src/cli/bridge-interactive-agent.js +94 -15
- package/dist/src/cli/bridge-interactive-agent.js.map +1 -1
- package/dist/src/cli/version.d.ts +3 -0
- package/dist/src/cli/version.d.ts.map +1 -0
- package/dist/src/cli/version.js +28 -0
- package/dist/src/cli/version.js.map +1 -0
- package/dist/src/gui/actoviqGui.d.ts +29 -0
- package/dist/src/gui/actoviqGui.d.ts.map +1 -0
- package/dist/src/gui/actoviqGui.js +5319 -0
- package/dist/src/gui/actoviqGui.js.map +1 -0
- package/dist/src/gui/electronMain.d.ts +3 -0
- package/dist/src/gui/electronMain.d.ts.map +1 -0
- package/dist/src/gui/electronMain.js +176 -0
- package/dist/src/gui/electronMain.js.map +1 -0
- package/dist/src/gui/guiMarkdown.d.ts +3 -0
- package/dist/src/gui/guiMarkdown.d.ts.map +1 -0
- package/dist/src/gui/guiMarkdown.js +188 -0
- package/dist/src/gui/guiMarkdown.js.map +1 -0
- package/dist/src/hooks/userHooks.d.ts +39 -0
- package/dist/src/hooks/userHooks.d.ts.map +1 -0
- package/dist/src/hooks/userHooks.js +169 -0
- package/dist/src/hooks/userHooks.js.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/mcp/mcpServerConfig.d.ts +19 -0
- package/dist/src/mcp/mcpServerConfig.d.ts.map +1 -0
- package/dist/src/mcp/mcpServerConfig.js +51 -0
- package/dist/src/mcp/mcpServerConfig.js.map +1 -0
- package/dist/src/memory/projectContext.d.ts +32 -0
- package/dist/src/memory/projectContext.d.ts.map +1 -0
- package/dist/src/memory/projectContext.js +175 -0
- package/dist/src/memory/projectContext.js.map +1 -0
- package/dist/src/memory/sessionHistory.d.ts +21 -0
- package/dist/src/memory/sessionHistory.d.ts.map +1 -0
- package/dist/src/memory/sessionHistory.js +83 -0
- package/dist/src/memory/sessionHistory.js.map +1 -0
- package/dist/src/parity/actoviqBridgeSdk.d.ts +3 -0
- package/dist/src/parity/actoviqBridgeSdk.d.ts.map +1 -1
- package/dist/src/parity/actoviqBridgeSdk.js +93 -92
- package/dist/src/parity/actoviqBridgeSdk.js.map +1 -1
- package/dist/src/parity/bridgeConfigs.d.ts +49 -0
- package/dist/src/parity/bridgeConfigs.d.ts.map +1 -0
- package/dist/src/parity/bridgeConfigs.js +134 -0
- package/dist/src/parity/bridgeConfigs.js.map +1 -0
- package/dist/src/parity/bridgeEventAdapter.d.ts +20 -0
- package/dist/src/parity/bridgeEventAdapter.d.ts.map +1 -0
- package/dist/src/parity/bridgeEventAdapter.js +121 -0
- package/dist/src/parity/bridgeEventAdapter.js.map +1 -0
- package/dist/src/parity/bridgeExecResolver.d.ts +27 -0
- package/dist/src/parity/bridgeExecResolver.d.ts.map +1 -0
- package/dist/src/parity/bridgeExecResolver.js +95 -0
- package/dist/src/parity/bridgeExecResolver.js.map +1 -0
- package/dist/src/parity/bridgeProviders.d.ts +132 -0
- package/dist/src/parity/bridgeProviders.d.ts.map +1 -0
- package/dist/src/parity/bridgeProviders.js +651 -0
- package/dist/src/parity/bridgeProviders.js.map +1 -0
- package/dist/src/prompts/outputStyles.d.ts +20 -0
- package/dist/src/prompts/outputStyles.d.ts.map +1 -0
- package/dist/src/prompts/outputStyles.js +35 -0
- package/dist/src/prompts/outputStyles.js.map +1 -0
- package/dist/src/prompts/systemPrompt.d.ts.map +1 -1
- package/dist/src/prompts/systemPrompt.js +9 -1
- package/dist/src/prompts/systemPrompt.js.map +1 -1
- package/dist/src/router/modelRouter.d.ts +7 -1
- package/dist/src/router/modelRouter.d.ts.map +1 -1
- package/dist/src/router/modelRouter.js +50 -15
- package/dist/src/router/modelRouter.js.map +1 -1
- package/dist/src/runtime/agentSession.d.ts +6 -0
- package/dist/src/runtime/agentSession.d.ts.map +1 -1
- package/dist/src/runtime/agentSession.js +15 -0
- package/dist/src/runtime/agentSession.js.map +1 -1
- package/dist/src/runtime/bashClassification.d.ts +18 -0
- package/dist/src/runtime/bashClassification.d.ts.map +1 -0
- package/dist/src/runtime/bashClassification.js +83 -0
- package/dist/src/runtime/bashClassification.js.map +1 -0
- package/dist/src/team/modelTeam.d.ts +3 -5
- package/dist/src/team/modelTeam.d.ts.map +1 -1
- package/dist/src/team/modelTeam.js +98 -162
- package/dist/src/team/modelTeam.js.map +1 -1
- package/dist/src/team/teamRuntime.d.ts +60 -0
- package/dist/src/team/teamRuntime.d.ts.map +1 -0
- package/dist/src/team/teamRuntime.js +139 -0
- package/dist/src/team/teamRuntime.js.map +1 -0
- package/dist/src/tools/actoviqCoreTools.d.ts +1 -0
- package/dist/src/tools/actoviqCoreTools.d.ts.map +1 -1
- package/dist/src/tools/actoviqCoreTools.js +5 -0
- package/dist/src/tools/actoviqCoreTools.js.map +1 -1
- package/dist/src/tools/planMode/PlanModeTools.d.ts +18 -0
- package/dist/src/tools/planMode/PlanModeTools.d.ts.map +1 -0
- package/dist/src/tools/planMode/PlanModeTools.js +71 -0
- package/dist/src/tools/planMode/PlanModeTools.js.map +1 -0
- package/dist/src/tui/actoviqTui.d.ts +3 -0
- package/dist/src/tui/actoviqTui.d.ts.map +1 -1
- package/dist/src/tui/actoviqTui.js +1474 -91
- package/dist/src/tui/actoviqTui.js.map +1 -1
- package/dist/src/tui/transcript.d.ts +6 -0
- package/dist/src/tui/transcript.d.ts.map +1 -1
- package/dist/src/tui/transcript.js +27 -0
- package/dist/src/tui/transcript.js.map +1 -1
- package/dist/src/types.d.ts +128 -9
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/ui/commandSurface.d.ts +13 -0
- package/dist/src/ui/commandSurface.d.ts.map +1 -0
- package/dist/src/ui/commandSurface.js +100 -0
- package/dist/src/ui/commandSurface.js.map +1 -0
- package/package.json +42 -3
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Named bridge connection configs (apiKey + baseURL presets).
|
|
3
|
+
*
|
|
4
|
+
* Persisted to ~/.actoviq/bridge-configs.json. Each config bundles a provider
|
|
5
|
+
* (now 'anthropic'|'openai' — the in-process SDK enum) plus apiKey/baseURL/model
|
|
6
|
+
* so the user can pre-configure e.g. one anthropic profile pointed at DeepSeek
|
|
7
|
+
* and another at Qwen, and switch between them by name.
|
|
8
|
+
*
|
|
9
|
+
* At activation the TUI pre-builds a ModelApi via buildRouteModelApi and injects
|
|
10
|
+
* it per-run into session.stream({model, modelApi}) — same session, no child
|
|
11
|
+
* process, context naturally survives switching bridge↔hadamard.
|
|
12
|
+
*
|
|
13
|
+
* Legacy config files stored provider as RuntimeProviderId ('claude'|'pi'|…);
|
|
14
|
+
* readBridgeConfigs auto-migrates these to 'anthropic'|'openai'.
|
|
15
|
+
* Mirrors mcpServerConfig for persistence.
|
|
16
|
+
*/
|
|
17
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
18
|
+
import os from 'node:os';
|
|
19
|
+
import path from 'node:path';
|
|
20
|
+
/** Map a runtime id to the wire protocol (in-process provider). */
|
|
21
|
+
export function runtimeToProvider(rt) {
|
|
22
|
+
switch (rt) {
|
|
23
|
+
case 'claude':
|
|
24
|
+
case 'codewhale':
|
|
25
|
+
return 'anthropic';
|
|
26
|
+
case 'reasonix':
|
|
27
|
+
case 'pi':
|
|
28
|
+
case 'codex':
|
|
29
|
+
case 'crush':
|
|
30
|
+
return 'openai';
|
|
31
|
+
default:
|
|
32
|
+
return null; // hadamard — no separate provider
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const VALID_PROVIDERS = ['anthropic', 'openai'];
|
|
36
|
+
// Legacy RuntimeProviderId → InProcessProvider migration (v0.6→v0.7).
|
|
37
|
+
// The TUI used to spawn external CLIs keyed by these ids; now the bridge is
|
|
38
|
+
// in-process and configs carry only 'anthropic'|'openai'. Best-effort mapping
|
|
39
|
+
// preserves saved configs across the upgrade.
|
|
40
|
+
const LEGACY_PROVIDER_MIGRATION = {
|
|
41
|
+
claude: 'anthropic',
|
|
42
|
+
codewhale: 'anthropic',
|
|
43
|
+
pi: 'openai',
|
|
44
|
+
codex: 'openai',
|
|
45
|
+
reasonix: 'openai',
|
|
46
|
+
crush: 'openai',
|
|
47
|
+
};
|
|
48
|
+
function migrateProvider(raw) {
|
|
49
|
+
if (VALID_PROVIDERS.includes(raw))
|
|
50
|
+
return raw;
|
|
51
|
+
return LEGACY_PROVIDER_MIGRATION[raw] ?? 'anthropic'; // fallback safe: unknown → anthropic
|
|
52
|
+
}
|
|
53
|
+
export function getBridgeConfigsPath(homeDir = os.homedir()) {
|
|
54
|
+
return path.join(homeDir, '.actoviq', 'bridge-configs.json');
|
|
55
|
+
}
|
|
56
|
+
export const VALID_RUNTIMES = ['hadamard', 'claude', 'codewhale', 'pi', 'codex', 'reasonix', 'crush'];
|
|
57
|
+
function isValidRuntime(raw) {
|
|
58
|
+
return VALID_RUNTIMES.includes(raw);
|
|
59
|
+
}
|
|
60
|
+
function isValidConfig(value) {
|
|
61
|
+
if (typeof value !== 'object' || value === null)
|
|
62
|
+
return false;
|
|
63
|
+
const c = value;
|
|
64
|
+
return typeof c.name === 'string' && typeof c.provider === 'string';
|
|
65
|
+
}
|
|
66
|
+
export function readBridgeConfigs(homeDir = os.homedir()) {
|
|
67
|
+
const file = getBridgeConfigsPath(homeDir);
|
|
68
|
+
if (!existsSync(file))
|
|
69
|
+
return { configs: [] };
|
|
70
|
+
try {
|
|
71
|
+
const parsed = JSON.parse(readFileSync(file, 'utf-8'));
|
|
72
|
+
const configs = Array.isArray(parsed.configs)
|
|
73
|
+
? parsed.configs.filter(isValidConfig).map((c) => {
|
|
74
|
+
const out = {
|
|
75
|
+
name: c.name,
|
|
76
|
+
provider: migrateProvider(c.provider),
|
|
77
|
+
// Pre-v0.8 legacy: missing/unknown runtime defaults to 'claude'.
|
|
78
|
+
runtime: isValidRuntime(c.runtime) ? c.runtime : 'claude',
|
|
79
|
+
};
|
|
80
|
+
if (typeof c.apiKey === 'string' && c.apiKey)
|
|
81
|
+
out.apiKey = c.apiKey;
|
|
82
|
+
if (typeof c.baseURL === 'string' && c.baseURL)
|
|
83
|
+
out.baseURL = c.baseURL;
|
|
84
|
+
if (typeof c.model === 'string' && c.model)
|
|
85
|
+
out.model = c.model;
|
|
86
|
+
if (Array.isArray(c.models)) {
|
|
87
|
+
out.models = c.models.filter((m) => typeof m === 'object' && m !== null && typeof m.name === 'string');
|
|
88
|
+
}
|
|
89
|
+
return out;
|
|
90
|
+
})
|
|
91
|
+
: [];
|
|
92
|
+
// Best-effort re-save: write the migrated configs back so the file stays
|
|
93
|
+
// current. Ignore failures (read-only fs, etc.).
|
|
94
|
+
try {
|
|
95
|
+
writeFileSync(file, JSON.stringify({ configs }, null, 2), 'utf-8');
|
|
96
|
+
}
|
|
97
|
+
catch { /* ignore */ }
|
|
98
|
+
return { configs };
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
return { configs: [] };
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
export function writeBridgeConfigs(configs, homeDir = os.homedir()) {
|
|
105
|
+
const file = getBridgeConfigsPath(homeDir);
|
|
106
|
+
mkdirSync(path.dirname(file), { recursive: true });
|
|
107
|
+
writeFileSync(file, JSON.stringify(configs, null, 2), 'utf-8');
|
|
108
|
+
}
|
|
109
|
+
export function addBridgeConfig(config, homeDir = os.homedir()) {
|
|
110
|
+
const current = readBridgeConfigs(homeDir);
|
|
111
|
+
const without = current.configs.filter((c) => c.name !== config.name);
|
|
112
|
+
without.push(config);
|
|
113
|
+
const next = { configs: without };
|
|
114
|
+
writeBridgeConfigs(next, homeDir);
|
|
115
|
+
return next;
|
|
116
|
+
}
|
|
117
|
+
export function removeBridgeConfig(name, homeDir = os.homedir()) {
|
|
118
|
+
const current = readBridgeConfigs(homeDir);
|
|
119
|
+
const next = { configs: current.configs.filter((c) => c.name !== name) };
|
|
120
|
+
writeBridgeConfigs(next, homeDir);
|
|
121
|
+
return next;
|
|
122
|
+
}
|
|
123
|
+
export function findBridgeConfig(name, homeDir = os.homedir()) {
|
|
124
|
+
return readBridgeConfigs(homeDir).configs.find((c) => c.name === name);
|
|
125
|
+
}
|
|
126
|
+
/** Mask an API key for display: first 4 + … + last 4. */
|
|
127
|
+
export function maskApiKey(key) {
|
|
128
|
+
if (!key)
|
|
129
|
+
return '(none)';
|
|
130
|
+
if (key.length <= 8)
|
|
131
|
+
return '****';
|
|
132
|
+
return `${key.slice(0, 4)}…${key.slice(-4)}`;
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=bridgeConfigs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridgeConfigs.js","sourceRoot":"","sources":["../../../src/parity/bridgeConfigs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAyB7B,mEAAmE;AACnE,MAAM,UAAU,iBAAiB,CAAC,EAAiB;IACjD,QAAQ,EAAE,EAAE,CAAC;QACX,KAAK,QAAQ,CAAC;QACd,KAAK,WAAW;YACd,OAAO,WAAW,CAAC;QACrB,KAAK,UAAU,CAAC;QAChB,KAAK,IAAI,CAAC;QACV,KAAK,OAAO,CAAC;QACb,KAAK,OAAO;YACV,OAAO,QAAQ,CAAC;QAClB;YACE,OAAO,IAAI,CAAC,CAA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4
|
+
* Maps `ActoviqBridgeJsonEvent` (the canonical system/assistant/result trio
|
|
5
|
+
* that all directCli providers normalize into) to the `AgentEvent` union that
|
|
6
|
+
* the GUI's `forwardAgentEvent` already switches on. This is the inverse of
|
|
7
|
+
* `cleanEventToBridgeEvents` in actoviqCleanBridgeCompatSdk.ts.
|
|
8
|
+
*/
|
|
9
|
+
import type { ActoviqBridgeJsonEvent, ActoviqBridgeRunResult, AgentEvent, AgentRunResult } from '../types.js';
|
|
10
|
+
export declare function bridgeEventToAgentEvents(event: ActoviqBridgeJsonEvent, _sessionId: string, runId: string, model: string): AgentEvent[];
|
|
11
|
+
export interface BridgeAgentRunStream {
|
|
12
|
+
[Symbol.asyncIterator](): AsyncIterator<AgentEvent>;
|
|
13
|
+
result: Promise<AgentRunResult>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Wrap an `ActoviqBridgeRunStream` into an async iterable of `AgentEvent`
|
|
17
|
+
* + a `.result` promise, so the GUI run loop can branch ONLY the stream source.
|
|
18
|
+
*/
|
|
19
|
+
export declare function adaptBridgeRun(bridgeStream: AsyncIterable<ActoviqBridgeJsonEvent>, bridgeResult: Promise<ActoviqBridgeRunResult>, runId: string, model: string): BridgeAgentRunStream;
|
|
20
|
+
//# sourceMappingURL=bridgeEventAdapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridgeEventAdapter.d.ts","sourceRoot":"","sources":["../../../src/parity/bridgeEventAdapter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAI9G,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,sBAAsB,EAC7B,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACZ,UAAU,EAAE,CAwEd;AAID,MAAM,WAAW,oBAAoB;IACnC,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,aAAa,CAAC,UAAU,CAAC,CAAC;IACpD,MAAM,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;CACjC;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,YAAY,EAAE,aAAa,CAAC,sBAAsB,CAAC,EACnD,YAAY,EAAE,OAAO,CAAC,sBAAsB,CAAC,EAC7C,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACZ,oBAAoB,CAiDtB"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bridge → Agent event adapter.
|
|
3
|
+
*
|
|
4
|
+
* Maps `ActoviqBridgeJsonEvent` (the canonical system/assistant/result trio
|
|
5
|
+
* that all directCli providers normalize into) to the `AgentEvent` union that
|
|
6
|
+
* the GUI's `forwardAgentEvent` already switches on. This is the inverse of
|
|
7
|
+
* `cleanEventToBridgeEvents` in actoviqCleanBridgeCompatSdk.ts.
|
|
8
|
+
*/
|
|
9
|
+
// ---------- per-event adaptation ----------
|
|
10
|
+
export function bridgeEventToAgentEvents(event, _sessionId, runId, model) {
|
|
11
|
+
const events = [];
|
|
12
|
+
if (event.type === 'system' && event.subtype === 'init') {
|
|
13
|
+
events.push({
|
|
14
|
+
type: 'run.started',
|
|
15
|
+
runId,
|
|
16
|
+
sessionId: String(event.session_id ?? ''),
|
|
17
|
+
model: typeof event.model === 'string' ? event.model : model,
|
|
18
|
+
timestamp: new Date().toISOString(),
|
|
19
|
+
input: '',
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
if (event.type === 'stream_event' && typeof event.event === 'object' && event.event !== null) {
|
|
23
|
+
const inner = event.event;
|
|
24
|
+
if (inner.type === 'content_block_delta' &&
|
|
25
|
+
typeof inner.delta === 'object' &&
|
|
26
|
+
inner.delta !== null &&
|
|
27
|
+
inner.delta.type === 'text_delta') {
|
|
28
|
+
events.push({
|
|
29
|
+
type: 'response.text.delta',
|
|
30
|
+
delta: String(inner.delta.text ?? ''),
|
|
31
|
+
snapshot: String(inner.delta.text ?? ''),
|
|
32
|
+
timestamp: new Date().toISOString(),
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if (event.type === 'assistant') {
|
|
37
|
+
const msg = event.message;
|
|
38
|
+
if (msg?.content && Array.isArray(msg.content)) {
|
|
39
|
+
for (const block of msg.content) {
|
|
40
|
+
if (typeof block === 'object' && block !== null) {
|
|
41
|
+
const b = block;
|
|
42
|
+
if (b.type === 'tool_use') {
|
|
43
|
+
events.push({
|
|
44
|
+
type: 'tool.call',
|
|
45
|
+
call: {
|
|
46
|
+
id: String(b.id ?? ''),
|
|
47
|
+
name: String(b.name ?? ''),
|
|
48
|
+
input: (b.input ?? {}),
|
|
49
|
+
},
|
|
50
|
+
publicName: String(b.name ?? ''),
|
|
51
|
+
provider: 'bridge',
|
|
52
|
+
runId,
|
|
53
|
+
iteration: 0,
|
|
54
|
+
timestamp: new Date().toISOString(),
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (event.type === 'user') {
|
|
62
|
+
const tr = event.tool_result;
|
|
63
|
+
if (tr && typeof tr === 'object') {
|
|
64
|
+
events.push({
|
|
65
|
+
type: 'tool.result',
|
|
66
|
+
result: {
|
|
67
|
+
id: String(tr.tool_use_id ?? ''),
|
|
68
|
+
output: tr,
|
|
69
|
+
},
|
|
70
|
+
timestamp: new Date().toISOString(),
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return events;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Wrap an `ActoviqBridgeRunStream` into an async iterable of `AgentEvent`
|
|
78
|
+
* + a `.result` promise, so the GUI run loop can branch ONLY the stream source.
|
|
79
|
+
*/
|
|
80
|
+
export function adaptBridgeRun(bridgeStream, bridgeResult, runId, model) {
|
|
81
|
+
let finalResult;
|
|
82
|
+
const resultPromise = bridgeResult.then((r) => {
|
|
83
|
+
finalResult = {
|
|
84
|
+
sessionId: r.sessionId,
|
|
85
|
+
text: r.text,
|
|
86
|
+
model,
|
|
87
|
+
runId,
|
|
88
|
+
startedAt: r.initEvent?.['timestamp'] ?? new Date().toISOString(),
|
|
89
|
+
completedAt: new Date().toISOString(),
|
|
90
|
+
requests: [],
|
|
91
|
+
messages: [],
|
|
92
|
+
toolCalls: [],
|
|
93
|
+
message: {
|
|
94
|
+
id: `bridge-${runId}`,
|
|
95
|
+
role: 'assistant',
|
|
96
|
+
type: 'message',
|
|
97
|
+
model,
|
|
98
|
+
stop_reason: 'end_turn',
|
|
99
|
+
content: [{ type: 'text', text: r.text }],
|
|
100
|
+
},
|
|
101
|
+
stopReason: r.stopReason ?? 'end_turn',
|
|
102
|
+
};
|
|
103
|
+
if (r.isError) {
|
|
104
|
+
return Promise.reject(new Error(r.text || 'Bridge run failed'));
|
|
105
|
+
}
|
|
106
|
+
return finalResult;
|
|
107
|
+
}, (err) => Promise.reject(err));
|
|
108
|
+
const iterator = (async function* () {
|
|
109
|
+
for await (const event of bridgeStream) {
|
|
110
|
+
const agentEvents = bridgeEventToAgentEvents(event, '', runId, model);
|
|
111
|
+
for (const ae of agentEvents)
|
|
112
|
+
yield ae;
|
|
113
|
+
}
|
|
114
|
+
await resultPromise.catch(() => undefined);
|
|
115
|
+
})();
|
|
116
|
+
return {
|
|
117
|
+
[Symbol.asyncIterator]: () => iterator,
|
|
118
|
+
result: resultPromise,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=bridgeEventAdapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridgeEventAdapter.js","sourceRoot":"","sources":["../../../src/parity/bridgeEventAdapter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,6CAA6C;AAE7C,MAAM,UAAU,wBAAwB,CACtC,KAA6B,EAC7B,UAAk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AAE,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAC7B,CAAC;IAEF,MAAM,QAAQ,GAA8B,CAAC,KAAK,SAAS,CAAC;QAC1D,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,YAAY,EAAE,CAAC;YACvC,MAAM,WAAW,GAAG,wBAAwB,CAC1C,KAAK,EACL,EAAE,EACF,KAAK,EACL,KAAK,CACN,CAAC;YACF,KAAK,MAAM,EAAE,IAAI,WAAW;gBAAE,MAAM,EAAE,CAAC;QACzC,CAAC;QACD,MAAM,aAAa,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IAC7C,CAAC,CAAC,EAA+B,CAAC;IAElC,OAAO;QACL,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,GAAG,EAAE,CAAC,QAAQ;QACtC,MAAM,EAAE,aAAwC;KACjD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Executable resolution primitives shared by the bridge SDK and its provider
|
|
3
|
+
* layer. Kept in a leaf module so `bridgeProviders.ts` can resolve a provider
|
|
4
|
+
* binary on PATH without importing the full `actoviqBridgeSdk.ts` (which would
|
|
5
|
+
* create a circular import).
|
|
6
|
+
*/
|
|
7
|
+
declare const IS_WINDOWS: boolean;
|
|
8
|
+
export declare function pathExists(filePath: string): Promise<boolean>;
|
|
9
|
+
export declare function isExecutable(filePath: string): Promise<boolean>;
|
|
10
|
+
export declare function splitPathEnv(pathValue: string | undefined): string[];
|
|
11
|
+
export declare function findExecutableOnPath(name: string): Promise<string | undefined>;
|
|
12
|
+
export declare function findFirstExistingPath(candidates: string[]): Promise<string | undefined>;
|
|
13
|
+
/**
|
|
14
|
+
* Quote a single argument for `cmd.exe` when `spawn(..., { shell: true })` is
|
|
15
|
+
* used (required for `.cmd`/`.bat` shims on Windows). Node's `shell: true`
|
|
16
|
+
* joins args with spaces and passes them to `cmd /c` UNquoted, so an arg
|
|
17
|
+
* containing a space — e.g. the prompt passed to `claude -p "<prompt>"` —
|
|
18
|
+
* gets split by cmd.exe into multiple tokens ("My favorite number…" → "My").
|
|
19
|
+
* This wraps space-containing args in double quotes and escapes internal
|
|
20
|
+
* quotes/backslashes per the cmd.exe command-line parsing rules.
|
|
21
|
+
*
|
|
22
|
+
* Only meaningful when spawning through a shell; argv-mode spawns pass each
|
|
23
|
+
* arg verbatim and must NOT be pre-quoted.
|
|
24
|
+
*/
|
|
25
|
+
export declare function quoteForWindowsShell(arg: string): string;
|
|
26
|
+
export { IS_WINDOWS };
|
|
27
|
+
//# sourceMappingURL=bridgeExecResolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridgeExecResolver.d.ts","sourceRoot":"","sources":["../../../src/parity/bridgeExecResolver.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,QAAA,MAAM,UAAU,SAA+B,CAAC;AAEhD,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAOnE;AAED,wBAAsB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAOrE;AAED,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,EAAE,CAKpE;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAyBpF;AAED,wBAAsB,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAU7F;AAID;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CASxD;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Executable resolution primitives shared by the bridge SDK and its provider
|
|
3
|
+
* layer. Kept in a leaf module so `bridgeProviders.ts` can resolve a provider
|
|
4
|
+
* binary on PATH without importing the full `actoviqBridgeSdk.ts` (which would
|
|
5
|
+
* create a circular import).
|
|
6
|
+
*/
|
|
7
|
+
import { constants as fsConstants } from 'node:fs';
|
|
8
|
+
import { access } from 'node:fs/promises';
|
|
9
|
+
import path from 'node:path';
|
|
10
|
+
const IS_WINDOWS = process.platform === 'win32';
|
|
11
|
+
export async function pathExists(filePath) {
|
|
12
|
+
try {
|
|
13
|
+
await access(filePath, fsConstants.F_OK);
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export async function isExecutable(filePath) {
|
|
21
|
+
try {
|
|
22
|
+
await access(filePath, IS_WINDOWS ? fsConstants.F_OK : fsConstants.X_OK);
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export function splitPathEnv(pathValue) {
|
|
30
|
+
if (!pathValue) {
|
|
31
|
+
return [];
|
|
32
|
+
}
|
|
33
|
+
return pathValue.split(path.delimiter).filter(Boolean);
|
|
34
|
+
}
|
|
35
|
+
export async function findExecutableOnPath(name) {
|
|
36
|
+
const pathDirectories = splitPathEnv(process.env.PATH);
|
|
37
|
+
const extensions = IS_WINDOWS
|
|
38
|
+
? (process.env.PATHEXT ?? '.COM;.EXE;.BAT;.CMD')
|
|
39
|
+
.split(';')
|
|
40
|
+
.filter(Boolean)
|
|
41
|
+
: [''];
|
|
42
|
+
for (const directory of pathDirectories) {
|
|
43
|
+
const directCandidate = path.join(directory, name);
|
|
44
|
+
if (!IS_WINDOWS && (await isExecutable(directCandidate))) {
|
|
45
|
+
return directCandidate;
|
|
46
|
+
}
|
|
47
|
+
for (const extension of extensions) {
|
|
48
|
+
const candidate = directCandidate.endsWith(extension.toLowerCase())
|
|
49
|
+
? directCandidate
|
|
50
|
+
: `${directCandidate}${extension.toLowerCase()}`;
|
|
51
|
+
if (await isExecutable(candidate)) {
|
|
52
|
+
return candidate;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
58
|
+
export async function findFirstExistingPath(candidates) {
|
|
59
|
+
for (const candidate of candidates) {
|
|
60
|
+
if (!candidate) {
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
if (await pathExists(candidate)) {
|
|
64
|
+
return candidate;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return undefined;
|
|
68
|
+
}
|
|
69
|
+
const WINDOWS_SHELL_SAFE = /^[A-Za-z0-9@_+=:,./-]+$/;
|
|
70
|
+
/**
|
|
71
|
+
* Quote a single argument for `cmd.exe` when `spawn(..., { shell: true })` is
|
|
72
|
+
* used (required for `.cmd`/`.bat` shims on Windows). Node's `shell: true`
|
|
73
|
+
* joins args with spaces and passes them to `cmd /c` UNquoted, so an arg
|
|
74
|
+
* containing a space — e.g. the prompt passed to `claude -p "<prompt>"` —
|
|
75
|
+
* gets split by cmd.exe into multiple tokens ("My favorite number…" → "My").
|
|
76
|
+
* This wraps space-containing args in double quotes and escapes internal
|
|
77
|
+
* quotes/backslashes per the cmd.exe command-line parsing rules.
|
|
78
|
+
*
|
|
79
|
+
* Only meaningful when spawning through a shell; argv-mode spawns pass each
|
|
80
|
+
* arg verbatim and must NOT be pre-quoted.
|
|
81
|
+
*/
|
|
82
|
+
export function quoteForWindowsShell(arg) {
|
|
83
|
+
if (arg === '')
|
|
84
|
+
return '""';
|
|
85
|
+
if (WINDOWS_SHELL_SAFE.test(arg))
|
|
86
|
+
return arg;
|
|
87
|
+
// Double backslashes that precede a quote, escape the quote, then double
|
|
88
|
+
// any trailing backslashes (so they don't escape the closing quote).
|
|
89
|
+
const escaped = arg
|
|
90
|
+
.replace(/(\\*)"/g, (_m, bs) => bs + bs + '\\"')
|
|
91
|
+
.replace(/(\\*)$/, (_m, bs) => bs + bs);
|
|
92
|
+
return `"${escaped}"`;
|
|
93
|
+
}
|
|
94
|
+
export { IS_WINDOWS };
|
|
95
|
+
//# sourceMappingURL=bridgeExecResolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridgeExecResolver.js","sourceRoot":"","sources":["../../../src/parity/bridgeExecResolver.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,UAAU,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC;AAEhD,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,QAAgB;IAC/C,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;QACzC,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,QAAgB;IACjD,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACzE,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,SAA6B;IACxD,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAC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SAAS,CAAC;AACnB,CAAC;AAED,MAAM,kBAAkB,GAAG,yBAAyB,CAAC;AAErD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,oBAAoB,CAAC,GAAW;IAC9C,IAAI,GAAG,KAAK,EAAE;QAAE,OAAO,IAAI,CAAC;IAC5B,IAAI,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,GAAG,CAAC;IAC7C,yEAAyE;IACzE,qEAAqE;IACrE,MAAM,OAAO,GAAG,GAAG;SAChB,OAAO,CAAC,SAAS,EAAE,CAAC,EAAE,EAAE,EAAU,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC;SACvD,OAAO,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAU,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;IAClD,OAAO,IAAI,OAAO,GAAG,CAAC;AACxB,CAAC;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multi-provider abstraction for the bridge SDK's directCli mode.
|
|
3
|
+
*
|
|
4
|
+
* The vendored-bundle path and the original Claude Code `-p` stream-json path
|
|
5
|
+
* are both the `claude` provider. `pi` and `codex` reuse the same spawn +
|
|
6
|
+
* line-by-line JSONL pipeline but speak their own wire protocols, so each
|
|
7
|
+
* provider supplies four pieces the rest of `actoviqBridgeSdk.ts` stays
|
|
8
|
+
* protocol-agnostic around:
|
|
9
|
+
*
|
|
10
|
+
* 1. executable resolution (which binary on PATH, default error message)
|
|
11
|
+
* 2. argv construction (the provider's CLI flags + prompt placement)
|
|
12
|
+
* 3. child-process env injection (provider-specific credential variables)
|
|
13
|
+
* 4. event normalization (provider JSONL → the `system/assistant/result`
|
|
14
|
+
* trio `execute()` already switches on — plus claude content-block shape)
|
|
15
|
+
*
|
|
16
|
+
* Normalization is stateful (pi's session id arrives once in a header line;
|
|
17
|
+
* codex's model is never in the stream; assistant text accumulates across
|
|
18
|
+
* deltas), so each provider hands back a fresh normalizer per run.
|
|
19
|
+
*/
|
|
20
|
+
import type { ActoviqBridgeJsonEvent, ActoviqBridgeRunOptions, BridgeProviderDetection, RuntimeProviderId } from '../types.js';
|
|
21
|
+
/**
|
|
22
|
+
* Per-run state + the translate step. `translate(rawLine)` returns the
|
|
23
|
+
* normalized event to forward, or `null` to drop the line (e.g. a provider
|
|
24
|
+
* status event with no bridge equivalent). Multiple native events may map to
|
|
25
|
+
* a single normalized event; one native event may also emit several.
|
|
26
|
+
*/
|
|
27
|
+
export interface BridgeEventNormalizer {
|
|
28
|
+
/**
|
|
29
|
+
* Translate one parsed JSON line (stream-json/JSONL providers) into
|
|
30
|
+
* normalized events. Return `[]` to drop the line.
|
|
31
|
+
*/
|
|
32
|
+
translate(raw: Record<string, unknown>): ActoviqBridgeJsonEvent[];
|
|
33
|
+
/**
|
|
34
|
+
* When true, the provider emits plain text (not JSONL). `translate()` is
|
|
35
|
+
* called with each raw text line as `{_raw: line}`, and `flush()` is
|
|
36
|
+
* called once when stdout ends.
|
|
37
|
+
*/
|
|
38
|
+
rawText?: true;
|
|
39
|
+
/** Flush accumulated state at end-of-stream (raw-text providers only). */
|
|
40
|
+
flush?(): ActoviqBridgeJsonEvent[];
|
|
41
|
+
}
|
|
42
|
+
export interface RuntimeProvider {
|
|
43
|
+
readonly id: RuntimeProviderId;
|
|
44
|
+
/** Binary name looked up on PATH when `executable` is not provided. */
|
|
45
|
+
readonly pathBinary: string;
|
|
46
|
+
/** Human-readable name for "not found on PATH" errors. */
|
|
47
|
+
readonly displayName: string;
|
|
48
|
+
resolveExecutable(explicitPath?: string): Promise<string>;
|
|
49
|
+
/**
|
|
50
|
+
* Best-effort `<binary> --version` probe. Returns the version string on
|
|
51
|
+
* success, or `undefined` if the binary cannot be probed (missing, exits
|
|
52
|
+
* non-zero, hangs, etc.). Used by `detectBridgeProviders()` only — never on
|
|
53
|
+
* the run path.
|
|
54
|
+
*/
|
|
55
|
+
probeVersion(executablePath: string): Promise<string | undefined>;
|
|
56
|
+
buildArgs(prompt: string, options: ActoviqBridgeRunOptions): string[];
|
|
57
|
+
/**
|
|
58
|
+
* Build the child env. `settingsEnv` is the `~/.actoviq/settings.json` env
|
|
59
|
+
* block; `baseEnv` is the inherited process env already filtered to
|
|
60
|
+
* string values. Providers emit whatever credential variables their CLI
|
|
61
|
+
* reads (claude: ANTHROPIC_*, pi/codex: their own).
|
|
62
|
+
*/
|
|
63
|
+
buildChildEnv(baseEnv: Record<string, string>, settingsEnv: Record<string, string>, overrides?: Record<string, string>): Record<string, string>;
|
|
64
|
+
/** A fresh normalizer for one run. */
|
|
65
|
+
createNormalizer(): BridgeEventNormalizer;
|
|
66
|
+
/** Recommended model IDs for this provider (used by TUI `/bridge model`). */
|
|
67
|
+
suggestedModels(): string[];
|
|
68
|
+
}
|
|
69
|
+
/** Shared base for executable resolution (PATH lookup + explicit-path check). */
|
|
70
|
+
export declare abstract class BaseRuntimeProvider implements RuntimeProvider {
|
|
71
|
+
abstract readonly id: RuntimeProviderId;
|
|
72
|
+
abstract readonly pathBinary: string;
|
|
73
|
+
abstract readonly displayName: string;
|
|
74
|
+
/**
|
|
75
|
+
* Resolve the executable for a run. Precedence (all in-memory; mirrors
|
|
76
|
+
* `buildChildEnvironment` in actoviqBridgeSdk.ts — no file I/O here):
|
|
77
|
+
* 1. `explicitPath` arg (caller-supplied `{ executable }`)
|
|
78
|
+
* 2. `ACTOVIQ_<ID>_PATH` env var (top-level or `env:` block — both are
|
|
79
|
+
* captured by `extractEnv` in loadJsonConfigFile.ts)
|
|
80
|
+
* 3. `raw.bridge.providers[id].path` from the loaded settings store
|
|
81
|
+
* 4. `findExecutableOnPath(this.pathBinary)` — the binary on PATH
|
|
82
|
+
*
|
|
83
|
+
* Mirrors the `ACTOVIQ_BASH_PATH` precedent in src/tools/bash/BashTool.ts.
|
|
84
|
+
*/
|
|
85
|
+
resolveExecutable(explicitPath?: string): Promise<string>;
|
|
86
|
+
probeVersion(executablePath: string): Promise<string | undefined>;
|
|
87
|
+
abstract buildArgs(prompt: string, options: ActoviqBridgeRunOptions): string[];
|
|
88
|
+
abstract buildChildEnv(baseEnv: Record<string, string>, settingsEnv: Record<string, string>, overrides?: Record<string, string>): Record<string, string>;
|
|
89
|
+
abstract createNormalizer(): BridgeEventNormalizer;
|
|
90
|
+
abstract suggestedModels(): string[];
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Build a single normalized event with common optional fields pre-stamped.
|
|
94
|
+
* Normalizers route every native event through this so the downstream
|
|
95
|
+
* `execute()` switch (system/assistant/result) and `runtimeInfoFromInitEvent`
|
|
96
|
+
* keep working untouched.
|
|
97
|
+
*/
|
|
98
|
+
export declare function bridgeEvent(type: string, fields?: Record<string, unknown>): ActoviqBridgeJsonEvent;
|
|
99
|
+
/**
|
|
100
|
+
* The configured default provider, read from `bridge.defaultProvider` in the
|
|
101
|
+
* loaded settings store. Falls back to `'claude'`. Explicit
|
|
102
|
+
* `directCliProvider` (passed to `resolveProvider`) always wins over this.
|
|
103
|
+
*/
|
|
104
|
+
export declare function getDefaultProviderId(): RuntimeProviderId;
|
|
105
|
+
export declare function resolveProvider(id?: RuntimeProviderId): RuntimeProvider;
|
|
106
|
+
/**
|
|
107
|
+
* Probe the locally installed agent CLIs. Resolves each provider via the
|
|
108
|
+
* env/settings/PATH chain (so env overrides are honored) and best-effort
|
|
109
|
+
* `--version`. Never throws — a missing provider is reported as
|
|
110
|
+
* `available: false` with `path: undefined`.
|
|
111
|
+
*/
|
|
112
|
+
export declare function detectBridgeProviders(): Promise<BridgeProviderDetection[]>;
|
|
113
|
+
/** Package-private seam for tests that need the ambient provider. */
|
|
114
|
+
export declare function _setCurrentProvider(provider: RuntimeProvider | undefined): void;
|
|
115
|
+
export declare function _getCurrentProvider(): RuntimeProvider | undefined;
|
|
116
|
+
export declare const claudeProvider: RuntimeProvider;
|
|
117
|
+
export declare const piProvider: RuntimeProvider;
|
|
118
|
+
export declare const codexProvider: RuntimeProvider;
|
|
119
|
+
export declare const codewhaleProvider: RuntimeProvider;
|
|
120
|
+
export declare const reasonixProvider: RuntimeProvider;
|
|
121
|
+
export declare const crushProvider: RuntimeProvider;
|
|
122
|
+
export declare const BRIDGE_PROVIDERS: Record<RuntimeProviderId, RuntimeProvider>;
|
|
123
|
+
/**
|
|
124
|
+
* Best-effort credential env-var names each provider's CLI reads. The TUI
|
|
125
|
+
* treats "any one of these set" (across the settings env block ∪ process.env)
|
|
126
|
+
* as "credentials likely configured". Empty arrays mean the provider's
|
|
127
|
+
* credential var is not known from its public surface (codewhale/crush are
|
|
128
|
+
* multi-backend); the UI shows an honest "(unknown)" rather than a wrong key.
|
|
129
|
+
* This is advisory display data only — it never gates a run.
|
|
130
|
+
*/
|
|
131
|
+
export declare const BRIDGE_PROVIDER_CREDENTIALS: Record<RuntimeProviderId, string[]>;
|
|
132
|
+
//# sourceMappingURL=bridgeProviders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridgeProviders.d.ts","sourceRoot":"","sources":["../../../src/parity/bridgeProviders.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,KAAK,EACV,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,EAClB,MAAM,aAAa,CAAC;AAyBrB;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,SAAS,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,sBAAsB,EAAE,CAAC;IAClE;;;;OAIG;IACH,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,0EAA0E;IAC1E,KAAK,CAAC,IAAI,sBAAsB,EAAE,CAAC;CACpC;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,EAAE,iBAAiB,CAAC;IAC/B,uEAAuE;IACvE,QAAQ,CAAC,UAAU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