@pellux/goodvibes-sdk 0.18.28 → 0.18.29
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/dist/_internal/platform/agents/orchestrator-runner.js +1 -1
- package/dist/_internal/platform/bookmarks/manager.d.ts +1 -1
- package/dist/_internal/platform/bookmarks/manager.d.ts.map +1 -1
- package/dist/_internal/platform/channels/surface-registry.js +3 -3
- package/dist/_internal/platform/config/api-keys.d.ts +29 -0
- package/dist/_internal/platform/config/api-keys.d.ts.map +1 -0
- package/dist/_internal/platform/config/api-keys.js +153 -0
- package/dist/_internal/platform/config/index.d.ts +1 -13
- package/dist/_internal/platform/config/index.d.ts.map +1 -1
- package/dist/_internal/platform/config/index.js +1 -138
- package/dist/_internal/platform/core/conversation-diff.d.ts +6 -2
- package/dist/_internal/platform/core/conversation-diff.d.ts.map +1 -1
- package/dist/_internal/platform/core/conversation.d.ts +13 -5
- package/dist/_internal/platform/core/conversation.d.ts.map +1 -1
- package/dist/_internal/platform/core/conversation.js +35 -1
- package/dist/_internal/platform/plugins/loader.d.ts +5 -1
- package/dist/_internal/platform/plugins/loader.d.ts.map +1 -1
- package/dist/_internal/platform/plugins/loader.js +7 -3
- package/dist/_internal/platform/runtime/bootstrap-hook-bridge.d.ts +10 -0
- package/dist/_internal/platform/runtime/bootstrap-hook-bridge.d.ts.map +1 -0
- package/dist/_internal/platform/runtime/bootstrap-hook-bridge.js +143 -0
- package/dist/_internal/platform/runtime/diagnostics/panels/panel-resources.d.ts +5 -5
- package/dist/_internal/platform/runtime/diagnostics/panels/panel-resources.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/diagnostics/panels/panel-resources.js +3 -3
- package/dist/_internal/platform/runtime/diagnostics/types.d.ts +26 -13
- package/dist/_internal/platform/runtime/diagnostics/types.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/diagnostics/types.js +4 -2
- package/dist/_internal/platform/runtime/mutable-runtime-state.d.ts +14 -0
- package/dist/_internal/platform/runtime/mutable-runtime-state.d.ts.map +1 -0
- package/dist/_internal/platform/runtime/mutable-runtime-state.js +1 -0
- package/dist/_internal/platform/runtime/ops/playbooks/permission-deadlock.js +2 -2
- package/dist/_internal/platform/runtime/perf/component-contracts.d.ts +114 -0
- package/dist/_internal/platform/runtime/perf/component-contracts.d.ts.map +1 -0
- package/dist/_internal/platform/runtime/perf/component-contracts.js +104 -0
- package/dist/_internal/platform/runtime/perf/component-health-monitor.d.ts +98 -0
- package/dist/_internal/platform/runtime/perf/component-health-monitor.d.ts.map +1 -0
- package/dist/_internal/platform/runtime/perf/component-health-monitor.js +248 -0
- package/dist/_internal/platform/runtime/perf/index.d.ts +6 -3
- package/dist/_internal/platform/runtime/perf/index.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/perf/index.js +4 -2
- package/dist/_internal/platform/runtime/perf/panel-contracts.d.ts +6 -90
- package/dist/_internal/platform/runtime/perf/panel-contracts.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/perf/panel-contracts.js +4 -83
- package/dist/_internal/platform/runtime/perf/panel-health-monitor.d.ts +4 -88
- package/dist/_internal/platform/runtime/perf/panel-health-monitor.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/perf/panel-health-monitor.js +4 -236
- package/dist/_internal/platform/runtime/service-queries.d.ts +3 -0
- package/dist/_internal/platform/runtime/service-queries.d.ts.map +1 -0
- package/dist/_internal/platform/runtime/service-queries.js +1 -0
- package/dist/_internal/platform/runtime/services.d.ts +2 -2
- package/dist/_internal/platform/runtime/services.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/services.js +3 -3
- package/dist/_internal/platform/runtime/session-return-context.js +1 -1
- package/dist/_internal/platform/runtime/shell-command-services.d.ts +2 -2
- package/dist/_internal/platform/runtime/shell-command-services.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/shell-command-services.js +2 -2
- package/dist/_internal/platform/runtime/shell-command-workspace.d.ts +2 -2
- package/dist/_internal/platform/runtime/shell-command-workspace.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/shell-command-workspace.js +2 -2
- package/dist/_internal/platform/runtime/store/domains/index.d.ts +2 -0
- package/dist/_internal/platform/runtime/store/domains/index.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/store/domains/index.js +1 -0
- package/dist/_internal/platform/runtime/store/selectors/index.d.ts +27 -14
- package/dist/_internal/platform/runtime/store/selectors/index.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/store/selectors/index.js +35 -25
- package/dist/_internal/platform/runtime/store/state.d.ts +3 -4
- package/dist/_internal/platform/runtime/store/state.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/store/state.js +3 -4
- package/dist/_internal/platform/runtime/system-message-policy.d.ts +18 -0
- package/dist/_internal/platform/runtime/system-message-policy.d.ts.map +1 -0
- package/dist/_internal/platform/runtime/system-message-policy.js +35 -0
- package/dist/_internal/platform/utils/clipboard.d.ts +3 -2
- package/dist/_internal/platform/utils/clipboard.d.ts.map +1 -1
- package/dist/_internal/platform/utils/clipboard.js +0 -17
- package/dist/_internal/platform/utils/notify.d.ts.map +1 -1
- package/dist/_internal/platform/utils/notify.js +4 -1
- package/dist/_internal/platform/utils/terminal-width.d.ts +13 -0
- package/dist/_internal/platform/utils/terminal-width.d.ts.map +1 -1
- package/dist/_internal/platform/utils/terminal-width.js +13 -0
- package/dist/_internal/platform/version.js +1 -1
- package/package.json +1 -1
- package/dist/_internal/platform/core/history.d.ts +0 -22
- package/dist/_internal/platform/core/history.d.ts.map +0 -1
- package/dist/_internal/platform/core/history.js +0 -43
- package/dist/_internal/platform/types/grid.d.ts +0 -27
- package/dist/_internal/platform/types/grid.d.ts.map +0 -1
- package/dist/_internal/platform/types/grid.js +0 -26
- package/dist/_internal/platform/utils/splash-lines.d.ts +0 -8
- package/dist/_internal/platform/utils/splash-lines.d.ts.map +0 -1
- package/dist/_internal/platform/utils/splash-lines.js +0 -32
|
@@ -264,7 +264,7 @@ export async function runAgentTask(context, record) {
|
|
|
264
264
|
const toolTokens = toolDefinitions.length > 0
|
|
265
265
|
? estimateTokens(JSON.stringify(toolDefinitions))
|
|
266
266
|
: 0;
|
|
267
|
-
conversation = new ConversationManager(
|
|
267
|
+
conversation = new ConversationManager();
|
|
268
268
|
conversation.addUserMessage(record.task);
|
|
269
269
|
let systemPrompt = buildOrchestratorSystemPrompt(record, undefined, context);
|
|
270
270
|
let continueLoop = true;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* BookmarkEntry - Metadata for a saved bookmark.
|
|
3
3
|
*/
|
|
4
4
|
export interface BookmarkEntry {
|
|
5
|
-
/** Stable
|
|
5
|
+
/** Stable key identifying the block (e.g. 'msg_3_code_1'). */
|
|
6
6
|
key: string;
|
|
7
7
|
/** Human-readable label (block type + short excerpt). */
|
|
8
8
|
label: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/bookmarks/manager.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/bookmarks/manager.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,8DAA8D;IAC9D,GAAG,EAAE,MAAM,CAAC;IACZ,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;GAKG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,SAAS,CAAoC;IACrD,OAAO,CAAC,OAAO,CAAS;gBAEZ,OAAO,EAAE,MAAM;IAI3B;;;OAGG;IACI,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO;IAcnD;;OAEG;IACI,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIzC;;OAEG;IACI,IAAI,IAAI,aAAa,EAAE;IAI9B;;OAEG;IACI,KAAK,IAAI,IAAI;IAIpB;;;OAGG;IACI,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM;IAgBzD;;OAEG;IACI,cAAc,IAAI,MAAM,EAAE;IAYjC;;OAEG;IACI,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;CAclD"}
|
|
@@ -27,7 +27,7 @@ export class SurfaceRegistry {
|
|
|
27
27
|
const pluginDescriptors = this.pluginRegistry?.listDescriptors() ?? [];
|
|
28
28
|
const enabledForSurface = (surface) => {
|
|
29
29
|
if (surface === 'tui')
|
|
30
|
-
return
|
|
30
|
+
return this.configManager.getCategory('surfaces').tui?.enabled !== false;
|
|
31
31
|
if (surface === 'web')
|
|
32
32
|
return Boolean(this.configManager.get('web.enabled') || this.configManager.get('controlPlane.enabled'));
|
|
33
33
|
if (surface === 'slack')
|
|
@@ -104,8 +104,8 @@ export class SurfaceRegistry {
|
|
|
104
104
|
id: 'surface:tui',
|
|
105
105
|
kind: 'tui',
|
|
106
106
|
label: 'Terminal UI',
|
|
107
|
-
enabled:
|
|
108
|
-
state: 'healthy',
|
|
107
|
+
enabled: enabledForSurface('tui'),
|
|
108
|
+
state: enabledForSurface('tui') ? 'healthy' : 'disabled',
|
|
109
109
|
configuredAt,
|
|
110
110
|
lastSeenAt: configuredAt,
|
|
111
111
|
capabilities: ['ingress', 'egress', 'session_binding'],
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API key resolution for all supported providers.
|
|
3
|
+
*
|
|
4
|
+
* Platform-level code — no surface/TUI dependencies.
|
|
5
|
+
* Used by every GoodVibes surface (TUI, CLI, web, etc.).
|
|
6
|
+
*
|
|
7
|
+
* Provides:
|
|
8
|
+
* - loadEnvApiKeys() — synchronous env-var scan, returns configured keys
|
|
9
|
+
* - getConfiguredApiKeys() — public alias for loadEnvApiKeys
|
|
10
|
+
* - resolveApiKeys() — three-tier async resolution: env → SecretsManager → skip
|
|
11
|
+
*/
|
|
12
|
+
import { SecretsManager } from './secrets.js';
|
|
13
|
+
/**
|
|
14
|
+
* Returns all provider API keys that are currently set in the environment.
|
|
15
|
+
* Pure env-var read — synchronous, no I/O.
|
|
16
|
+
*/
|
|
17
|
+
export declare function getConfiguredApiKeys(): Record<string, string>;
|
|
18
|
+
/**
|
|
19
|
+
* resolveApiKeys — three-tier async resolution for all provider API keys.
|
|
20
|
+
*
|
|
21
|
+
* Resolution order per key:
|
|
22
|
+
* 1. Environment variable (process.env)
|
|
23
|
+
* 2. SecretsManager hierarchy-aware stores (secure preferred, plaintext policy-aware)
|
|
24
|
+
* 3. Omitted from result (null → skip)
|
|
25
|
+
*
|
|
26
|
+
* Returns a map of provider → apiKey for all providers where a key is found.
|
|
27
|
+
*/
|
|
28
|
+
export declare function resolveApiKeys(secrets: Pick<SecretsManager, 'get'>): Promise<Record<string, string>>;
|
|
29
|
+
//# sourceMappingURL=api-keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-keys.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/config/api-keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAE7D;AAwDD;;;;;;;;;GASG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,KAAK,CAAC,GACnC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAkEjC"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API key resolution for all supported providers.
|
|
3
|
+
*
|
|
4
|
+
* Platform-level code — no surface/TUI dependencies.
|
|
5
|
+
* Used by every GoodVibes surface (TUI, CLI, web, etc.).
|
|
6
|
+
*
|
|
7
|
+
* Provides:
|
|
8
|
+
* - loadEnvApiKeys() — synchronous env-var scan, returns configured keys
|
|
9
|
+
* - getConfiguredApiKeys() — public alias for loadEnvApiKeys
|
|
10
|
+
* - resolveApiKeys() — three-tier async resolution: env → SecretsManager → skip
|
|
11
|
+
*/
|
|
12
|
+
import { SecretsManager } from './secrets.js';
|
|
13
|
+
/**
|
|
14
|
+
* Returns all provider API keys that are currently set in the environment.
|
|
15
|
+
* Pure env-var read — synchronous, no I/O.
|
|
16
|
+
*/
|
|
17
|
+
export function getConfiguredApiKeys() {
|
|
18
|
+
return loadEnvApiKeys();
|
|
19
|
+
}
|
|
20
|
+
function loadEnvApiKeys() {
|
|
21
|
+
const keys = {};
|
|
22
|
+
const mapping = {
|
|
23
|
+
openai: 'OPENAI_API_KEY',
|
|
24
|
+
anthropic: 'ANTHROPIC_API_KEY',
|
|
25
|
+
gemini: 'GEMINI_API_KEY',
|
|
26
|
+
inceptionlabs: 'INCEPTION_API_KEY',
|
|
27
|
+
openrouter: 'OPENROUTER_API_KEY',
|
|
28
|
+
aihubmix: 'AIHUBMIX_API_KEY',
|
|
29
|
+
groq: 'GROQ_API_KEY',
|
|
30
|
+
cerebras: 'CEREBRAS_API_KEY',
|
|
31
|
+
mistral: 'MISTRAL_API_KEY',
|
|
32
|
+
'ollama-cloud': 'OLLAMA_CLOUD_API_KEY',
|
|
33
|
+
// Note: also checked as OLLAMA_API_KEY below
|
|
34
|
+
huggingface: 'HF_API_KEY',
|
|
35
|
+
nvidia: 'NVIDIA_API_KEY',
|
|
36
|
+
llm7: 'LLM7_API_KEY',
|
|
37
|
+
deepseek: 'DEEPSEEK_API_KEY',
|
|
38
|
+
fireworks: 'FIREWORKS_API_KEY',
|
|
39
|
+
'github-copilot': 'COPILOT_GITHUB_TOKEN',
|
|
40
|
+
'microsoft-foundry': 'AZURE_OPENAI_API_KEY',
|
|
41
|
+
minimax: 'MINIMAX_API_KEY',
|
|
42
|
+
moonshot: 'MOONSHOT_API_KEY',
|
|
43
|
+
qianfan: 'QIANFAN_API_KEY',
|
|
44
|
+
qwen: 'QWEN_API_KEY',
|
|
45
|
+
sglang: 'SGLANG_API_KEY',
|
|
46
|
+
stepfun: 'STEPFUN_API_KEY',
|
|
47
|
+
together: 'TOGETHER_API_KEY',
|
|
48
|
+
venice: 'VENICE_API_KEY',
|
|
49
|
+
volcengine: 'VOLCANO_ENGINE_API_KEY',
|
|
50
|
+
xai: 'XAI_API_KEY',
|
|
51
|
+
xiaomi: 'XIAOMI_API_KEY',
|
|
52
|
+
zai: 'ZAI_API_KEY',
|
|
53
|
+
'cloudflare-ai-gateway': 'CLOUDFLARE_AI_GATEWAY_API_KEY',
|
|
54
|
+
'vercel-ai-gateway': 'AI_GATEWAY_API_KEY',
|
|
55
|
+
litellm: 'LITELLM_API_KEY',
|
|
56
|
+
'copilot-proxy': 'COPILOT_PROXY_API_KEY',
|
|
57
|
+
};
|
|
58
|
+
for (const [prov, envVar] of Object.entries(mapping)) {
|
|
59
|
+
let value = process.env[envVar];
|
|
60
|
+
// Fallback env var names
|
|
61
|
+
if (!value && prov === 'gemini')
|
|
62
|
+
value = process.env['GOOGLE_API_KEY'] ?? process.env['GOOGLE_GEMINI_API_KEY'];
|
|
63
|
+
if (!value && prov === 'openai')
|
|
64
|
+
value = process.env['OPENAI_KEY'];
|
|
65
|
+
if (!value && prov === 'anthropic')
|
|
66
|
+
value = process.env['CLAUDE_API_KEY'];
|
|
67
|
+
if (!value && prov === 'ollama-cloud')
|
|
68
|
+
value = process.env['OLLAMA_API_KEY'];
|
|
69
|
+
if (!value && prov === 'huggingface')
|
|
70
|
+
value = process.env['HUGGINGFACE_API_KEY'] ?? process.env['HF_TOKEN'];
|
|
71
|
+
if (!value && prov === 'github-copilot')
|
|
72
|
+
value = process.env['GH_TOKEN'] ?? process.env['GITHUB_TOKEN'];
|
|
73
|
+
if (!value && prov === 'qwen')
|
|
74
|
+
value = process.env['DASHSCOPE_API_KEY'] ?? process.env['MODELSTUDIO_API_KEY'];
|
|
75
|
+
if (!value && prov === 'zai')
|
|
76
|
+
value = process.env['Z_AI_API_KEY'];
|
|
77
|
+
if (value)
|
|
78
|
+
keys[prov] = value;
|
|
79
|
+
}
|
|
80
|
+
return keys;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* resolveApiKeys — three-tier async resolution for all provider API keys.
|
|
84
|
+
*
|
|
85
|
+
* Resolution order per key:
|
|
86
|
+
* 1. Environment variable (process.env)
|
|
87
|
+
* 2. SecretsManager hierarchy-aware stores (secure preferred, plaintext policy-aware)
|
|
88
|
+
* 3. Omitted from result (null → skip)
|
|
89
|
+
*
|
|
90
|
+
* Returns a map of provider → apiKey for all providers where a key is found.
|
|
91
|
+
*/
|
|
92
|
+
export async function resolveApiKeys(secrets) {
|
|
93
|
+
const mapping = [
|
|
94
|
+
{ prov: 'openai', envVars: ['OPENAI_API_KEY', 'OPENAI_KEY'] },
|
|
95
|
+
{ prov: 'anthropic', envVars: ['ANTHROPIC_API_KEY', 'CLAUDE_API_KEY'] },
|
|
96
|
+
{ prov: 'gemini', envVars: ['GEMINI_API_KEY', 'GOOGLE_API_KEY', 'GOOGLE_GEMINI_API_KEY'] },
|
|
97
|
+
{ prov: 'inceptionlabs', envVars: ['INCEPTION_API_KEY'] },
|
|
98
|
+
{ prov: 'openrouter', envVars: ['OPENROUTER_API_KEY'] },
|
|
99
|
+
{ prov: 'aihubmix', envVars: ['AIHUBMIX_API_KEY'] },
|
|
100
|
+
{ prov: 'groq', envVars: ['GROQ_API_KEY'] },
|
|
101
|
+
{ prov: 'cerebras', envVars: ['CEREBRAS_API_KEY'] },
|
|
102
|
+
{ prov: 'mistral', envVars: ['MISTRAL_API_KEY'] },
|
|
103
|
+
{ prov: 'ollama-cloud', envVars: ['OLLAMA_CLOUD_API_KEY', 'OLLAMA_API_KEY'] },
|
|
104
|
+
{ prov: 'huggingface', envVars: ['HF_API_KEY', 'HUGGINGFACE_API_KEY', 'HF_TOKEN'] },
|
|
105
|
+
{ prov: 'nvidia', envVars: ['NVIDIA_API_KEY'] },
|
|
106
|
+
{ prov: 'llm7', envVars: ['LLM7_API_KEY'] },
|
|
107
|
+
{ prov: 'deepseek', envVars: ['DEEPSEEK_API_KEY'] },
|
|
108
|
+
{ prov: 'fireworks', envVars: ['FIREWORKS_API_KEY'] },
|
|
109
|
+
{ prov: 'github-copilot', envVars: ['COPILOT_GITHUB_TOKEN', 'GH_TOKEN', 'GITHUB_TOKEN'] },
|
|
110
|
+
{ prov: 'microsoft-foundry', envVars: ['AZURE_OPENAI_API_KEY'] },
|
|
111
|
+
{ prov: 'minimax', envVars: ['MINIMAX_API_KEY'] },
|
|
112
|
+
{ prov: 'moonshot', envVars: ['MOONSHOT_API_KEY'] },
|
|
113
|
+
{ prov: 'qianfan', envVars: ['QIANFAN_API_KEY'] },
|
|
114
|
+
{ prov: 'qwen', envVars: ['QWEN_API_KEY', 'DASHSCOPE_API_KEY', 'MODELSTUDIO_API_KEY'] },
|
|
115
|
+
{ prov: 'sglang', envVars: ['SGLANG_API_KEY'] },
|
|
116
|
+
{ prov: 'stepfun', envVars: ['STEPFUN_API_KEY'] },
|
|
117
|
+
{ prov: 'together', envVars: ['TOGETHER_API_KEY'] },
|
|
118
|
+
{ prov: 'venice', envVars: ['VENICE_API_KEY'] },
|
|
119
|
+
{ prov: 'volcengine', envVars: ['VOLCANO_ENGINE_API_KEY'] },
|
|
120
|
+
{ prov: 'xai', envVars: ['XAI_API_KEY'] },
|
|
121
|
+
{ prov: 'xiaomi', envVars: ['XIAOMI_API_KEY'] },
|
|
122
|
+
{ prov: 'zai', envVars: ['ZAI_API_KEY', 'Z_AI_API_KEY'] },
|
|
123
|
+
{ prov: 'cloudflare-ai-gateway', envVars: ['CLOUDFLARE_AI_GATEWAY_API_KEY'] },
|
|
124
|
+
{ prov: 'vercel-ai-gateway', envVars: ['AI_GATEWAY_API_KEY'] },
|
|
125
|
+
{ prov: 'litellm', envVars: ['LITELLM_API_KEY'] },
|
|
126
|
+
{ prov: 'copilot-proxy', envVars: ['COPILOT_PROXY_API_KEY'] },
|
|
127
|
+
];
|
|
128
|
+
const result = {};
|
|
129
|
+
for (const { prov, envVars } of mapping) {
|
|
130
|
+
// Tier 1: environment variables
|
|
131
|
+
let value = null;
|
|
132
|
+
for (const envVar of envVars) {
|
|
133
|
+
if (process.env[envVar]) {
|
|
134
|
+
value = process.env[envVar];
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
// Tier 2: SecretsManager hierarchy-aware secure/plaintext stores
|
|
139
|
+
if (value === null) {
|
|
140
|
+
for (const envVar of envVars) {
|
|
141
|
+
const stored = await secrets.get(envVar);
|
|
142
|
+
if (stored !== null) {
|
|
143
|
+
value = stored;
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
if (value !== null) {
|
|
149
|
+
result[prov] = value;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return result;
|
|
153
|
+
}
|
|
@@ -12,7 +12,6 @@ export { DEFAULT_CONFIG, CONFIG_SCHEMA } from '@pellux/goodvibes-sdk/platform/co
|
|
|
12
12
|
export { ConfigError } from '@pellux/goodvibes-sdk/platform/types/errors';
|
|
13
13
|
import { ConfigManager } from './manager.js';
|
|
14
14
|
import type { GoodVibesConfig } from '@pellux/goodvibes-sdk/platform/config/schema';
|
|
15
|
-
import { SecretsManager } from './secrets.js';
|
|
16
15
|
export declare function getConfigSnapshot(configManager: Pick<ConfigManager, 'getRaw'>): Readonly<GoodVibesConfig>;
|
|
17
16
|
export declare function getConfiguredModelId(configManager: Pick<ConfigManager, 'get'>): string;
|
|
18
17
|
export declare function getConfiguredProviderId(configManager: Pick<ConfigManager, 'get'>): string;
|
|
@@ -20,16 +19,5 @@ export declare function getConfiguredEmbeddingProviderId(configManager: Pick<Con
|
|
|
20
19
|
export declare function isAutoApproveEnabled(configManager: Pick<ConfigManager, 'get'>): boolean;
|
|
21
20
|
export declare function getWorkingDirectory(configManager: Pick<ConfigManager, 'getWorkingDirectory'>): string | null;
|
|
22
21
|
export declare function getConfiguredSystemPrompt(configManager: Pick<ConfigManager, 'get'>): string | undefined;
|
|
23
|
-
export
|
|
24
|
-
/**
|
|
25
|
-
* resolveApiKeys — three-tier async resolution for all provider API keys.
|
|
26
|
-
*
|
|
27
|
-
* Resolution order per key:
|
|
28
|
-
* 1. Environment variable (process.env)
|
|
29
|
-
* 2. SecretsManager hierarchy-aware stores (secure preferred, plaintext policy-aware)
|
|
30
|
-
* 3. Omitted from result (null → skip)
|
|
31
|
-
*
|
|
32
|
-
* Returns a map of provider → apiKey for all providers where a key is found.
|
|
33
|
-
*/
|
|
34
|
-
export declare function resolveApiKeys(secrets: Pick<SecretsManager, 'get'>): Promise<Record<string, string>>;
|
|
22
|
+
export { getConfiguredApiKeys, resolveApiKeys } from './api-keys.js';
|
|
35
23
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/config/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACzM,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAC7F,OAAO,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAG1E,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;
|
|
1
|
+
{"version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GAAG,MAAM,GAAG,SAAS,CASvG;AAED,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -10,7 +10,6 @@ export { DEFAULT_CONFIG, CONFIG_SCHEMA } from '@pellux/goodvibes-sdk/platform/co
|
|
|
10
10
|
export { ConfigError } from '@pellux/goodvibes-sdk/platform/types/errors';
|
|
11
11
|
import { readFileSync } from 'fs';
|
|
12
12
|
import { ConfigManager } from './manager.js';
|
|
13
|
-
import { SecretsManager } from './secrets.js';
|
|
14
13
|
import { logger } from '@pellux/goodvibes-sdk/platform/utils/logger';
|
|
15
14
|
import { summarizeError } from '@pellux/goodvibes-sdk/platform/utils/error-display';
|
|
16
15
|
export function getConfigSnapshot(configManager) {
|
|
@@ -43,140 +42,4 @@ export function getConfiguredSystemPrompt(configManager) {
|
|
|
43
42
|
return undefined;
|
|
44
43
|
}
|
|
45
44
|
}
|
|
46
|
-
export
|
|
47
|
-
return loadEnvApiKeys();
|
|
48
|
-
}
|
|
49
|
-
function loadEnvApiKeys() {
|
|
50
|
-
const keys = {};
|
|
51
|
-
const mapping = {
|
|
52
|
-
openai: 'OPENAI_API_KEY',
|
|
53
|
-
anthropic: 'ANTHROPIC_API_KEY',
|
|
54
|
-
gemini: 'GEMINI_API_KEY',
|
|
55
|
-
inceptionlabs: 'INCEPTION_API_KEY',
|
|
56
|
-
openrouter: 'OPENROUTER_API_KEY',
|
|
57
|
-
aihubmix: 'AIHUBMIX_API_KEY',
|
|
58
|
-
groq: 'GROQ_API_KEY',
|
|
59
|
-
cerebras: 'CEREBRAS_API_KEY',
|
|
60
|
-
mistral: 'MISTRAL_API_KEY',
|
|
61
|
-
'ollama-cloud': 'OLLAMA_CLOUD_API_KEY',
|
|
62
|
-
// Note: also checked as OLLAMA_API_KEY below
|
|
63
|
-
huggingface: 'HF_API_KEY',
|
|
64
|
-
nvidia: 'NVIDIA_API_KEY',
|
|
65
|
-
llm7: 'LLM7_API_KEY',
|
|
66
|
-
deepseek: 'DEEPSEEK_API_KEY',
|
|
67
|
-
fireworks: 'FIREWORKS_API_KEY',
|
|
68
|
-
'github-copilot': 'COPILOT_GITHUB_TOKEN',
|
|
69
|
-
'microsoft-foundry': 'AZURE_OPENAI_API_KEY',
|
|
70
|
-
minimax: 'MINIMAX_API_KEY',
|
|
71
|
-
moonshot: 'MOONSHOT_API_KEY',
|
|
72
|
-
qianfan: 'QIANFAN_API_KEY',
|
|
73
|
-
qwen: 'QWEN_API_KEY',
|
|
74
|
-
sglang: 'SGLANG_API_KEY',
|
|
75
|
-
stepfun: 'STEPFUN_API_KEY',
|
|
76
|
-
together: 'TOGETHER_API_KEY',
|
|
77
|
-
venice: 'VENICE_API_KEY',
|
|
78
|
-
volcengine: 'VOLCANO_ENGINE_API_KEY',
|
|
79
|
-
xai: 'XAI_API_KEY',
|
|
80
|
-
xiaomi: 'XIAOMI_API_KEY',
|
|
81
|
-
zai: 'ZAI_API_KEY',
|
|
82
|
-
'cloudflare-ai-gateway': 'CLOUDFLARE_AI_GATEWAY_API_KEY',
|
|
83
|
-
'vercel-ai-gateway': 'AI_GATEWAY_API_KEY',
|
|
84
|
-
litellm: 'LITELLM_API_KEY',
|
|
85
|
-
'copilot-proxy': 'COPILOT_PROXY_API_KEY',
|
|
86
|
-
};
|
|
87
|
-
for (const [prov, envVar] of Object.entries(mapping)) {
|
|
88
|
-
let value = process.env[envVar];
|
|
89
|
-
// Fallback env var names
|
|
90
|
-
if (!value && prov === 'gemini')
|
|
91
|
-
value = process.env['GOOGLE_API_KEY'] ?? process.env['GOOGLE_GEMINI_API_KEY'];
|
|
92
|
-
if (!value && prov === 'openai')
|
|
93
|
-
value = process.env['OPENAI_KEY'];
|
|
94
|
-
if (!value && prov === 'anthropic')
|
|
95
|
-
value = process.env['CLAUDE_API_KEY'];
|
|
96
|
-
if (!value && prov === 'ollama-cloud')
|
|
97
|
-
value = process.env['OLLAMA_API_KEY'];
|
|
98
|
-
if (!value && prov === 'huggingface')
|
|
99
|
-
value = process.env['HUGGINGFACE_API_KEY'] ?? process.env['HF_TOKEN'];
|
|
100
|
-
if (!value && prov === 'github-copilot')
|
|
101
|
-
value = process.env['GH_TOKEN'] ?? process.env['GITHUB_TOKEN'];
|
|
102
|
-
if (!value && prov === 'qwen')
|
|
103
|
-
value = process.env['DASHSCOPE_API_KEY'] ?? process.env['MODELSTUDIO_API_KEY'];
|
|
104
|
-
if (!value && prov === 'zai')
|
|
105
|
-
value = process.env['Z_AI_API_KEY'];
|
|
106
|
-
if (value)
|
|
107
|
-
keys[prov] = value;
|
|
108
|
-
}
|
|
109
|
-
return keys;
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* resolveApiKeys — three-tier async resolution for all provider API keys.
|
|
113
|
-
*
|
|
114
|
-
* Resolution order per key:
|
|
115
|
-
* 1. Environment variable (process.env)
|
|
116
|
-
* 2. SecretsManager hierarchy-aware stores (secure preferred, plaintext policy-aware)
|
|
117
|
-
* 3. Omitted from result (null → skip)
|
|
118
|
-
*
|
|
119
|
-
* Returns a map of provider → apiKey for all providers where a key is found.
|
|
120
|
-
*/
|
|
121
|
-
export async function resolveApiKeys(secrets) {
|
|
122
|
-
const mapping = [
|
|
123
|
-
{ prov: 'openai', envVars: ['OPENAI_API_KEY', 'OPENAI_KEY'] },
|
|
124
|
-
{ prov: 'anthropic', envVars: ['ANTHROPIC_API_KEY', 'CLAUDE_API_KEY'] },
|
|
125
|
-
{ prov: 'gemini', envVars: ['GEMINI_API_KEY', 'GOOGLE_API_KEY', 'GOOGLE_GEMINI_API_KEY'] },
|
|
126
|
-
{ prov: 'inceptionlabs', envVars: ['INCEPTION_API_KEY'] },
|
|
127
|
-
{ prov: 'openrouter', envVars: ['OPENROUTER_API_KEY'] },
|
|
128
|
-
{ prov: 'aihubmix', envVars: ['AIHUBMIX_API_KEY'] },
|
|
129
|
-
{ prov: 'groq', envVars: ['GROQ_API_KEY'] },
|
|
130
|
-
{ prov: 'cerebras', envVars: ['CEREBRAS_API_KEY'] },
|
|
131
|
-
{ prov: 'mistral', envVars: ['MISTRAL_API_KEY'] },
|
|
132
|
-
{ prov: 'ollama-cloud', envVars: ['OLLAMA_CLOUD_API_KEY', 'OLLAMA_API_KEY'] },
|
|
133
|
-
{ prov: 'huggingface', envVars: ['HF_API_KEY', 'HUGGINGFACE_API_KEY', 'HF_TOKEN'] },
|
|
134
|
-
{ prov: 'nvidia', envVars: ['NVIDIA_API_KEY'] },
|
|
135
|
-
{ prov: 'llm7', envVars: ['LLM7_API_KEY'] },
|
|
136
|
-
{ prov: 'deepseek', envVars: ['DEEPSEEK_API_KEY'] },
|
|
137
|
-
{ prov: 'fireworks', envVars: ['FIREWORKS_API_KEY'] },
|
|
138
|
-
{ prov: 'github-copilot', envVars: ['COPILOT_GITHUB_TOKEN', 'GH_TOKEN', 'GITHUB_TOKEN'] },
|
|
139
|
-
{ prov: 'microsoft-foundry', envVars: ['AZURE_OPENAI_API_KEY'] },
|
|
140
|
-
{ prov: 'minimax', envVars: ['MINIMAX_API_KEY'] },
|
|
141
|
-
{ prov: 'moonshot', envVars: ['MOONSHOT_API_KEY'] },
|
|
142
|
-
{ prov: 'qianfan', envVars: ['QIANFAN_API_KEY'] },
|
|
143
|
-
{ prov: 'qwen', envVars: ['QWEN_API_KEY', 'DASHSCOPE_API_KEY', 'MODELSTUDIO_API_KEY'] },
|
|
144
|
-
{ prov: 'sglang', envVars: ['SGLANG_API_KEY'] },
|
|
145
|
-
{ prov: 'stepfun', envVars: ['STEPFUN_API_KEY'] },
|
|
146
|
-
{ prov: 'together', envVars: ['TOGETHER_API_KEY'] },
|
|
147
|
-
{ prov: 'venice', envVars: ['VENICE_API_KEY'] },
|
|
148
|
-
{ prov: 'volcengine', envVars: ['VOLCANO_ENGINE_API_KEY'] },
|
|
149
|
-
{ prov: 'xai', envVars: ['XAI_API_KEY'] },
|
|
150
|
-
{ prov: 'xiaomi', envVars: ['XIAOMI_API_KEY'] },
|
|
151
|
-
{ prov: 'zai', envVars: ['ZAI_API_KEY', 'Z_AI_API_KEY'] },
|
|
152
|
-
{ prov: 'cloudflare-ai-gateway', envVars: ['CLOUDFLARE_AI_GATEWAY_API_KEY'] },
|
|
153
|
-
{ prov: 'vercel-ai-gateway', envVars: ['AI_GATEWAY_API_KEY'] },
|
|
154
|
-
{ prov: 'litellm', envVars: ['LITELLM_API_KEY'] },
|
|
155
|
-
{ prov: 'copilot-proxy', envVars: ['COPILOT_PROXY_API_KEY'] },
|
|
156
|
-
];
|
|
157
|
-
const result = {};
|
|
158
|
-
for (const { prov, envVars } of mapping) {
|
|
159
|
-
// Tier 1: environment variables
|
|
160
|
-
let value = null;
|
|
161
|
-
for (const envVar of envVars) {
|
|
162
|
-
if (process.env[envVar]) {
|
|
163
|
-
value = process.env[envVar];
|
|
164
|
-
break;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
// Tier 2: SecretsManager hierarchy-aware secure/plaintext stores
|
|
168
|
-
if (value === null) {
|
|
169
|
-
for (const envVar of envVars) {
|
|
170
|
-
const stored = await secrets.get(envVar);
|
|
171
|
-
if (stored !== null) {
|
|
172
|
-
value = stored;
|
|
173
|
-
break;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
if (value !== null) {
|
|
178
|
-
result[prov] = value;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
return result;
|
|
182
|
-
}
|
|
45
|
+
export { getConfiguredApiKeys, resolveApiKeys } from './api-keys.js';
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export interface DiffParseResult {
|
|
2
|
+
filePath?: string;
|
|
3
|
+
diffOriginal?: string;
|
|
4
|
+
diffUpdated?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function parseDiffForApply(diffText: string): DiffParseResult;
|
|
3
7
|
export declare function applyDiffContent(fileContent: string, original: string, updated: string): {
|
|
4
8
|
ok: true;
|
|
5
9
|
content: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation-diff.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/core/conversation-diff.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"conversation-diff.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/core/conversation-diff.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,CAkCnE;AAED,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GACd;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAY9D"}
|
|
@@ -36,12 +36,8 @@ export type ConversationMessageSnapshot = {
|
|
|
36
36
|
type Message = ConversationMessageSnapshot;
|
|
37
37
|
export type ConversationTitleSource = 'system' | 'user';
|
|
38
38
|
export interface BlockMeta {
|
|
39
|
-
blockIndex: number;
|
|
40
39
|
type: 'tool' | 'code' | 'diff' | 'thinking';
|
|
41
|
-
startLine: number;
|
|
42
|
-
lineCount: number;
|
|
43
40
|
rawContent: string;
|
|
44
|
-
collapseKey: string;
|
|
45
41
|
filePath?: string;
|
|
46
42
|
diffOriginal?: string;
|
|
47
43
|
diffUpdated?: string;
|
|
@@ -55,7 +51,8 @@ export declare class ConversationManager {
|
|
|
55
51
|
private branches;
|
|
56
52
|
private currentBranch;
|
|
57
53
|
private streamingMessageIndex;
|
|
58
|
-
|
|
54
|
+
private undoStack;
|
|
55
|
+
constructor();
|
|
59
56
|
private findToolName;
|
|
60
57
|
setSessionMemoryStore(store: Pick<SessionMemoryStore, 'list'>): void;
|
|
61
58
|
getSessionMemoryStore(): Pick<SessionMemoryStore, 'list'> | null;
|
|
@@ -71,6 +68,17 @@ export declare class ConversationManager {
|
|
|
71
68
|
model?: string;
|
|
72
69
|
provider?: string;
|
|
73
70
|
}): void;
|
|
71
|
+
/**
|
|
72
|
+
* undo - Remove the last complete turn (the last user message and all subsequent
|
|
73
|
+
* non-user messages). Pushes the removed messages onto the undo stack.
|
|
74
|
+
* Returns true if a turn was removed, false if there was nothing to undo.
|
|
75
|
+
*/
|
|
76
|
+
undo(): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* redo - Restore the most recently undone turn.
|
|
79
|
+
* Returns true if a turn was restored, false if the undo stack is empty.
|
|
80
|
+
*/
|
|
81
|
+
redo(): boolean;
|
|
74
82
|
addToolResults(results: ToolResult[]): void;
|
|
75
83
|
addSystemMessage(content: string): void;
|
|
76
84
|
getLastUserMessage(): string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/core/conversation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AACvF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AAC7F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAC;AAYjG,MAAM,MAAM,UAAU,GAAG;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAA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AQ,CAAC,IAAI,EAAE;QACpB,QAAQ,EAAE,OAAO,EAAE,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;QACrC,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,uBAAuB,CAAC;KACvC,GAAG,IAAI;CAUT;AAED,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -13,7 +13,8 @@ export class ConversationManager {
|
|
|
13
13
|
branches = new Map();
|
|
14
14
|
currentBranch = 'main';
|
|
15
15
|
streamingMessageIndex = -1;
|
|
16
|
-
|
|
16
|
+
undoStack = [];
|
|
17
|
+
constructor() { }
|
|
17
18
|
findToolName(callId) {
|
|
18
19
|
for (let i = this.messages.length - 1; i >= 0; i--) {
|
|
19
20
|
const message = this.messages[i];
|
|
@@ -68,6 +69,8 @@ export class ConversationManager {
|
|
|
68
69
|
this.setSystemTitle(deriveConversationTitle(content));
|
|
69
70
|
}
|
|
70
71
|
this.messages.push({ role: 'user', content });
|
|
72
|
+
// Clear undo stack when new user input is added (can't redo past new input)
|
|
73
|
+
this.undoStack = [];
|
|
71
74
|
}
|
|
72
75
|
addAssistantMessage(content, opts) {
|
|
73
76
|
this.messages.push({
|
|
@@ -81,6 +84,36 @@ export class ConversationManager {
|
|
|
81
84
|
provider: opts?.provider,
|
|
82
85
|
});
|
|
83
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* undo - Remove the last complete turn (the last user message and all subsequent
|
|
89
|
+
* non-user messages). Pushes the removed messages onto the undo stack.
|
|
90
|
+
* Returns true if a turn was removed, false if there was nothing to undo.
|
|
91
|
+
*/
|
|
92
|
+
undo() {
|
|
93
|
+
let lastUserIdx = -1;
|
|
94
|
+
for (let i = this.messages.length - 1; i >= 0; i--) {
|
|
95
|
+
if (this.messages[i].role === 'user') {
|
|
96
|
+
lastUserIdx = i;
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
if (lastUserIdx === -1)
|
|
101
|
+
return false;
|
|
102
|
+
const turn = this.messages.splice(lastUserIdx);
|
|
103
|
+
this.undoStack.push(turn);
|
|
104
|
+
return true;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* redo - Restore the most recently undone turn.
|
|
108
|
+
* Returns true if a turn was restored, false if the undo stack is empty.
|
|
109
|
+
*/
|
|
110
|
+
redo() {
|
|
111
|
+
if (this.undoStack.length === 0)
|
|
112
|
+
return false;
|
|
113
|
+
const turn = this.undoStack.pop();
|
|
114
|
+
this.messages.push(...turn);
|
|
115
|
+
return true;
|
|
116
|
+
}
|
|
84
117
|
addToolResults(results) {
|
|
85
118
|
for (const result of results) {
|
|
86
119
|
const content = result.success
|
|
@@ -178,6 +211,7 @@ export class ConversationManager {
|
|
|
178
211
|
this.branches.clear();
|
|
179
212
|
this.currentBranch = 'main';
|
|
180
213
|
this.streamingMessageIndex = -1;
|
|
214
|
+
this.undoStack = [];
|
|
181
215
|
}
|
|
182
216
|
forkBranch(name, force = false) {
|
|
183
217
|
const branchName = name?.trim() || `branch-${Date.now()}`;
|
|
@@ -12,6 +12,10 @@ import type { WebSearchProviderRegistry } from '../web-search/index.js';
|
|
|
12
12
|
export interface PluginPathOptions {
|
|
13
13
|
readonly cwd: string;
|
|
14
14
|
readonly homeDir: string;
|
|
15
|
+
/** Additional plugin directories to search, appended after the standard directories. */
|
|
16
|
+
readonly additionalDirectories?: readonly string[];
|
|
17
|
+
/** Default entry point filename when a plugin manifest does not specify `main`. Defaults to 'index.js'. */
|
|
18
|
+
readonly entryDefault?: string;
|
|
15
19
|
}
|
|
16
20
|
/**
|
|
17
21
|
* Plugin search directories in precedence order.
|
|
@@ -93,7 +97,7 @@ export interface PluginLoaderDeps {
|
|
|
93
97
|
* @param cacheBust - Optional timestamp suffix appended to the import URL to bypass
|
|
94
98
|
* Bun's module cache. Pass `Date.now()` on reload to force fresh execution.
|
|
95
99
|
*/
|
|
96
|
-
export declare function loadPlugin(discovered: DiscoveredPlugin, deps: PluginLoaderDeps, cacheBust?: number): Promise<LoadedPlugin | null>;
|
|
100
|
+
export declare function loadPlugin(discovered: DiscoveredPlugin, deps: PluginLoaderDeps, cacheBust?: number, entryDefault?: string): Promise<LoadedPlugin | null>;
|
|
97
101
|
/**
|
|
98
102
|
* unloadPlugin — Deactivate a plugin and run all cleanup callbacks.
|
|
99
103
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/plugins/loader.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAyB,MAAM,UAAU,CAAC;AAClE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AACzF,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AACxF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAGxE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"loader.d.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qB,EAAE,qBAAqB,CAAC;IAC7C,uBAAuB,EAAE,+BAA+B,CAAC;IACzD,qBAAqB,EAAE,qBAAqB,CAAC;IAC7C,qBAAqB,EAAE,qBAAqB,CAAC;IAC7C,yBAAyB,EAAE,yBAAyB,CAAC;IACrD,0DAA0D;IAC1D,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvD,+DAA+D;IAC/D,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CAClC;AAED;;;;;;GAMG;AACH,wBAAsB,UAAU,CAC9B,UAAU,EAAE,gBAAgB,EAC5B,IAAI,EAAE,gBAAgB,EACtB,SAAS,CAAC,EAAE,MAAM,EAClB,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CA8F9B;AAED;;GAEG;AACH,wBAAsB,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAiBtE"}
|
|
@@ -12,10 +12,14 @@ export function getUserPluginDirectory(options) {
|
|
|
12
12
|
return join(options.homeDir, '.goodvibes', PLUGIN_ROOT);
|
|
13
13
|
}
|
|
14
14
|
export function getPluginDirectories(options) {
|
|
15
|
-
|
|
15
|
+
const dirs = [
|
|
16
16
|
join(options.cwd, '.goodvibes', PLUGIN_ROOT),
|
|
17
17
|
getUserPluginDirectory(options),
|
|
18
18
|
];
|
|
19
|
+
if (options.additionalDirectories) {
|
|
20
|
+
dirs.push(...options.additionalDirectories);
|
|
21
|
+
}
|
|
22
|
+
return dirs;
|
|
19
23
|
}
|
|
20
24
|
/**
|
|
21
25
|
* discoverPlugins — Scan the configured plugin directories for valid plugin folders.
|
|
@@ -88,9 +92,9 @@ export function discoverPlugins(options) {
|
|
|
88
92
|
* @param cacheBust - Optional timestamp suffix appended to the import URL to bypass
|
|
89
93
|
* Bun's module cache. Pass `Date.now()` on reload to force fresh execution.
|
|
90
94
|
*/
|
|
91
|
-
export async function loadPlugin(discovered, deps, cacheBust) {
|
|
95
|
+
export async function loadPlugin(discovered, deps, cacheBust, entryDefault) {
|
|
92
96
|
const { manifest, pluginDir } = discovered;
|
|
93
|
-
const entryFile = manifest.main ?? 'index.js';
|
|
97
|
+
const entryFile = manifest.main ?? entryDefault ?? 'index.js';
|
|
94
98
|
const entryPath = join(pluginDir, entryFile);
|
|
95
99
|
// Path traversal guard: resolved entry must remain within pluginDir
|
|
96
100
|
const resolvedEntry = resolve(entryPath);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HookDispatcher } from '../hooks/index.js';
|
|
2
|
+
import type { MutableRuntimeState } from './mutable-runtime-state.js';
|
|
3
|
+
import type { RuntimeEventBus } from './events/index.js';
|
|
4
|
+
export interface HookBridgeRegistrationOptions {
|
|
5
|
+
readonly runtimeBus: RuntimeEventBus;
|
|
6
|
+
readonly hookDispatcher: HookDispatcher;
|
|
7
|
+
readonly runtime: MutableRuntimeState;
|
|
8
|
+
}
|
|
9
|
+
export declare function registerBootstrapHookBridge(options: HookBridgeRegistrationOptions): Array<() => void>;
|
|
10
|
+
//# sourceMappingURL=bootstrap-hook-bridge.d.ts.map
|