@pellux/goodvibes-agent 1.6.4 → 1.7.0
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 +10 -0
- package/README.md +1 -1
- package/dist/package/main.js +954 -786
- package/docs/README.md +1 -1
- package/package.json +2 -2
- package/src/version.ts +1 -1
package/dist/package/main.js
CHANGED
|
@@ -4463,7 +4463,7 @@ var init_mcp = __esm(() => {
|
|
|
4463
4463
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/version.js
|
|
4464
4464
|
import { readFileSync as readFileSync3 } from "fs";
|
|
4465
4465
|
import { join as join4 } from "path";
|
|
4466
|
-
var version = "1.
|
|
4466
|
+
var version = "1.5.0", VERSION2;
|
|
4467
4467
|
var init_version = __esm(() => {
|
|
4468
4468
|
try {
|
|
4469
4469
|
const pkg = JSON.parse(readFileSync3(join4(import.meta.dir, "..", "..", "package.json"), "utf-8"));
|
|
@@ -6025,6 +6025,93 @@ function isRecord2(value) {
|
|
|
6025
6025
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6026
6026
|
}
|
|
6027
6027
|
|
|
6028
|
+
// node_modules/@pellux/goodvibes-sdk/dist/platform/providers/stop-reason-maps.js
|
|
6029
|
+
function mapAnthropicStopReason(raw) {
|
|
6030
|
+
if (!raw)
|
|
6031
|
+
return "unknown";
|
|
6032
|
+
return ANTHROPIC_STOP_REASON_MAP[raw] ?? "unknown";
|
|
6033
|
+
}
|
|
6034
|
+
function isContextOverflowSignal(stopReason, providerStopReason) {
|
|
6035
|
+
if (stopReason === "context_overflow")
|
|
6036
|
+
return true;
|
|
6037
|
+
return providerStopReason !== undefined && CONTEXT_OVERFLOW_RAW_STOP_REASONS.has(providerStopReason);
|
|
6038
|
+
}
|
|
6039
|
+
function mapOpenAIStopReason(raw) {
|
|
6040
|
+
if (!raw)
|
|
6041
|
+
return "unknown";
|
|
6042
|
+
return OPENAI_STOP_REASON_MAP[raw] ?? "unknown";
|
|
6043
|
+
}
|
|
6044
|
+
function mapGeminiStopReason(raw) {
|
|
6045
|
+
if (!raw)
|
|
6046
|
+
return "unknown";
|
|
6047
|
+
return GEMINI_STOP_REASON_MAP[raw] ?? "unknown";
|
|
6048
|
+
}
|
|
6049
|
+
function mapLlamaCppStopReason(finishReason, hasToolCalls) {
|
|
6050
|
+
if (hasToolCalls || finishReason === "tool_calls")
|
|
6051
|
+
return "tool_call";
|
|
6052
|
+
if (finishReason === "length")
|
|
6053
|
+
return "max_tokens";
|
|
6054
|
+
return "completed";
|
|
6055
|
+
}
|
|
6056
|
+
function mapOllamaStopReason(doneReason, hasToolCalls) {
|
|
6057
|
+
if (hasToolCalls || /tool/i.test(doneReason))
|
|
6058
|
+
return "tool_call";
|
|
6059
|
+
if (/length|max_tokens/i.test(doneReason))
|
|
6060
|
+
return "max_tokens";
|
|
6061
|
+
return "completed";
|
|
6062
|
+
}
|
|
6063
|
+
function mapCodexStopReason(status, hasToolCalls) {
|
|
6064
|
+
if (hasToolCalls && status === "completed")
|
|
6065
|
+
return "tool_call";
|
|
6066
|
+
if (status === "incomplete")
|
|
6067
|
+
return "max_tokens";
|
|
6068
|
+
if (status === "failed" || status === "cancelled")
|
|
6069
|
+
return "error";
|
|
6070
|
+
return "completed";
|
|
6071
|
+
}
|
|
6072
|
+
function mapLmStudioStopReason(status, hasToolCalls) {
|
|
6073
|
+
if (hasToolCalls && status === "completed")
|
|
6074
|
+
return "tool_call";
|
|
6075
|
+
if (status === "incomplete")
|
|
6076
|
+
return "max_tokens";
|
|
6077
|
+
if (status === "failed" || status === "cancelled")
|
|
6078
|
+
return "error";
|
|
6079
|
+
return "completed";
|
|
6080
|
+
}
|
|
6081
|
+
var ANTHROPIC_STOP_REASON_MAP, CONTEXT_OVERFLOW_RAW_STOP_REASONS, OPENAI_STOP_REASON_MAP, GEMINI_STOP_REASON_MAP;
|
|
6082
|
+
var init_stop_reason_maps = __esm(() => {
|
|
6083
|
+
ANTHROPIC_STOP_REASON_MAP = {
|
|
6084
|
+
end_turn: "completed",
|
|
6085
|
+
max_tokens: "max_tokens",
|
|
6086
|
+
tool_use: "tool_call",
|
|
6087
|
+
stop_sequence: "stop_sequence",
|
|
6088
|
+
model_context_window_exceeded: "context_overflow"
|
|
6089
|
+
};
|
|
6090
|
+
CONTEXT_OVERFLOW_RAW_STOP_REASONS = new Set([
|
|
6091
|
+
"model_context_window_exceeded",
|
|
6092
|
+
"context_length_exceeded",
|
|
6093
|
+
"context_window_exceeded"
|
|
6094
|
+
]);
|
|
6095
|
+
OPENAI_STOP_REASON_MAP = {
|
|
6096
|
+
stop: "completed",
|
|
6097
|
+
length: "max_tokens",
|
|
6098
|
+
tool_calls: "tool_call",
|
|
6099
|
+
content_filter: "content_filter",
|
|
6100
|
+
function_call: "tool_call"
|
|
6101
|
+
};
|
|
6102
|
+
GEMINI_STOP_REASON_MAP = {
|
|
6103
|
+
STOP: "completed",
|
|
6104
|
+
MAX_TOKENS: "max_tokens",
|
|
6105
|
+
SAFETY: "content_filter",
|
|
6106
|
+
RECITATION: "content_filter",
|
|
6107
|
+
OTHER: "unknown",
|
|
6108
|
+
BLOCKLIST: "content_filter",
|
|
6109
|
+
PROHIBITED_CONTENT: "content_filter",
|
|
6110
|
+
SPII: "content_filter",
|
|
6111
|
+
MALFORMED_FUNCTION_CALL: "unknown"
|
|
6112
|
+
};
|
|
6113
|
+
});
|
|
6114
|
+
|
|
6028
6115
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/providers/registry-helpers.js
|
|
6029
6116
|
function withRegistryKey(model) {
|
|
6030
6117
|
return model.registryKey ? model : { ...model, registryKey: `${model.provider}:${model.id}` };
|
|
@@ -264064,7 +264151,7 @@ var FOUNDATION_METADATA;
|
|
|
264064
264151
|
var init_foundation_metadata = __esm(() => {
|
|
264065
264152
|
FOUNDATION_METADATA = {
|
|
264066
264153
|
productId: "goodvibes",
|
|
264067
|
-
productVersion: "1.
|
|
264154
|
+
productVersion: "1.5.0",
|
|
264068
264155
|
operatorMethodCount: 329,
|
|
264069
264156
|
operatorEventCount: 31,
|
|
264070
264157
|
peerEndpointCount: 6
|
|
@@ -264079,7 +264166,7 @@ var init_operator_contract = __esm(() => {
|
|
|
264079
264166
|
product: {
|
|
264080
264167
|
id: "goodvibes",
|
|
264081
264168
|
surface: "operator",
|
|
264082
|
-
version: "1.
|
|
264169
|
+
version: "1.5.0"
|
|
264083
264170
|
},
|
|
264084
264171
|
auth: {
|
|
264085
264172
|
modes: [
|
|
@@ -364984,6 +365071,19 @@ var init_session4 = __esm(() => {
|
|
|
364984
365071
|
});
|
|
364985
365072
|
|
|
364986
365073
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/agents/orchestrator-utils.js
|
|
365074
|
+
function maybeCompactAfterModelContextWarning(opts) {
|
|
365075
|
+
const { response, conversation, record: record2, turn: turn2 } = opts;
|
|
365076
|
+
if (!opts.contextWindowAwarenessEnabled)
|
|
365077
|
+
return false;
|
|
365078
|
+
if (!isContextOverflowSignal(response.stopReason, response.providerStopReason))
|
|
365079
|
+
return false;
|
|
365080
|
+
logger.warn(`[AgentOrchestrator] model reported context window exhaustion on turn ${turn2} - compacting immediately`, { agentId: record2.id, providerStopReason: response.providerStopReason });
|
|
365081
|
+
record2.progress = `Turn ${turn2} \xB7 Model reported full context, compacting\u2026`;
|
|
365082
|
+
opts.emitProgress(record2.progress);
|
|
365083
|
+
const messages = conversation.getMessagesForLLM();
|
|
365084
|
+
conversation.replaceMessagesForLLM(compactSmallWindow(messages, Math.max(5, Math.floor(messages.length / 3))));
|
|
365085
|
+
return true;
|
|
365086
|
+
}
|
|
364987
365087
|
function summarizeToolArgs(args2) {
|
|
364988
365088
|
for (const key of ["path", "file", "cmd", "pattern", "url", "query"]) {
|
|
364989
365089
|
const val = args2[key];
|
|
@@ -365000,6 +365100,11 @@ function summarizeToolArgs(args2) {
|
|
|
365000
365100
|
}
|
|
365001
365101
|
return "";
|
|
365002
365102
|
}
|
|
365103
|
+
var init_orchestrator_utils = __esm(() => {
|
|
365104
|
+
init_stop_reason_maps();
|
|
365105
|
+
init_context_compaction();
|
|
365106
|
+
init_logger();
|
|
365107
|
+
});
|
|
365003
365108
|
|
|
365004
365109
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/agents/orchestrator-prompts.js
|
|
365005
365110
|
import { existsSync as existsSync36, readFileSync as readFileSync40 } from "fs";
|
|
@@ -365820,6 +365925,17 @@ ${priorTurnKnowledgeBlock}`;
|
|
|
365820
365925
|
turnCount: (record2.usage?.turnCount ?? 0) + 1,
|
|
365821
365926
|
reasoningSummaryCount: (record2.usage?.reasoningSummaryCount ?? 0) + (response.reasoningSummary ? 1 : 0)
|
|
365822
365927
|
};
|
|
365928
|
+
maybeCompactAfterModelContextWarning({
|
|
365929
|
+
response,
|
|
365930
|
+
conversation,
|
|
365931
|
+
record: record2,
|
|
365932
|
+
turn: turn2,
|
|
365933
|
+
contextWindowAwarenessEnabled: context.featureFlagManager?.isEnabled("agent-context-window-awareness") ?? true,
|
|
365934
|
+
emitProgress: (progress) => {
|
|
365935
|
+
context.emitAgentProgress(record2.id, progress);
|
|
365936
|
+
context.emitOrchestrationProgress(record2, progress);
|
|
365937
|
+
}
|
|
365938
|
+
});
|
|
365823
365939
|
if (response.toolCalls.length > 0) {
|
|
365824
365940
|
conversation.addAssistantMessage(response.content, { toolCalls: response.toolCalls, usage: response.usage });
|
|
365825
365941
|
const results = await executeToolCalls2(response.toolCalls, toolRegistry, session2, turn2, record2, callHistory, CALL_HISTORY_WINDOW, context);
|
|
@@ -365888,6 +366004,7 @@ var init_orchestrator_runner = __esm(() => {
|
|
|
365888
366004
|
init_session4();
|
|
365889
366005
|
init_context_compaction();
|
|
365890
366006
|
init_emitters();
|
|
366007
|
+
init_orchestrator_utils();
|
|
365891
366008
|
init_orchestrator_prompts();
|
|
365892
366009
|
init_turn_knowledge_injection();
|
|
365893
366010
|
init_error_display();
|
|
@@ -379216,82 +379333,6 @@ function extractOpenAIStreamTextDelta(rawChunk, options = {}) {
|
|
|
379216
379333
|
return { content, reasoning };
|
|
379217
379334
|
}
|
|
379218
379335
|
|
|
379219
|
-
// node_modules/@pellux/goodvibes-sdk/dist/platform/providers/stop-reason-maps.js
|
|
379220
|
-
function mapAnthropicStopReason(raw) {
|
|
379221
|
-
if (!raw)
|
|
379222
|
-
return "unknown";
|
|
379223
|
-
return ANTHROPIC_STOP_REASON_MAP[raw] ?? "unknown";
|
|
379224
|
-
}
|
|
379225
|
-
function mapOpenAIStopReason(raw) {
|
|
379226
|
-
if (!raw)
|
|
379227
|
-
return "unknown";
|
|
379228
|
-
return OPENAI_STOP_REASON_MAP[raw] ?? "unknown";
|
|
379229
|
-
}
|
|
379230
|
-
function mapGeminiStopReason(raw) {
|
|
379231
|
-
if (!raw)
|
|
379232
|
-
return "unknown";
|
|
379233
|
-
return GEMINI_STOP_REASON_MAP[raw] ?? "unknown";
|
|
379234
|
-
}
|
|
379235
|
-
function mapLlamaCppStopReason(finishReason, hasToolCalls) {
|
|
379236
|
-
if (hasToolCalls || finishReason === "tool_calls")
|
|
379237
|
-
return "tool_call";
|
|
379238
|
-
if (finishReason === "length")
|
|
379239
|
-
return "max_tokens";
|
|
379240
|
-
return "completed";
|
|
379241
|
-
}
|
|
379242
|
-
function mapOllamaStopReason(doneReason, hasToolCalls) {
|
|
379243
|
-
if (hasToolCalls || /tool/i.test(doneReason))
|
|
379244
|
-
return "tool_call";
|
|
379245
|
-
if (/length|max_tokens/i.test(doneReason))
|
|
379246
|
-
return "max_tokens";
|
|
379247
|
-
return "completed";
|
|
379248
|
-
}
|
|
379249
|
-
function mapCodexStopReason(status, hasToolCalls) {
|
|
379250
|
-
if (hasToolCalls && status === "completed")
|
|
379251
|
-
return "tool_call";
|
|
379252
|
-
if (status === "incomplete")
|
|
379253
|
-
return "max_tokens";
|
|
379254
|
-
if (status === "failed" || status === "cancelled")
|
|
379255
|
-
return "error";
|
|
379256
|
-
return "completed";
|
|
379257
|
-
}
|
|
379258
|
-
function mapLmStudioStopReason(status, hasToolCalls) {
|
|
379259
|
-
if (hasToolCalls && status === "completed")
|
|
379260
|
-
return "tool_call";
|
|
379261
|
-
if (status === "incomplete")
|
|
379262
|
-
return "max_tokens";
|
|
379263
|
-
if (status === "failed" || status === "cancelled")
|
|
379264
|
-
return "error";
|
|
379265
|
-
return "completed";
|
|
379266
|
-
}
|
|
379267
|
-
var ANTHROPIC_STOP_REASON_MAP, OPENAI_STOP_REASON_MAP, GEMINI_STOP_REASON_MAP;
|
|
379268
|
-
var init_stop_reason_maps = __esm(() => {
|
|
379269
|
-
ANTHROPIC_STOP_REASON_MAP = {
|
|
379270
|
-
end_turn: "completed",
|
|
379271
|
-
max_tokens: "max_tokens",
|
|
379272
|
-
tool_use: "tool_call",
|
|
379273
|
-
stop_sequence: "stop_sequence"
|
|
379274
|
-
};
|
|
379275
|
-
OPENAI_STOP_REASON_MAP = {
|
|
379276
|
-
stop: "completed",
|
|
379277
|
-
length: "max_tokens",
|
|
379278
|
-
tool_calls: "tool_call",
|
|
379279
|
-
content_filter: "content_filter",
|
|
379280
|
-
function_call: "tool_call"
|
|
379281
|
-
};
|
|
379282
|
-
GEMINI_STOP_REASON_MAP = {
|
|
379283
|
-
STOP: "completed",
|
|
379284
|
-
MAX_TOKENS: "max_tokens",
|
|
379285
|
-
SAFETY: "content_filter",
|
|
379286
|
-
RECITATION: "content_filter",
|
|
379287
|
-
OTHER: "unknown",
|
|
379288
|
-
BLOCKLIST: "content_filter",
|
|
379289
|
-
PROHIBITED_CONTENT: "content_filter",
|
|
379290
|
-
SPII: "content_filter",
|
|
379291
|
-
MALFORMED_FUNCTION_CALL: "unknown"
|
|
379292
|
-
};
|
|
379293
|
-
});
|
|
379294
|
-
|
|
379295
379336
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/providers/runtime-metadata.js
|
|
379296
379337
|
var exports_runtime_metadata = {};
|
|
379297
379338
|
__export(exports_runtime_metadata, {
|
|
@@ -440066,6 +440107,102 @@ var init_model_limits = __esm(() => {
|
|
|
440066
440107
|
};
|
|
440067
440108
|
});
|
|
440068
440109
|
|
|
440110
|
+
// node_modules/@pellux/goodvibes-sdk/dist/platform/providers/context-window-overrides.js
|
|
440111
|
+
import { dirname as dirname37, join as join58 } from "path";
|
|
440112
|
+
import { mkdirSync as mkdirSync33, readFileSync as readFileSync48, writeFileSync as writeFileSync29 } from "fs";
|
|
440113
|
+
function getContextWindowOverridesPath(configDir) {
|
|
440114
|
+
return join58(configDir, "context-window-overrides.json");
|
|
440115
|
+
}
|
|
440116
|
+
function isValidContextWindowOverride(value) {
|
|
440117
|
+
return Number.isInteger(value) && value > 0 && value <= MAX_CONTEXT_WINDOW_OVERRIDE;
|
|
440118
|
+
}
|
|
440119
|
+
function loadContextWindowOverrides(filePath) {
|
|
440120
|
+
const overrides = new Map;
|
|
440121
|
+
let raw;
|
|
440122
|
+
try {
|
|
440123
|
+
raw = readFileSync48(filePath, "utf-8");
|
|
440124
|
+
} catch {
|
|
440125
|
+
return overrides;
|
|
440126
|
+
}
|
|
440127
|
+
try {
|
|
440128
|
+
const parsed = JSON.parse(raw);
|
|
440129
|
+
if (!parsed || parsed.version !== 1 || typeof parsed.overrides !== "object" || parsed.overrides === null) {
|
|
440130
|
+
logger.warn("[context-window-overrides] Ignoring malformed overrides file", { filePath });
|
|
440131
|
+
return overrides;
|
|
440132
|
+
}
|
|
440133
|
+
for (const [registryKey, value] of Object.entries(parsed.overrides)) {
|
|
440134
|
+
if (typeof value === "number" && isValidContextWindowOverride(value)) {
|
|
440135
|
+
overrides.set(registryKey, value);
|
|
440136
|
+
} else {
|
|
440137
|
+
logger.warn("[context-window-overrides] Dropping invalid override entry", { registryKey, value });
|
|
440138
|
+
}
|
|
440139
|
+
}
|
|
440140
|
+
} catch (error51) {
|
|
440141
|
+
logger.warn("[context-window-overrides] Failed to parse overrides file", {
|
|
440142
|
+
filePath,
|
|
440143
|
+
error: summarizeError(error51)
|
|
440144
|
+
});
|
|
440145
|
+
}
|
|
440146
|
+
return overrides;
|
|
440147
|
+
}
|
|
440148
|
+
|
|
440149
|
+
class ContextWindowOverrideStore {
|
|
440150
|
+
filePath;
|
|
440151
|
+
overrides = null;
|
|
440152
|
+
constructor(filePath) {
|
|
440153
|
+
this.filePath = filePath;
|
|
440154
|
+
}
|
|
440155
|
+
load() {
|
|
440156
|
+
this.overrides ??= loadContextWindowOverrides(this.filePath);
|
|
440157
|
+
return this.overrides;
|
|
440158
|
+
}
|
|
440159
|
+
get(registryKey) {
|
|
440160
|
+
return this.load().get(registryKey) ?? null;
|
|
440161
|
+
}
|
|
440162
|
+
set(registryKey, cap) {
|
|
440163
|
+
if (!isValidContextWindowOverride(cap))
|
|
440164
|
+
return false;
|
|
440165
|
+
const overrides = this.load();
|
|
440166
|
+
overrides.set(registryKey, cap);
|
|
440167
|
+
saveContextWindowOverrides(this.filePath, overrides);
|
|
440168
|
+
return true;
|
|
440169
|
+
}
|
|
440170
|
+
clear(registryKey) {
|
|
440171
|
+
const overrides = this.load();
|
|
440172
|
+
const existed = overrides.delete(registryKey);
|
|
440173
|
+
if (existed)
|
|
440174
|
+
saveContextWindowOverrides(this.filePath, overrides);
|
|
440175
|
+
return existed;
|
|
440176
|
+
}
|
|
440177
|
+
apply(model) {
|
|
440178
|
+
const override = this.load().get(model.registryKey);
|
|
440179
|
+
if (override === undefined)
|
|
440180
|
+
return model;
|
|
440181
|
+
return { ...model, contextWindow: override, contextWindowProvenance: "configured_cap" };
|
|
440182
|
+
}
|
|
440183
|
+
}
|
|
440184
|
+
function saveContextWindowOverrides(filePath, overrides) {
|
|
440185
|
+
const file2 = {
|
|
440186
|
+
version: 1,
|
|
440187
|
+
overrides: Object.fromEntries([...overrides.entries()].sort(([a2], [b2]) => a2.localeCompare(b2)))
|
|
440188
|
+
};
|
|
440189
|
+
try {
|
|
440190
|
+
mkdirSync33(dirname37(filePath), { recursive: true });
|
|
440191
|
+
writeFileSync29(filePath, `${JSON.stringify(file2, null, 2)}
|
|
440192
|
+
`, "utf-8");
|
|
440193
|
+
} catch (error51) {
|
|
440194
|
+
logger.warn("[context-window-overrides] Failed to persist overrides", {
|
|
440195
|
+
filePath,
|
|
440196
|
+
error: summarizeError(error51)
|
|
440197
|
+
});
|
|
440198
|
+
}
|
|
440199
|
+
}
|
|
440200
|
+
var MAX_CONTEXT_WINDOW_OVERRIDE = 1e7;
|
|
440201
|
+
var init_context_window_overrides = __esm(() => {
|
|
440202
|
+
init_logger();
|
|
440203
|
+
init_error_display();
|
|
440204
|
+
});
|
|
440205
|
+
|
|
440069
440206
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/providers/registry-configured-ids.js
|
|
440070
440207
|
function computeConfiguredProviderIds(catalogModels, providers2, getSyntheticBackendModelIds2, loadConfiguredApiKeys = getConfiguredApiKeys) {
|
|
440071
440208
|
const configured = new Set;
|
|
@@ -440139,7 +440276,7 @@ var init_registry_catalog_lifecycle = __esm(() => {
|
|
|
440139
440276
|
});
|
|
440140
440277
|
|
|
440141
440278
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/providers/registry.js
|
|
440142
|
-
import { join as
|
|
440279
|
+
import { join as join59 } from "path";
|
|
440143
440280
|
|
|
440144
440281
|
class ProviderRegistry {
|
|
440145
440282
|
providers = new Map;
|
|
@@ -440168,6 +440305,7 @@ class ProviderRegistry {
|
|
|
440168
440305
|
syntheticCanonicalModels = [];
|
|
440169
440306
|
_cachedModelRegistry = null;
|
|
440170
440307
|
_modelRegistryRevision = 0;
|
|
440308
|
+
_contextWindowOverrideStore = null;
|
|
440171
440309
|
constructor(options) {
|
|
440172
440310
|
this.configManager = options.configManager;
|
|
440173
440311
|
this.subscriptionManager = options.subscriptionManager;
|
|
@@ -440213,7 +440351,7 @@ class ProviderRegistry {
|
|
|
440213
440351
|
return this.configManager.getControlPlaneConfigDir();
|
|
440214
440352
|
}
|
|
440215
440353
|
getCustomProvidersDir() {
|
|
440216
|
-
return
|
|
440354
|
+
return join59(this.getPersistenceRoot(), "providers");
|
|
440217
440355
|
}
|
|
440218
440356
|
getCatalogCachePaths() {
|
|
440219
440357
|
const cachePath = getCatalogCachePath(this.getPersistenceRoot());
|
|
@@ -440251,9 +440389,13 @@ class ProviderRegistry {
|
|
|
440251
440389
|
catalogModels: this.getCatalogBuiltins(),
|
|
440252
440390
|
discoveredModels: this.discoveredModels,
|
|
440253
440391
|
suppressedCatalogRegistryKeys: this.getSuppressedCatalogModelRegistryKeys()
|
|
440254
|
-
});
|
|
440392
|
+
}).map((model) => this.contextWindowOverrideStore().apply(model));
|
|
440255
440393
|
return this._cachedModelRegistry;
|
|
440256
440394
|
}
|
|
440395
|
+
contextWindowOverrideStore() {
|
|
440396
|
+
this._contextWindowOverrideStore ??= new ContextWindowOverrideStore(getContextWindowOverridesPath(this.getPersistenceRoot()));
|
|
440397
|
+
return this._contextWindowOverrideStore;
|
|
440398
|
+
}
|
|
440257
440399
|
register(provider5) {
|
|
440258
440400
|
this.providers.set(provider5.name, provider5);
|
|
440259
440401
|
this._invalidateModelRegistry();
|
|
@@ -440459,7 +440601,7 @@ class ProviderRegistry {
|
|
|
440459
440601
|
if (!provider5 || !provider5.models.includes(resolvedModelId))
|
|
440460
440602
|
return null;
|
|
440461
440603
|
const isFree = resolvedModelId.endsWith(":free") || resolvedModelId.endsWith("-free") || resolvedModelId.endsWith("/free");
|
|
440462
|
-
return {
|
|
440604
|
+
return this.contextWindowOverrideStore().apply({
|
|
440463
440605
|
id: resolvedModelId,
|
|
440464
440606
|
provider: providerId,
|
|
440465
440607
|
registryKey: `${providerId}:${resolvedModelId}`,
|
|
@@ -440470,30 +440612,23 @@ class ProviderRegistry {
|
|
|
440470
440612
|
contextWindowProvenance: "fallback",
|
|
440471
440613
|
selectable: true,
|
|
440472
440614
|
tier: isFree ? "free" : "standard"
|
|
440473
|
-
};
|
|
440615
|
+
});
|
|
440474
440616
|
}
|
|
440475
440617
|
setModelContextCap(registryKey, cap) {
|
|
440476
|
-
|
|
440477
|
-
|
|
440478
|
-
this.customModels[customIdx] = {
|
|
440479
|
-
...this.customModels[customIdx],
|
|
440480
|
-
contextWindow: cap,
|
|
440481
|
-
contextWindowProvenance: "configured_cap"
|
|
440482
|
-
};
|
|
440483
|
-
this._invalidateModelRegistry();
|
|
440618
|
+
if (!this.contextWindowOverrideStore().set(registryKey, cap)) {
|
|
440619
|
+
logger.warn("[registry] setModelContextCap: rejecting invalid cap", { registryKey, cap });
|
|
440484
440620
|
return;
|
|
440485
440621
|
}
|
|
440486
|
-
|
|
440487
|
-
|
|
440488
|
-
|
|
440489
|
-
|
|
440490
|
-
|
|
440491
|
-
contextWindowProvenance: "configured_cap"
|
|
440492
|
-
};
|
|
440622
|
+
this._invalidateModelRegistry();
|
|
440623
|
+
}
|
|
440624
|
+
clearModelContextCap(registryKey) {
|
|
440625
|
+
const existed = this.contextWindowOverrideStore().clear(registryKey);
|
|
440626
|
+
if (existed)
|
|
440493
440627
|
this._invalidateModelRegistry();
|
|
440494
|
-
|
|
440495
|
-
|
|
440496
|
-
|
|
440628
|
+
return existed;
|
|
440629
|
+
}
|
|
440630
|
+
getModelContextCap(registryKey) {
|
|
440631
|
+
return this.contextWindowOverrideStore().get(registryKey);
|
|
440497
440632
|
}
|
|
440498
440633
|
setCurrentModel(registryKey) {
|
|
440499
440634
|
if (!registryKey.includes(":")) {
|
|
@@ -440661,6 +440796,7 @@ var init_registry3 = __esm(() => {
|
|
|
440661
440796
|
init_local_context_ingestion();
|
|
440662
440797
|
init_model_limits();
|
|
440663
440798
|
init_github_copilot();
|
|
440799
|
+
init_context_window_overrides();
|
|
440664
440800
|
init_registry_configured_ids();
|
|
440665
440801
|
init_registry_catalog_lifecycle();
|
|
440666
440802
|
init_registry_models();
|
|
@@ -440668,9 +440804,9 @@ var init_registry3 = __esm(() => {
|
|
|
440668
440804
|
|
|
440669
440805
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/providers/favorites.js
|
|
440670
440806
|
import { randomUUID as randomUUID18 } from "crypto";
|
|
440671
|
-
import { mkdirSync as
|
|
440807
|
+
import { mkdirSync as mkdirSync34 } from "fs";
|
|
440672
440808
|
import { rename } from "fs/promises";
|
|
440673
|
-
import { join as
|
|
440809
|
+
import { join as join60 } from "path";
|
|
440674
440810
|
function emptyData() {
|
|
440675
440811
|
return { pinned: [], history: [] };
|
|
440676
440812
|
}
|
|
@@ -440750,7 +440886,7 @@ class FavoritesStore {
|
|
|
440750
440886
|
return this.dir;
|
|
440751
440887
|
}
|
|
440752
440888
|
getPath() {
|
|
440753
|
-
return
|
|
440889
|
+
return join60(this.dir, "favorites.json");
|
|
440754
440890
|
}
|
|
440755
440891
|
async load() {
|
|
440756
440892
|
const file2 = Bun.file(this.getPath());
|
|
@@ -440780,7 +440916,7 @@ class FavoritesStore {
|
|
|
440780
440916
|
}
|
|
440781
440917
|
}
|
|
440782
440918
|
async save(data) {
|
|
440783
|
-
|
|
440919
|
+
mkdirSync34(this.dir, { recursive: true });
|
|
440784
440920
|
const path5 = this.getPath();
|
|
440785
440921
|
const tmp = `${path5}.tmp.${randomUUID18()}`;
|
|
440786
440922
|
await Bun.write(tmp, JSON.stringify(data, null, 2));
|
|
@@ -442139,7 +442275,7 @@ var init_error_response = __esm(() => {
|
|
|
442139
442275
|
import { randomUUID as randomUUID19 } from "crypto";
|
|
442140
442276
|
import { mkdtemp, open, rm } from "fs/promises";
|
|
442141
442277
|
import { tmpdir as tmpdir3 } from "os";
|
|
442142
|
-
import { join as
|
|
442278
|
+
import { join as join64 } from "path";
|
|
442143
442279
|
function artifactUploadError(message, options = {}) {
|
|
442144
442280
|
return new GoodVibesSdkError(message, {
|
|
442145
442281
|
category: "bad_request",
|
|
@@ -442427,8 +442563,8 @@ async function spoolMultipartUpload(req, maxFileBytes) {
|
|
|
442427
442563
|
await drainUnreadBody(req.body);
|
|
442428
442564
|
throw artifactSizeError(maxFileBytes);
|
|
442429
442565
|
}
|
|
442430
|
-
const tempDir = await mkdtemp(
|
|
442431
|
-
const filePath =
|
|
442566
|
+
const tempDir = await mkdtemp(join64(tmpdir3(), "goodvibes-upload-"));
|
|
442567
|
+
const filePath = join64(tempDir, `${randomUUID19()}.upload`);
|
|
442432
442568
|
const fields = {};
|
|
442433
442569
|
const firstBoundary = Buffer.from(`--${boundary}`);
|
|
442434
442570
|
const bodyBoundary = Buffer.from(`\r
|
|
@@ -459608,12 +459744,12 @@ var init_session_broker = __esm(() => {
|
|
|
459608
459744
|
});
|
|
459609
459745
|
|
|
459610
459746
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/companion/companion-chat-persistence.js
|
|
459611
|
-
import { existsSync as existsSync46, mkdirSync as
|
|
459747
|
+
import { existsSync as existsSync46, mkdirSync as mkdirSync38, readdirSync as readdirSync15, renameSync as renameSync7 } from "fs";
|
|
459612
459748
|
import { promises as fs8 } from "fs";
|
|
459613
|
-
import { dirname as
|
|
459749
|
+
import { dirname as dirname41, join as join65 } from "path";
|
|
459614
459750
|
import { homedir as homedir2 } from "os";
|
|
459615
459751
|
function defaultSessionsDir(homeDirectory) {
|
|
459616
|
-
return
|
|
459752
|
+
return join65(homeDirectory ?? homedir2(), ".goodvibes", "companion-chat", "sessions");
|
|
459617
459753
|
}
|
|
459618
459754
|
|
|
459619
459755
|
class CompanionChatPersistence {
|
|
@@ -459622,10 +459758,10 @@ class CompanionChatPersistence {
|
|
|
459622
459758
|
this.sessionsDir = sessionsDir ?? defaultSessionsDir();
|
|
459623
459759
|
}
|
|
459624
459760
|
ensureDir() {
|
|
459625
|
-
|
|
459761
|
+
mkdirSync38(this.sessionsDir, { recursive: true });
|
|
459626
459762
|
}
|
|
459627
459763
|
filePath(sessionId) {
|
|
459628
|
-
return
|
|
459764
|
+
return join65(this.sessionsDir, `${sessionId}.json`);
|
|
459629
459765
|
}
|
|
459630
459766
|
async loadAll() {
|
|
459631
459767
|
const results = [];
|
|
@@ -459641,7 +459777,7 @@ class CompanionChatPersistence {
|
|
|
459641
459777
|
return results;
|
|
459642
459778
|
}
|
|
459643
459779
|
await Promise.all(entries.map(async (filename) => {
|
|
459644
|
-
const filePath =
|
|
459780
|
+
const filePath = join65(this.sessionsDir, filename);
|
|
459645
459781
|
try {
|
|
459646
459782
|
const raw = await fs8.readFile(filePath, "utf-8");
|
|
459647
459783
|
const parsed = JSON.parse(raw);
|
|
@@ -459662,7 +459798,7 @@ class CompanionChatPersistence {
|
|
|
459662
459798
|
const tmpPath = `${filePath}.tmp`;
|
|
459663
459799
|
try {
|
|
459664
459800
|
this.ensureDir();
|
|
459665
|
-
|
|
459801
|
+
mkdirSync38(dirname41(filePath), { recursive: true });
|
|
459666
459802
|
const content = JSON.stringify(session2, null, 2) + `
|
|
459667
459803
|
`;
|
|
459668
459804
|
await fs8.writeFile(tmpPath, content, "utf-8");
|
|
@@ -459709,12 +459845,12 @@ var init_companion_chat_persistence = __esm(() => {
|
|
|
459709
459845
|
|
|
459710
459846
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/control-plane/session-store-importer.js
|
|
459711
459847
|
import { existsSync as existsSync47, readdirSync as readdirSync16 } from "fs";
|
|
459712
|
-
import { join as
|
|
459848
|
+
import { join as join66 } from "path";
|
|
459713
459849
|
function discoverLegacySessionSources(input) {
|
|
459714
459850
|
const sources = [];
|
|
459715
459851
|
const companionDir = input.companionSessionsDir ?? defaultSessionsDir();
|
|
459716
459852
|
sources.push({ kind: "companion-dir", path: companionDir, project: "unknown" });
|
|
459717
|
-
const goodvibesRoot =
|
|
459853
|
+
const goodvibesRoot = join66(input.projectRoot, ".goodvibes");
|
|
459718
459854
|
let surfaceDirs = [];
|
|
459719
459855
|
try {
|
|
459720
459856
|
surfaceDirs = existsSync47(goodvibesRoot) ? readdirSync16(goodvibesRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name) : [];
|
|
@@ -459725,7 +459861,7 @@ function discoverLegacySessionSources(input) {
|
|
|
459725
459861
|
});
|
|
459726
459862
|
}
|
|
459727
459863
|
for (const surface of surfaceDirs) {
|
|
459728
|
-
const storePath =
|
|
459864
|
+
const storePath = join66(goodvibesRoot, surface, "control-plane", "sessions.json");
|
|
459729
459865
|
if (existsSync47(storePath)) {
|
|
459730
459866
|
sources.push({ kind: "broker-store", path: storePath, project: input.projectRoot });
|
|
459731
459867
|
}
|
|
@@ -464321,9 +464457,9 @@ https://example.com/research`
|
|
|
464321
464457
|
var init_connectors4 = () => {};
|
|
464322
464458
|
|
|
464323
464459
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/knowledge/store-schema.js
|
|
464324
|
-
import { join as
|
|
464460
|
+
import { join as join67 } from "path";
|
|
464325
464461
|
function resolveKnowledgeDbPathFromControlPlaneDir(controlPlaneDir, dbFileName = DEFAULT_KNOWLEDGE_DB_FILE) {
|
|
464326
|
-
return
|
|
464462
|
+
return join67(controlPlaneDir, dbFileName);
|
|
464327
464463
|
}
|
|
464328
464464
|
function nowMs() {
|
|
464329
464465
|
return Date.now();
|
|
@@ -465271,7 +465407,7 @@ var require_BufferList = __commonJS((exports, module2) => {
|
|
|
465271
465407
|
this.head = this.tail = null;
|
|
465272
465408
|
this.length = 0;
|
|
465273
465409
|
};
|
|
465274
|
-
BufferList.prototype.join = function
|
|
465410
|
+
BufferList.prototype.join = function join68(s2) {
|
|
465275
465411
|
if (this.length === 0)
|
|
465276
465412
|
return "";
|
|
465277
465413
|
var p2 = this.head;
|
|
@@ -563667,7 +563803,7 @@ var require_util4 = __commonJS((exports) => {
|
|
|
563667
563803
|
return path5;
|
|
563668
563804
|
});
|
|
563669
563805
|
exports.normalize = normalize4;
|
|
563670
|
-
function
|
|
563806
|
+
function join68(aRoot, aPath) {
|
|
563671
563807
|
if (aRoot === "") {
|
|
563672
563808
|
aRoot = ".";
|
|
563673
563809
|
}
|
|
@@ -563699,7 +563835,7 @@ var require_util4 = __commonJS((exports) => {
|
|
|
563699
563835
|
}
|
|
563700
563836
|
return joined;
|
|
563701
563837
|
}
|
|
563702
|
-
exports.join =
|
|
563838
|
+
exports.join = join68;
|
|
563703
563839
|
exports.isAbsolute = function(aPath) {
|
|
563704
563840
|
return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
|
|
563705
563841
|
};
|
|
@@ -563913,7 +564049,7 @@ var require_util4 = __commonJS((exports) => {
|
|
|
563913
564049
|
parsed.path = parsed.path.substring(0, index + 1);
|
|
563914
564050
|
}
|
|
563915
564051
|
}
|
|
563916
|
-
sourceURL =
|
|
564052
|
+
sourceURL = join68(urlGenerate(parsed), sourceURL);
|
|
563917
564053
|
}
|
|
563918
564054
|
return normalize4(sourceURL);
|
|
563919
564055
|
}
|
|
@@ -734143,10 +734279,10 @@ var require_FormData_impl = __commonJS((exports) => {
|
|
|
734143
734279
|
} else {
|
|
734144
734280
|
appendAnEntry(entryList, name51, field._getValue());
|
|
734145
734281
|
}
|
|
734146
|
-
const
|
|
734147
|
-
if (
|
|
734282
|
+
const dirname42 = field.getAttributeNS(null, "dirname");
|
|
734283
|
+
if (dirname42 !== null && dirname42 !== "") {
|
|
734148
734284
|
const dir = "ltr";
|
|
734149
|
-
appendAnEntry(entryList,
|
|
734285
|
+
appendAnEntry(entryList, dirname42, dir);
|
|
734150
734286
|
}
|
|
734151
734287
|
}
|
|
734152
734288
|
return entryList;
|
|
@@ -759052,7 +759188,7 @@ var init_pdf2 = __esm(() => {
|
|
|
759052
759188
|
var defineProperty = Object.defineProperty;
|
|
759053
759189
|
var stringSlice = uncurryThis("".slice);
|
|
759054
759190
|
var replace = uncurryThis("".replace);
|
|
759055
|
-
var
|
|
759191
|
+
var join68 = uncurryThis([].join);
|
|
759056
759192
|
var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function() {
|
|
759057
759193
|
return defineProperty(function() {}, "length", { value: 8 }).length !== 8;
|
|
759058
759194
|
});
|
|
@@ -759083,7 +759219,7 @@ var init_pdf2 = __esm(() => {
|
|
|
759083
759219
|
} catch (error51) {}
|
|
759084
759220
|
var state = enforceInternalState(value);
|
|
759085
759221
|
if (!hasOwn8(state, "source")) {
|
|
759086
|
-
state.source =
|
|
759222
|
+
state.source = join68(TEMPLATE, typeof name51 == "string" ? name51 : "");
|
|
759087
759223
|
}
|
|
759088
759224
|
return value;
|
|
759089
759225
|
};
|
|
@@ -761587,7 +761723,7 @@ var init_pdf2 = __esm(() => {
|
|
|
761587
761723
|
var anUint8Array = __webpack_require__(4154);
|
|
761588
761724
|
var notDetached = __webpack_require__(5169);
|
|
761589
761725
|
var numberToString = uncurryThis(1.1 .toString);
|
|
761590
|
-
var
|
|
761726
|
+
var join68 = uncurryThis([].join);
|
|
761591
761727
|
var $Array = Array;
|
|
761592
761728
|
var Uint8Array2 = globalThis2.Uint8Array;
|
|
761593
761729
|
var INCORRECT_BEHAVIOR_OR_DOESNT_EXISTS = !Uint8Array2 || !Uint8Array2.prototype.toHex || !function() {
|
|
@@ -761608,7 +761744,7 @@ var init_pdf2 = __esm(() => {
|
|
|
761608
761744
|
var hex6 = numberToString(this[i5], 16);
|
|
761609
761745
|
result[i5] = hex6.length === 1 ? "0" + hex6 : hex6;
|
|
761610
761746
|
}
|
|
761611
|
-
return
|
|
761747
|
+
return join68(result, "");
|
|
761612
761748
|
}
|
|
761613
761749
|
});
|
|
761614
761750
|
},
|
|
@@ -775527,7 +775663,7 @@ var init_paths2 = __esm(() => {
|
|
|
775527
775663
|
|
|
775528
775664
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/knowledge/browser-history/discover.js
|
|
775529
775665
|
import { access, readdir as readdir6, realpath } from "fs/promises";
|
|
775530
|
-
import { join as
|
|
775666
|
+
import { join as join68 } from "path";
|
|
775531
775667
|
async function pathExists(path6) {
|
|
775532
775668
|
try {
|
|
775533
775669
|
await access(path6);
|
|
@@ -775547,8 +775683,8 @@ async function matchingSubdirs(dir, pattern) {
|
|
|
775547
775683
|
}
|
|
775548
775684
|
async function buildProfile(browser, profilePath, profileName) {
|
|
775549
775685
|
const entry = getBrowserPathEntry(browser);
|
|
775550
|
-
const historyPath =
|
|
775551
|
-
const bookmarksPath =
|
|
775686
|
+
const historyPath = join68(profilePath, entry.historyFile);
|
|
775687
|
+
const bookmarksPath = join68(profilePath, entry.bookmarksFile);
|
|
775552
775688
|
const [historyExists, bookmarksExists] = await Promise.all([
|
|
775553
775689
|
pathExists(historyPath),
|
|
775554
775690
|
pathExists(bookmarksPath)
|
|
@@ -775589,7 +775725,7 @@ async function discoverBrowserKnowledgeProfiles(filter = {}) {
|
|
|
775589
775725
|
}
|
|
775590
775726
|
const names2 = await matchingSubdirs(root, profileRegex);
|
|
775591
775727
|
for (const profileName of names2) {
|
|
775592
|
-
const rawProfilePath =
|
|
775728
|
+
const rawProfilePath = join68(root, profileName);
|
|
775593
775729
|
let profilePath = rawProfilePath;
|
|
775594
775730
|
try {
|
|
775595
775731
|
profilePath = await realpath(rawProfilePath);
|
|
@@ -777293,7 +777429,7 @@ var require_bplistParser = __commonJS((exports) => {
|
|
|
777293
777429
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/knowledge/browser-history/locked-db.js
|
|
777294
777430
|
import { access as access2, copyFile, mkdtemp as mkdtemp2, rm as rm2 } from "fs/promises";
|
|
777295
777431
|
import { tmpdir as tmpdir4 } from "os";
|
|
777296
|
-
import { basename as basename4, join as
|
|
777432
|
+
import { basename as basename4, join as join69 } from "path";
|
|
777297
777433
|
async function exists2(path6) {
|
|
777298
777434
|
try {
|
|
777299
777435
|
await access2(path6);
|
|
@@ -777306,14 +777442,14 @@ async function copyLockedBrowserSqlite(sourcePath) {
|
|
|
777306
777442
|
if (!await exists2(sourcePath)) {
|
|
777307
777443
|
throw new Error(`Browser SQLite file does not exist: ${sourcePath}`);
|
|
777308
777444
|
}
|
|
777309
|
-
const tempDir = await mkdtemp2(
|
|
777445
|
+
const tempDir = await mkdtemp2(join69(tmpdir4(), "goodvibes-browser-db-"));
|
|
777310
777446
|
const baseName = basename4(sourcePath);
|
|
777311
|
-
const copiedDbPath =
|
|
777447
|
+
const copiedDbPath = join69(tempDir, baseName);
|
|
777312
777448
|
await copyFile(sourcePath, copiedDbPath);
|
|
777313
777449
|
for (const suffix of ["-wal", "-shm"]) {
|
|
777314
777450
|
const source = `${sourcePath}${suffix}`;
|
|
777315
777451
|
if (await exists2(source)) {
|
|
777316
|
-
await copyFile(source,
|
|
777452
|
+
await copyFile(source, join69(tempDir, `${baseName}${suffix}`));
|
|
777317
777453
|
}
|
|
777318
777454
|
}
|
|
777319
777455
|
let cleaned = false;
|
|
@@ -780588,13 +780724,13 @@ var init_visitor = __esm(() => {
|
|
|
780588
780724
|
function print(ast) {
|
|
780589
780725
|
return visit(ast, printDocASTReducer);
|
|
780590
780726
|
}
|
|
780591
|
-
function
|
|
780727
|
+
function join70(maybeArray, separator = "") {
|
|
780592
780728
|
var _maybeArray$filter$jo;
|
|
780593
780729
|
return (_maybeArray$filter$jo = maybeArray === null || maybeArray === undefined ? undefined : maybeArray.filter((x2) => x2).join(separator)) !== null && _maybeArray$filter$jo !== undefined ? _maybeArray$filter$jo : "";
|
|
780594
780730
|
}
|
|
780595
780731
|
function block(array2) {
|
|
780596
780732
|
return wrap(`{
|
|
780597
|
-
`, indent(
|
|
780733
|
+
`, indent(join70(array2, `
|
|
780598
780734
|
`)), `
|
|
780599
780735
|
}`);
|
|
780600
780736
|
}
|
|
@@ -780623,28 +780759,28 @@ var init_printer = __esm(() => {
|
|
|
780623
780759
|
leave: (node) => "$" + node.name
|
|
780624
780760
|
},
|
|
780625
780761
|
Document: {
|
|
780626
|
-
leave: (node) =>
|
|
780762
|
+
leave: (node) => join70(node.definitions, `
|
|
780627
780763
|
|
|
780628
780764
|
`)
|
|
780629
780765
|
},
|
|
780630
780766
|
OperationDefinition: {
|
|
780631
780767
|
leave(node) {
|
|
780632
780768
|
const varDefs = hasMultilineItems(node.variableDefinitions) ? wrap(`(
|
|
780633
|
-
`,
|
|
780769
|
+
`, join70(node.variableDefinitions, `
|
|
780634
780770
|
`), `
|
|
780635
|
-
)`) : wrap("(",
|
|
780771
|
+
)`) : wrap("(", join70(node.variableDefinitions, ", "), ")");
|
|
780636
780772
|
const prefix = wrap("", node.description, `
|
|
780637
|
-
`) +
|
|
780773
|
+
`) + join70([
|
|
780638
780774
|
node.operation,
|
|
780639
|
-
|
|
780640
|
-
|
|
780775
|
+
join70([node.name, varDefs]),
|
|
780776
|
+
join70(node.directives, " ")
|
|
780641
780777
|
], " ");
|
|
780642
780778
|
return (prefix === "query" ? "" : prefix + " ") + node.selectionSet;
|
|
780643
780779
|
}
|
|
780644
780780
|
},
|
|
780645
780781
|
VariableDefinition: {
|
|
780646
780782
|
leave: ({ variable, type, defaultValue, directives, description }) => wrap("", description, `
|
|
780647
|
-
`) + variable + ": " + type + wrap(" = ", defaultValue) + wrap(" ",
|
|
780783
|
+
`) + variable + ": " + type + wrap(" = ", defaultValue) + wrap(" ", join70(directives, " "))
|
|
780648
780784
|
},
|
|
780649
780785
|
SelectionSet: {
|
|
780650
780786
|
leave: ({ selections }) => block(selections)
|
|
@@ -780652,27 +780788,27 @@ var init_printer = __esm(() => {
|
|
|
780652
780788
|
Field: {
|
|
780653
780789
|
leave({ alias, name: name51, arguments: args2, directives, selectionSet }) {
|
|
780654
780790
|
const prefix = wrap("", alias, ": ") + name51;
|
|
780655
|
-
let argsLine = prefix + wrap("(",
|
|
780791
|
+
let argsLine = prefix + wrap("(", join70(args2, ", "), ")");
|
|
780656
780792
|
if (argsLine.length > MAX_LINE_LENGTH2) {
|
|
780657
780793
|
argsLine = prefix + wrap(`(
|
|
780658
|
-
`, indent(
|
|
780794
|
+
`, indent(join70(args2, `
|
|
780659
780795
|
`)), `
|
|
780660
780796
|
)`);
|
|
780661
780797
|
}
|
|
780662
|
-
return
|
|
780798
|
+
return join70([argsLine, join70(directives, " "), selectionSet], " ");
|
|
780663
780799
|
}
|
|
780664
780800
|
},
|
|
780665
780801
|
Argument: {
|
|
780666
780802
|
leave: ({ name: name51, value }) => name51 + ": " + value
|
|
780667
780803
|
},
|
|
780668
780804
|
FragmentSpread: {
|
|
780669
|
-
leave: ({ name: name51, directives }) => "..." + name51 + wrap(" ",
|
|
780805
|
+
leave: ({ name: name51, directives }) => "..." + name51 + wrap(" ", join70(directives, " "))
|
|
780670
780806
|
},
|
|
780671
780807
|
InlineFragment: {
|
|
780672
|
-
leave: ({ typeCondition, directives, selectionSet }) =>
|
|
780808
|
+
leave: ({ typeCondition, directives, selectionSet }) => join70([
|
|
780673
780809
|
"...",
|
|
780674
780810
|
wrap("on ", typeCondition),
|
|
780675
|
-
|
|
780811
|
+
join70(directives, " "),
|
|
780676
780812
|
selectionSet
|
|
780677
780813
|
], " ")
|
|
780678
780814
|
},
|
|
@@ -780685,7 +780821,7 @@ var init_printer = __esm(() => {
|
|
|
780685
780821
|
selectionSet,
|
|
780686
780822
|
description
|
|
780687
780823
|
}) => wrap("", description, `
|
|
780688
|
-
`) + `fragment ${name51}${wrap("(",
|
|
780824
|
+
`) + `fragment ${name51}${wrap("(", join70(variableDefinitions, ", "), ")")} ` + `on ${typeCondition} ${wrap("", join70(directives, " "), " ")}` + selectionSet
|
|
780689
780825
|
},
|
|
780690
780826
|
IntValue: {
|
|
780691
780827
|
leave: ({ value }) => value
|
|
@@ -780706,16 +780842,16 @@ var init_printer = __esm(() => {
|
|
|
780706
780842
|
leave: ({ value }) => value
|
|
780707
780843
|
},
|
|
780708
780844
|
ListValue: {
|
|
780709
|
-
leave: ({ values: values2 }) => "[" +
|
|
780845
|
+
leave: ({ values: values2 }) => "[" + join70(values2, ", ") + "]"
|
|
780710
780846
|
},
|
|
780711
780847
|
ObjectValue: {
|
|
780712
|
-
leave: ({ fields }) => "{" +
|
|
780848
|
+
leave: ({ fields }) => "{" + join70(fields, ", ") + "}"
|
|
780713
780849
|
},
|
|
780714
780850
|
ObjectField: {
|
|
780715
780851
|
leave: ({ name: name51, value }) => name51 + ": " + value
|
|
780716
780852
|
},
|
|
780717
780853
|
Directive: {
|
|
780718
|
-
leave: ({ name: name51, arguments: args2 }) => "@" + name51 + wrap("(",
|
|
780854
|
+
leave: ({ name: name51, arguments: args2 }) => "@" + name51 + wrap("(", join70(args2, ", "), ")")
|
|
780719
780855
|
},
|
|
780720
780856
|
NamedType: {
|
|
780721
780857
|
leave: ({ name: name51 }) => name51
|
|
@@ -780728,121 +780864,121 @@ var init_printer = __esm(() => {
|
|
|
780728
780864
|
},
|
|
780729
780865
|
SchemaDefinition: {
|
|
780730
780866
|
leave: ({ description, directives, operationTypes }) => wrap("", description, `
|
|
780731
|
-
`) +
|
|
780867
|
+
`) + join70(["schema", join70(directives, " "), block(operationTypes)], " ")
|
|
780732
780868
|
},
|
|
780733
780869
|
OperationTypeDefinition: {
|
|
780734
780870
|
leave: ({ operation, type }) => operation + ": " + type
|
|
780735
780871
|
},
|
|
780736
780872
|
ScalarTypeDefinition: {
|
|
780737
780873
|
leave: ({ description, name: name51, directives }) => wrap("", description, `
|
|
780738
|
-
`) +
|
|
780874
|
+
`) + join70(["scalar", name51, join70(directives, " ")], " ")
|
|
780739
780875
|
},
|
|
780740
780876
|
ObjectTypeDefinition: {
|
|
780741
780877
|
leave: ({ description, name: name51, interfaces, directives, fields }) => wrap("", description, `
|
|
780742
|
-
`) +
|
|
780878
|
+
`) + join70([
|
|
780743
780879
|
"type",
|
|
780744
780880
|
name51,
|
|
780745
|
-
wrap("implements ",
|
|
780746
|
-
|
|
780881
|
+
wrap("implements ", join70(interfaces, " & ")),
|
|
780882
|
+
join70(directives, " "),
|
|
780747
780883
|
block(fields)
|
|
780748
780884
|
], " ")
|
|
780749
780885
|
},
|
|
780750
780886
|
FieldDefinition: {
|
|
780751
780887
|
leave: ({ description, name: name51, arguments: args2, type, directives }) => wrap("", description, `
|
|
780752
780888
|
`) + name51 + (hasMultilineItems(args2) ? wrap(`(
|
|
780753
|
-
`, indent(
|
|
780889
|
+
`, indent(join70(args2, `
|
|
780754
780890
|
`)), `
|
|
780755
|
-
)`) : wrap("(",
|
|
780891
|
+
)`) : wrap("(", join70(args2, ", "), ")")) + ": " + type + wrap(" ", join70(directives, " "))
|
|
780756
780892
|
},
|
|
780757
780893
|
InputValueDefinition: {
|
|
780758
780894
|
leave: ({ description, name: name51, type, defaultValue, directives }) => wrap("", description, `
|
|
780759
|
-
`) +
|
|
780895
|
+
`) + join70([name51 + ": " + type, wrap("= ", defaultValue), join70(directives, " ")], " ")
|
|
780760
780896
|
},
|
|
780761
780897
|
InterfaceTypeDefinition: {
|
|
780762
780898
|
leave: ({ description, name: name51, interfaces, directives, fields }) => wrap("", description, `
|
|
780763
|
-
`) +
|
|
780899
|
+
`) + join70([
|
|
780764
780900
|
"interface",
|
|
780765
780901
|
name51,
|
|
780766
|
-
wrap("implements ",
|
|
780767
|
-
|
|
780902
|
+
wrap("implements ", join70(interfaces, " & ")),
|
|
780903
|
+
join70(directives, " "),
|
|
780768
780904
|
block(fields)
|
|
780769
780905
|
], " ")
|
|
780770
780906
|
},
|
|
780771
780907
|
UnionTypeDefinition: {
|
|
780772
780908
|
leave: ({ description, name: name51, directives, types: types12 }) => wrap("", description, `
|
|
780773
|
-
`) +
|
|
780909
|
+
`) + join70(["union", name51, join70(directives, " "), wrap("= ", join70(types12, " | "))], " ")
|
|
780774
780910
|
},
|
|
780775
780911
|
EnumTypeDefinition: {
|
|
780776
780912
|
leave: ({ description, name: name51, directives, values: values2 }) => wrap("", description, `
|
|
780777
|
-
`) +
|
|
780913
|
+
`) + join70(["enum", name51, join70(directives, " "), block(values2)], " ")
|
|
780778
780914
|
},
|
|
780779
780915
|
EnumValueDefinition: {
|
|
780780
780916
|
leave: ({ description, name: name51, directives }) => wrap("", description, `
|
|
780781
|
-
`) +
|
|
780917
|
+
`) + join70([name51, join70(directives, " ")], " ")
|
|
780782
780918
|
},
|
|
780783
780919
|
InputObjectTypeDefinition: {
|
|
780784
780920
|
leave: ({ description, name: name51, directives, fields }) => wrap("", description, `
|
|
780785
|
-
`) +
|
|
780921
|
+
`) + join70(["input", name51, join70(directives, " "), block(fields)], " ")
|
|
780786
780922
|
},
|
|
780787
780923
|
DirectiveDefinition: {
|
|
780788
780924
|
leave: ({ description, name: name51, arguments: args2, repeatable, locations }) => wrap("", description, `
|
|
780789
780925
|
`) + "directive @" + name51 + (hasMultilineItems(args2) ? wrap(`(
|
|
780790
|
-
`, indent(
|
|
780926
|
+
`, indent(join70(args2, `
|
|
780791
780927
|
`)), `
|
|
780792
|
-
)`) : wrap("(",
|
|
780928
|
+
)`) : wrap("(", join70(args2, ", "), ")")) + (repeatable ? " repeatable" : "") + " on " + join70(locations, " | ")
|
|
780793
780929
|
},
|
|
780794
780930
|
SchemaExtension: {
|
|
780795
|
-
leave: ({ directives, operationTypes }) =>
|
|
780931
|
+
leave: ({ directives, operationTypes }) => join70(["extend schema", join70(directives, " "), block(operationTypes)], " ")
|
|
780796
780932
|
},
|
|
780797
780933
|
ScalarTypeExtension: {
|
|
780798
|
-
leave: ({ name: name51, directives }) =>
|
|
780934
|
+
leave: ({ name: name51, directives }) => join70(["extend scalar", name51, join70(directives, " ")], " ")
|
|
780799
780935
|
},
|
|
780800
780936
|
ObjectTypeExtension: {
|
|
780801
|
-
leave: ({ name: name51, interfaces, directives, fields }) =>
|
|
780937
|
+
leave: ({ name: name51, interfaces, directives, fields }) => join70([
|
|
780802
780938
|
"extend type",
|
|
780803
780939
|
name51,
|
|
780804
|
-
wrap("implements ",
|
|
780805
|
-
|
|
780940
|
+
wrap("implements ", join70(interfaces, " & ")),
|
|
780941
|
+
join70(directives, " "),
|
|
780806
780942
|
block(fields)
|
|
780807
780943
|
], " ")
|
|
780808
780944
|
},
|
|
780809
780945
|
InterfaceTypeExtension: {
|
|
780810
|
-
leave: ({ name: name51, interfaces, directives, fields }) =>
|
|
780946
|
+
leave: ({ name: name51, interfaces, directives, fields }) => join70([
|
|
780811
780947
|
"extend interface",
|
|
780812
780948
|
name51,
|
|
780813
|
-
wrap("implements ",
|
|
780814
|
-
|
|
780949
|
+
wrap("implements ", join70(interfaces, " & ")),
|
|
780950
|
+
join70(directives, " "),
|
|
780815
780951
|
block(fields)
|
|
780816
780952
|
], " ")
|
|
780817
780953
|
},
|
|
780818
780954
|
UnionTypeExtension: {
|
|
780819
|
-
leave: ({ name: name51, directives, types: types12 }) =>
|
|
780955
|
+
leave: ({ name: name51, directives, types: types12 }) => join70([
|
|
780820
780956
|
"extend union",
|
|
780821
780957
|
name51,
|
|
780822
|
-
|
|
780823
|
-
wrap("= ",
|
|
780958
|
+
join70(directives, " "),
|
|
780959
|
+
wrap("= ", join70(types12, " | "))
|
|
780824
780960
|
], " ")
|
|
780825
780961
|
},
|
|
780826
780962
|
EnumTypeExtension: {
|
|
780827
|
-
leave: ({ name: name51, directives, values: values2 }) =>
|
|
780963
|
+
leave: ({ name: name51, directives, values: values2 }) => join70(["extend enum", name51, join70(directives, " "), block(values2)], " ")
|
|
780828
780964
|
},
|
|
780829
780965
|
InputObjectTypeExtension: {
|
|
780830
|
-
leave: ({ name: name51, directives, fields }) =>
|
|
780966
|
+
leave: ({ name: name51, directives, fields }) => join70(["extend input", name51, join70(directives, " "), block(fields)], " ")
|
|
780831
780967
|
},
|
|
780832
780968
|
TypeCoordinate: {
|
|
780833
780969
|
leave: ({ name: name51 }) => name51
|
|
780834
780970
|
},
|
|
780835
780971
|
MemberCoordinate: {
|
|
780836
|
-
leave: ({ name: name51, memberName }) =>
|
|
780972
|
+
leave: ({ name: name51, memberName }) => join70([name51, wrap(".", memberName)])
|
|
780837
780973
|
},
|
|
780838
780974
|
ArgumentCoordinate: {
|
|
780839
|
-
leave: ({ name: name51, fieldName, argumentName }) =>
|
|
780975
|
+
leave: ({ name: name51, fieldName, argumentName }) => join70([name51, wrap(".", fieldName), wrap("(", argumentName, ":)")])
|
|
780840
780976
|
},
|
|
780841
780977
|
DirectiveCoordinate: {
|
|
780842
|
-
leave: ({ name: name51 }) =>
|
|
780978
|
+
leave: ({ name: name51 }) => join70(["@", name51])
|
|
780843
780979
|
},
|
|
780844
780980
|
DirectiveArgumentCoordinate: {
|
|
780845
|
-
leave: ({ name: name51, argumentName }) =>
|
|
780981
|
+
leave: ({ name: name51, argumentName }) => join70(["@", name51, wrap("(", argumentName, ":)")])
|
|
780846
780982
|
}
|
|
780847
780983
|
};
|
|
780848
780984
|
});
|
|
@@ -807699,19 +807835,19 @@ var init_knowledge2 = __esm(() => {
|
|
|
807699
807835
|
|
|
807700
807836
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/runtime/network/shared.js
|
|
807701
807837
|
import { existsSync as existsSync48, readdirSync as readdirSync17, statSync as statSync14 } from "fs";
|
|
807702
|
-
import { basename as basename6, dirname as
|
|
807838
|
+
import { basename as basename6, dirname as dirname42, extname as extname8, isAbsolute as isAbsolute9, join as join71, resolve as resolve29 } from "path";
|
|
807703
807839
|
function getGoodVibesRootDir(configManager) {
|
|
807704
807840
|
const configuredDir = configManager.getControlPlaneConfigDir();
|
|
807705
807841
|
return resolve29(configuredDir);
|
|
807706
807842
|
}
|
|
807707
807843
|
function getDefaultCertDirectory(configManager) {
|
|
807708
|
-
return
|
|
807844
|
+
return join71(getGoodVibesRootDir(configManager), "certs");
|
|
807709
807845
|
}
|
|
807710
807846
|
function getDefaultInboundCertPaths(configManager) {
|
|
807711
807847
|
const certDir = getDefaultCertDirectory(configManager);
|
|
807712
807848
|
return {
|
|
807713
|
-
certFile:
|
|
807714
|
-
keyFile:
|
|
807849
|
+
certFile: join71(certDir, "fullchain.pem"),
|
|
807850
|
+
keyFile: join71(certDir, "privkey.pem")
|
|
807715
807851
|
};
|
|
807716
807852
|
}
|
|
807717
807853
|
function resolvePathFromGoodVibesRoot(value, configManager) {
|
|
@@ -807723,7 +807859,7 @@ function resolvePathFromGoodVibesRoot(value, configManager) {
|
|
|
807723
807859
|
function readPemEntriesFromDirectory(path6) {
|
|
807724
807860
|
if (!existsSync48(path6))
|
|
807725
807861
|
return [];
|
|
807726
|
-
return readdirSync17(path6, { withFileTypes: true }).filter((entry) => entry.isFile() && PEM_EXTENSIONS.has(extname8(entry.name).toLowerCase())).map((entry) =>
|
|
807862
|
+
return readdirSync17(path6, { withFileTypes: true }).filter((entry) => entry.isFile() && PEM_EXTENSIONS.has(extname8(entry.name).toLowerCase())).map((entry) => join71(path6, entry.name)).sort((a4, b3) => a4.localeCompare(b3));
|
|
807727
807863
|
}
|
|
807728
807864
|
function isLocalHostname2(hostname4) {
|
|
807729
807865
|
const normalized = hostname4.trim().toLowerCase();
|
|
@@ -807841,7 +807977,7 @@ var init_inbound = __esm(() => {
|
|
|
807841
807977
|
});
|
|
807842
807978
|
|
|
807843
807979
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/runtime/network/outbound.js
|
|
807844
|
-
import { existsSync as existsSync50, readFileSync as
|
|
807980
|
+
import { existsSync as existsSync50, readFileSync as readFileSync52 } from "fs";
|
|
807845
807981
|
import { rootCertificates } from "tls";
|
|
807846
807982
|
import * as tls from "tls";
|
|
807847
807983
|
function readMode2(configManager) {
|
|
@@ -807863,7 +807999,7 @@ function loadCustomCaEntries(configManager) {
|
|
|
807863
807999
|
const customCaDir = readCustomCaDir(configManager);
|
|
807864
808000
|
if (customCaFile) {
|
|
807865
808001
|
if (existsSync50(customCaFile)) {
|
|
807866
|
-
entries.push(
|
|
808002
|
+
entries.push(readFileSync52(customCaFile, "utf-8"));
|
|
807867
808003
|
} else {
|
|
807868
808004
|
errors4.push(`Custom CA file not found: ${customCaFile}`);
|
|
807869
808005
|
}
|
|
@@ -807871,7 +808007,7 @@ function loadCustomCaEntries(configManager) {
|
|
|
807871
808007
|
if (customCaDir) {
|
|
807872
808008
|
if (existsSync50(customCaDir)) {
|
|
807873
808009
|
for (const path6 of readPemEntriesFromDirectory(customCaDir)) {
|
|
807874
|
-
entries.push(
|
|
808010
|
+
entries.push(readFileSync52(path6, "utf-8"));
|
|
807875
808011
|
}
|
|
807876
808012
|
} else {
|
|
807877
808013
|
errors4.push(`Custom CA directory not found: ${customCaDir}`);
|
|
@@ -814028,7 +814164,7 @@ var init_types17 = __esm(() => {
|
|
|
814028
814164
|
});
|
|
814029
814165
|
|
|
814030
814166
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/batch/manager.js
|
|
814031
|
-
import { join as
|
|
814167
|
+
import { join as join72 } from "path";
|
|
814032
814168
|
function now3() {
|
|
814033
814169
|
return Date.now();
|
|
814034
814170
|
}
|
|
@@ -814085,7 +814221,7 @@ class DaemonBatchManager {
|
|
|
814085
814221
|
ticking = null;
|
|
814086
814222
|
constructor(options) {
|
|
814087
814223
|
this.options = options;
|
|
814088
|
-
this.store = new PersistentStore2(options.storePath ??
|
|
814224
|
+
this.store = new PersistentStore2(options.storePath ?? join72(options.configManager.getControlPlaneConfigDir(), "batch-jobs.json"));
|
|
814089
814225
|
}
|
|
814090
814226
|
start() {
|
|
814091
814227
|
if (this.interval !== null)
|
|
@@ -818100,8 +818236,8 @@ var init_companion_chat_manager = __esm(() => {
|
|
|
818100
818236
|
});
|
|
818101
818237
|
|
|
818102
818238
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/watchers/store.js
|
|
818103
|
-
import { existsSync as existsSync51, mkdirSync as
|
|
818104
|
-
import { dirname as
|
|
818239
|
+
import { existsSync as existsSync51, mkdirSync as mkdirSync39, readFileSync as readFileSync53, writeFileSync as writeFileSync33 } from "fs";
|
|
818240
|
+
import { dirname as dirname43 } from "path";
|
|
818105
818241
|
function sortWatchers(watchers2) {
|
|
818106
818242
|
return [...watchers2].sort((a4, b3) => a4.label.localeCompare(b3.label) || a4.id.localeCompare(b3.id));
|
|
818107
818243
|
}
|
|
@@ -818114,7 +818250,7 @@ function resolveWatcherStorePath(storePath) {
|
|
|
818114
818250
|
function loadWatcherSnapshotFromPath(storePath) {
|
|
818115
818251
|
if (!existsSync51(storePath))
|
|
818116
818252
|
return null;
|
|
818117
|
-
const raw =
|
|
818253
|
+
const raw = readFileSync53(storePath, "utf-8");
|
|
818118
818254
|
const parsed = JSON.parse(raw);
|
|
818119
818255
|
if (!parsed || parsed.version !== 1 || !Array.isArray(parsed.watchers)) {
|
|
818120
818256
|
throw new Error(`Watcher store snapshot is malformed: ${storePath}`);
|
|
@@ -818129,12 +818265,12 @@ function loadWatcherSnapshotFromPath(storePath) {
|
|
|
818129
818265
|
};
|
|
818130
818266
|
}
|
|
818131
818267
|
function saveWatcherSnapshotToPath(watchers2, storePath) {
|
|
818132
|
-
|
|
818268
|
+
mkdirSync39(dirname43(storePath), { recursive: true });
|
|
818133
818269
|
const snapshot = {
|
|
818134
818270
|
version: 1,
|
|
818135
818271
|
watchers: sortWatchers(watchers2)
|
|
818136
818272
|
};
|
|
818137
|
-
|
|
818273
|
+
writeFileSync33(storePath, `${JSON.stringify(snapshot, null, 2)}
|
|
818138
818274
|
`, "utf-8");
|
|
818139
818275
|
}
|
|
818140
818276
|
var init_store4 = () => {};
|
|
@@ -819424,8 +819560,8 @@ function createComfyProvider() {
|
|
|
819424
819560
|
const workflowPath = trimString(options["workflowPath"]);
|
|
819425
819561
|
if (!workflowPath)
|
|
819426
819562
|
throw new Error("Comfy generation requires options.workflow or options.workflowPath.");
|
|
819427
|
-
const { readFileSync:
|
|
819428
|
-
workflow = JSON.parse(
|
|
819563
|
+
const { readFileSync: readFileSync54 } = await import("fs");
|
|
819564
|
+
workflow = JSON.parse(readFileSync54(workflowPath, "utf-8"));
|
|
819429
819565
|
}
|
|
819430
819566
|
const reference = resolveReferenceArtifact(request2);
|
|
819431
819567
|
if (reference && trimString(options["inputImageNodeId"]) && reference.dataBase64) {
|
|
@@ -820640,9 +820776,9 @@ Path:ssml\r
|
|
|
820640
820776
|
});
|
|
820641
820777
|
|
|
820642
820778
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/voice/providers/microsoft.js
|
|
820643
|
-
import { mkdtempSync, readFileSync as
|
|
820779
|
+
import { mkdtempSync, readFileSync as readFileSync54, rmSync as rmSync5 } from "fs";
|
|
820644
820780
|
import { tmpdir as tmpdir5 } from "os";
|
|
820645
|
-
import { join as
|
|
820781
|
+
import { join as join73 } from "path";
|
|
820646
820782
|
function buildMicrosoftVoiceHeaders() {
|
|
820647
820783
|
const major = import_drm.CHROMIUM_FULL_VERSION.split(".")[0] || "0";
|
|
820648
820784
|
return {
|
|
@@ -820684,8 +820820,8 @@ function createMicrosoftProvider() {
|
|
|
820684
820820
|
async synthesize(request2) {
|
|
820685
820821
|
const outputFormat = request2.format === "wav" ? "riff-24khz-16bit-mono-pcm" : "audio-24khz-48kbitrate-mono-mp3";
|
|
820686
820822
|
const ext = inferExtFromOutputFormat(outputFormat);
|
|
820687
|
-
const dir = mkdtempSync(
|
|
820688
|
-
const outPath =
|
|
820823
|
+
const dir = mkdtempSync(join73(tmpdir5(), "gv-edge-tts-"));
|
|
820824
|
+
const outPath = join73(dir, `speech${ext}`);
|
|
820689
820825
|
try {
|
|
820690
820826
|
const tts = new import_node_edge_tts.EdgeTTS({
|
|
820691
820827
|
voice: request2.voiceId?.trim() || "en-US-MichelleNeural",
|
|
@@ -820694,7 +820830,7 @@ function createMicrosoftProvider() {
|
|
|
820694
820830
|
rate: typeof request2.speed === "number" && Number.isFinite(request2.speed) ? `${Math.round((request2.speed - 1) * 100)}%` : "default"
|
|
820695
820831
|
});
|
|
820696
820832
|
await tts.ttsPromise(request2.text, outPath);
|
|
820697
|
-
const buffer =
|
|
820833
|
+
const buffer = readFileSync54(outPath);
|
|
820698
820834
|
return {
|
|
820699
820835
|
providerId: "microsoft",
|
|
820700
820836
|
audio: {
|
|
@@ -822221,8 +822357,8 @@ var init_retention2 = __esm(() => {
|
|
|
822221
822357
|
});
|
|
822222
822358
|
|
|
822223
822359
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/workspace/checkpoint/side-git.js
|
|
822224
|
-
import { existsSync as existsSync53, mkdirSync as
|
|
822225
|
-
import { join as
|
|
822360
|
+
import { existsSync as existsSync53, mkdirSync as mkdirSync40, readFileSync as readFileSync55, writeFileSync as writeFileSync34 } from "fs";
|
|
822361
|
+
import { join as join74 } from "path";
|
|
822226
822362
|
function sanitizeGitEnv(env2) {
|
|
822227
822363
|
const sanitized = {};
|
|
822228
822364
|
for (const [key, value] of Object.entries(env2)) {
|
|
@@ -822251,9 +822387,9 @@ class SideGitRunner {
|
|
|
822251
822387
|
}
|
|
822252
822388
|
async init() {
|
|
822253
822389
|
if (!existsSync53(this.gitDir)) {
|
|
822254
|
-
|
|
822390
|
+
mkdirSync40(this.gitDir, { recursive: true });
|
|
822255
822391
|
}
|
|
822256
|
-
const alreadyInit = existsSync53(
|
|
822392
|
+
const alreadyInit = existsSync53(join74(this.gitDir, "HEAD"));
|
|
822257
822393
|
if (!alreadyInit) {
|
|
822258
822394
|
await this.git.raw(["init", "--quiet"]);
|
|
822259
822395
|
logger.debug("SideGitRunner.init: initialized side repo", { gitDir: this.gitDir });
|
|
@@ -822263,22 +822399,22 @@ class SideGitRunner {
|
|
|
822263
822399
|
this.ensureGoodvibesIgnored();
|
|
822264
822400
|
}
|
|
822265
822401
|
ensureGoodvibesIgnored() {
|
|
822266
|
-
const goodvibesDir =
|
|
822267
|
-
const ignorePath =
|
|
822402
|
+
const goodvibesDir = join74(this.workspaceRoot, ".goodvibes");
|
|
822403
|
+
const ignorePath = join74(goodvibesDir, ".gitignore");
|
|
822268
822404
|
if (!existsSync53(goodvibesDir)) {
|
|
822269
|
-
|
|
822405
|
+
mkdirSync40(goodvibesDir, { recursive: true });
|
|
822270
822406
|
}
|
|
822271
822407
|
try {
|
|
822272
822408
|
if (!existsSync53(ignorePath)) {
|
|
822273
|
-
|
|
822409
|
+
writeFileSync34(ignorePath, `*
|
|
822274
822410
|
`, "utf-8");
|
|
822275
822411
|
return;
|
|
822276
822412
|
}
|
|
822277
|
-
const existing =
|
|
822413
|
+
const existing = readFileSync55(ignorePath, "utf-8");
|
|
822278
822414
|
const hasIgnoreAll = existing.split(`
|
|
822279
822415
|
`).some((line) => line.trim() === "*");
|
|
822280
822416
|
if (!hasIgnoreAll) {
|
|
822281
|
-
|
|
822417
|
+
writeFileSync34(ignorePath, `${existing.replace(/\s*$/, "")}
|
|
822282
822418
|
*
|
|
822283
822419
|
`, "utf-8");
|
|
822284
822420
|
}
|
|
@@ -822379,7 +822515,7 @@ var init_side_git = __esm(() => {
|
|
|
822379
822515
|
import { randomUUID as randomUUID45 } from "crypto";
|
|
822380
822516
|
import { existsSync as existsSync54, rmSync as rmSync6 } from "fs";
|
|
822381
822517
|
import { stat as stat6 } from "fs/promises";
|
|
822382
|
-
import { join as
|
|
822518
|
+
import { join as join75 } from "path";
|
|
822383
822519
|
function generateCheckpointId(now5) {
|
|
822384
822520
|
const ts2 = now5().toString(36);
|
|
822385
822521
|
const rand = randomUUID45().slice(0, 8);
|
|
@@ -822474,12 +822610,12 @@ class WorkspaceCheckpointManager {
|
|
|
822474
822610
|
}
|
|
822475
822611
|
constructor(opts) {
|
|
822476
822612
|
this.workspaceRoot = opts.workspaceRoot;
|
|
822477
|
-
this.checkpointRootDir = opts.checkpointDir ??
|
|
822613
|
+
this.checkpointRootDir = opts.checkpointDir ?? join75(opts.workspaceRoot, ".goodvibes", "checkpoints");
|
|
822478
822614
|
this.sideGit = new SideGitRunner({
|
|
822479
822615
|
workspaceRoot: opts.workspaceRoot,
|
|
822480
|
-
gitDir:
|
|
822616
|
+
gitDir: join75(this.checkpointRootDir, "git")
|
|
822481
822617
|
});
|
|
822482
|
-
this.manifestStore = new JsonFileStore2(
|
|
822618
|
+
this.manifestStore = new JsonFileStore2(join75(this.checkpointRootDir, "index.json"));
|
|
822483
822619
|
this.now = opts.now ?? Date.now;
|
|
822484
822620
|
this.runtimeBus = opts.runtimeBus;
|
|
822485
822621
|
this.retentionPolicy = new RetentionPolicy(opts.retention, this.now, new WorkspaceCheckpointPruner(this.sideGit, (id) => this.checkpoints.delete(id)));
|
|
@@ -822660,7 +822796,7 @@ class WorkspaceCheckpointManager {
|
|
|
822660
822796
|
await this.sideGit.checkoutIndexAll();
|
|
822661
822797
|
for (const path7 of removedFiles) {
|
|
822662
822798
|
try {
|
|
822663
|
-
rmSync6(
|
|
822799
|
+
rmSync6(join75(this.workspaceRoot, path7), { force: true });
|
|
822664
822800
|
} catch (err2) {
|
|
822665
822801
|
logger.warn("WorkspaceCheckpointManager.restore: failed to remove file added after checkpoint", {
|
|
822666
822802
|
id,
|
|
@@ -822721,7 +822857,7 @@ class WorkspaceCheckpointManager {
|
|
|
822721
822857
|
async computeSizeBytes(paths) {
|
|
822722
822858
|
let total = 0;
|
|
822723
822859
|
for (const path7 of paths) {
|
|
822724
|
-
const absolute =
|
|
822860
|
+
const absolute = join75(this.workspaceRoot, path7);
|
|
822725
822861
|
if (!existsSync54(absolute))
|
|
822726
822862
|
continue;
|
|
822727
822863
|
try {
|
|
@@ -823002,8 +823138,8 @@ var init_registry5 = __esm(() => {
|
|
|
823002
823138
|
});
|
|
823003
823139
|
|
|
823004
823140
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/sessions/manager.js
|
|
823005
|
-
import { existsSync as existsSync55, mkdirSync as
|
|
823006
|
-
import { join as
|
|
823141
|
+
import { existsSync as existsSync55, mkdirSync as mkdirSync41, readFileSync as readFileSync56, readdirSync as readdirSync18, writeFileSync as writeFileSync35, unlinkSync as unlinkSync9, renameSync as renameSync8, openSync, fsyncSync, closeSync } from "fs";
|
|
823142
|
+
import { join as join76 } from "path";
|
|
823007
823143
|
|
|
823008
823144
|
class SessionManager {
|
|
823009
823145
|
sessionsDir;
|
|
@@ -823019,11 +823155,11 @@ class SessionManager {
|
|
|
823019
823155
|
for (const f4 of files) {
|
|
823020
823156
|
if (f4.startsWith(".tmp-")) {
|
|
823021
823157
|
try {
|
|
823022
|
-
unlinkSync9(
|
|
823158
|
+
unlinkSync9(join76(this.sessionsDir, f4));
|
|
823023
823159
|
logger.debug("SessionManager: removed orphan tmp file", { file: f4 });
|
|
823024
823160
|
} catch (err2) {
|
|
823025
823161
|
logger.warn("SessionManager: failed to remove orphan tmp file", {
|
|
823026
|
-
file:
|
|
823162
|
+
file: join76(this.sessionsDir, f4),
|
|
823027
823163
|
error: summarizeError(err2)
|
|
823028
823164
|
});
|
|
823029
823165
|
}
|
|
@@ -823037,8 +823173,8 @@ class SessionManager {
|
|
|
823037
823173
|
}
|
|
823038
823174
|
}
|
|
823039
823175
|
_atomicWrite(filePath, content) {
|
|
823040
|
-
const tmpPath =
|
|
823041
|
-
|
|
823176
|
+
const tmpPath = join76(this.sessionsDir, `.tmp-${process.pid}-${Date.now()}`);
|
|
823177
|
+
writeFileSync35(tmpPath, content, "utf-8");
|
|
823042
823178
|
const fileFd = openSync(tmpPath, "r+");
|
|
823043
823179
|
try {
|
|
823044
823180
|
fsyncSync(fileFd);
|
|
@@ -823056,9 +823192,9 @@ class SessionManager {
|
|
|
823056
823192
|
save(name51, messages, meta3, agentRecords) {
|
|
823057
823193
|
if (!name51 || !name51.trim())
|
|
823058
823194
|
throw new Error("Session name cannot be empty");
|
|
823059
|
-
|
|
823195
|
+
mkdirSync41(this.sessionsDir, { recursive: true });
|
|
823060
823196
|
const sanitizedName = this.sanitizeName(name51);
|
|
823061
|
-
const filePath =
|
|
823197
|
+
const filePath = join76(this.sessionsDir, `${sanitizedName}.jsonl`);
|
|
823062
823198
|
const lines = [];
|
|
823063
823199
|
const metaRecord = {
|
|
823064
823200
|
type: "meta",
|
|
@@ -823091,11 +823227,11 @@ class SessionManager {
|
|
|
823091
823227
|
if (!name51 || !name51.trim())
|
|
823092
823228
|
throw new Error("Session name cannot be empty");
|
|
823093
823229
|
const filename = this.sanitizeName(name51);
|
|
823094
|
-
const filePath =
|
|
823230
|
+
const filePath = join76(this.sessionsDir, `${filename}.jsonl`);
|
|
823095
823231
|
if (!existsSync55(filePath)) {
|
|
823096
823232
|
throw new Error(`Session not found: ${name51}`);
|
|
823097
823233
|
}
|
|
823098
|
-
const raw =
|
|
823234
|
+
const raw = readFileSync56(filePath, "utf-8");
|
|
823099
823235
|
const lines = raw.split(`
|
|
823100
823236
|
`).filter((l3) => l3.trim().length > 0);
|
|
823101
823237
|
let meta3 = { title: "", model: "", provider: "", timestamp: 0, titleSource: "system" };
|
|
@@ -823160,11 +823296,11 @@ class SessionManager {
|
|
|
823160
823296
|
const sessions = [];
|
|
823161
823297
|
for (const file2 of files) {
|
|
823162
823298
|
const name51 = file2.replace(/\.jsonl$/, "");
|
|
823163
|
-
const filePath =
|
|
823299
|
+
const filePath = join76(this.sessionsDir, file2);
|
|
823164
823300
|
let meta3 = { title: "", model: "", provider: "", timestamp: 0, titleSource: "system" };
|
|
823165
823301
|
let messageCount = 0;
|
|
823166
823302
|
try {
|
|
823167
|
-
const raw =
|
|
823303
|
+
const raw = readFileSync56(filePath, "utf-8");
|
|
823168
823304
|
const lines = raw.split(`
|
|
823169
823305
|
`).filter((l3) => l3.trim().length > 0);
|
|
823170
823306
|
if (lines.length > 0) {
|
|
@@ -823224,11 +823360,11 @@ class SessionManager {
|
|
|
823224
823360
|
if (!name51 || !name51.trim())
|
|
823225
823361
|
return null;
|
|
823226
823362
|
const filename = this.sanitizeName(name51);
|
|
823227
|
-
const filePath =
|
|
823363
|
+
const filePath = join76(this.sessionsDir, `${filename}.jsonl`);
|
|
823228
823364
|
if (!existsSync55(filePath))
|
|
823229
823365
|
return null;
|
|
823230
823366
|
try {
|
|
823231
|
-
const raw =
|
|
823367
|
+
const raw = readFileSync56(filePath, "utf-8");
|
|
823232
823368
|
const firstLine = raw.split(`
|
|
823233
823369
|
`)[0];
|
|
823234
823370
|
if (!firstLine?.trim())
|
|
@@ -823258,10 +823394,10 @@ class SessionManager {
|
|
|
823258
823394
|
if (!name51 || !name51.trim())
|
|
823259
823395
|
throw new Error("Session name cannot be empty");
|
|
823260
823396
|
const filename = this.sanitizeName(name51);
|
|
823261
|
-
const filePath =
|
|
823397
|
+
const filePath = join76(this.sessionsDir, `${filename}.jsonl`);
|
|
823262
823398
|
if (!existsSync55(filePath))
|
|
823263
823399
|
throw new Error(`Session not found: ${name51}`);
|
|
823264
|
-
const raw =
|
|
823400
|
+
const raw = readFileSync56(filePath, "utf-8");
|
|
823265
823401
|
const lines = raw.split(`
|
|
823266
823402
|
`);
|
|
823267
823403
|
if (lines.length === 0)
|
|
@@ -823280,7 +823416,7 @@ class SessionManager {
|
|
|
823280
823416
|
if (!name51 || !name51.trim())
|
|
823281
823417
|
throw new Error("Session name cannot be empty");
|
|
823282
823418
|
const filename = this.sanitizeName(name51);
|
|
823283
|
-
const filePath =
|
|
823419
|
+
const filePath = join76(this.sessionsDir, `${filename}.jsonl`);
|
|
823284
823420
|
if (!existsSync55(filePath))
|
|
823285
823421
|
throw new Error(`Session not found: ${name51}`);
|
|
823286
823422
|
try {
|
|
@@ -823297,7 +823433,7 @@ class SessionManager {
|
|
|
823297
823433
|
const results = [];
|
|
823298
823434
|
for (const session2 of sessions) {
|
|
823299
823435
|
try {
|
|
823300
|
-
const raw =
|
|
823436
|
+
const raw = readFileSync56(session2.filePath, "utf-8");
|
|
823301
823437
|
const lines = raw.split(`
|
|
823302
823438
|
`).filter((l3) => l3.trim().length > 0);
|
|
823303
823439
|
let matchCount = 0;
|
|
@@ -823352,8 +823488,8 @@ var init_manager14 = __esm(() => {
|
|
|
823352
823488
|
|
|
823353
823489
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/runtime/session-persistence.js
|
|
823354
823490
|
import { randomBytes as randomBytes7 } from "crypto";
|
|
823355
|
-
import { closeSync as closeSync2, existsSync as existsSync56, mkdirSync as
|
|
823356
|
-
import { dirname as
|
|
823491
|
+
import { closeSync as closeSync2, existsSync as existsSync56, mkdirSync as mkdirSync42, openSync as openSync2, readFileSync as readFileSync57, readSync, renameSync as renameSync9, statSync as statSync16, unlinkSync as unlinkSync10, writeFileSync as writeFileSync36 } from "fs";
|
|
823492
|
+
import { dirname as dirname44, join as join77 } from "path";
|
|
823357
823493
|
function requireWorkingDirectory2(options) {
|
|
823358
823494
|
const workingDirectory = options?.workingDirectory;
|
|
823359
823495
|
if (!workingDirectory) {
|
|
@@ -823384,7 +823520,7 @@ function getUserSessionsDir(workingDirectory, surfaceRoot) {
|
|
|
823384
823520
|
return resolveScopedDirectory(workingDirectory, surfaceRoot, "sessions");
|
|
823385
823521
|
}
|
|
823386
823522
|
function getLastSessionPointerPath(workingDirectory, surfaceRoot) {
|
|
823387
|
-
return
|
|
823523
|
+
return join77(getUserSessionsDir(workingDirectory, surfaceRoot), "last-session.json");
|
|
823388
823524
|
}
|
|
823389
823525
|
function getRecoveryFilePath(homeDirectory, surfaceRoot) {
|
|
823390
823526
|
return resolveScopedDirectory(homeDirectory, surfaceRoot, "recovery.jsonl");
|
|
@@ -823412,8 +823548,8 @@ function writeLastSessionPointer(sessionId, options) {
|
|
|
823412
823548
|
try {
|
|
823413
823549
|
const workingDirectory = requireWorkingDirectory2(options);
|
|
823414
823550
|
const pointerPath = getLastSessionPointerPath(workingDirectory, options?.surfaceRoot);
|
|
823415
|
-
|
|
823416
|
-
|
|
823551
|
+
mkdirSync42(dirname44(pointerPath), { recursive: true });
|
|
823552
|
+
writeFileSync36(pointerPath, JSON.stringify({ sessionId, timestamp: new Date().toISOString() }) + `
|
|
823417
823553
|
`, "utf-8");
|
|
823418
823554
|
} catch (error51) {
|
|
823419
823555
|
logger.warn("writeLastSessionPointer failed", { error: summarizeError(error51) });
|
|
@@ -823425,7 +823561,7 @@ function readLastSessionPointer(options) {
|
|
|
823425
823561
|
const pointerPath = getLastSessionPointerPath(workingDirectory, options?.surfaceRoot);
|
|
823426
823562
|
if (!existsSync56(pointerPath))
|
|
823427
823563
|
return null;
|
|
823428
|
-
const data = JSON.parse(
|
|
823564
|
+
const data = JSON.parse(readFileSync57(pointerPath, "utf-8"));
|
|
823429
823565
|
if (typeof data.sessionId === "string" && data.sessionId.trim())
|
|
823430
823566
|
return data.sessionId;
|
|
823431
823567
|
} catch (error51) {
|
|
@@ -823468,8 +823604,8 @@ function writeRecoveryFile(snapshot, sessionId, title = "", options) {
|
|
|
823468
823604
|
lines.push(JSON.stringify({ type: "message", ...message }));
|
|
823469
823605
|
}
|
|
823470
823606
|
const tmpPath = recoveryFile + ".tmp";
|
|
823471
|
-
|
|
823472
|
-
|
|
823607
|
+
mkdirSync42(dirname44(recoveryFile), { recursive: true });
|
|
823608
|
+
writeFileSync36(tmpPath, lines.join(`
|
|
823473
823609
|
`) + `
|
|
823474
823610
|
`, "utf-8");
|
|
823475
823611
|
renameSync9(tmpPath, recoveryFile);
|
|
@@ -823521,7 +823657,7 @@ function loadRecoveryConversation(options) {
|
|
|
823521
823657
|
try {
|
|
823522
823658
|
const homeDirectory = requireHomeDirectory(options);
|
|
823523
823659
|
const recoveryFile = getRecoveryFilePath(homeDirectory, options?.surfaceRoot);
|
|
823524
|
-
const raw =
|
|
823660
|
+
const raw = readFileSync57(recoveryFile, "utf-8");
|
|
823525
823661
|
const lines = raw.split(`
|
|
823526
823662
|
`).filter(Boolean);
|
|
823527
823663
|
if (lines.length < 2)
|
|
@@ -823569,8 +823705,8 @@ var init_session_persistence = __esm(() => {
|
|
|
823569
823705
|
});
|
|
823570
823706
|
|
|
823571
823707
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/runtime/worktree/registry.js
|
|
823572
|
-
import { mkdirSync as
|
|
823573
|
-
import { dirname as
|
|
823708
|
+
import { mkdirSync as mkdirSync43, readFileSync as readFileSync58, writeFileSync as writeFileSync37 } from "fs";
|
|
823709
|
+
import { dirname as dirname45, isAbsolute as isAbsolute11, join as join78, resolve as resolve31 } from "path";
|
|
823574
823710
|
function getStorePath(workingDirectory, surfaceRoot) {
|
|
823575
823711
|
return resolveScopedDirectory(workingDirectory, surfaceRoot, "worktrees.json");
|
|
823576
823712
|
}
|
|
@@ -823582,7 +823718,7 @@ function normalizePath(path7, workingDirectory) {
|
|
|
823582
823718
|
}
|
|
823583
823719
|
function readStore2(storePath) {
|
|
823584
823720
|
try {
|
|
823585
|
-
return JSON.parse(
|
|
823721
|
+
return JSON.parse(readFileSync58(storePath, "utf-8"));
|
|
823586
823722
|
} catch {
|
|
823587
823723
|
return defaultStore2();
|
|
823588
823724
|
}
|
|
@@ -823645,8 +823781,8 @@ function summarizeWorktreeOwnership(records) {
|
|
|
823645
823781
|
});
|
|
823646
823782
|
}
|
|
823647
823783
|
function writeStore2(store, storePath) {
|
|
823648
|
-
|
|
823649
|
-
|
|
823784
|
+
mkdirSync43(dirname45(storePath), { recursive: true });
|
|
823785
|
+
writeFileSync37(storePath, `${JSON.stringify(store, null, 2)}
|
|
823650
823786
|
`, "utf-8");
|
|
823651
823787
|
}
|
|
823652
823788
|
function classifyWorktreePath(path7, workingDirectory) {
|
|
@@ -823655,7 +823791,7 @@ function classifyWorktreePath(path7, workingDirectory) {
|
|
|
823655
823791
|
if (agentMatch) {
|
|
823656
823792
|
return { kind: "agent", ownerId: agentMatch[1] };
|
|
823657
823793
|
}
|
|
823658
|
-
if (normalized.includes(`${
|
|
823794
|
+
if (normalized.includes(`${join78(".goodvibes", ".worktrees")}`)) {
|
|
823659
823795
|
return { kind: "orchestrator" };
|
|
823660
823796
|
}
|
|
823661
823797
|
return { kind: "manual" };
|
|
@@ -825511,9 +825647,9 @@ var init_web_search2 = __esm(() => {
|
|
|
825511
825647
|
});
|
|
825512
825648
|
|
|
825513
825649
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/hooks/workbench.js
|
|
825514
|
-
import { existsSync as existsSync57, mkdirSync as
|
|
825650
|
+
import { existsSync as existsSync57, mkdirSync as mkdirSync44, readFileSync as readFileSync59 } from "fs";
|
|
825515
825651
|
import { writeFile as writeFile9 } from "fs/promises";
|
|
825516
|
-
import { dirname as
|
|
825652
|
+
import { dirname as dirname46, resolve as resolve32 } from "path";
|
|
825517
825653
|
function cloneConfig(config6) {
|
|
825518
825654
|
return {
|
|
825519
825655
|
hooks: Object.fromEntries(Object.entries(config6.hooks ?? {}).map(([pattern, defs]) => [pattern, defs.map((def) => ({ ...def }))])),
|
|
@@ -825585,7 +825721,7 @@ class HookWorkbench {
|
|
|
825585
825721
|
return this.getManagedConfig();
|
|
825586
825722
|
}
|
|
825587
825723
|
try {
|
|
825588
|
-
const parsed = JSON.parse(
|
|
825724
|
+
const parsed = JSON.parse(readFileSync59(path7, "utf-8"));
|
|
825589
825725
|
this.managedConfig = ensureConfigShape(parsed);
|
|
825590
825726
|
this.recordAction({ kind: "load", target: path7, timestamp: Date.now(), detail: `${this.listManagedHooks().length} hooks / ${this.listManagedChains().length} chains` });
|
|
825591
825727
|
} catch (error51) {
|
|
@@ -825596,7 +825732,7 @@ class HookWorkbench {
|
|
|
825596
825732
|
return this.getManagedConfig();
|
|
825597
825733
|
}
|
|
825598
825734
|
async saveManagedConfig(path7 = this.lastLoadedPath ?? this.getHooksFilePath()) {
|
|
825599
|
-
|
|
825735
|
+
mkdirSync44(dirname46(path7), { recursive: true });
|
|
825600
825736
|
await writeFile9(path7, `${JSON.stringify(this.managedConfig, null, 2)}
|
|
825601
825737
|
`, "utf-8");
|
|
825602
825738
|
this.lastLoadedPath = path7;
|
|
@@ -825696,7 +825832,7 @@ class HookWorkbench {
|
|
|
825696
825832
|
return path7;
|
|
825697
825833
|
}
|
|
825698
825834
|
inspectManagedConfig(path7) {
|
|
825699
|
-
const config6 = ensureConfigShape(JSON.parse(
|
|
825835
|
+
const config6 = ensureConfigShape(JSON.parse(readFileSync59(path7, "utf-8")));
|
|
825700
825836
|
const inspection = {
|
|
825701
825837
|
path: path7,
|
|
825702
825838
|
hookCount: Object.values(config6.hooks ?? {}).reduce((sum, defs) => sum + defs.length, 0),
|
|
@@ -825712,7 +825848,7 @@ class HookWorkbench {
|
|
|
825712
825848
|
return inspection;
|
|
825713
825849
|
}
|
|
825714
825850
|
importManagedConfig(path7, strategy = "merge") {
|
|
825715
|
-
const incoming = ensureConfigShape(JSON.parse(
|
|
825851
|
+
const incoming = ensureConfigShape(JSON.parse(readFileSync59(path7, "utf-8")));
|
|
825716
825852
|
if (strategy === "replace") {
|
|
825717
825853
|
this.managedConfig = cloneConfig(incoming);
|
|
825718
825854
|
} else {
|
|
@@ -826102,14 +826238,14 @@ var init_api4 = __esm(() => {
|
|
|
826102
826238
|
});
|
|
826103
826239
|
|
|
826104
826240
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/plugins/loader.js
|
|
826105
|
-
import { existsSync as existsSync58, readdirSync as readdirSync19, readFileSync as
|
|
826106
|
-
import { join as
|
|
826241
|
+
import { existsSync as existsSync58, readdirSync as readdirSync19, readFileSync as readFileSync60, statSync as statSync17 } from "fs";
|
|
826242
|
+
import { join as join79, resolve as resolve33, isAbsolute as isAbsolute12 } from "path";
|
|
826107
826243
|
function getUserPluginDirectory(options) {
|
|
826108
|
-
return
|
|
826244
|
+
return join79(options.homeDir, ".goodvibes", PLUGIN_ROOT);
|
|
826109
826245
|
}
|
|
826110
826246
|
function getPluginDirectories(options) {
|
|
826111
826247
|
const dirs = [
|
|
826112
|
-
|
|
826248
|
+
join79(options.cwd, ".goodvibes", PLUGIN_ROOT),
|
|
826113
826249
|
getUserPluginDirectory(options)
|
|
826114
826250
|
];
|
|
826115
826251
|
if (options.additionalDirectories) {
|
|
@@ -826129,14 +826265,14 @@ function scanPluginDirectory(rootDir) {
|
|
|
826129
826265
|
return [];
|
|
826130
826266
|
}
|
|
826131
826267
|
for (const entry of entries) {
|
|
826132
|
-
const pluginDir =
|
|
826268
|
+
const pluginDir = join79(rootDir, entry);
|
|
826133
826269
|
try {
|
|
826134
826270
|
if (!statSync17(pluginDir).isDirectory())
|
|
826135
826271
|
continue;
|
|
826136
|
-
const manifestPath =
|
|
826272
|
+
const manifestPath = join79(pluginDir, "manifest.json");
|
|
826137
826273
|
if (!existsSync58(manifestPath))
|
|
826138
826274
|
continue;
|
|
826139
|
-
const raw =
|
|
826275
|
+
const raw = readFileSync60(manifestPath, "utf-8");
|
|
826140
826276
|
const manifest = JSON.parse(raw);
|
|
826141
826277
|
if (!manifest.name || !manifest.version) {
|
|
826142
826278
|
logger.warn(`[plugins] ${entry}: manifest.json missing required fields (name, version)`);
|
|
@@ -826177,7 +826313,7 @@ function discoverPlugins(options) {
|
|
|
826177
826313
|
async function loadPlugin(discovered, deps, cacheBust, entryDefault) {
|
|
826178
826314
|
const { manifest, pluginDir } = discovered;
|
|
826179
826315
|
const entryFile = manifest.main ?? entryDefault ?? "index.js";
|
|
826180
|
-
const entryPath =
|
|
826316
|
+
const entryPath = join79(pluginDir, entryFile);
|
|
826181
826317
|
const resolvedEntry = resolve33(entryPath);
|
|
826182
826318
|
const resolvedPluginDir = resolve33(pluginDir);
|
|
826183
826319
|
if (!resolvedEntry.startsWith(resolvedPluginDir + "/") && resolvedEntry !== resolvedPluginDir) {
|
|
@@ -826583,8 +826719,8 @@ var init_quarantine = __esm(() => {
|
|
|
826583
826719
|
});
|
|
826584
826720
|
|
|
826585
826721
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/plugins/manager.js
|
|
826586
|
-
import { existsSync as existsSync59, mkdirSync as
|
|
826587
|
-
import { dirname as
|
|
826722
|
+
import { existsSync as existsSync59, mkdirSync as mkdirSync45, readFileSync as readFileSync61, writeFileSync as writeFileSync38 } from "fs";
|
|
826723
|
+
import { dirname as dirname47 } from "path";
|
|
826588
826724
|
|
|
826589
826725
|
class PluginManager {
|
|
826590
826726
|
plugins = new Map;
|
|
@@ -826811,7 +826947,7 @@ class PluginManager {
|
|
|
826811
826947
|
loadState() {
|
|
826812
826948
|
try {
|
|
826813
826949
|
if (existsSync59(this.stateFilePath)) {
|
|
826814
|
-
const raw =
|
|
826950
|
+
const raw = readFileSync61(this.stateFilePath, "utf-8");
|
|
826815
826951
|
const parsed = JSON.parse(raw);
|
|
826816
826952
|
this.state.enabled = parsed.enabled ?? {};
|
|
826817
826953
|
this.state.config = parsed.config ?? {};
|
|
@@ -826827,8 +826963,8 @@ class PluginManager {
|
|
|
826827
826963
|
}
|
|
826828
826964
|
saveState() {
|
|
826829
826965
|
try {
|
|
826830
|
-
|
|
826831
|
-
|
|
826966
|
+
mkdirSync45(dirname47(this.stateFilePath), { recursive: true });
|
|
826967
|
+
writeFileSync38(this.stateFilePath, JSON.stringify(this.state, null, 2), "utf-8");
|
|
826832
826968
|
} catch (err2) {
|
|
826833
826969
|
logger.warn(`[plugins] Could not save state: ${summarizeError(err2)}`);
|
|
826834
826970
|
}
|
|
@@ -826869,8 +827005,8 @@ var init_manager15 = __esm(() => {
|
|
|
826869
827005
|
});
|
|
826870
827006
|
|
|
826871
827007
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/bookmarks/manager.js
|
|
826872
|
-
import { existsSync as existsSync60, mkdirSync as
|
|
826873
|
-
import { join as
|
|
827008
|
+
import { existsSync as existsSync60, mkdirSync as mkdirSync46, readFileSync as readFileSync62, readdirSync as readdirSync20, writeFileSync as writeFileSync39 } from "fs";
|
|
827009
|
+
import { join as join80, resolve as resolve34 } from "path";
|
|
826874
827010
|
|
|
826875
827011
|
class BookmarkManager {
|
|
826876
827012
|
bookmarks = new Map;
|
|
@@ -826901,12 +827037,12 @@ class BookmarkManager {
|
|
|
826901
827037
|
this.bookmarks.clear();
|
|
826902
827038
|
}
|
|
826903
827039
|
saveToFile(content, label) {
|
|
826904
|
-
|
|
827040
|
+
mkdirSync46(this.saveDir, { recursive: true });
|
|
826905
827041
|
const timestamp = new Date().toISOString().replace(/[:.]/g, "-").slice(0, 19);
|
|
826906
827042
|
const sanitizedLabel = label.toLowerCase().replace(/[^a-z0-9_-]/g, "-").replace(/-+/g, "-").replace(/^-+|-+$/g, "").slice(0, 40) || "block";
|
|
826907
827043
|
const filename = `${timestamp}-${sanitizedLabel}.txt`;
|
|
826908
|
-
const filePath =
|
|
826909
|
-
|
|
827044
|
+
const filePath = join80(this.saveDir, filename);
|
|
827045
|
+
writeFileSync39(filePath, content, "utf-8");
|
|
826910
827046
|
logger.debug("BookmarkManager: saved block content", { filePath });
|
|
826911
827047
|
return filePath;
|
|
826912
827048
|
}
|
|
@@ -826914,7 +827050,7 @@ class BookmarkManager {
|
|
|
826914
827050
|
if (!existsSync60(this.saveDir))
|
|
826915
827051
|
return [];
|
|
826916
827052
|
try {
|
|
826917
|
-
return readdirSync20(this.saveDir).filter((f4) => f4.endsWith(".txt")).map((f4) =>
|
|
827053
|
+
return readdirSync20(this.saveDir).filter((f4) => f4.endsWith(".txt")).map((f4) => join80(this.saveDir, f4)).sort();
|
|
826918
827054
|
} catch (err2) {
|
|
826919
827055
|
logger.warn("BookmarkManager: failed to list saved files", { dir: this.saveDir, error: summarizeError(err2) });
|
|
826920
827056
|
return [];
|
|
@@ -826922,7 +827058,7 @@ class BookmarkManager {
|
|
|
826922
827058
|
}
|
|
826923
827059
|
loadSavedFile(name51) {
|
|
826924
827060
|
const sanitized = name51.endsWith(".txt") ? name51 : `${name51}.txt`;
|
|
826925
|
-
const resolved = resolve34(
|
|
827061
|
+
const resolved = resolve34(join80(this.saveDir, sanitized));
|
|
826926
827062
|
if (!resolved.startsWith(resolve34(this.saveDir) + "/") && resolved !== resolve34(this.saveDir)) {
|
|
826927
827063
|
throw new Error("Invalid bookmark name");
|
|
826928
827064
|
}
|
|
@@ -826930,7 +827066,7 @@ class BookmarkManager {
|
|
|
826930
827066
|
if (!existsSync60(filePath))
|
|
826931
827067
|
return null;
|
|
826932
827068
|
try {
|
|
826933
|
-
return
|
|
827069
|
+
return readFileSync62(filePath, "utf-8");
|
|
826934
827070
|
} catch (err2) {
|
|
826935
827071
|
logger.warn("BookmarkManager: failed to read saved file", { filePath, error: summarizeError(err2) });
|
|
826936
827072
|
return null;
|
|
@@ -827144,8 +827280,8 @@ var init_token_audit = __esm(() => {
|
|
|
827144
827280
|
|
|
827145
827281
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/security/user-auth.js
|
|
827146
827282
|
import { createHash as createHash20, randomBytes as randomBytes8, scryptSync, timingSafeEqual as timingSafeEqual9 } from "crypto";
|
|
827147
|
-
import { chmodSync as chmodSync2, closeSync as closeSync3, existsSync as existsSync61, fsyncSync as fsyncSync2, mkdirSync as
|
|
827148
|
-
import { dirname as
|
|
827283
|
+
import { chmodSync as chmodSync2, closeSync as closeSync3, existsSync as existsSync61, fsyncSync as fsyncSync2, mkdirSync as mkdirSync47, openSync as openSync3, readFileSync as readFileSync63, renameSync as renameSync10, rmSync as rmSync7, writeFileSync as writeFileSync40 } from "fs";
|
|
827284
|
+
import { dirname as dirname48, join as join81 } from "path";
|
|
827149
827285
|
function toBase647(value) {
|
|
827150
827286
|
return value.toString("base64");
|
|
827151
827287
|
}
|
|
@@ -827197,7 +827333,7 @@ function readBootstrapUsers(filePath) {
|
|
|
827197
827333
|
try {
|
|
827198
827334
|
if (!existsSync61(filePath))
|
|
827199
827335
|
return null;
|
|
827200
|
-
const raw =
|
|
827336
|
+
const raw = readFileSync63(filePath, "utf-8");
|
|
827201
827337
|
const parsed = JSON.parse(raw);
|
|
827202
827338
|
if (parsed.version !== 1 || !Array.isArray(parsed.users))
|
|
827203
827339
|
return null;
|
|
@@ -827208,10 +827344,10 @@ function readBootstrapUsers(filePath) {
|
|
|
827208
827344
|
}
|
|
827209
827345
|
}
|
|
827210
827346
|
function atomicWriteSecretFile(filePath, content) {
|
|
827211
|
-
const dir =
|
|
827212
|
-
|
|
827347
|
+
const dir = dirname48(filePath);
|
|
827348
|
+
mkdirSync47(dir, { recursive: true });
|
|
827213
827349
|
const tmpPath = filePath + ".tmp";
|
|
827214
|
-
|
|
827350
|
+
writeFileSync40(tmpPath, content, { encoding: "utf-8", mode: 384 });
|
|
827215
827351
|
try {
|
|
827216
827352
|
chmodSync2(tmpPath, 384);
|
|
827217
827353
|
} catch (error51) {
|
|
@@ -827273,7 +827409,7 @@ function readBootstrapCredentialFile(filePath) {
|
|
|
827273
827409
|
try {
|
|
827274
827410
|
if (!existsSync61(filePath))
|
|
827275
827411
|
return null;
|
|
827276
|
-
const raw =
|
|
827412
|
+
const raw = readFileSync63(filePath, "utf-8");
|
|
827277
827413
|
let username;
|
|
827278
827414
|
let password;
|
|
827279
827415
|
for (const rawLine of raw.split(`
|
|
@@ -827581,8 +827717,8 @@ var init_user_auth = __esm(() => {
|
|
|
827581
827717
|
});
|
|
827582
827718
|
|
|
827583
827719
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/mcp/config.js
|
|
827584
|
-
import { existsSync as existsSync62, mkdirSync as
|
|
827585
|
-
import { dirname as
|
|
827720
|
+
import { existsSync as existsSync62, mkdirSync as mkdirSync48, readFileSync as readFileSync64, writeFileSync as writeFileSync41 } from "fs";
|
|
827721
|
+
import { dirname as dirname49, join as join82 } from "path";
|
|
827586
827722
|
function optionalStringArray2(value) {
|
|
827587
827723
|
return Array.isArray(value) && value.every((entry) => typeof entry === "string") ? [...value] : undefined;
|
|
827588
827724
|
}
|
|
@@ -827613,31 +827749,31 @@ function getMcpConfigLocations(roots) {
|
|
|
827613
827749
|
{
|
|
827614
827750
|
scope: "global",
|
|
827615
827751
|
kind: "global-xdg",
|
|
827616
|
-
path:
|
|
827752
|
+
path: join82(home, ".config", "mcp", "mcp.json"),
|
|
827617
827753
|
writable: true
|
|
827618
827754
|
},
|
|
827619
827755
|
{
|
|
827620
827756
|
scope: "external",
|
|
827621
827757
|
kind: "global-dotdir",
|
|
827622
|
-
path:
|
|
827758
|
+
path: join82(home, ".mcp", "mcp.json"),
|
|
827623
827759
|
writable: false
|
|
827624
827760
|
},
|
|
827625
827761
|
{
|
|
827626
827762
|
scope: "external",
|
|
827627
827763
|
kind: "claude-desktop",
|
|
827628
|
-
path:
|
|
827764
|
+
path: join82(home, ".config", "claude", "claude_desktop_config.json"),
|
|
827629
827765
|
writable: false
|
|
827630
827766
|
},
|
|
827631
827767
|
{
|
|
827632
827768
|
scope: "external",
|
|
827633
827769
|
kind: "project-mcp",
|
|
827634
|
-
path:
|
|
827770
|
+
path: join82(cwd, ".mcp", "mcp.json"),
|
|
827635
827771
|
writable: false
|
|
827636
827772
|
},
|
|
827637
827773
|
{
|
|
827638
827774
|
scope: "project",
|
|
827639
827775
|
kind: "project-goodvibes",
|
|
827640
|
-
path:
|
|
827776
|
+
path: join82(cwd, ".goodvibes", "mcp.json"),
|
|
827641
827777
|
writable: true
|
|
827642
827778
|
}
|
|
827643
827779
|
];
|
|
@@ -827669,7 +827805,7 @@ function parseMcpServers(raw) {
|
|
|
827669
827805
|
function readMcpConfigAtPath(path7) {
|
|
827670
827806
|
if (!existsSync62(path7))
|
|
827671
827807
|
return { servers: [] };
|
|
827672
|
-
const raw = JSON.parse(
|
|
827808
|
+
const raw = JSON.parse(readFileSync64(path7, "utf-8"));
|
|
827673
827809
|
const servers = parseMcpServers(raw);
|
|
827674
827810
|
return { servers: servers ?? [] };
|
|
827675
827811
|
}
|
|
@@ -827683,7 +827819,7 @@ function assertServerConfig(server2) {
|
|
|
827683
827819
|
throw new Error("MCP server command is required.");
|
|
827684
827820
|
}
|
|
827685
827821
|
function writeMcpConfigFile(path7, config6) {
|
|
827686
|
-
|
|
827822
|
+
mkdirSync48(dirname49(path7), { recursive: true });
|
|
827687
827823
|
const normalized = {
|
|
827688
827824
|
servers: config6.servers.map((server2) => {
|
|
827689
827825
|
assertServerConfig(server2);
|
|
@@ -827699,7 +827835,7 @@ function writeMcpConfigFile(path7, config6) {
|
|
|
827699
827835
|
};
|
|
827700
827836
|
})
|
|
827701
827837
|
};
|
|
827702
|
-
|
|
827838
|
+
writeFileSync41(path7, `${JSON.stringify(normalized, null, 2)}
|
|
827703
827839
|
`);
|
|
827704
827840
|
}
|
|
827705
827841
|
function loadMcpEffectiveConfig(roots) {
|
|
@@ -829581,7 +829717,7 @@ var init_component_health_monitor = __esm(() => {
|
|
|
829581
829717
|
});
|
|
829582
829718
|
|
|
829583
829719
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/runtime/shell-paths.js
|
|
829584
|
-
import { isAbsolute as isAbsolute13, join as
|
|
829720
|
+
import { isAbsolute as isAbsolute13, join as join83, resolve as resolve35 } from "path";
|
|
829585
829721
|
function requireAbsoluteOwnedRoot(path7, name51) {
|
|
829586
829722
|
const trimmed2 = path7.trim();
|
|
829587
829723
|
if (!trimmed2) {
|
|
@@ -829595,13 +829731,13 @@ function requireAbsoluteOwnedRoot(path7, name51) {
|
|
|
829595
829731
|
function createShellPathService(options) {
|
|
829596
829732
|
const workingDirectory = requireAbsoluteOwnedRoot(options.workingDirectory, "workingDirectory");
|
|
829597
829733
|
const homeDirectory = requireAbsoluteOwnedRoot(options.homeDirectory, "homeDirectory");
|
|
829598
|
-
const projectGoodVibesRoot =
|
|
829599
|
-
const userGoodVibesRoot =
|
|
829734
|
+
const projectGoodVibesRoot = join83(workingDirectory, ".goodvibes");
|
|
829735
|
+
const userGoodVibesRoot = join83(homeDirectory, ".goodvibes");
|
|
829600
829736
|
const expandHomePath = (path7) => {
|
|
829601
829737
|
if (path7 === "~")
|
|
829602
829738
|
return homeDirectory;
|
|
829603
829739
|
if (path7.startsWith("~/")) {
|
|
829604
|
-
return
|
|
829740
|
+
return join83(homeDirectory, path7.slice(2));
|
|
829605
829741
|
}
|
|
829606
829742
|
return path7;
|
|
829607
829743
|
};
|
|
@@ -829621,8 +829757,8 @@ function createShellPathService(options) {
|
|
|
829621
829757
|
userGoodVibesRoot,
|
|
829622
829758
|
expandHomePath,
|
|
829623
829759
|
resolveWorkspacePath,
|
|
829624
|
-
resolveProjectPath: (...segments) =>
|
|
829625
|
-
resolveUserPath: (...segments) =>
|
|
829760
|
+
resolveProjectPath: (...segments) => join83(projectGoodVibesRoot, ...segments),
|
|
829761
|
+
resolveUserPath: (...segments) => join83(userGoodVibesRoot, ...segments),
|
|
829626
829762
|
isWithinWorkingDirectory
|
|
829627
829763
|
};
|
|
829628
829764
|
}
|
|
@@ -831799,14 +831935,14 @@ function createCancellationRegistry() {
|
|
|
831799
831935
|
|
|
831800
831936
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/orchestration/dirty-guard.js
|
|
831801
831937
|
import { createHash as createHash21 } from "crypto";
|
|
831802
|
-
import { readFileSync as
|
|
831803
|
-
import { join as
|
|
831938
|
+
import { readFileSync as readFileSync65, existsSync as existsSync63 } from "fs";
|
|
831939
|
+
import { join as join84 } from "path";
|
|
831804
831940
|
function hashWorkingTreeFile(cwd, relativePath) {
|
|
831805
|
-
const absolutePath =
|
|
831941
|
+
const absolutePath = join84(cwd, relativePath);
|
|
831806
831942
|
if (!existsSync63(absolutePath))
|
|
831807
831943
|
return null;
|
|
831808
831944
|
try {
|
|
831809
|
-
return createHash21("sha256").update(
|
|
831945
|
+
return createHash21("sha256").update(readFileSync65(absolutePath)).digest("hex");
|
|
831810
831946
|
} catch (error51) {
|
|
831811
831947
|
logger.warn("orchestration dirty-guard: failed to hash working-tree file", {
|
|
831812
831948
|
path: relativePath,
|
|
@@ -832216,7 +832352,7 @@ var init_phase_runner = __esm(() => {
|
|
|
832216
832352
|
|
|
832217
832353
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/orchestration/worktree-isolation.js
|
|
832218
832354
|
import { createHash as createHash22 } from "crypto";
|
|
832219
|
-
import { join as
|
|
832355
|
+
import { join as join85 } from "path";
|
|
832220
832356
|
function shortId(id) {
|
|
832221
832357
|
const dash = id.lastIndexOf("-");
|
|
832222
832358
|
const candidate = dash >= 0 ? id.slice(dash + 1) : id;
|
|
@@ -832228,7 +832364,7 @@ function itemWorktreeBranch(workstreamId, itemId) {
|
|
|
832228
832364
|
return `ws/${shortId(workstreamId)}/${shortId(itemId)}`;
|
|
832229
832365
|
}
|
|
832230
832366
|
function itemWorktreeDir(projectRoot, workstreamId, itemId) {
|
|
832231
|
-
return
|
|
832367
|
+
return join85(projectRoot, ".goodvibes", ".worktrees", "ws", shortId(workstreamId), shortId(itemId));
|
|
832232
832368
|
}
|
|
832233
832369
|
function createWorktreeIsolationManager(deps) {
|
|
832234
832370
|
const now5 = deps.now ?? (() => Date.now());
|
|
@@ -832413,8 +832549,8 @@ var init_worktree_isolation = __esm(() => {
|
|
|
832413
832549
|
});
|
|
832414
832550
|
|
|
832415
832551
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/orchestration/persistence.js
|
|
832416
|
-
import { existsSync as existsSync64, mkdirSync as
|
|
832417
|
-
import { join as
|
|
832552
|
+
import { existsSync as existsSync64, mkdirSync as mkdirSync49, readFileSync as readFileSync66, readdirSync as readdirSync21, renameSync as renameSync11, writeFileSync as writeFileSync42 } from "fs";
|
|
832553
|
+
import { join as join86 } from "path";
|
|
832418
832554
|
function serializeWorkItem(item) {
|
|
832419
832555
|
return { ...item, visits: Object.fromEntries(item.visits) };
|
|
832420
832556
|
}
|
|
@@ -832472,10 +832608,10 @@ function deserializeWorkstreamSnapshot(json2) {
|
|
|
832472
832608
|
return candidate;
|
|
832473
832609
|
}
|
|
832474
832610
|
function orchestrationDir(projectRoot) {
|
|
832475
|
-
return
|
|
832611
|
+
return join86(projectRoot, ".goodvibes", "orchestration");
|
|
832476
832612
|
}
|
|
832477
832613
|
function snapshotPath(projectRoot, workstreamId) {
|
|
832478
|
-
return
|
|
832614
|
+
return join86(orchestrationDir(projectRoot), `${workstreamId}.json`);
|
|
832479
832615
|
}
|
|
832480
832616
|
function loadWorkstreamSnapshot(projectRoot, workstreamId) {
|
|
832481
832617
|
const path7 = snapshotPath(projectRoot, workstreamId);
|
|
@@ -832483,7 +832619,7 @@ function loadWorkstreamSnapshot(projectRoot, workstreamId) {
|
|
|
832483
832619
|
return null;
|
|
832484
832620
|
let text;
|
|
832485
832621
|
try {
|
|
832486
|
-
text =
|
|
832622
|
+
text = readFileSync66(path7, "utf-8");
|
|
832487
832623
|
} catch (error51) {
|
|
832488
832624
|
logger.warn("orchestration persistence: snapshot read failed", { path: path7, error: summarizeError(error51) });
|
|
832489
832625
|
return null;
|
|
@@ -832518,8 +832654,8 @@ function writeWorkstreamSnapshot(projectRoot, workstream, completedResults) {
|
|
|
832518
832654
|
return;
|
|
832519
832655
|
const path7 = snapshotPath(projectRoot, workstream.id);
|
|
832520
832656
|
try {
|
|
832521
|
-
|
|
832522
|
-
|
|
832657
|
+
mkdirSync49(orchestrationDir(projectRoot), { recursive: true });
|
|
832658
|
+
writeFileSync42(path7, json2, "utf-8");
|
|
832523
832659
|
} catch (error51) {
|
|
832524
832660
|
logger.error("orchestration persistence: snapshot write failed", { path: path7, error: summarizeError(error51) });
|
|
832525
832661
|
}
|
|
@@ -833066,7 +833202,7 @@ var init_orchestration4 = __esm(() => {
|
|
|
833066
833202
|
});
|
|
833067
833203
|
|
|
833068
833204
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/runtime/services.js
|
|
833069
|
-
import { join as
|
|
833205
|
+
import { join as join87 } from "path";
|
|
833070
833206
|
function bindProviderOptimizerFeatureFlag(featureFlags, providerOptimizer) {
|
|
833071
833207
|
providerOptimizer.setEnabled(featureFlags.isEnabled("provider-optimizer"));
|
|
833072
833208
|
return featureFlags.subscribe((flagId, state) => {
|
|
@@ -833156,7 +833292,7 @@ function createRuntimeServices(options) {
|
|
|
833156
833292
|
});
|
|
833157
833293
|
const agentMessageBus = new AgentMessageBus;
|
|
833158
833294
|
agentMessageBus.setRuntimeBus(options.runtimeBus);
|
|
833159
|
-
const archetypeLoader = new ArchetypeLoader(
|
|
833295
|
+
const archetypeLoader = new ArchetypeLoader(join87(workingDirectory, ".goodvibes", "agents"));
|
|
833160
833296
|
const agentOrchestrator = new AgentOrchestrator({
|
|
833161
833297
|
messageBus: agentMessageBus
|
|
833162
833298
|
});
|
|
@@ -833208,12 +833344,12 @@ function createRuntimeServices(options) {
|
|
|
833208
833344
|
});
|
|
833209
833345
|
const artifactStore = new ArtifactStore({ configManager });
|
|
833210
833346
|
const memoryEmbeddingRegistry = new MemoryEmbeddingProviderRegistry({ configManager });
|
|
833211
|
-
const memoryDbPath =
|
|
833347
|
+
const memoryDbPath = join87(workingDirectory, ".goodvibes", surfaceRoot, "memory.sqlite");
|
|
833212
833348
|
const memoryStore = new MemoryStore(memoryDbPath, {
|
|
833213
833349
|
embeddingRegistry: memoryEmbeddingRegistry
|
|
833214
833350
|
});
|
|
833215
833351
|
const memoryRegistry = new MemoryRegistry(memoryStore);
|
|
833216
|
-
const codeIndexDbPath =
|
|
833352
|
+
const codeIndexDbPath = join87(workingDirectory, ".goodvibes", surfaceRoot, "code-index.sqlite");
|
|
833217
833353
|
const codeIndexStore = new CodeIndexStore(workingDirectory, codeIndexDbPath, memoryEmbeddingRegistry);
|
|
833218
833354
|
codeIndexStore.init();
|
|
833219
833355
|
if (options.autoStartCodeIndex) {
|
|
@@ -833564,9 +833700,9 @@ function createRuntimeServices(options) {
|
|
|
833564
833700
|
workspaceCheckpointManager,
|
|
833565
833701
|
integrationHelpers,
|
|
833566
833702
|
async rerootStores(newWorkingDir) {
|
|
833567
|
-
const newMemoryDbPath =
|
|
833703
|
+
const newMemoryDbPath = join87(newWorkingDir, ".goodvibes", surfaceRoot, "memory.sqlite");
|
|
833568
833704
|
await memoryStore.reroot(newMemoryDbPath);
|
|
833569
|
-
const newCodeIndexDbPath =
|
|
833705
|
+
const newCodeIndexDbPath = join87(newWorkingDir, ".goodvibes", surfaceRoot, "code-index.sqlite");
|
|
833570
833706
|
await codeIndexStore.reroot(newWorkingDir, newCodeIndexDbPath);
|
|
833571
833707
|
await projectIndex.reroot(newWorkingDir);
|
|
833572
833708
|
const cannotReroot = [
|
|
@@ -833665,8 +833801,8 @@ var init_services3 = __esm(() => {
|
|
|
833665
833801
|
});
|
|
833666
833802
|
|
|
833667
833803
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/daemon/service-manager.js
|
|
833668
|
-
import { closeSync as closeSync4, existsSync as existsSync65, mkdirSync as
|
|
833669
|
-
import { dirname as
|
|
833804
|
+
import { closeSync as closeSync4, existsSync as existsSync65, mkdirSync as mkdirSync50, openSync as openSync4, readFileSync as readFileSync67, rmSync as rmSync8, writeFileSync as writeFileSync43 } from "fs";
|
|
833805
|
+
import { dirname as dirname50, join as join88, resolve as resolve36 } from "path";
|
|
833670
833806
|
import { spawnSync as spawnSync2, spawn as spawn4 } from "child_process";
|
|
833671
833807
|
function detectPlatform(platform4) {
|
|
833672
833808
|
switch (platform4) {
|
|
@@ -833772,9 +833908,9 @@ function renderWindowsCommand(definition) {
|
|
|
833772
833908
|
function definitionPath(platform4, serviceName, paths, surfaceRoot) {
|
|
833773
833909
|
switch (platform4) {
|
|
833774
833910
|
case "systemd":
|
|
833775
|
-
return
|
|
833911
|
+
return join88(paths.homeDirectory, ".config", "systemd", "user", `${serviceName}.service`);
|
|
833776
833912
|
case "launchd":
|
|
833777
|
-
return
|
|
833913
|
+
return join88(paths.homeDirectory, "Library", "LaunchAgents", `${serviceName}.plist`);
|
|
833778
833914
|
case "windows":
|
|
833779
833915
|
return resolveScopedDirectory(paths.workingDirectory, surfaceRoot, "service", "windows-task.txt");
|
|
833780
833916
|
case "manual":
|
|
@@ -833888,7 +834024,7 @@ class PlatformServiceManager {
|
|
|
833888
834024
|
...pid !== undefined && running ? { pid } : {},
|
|
833889
834025
|
logPath: resolveLogPath(this.configManager, platform4, this.workingDirectory, this.surfaceRoot),
|
|
833890
834026
|
commandPreview: installed ? path7 : [definition.command, ...definition.args].join(" "),
|
|
833891
|
-
contents: installed ?
|
|
834027
|
+
contents: installed ? readFileSync67(path7, "utf-8") : undefined,
|
|
833892
834028
|
suggestedCommands: suggestedCommands(platform4, path7, serviceName),
|
|
833893
834029
|
lastAction: "status"
|
|
833894
834030
|
};
|
|
@@ -833900,8 +834036,8 @@ class PlatformServiceManager {
|
|
|
833900
834036
|
const definition = this.resolveDefinition();
|
|
833901
834037
|
const path7 = definitionPath(platform4, serviceName, this.getPaths(), this.surfaceRoot);
|
|
833902
834038
|
const contents = platform4 === "systemd" ? renderSystemdUnit(definition) : platform4 === "launchd" ? renderLaunchdPlist(definition) : platform4 === "windows" ? renderWindowsCommand(definition) : [definition.command, ...definition.args].join(" ");
|
|
833903
|
-
|
|
833904
|
-
|
|
834039
|
+
mkdirSync50(dirname50(path7), { recursive: true });
|
|
834040
|
+
writeFileSync43(path7, `${contents}
|
|
833905
834041
|
`, "utf-8");
|
|
833906
834042
|
return {
|
|
833907
834043
|
...this.status(),
|
|
@@ -833966,8 +834102,8 @@ class PlatformServiceManager {
|
|
|
833966
834102
|
const definition = this.resolveDefinition();
|
|
833967
834103
|
const logPath = resolveLogPath(this.configManager, platform4, this.workingDirectory, this.surfaceRoot);
|
|
833968
834104
|
const pidPath = pidFilePath(platform4, this.workingDirectory, this.surfaceRoot);
|
|
833969
|
-
|
|
833970
|
-
|
|
834105
|
+
mkdirSync50(dirname50(pidPath), { recursive: true });
|
|
834106
|
+
mkdirSync50(dirname50(logPath), { recursive: true });
|
|
833971
834107
|
const stdoutFd = openSync4(logPath, "a");
|
|
833972
834108
|
const stderrFd = openSync4(logPath, "a");
|
|
833973
834109
|
let child;
|
|
@@ -833987,7 +834123,7 @@ class PlatformServiceManager {
|
|
|
833987
834123
|
closeSync4(stderrFd);
|
|
833988
834124
|
}
|
|
833989
834125
|
child.unref();
|
|
833990
|
-
|
|
834126
|
+
writeFileSync43(pidPath, `${child.pid}
|
|
833991
834127
|
`, "utf-8");
|
|
833992
834128
|
return {
|
|
833993
834129
|
...this.status(),
|
|
@@ -834070,7 +834206,7 @@ class PlatformServiceManager {
|
|
|
834070
834206
|
return this.actionRunner ? this.actionRunner(command8, args2) : spawnSync2(command8, args2, { stdio: "pipe", encoding: "utf-8" });
|
|
834071
834207
|
}
|
|
834072
834208
|
readPid(path7) {
|
|
834073
|
-
const raw =
|
|
834209
|
+
const raw = readFileSync67(path7, "utf-8").trim();
|
|
834074
834210
|
const pid = Number.parseInt(raw, 10);
|
|
834075
834211
|
return Number.isFinite(pid) && pid > 0 ? pid : undefined;
|
|
834076
834212
|
}
|
|
@@ -837620,7 +837756,7 @@ var createStyledCell = (char, overrides = {}) => ({
|
|
|
837620
837756
|
// src/version.ts
|
|
837621
837757
|
import { readFileSync } from "fs";
|
|
837622
837758
|
import { join } from "path";
|
|
837623
|
-
var _version = "1.
|
|
837759
|
+
var _version = "1.7.0";
|
|
837624
837760
|
try {
|
|
837625
837761
|
const pkg = JSON.parse(readFileSync(join(import.meta.dir, "..", "package.json"), "utf-8"));
|
|
837626
837762
|
_version = typeof pkg.version === "string" ? pkg.version : _version;
|
|
@@ -838861,6 +838997,10 @@ function formatAutoCompactTrigger(decision) {
|
|
|
838861
838997
|
}
|
|
838862
838998
|
return `crossing the ${decision.thresholdPercent}% auto-compact threshold`;
|
|
838863
838999
|
}
|
|
839000
|
+
function describeModelContextWarning(warning) {
|
|
839001
|
+
const detail = warning.providerStopReason ? ` (${warning.providerStopReason})` : "";
|
|
839002
|
+
return `${warning.model} reported its context window is full${detail}`;
|
|
839003
|
+
}
|
|
838864
839004
|
function buildAutoCompactionContext(deps, params) {
|
|
838865
839005
|
return {
|
|
838866
839006
|
messages: params.messages,
|
|
@@ -838892,9 +839032,12 @@ async function checkContextWindowPreflight(deps, turnId, model) {
|
|
|
838892
839032
|
isCompacting: deps.isCompacting,
|
|
838893
839033
|
thresholdPercent: threshold
|
|
838894
839034
|
});
|
|
838895
|
-
|
|
839035
|
+
const modelWarning = deps.modelContextWarning ?? null;
|
|
839036
|
+
const forcedByModelWarning = modelWarning !== null && !deps.isCompacting;
|
|
839037
|
+
if (!forcedByModelWarning && !preflightDecision.shouldCompact && estimatedTokens <= contextWindow)
|
|
838896
839038
|
return "ok";
|
|
838897
|
-
if (autoCompactEnabled && !deps.isCompacting && preflightDecision.shouldCompact) {
|
|
839039
|
+
if (forcedByModelWarning || autoCompactEnabled && !deps.isCompacting && preflightDecision.shouldCompact) {
|
|
839040
|
+
deps.clearModelContextWarning?.();
|
|
838898
839041
|
logger.info("Orchestrator: context window pre-flight - auto-compacting before chat call", {
|
|
838899
839042
|
modelId: model.id,
|
|
838900
839043
|
estimatedTokens,
|
|
@@ -838904,10 +839047,11 @@ async function checkContextWindowPreflight(deps, turnId, model) {
|
|
|
838904
839047
|
thresholdTokens: preflightDecision.thresholdTokens,
|
|
838905
839048
|
remainingTokens: preflightDecision.remainingTokens,
|
|
838906
839049
|
safetyBufferTokens: preflightDecision.safetyBufferTokens,
|
|
838907
|
-
reason: preflightDecision.reason
|
|
839050
|
+
reason: forcedByModelWarning ? "model-warning" : preflightDecision.reason,
|
|
839051
|
+
...modelWarning?.providerStopReason ? { providerStopReason: modelWarning.providerStopReason } : {}
|
|
838908
839052
|
});
|
|
838909
839053
|
deps.setIsCompacting(true);
|
|
838910
|
-
deps.conversation.addSystemMessage(`Context pre-check: request is at ${Math.round(preflightDecision.usagePct)}% (${estimatedTokens}/${contextWindow} tokens), ${formatAutoCompactTrigger(preflightDecision)}. Auto-compacting...`);
|
|
839054
|
+
deps.conversation.addSystemMessage(forcedByModelWarning && modelWarning ? `${describeModelContextWarning(modelWarning)}. Auto-compacting before the next request, regardless of the ~${Math.round(preflightDecision.usagePct)}% estimated usage...` : `Context pre-check: request is at ${Math.round(preflightDecision.usagePct)}% (${estimatedTokens}/${contextWindow} tokens), ${formatAutoCompactTrigger(preflightDecision)}. Auto-compacting...`);
|
|
838911
839055
|
deps.requestRender();
|
|
838912
839056
|
if (deps.hookDispatcher) {
|
|
838913
839057
|
const preResult = await deps.hookDispatcher.fire({
|
|
@@ -838926,7 +839070,7 @@ async function checkContextWindowPreflight(deps, turnId, model) {
|
|
|
838926
839070
|
thresholdTokens: preflightDecision.thresholdTokens,
|
|
838927
839071
|
remainingTokens: preflightDecision.remainingTokens,
|
|
838928
839072
|
safetyBufferTokens: preflightDecision.safetyBufferTokens,
|
|
838929
|
-
reason: preflightDecision.reason
|
|
839073
|
+
reason: forcedByModelWarning ? "model-warning" : preflightDecision.reason
|
|
838930
839074
|
}
|
|
838931
839075
|
}).catch((err2) => {
|
|
838932
839076
|
logger.warn("Pre:compact:preflight hook error", { error: summarizeError(err2) });
|
|
@@ -838964,7 +839108,7 @@ async function checkContextWindowPreflight(deps, turnId, model) {
|
|
|
838964
839108
|
thresholdTokens: preflightDecision.thresholdTokens,
|
|
838965
839109
|
remainingTokens: preflightDecision.remainingTokens,
|
|
838966
839110
|
safetyBufferTokens: preflightDecision.safetyBufferTokens,
|
|
838967
|
-
reason: preflightDecision.reason
|
|
839111
|
+
reason: forcedByModelWarning ? "model-warning" : preflightDecision.reason
|
|
838968
839112
|
}
|
|
838969
839113
|
}).catch((err2) => {
|
|
838970
839114
|
logger.warn("Post:compact:preflight hook error", { error: summarizeError(err2) });
|
|
@@ -838991,7 +839135,7 @@ async function checkContextWindowPreflight(deps, turnId, model) {
|
|
|
838991
839135
|
thresholdTokens: preflightDecision.thresholdTokens,
|
|
838992
839136
|
remainingTokens: preflightDecision.remainingTokens,
|
|
838993
839137
|
safetyBufferTokens: preflightDecision.safetyBufferTokens,
|
|
838994
|
-
reason: preflightDecision.reason,
|
|
839138
|
+
reason: forcedByModelWarning ? "model-warning" : preflightDecision.reason,
|
|
838995
839139
|
error: msg
|
|
838996
839140
|
}
|
|
838997
839141
|
}).catch((err2) => {
|
|
@@ -839045,9 +839189,12 @@ async function handlePostTurnContextMaintenance(deps, turnId, totalTokens) {
|
|
|
839045
839189
|
});
|
|
839046
839190
|
const usagePct = Math.round(autoDecision.usagePct);
|
|
839047
839191
|
const bracket = Math.floor(usagePct / 10) * 10;
|
|
839048
|
-
|
|
839192
|
+
const modelWarning = deps.modelContextWarning ?? null;
|
|
839193
|
+
const forcedByModelWarning = modelWarning !== null && !deps.isCompacting;
|
|
839194
|
+
if (forcedByModelWarning || autoCompactEnabled && autoDecision.shouldCompact) {
|
|
839195
|
+
deps.clearModelContextWarning?.();
|
|
839049
839196
|
deps.setIsCompacting(true);
|
|
839050
|
-
deps.conversation.addSystemMessage(`Context usage at ${usagePct}% (${totalTokens}/${maxTokens} tokens), ${formatAutoCompactTrigger(autoDecision)}. Auto-compacting conversation...`);
|
|
839197
|
+
deps.conversation.addSystemMessage(forcedByModelWarning && modelWarning ? `${describeModelContextWarning(modelWarning)}. Auto-compacting now, regardless of the ~${usagePct}% estimated usage (${totalTokens}/${maxTokens} tokens)...` : `Context usage at ${usagePct}% (${totalTokens}/${maxTokens} tokens), ${formatAutoCompactTrigger(autoDecision)}. Auto-compacting conversation...`);
|
|
839051
839198
|
if (deps.runtimeBus) {
|
|
839052
839199
|
emitOpsContextWarning(deps.runtimeBus, deps.emitterContext(turnId), {
|
|
839053
839200
|
usage: usagePct,
|
|
@@ -839057,7 +839204,7 @@ async function handlePostTurnContextMaintenance(deps, turnId, totalTokens) {
|
|
|
839057
839204
|
thresholdTokens: autoDecision.thresholdTokens,
|
|
839058
839205
|
remainingTokens: autoDecision.remainingTokens,
|
|
839059
839206
|
safetyBufferTokens: autoDecision.safetyBufferTokens,
|
|
839060
|
-
reason: autoDecision.reason ?? "threshold"
|
|
839207
|
+
reason: forcedByModelWarning ? "model-warning" : autoDecision.reason ?? "threshold"
|
|
839061
839208
|
});
|
|
839062
839209
|
}
|
|
839063
839210
|
deps.requestRender();
|
|
@@ -839079,7 +839226,7 @@ async function handlePostTurnContextMaintenance(deps, turnId, totalTokens) {
|
|
|
839079
839226
|
thresholdTokens: autoDecision.thresholdTokens,
|
|
839080
839227
|
remainingTokens: autoDecision.remainingTokens,
|
|
839081
839228
|
safetyBufferTokens: autoDecision.safetyBufferTokens,
|
|
839082
|
-
reason: autoDecision.reason
|
|
839229
|
+
reason: forcedByModelWarning ? "model-warning" : autoDecision.reason
|
|
839083
839230
|
}
|
|
839084
839231
|
}).catch((err2) => {
|
|
839085
839232
|
logger.warn("Pre:compact:auto hook error", { error: summarizeError(err2) });
|
|
@@ -839130,7 +839277,7 @@ async function handlePostTurnContextMaintenance(deps, turnId, totalTokens) {
|
|
|
839130
839277
|
thresholdTokens: autoDecision.thresholdTokens,
|
|
839131
839278
|
remainingTokens: autoDecision.remainingTokens,
|
|
839132
839279
|
safetyBufferTokens: autoDecision.safetyBufferTokens,
|
|
839133
|
-
reason: autoDecision.reason
|
|
839280
|
+
reason: forcedByModelWarning ? "model-warning" : autoDecision.reason
|
|
839134
839281
|
});
|
|
839135
839282
|
if (deps.hookDispatcher) {
|
|
839136
839283
|
deps.hookDispatcher.fire({
|
|
@@ -839149,7 +839296,7 @@ async function handlePostTurnContextMaintenance(deps, turnId, totalTokens) {
|
|
|
839149
839296
|
thresholdTokens: autoDecision.thresholdTokens,
|
|
839150
839297
|
remainingTokens: autoDecision.remainingTokens,
|
|
839151
839298
|
safetyBufferTokens: autoDecision.safetyBufferTokens,
|
|
839152
|
-
reason: autoDecision.reason
|
|
839299
|
+
reason: forcedByModelWarning ? "model-warning" : autoDecision.reason
|
|
839153
839300
|
}
|
|
839154
839301
|
}).catch((err2) => {
|
|
839155
839302
|
logger.warn("Post:compact:auto hook error", { error: summarizeError(err2) });
|
|
@@ -839178,7 +839325,7 @@ async function handlePostTurnContextMaintenance(deps, turnId, totalTokens) {
|
|
|
839178
839325
|
thresholdTokens: autoDecision.thresholdTokens,
|
|
839179
839326
|
remainingTokens: autoDecision.remainingTokens,
|
|
839180
839327
|
safetyBufferTokens: autoDecision.safetyBufferTokens,
|
|
839181
|
-
reason: autoDecision.reason,
|
|
839328
|
+
reason: forcedByModelWarning ? "model-warning" : autoDecision.reason,
|
|
839182
839329
|
error: msg
|
|
839183
839330
|
}
|
|
839184
839331
|
}).catch((err3) => {
|
|
@@ -839711,6 +839858,7 @@ function emitMalformedToolUseWarning(args2) {
|
|
|
839711
839858
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/core/orchestrator-turn-loop.js
|
|
839712
839859
|
init_context_compaction();
|
|
839713
839860
|
init_errors();
|
|
839861
|
+
init_stop_reason_maps();
|
|
839714
839862
|
init_emitters();
|
|
839715
839863
|
init_logger();
|
|
839716
839864
|
init_goodvibes_runtime();
|
|
@@ -840029,6 +840177,13 @@ ${turnKnowledgeBlock}`;
|
|
|
840029
840177
|
}
|
|
840030
840178
|
const reasoningForMsg = reasoningAccumulated || undefined;
|
|
840031
840179
|
const reasoningSummaryForMsg = response.reasoningSummary || undefined;
|
|
840180
|
+
if (isContextOverflowSignal(response.stopReason, response.providerStopReason)) {
|
|
840181
|
+
context.noteModelContextWindowWarning({
|
|
840182
|
+
provider: model.provider,
|
|
840183
|
+
model: model.id,
|
|
840184
|
+
providerStopReason: response.providerStopReason
|
|
840185
|
+
});
|
|
840186
|
+
}
|
|
840032
840187
|
if (response.stopReason === "tool_call" && response.toolCalls.length === 0) {
|
|
840033
840188
|
emitMalformedToolUseWarning({
|
|
840034
840189
|
conversation: context.conversation,
|
|
@@ -840147,6 +840302,7 @@ class Orchestrator {
|
|
|
840147
840302
|
isStreaming = false;
|
|
840148
840303
|
lastWarningBracket = 0;
|
|
840149
840304
|
isCompacting = false;
|
|
840305
|
+
modelContextWarning = null;
|
|
840150
840306
|
sessionId;
|
|
840151
840307
|
currentSubmissionKey = null;
|
|
840152
840308
|
_turnFailed = false;
|
|
@@ -840497,6 +840653,10 @@ class Orchestrator {
|
|
|
840497
840653
|
markTurnFailed: () => {
|
|
840498
840654
|
this._turnFailed = true;
|
|
840499
840655
|
},
|
|
840656
|
+
noteModelContextWindowWarning: (details) => {
|
|
840657
|
+
this.modelContextWarning = details;
|
|
840658
|
+
logger.warn("Orchestrator: model reported context window exhaustion - forcing compaction at next opportunity", details);
|
|
840659
|
+
},
|
|
840500
840660
|
usage: this.usage,
|
|
840501
840661
|
memoryRegistry: this.coreServices.memoryRegistry,
|
|
840502
840662
|
isPassiveKnowledgeInjectionEnabled: () => this.isPassiveKnowledgeInjectionEnabled(),
|
|
@@ -840536,6 +840696,10 @@ class Orchestrator {
|
|
|
840536
840696
|
lastWarningBracket: this.lastWarningBracket,
|
|
840537
840697
|
setLastWarningBracket: (value) => {
|
|
840538
840698
|
this.lastWarningBracket = value;
|
|
840699
|
+
},
|
|
840700
|
+
modelContextWarning: this.modelContextWarning,
|
|
840701
|
+
clearModelContextWarning: () => {
|
|
840702
|
+
this.modelContextWarning = null;
|
|
840539
840703
|
}
|
|
840540
840704
|
}, turnId, this.lastInputTokens);
|
|
840541
840705
|
}
|
|
@@ -840636,6 +840800,10 @@ class Orchestrator {
|
|
|
840636
840800
|
isCompacting: this.isCompacting,
|
|
840637
840801
|
setIsCompacting: (value) => {
|
|
840638
840802
|
this.setCompacting(value);
|
|
840803
|
+
},
|
|
840804
|
+
modelContextWarning: this.modelContextWarning,
|
|
840805
|
+
clearModelContextWarning: () => {
|
|
840806
|
+
this.modelContextWarning = null;
|
|
840639
840807
|
}
|
|
840640
840808
|
}, turnId, model);
|
|
840641
840809
|
}
|
|
@@ -843341,8 +843509,8 @@ class SearchManager {
|
|
|
843341
843509
|
// src/input/input-history.ts
|
|
843342
843510
|
init_utils4();
|
|
843343
843511
|
init_utils4();
|
|
843344
|
-
import { existsSync as existsSync44, mkdirSync as
|
|
843345
|
-
import { dirname as
|
|
843512
|
+
import { existsSync as existsSync44, mkdirSync as mkdirSync35, readFileSync as readFileSync49, writeFileSync as writeFileSync30 } from "fs";
|
|
843513
|
+
import { dirname as dirname38, join as join61 } from "path";
|
|
843346
843514
|
|
|
843347
843515
|
// src/config/surface.ts
|
|
843348
843516
|
var GOODVIBES_AGENT_SURFACE_ROOT = "agent";
|
|
@@ -843427,7 +843595,7 @@ function resolveHistoryPath2(options) {
|
|
|
843427
843595
|
if (!userRoot) {
|
|
843428
843596
|
throw new Error("InputHistory requires historyPath or an explicit userRoot/homeDirectory.");
|
|
843429
843597
|
}
|
|
843430
|
-
return
|
|
843598
|
+
return join61(userRoot, ".goodvibes", GOODVIBES_AGENT_SURFACE_ROOT, "input-history.json");
|
|
843431
843599
|
}
|
|
843432
843600
|
|
|
843433
843601
|
class InputHistory {
|
|
@@ -843499,8 +843667,8 @@ class InputHistory {
|
|
|
843499
843667
|
}
|
|
843500
843668
|
save() {
|
|
843501
843669
|
try {
|
|
843502
|
-
|
|
843503
|
-
|
|
843670
|
+
mkdirSync35(dirname38(this.historyPath), { recursive: true });
|
|
843671
|
+
writeFileSync30(this.historyPath, JSON.stringify(this.entries), "utf-8");
|
|
843504
843672
|
} catch (err2) {
|
|
843505
843673
|
logger.debug("InputHistory save failed (non-fatal)", { error: summarizeError(err2) });
|
|
843506
843674
|
}
|
|
@@ -843508,7 +843676,7 @@ class InputHistory {
|
|
|
843508
843676
|
load() {
|
|
843509
843677
|
try {
|
|
843510
843678
|
if (existsSync44(this.historyPath)) {
|
|
843511
|
-
const raw =
|
|
843679
|
+
const raw = readFileSync49(this.historyPath, "utf-8");
|
|
843512
843680
|
const parsed = JSON.parse(raw);
|
|
843513
843681
|
if (Array.isArray(parsed)) {
|
|
843514
843682
|
this.entries = parsed.map((entry) => this.normalizeStoredEntry(entry)).filter((entry) => entry !== null).slice(0, this.maxEntries);
|
|
@@ -844925,8 +845093,8 @@ init_surface_root();
|
|
|
844925
845093
|
init_fetch_with_timeout();
|
|
844926
845094
|
init_error_display();
|
|
844927
845095
|
import { networkInterfaces } from "os";
|
|
844928
|
-
import { existsSync as existsSync45, readFileSync as
|
|
844929
|
-
import { dirname as
|
|
845096
|
+
import { existsSync as existsSync45, readFileSync as readFileSync50, writeFileSync as writeFileSync31, mkdirSync as mkdirSync36 } from "fs";
|
|
845097
|
+
import { dirname as dirname39 } from "path";
|
|
844930
845098
|
function getPersistedPath(roots) {
|
|
844931
845099
|
return resolveSurfaceDirectory(roots.homeDirectory, roots.surfaceRoot, "discovered-providers.json");
|
|
844932
845100
|
}
|
|
@@ -844935,7 +845103,7 @@ function loadPersistedProviders(roots) {
|
|
|
844935
845103
|
try {
|
|
844936
845104
|
if (!existsSync45(persistedPath))
|
|
844937
845105
|
return [];
|
|
844938
|
-
const raw =
|
|
845106
|
+
const raw = readFileSync50(persistedPath, "utf-8");
|
|
844939
845107
|
const parsed = JSON.parse(raw);
|
|
844940
845108
|
if (!Array.isArray(parsed)) {
|
|
844941
845109
|
logger.warn("[Scanner] loadPersistedProviders ignored invalid discovery cache", { path: persistedPath });
|
|
@@ -844957,7 +845125,7 @@ function persistProviders(roots, servers) {
|
|
|
844957
845125
|
let existing = [];
|
|
844958
845126
|
if (existsSync45(persistedPath)) {
|
|
844959
845127
|
try {
|
|
844960
|
-
const raw =
|
|
845128
|
+
const raw = readFileSync50(persistedPath, "utf-8");
|
|
844961
845129
|
const parsed = JSON.parse(raw);
|
|
844962
845130
|
if (Array.isArray(parsed)) {
|
|
844963
845131
|
existing = parsed.filter((item) => typeof item === "object" && item !== null && typeof item.host === "string" && typeof item.port === "number" && Array.isArray(item.models));
|
|
@@ -844978,8 +845146,8 @@ function persistProviders(roots, servers) {
|
|
|
844978
845146
|
for (const server2 of servers) {
|
|
844979
845147
|
byKey.set(`${server2.host}:${server2.port}`, { ...server2, lastSeen: now3 });
|
|
844980
845148
|
}
|
|
844981
|
-
|
|
844982
|
-
|
|
845149
|
+
mkdirSync36(dirname39(persistedPath), { recursive: true });
|
|
845150
|
+
writeFileSync31(persistedPath, JSON.stringify([...byKey.values()], null, 2) + `
|
|
844983
845151
|
`, "utf-8");
|
|
844984
845152
|
} catch (err2) {
|
|
844985
845153
|
logger.warn("[Scanner] persistProviders failed; discovery cache was not updated", {
|
|
@@ -844996,7 +845164,7 @@ function removePersistedProviders(roots, toRemove) {
|
|
|
844996
845164
|
try {
|
|
844997
845165
|
if (!existsSync45(persistedPath))
|
|
844998
845166
|
return;
|
|
844999
|
-
const raw =
|
|
845167
|
+
const raw = readFileSync50(persistedPath, "utf-8");
|
|
845000
845168
|
const parsed = JSON.parse(raw);
|
|
845001
845169
|
if (!Array.isArray(parsed)) {
|
|
845002
845170
|
logger.warn("[Scanner] removePersistedProviders skipped invalid discovery cache", { path: persistedPath });
|
|
@@ -845005,7 +845173,7 @@ function removePersistedProviders(roots, toRemove) {
|
|
|
845005
845173
|
const current = parsed;
|
|
845006
845174
|
const removeKeys = new Set(toRemove.map((s2) => `${s2.host}:${s2.port}`));
|
|
845007
845175
|
const filtered = current.filter((s2) => !removeKeys.has(`${s2.host}:${s2.port}`));
|
|
845008
|
-
|
|
845176
|
+
writeFileSync31(persistedPath, JSON.stringify(filtered, null, 2) + `
|
|
845009
845177
|
`, "utf-8");
|
|
845010
845178
|
} catch (err2) {
|
|
845011
845179
|
logger.warn("[Scanner] removePersistedProviders failed; discovery cache was not cleaned up", {
|
|
@@ -845475,7 +845643,7 @@ init_logger();
|
|
|
845475
845643
|
init_surface_root();
|
|
845476
845644
|
init_error_display();
|
|
845477
845645
|
import { readdir as readdir5, stat as stat5 } from "fs/promises";
|
|
845478
|
-
import { join as
|
|
845646
|
+
import { join as join62 } from "path";
|
|
845479
845647
|
var KNOWN_NPX_MCP_PACKAGES = [
|
|
845480
845648
|
"@modelcontextprotocol/server-filesystem",
|
|
845481
845649
|
"@modelcontextprotocol/server-github",
|
|
@@ -845498,16 +845666,16 @@ function deriveServerName(nameOrPath) {
|
|
|
845498
845666
|
}
|
|
845499
845667
|
async function findLocalNpxBin(cwd, packageName) {
|
|
845500
845668
|
const binName = packageName.replace(/^@[^/]+\//, "");
|
|
845501
|
-
const localBin =
|
|
845669
|
+
const localBin = join62(cwd, "node_modules", ".bin", binName);
|
|
845502
845670
|
if (await stat5(localBin).then(() => true).catch(() => false))
|
|
845503
845671
|
return localBin;
|
|
845504
|
-
const localPkg =
|
|
845672
|
+
const localPkg = join62(cwd, "node_modules", packageName, "package.json");
|
|
845505
845673
|
if (await stat5(localPkg).then(() => true).catch(() => false))
|
|
845506
845674
|
return packageName;
|
|
845507
845675
|
return null;
|
|
845508
845676
|
}
|
|
845509
845677
|
async function scanProjectMcpDir(roots, knownNames) {
|
|
845510
|
-
const mcpDir =
|
|
845678
|
+
const mcpDir = join62(roots.workingDirectory, ".mcp");
|
|
845511
845679
|
if (!await stat5(mcpDir).then(() => true).catch(() => false))
|
|
845512
845680
|
return [];
|
|
845513
845681
|
const suggestions = [];
|
|
@@ -845516,14 +845684,14 @@ async function scanProjectMcpDir(roots, knownNames) {
|
|
|
845516
845684
|
for (const entry of entries) {
|
|
845517
845685
|
if (entry === "mcp.json")
|
|
845518
845686
|
continue;
|
|
845519
|
-
const entryPath =
|
|
845687
|
+
const entryPath = join62(mcpDir, entry);
|
|
845520
845688
|
try {
|
|
845521
845689
|
const entryStat = await stat5(entryPath);
|
|
845522
845690
|
if (!entryStat.isDirectory())
|
|
845523
845691
|
continue;
|
|
845524
845692
|
const candidates = ["index.js", "index.ts", "server.js", "server.ts", "main.js", "main.ts"];
|
|
845525
845693
|
for (const candidate of candidates) {
|
|
845526
|
-
const candidatePath =
|
|
845694
|
+
const candidatePath = join62(entryPath, candidate);
|
|
845527
845695
|
if (await stat5(candidatePath).then(() => true).catch(() => false)) {
|
|
845528
845696
|
if (knownNames.has(entry))
|
|
845529
845697
|
break;
|
|
@@ -845544,20 +845712,20 @@ async function scanProjectMcpDir(roots, knownNames) {
|
|
|
845544
845712
|
return suggestions;
|
|
845545
845713
|
}
|
|
845546
845714
|
async function scanGoodvibesMcpDir(roots, knownNames) {
|
|
845547
|
-
const mcpDir =
|
|
845715
|
+
const mcpDir = join62(roots.homeDirectory, ".goodvibes", requireSurfaceRoot(roots.surfaceRoot, "MCP discovery surfaceRoot"), "mcp");
|
|
845548
845716
|
if (!await stat5(mcpDir).then(() => true).catch(() => false))
|
|
845549
845717
|
return [];
|
|
845550
845718
|
const suggestions = [];
|
|
845551
845719
|
try {
|
|
845552
845720
|
const entries = await readdir5(mcpDir);
|
|
845553
845721
|
for (const entry of entries) {
|
|
845554
|
-
const entryPath =
|
|
845722
|
+
const entryPath = join62(mcpDir, entry);
|
|
845555
845723
|
try {
|
|
845556
845724
|
const entryStat = await stat5(entryPath);
|
|
845557
845725
|
if (entryStat.isDirectory()) {
|
|
845558
845726
|
const candidates = ["index.js", "index.ts", "server.js", "server.ts"];
|
|
845559
845727
|
for (const candidate of candidates) {
|
|
845560
|
-
const candidatePath =
|
|
845728
|
+
const candidatePath = join62(entryPath, candidate);
|
|
845561
845729
|
if (await stat5(candidatePath).then(() => true).catch(() => false)) {
|
|
845562
845730
|
if (knownNames.has(entry))
|
|
845563
845731
|
break;
|
|
@@ -846045,8 +846213,8 @@ init_fetch_with_timeout();
|
|
|
846045
846213
|
init_version();
|
|
846046
846214
|
import net2 from "net";
|
|
846047
846215
|
import os from "os";
|
|
846048
|
-
import { closeSync as closeSync5, mkdirSync as
|
|
846049
|
-
import { join as
|
|
846216
|
+
import { closeSync as closeSync5, mkdirSync as mkdirSync51, openSync as openSync5 } from "fs";
|
|
846217
|
+
import { join as join89 } from "path";
|
|
846050
846218
|
import { spawn as spawn5 } from "child_process";
|
|
846051
846219
|
|
|
846052
846220
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/runtime/daemon-version-compat.js
|
|
@@ -846087,17 +846255,17 @@ function describeVersionIncompatibility(host, port2, localVersion, remoteVersion
|
|
|
846087
846255
|
init_config6();
|
|
846088
846256
|
|
|
846089
846257
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/runtime/detached-daemon-runtime.js
|
|
846090
|
-
import { mkdirSync as
|
|
846091
|
-
import { dirname as
|
|
846258
|
+
import { mkdirSync as mkdirSync37, readFileSync as readFileSync51, writeFileSync as writeFileSync32 } from "fs";
|
|
846259
|
+
import { dirname as dirname40, join as join63 } from "path";
|
|
846092
846260
|
var DETACHED_DAEMON_RUNTIME_FILE = "detached-daemon.json";
|
|
846093
846261
|
function detachedDaemonRuntimePath(runtimeDir) {
|
|
846094
|
-
return
|
|
846262
|
+
return join63(runtimeDir, DETACHED_DAEMON_RUNTIME_FILE);
|
|
846095
846263
|
}
|
|
846096
846264
|
function recordDetachedDaemonRuntime(runtimeDir, record2) {
|
|
846097
846265
|
const path5 = detachedDaemonRuntimePath(runtimeDir);
|
|
846098
846266
|
try {
|
|
846099
|
-
|
|
846100
|
-
|
|
846267
|
+
mkdirSync37(dirname40(path5), { recursive: true });
|
|
846268
|
+
writeFileSync32(path5, `${JSON.stringify(record2, null, 2)}
|
|
846101
846269
|
`, "utf-8");
|
|
846102
846270
|
return path5;
|
|
846103
846271
|
} catch {
|
|
@@ -846329,8 +846497,8 @@ async function startHostServices(config6, runtimeBus, hookDispatcher, runtimeSer
|
|
|
846329
846497
|
}));
|
|
846330
846498
|
const command8 = (factories.daemonLaunchCommand ?? process.env.GOODVIBES_DAEMON_BINARY ?? "goodvibes-daemon").trim() || "goodvibes-daemon";
|
|
846331
846499
|
const daemonHomeDir = factories.daemonHomeDir ?? os.homedir();
|
|
846332
|
-
const runtimeDir = factories.daemonRuntimeDir ??
|
|
846333
|
-
const logFilePath =
|
|
846500
|
+
const runtimeDir = factories.daemonRuntimeDir ?? join89(daemonHomeDir, ".goodvibes", "daemon");
|
|
846501
|
+
const logFilePath = join89(runtimeDir, "detached-daemon.log");
|
|
846334
846502
|
const args2 = [
|
|
846335
846503
|
"--daemon-home",
|
|
846336
846504
|
daemonHomeDir,
|
|
@@ -846343,7 +846511,7 @@ async function startHostServices(config6, runtimeBus, hookDispatcher, runtimeSer
|
|
|
846343
846511
|
let stdio = "ignore";
|
|
846344
846512
|
let closeStdio = null;
|
|
846345
846513
|
try {
|
|
846346
|
-
|
|
846514
|
+
mkdirSync51(runtimeDir, { recursive: true });
|
|
846347
846515
|
const out2 = openSync5(logFilePath, "a");
|
|
846348
846516
|
const err2 = openSync5(logFilePath, "a");
|
|
846349
846517
|
stdio = ["ignore", out2, err2];
|
|
@@ -851812,14 +851980,14 @@ import { existsSync as existsSync67 } from "fs";
|
|
|
851812
851980
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/runtime/ops/runtime-context.js
|
|
851813
851981
|
init_error_display();
|
|
851814
851982
|
import { AsyncLocalStorage as AsyncLocalStorage2 } from "async_hooks";
|
|
851815
|
-
import { existsSync as existsSync66, readFileSync as
|
|
851983
|
+
import { existsSync as existsSync66, readFileSync as readFileSync68 } from "fs";
|
|
851816
851984
|
var scopedContext = new AsyncLocalStorage2;
|
|
851817
851985
|
function readRecoveryFileMetadata(path7) {
|
|
851818
851986
|
if (!existsSync66(path7)) {
|
|
851819
851987
|
return { ok: false, summary: "Recovery file does not exist." };
|
|
851820
851988
|
}
|
|
851821
851989
|
try {
|
|
851822
|
-
const [firstLine] =
|
|
851990
|
+
const [firstLine] = readFileSync68(path7, "utf-8").split(`
|
|
851823
851991
|
`);
|
|
851824
851992
|
if (!firstLine) {
|
|
851825
851993
|
return { ok: false, summary: "Recovery file exists but is empty." };
|
|
@@ -853076,16 +853244,16 @@ init_registry6();
|
|
|
853076
853244
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/runtime/ecosystem/catalog.js
|
|
853077
853245
|
init_version();
|
|
853078
853246
|
import { createHash as createHash23 } from "crypto";
|
|
853079
|
-
import { cpSync as cpSync3, existsSync as existsSync68, mkdirSync as
|
|
853080
|
-
import { dirname as
|
|
853247
|
+
import { cpSync as cpSync3, existsSync as existsSync68, mkdirSync as mkdirSync52, readFileSync as readFileSync69, readdirSync as readdirSync22, rmSync as rmSync9, statSync as statSync18, writeFileSync as writeFileSync44 } from "fs";
|
|
853248
|
+
import { dirname as dirname51, join as join90, resolve as resolve38 } from "path";
|
|
853081
853249
|
function resolveCatalogRoot(options, scope) {
|
|
853082
853250
|
if (scope === "project") {
|
|
853083
|
-
return options.projectCatalogRoot ??
|
|
853251
|
+
return options.projectCatalogRoot ?? join90(options.cwd, ".goodvibes", "ecosystem");
|
|
853084
853252
|
}
|
|
853085
|
-
return options.userCatalogRoot ??
|
|
853253
|
+
return options.userCatalogRoot ?? join90(options.homeDir, ".goodvibes", "ecosystem");
|
|
853086
853254
|
}
|
|
853087
853255
|
function catalogPath(kind2, options, scope) {
|
|
853088
|
-
return
|
|
853256
|
+
return join90(resolveCatalogRoot(options, scope), `${kind2}s.json`);
|
|
853089
853257
|
}
|
|
853090
853258
|
function catalogPaths(kind2, options) {
|
|
853091
853259
|
return [
|
|
@@ -853095,47 +853263,47 @@ function catalogPaths(kind2, options) {
|
|
|
853095
853263
|
}
|
|
853096
853264
|
function resolveInstallRoot(options, scope) {
|
|
853097
853265
|
if (scope === "project") {
|
|
853098
|
-
return options.projectInstallRoot ??
|
|
853266
|
+
return options.projectInstallRoot ?? join90(options.cwd, ".goodvibes");
|
|
853099
853267
|
}
|
|
853100
|
-
return options.userInstallRoot ??
|
|
853268
|
+
return options.userInstallRoot ?? join90(options.homeDir, ".goodvibes");
|
|
853101
853269
|
}
|
|
853102
853270
|
function installedRoot(kind2, options, scope) {
|
|
853103
853271
|
const base2 = resolveInstallRoot(options, scope);
|
|
853104
853272
|
switch (kind2) {
|
|
853105
853273
|
case "plugin":
|
|
853106
|
-
return
|
|
853274
|
+
return join90(base2, "plugins");
|
|
853107
853275
|
case "skill":
|
|
853108
|
-
return
|
|
853276
|
+
return join90(base2, "skills");
|
|
853109
853277
|
case "hook-pack":
|
|
853110
|
-
return
|
|
853278
|
+
return join90(base2, "hooks", "packs");
|
|
853111
853279
|
case "policy-pack":
|
|
853112
|
-
return
|
|
853280
|
+
return join90(base2, "policies", "packs");
|
|
853113
853281
|
}
|
|
853114
853282
|
}
|
|
853115
853283
|
function installedReceiptsRoot(options, scope) {
|
|
853116
|
-
return
|
|
853284
|
+
return join90(resolveCatalogRoot(options, scope), "installed");
|
|
853117
853285
|
}
|
|
853118
853286
|
function receiptPath(kind2, entryId, options, scope) {
|
|
853119
853287
|
const base2 = installedReceiptsRoot(options, scope);
|
|
853120
|
-
return
|
|
853288
|
+
return join90(base2, `${kind2}-${entryId}.json`);
|
|
853121
853289
|
}
|
|
853122
853290
|
function backupRoot(options, scope) {
|
|
853123
|
-
return
|
|
853291
|
+
return join90(installedReceiptsRoot(options, scope), "backups");
|
|
853124
853292
|
}
|
|
853125
853293
|
function backupPrefix(kind2, entryId) {
|
|
853126
853294
|
return `${kind2}-${entryId}`;
|
|
853127
853295
|
}
|
|
853128
853296
|
function backupMetaPath(kind2, entryId, createdAt, options, scope) {
|
|
853129
|
-
return
|
|
853297
|
+
return join90(backupRoot(options, scope), `${backupPrefix(kind2, entryId)}-${createdAt}.json`);
|
|
853130
853298
|
}
|
|
853131
853299
|
function backupArchivePath(kind2, entryId, createdAt, options, scope) {
|
|
853132
|
-
return
|
|
853300
|
+
return join90(backupRoot(options, scope), `${backupPrefix(kind2, entryId)}-${createdAt}`);
|
|
853133
853301
|
}
|
|
853134
853302
|
function loadReceipt(path7) {
|
|
853135
853303
|
if (!existsSync68(path7))
|
|
853136
853304
|
return null;
|
|
853137
853305
|
try {
|
|
853138
|
-
const parsed = JSON.parse(
|
|
853306
|
+
const parsed = JSON.parse(readFileSync69(path7, "utf-8"));
|
|
853139
853307
|
return parsed?.version === 1 ? parsed : null;
|
|
853140
853308
|
} catch {
|
|
853141
853309
|
return null;
|
|
@@ -853145,7 +853313,7 @@ function loadBackup(path7) {
|
|
|
853145
853313
|
if (!existsSync68(path7))
|
|
853146
853314
|
return null;
|
|
853147
853315
|
try {
|
|
853148
|
-
const parsed = JSON.parse(
|
|
853316
|
+
const parsed = JSON.parse(readFileSync69(path7, "utf-8"));
|
|
853149
853317
|
return parsed?.version === 1 ? parsed : null;
|
|
853150
853318
|
} catch {
|
|
853151
853319
|
return null;
|
|
@@ -853154,12 +853322,12 @@ function loadBackup(path7) {
|
|
|
853154
853322
|
function createBackupFromReceipt(receipt, reason, options) {
|
|
853155
853323
|
const createdAt = Date.now();
|
|
853156
853324
|
const archivedTargetPath = backupArchivePath(receipt.kind, receipt.entry.id, createdAt, options, receipt.scope);
|
|
853157
|
-
|
|
853325
|
+
mkdirSync52(dirname51(archivedTargetPath), { recursive: true });
|
|
853158
853326
|
rmSync9(archivedTargetPath, { recursive: true, force: true });
|
|
853159
853327
|
if (existsSync68(receipt.targetPath)) {
|
|
853160
853328
|
cpSync3(receipt.targetPath, archivedTargetPath, { recursive: true });
|
|
853161
853329
|
} else {
|
|
853162
|
-
|
|
853330
|
+
mkdirSync52(archivedTargetPath, { recursive: true });
|
|
853163
853331
|
}
|
|
853164
853332
|
const backup = {
|
|
853165
853333
|
version: 1,
|
|
@@ -853173,7 +853341,7 @@ function createBackupFromReceipt(receipt, reason, options) {
|
|
|
853173
853341
|
reason
|
|
853174
853342
|
};
|
|
853175
853343
|
const metaPath = backupMetaPath(receipt.kind, receipt.entry.id, createdAt, options, receipt.scope);
|
|
853176
|
-
|
|
853344
|
+
writeFileSync44(metaPath, `${JSON.stringify(backup, null, 2)}
|
|
853177
853345
|
`, "utf-8");
|
|
853178
853346
|
return backup;
|
|
853179
853347
|
}
|
|
@@ -853206,19 +853374,19 @@ function hashPath(path7) {
|
|
|
853206
853374
|
hash2.update(`dir:${path7}`);
|
|
853207
853375
|
for (const name51 of names2) {
|
|
853208
853376
|
hash2.update(name51);
|
|
853209
|
-
hash2.update(hashPath(
|
|
853377
|
+
hash2.update(hashPath(join90(path7, name51)));
|
|
853210
853378
|
}
|
|
853211
853379
|
return hash2.digest("hex");
|
|
853212
853380
|
}
|
|
853213
853381
|
hash2.update(`file:${path7}`);
|
|
853214
|
-
hash2.update(
|
|
853382
|
+
hash2.update(readFileSync69(path7));
|
|
853215
853383
|
return hash2.digest("hex");
|
|
853216
853384
|
}
|
|
853217
853385
|
function readCatalogFile(path7) {
|
|
853218
853386
|
if (!existsSync68(path7))
|
|
853219
853387
|
return [];
|
|
853220
853388
|
try {
|
|
853221
|
-
const parsed = JSON.parse(
|
|
853389
|
+
const parsed = JSON.parse(readFileSync69(path7, "utf-8"));
|
|
853222
853390
|
if (!parsed || parsed.version !== 1 || !Array.isArray(parsed.entries))
|
|
853223
853391
|
return [];
|
|
853224
853392
|
return parsed.entries.filter((entry) => entry && typeof entry.id === "string" && typeof entry.name === "string" && entry.kind !== undefined);
|
|
@@ -853230,7 +853398,7 @@ function readCatalogDocument(path7) {
|
|
|
853230
853398
|
if (!existsSync68(path7))
|
|
853231
853399
|
return { version: 1, entries: [] };
|
|
853232
853400
|
try {
|
|
853233
|
-
const parsed = JSON.parse(
|
|
853401
|
+
const parsed = JSON.parse(readFileSync69(path7, "utf-8"));
|
|
853234
853402
|
if (!parsed || parsed.version !== 1 || !Array.isArray(parsed.entries)) {
|
|
853235
853403
|
return { version: 1, entries: [] };
|
|
853236
853404
|
}
|
|
@@ -853320,12 +853488,12 @@ function installEcosystemCatalogEntry(kind2, entryId, options) {
|
|
|
853320
853488
|
if (!review.sourceExists) {
|
|
853321
853489
|
return { ok: false, error: `Curated ${kind2} source path does not exist: ${review.sourcePath}` };
|
|
853322
853490
|
}
|
|
853323
|
-
const targetPath =
|
|
853491
|
+
const targetPath = join90(installedRoot(kind2, options, scope), entry.id);
|
|
853324
853492
|
const previousReceipt = loadReceipt(receiptPath(kind2, entry.id, options, scope));
|
|
853325
853493
|
if (previousReceipt && !options.skipBackup) {
|
|
853326
853494
|
createBackupFromReceipt(previousReceipt, "replace", options);
|
|
853327
853495
|
}
|
|
853328
|
-
|
|
853496
|
+
mkdirSync52(installedRoot(kind2, options, scope), { recursive: true });
|
|
853329
853497
|
rmSync9(targetPath, { recursive: true, force: true });
|
|
853330
853498
|
cpSync3(review.sourcePath, targetPath, { recursive: true });
|
|
853331
853499
|
const receipt = {
|
|
@@ -853351,8 +853519,8 @@ function installEcosystemCatalogEntry(kind2, entryId, options) {
|
|
|
853351
853519
|
}
|
|
853352
853520
|
};
|
|
853353
853521
|
const path7 = receiptPath(kind2, entry.id, options, scope);
|
|
853354
|
-
|
|
853355
|
-
|
|
853522
|
+
mkdirSync52(dirname51(path7), { recursive: true });
|
|
853523
|
+
writeFileSync44(path7, `${JSON.stringify(receipt, null, 2)}
|
|
853356
853524
|
`, "utf-8");
|
|
853357
853525
|
return { ok: true, receipt };
|
|
853358
853526
|
}
|
|
@@ -853392,7 +853560,7 @@ function listEcosystemInstallBackups(kind2, entryId, options) {
|
|
|
853392
853560
|
if (!existsSync68(dir))
|
|
853393
853561
|
return [];
|
|
853394
853562
|
const prefix = `${backupPrefix(kind2, entryId)}-`;
|
|
853395
|
-
return readdirSync22(dir).filter((name51) => name51.startsWith(prefix) && name51.endsWith(".json")).map((name51) => loadBackup(
|
|
853563
|
+
return readdirSync22(dir).filter((name51) => name51.startsWith(prefix) && name51.endsWith(".json")).map((name51) => loadBackup(join90(dir, name51))).filter((backup) => backup !== null && backup.kind === kind2 && backup.receipt.entry.id === entryId).sort((a4, b3) => b3.createdAt - a4.createdAt);
|
|
853396
853564
|
}
|
|
853397
853565
|
function rollbackInstalledEcosystemEntry(kind2, entryId, options) {
|
|
853398
853566
|
const scope = options.scope ?? "project";
|
|
@@ -853401,10 +853569,10 @@ function rollbackInstalledEcosystemEntry(kind2, entryId, options) {
|
|
|
853401
853569
|
if (!backup) {
|
|
853402
853570
|
return { ok: false, error: `No rollback backup found for ${kind2} ${entryId} in ${scope} scope.` };
|
|
853403
853571
|
}
|
|
853404
|
-
|
|
853572
|
+
mkdirSync52(dirname51(backup.targetPath), { recursive: true });
|
|
853405
853573
|
rmSync9(backup.targetPath, { recursive: true, force: true });
|
|
853406
853574
|
cpSync3(backup.archivedTargetPath, backup.targetPath, { recursive: true });
|
|
853407
|
-
|
|
853575
|
+
writeFileSync44(receiptPath(kind2, entryId, options, scope), `${JSON.stringify(backup.receipt, null, 2)}
|
|
853408
853576
|
`, "utf-8");
|
|
853409
853577
|
return { ok: true, receipt: backup.receipt, restoredFrom: backup };
|
|
853410
853578
|
}
|
|
@@ -853420,7 +853588,7 @@ function listInstalledEcosystemEntries(kind2, options) {
|
|
|
853420
853588
|
for (const name51 of readdirSync22(dir)) {
|
|
853421
853589
|
if (!name51.startsWith(`${kind2}-`) || !name51.endsWith(".json"))
|
|
853422
853590
|
continue;
|
|
853423
|
-
const receipt = loadReceipt(
|
|
853591
|
+
const receipt = loadReceipt(join90(dir, name51));
|
|
853424
853592
|
if (receipt && receipt.kind === kind2)
|
|
853425
853593
|
found.push(receipt);
|
|
853426
853594
|
}
|
|
@@ -853474,8 +853642,8 @@ function importEcosystemCatalogBundle(bundle, options) {
|
|
|
853474
853642
|
if (byKind[kind2].length === 0)
|
|
853475
853643
|
continue;
|
|
853476
853644
|
const path7 = catalogPath(kind2, options, scope);
|
|
853477
|
-
|
|
853478
|
-
|
|
853645
|
+
mkdirSync52(dirname51(path7), { recursive: true });
|
|
853646
|
+
writeFileSync44(path7, `${JSON.stringify({ version: 1, entries: byKind[kind2].sort((a4, b3) => a4.name.localeCompare(b3.name)) }, null, 2)}
|
|
853479
853647
|
`, "utf-8");
|
|
853480
853648
|
pathByKind[kind2] = path7;
|
|
853481
853649
|
imported += byKind[kind2].length;
|
|
@@ -853489,8 +853657,8 @@ function upsertEcosystemCatalogEntry(entry, options) {
|
|
|
853489
853657
|
const nextEntries = document2.entries.filter((candidate) => candidate.id !== entry.id || candidate.kind !== entry.kind);
|
|
853490
853658
|
nextEntries.push(entry);
|
|
853491
853659
|
nextEntries.sort((a4, b3) => a4.name.localeCompare(b3.name));
|
|
853492
|
-
|
|
853493
|
-
|
|
853660
|
+
mkdirSync52(dirname51(path7), { recursive: true });
|
|
853661
|
+
writeFileSync44(path7, `${JSON.stringify({ version: 1, entries: nextEntries }, null, 2)}
|
|
853494
853662
|
`, "utf-8");
|
|
853495
853663
|
return { ok: true, path: path7, entry };
|
|
853496
853664
|
}
|
|
@@ -853502,8 +853670,8 @@ function removeEcosystemCatalogEntry(kind2, entryId, options) {
|
|
|
853502
853670
|
if (nextEntries.length === document2.entries.length) {
|
|
853503
853671
|
return { ok: false, error: `Curated ${kind2} catalog entry not found: ${entryId}` };
|
|
853504
853672
|
}
|
|
853505
|
-
|
|
853506
|
-
|
|
853673
|
+
mkdirSync52(dirname51(path7), { recursive: true });
|
|
853674
|
+
writeFileSync44(path7, `${JSON.stringify({ version: 1, entries: nextEntries }, null, 2)}
|
|
853507
853675
|
`, "utf-8");
|
|
853508
853676
|
return { ok: true, path: path7 };
|
|
853509
853677
|
}
|
|
@@ -856498,8 +856666,8 @@ init_utils4();
|
|
|
856498
856666
|
// src/runtime/lan-scan-consent.ts
|
|
856499
856667
|
init_utils4();
|
|
856500
856668
|
init_utils4();
|
|
856501
|
-
import { existsSync as existsSync69, mkdirSync as
|
|
856502
|
-
import { dirname as
|
|
856669
|
+
import { existsSync as existsSync69, mkdirSync as mkdirSync53, readFileSync as readFileSync70, writeFileSync as writeFileSync45 } from "fs";
|
|
856670
|
+
import { dirname as dirname52 } from "path";
|
|
856503
856671
|
var CONSENT_FILE_NAME = "network-discovery-consent.json";
|
|
856504
856672
|
var DISCOVERED_PROVIDERS_FILE = "discovered-providers.json";
|
|
856505
856673
|
function consentFilePath(roots, surfaceRoot) {
|
|
@@ -856513,7 +856681,7 @@ function loadLanScanConsent(roots, surfaceRoot) {
|
|
|
856513
856681
|
try {
|
|
856514
856682
|
if (!existsSync69(path7))
|
|
856515
856683
|
return;
|
|
856516
|
-
const raw =
|
|
856684
|
+
const raw = readFileSync70(path7, "utf-8");
|
|
856517
856685
|
const parsed = JSON.parse(raw);
|
|
856518
856686
|
if (!parsed || parsed.decision !== "granted" && parsed.decision !== "declined") {
|
|
856519
856687
|
logger.warn("[LanScanConsent] ignoring invalid consent file", { path: path7 });
|
|
@@ -856531,9 +856699,9 @@ function loadLanScanConsent(roots, surfaceRoot) {
|
|
|
856531
856699
|
function saveLanScanConsent(roots, surfaceRoot, decision) {
|
|
856532
856700
|
const path7 = consentFilePath(roots, surfaceRoot);
|
|
856533
856701
|
try {
|
|
856534
|
-
|
|
856702
|
+
mkdirSync53(dirname52(path7), { recursive: true });
|
|
856535
856703
|
const state2 = { decision, decidedAt: new Date().toISOString() };
|
|
856536
|
-
|
|
856704
|
+
writeFileSync45(path7, `${JSON.stringify(state2, null, 2)}
|
|
856537
856705
|
`, "utf-8");
|
|
856538
856706
|
} catch (err2) {
|
|
856539
856707
|
logger.warn("[LanScanConsent] save failed; decision will not persist", { path: path7, error: summarizeError(err2) });
|
|
@@ -856617,8 +856785,8 @@ function runGatedLanScan(options) {
|
|
|
856617
856785
|
init_utils4();
|
|
856618
856786
|
|
|
856619
856787
|
// src/agent/calendar-subscription-registry.ts
|
|
856620
|
-
import { existsSync as existsSync70, mkdirSync as
|
|
856621
|
-
import { dirname as
|
|
856788
|
+
import { existsSync as existsSync70, mkdirSync as mkdirSync54, readFileSync as readFileSync71, renameSync as renameSync12, writeFileSync as writeFileSync46 } from "fs";
|
|
856789
|
+
import { dirname as dirname53 } from "path";
|
|
856622
856790
|
|
|
856623
856791
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/calendar/rrule.js
|
|
856624
856792
|
var WEEKDAY_TOKENS = ["SU", "MO", "TU", "WE", "TH", "FR", "SA"];
|
|
@@ -858400,7 +858568,7 @@ class CalendarSubscriptionRegistry {
|
|
|
858400
858568
|
if (!existsSync70(this.storePath))
|
|
858401
858569
|
return { version: STORE_VERSION, subscriptions: [] };
|
|
858402
858570
|
try {
|
|
858403
|
-
const parsed = JSON.parse(
|
|
858571
|
+
const parsed = JSON.parse(readFileSync71(this.storePath, "utf-8"));
|
|
858404
858572
|
if (!isRecord3(parsed) || !Array.isArray(parsed.subscriptions))
|
|
858405
858573
|
return { version: STORE_VERSION, subscriptions: [] };
|
|
858406
858574
|
const subscriptions = parsed.subscriptions.filter(isRecord3).map(coerceMeta).filter((m3) => m3 !== null);
|
|
@@ -858410,9 +858578,9 @@ class CalendarSubscriptionRegistry {
|
|
|
858410
858578
|
}
|
|
858411
858579
|
}
|
|
858412
858580
|
writeStore(file2) {
|
|
858413
|
-
|
|
858581
|
+
mkdirSync54(dirname53(this.storePath), { recursive: true });
|
|
858414
858582
|
const tmp = `${this.storePath}.tmp`;
|
|
858415
|
-
|
|
858583
|
+
writeFileSync46(tmp, `${JSON.stringify(file2, null, 2)}
|
|
858416
858584
|
`, "utf-8");
|
|
858417
858585
|
renameSync12(tmp, this.storePath);
|
|
858418
858586
|
}
|
|
@@ -860470,7 +860638,7 @@ init_errors();
|
|
|
860470
860638
|
// src/config/index.ts
|
|
860471
860639
|
init_utils4();
|
|
860472
860640
|
init_utils4();
|
|
860473
|
-
import { readFileSync as
|
|
860641
|
+
import { readFileSync as readFileSync72 } from "fs";
|
|
860474
860642
|
|
|
860475
860643
|
// src/config/provider-model.ts
|
|
860476
860644
|
init_config6();
|
|
@@ -860507,7 +860675,7 @@ function getConfiguredSystemPrompt(configManager) {
|
|
|
860507
860675
|
if (!file2)
|
|
860508
860676
|
return;
|
|
860509
860677
|
try {
|
|
860510
|
-
return
|
|
860678
|
+
return readFileSync72(file2, "utf-8");
|
|
860511
860679
|
} catch (err2) {
|
|
860512
860680
|
logger.debug("systemPrompt file read failed (non-fatal)", { file: file2, error: summarizeError(err2) });
|
|
860513
860681
|
return;
|
|
@@ -861469,7 +861637,7 @@ function createDomainDispatch2(store) {
|
|
|
861469
861637
|
}
|
|
861470
861638
|
|
|
861471
861639
|
// src/runtime/services.ts
|
|
861472
|
-
import { join as
|
|
861640
|
+
import { join as join94 } from "path";
|
|
861473
861641
|
|
|
861474
861642
|
// src/config/secrets.ts
|
|
861475
861643
|
init_config6();
|
|
@@ -861546,8 +861714,8 @@ init_utils4();
|
|
|
861546
861714
|
|
|
861547
861715
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/runtime/session-spine/client.js
|
|
861548
861716
|
init_logger();
|
|
861549
|
-
import { existsSync as existsSync71, mkdirSync as
|
|
861550
|
-
import { dirname as
|
|
861717
|
+
import { existsSync as existsSync71, mkdirSync as mkdirSync55, readFileSync as readFileSync73, writeFileSync as writeFileSync47 } from "fs";
|
|
861718
|
+
import { dirname as dirname54 } from "path";
|
|
861551
861719
|
var AGENT_SPINE_PARTICIPANT = {
|
|
861552
861720
|
surfaceKind: "service",
|
|
861553
861721
|
surfaceId: "surface:goodvibes-agent",
|
|
@@ -861830,7 +861998,7 @@ function foldLegacySpineStore(client9, options) {
|
|
|
861830
861998
|
return { folded: 0, skipped: true };
|
|
861831
861999
|
let raw;
|
|
861832
862000
|
try {
|
|
861833
|
-
raw = JSON.parse(
|
|
862001
|
+
raw = JSON.parse(readFileSync73(options.storePath, "utf-8"));
|
|
861834
862002
|
} catch {
|
|
861835
862003
|
return { folded: 0, skipped: false };
|
|
861836
862004
|
}
|
|
@@ -861848,8 +862016,8 @@ function foldLegacySpineStore(client9, options) {
|
|
|
861848
862016
|
}
|
|
861849
862017
|
client9.foldLegacyRecords(records, closedIds);
|
|
861850
862018
|
try {
|
|
861851
|
-
|
|
861852
|
-
|
|
862019
|
+
mkdirSync55(dirname54(options.markerPath), { recursive: true });
|
|
862020
|
+
writeFileSync47(options.markerPath, JSON.stringify({ migratedAt: (options.now ?? Date.now)(), count: records.length, source: options.storePath }, null, 2));
|
|
861853
862021
|
} catch (err2) {
|
|
861854
862022
|
log3.debug("session spine legacy fold marker write failed", { err: err2 });
|
|
861855
862023
|
}
|
|
@@ -862004,13 +862172,13 @@ async function postSessionClose(connection5, sessionId, options = {}) {
|
|
|
862004
862172
|
|
|
862005
862173
|
// src/runtime/connected-host-auth.ts
|
|
862006
862174
|
import { createHash as createHash24 } from "crypto";
|
|
862007
|
-
import { existsSync as existsSync72, readFileSync as
|
|
862008
|
-
import { join as
|
|
862175
|
+
import { existsSync as existsSync72, readFileSync as readFileSync74 } from "fs";
|
|
862176
|
+
import { join as join91 } from "path";
|
|
862009
862177
|
function isRecord7(value) {
|
|
862010
862178
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
862011
862179
|
}
|
|
862012
862180
|
function connectedHostOperatorTokenPath(homeDirectory) {
|
|
862013
|
-
return
|
|
862181
|
+
return join91(homeDirectory, ".goodvibes", "daemon", "operator-tokens.json");
|
|
862014
862182
|
}
|
|
862015
862183
|
function readConnectedHostOperatorToken(homeDirectory) {
|
|
862016
862184
|
const connectedHostEnvToken = process.env.GOODVIBES_CONNECTED_HOST_TOKEN?.trim();
|
|
@@ -862033,7 +862201,7 @@ function readConnectedHostOperatorToken(homeDirectory) {
|
|
|
862033
862201
|
if (!existsSync72(path7))
|
|
862034
862202
|
return { path: path7, present: false, token: null };
|
|
862035
862203
|
try {
|
|
862036
|
-
const parsed = JSON.parse(
|
|
862204
|
+
const parsed = JSON.parse(readFileSync74(path7, "utf-8"));
|
|
862037
862205
|
const token = isRecord7(parsed) && typeof parsed.token === "string" && parsed.token.trim().length > 0 ? parsed.token : null;
|
|
862038
862206
|
return { path: path7, present: true, token };
|
|
862039
862207
|
} catch (error51) {
|
|
@@ -862557,8 +862725,8 @@ init_config13();
|
|
|
862557
862725
|
|
|
862558
862726
|
// src/input/keybindings.ts
|
|
862559
862727
|
init_utils4();
|
|
862560
|
-
import { readFileSync as
|
|
862561
|
-
import { join as
|
|
862728
|
+
import { readFileSync as readFileSync75, existsSync as existsSync73 } from "fs";
|
|
862729
|
+
import { join as join92 } from "path";
|
|
862562
862730
|
init_utils4();
|
|
862563
862731
|
var ACTION_DESCRIPTIONS = {
|
|
862564
862732
|
"copy-selection": "Copy selected text to clipboard",
|
|
@@ -862637,7 +862805,7 @@ function resolveKeybindingsPath(options) {
|
|
|
862637
862805
|
if (options?.surfaceRoot) {
|
|
862638
862806
|
return resolveSurfaceDirectory2(userRoot, options.surfaceRoot, "keybindings.json");
|
|
862639
862807
|
}
|
|
862640
|
-
return
|
|
862808
|
+
return join92(userRoot, ".goodvibes", GOODVIBES_AGENT_SURFACE_ROOT, "keybindings.json");
|
|
862641
862809
|
}
|
|
862642
862810
|
|
|
862643
862811
|
class KeybindingsManager {
|
|
@@ -862660,7 +862828,7 @@ class KeybindingsManager {
|
|
|
862660
862828
|
if (!existsSync73(this.configPath))
|
|
862661
862829
|
return;
|
|
862662
862830
|
try {
|
|
862663
|
-
const raw =
|
|
862831
|
+
const raw = readFileSync75(this.configPath, "utf-8");
|
|
862664
862832
|
const parsed = JSON.parse(raw);
|
|
862665
862833
|
const validActions = new Set(Object.keys(DEFAULT_KEYBINDINGS));
|
|
862666
862834
|
this.bindings = this.cloneDefaults();
|
|
@@ -862767,8 +862935,8 @@ init_tools2();
|
|
|
862767
862935
|
|
|
862768
862936
|
// src/work-plans/work-plan-store.ts
|
|
862769
862937
|
import { createHash as createHash25, randomUUID as randomUUID50 } from "crypto";
|
|
862770
|
-
import { existsSync as existsSync74, mkdirSync as
|
|
862771
|
-
import { dirname as
|
|
862938
|
+
import { existsSync as existsSync74, mkdirSync as mkdirSync56, readFileSync as readFileSync76, renameSync as renameSync13, writeFileSync as writeFileSync48 } from "fs";
|
|
862939
|
+
import { dirname as dirname55, join as join93 } from "path";
|
|
862772
862940
|
var WORK_PLAN_STATUSES = [
|
|
862773
862941
|
"pending",
|
|
862774
862942
|
"in_progress",
|
|
@@ -862870,7 +863038,7 @@ class WorkPlanStore {
|
|
|
862870
863038
|
constructor(options) {
|
|
862871
863039
|
this.options = options;
|
|
862872
863040
|
const fileName = `${safeFileId(options.projectId, options.projectRoot)}.json`;
|
|
862873
|
-
this.filePath =
|
|
863041
|
+
this.filePath = join93(options.homeDirectory, ".goodvibes", GOODVIBES_AGENT_SURFACE_ROOT, "work-plans", fileName);
|
|
862874
863042
|
}
|
|
862875
863043
|
getActivePlan() {
|
|
862876
863044
|
return this.readPlan();
|
|
@@ -862995,7 +863163,7 @@ class WorkPlanStore {
|
|
|
862995
863163
|
readPlan() {
|
|
862996
863164
|
if (!existsSync74(this.filePath))
|
|
862997
863165
|
return this.createEmptyPlan();
|
|
862998
|
-
const raw =
|
|
863166
|
+
const raw = readFileSync76(this.filePath, "utf8");
|
|
862999
863167
|
const parsed = JSON.parse(raw);
|
|
863000
863168
|
if (!isObject4(parsed))
|
|
863001
863169
|
return this.createEmptyPlan();
|
|
@@ -863031,9 +863199,9 @@ class WorkPlanStore {
|
|
|
863031
863199
|
};
|
|
863032
863200
|
}
|
|
863033
863201
|
writePlan(plan) {
|
|
863034
|
-
|
|
863202
|
+
mkdirSync56(dirname55(this.filePath), { recursive: true });
|
|
863035
863203
|
const tmp = `${this.filePath}.${process.pid}.${Date.now()}.tmp`;
|
|
863036
|
-
|
|
863204
|
+
writeFileSync48(tmp, `${JSON.stringify(plan, null, 2)}
|
|
863037
863205
|
`, { mode: 384 });
|
|
863038
863206
|
renameSync13(tmp, this.filePath);
|
|
863039
863207
|
}
|
|
@@ -863534,7 +863702,7 @@ function createRuntimeServices2(options) {
|
|
|
863534
863702
|
});
|
|
863535
863703
|
const agentMessageBus = new AgentMessageBus;
|
|
863536
863704
|
agentMessageBus.setRuntimeBus(options.runtimeBus);
|
|
863537
|
-
const archetypeLoader = new ArchetypeLoader(
|
|
863705
|
+
const archetypeLoader = new ArchetypeLoader(join94(workingDirectory, ".goodvibes", "agents"));
|
|
863538
863706
|
const agentOrchestrator = new AgentOrchestrator({
|
|
863539
863707
|
messageBus: agentMessageBus
|
|
863540
863708
|
});
|
|
@@ -863815,7 +863983,7 @@ function createRuntimeServices2(options) {
|
|
|
863815
863983
|
runtimeBus: options.runtimeBus,
|
|
863816
863984
|
projectRoot: workingDirectory
|
|
863817
863985
|
});
|
|
863818
|
-
const codeIndexStore = new CodeIndexStore(workingDirectory,
|
|
863986
|
+
const codeIndexStore = new CodeIndexStore(workingDirectory, join94(workingDirectory, ".goodvibes", "agent", "code-index.sqlite"), memoryEmbeddingRegistry);
|
|
863819
863987
|
const codeIndexReindexScheduler = new CodeIndexReindexScheduler({
|
|
863820
863988
|
target: codeIndexStore,
|
|
863821
863989
|
workingDirectory,
|
|
@@ -863952,13 +864120,13 @@ init_state();
|
|
|
863952
864120
|
init_utils4();
|
|
863953
864121
|
|
|
863954
864122
|
// src/agent/vibe-file.ts
|
|
863955
|
-
import { existsSync as existsSync76, mkdirSync as
|
|
864123
|
+
import { existsSync as existsSync76, mkdirSync as mkdirSync58, readFileSync as readFileSync78, writeFileSync as writeFileSync50 } from "fs";
|
|
863956
864124
|
import { createHash as createHash26 } from "crypto";
|
|
863957
|
-
import { dirname as
|
|
864125
|
+
import { dirname as dirname57, isAbsolute as isAbsolute14, join as join95, resolve as resolve39 } from "path";
|
|
863958
864126
|
|
|
863959
864127
|
// src/agent/persona-registry.ts
|
|
863960
|
-
import { existsSync as existsSync75, mkdirSync as
|
|
863961
|
-
import { dirname as
|
|
864128
|
+
import { existsSync as existsSync75, mkdirSync as mkdirSync57, readFileSync as readFileSync77, renameSync as renameSync14, writeFileSync as writeFileSync49 } from "fs";
|
|
864129
|
+
import { dirname as dirname56 } from "path";
|
|
863962
864130
|
|
|
863963
864131
|
// src/agent/record-labels.ts
|
|
863964
864132
|
var SOURCE_LABELS = {
|
|
@@ -864357,15 +864525,15 @@ class AgentPersonaRegistry {
|
|
|
864357
864525
|
if (!existsSync75(this.storePath))
|
|
864358
864526
|
return { version: STORE_VERSION2, activePersonaId: null, personas: [] };
|
|
864359
864527
|
try {
|
|
864360
|
-
return parseStore(
|
|
864528
|
+
return parseStore(readFileSync77(this.storePath, "utf-8"));
|
|
864361
864529
|
} catch (error51) {
|
|
864362
864530
|
throw new Error(`Could not read Agent persona store ${error51 instanceof Error ? error51.message : String(error51)}`);
|
|
864363
864531
|
}
|
|
864364
864532
|
}
|
|
864365
864533
|
writeStore(store) {
|
|
864366
|
-
|
|
864534
|
+
mkdirSync57(dirname56(this.storePath), { recursive: true });
|
|
864367
864535
|
const tmpPath = `${this.storePath}.tmp`;
|
|
864368
|
-
|
|
864536
|
+
writeFileSync49(tmpPath, formatStore(store), "utf-8");
|
|
864369
864537
|
renameSync14(tmpPath, this.storePath);
|
|
864370
864538
|
}
|
|
864371
864539
|
}
|
|
@@ -864434,7 +864602,7 @@ function readVibeCandidate(path7, scope) {
|
|
|
864434
864602
|
return null;
|
|
864435
864603
|
let content = "";
|
|
864436
864604
|
try {
|
|
864437
|
-
content =
|
|
864605
|
+
content = readFileSync78(path7, "utf-8");
|
|
864438
864606
|
} catch (error51) {
|
|
864439
864607
|
return {
|
|
864440
864608
|
path: path7,
|
|
@@ -864473,11 +864641,11 @@ function projectWalkRoots(workingDirectory) {
|
|
|
864473
864641
|
let foundGitRoot = false;
|
|
864474
864642
|
for (let depth = 0;depth < MAX_PROJECT_DEPTH; depth += 1) {
|
|
864475
864643
|
roots.push(current);
|
|
864476
|
-
if (existsSync76(
|
|
864644
|
+
if (existsSync76(join95(current, ".git"))) {
|
|
864477
864645
|
foundGitRoot = true;
|
|
864478
864646
|
break;
|
|
864479
864647
|
}
|
|
864480
|
-
const parent =
|
|
864648
|
+
const parent = dirname57(current);
|
|
864481
864649
|
if (parent === current)
|
|
864482
864650
|
break;
|
|
864483
864651
|
current = parent;
|
|
@@ -864488,12 +864656,12 @@ function projectWalkRoots(workingDirectory) {
|
|
|
864488
864656
|
}
|
|
864489
864657
|
function candidatePaths(shellPaths) {
|
|
864490
864658
|
const candidates = [];
|
|
864491
|
-
candidates.push({ path:
|
|
864659
|
+
candidates.push({ path: join95(shellPaths.homeDirectory, ".goodvibes", "VIBE.md"), scope: "global" });
|
|
864492
864660
|
candidates.push({ path: shellPaths.resolveUserPath(GOODVIBES_AGENT_SURFACE_ROOT, "VIBE.md"), scope: "global" });
|
|
864493
864661
|
for (const root of projectWalkRoots(shellPaths.workingDirectory)) {
|
|
864494
|
-
candidates.push({ path:
|
|
864495
|
-
candidates.push({ path:
|
|
864496
|
-
candidates.push({ path:
|
|
864662
|
+
candidates.push({ path: join95(root, "VIBE.md"), scope: "project" });
|
|
864663
|
+
candidates.push({ path: join95(root, ".goodvibes", "VIBE.md"), scope: "project" });
|
|
864664
|
+
candidates.push({ path: join95(root, ".goodvibes", GOODVIBES_AGENT_SURFACE_ROOT, "VIBE.md"), scope: "project" });
|
|
864497
864665
|
}
|
|
864498
864666
|
return candidates;
|
|
864499
864667
|
}
|
|
@@ -864510,7 +864678,7 @@ function dedupeCandidates(candidates) {
|
|
|
864510
864678
|
return result2;
|
|
864511
864679
|
}
|
|
864512
864680
|
function projectVibeInitPath(shellPaths) {
|
|
864513
|
-
return
|
|
864681
|
+
return join95(shellPaths.workingDirectory, "VIBE.md");
|
|
864514
864682
|
}
|
|
864515
864683
|
function globalVibeInitPath(shellPaths) {
|
|
864516
864684
|
return shellPaths.resolveUserPath(GOODVIBES_AGENT_SURFACE_ROOT, "VIBE.md");
|
|
@@ -864546,7 +864714,7 @@ function readVibeImportMarker(path7) {
|
|
|
864546
864714
|
if (!existsSync76(path7))
|
|
864547
864715
|
return { migrated: {} };
|
|
864548
864716
|
try {
|
|
864549
|
-
const parsed = JSON.parse(
|
|
864717
|
+
const parsed = JSON.parse(readFileSync78(path7, "utf-8"));
|
|
864550
864718
|
const migrated = parsed?.migrated;
|
|
864551
864719
|
if (migrated && typeof migrated === "object" && !Array.isArray(migrated)) {
|
|
864552
864720
|
const out2 = {};
|
|
@@ -864560,8 +864728,8 @@ function readVibeImportMarker(path7) {
|
|
|
864560
864728
|
return { migrated: {} };
|
|
864561
864729
|
}
|
|
864562
864730
|
function writeVibeImportMarker(path7, marker) {
|
|
864563
|
-
|
|
864564
|
-
|
|
864731
|
+
mkdirSync58(dirname57(path7), { recursive: true });
|
|
864732
|
+
writeFileSync50(path7, `${JSON.stringify(marker, null, 2)}
|
|
864565
864733
|
`, "utf-8");
|
|
864566
864734
|
}
|
|
864567
864735
|
function hashVibeBody(body2) {
|
|
@@ -864624,8 +864792,8 @@ function initVibeFile(shellPaths, options = {}) {
|
|
|
864624
864792
|
const path7 = options.scope === "global" ? globalVibeInitPath(shellPaths) : projectVibeInitPath(shellPaths);
|
|
864625
864793
|
if (existsSync76(path7) && !options.force)
|
|
864626
864794
|
return { path: path7, created: false };
|
|
864627
|
-
|
|
864628
|
-
|
|
864795
|
+
mkdirSync58(dirname57(path7), { recursive: true });
|
|
864796
|
+
writeFileSync50(path7, `${DEFAULT_VIBE_BODY}
|
|
864629
864797
|
`, "utf-8");
|
|
864630
864798
|
return { path: path7, created: true };
|
|
864631
864799
|
}
|
|
@@ -866193,8 +866361,8 @@ function formatAgentChannelDeliveryResult(result2) {
|
|
|
866193
866361
|
|
|
866194
866362
|
// src/agent/channel-delivery-receipts.ts
|
|
866195
866363
|
import { createHash as createHash27, randomUUID as randomUUID51 } from "crypto";
|
|
866196
|
-
import { existsSync as existsSync77, mkdirSync as
|
|
866197
|
-
import { dirname as
|
|
866364
|
+
import { existsSync as existsSync77, mkdirSync as mkdirSync59, readFileSync as readFileSync79, renameSync as renameSync15, writeFileSync as writeFileSync51 } from "fs";
|
|
866365
|
+
import { dirname as dirname58 } from "path";
|
|
866198
866366
|
var RECEIPT_VERSION = 1;
|
|
866199
866367
|
var RECEIPT_LIMIT = 100;
|
|
866200
866368
|
var MESSAGE_PREVIEW_LIMIT = 120;
|
|
@@ -866358,7 +866526,7 @@ function readAgentChannelDeliveryReceipts(shellPaths) {
|
|
|
866358
866526
|
if (!existsSync77(path7))
|
|
866359
866527
|
return { path: path7, exists: false, receipts: [] };
|
|
866360
866528
|
try {
|
|
866361
|
-
const parsed = JSON.parse(
|
|
866529
|
+
const parsed = JSON.parse(readFileSync79(path7, "utf-8"));
|
|
866362
866530
|
return { path: path7, exists: true, receipts: parseReceiptFile(parsed).receipts };
|
|
866363
866531
|
} catch (error51) {
|
|
866364
866532
|
return {
|
|
@@ -866394,9 +866562,9 @@ function recordAgentChannelDeliveryReceipt(shellPaths, input) {
|
|
|
866394
866562
|
version: RECEIPT_VERSION,
|
|
866395
866563
|
receipts: [receipt, ...current].slice(0, RECEIPT_LIMIT)
|
|
866396
866564
|
};
|
|
866397
|
-
|
|
866565
|
+
mkdirSync59(dirname58(path7), { recursive: true });
|
|
866398
866566
|
const tempPath = `${path7}.tmp`;
|
|
866399
|
-
|
|
866567
|
+
writeFileSync51(tempPath, `${JSON.stringify(next, null, 2)}
|
|
866400
866568
|
`, "utf-8");
|
|
866401
866569
|
renameSync15(tempPath, path7);
|
|
866402
866570
|
return receipt;
|
|
@@ -867145,8 +867313,8 @@ function createBrowserGoodVibesSdk(options = {}) {
|
|
|
867145
867313
|
init_utils4();
|
|
867146
867314
|
|
|
867147
867315
|
// src/agent/routine-schedule-promotion.ts
|
|
867148
|
-
import { existsSync as existsSync78, readFileSync as
|
|
867149
|
-
import { join as
|
|
867316
|
+
import { existsSync as existsSync78, readFileSync as readFileSync80 } from "fs";
|
|
867317
|
+
import { join as join96 } from "path";
|
|
867150
867318
|
init_utils4();
|
|
867151
867319
|
var ROUTINE_SCHEDULE_ROUTE = "/api/automation/schedules";
|
|
867152
867320
|
var ROUTINE_SCHEDULE_METHOD = "automation.schedules.create";
|
|
@@ -867179,11 +867347,11 @@ function toDeliveryTargetInput(target) {
|
|
|
867179
867347
|
function resolveAgentConnectedHostConnection(configManager, homeDirectory) {
|
|
867180
867348
|
const host = String(configManager.get("controlPlane.host") ?? "127.0.0.1");
|
|
867181
867349
|
const port2 = Number(configManager.get("controlPlane.port") ?? 3421);
|
|
867182
|
-
const tokenPath =
|
|
867350
|
+
const tokenPath = join96(homeDirectory, ".goodvibes", "daemon", "operator-tokens.json");
|
|
867183
867351
|
if (!existsSync78(tokenPath))
|
|
867184
867352
|
return { baseUrl: `http://${host}:${Number.isFinite(port2) ? port2 : 3421}`, token: null, tokenPath };
|
|
867185
867353
|
try {
|
|
867186
|
-
const parsed = JSON.parse(
|
|
867354
|
+
const parsed = JSON.parse(readFileSync80(tokenPath, "utf-8"));
|
|
867187
867355
|
const token = isRecord16(parsed) && typeof parsed.token === "string" ? parsed.token : null;
|
|
867188
867356
|
return { baseUrl: `http://${host}:${Number.isFinite(port2) ? port2 : 3421}`, token, tokenPath };
|
|
867189
867357
|
} catch {
|
|
@@ -868094,7 +868262,7 @@ function registerAgentAutonomyScheduleTool(registry5, shellPaths, configManager)
|
|
|
868094
868262
|
init_utils4();
|
|
868095
868263
|
import { existsSync as existsSync79 } from "fs";
|
|
868096
868264
|
import { mkdir as mkdir4, stat as stat7, writeFile as writeFile10 } from "fs/promises";
|
|
868097
|
-
import { dirname as
|
|
868265
|
+
import { dirname as dirname59, join as join97 } from "path";
|
|
868098
868266
|
|
|
868099
868267
|
// src/tools/artifact-archive.ts
|
|
868100
868268
|
import { deflateRawSync } from "zlib";
|
|
@@ -868462,7 +868630,7 @@ async function exportArtifactToFile(store, args2, options) {
|
|
|
868462
868630
|
if (existsSync79(resolvedPath3) && !overwrite) {
|
|
868463
868631
|
throw new Error(`Export target already exists: ${resolvedPath3}. Pass overwrite:true only after the user confirms replacement.`);
|
|
868464
868632
|
}
|
|
868465
|
-
await mkdir4(
|
|
868633
|
+
await mkdir4(dirname59(resolvedPath3), { recursive: true });
|
|
868466
868634
|
await writeFile10(resolvedPath3, buffer);
|
|
868467
868635
|
return [
|
|
868468
868636
|
"Exported Agent artifact",
|
|
@@ -868569,8 +868737,8 @@ function buildArtifactPackagePayload(loaded) {
|
|
|
868569
868737
|
}
|
|
868570
868738
|
async function writeArtifactPackageDirectory(resolvedPath3, payload) {
|
|
868571
868739
|
for (const entry of payload.entries) {
|
|
868572
|
-
const target =
|
|
868573
|
-
await mkdir4(
|
|
868740
|
+
const target = join97(resolvedPath3, ...entry.path.split("/"));
|
|
868741
|
+
await mkdir4(dirname59(target), { recursive: true });
|
|
868574
868742
|
await writeFile10(target, entry.buffer);
|
|
868575
868743
|
}
|
|
868576
868744
|
}
|
|
@@ -868595,13 +868763,13 @@ async function exportArtifactPackage(store, args2, options) {
|
|
|
868595
868763
|
const loaded = await loadArtifactsForPackage(store, args2, "package");
|
|
868596
868764
|
const payload = buildArtifactPackagePayload(loaded);
|
|
868597
868765
|
await writeArtifactPackageDirectory(resolvedPath3, payload);
|
|
868598
|
-
const artifactDir =
|
|
868766
|
+
const artifactDir = join97(resolvedPath3, "artifacts");
|
|
868599
868767
|
return [
|
|
868600
868768
|
"Exported Agent artifact package",
|
|
868601
868769
|
` path ${resolvedPath3}`,
|
|
868602
868770
|
` artifacts ${payload.artifactCount}`,
|
|
868603
868771
|
` bytes ${payload.totalBytes}`,
|
|
868604
|
-
` manifest ${
|
|
868772
|
+
` manifest ${join97(resolvedPath3, "manifest.json")}`,
|
|
868605
868773
|
` files ${artifactDir}`,
|
|
868606
868774
|
` overwrite ${overwrite ? "yes" : "no"}`,
|
|
868607
868775
|
" policy exact artifact bytes copied; metadata redacted; artifacts retained; content not printed"
|
|
@@ -868629,7 +868797,7 @@ async function exportArtifactArchive(store, args2, options) {
|
|
|
868629
868797
|
const loaded = await loadArtifactsForPackage(store, args2, "archive");
|
|
868630
868798
|
const payload = buildArtifactPackagePayload(loaded);
|
|
868631
868799
|
const archive = createZipArchive(payload.entries);
|
|
868632
|
-
await mkdir4(
|
|
868800
|
+
await mkdir4(dirname59(resolvedPath3), { recursive: true });
|
|
868633
868801
|
await writeFile10(resolvedPath3, archive);
|
|
868634
868802
|
return [
|
|
868635
868803
|
"Exported Agent artifact archive",
|
|
@@ -868766,8 +868934,8 @@ function registerAgentArtifactsTool(registry5, artifactStore, options = {}) {
|
|
|
868766
868934
|
}
|
|
868767
868935
|
|
|
868768
868936
|
// src/agent/document-registry.ts
|
|
868769
|
-
import { existsSync as existsSync80, mkdirSync as
|
|
868770
|
-
import { dirname as
|
|
868937
|
+
import { existsSync as existsSync80, mkdirSync as mkdirSync60, readFileSync as readFileSync81, renameSync as renameSync16, writeFileSync as writeFileSync52 } from "fs";
|
|
868938
|
+
import { dirname as dirname60 } from "path";
|
|
868771
868939
|
var STORE_VERSION3 = 1;
|
|
868772
868940
|
var MAX_VERSIONS = 50;
|
|
868773
868941
|
function isRecord18(value) {
|
|
@@ -869357,15 +869525,15 @@ class AgentDocumentRegistry {
|
|
|
869357
869525
|
if (!existsSync80(this.storePath))
|
|
869358
869526
|
return { version: STORE_VERSION3, documents: [] };
|
|
869359
869527
|
try {
|
|
869360
|
-
return parseStore2(
|
|
869528
|
+
return parseStore2(readFileSync81(this.storePath, "utf-8"));
|
|
869361
869529
|
} catch (error51) {
|
|
869362
869530
|
throw new Error(`Could not read Agent document store: ${error51 instanceof Error ? error51.message : String(error51)}`);
|
|
869363
869531
|
}
|
|
869364
869532
|
}
|
|
869365
869533
|
writeStore(store) {
|
|
869366
|
-
|
|
869534
|
+
mkdirSync60(dirname60(this.storePath), { recursive: true });
|
|
869367
869535
|
const tempPath = `${this.storePath}.tmp`;
|
|
869368
|
-
|
|
869536
|
+
writeFileSync52(tempPath, formatStore2(store), "utf-8");
|
|
869369
869537
|
renameSync16(tempPath, this.storePath);
|
|
869370
869538
|
}
|
|
869371
869539
|
validateRequired(title, body2) {
|
|
@@ -871671,16 +871839,16 @@ function registerAgentKnowledgeTool(registry5, shellPaths, configManager) {
|
|
|
871671
871839
|
}
|
|
871672
871840
|
|
|
871673
871841
|
// src/agent/routine-registry.ts
|
|
871674
|
-
import { existsSync as existsSync83, mkdirSync as
|
|
871675
|
-
import { dirname as
|
|
871842
|
+
import { existsSync as existsSync83, mkdirSync as mkdirSync63, readFileSync as readFileSync83, renameSync as renameSync18, writeFileSync as writeFileSync55 } from "fs";
|
|
871843
|
+
import { dirname as dirname62 } from "path";
|
|
871676
871844
|
|
|
871677
871845
|
// src/agent/skill-registry.ts
|
|
871678
|
-
import { accessSync, constants as constants4, existsSync as existsSync82, mkdirSync as
|
|
871679
|
-
import { delimiter, dirname as
|
|
871846
|
+
import { accessSync, constants as constants4, existsSync as existsSync82, mkdirSync as mkdirSync62, readFileSync as readFileSync82, renameSync as renameSync17, writeFileSync as writeFileSync54 } from "fs";
|
|
871847
|
+
import { delimiter, dirname as dirname61, join as join99 } from "path";
|
|
871680
871848
|
|
|
871681
871849
|
// src/agent/skill-standard.ts
|
|
871682
|
-
import { existsSync as existsSync81, mkdirSync as
|
|
871683
|
-
import { join as
|
|
871850
|
+
import { existsSync as existsSync81, mkdirSync as mkdirSync61, writeFileSync as writeFileSync53 } from "fs";
|
|
871851
|
+
import { join as join98 } from "path";
|
|
871684
871852
|
function parseStandardFrontmatter(content) {
|
|
871685
871853
|
const match = content.match(/^---\n([\s\S]*?)\n---/);
|
|
871686
871854
|
if (!match)
|
|
@@ -871733,13 +871901,13 @@ function writeSkillStandardFile(skill, destDir, overwrite = false) {
|
|
|
871733
871901
|
if (!slug) {
|
|
871734
871902
|
throw new Error("skill name produces an empty folder name");
|
|
871735
871903
|
}
|
|
871736
|
-
const dir =
|
|
871737
|
-
const filePath =
|
|
871904
|
+
const dir = join98(destDir, slug);
|
|
871905
|
+
const filePath = join98(dir, "SKILL.md");
|
|
871738
871906
|
if (!overwrite && existsSync81(filePath)) {
|
|
871739
871907
|
throw new Error(`Skill file already exists at ${filePath}. Pass --overwrite to replace it.`);
|
|
871740
871908
|
}
|
|
871741
|
-
|
|
871742
|
-
|
|
871909
|
+
mkdirSync61(dir, { recursive: true });
|
|
871910
|
+
writeFileSync53(filePath, renderSkillStandardMarkdown(skill), "utf-8");
|
|
871743
871911
|
return filePath;
|
|
871744
871912
|
}
|
|
871745
871913
|
|
|
@@ -871840,7 +872008,7 @@ function canExecute(path7) {
|
|
|
871840
872008
|
function commandExists(command8, pathValue) {
|
|
871841
872009
|
if (!pathValue)
|
|
871842
872010
|
return false;
|
|
871843
|
-
return pathValue.split(delimiter).filter(Boolean).some((pathEntry) => canExecute(
|
|
872011
|
+
return pathValue.split(delimiter).filter(Boolean).some((pathEntry) => canExecute(join99(pathEntry, command8)));
|
|
871844
872012
|
}
|
|
871845
872013
|
function parseSkill(value) {
|
|
871846
872014
|
if (!isRecord22(value))
|
|
@@ -872307,15 +872475,15 @@ class AgentSkillRegistry {
|
|
|
872307
872475
|
if (!existsSync82(this.storePath))
|
|
872308
872476
|
return { version: STORE_VERSION4, skills: [], bundles: [] };
|
|
872309
872477
|
try {
|
|
872310
|
-
return parseStore3(
|
|
872478
|
+
return parseStore3(readFileSync82(this.storePath, "utf-8"));
|
|
872311
872479
|
} catch (error51) {
|
|
872312
872480
|
throw new Error(`Could not read Agent skill store ${error51 instanceof Error ? error51.message : String(error51)}`);
|
|
872313
872481
|
}
|
|
872314
872482
|
}
|
|
872315
872483
|
writeStore(store) {
|
|
872316
|
-
|
|
872484
|
+
mkdirSync62(dirname61(this.storePath), { recursive: true });
|
|
872317
872485
|
const tmpPath = `${this.storePath}.tmp`;
|
|
872318
|
-
|
|
872486
|
+
writeFileSync54(tmpPath, formatStore3(store), "utf-8");
|
|
872319
872487
|
renameSync17(tmpPath, this.storePath);
|
|
872320
872488
|
}
|
|
872321
872489
|
}
|
|
@@ -872760,15 +872928,15 @@ class AgentRoutineRegistry {
|
|
|
872760
872928
|
if (!existsSync83(this.storePath))
|
|
872761
872929
|
return { version: STORE_VERSION5, routines: [] };
|
|
872762
872930
|
try {
|
|
872763
|
-
return parseStore4(
|
|
872931
|
+
return parseStore4(readFileSync83(this.storePath, "utf-8"));
|
|
872764
872932
|
} catch (error51) {
|
|
872765
872933
|
throw new Error(`Could not read Agent routine store ${error51 instanceof Error ? error51.message : String(error51)}`);
|
|
872766
872934
|
}
|
|
872767
872935
|
}
|
|
872768
872936
|
writeStore(store) {
|
|
872769
|
-
|
|
872937
|
+
mkdirSync63(dirname62(this.storePath), { recursive: true });
|
|
872770
872938
|
const tmpPath = `${this.storePath}.tmp`;
|
|
872771
|
-
|
|
872939
|
+
writeFileSync55(tmpPath, formatStore4(store), "utf-8");
|
|
872772
872940
|
renameSync18(tmpPath, this.storePath);
|
|
872773
872941
|
}
|
|
872774
872942
|
}
|
|
@@ -872810,8 +872978,8 @@ function buildEnabledRoutinesPrompt(shellPaths) {
|
|
|
872810
872978
|
}
|
|
872811
872979
|
|
|
872812
872980
|
// src/tools/agent-learning-consolidation-core.ts
|
|
872813
|
-
import { existsSync as existsSync93, mkdirSync as
|
|
872814
|
-
import { dirname as
|
|
872981
|
+
import { existsSync as existsSync93, mkdirSync as mkdirSync72, readFileSync as readFileSync94, renameSync as renameSync24, writeFileSync as writeFileSync64 } from "fs";
|
|
872982
|
+
import { dirname as dirname71 } from "path";
|
|
872815
872983
|
|
|
872816
872984
|
// src/input/agent-workspace-snapshot.ts
|
|
872817
872985
|
import { basename as basename7, sep as sep5 } from "path";
|
|
@@ -872912,8 +873080,8 @@ function buildReviewedMemoryPrompt(memoryRegistry, options = {}) {
|
|
|
872912
873080
|
}
|
|
872913
873081
|
|
|
872914
873082
|
// src/agent/behavior-discovery-summary.ts
|
|
872915
|
-
import { readdirSync as readdirSync23, readFileSync as
|
|
872916
|
-
import { join as
|
|
873083
|
+
import { readdirSync as readdirSync23, readFileSync as readFileSync84 } from "fs";
|
|
873084
|
+
import { join as join100 } from "path";
|
|
872917
873085
|
var EMPTY_SUMMARY = {
|
|
872918
873086
|
count: 0,
|
|
872919
873087
|
projectLocalCount: 0,
|
|
@@ -872928,7 +873096,7 @@ var EMPTY_AGENT_BEHAVIOR_DISCOVERY_SNAPSHOT = {
|
|
|
872928
873096
|
function readDiscoveryCandidate(path7, origin, definition) {
|
|
872929
873097
|
let content = "";
|
|
872930
873098
|
try {
|
|
872931
|
-
content =
|
|
873099
|
+
content = readFileSync84(path7, "utf-8");
|
|
872932
873100
|
} catch {
|
|
872933
873101
|
return null;
|
|
872934
873102
|
}
|
|
@@ -872942,8 +873110,8 @@ function readDiscoveryCandidate(path7, origin, definition) {
|
|
|
872942
873110
|
}
|
|
872943
873111
|
function candidatePaths2(root, entry, markers) {
|
|
872944
873112
|
if (entry.endsWith(".md"))
|
|
872945
|
-
return [
|
|
872946
|
-
return markers.map((marker) =>
|
|
873113
|
+
return [join100(root, entry)];
|
|
873114
|
+
return markers.map((marker) => join100(root, entry, marker));
|
|
872947
873115
|
}
|
|
872948
873116
|
function summarizeDefinition(definition, limit3) {
|
|
872949
873117
|
const seen = new Set;
|
|
@@ -872990,29 +873158,29 @@ function definitions(shellPaths) {
|
|
|
872990
873158
|
const homeDir = shellPaths.homeDirectory;
|
|
872991
873159
|
const personas = {
|
|
872992
873160
|
roots: [
|
|
872993
|
-
{ root:
|
|
872994
|
-
{ root:
|
|
872995
|
-
{ root:
|
|
872996
|
-
{ root:
|
|
873161
|
+
{ root: join100(cwd, ".goodvibes", "personas"), origin: "project-local" },
|
|
873162
|
+
{ root: join100(cwd, ".goodvibes", GOODVIBES_AGENT_SURFACE_ROOT, "personas"), origin: "project-local" },
|
|
873163
|
+
{ root: join100(homeDir, ".goodvibes", "personas"), origin: "global" },
|
|
873164
|
+
{ root: join100(homeDir, ".goodvibes", GOODVIBES_AGENT_SURFACE_ROOT, "personas"), origin: "global" }
|
|
872997
873165
|
],
|
|
872998
873166
|
markers: ["PERSONA.md", "persona.md"],
|
|
872999
873167
|
frontmatterBodyKey: "system_prompt"
|
|
873000
873168
|
};
|
|
873001
873169
|
const skills = {
|
|
873002
873170
|
roots: [
|
|
873003
|
-
{ root:
|
|
873004
|
-
{ root:
|
|
873005
|
-
{ root:
|
|
873006
|
-
{ root:
|
|
873171
|
+
{ root: join100(cwd, ".goodvibes", "skills"), origin: "project-local" },
|
|
873172
|
+
{ root: join100(cwd, ".goodvibes", GOODVIBES_AGENT_SURFACE_ROOT, "skills"), origin: "project-local" },
|
|
873173
|
+
{ root: join100(homeDir, ".goodvibes", "skills"), origin: "global" },
|
|
873174
|
+
{ root: join100(homeDir, ".goodvibes", GOODVIBES_AGENT_SURFACE_ROOT, "skills"), origin: "global" }
|
|
873007
873175
|
],
|
|
873008
873176
|
markers: ["SKILL.md"]
|
|
873009
873177
|
};
|
|
873010
873178
|
const routines = {
|
|
873011
873179
|
roots: [
|
|
873012
|
-
{ root:
|
|
873013
|
-
{ root:
|
|
873014
|
-
{ root:
|
|
873015
|
-
{ root:
|
|
873180
|
+
{ root: join100(cwd, ".goodvibes", "routines"), origin: "project-local" },
|
|
873181
|
+
{ root: join100(cwd, ".goodvibes", GOODVIBES_AGENT_SURFACE_ROOT, "routines"), origin: "project-local" },
|
|
873182
|
+
{ root: join100(homeDir, ".goodvibes", "routines"), origin: "global" },
|
|
873183
|
+
{ root: join100(homeDir, ".goodvibes", GOODVIBES_AGENT_SURFACE_ROOT, "routines"), origin: "global" }
|
|
873016
873184
|
],
|
|
873017
873185
|
markers: ["ROUTINE.md", "routine.md"],
|
|
873018
873186
|
frontmatterBodyKey: "steps"
|
|
@@ -874466,8 +874634,8 @@ function buildAgentWorkspaceVoiceMediaReadiness(options) {
|
|
|
874466
874634
|
}
|
|
874467
874635
|
|
|
874468
874636
|
// src/agent/project-context-files.ts
|
|
874469
|
-
import { existsSync as existsSync84, readFileSync as
|
|
874470
|
-
import { dirname as
|
|
874637
|
+
import { existsSync as existsSync84, readFileSync as readFileSync85, readdirSync as readdirSync24, statSync as statSync19 } from "fs";
|
|
874638
|
+
import { dirname as dirname63, isAbsolute as isAbsolute15, join as join101, relative as relative18, resolve as resolve40 } from "path";
|
|
874471
874639
|
var MAX_CONTEXT_FILE_CHARS = 1e4;
|
|
874472
874640
|
var MAX_TOTAL_CONTEXT_CHARS = 32000;
|
|
874473
874641
|
var MAX_PROJECT_DEPTH2 = 32;
|
|
@@ -874481,9 +874649,9 @@ function safeStat(path7) {
|
|
|
874481
874649
|
function findGitRoot(workingDirectory) {
|
|
874482
874650
|
let current = resolve40(workingDirectory);
|
|
874483
874651
|
for (let depth = 0;depth < MAX_PROJECT_DEPTH2; depth += 1) {
|
|
874484
|
-
if (existsSync84(
|
|
874652
|
+
if (existsSync84(join101(current, ".git")))
|
|
874485
874653
|
return current;
|
|
874486
|
-
const parent =
|
|
874654
|
+
const parent = dirname63(current);
|
|
874487
874655
|
if (parent === current)
|
|
874488
874656
|
break;
|
|
874489
874657
|
current = parent;
|
|
@@ -874503,7 +874671,7 @@ function resolveTargetDirectory(shellPaths, targetPath) {
|
|
|
874503
874671
|
if (!pathInside(shellPaths.workingDirectory, resolved))
|
|
874504
874672
|
return resolve40(shellPaths.workingDirectory);
|
|
874505
874673
|
const stat8 = safeStat(resolved);
|
|
874506
|
-
return stat8?.isDirectory() ? resolved :
|
|
874674
|
+
return stat8?.isDirectory() ? resolved : dirname63(resolved);
|
|
874507
874675
|
}
|
|
874508
874676
|
function contextWalkRoots(workingDirectory, targetDirectory) {
|
|
874509
874677
|
const gitRoot = findGitRoot(workingDirectory);
|
|
@@ -874514,7 +874682,7 @@ function contextWalkRoots(workingDirectory, targetDirectory) {
|
|
|
874514
874682
|
roots.push(current);
|
|
874515
874683
|
if (current === start2)
|
|
874516
874684
|
break;
|
|
874517
|
-
const parent =
|
|
874685
|
+
const parent = dirname63(current);
|
|
874518
874686
|
if (parent === current)
|
|
874519
874687
|
break;
|
|
874520
874688
|
current = parent;
|
|
@@ -874522,13 +874690,13 @@ function contextWalkRoots(workingDirectory, targetDirectory) {
|
|
|
874522
874690
|
return { roots: roots.reverse(), gitRoot };
|
|
874523
874691
|
}
|
|
874524
874692
|
function cursorRuleCandidates(workingDirectory) {
|
|
874525
|
-
const dir =
|
|
874693
|
+
const dir = join101(workingDirectory, ".cursor", "rules");
|
|
874526
874694
|
const stat8 = safeStat(dir);
|
|
874527
874695
|
if (!stat8?.isDirectory())
|
|
874528
874696
|
return [];
|
|
874529
874697
|
try {
|
|
874530
874698
|
return readdirSync24(dir).filter((entry) => entry.endsWith(".mdc")).sort((left, right) => left.localeCompare(right)).map((entry, index) => ({
|
|
874531
|
-
path:
|
|
874699
|
+
path: join101(dir, entry),
|
|
874532
874700
|
kind: "cursor",
|
|
874533
874701
|
scope: "cwd",
|
|
874534
874702
|
source: ".cursor/rules/*.mdc",
|
|
@@ -874544,7 +874712,7 @@ function candidateContextFiles(shellPaths, targetDirectory) {
|
|
|
874544
874712
|
const hermesHome = process.env.HERMES_HOME?.trim();
|
|
874545
874713
|
if (hermesHome) {
|
|
874546
874714
|
candidates.push({
|
|
874547
|
-
path:
|
|
874715
|
+
path: join101(shellPaths.expandHomePath(hermesHome), "SOUL.md"),
|
|
874548
874716
|
kind: "soul",
|
|
874549
874717
|
scope: "global",
|
|
874550
874718
|
source: "HERMES_HOME/SOUL.md",
|
|
@@ -874554,10 +874722,10 @@ function candidateContextFiles(shellPaths, targetDirectory) {
|
|
|
874554
874722
|
const workingDirectory = resolve40(shellPaths.workingDirectory);
|
|
874555
874723
|
for (const [index, root] of roots.entries()) {
|
|
874556
874724
|
const scope = root === workingDirectory ? "cwd" : pathInside(workingDirectory, root) ? "subdirectory" : "project";
|
|
874557
|
-
candidates.push({ path:
|
|
874725
|
+
candidates.push({ path: join101(root, ".hermes.md"), kind: "hermes", scope, source: ".hermes.md", priority: 20 + index }, { path: join101(root, "HERMES.md"), kind: "hermes", scope, source: "HERMES.md", priority: 25 + index }, { path: join101(root, "AGENTS.md"), kind: "agents", scope, source: "AGENTS.md", priority: 40 + index }, { path: join101(root, "CLAUDE.md"), kind: "claude", scope, source: "CLAUDE.md", priority: 55 + index });
|
|
874558
874726
|
}
|
|
874559
874727
|
candidates.push({
|
|
874560
|
-
path:
|
|
874728
|
+
path: join101(shellPaths.workingDirectory, ".cursorrules"),
|
|
874561
874729
|
kind: "cursor",
|
|
874562
874730
|
scope: "cwd",
|
|
874563
874731
|
source: ".cursorrules",
|
|
@@ -874588,7 +874756,7 @@ function readContextCandidate(candidate) {
|
|
|
874588
874756
|
return null;
|
|
874589
874757
|
let content = "";
|
|
874590
874758
|
try {
|
|
874591
|
-
content =
|
|
874759
|
+
content = readFileSync85(candidate.path, "utf-8");
|
|
874592
874760
|
} catch (error51) {
|
|
874593
874761
|
return {
|
|
874594
874762
|
...candidate,
|
|
@@ -874963,8 +875131,8 @@ function buildProcessSupervisionSummary(context) {
|
|
|
874963
875131
|
}
|
|
874964
875132
|
|
|
874965
875133
|
// src/agent/research-run-registry.ts
|
|
874966
|
-
import { existsSync as existsSync85, mkdirSync as
|
|
874967
|
-
import { dirname as
|
|
875134
|
+
import { existsSync as existsSync85, mkdirSync as mkdirSync64, readFileSync as readFileSync86, renameSync as renameSync19, writeFileSync as writeFileSync56 } from "fs";
|
|
875135
|
+
import { dirname as dirname64 } from "path";
|
|
874968
875136
|
var STORE_VERSION6 = 1;
|
|
874969
875137
|
var TERMINAL_STATUSES = new Set(["cancelled", "completed", "failed"]);
|
|
874970
875138
|
function isRecord24(value) {
|
|
@@ -875412,15 +875580,15 @@ class AgentResearchRunRegistry {
|
|
|
875412
875580
|
if (!existsSync85(this.storePath))
|
|
875413
875581
|
return { version: STORE_VERSION6, runs: [] };
|
|
875414
875582
|
try {
|
|
875415
|
-
return parseStore5(
|
|
875583
|
+
return parseStore5(readFileSync86(this.storePath, "utf8"));
|
|
875416
875584
|
} catch {
|
|
875417
875585
|
return { version: STORE_VERSION6, runs: [] };
|
|
875418
875586
|
}
|
|
875419
875587
|
}
|
|
875420
875588
|
writeStore(store) {
|
|
875421
|
-
|
|
875589
|
+
mkdirSync64(dirname64(this.storePath), { recursive: true });
|
|
875422
875590
|
const tempPath = `${this.storePath}.tmp`;
|
|
875423
|
-
|
|
875591
|
+
writeFileSync56(tempPath, formatStore5(store), "utf8");
|
|
875424
875592
|
renameSync19(tempPath, this.storePath);
|
|
875425
875593
|
}
|
|
875426
875594
|
}
|
|
@@ -876190,8 +876358,8 @@ function reviewerReadinessBadge(documents, artifacts, artifactListAvailable) {
|
|
|
876190
876358
|
}
|
|
876191
876359
|
|
|
876192
876360
|
// src/agent/setup-wizard-checkpoint.ts
|
|
876193
|
-
import { existsSync as existsSync86, mkdirSync as
|
|
876194
|
-
import { dirname as
|
|
876361
|
+
import { existsSync as existsSync86, mkdirSync as mkdirSync65, readFileSync as readFileSync87, renameSync as renameSync20, rmSync as rmSync10, writeFileSync as writeFileSync57 } from "fs";
|
|
876362
|
+
import { dirname as dirname65 } from "path";
|
|
876195
876363
|
var CHECKPOINT_VERSION = 1;
|
|
876196
876364
|
function isRecord25(value) {
|
|
876197
876365
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
@@ -876241,7 +876409,7 @@ function readSetupWizardCheckpoint(shellPaths) {
|
|
|
876241
876409
|
};
|
|
876242
876410
|
}
|
|
876243
876411
|
try {
|
|
876244
|
-
const parsed = JSON.parse(
|
|
876412
|
+
const parsed = JSON.parse(readFileSync87(path7, "utf-8"));
|
|
876245
876413
|
const checkpoint = parseCheckpoint2(parsed);
|
|
876246
876414
|
if (!checkpoint) {
|
|
876247
876415
|
return {
|
|
@@ -876281,9 +876449,9 @@ function saveSetupWizardCheckpoint(shellPaths, input) {
|
|
|
876281
876449
|
source: input.source,
|
|
876282
876450
|
...input.note?.trim() ? { note: input.note.trim().replace(/\s+/g, " ") } : {}
|
|
876283
876451
|
};
|
|
876284
|
-
|
|
876452
|
+
mkdirSync65(dirname65(path7), { recursive: true });
|
|
876285
876453
|
const tempPath = `${path7}.tmp`;
|
|
876286
|
-
|
|
876454
|
+
writeFileSync57(tempPath, formatCheckpoint(checkpoint), "utf-8");
|
|
876287
876455
|
renameSync20(tempPath, path7);
|
|
876288
876456
|
return readSetupWizardCheckpoint(shellPaths);
|
|
876289
876457
|
}
|
|
@@ -876294,7 +876462,7 @@ function clearSetupWizardCheckpoint(shellPaths) {
|
|
|
876294
876462
|
return readSetupWizardCheckpoint(shellPaths);
|
|
876295
876463
|
}
|
|
876296
876464
|
// src/runtime/onboarding/state.ts
|
|
876297
|
-
import { existsSync as existsSync87, mkdirSync as
|
|
876465
|
+
import { existsSync as existsSync87, mkdirSync as mkdirSync66, readFileSync as readFileSync88, writeFileSync as writeFileSync58 } from "fs";
|
|
876298
876466
|
var ONBOARDING_RUNTIME_STATE_FILE = "onboarding-state.json";
|
|
876299
876467
|
function resolveStatePath(shellPaths, scope) {
|
|
876300
876468
|
return scope === "project" ? shellPaths.resolveProjectPath(GOODVIBES_AGENT_SURFACE_ROOT, ONBOARDING_RUNTIME_STATE_FILE) : shellPaths.resolveUserPath(GOODVIBES_AGENT_SURFACE_ROOT, ONBOARDING_RUNTIME_STATE_FILE);
|
|
@@ -876336,7 +876504,7 @@ function readOnboardingRuntimeState(shellPaths, scope = "project") {
|
|
|
876336
876504
|
};
|
|
876337
876505
|
}
|
|
876338
876506
|
try {
|
|
876339
|
-
const parsed = JSON.parse(
|
|
876507
|
+
const parsed = JSON.parse(readFileSync88(path7, "utf-8"));
|
|
876340
876508
|
if (!isRuntimeStatePayload(parsed)) {
|
|
876341
876509
|
return {
|
|
876342
876510
|
scope,
|
|
@@ -876936,19 +877104,19 @@ function deriveStep1CapabilityFlags(snapshot) {
|
|
|
876936
877104
|
};
|
|
876937
877105
|
}
|
|
876938
877106
|
// src/agent/runtime-profile.ts
|
|
876939
|
-
import { existsSync as existsSync88, mkdirSync as
|
|
876940
|
-
import { dirname as
|
|
877107
|
+
import { existsSync as existsSync88, mkdirSync as mkdirSync67, readFileSync as readFileSync89, readdirSync as readdirSync25, rmSync as rmSync11, statSync as statSync20, writeFileSync as writeFileSync59 } from "fs";
|
|
877108
|
+
import { dirname as dirname66, isAbsolute as isAbsolute16, join as join105, resolve as resolve41 } from "path";
|
|
876941
877109
|
|
|
876942
877110
|
// src/agent/persona-discovery.ts
|
|
876943
877111
|
import { promises as fsPromises4 } from "fs";
|
|
876944
|
-
import { join as
|
|
877112
|
+
import { join as join102 } from "path";
|
|
876945
877113
|
var DIRECTORY_MARKERS = ["PERSONA.md", "persona.md"];
|
|
876946
877114
|
function getPersonaDirectories(cwd, homeDir) {
|
|
876947
877115
|
return [
|
|
876948
|
-
{ root:
|
|
876949
|
-
{ root:
|
|
876950
|
-
{ root:
|
|
876951
|
-
{ root:
|
|
877116
|
+
{ root: join102(cwd, ".goodvibes", "personas"), origin: "project-local" },
|
|
877117
|
+
{ root: join102(cwd, ".goodvibes", GOODVIBES_AGENT_SURFACE_ROOT, "personas"), origin: "project-local" },
|
|
877118
|
+
{ root: join102(homeDir, ".goodvibes", "personas"), origin: "global" },
|
|
877119
|
+
{ root: join102(homeDir, ".goodvibes", GOODVIBES_AGENT_SURFACE_ROOT, "personas"), origin: "global" }
|
|
876952
877120
|
];
|
|
876953
877121
|
}
|
|
876954
877122
|
async function readPersonaFile(path7, origin) {
|
|
@@ -876984,13 +877152,13 @@ async function scanPersonaDirectory(root, origin) {
|
|
|
876984
877152
|
const records = [];
|
|
876985
877153
|
for (const entry of entries.sort((a4, b3) => a4.localeCompare(b3))) {
|
|
876986
877154
|
if (entry.endsWith(".md")) {
|
|
876987
|
-
const record2 = await readPersonaFile(
|
|
877155
|
+
const record2 = await readPersonaFile(join102(root, entry), origin);
|
|
876988
877156
|
if (record2)
|
|
876989
877157
|
records.push(record2);
|
|
876990
877158
|
continue;
|
|
876991
877159
|
}
|
|
876992
877160
|
for (const marker of DIRECTORY_MARKERS) {
|
|
876993
|
-
const record2 = await readPersonaFile(
|
|
877161
|
+
const record2 = await readPersonaFile(join102(root, entry, marker), origin);
|
|
876994
877162
|
if (record2) {
|
|
876995
877163
|
records.push(record2);
|
|
876996
877164
|
break;
|
|
@@ -877019,14 +877187,14 @@ async function discoverPersonas(shellPaths) {
|
|
|
877019
877187
|
|
|
877020
877188
|
// src/agent/routine-discovery.ts
|
|
877021
877189
|
import { promises as fsPromises5 } from "fs";
|
|
877022
|
-
import { join as
|
|
877190
|
+
import { join as join103 } from "path";
|
|
877023
877191
|
var DIRECTORY_MARKERS2 = ["ROUTINE.md", "routine.md"];
|
|
877024
877192
|
function getRoutineDirectories(cwd, homeDir) {
|
|
877025
877193
|
return [
|
|
877026
|
-
{ root:
|
|
877027
|
-
{ root:
|
|
877028
|
-
{ root:
|
|
877029
|
-
{ root:
|
|
877194
|
+
{ root: join103(cwd, ".goodvibes", "routines"), origin: "project-local" },
|
|
877195
|
+
{ root: join103(cwd, ".goodvibes", GOODVIBES_AGENT_SURFACE_ROOT, "routines"), origin: "project-local" },
|
|
877196
|
+
{ root: join103(homeDir, ".goodvibes", "routines"), origin: "global" },
|
|
877197
|
+
{ root: join103(homeDir, ".goodvibes", GOODVIBES_AGENT_SURFACE_ROOT, "routines"), origin: "global" }
|
|
877030
877198
|
];
|
|
877031
877199
|
}
|
|
877032
877200
|
async function readRoutineFile(path7, origin) {
|
|
@@ -877062,13 +877230,13 @@ async function scanRoutineDirectory(root, origin) {
|
|
|
877062
877230
|
const records = [];
|
|
877063
877231
|
for (const entry of entries.sort((a4, b3) => a4.localeCompare(b3))) {
|
|
877064
877232
|
if (entry.endsWith(".md")) {
|
|
877065
|
-
const record2 = await readRoutineFile(
|
|
877233
|
+
const record2 = await readRoutineFile(join103(root, entry), origin);
|
|
877066
877234
|
if (record2)
|
|
877067
877235
|
records.push(record2);
|
|
877068
877236
|
continue;
|
|
877069
877237
|
}
|
|
877070
877238
|
for (const marker of DIRECTORY_MARKERS2) {
|
|
877071
|
-
const record2 = await readRoutineFile(
|
|
877239
|
+
const record2 = await readRoutineFile(join103(root, entry, marker), origin);
|
|
877072
877240
|
if (record2) {
|
|
877073
877241
|
records.push(record2);
|
|
877074
877242
|
break;
|
|
@@ -877097,13 +877265,13 @@ async function discoverRoutines(shellPaths) {
|
|
|
877097
877265
|
|
|
877098
877266
|
// src/agent/skill-discovery.ts
|
|
877099
877267
|
import { promises as fsPromises6 } from "fs";
|
|
877100
|
-
import { join as
|
|
877268
|
+
import { join as join104 } from "path";
|
|
877101
877269
|
function getSkillDirectories(cwd, homeDir) {
|
|
877102
877270
|
return [
|
|
877103
|
-
{ root:
|
|
877104
|
-
{ root:
|
|
877105
|
-
{ root:
|
|
877106
|
-
{ root:
|
|
877271
|
+
{ root: join104(cwd, ".goodvibes", "skills"), origin: "project-local" },
|
|
877272
|
+
{ root: join104(cwd, ".goodvibes", GOODVIBES_AGENT_SURFACE_ROOT, "skills"), origin: "project-local" },
|
|
877273
|
+
{ root: join104(homeDir, ".goodvibes", "skills"), origin: "global" },
|
|
877274
|
+
{ root: join104(homeDir, ".goodvibes", GOODVIBES_AGENT_SURFACE_ROOT, "skills"), origin: "global" }
|
|
877107
877275
|
];
|
|
877108
877276
|
}
|
|
877109
877277
|
async function readSkillFile(path7, origin) {
|
|
@@ -877145,12 +877313,12 @@ async function scanSkillDirectory(root, origin) {
|
|
|
877145
877313
|
const records = [];
|
|
877146
877314
|
for (const entry of entries.sort((a4, b3) => a4.localeCompare(b3))) {
|
|
877147
877315
|
if (entry.endsWith(".md")) {
|
|
877148
|
-
const record3 = await readSkillFile(
|
|
877316
|
+
const record3 = await readSkillFile(join104(root, entry), origin);
|
|
877149
877317
|
if (record3)
|
|
877150
877318
|
records.push(record3);
|
|
877151
877319
|
continue;
|
|
877152
877320
|
}
|
|
877153
|
-
const markerPath =
|
|
877321
|
+
const markerPath = join104(root, entry, "SKILL.md");
|
|
877154
877322
|
const record2 = await readSkillFile(markerPath, origin);
|
|
877155
877323
|
if (record2)
|
|
877156
877324
|
records.push(record2);
|
|
@@ -877520,19 +877688,19 @@ function assertValidAgentRuntimeProfileId(value) {
|
|
|
877520
877688
|
return normalized;
|
|
877521
877689
|
}
|
|
877522
877690
|
function getAgentRuntimeProfilesRoot(baseHomeDirectory) {
|
|
877523
|
-
return
|
|
877691
|
+
return join105(baseHomeDirectory, ".goodvibes", "agent", "profile-homes");
|
|
877524
877692
|
}
|
|
877525
877693
|
function getAgentRuntimeProfileTemplatesRoot(baseHomeDirectory) {
|
|
877526
|
-
return
|
|
877694
|
+
return join105(baseHomeDirectory, ".goodvibes", GOODVIBES_AGENT_SURFACE_ROOT, "profile-starters");
|
|
877527
877695
|
}
|
|
877528
877696
|
function getAgentRuntimeProfileSelectionPath(baseHomeDirectory) {
|
|
877529
|
-
return
|
|
877697
|
+
return join105(baseHomeDirectory, ".goodvibes", GOODVIBES_AGENT_SURFACE_ROOT, PROFILE_SELECTION_FILE);
|
|
877530
877698
|
}
|
|
877531
877699
|
function resolveAgentRuntimeProfileHome(baseHomeDirectory, profileName) {
|
|
877532
877700
|
const id = assertValidAgentRuntimeProfileId(profileName);
|
|
877533
877701
|
return {
|
|
877534
877702
|
id,
|
|
877535
|
-
homeDirectory:
|
|
877703
|
+
homeDirectory: join105(getAgentRuntimeProfilesRoot(baseHomeDirectory), id)
|
|
877536
877704
|
};
|
|
877537
877705
|
}
|
|
877538
877706
|
function readAgentRuntimeProfileSelection(baseHomeDirectory) {
|
|
@@ -877540,7 +877708,7 @@ function readAgentRuntimeProfileSelection(baseHomeDirectory) {
|
|
|
877540
877708
|
if (!existsSync88(path7))
|
|
877541
877709
|
return null;
|
|
877542
877710
|
try {
|
|
877543
|
-
const raw = JSON.parse(
|
|
877711
|
+
const raw = JSON.parse(readFileSync89(path7, "utf-8"));
|
|
877544
877712
|
if (!isRecord26(raw))
|
|
877545
877713
|
return null;
|
|
877546
877714
|
const profileId = raw.profileId;
|
|
@@ -877568,11 +877736,11 @@ function resolveSelectedAgentRuntimeProfileHome(baseHomeDirectory) {
|
|
|
877568
877736
|
};
|
|
877569
877737
|
}
|
|
877570
877738
|
function readProfileCreatedAt(homeDirectory) {
|
|
877571
|
-
const path7 =
|
|
877739
|
+
const path7 = join105(homeDirectory, PROFILE_CREATED_FILE);
|
|
877572
877740
|
if (!existsSync88(path7))
|
|
877573
877741
|
return null;
|
|
877574
877742
|
try {
|
|
877575
|
-
const raw = JSON.parse(
|
|
877743
|
+
const raw = JSON.parse(readFileSync89(path7, "utf-8"));
|
|
877576
877744
|
if (raw && typeof raw === "object" && typeof raw.createdAt === "string")
|
|
877577
877745
|
return raw.createdAt;
|
|
877578
877746
|
} catch {
|
|
@@ -877581,11 +877749,11 @@ function readProfileCreatedAt(homeDirectory) {
|
|
|
877581
877749
|
return null;
|
|
877582
877750
|
}
|
|
877583
877751
|
function readProfileStarterTemplate(homeDirectory) {
|
|
877584
|
-
const path7 =
|
|
877752
|
+
const path7 = join105(homeDirectory, PROFILE_CREATED_FILE);
|
|
877585
877753
|
if (!existsSync88(path7))
|
|
877586
877754
|
return {};
|
|
877587
877755
|
try {
|
|
877588
|
-
const raw = JSON.parse(
|
|
877756
|
+
const raw = JSON.parse(readFileSync89(path7, "utf-8"));
|
|
877589
877757
|
if (!isRecord26(raw))
|
|
877590
877758
|
return {};
|
|
877591
877759
|
const starter = raw.starterTemplate;
|
|
@@ -877613,7 +877781,7 @@ function buildProfileInfo(baseHomeDirectory, id) {
|
|
|
877613
877781
|
};
|
|
877614
877782
|
}
|
|
877615
877783
|
function profileStorePath(homeDirectory, folder, file2) {
|
|
877616
|
-
return
|
|
877784
|
+
return join105(homeDirectory, ".goodvibes", GOODVIBES_AGENT_SURFACE_ROOT, folder, file2);
|
|
877617
877785
|
}
|
|
877618
877786
|
function isAgentRuntimeProfileTemplateId(value) {
|
|
877619
877787
|
if (typeof value !== "string")
|
|
@@ -877756,10 +877924,10 @@ function profileTemplateVibeShellPaths(shellPaths) {
|
|
|
877756
877924
|
return {
|
|
877757
877925
|
homeDirectory: shellPaths.homeDirectory,
|
|
877758
877926
|
workingDirectory: shellPaths.workingDirectory,
|
|
877759
|
-
resolveUserPath: shellPaths.resolveUserPath ?? ((...parts2) =>
|
|
877760
|
-
expandHomePath: shellPaths.expandHomePath ?? ((value) => value.startsWith("~/") ?
|
|
877927
|
+
resolveUserPath: shellPaths.resolveUserPath ?? ((...parts2) => join105(shellPaths.homeDirectory, ".goodvibes", ...parts2)),
|
|
877928
|
+
expandHomePath: shellPaths.expandHomePath ?? ((value) => value.startsWith("~/") ? join105(shellPaths.homeDirectory, value.slice(2)) : value),
|
|
877761
877929
|
resolveWorkspacePath: shellPaths.resolveWorkspacePath ?? ((value) => {
|
|
877762
|
-
const expanded = value.startsWith("~/") ?
|
|
877930
|
+
const expanded = value.startsWith("~/") ? join105(shellPaths.homeDirectory, value.slice(2)) : value;
|
|
877763
877931
|
return isAbsolute16(expanded) ? resolve41(expanded) : resolve41(shellPaths.workingDirectory, expanded);
|
|
877764
877932
|
})
|
|
877765
877933
|
};
|
|
@@ -877834,7 +878002,7 @@ function parseStarterTemplate(raw, source, path7) {
|
|
|
877834
878002
|
}
|
|
877835
878003
|
function readLocalTemplate(path7) {
|
|
877836
878004
|
try {
|
|
877837
|
-
return parseStarterTemplate(JSON.parse(
|
|
878005
|
+
return parseStarterTemplate(JSON.parse(readFileSync89(path7, "utf-8")), "local", path7);
|
|
877838
878006
|
} catch {
|
|
877839
878007
|
return null;
|
|
877840
878008
|
}
|
|
@@ -877843,7 +878011,7 @@ function listLocalTemplates(baseHomeDirectory) {
|
|
|
877843
878011
|
const root = getAgentRuntimeProfileTemplatesRoot(baseHomeDirectory);
|
|
877844
878012
|
if (!existsSync88(root))
|
|
877845
878013
|
return [];
|
|
877846
|
-
return readdirSync25(root).filter((entry) => entry.endsWith(".json")).map((entry) => readLocalTemplate(
|
|
878014
|
+
return readdirSync25(root).filter((entry) => entry.endsWith(".json")).map((entry) => readLocalTemplate(join105(root, entry))).filter((entry) => entry !== null).sort((left, right) => left.id.localeCompare(right.id));
|
|
877847
878015
|
}
|
|
877848
878016
|
function resolveAgentRuntimeProfileTemplate(templateId, baseHomeDirectory) {
|
|
877849
878017
|
const id = assertValidAgentRuntimeProfileId(templateId);
|
|
@@ -877879,8 +878047,8 @@ function exportAgentRuntimeProfileTemplate(baseHomeDirectory, templateId, output
|
|
|
877879
878047
|
const target = outputPath.trim();
|
|
877880
878048
|
if (!target)
|
|
877881
878049
|
throw new Error("Template export path is required.");
|
|
877882
|
-
|
|
877883
|
-
|
|
878050
|
+
mkdirSync67(dirname66(target), { recursive: true });
|
|
878051
|
+
writeFileSync59(target, `${JSON.stringify(templateFilePayload(template), null, 2)}
|
|
877884
878052
|
`, "utf-8");
|
|
877885
878053
|
return { ...summarizeTemplate(template), path: target };
|
|
877886
878054
|
}
|
|
@@ -877888,11 +878056,11 @@ function importAgentRuntimeProfileTemplate(baseHomeDirectory, sourcePath) {
|
|
|
877888
878056
|
const source = sourcePath.trim();
|
|
877889
878057
|
if (!source)
|
|
877890
878058
|
throw new Error("Template import path is required.");
|
|
877891
|
-
const parsed = parseStarterTemplate(JSON.parse(
|
|
878059
|
+
const parsed = parseStarterTemplate(JSON.parse(readFileSync89(source, "utf-8")), "local");
|
|
877892
878060
|
const root = getAgentRuntimeProfileTemplatesRoot(baseHomeDirectory);
|
|
877893
|
-
|
|
877894
|
-
const target =
|
|
877895
|
-
|
|
878061
|
+
mkdirSync67(root, { recursive: true });
|
|
878062
|
+
const target = join105(root, `${parsed.id}.json`);
|
|
878063
|
+
writeFileSync59(target, `${JSON.stringify(templateFilePayload({ ...parsed, source: "local", path: target }), null, 2)}
|
|
877896
878064
|
`, "utf-8");
|
|
877897
878065
|
return summarizeTemplate({ ...parsed, source: "local", path: target });
|
|
877898
878066
|
}
|
|
@@ -877906,7 +878074,7 @@ async function createAgentRuntimeProfileTemplateFromDiscovered(shellPaths, optio
|
|
|
877906
878074
|
const selectedPersona = selectDiscoveredRecord(personas, options.persona, "persona");
|
|
877907
878075
|
const selectedSkills = selectDiscoveredRecords(skills, options.skills, "skill");
|
|
877908
878076
|
const selectedRoutines = selectDiscoveredRecords(routines, options.routines, "routine");
|
|
877909
|
-
const target =
|
|
878077
|
+
const target = join105(getAgentRuntimeProfileTemplatesRoot(shellPaths.homeDirectory), `${id}.json`);
|
|
877910
878078
|
if (existsSync88(target) && options.replace !== true) {
|
|
877911
878079
|
throw new Error(`Agent starter template already exists ${id}. Rerun with --replace to overwrite it.`);
|
|
877912
878080
|
}
|
|
@@ -877926,8 +878094,8 @@ async function createAgentRuntimeProfileTemplateFromDiscovered(shellPaths, optio
|
|
|
877926
878094
|
routines: selectedRoutines.map(discoveredRoutineToTemplate),
|
|
877927
878095
|
...vibe ? { vibe } : {}
|
|
877928
878096
|
};
|
|
877929
|
-
|
|
877930
|
-
|
|
878097
|
+
mkdirSync67(dirname66(target), { recursive: true });
|
|
878098
|
+
writeFileSync59(target, `${JSON.stringify(templateFilePayload(template), null, 2)}
|
|
877931
878099
|
`, "utf-8");
|
|
877932
878100
|
return summarizeTemplate(template);
|
|
877933
878101
|
}
|
|
@@ -877985,9 +878153,9 @@ function writeTemplateVibe(homeDirectory, template) {
|
|
|
877985
878153
|
if (!template.vibe?.body.trim())
|
|
877986
878154
|
return;
|
|
877987
878155
|
assertNoSecretLikeText([template.vibe.body], "Agent starter VIBE.md");
|
|
877988
|
-
const path7 =
|
|
877989
|
-
|
|
877990
|
-
|
|
878156
|
+
const path7 = join105(homeDirectory, ".goodvibes", GOODVIBES_AGENT_SURFACE_ROOT, "VIBE.md");
|
|
878157
|
+
mkdirSync67(dirname66(path7), { recursive: true });
|
|
878158
|
+
writeFileSync59(path7, `${template.vibe.body.trimEnd()}
|
|
877991
878159
|
`, "utf-8");
|
|
877992
878160
|
return path7;
|
|
877993
878161
|
}
|
|
@@ -878027,7 +878195,7 @@ function listAgentRuntimeProfiles(baseHomeDirectory) {
|
|
|
878027
878195
|
return [];
|
|
878028
878196
|
return readdirSync25(root).filter((entry) => PROFILE_ID_PATTERN.test(entry) && !entry.includes("..")).filter((entry) => {
|
|
878029
878197
|
try {
|
|
878030
|
-
return statSync20(
|
|
878198
|
+
return statSync20(join105(root, entry)).isDirectory();
|
|
878031
878199
|
} catch {
|
|
878032
878200
|
return false;
|
|
878033
878201
|
}
|
|
@@ -878038,10 +878206,10 @@ function createAgentRuntimeProfile(baseHomeDirectory, profileName, options = {})
|
|
|
878038
878206
|
if (existsSync88(resolution2.homeDirectory)) {
|
|
878039
878207
|
throw new Error(`Agent profile already exists: ${resolution2.id}`);
|
|
878040
878208
|
}
|
|
878041
|
-
|
|
878209
|
+
mkdirSync67(resolution2.homeDirectory, { recursive: true });
|
|
878042
878210
|
const createdAt = new Date().toISOString();
|
|
878043
878211
|
const appliedTemplate = options.templateId ? applyAgentRuntimeProfileTemplate(resolution2.homeDirectory, options.templateId, baseHomeDirectory) : undefined;
|
|
878044
|
-
|
|
878212
|
+
writeFileSync59(join105(resolution2.homeDirectory, PROFILE_CREATED_FILE), `${JSON.stringify({
|
|
878045
878213
|
id: resolution2.id,
|
|
878046
878214
|
createdAt,
|
|
878047
878215
|
starterTemplate: appliedTemplate
|
|
@@ -878061,9 +878229,9 @@ function setAgentRuntimeProfileSelection(baseHomeDirectory, profileName) {
|
|
|
878061
878229
|
throw new Error(`Agent profile not found ${resolution2.id}`);
|
|
878062
878230
|
}
|
|
878063
878231
|
const path7 = getAgentRuntimeProfileSelectionPath(baseHomeDirectory);
|
|
878064
|
-
|
|
878232
|
+
mkdirSync67(dirname66(path7), { recursive: true });
|
|
878065
878233
|
const selectedAt = new Date().toISOString();
|
|
878066
|
-
|
|
878234
|
+
writeFileSync59(path7, `${JSON.stringify({
|
|
878067
878235
|
profileId: resolution2.id,
|
|
878068
878236
|
selectedAt
|
|
878069
878237
|
}, null, 2)}
|
|
@@ -878094,8 +878262,8 @@ function deleteAgentRuntimeProfile(baseHomeDirectory, profileName) {
|
|
|
878094
878262
|
}
|
|
878095
878263
|
|
|
878096
878264
|
// src/agent/note-registry.ts
|
|
878097
|
-
import { existsSync as existsSync89, mkdirSync as
|
|
878098
|
-
import { dirname as
|
|
878265
|
+
import { existsSync as existsSync89, mkdirSync as mkdirSync68, readFileSync as readFileSync90, renameSync as renameSync21, writeFileSync as writeFileSync60 } from "fs";
|
|
878266
|
+
import { dirname as dirname67 } from "path";
|
|
878099
878267
|
var STORE_VERSION7 = 1;
|
|
878100
878268
|
function isRecord27(value) {
|
|
878101
878269
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -878347,21 +878515,21 @@ class AgentNoteRegistry {
|
|
|
878347
878515
|
if (!existsSync89(this.storePath))
|
|
878348
878516
|
return { version: STORE_VERSION7, notes: [] };
|
|
878349
878517
|
try {
|
|
878350
|
-
return parseStore6(
|
|
878518
|
+
return parseStore6(readFileSync90(this.storePath, "utf-8"));
|
|
878351
878519
|
} catch (error51) {
|
|
878352
878520
|
throw new Error(`Could not read Agent note store ${error51 instanceof Error ? error51.message : String(error51)}`);
|
|
878353
878521
|
}
|
|
878354
878522
|
}
|
|
878355
878523
|
writeStore(store) {
|
|
878356
|
-
|
|
878524
|
+
mkdirSync68(dirname67(this.storePath), { recursive: true });
|
|
878357
878525
|
const tmpPath = `${this.storePath}.tmp`;
|
|
878358
|
-
|
|
878526
|
+
writeFileSync60(tmpPath, formatStore6(store), "utf-8");
|
|
878359
878527
|
renameSync21(tmpPath, this.storePath);
|
|
878360
878528
|
}
|
|
878361
878529
|
}
|
|
878362
878530
|
// src/runtime/onboarding/markers.ts
|
|
878363
|
-
import { existsSync as existsSync90, mkdirSync as
|
|
878364
|
-
import { dirname as
|
|
878531
|
+
import { existsSync as existsSync90, mkdirSync as mkdirSync69, readFileSync as readFileSync91, writeFileSync as writeFileSync61 } from "fs";
|
|
878532
|
+
import { dirname as dirname68 } from "path";
|
|
878365
878533
|
var ONBOARDING_CHECK_MARKER_FILE = "onboarding-checked.json";
|
|
878366
878534
|
var ONBOARDING_COMPLETION_MARKER_FILE = "onboarding-complete.json";
|
|
878367
878535
|
function resolveMarkerPath(shellPaths, scope, fileName = ONBOARDING_CHECK_MARKER_FILE) {
|
|
@@ -878408,7 +878576,7 @@ function readOnboardingMarker(shellPaths, scope, fileName) {
|
|
|
878408
878576
|
if (!existsSync90(path7))
|
|
878409
878577
|
return buildMissingMarkerState(scope, path7);
|
|
878410
878578
|
try {
|
|
878411
|
-
const parsed = JSON.parse(
|
|
878579
|
+
const parsed = JSON.parse(readFileSync91(path7, "utf-8"));
|
|
878412
878580
|
if (!isCheckMarkerPayload(parsed)) {
|
|
878413
878581
|
return buildParseErrorState(scope, path7, "Invalid onboarding check marker payload.");
|
|
878414
878582
|
}
|
|
@@ -878450,8 +878618,8 @@ function writeOnboardingMarker(shellPaths, options, fileName) {
|
|
|
878450
878618
|
...options.mode ? { mode: options.mode } : {},
|
|
878451
878619
|
...options.workspaceRoot ? { workspaceRoot: options.workspaceRoot } : {}
|
|
878452
878620
|
};
|
|
878453
|
-
|
|
878454
|
-
|
|
878621
|
+
mkdirSync69(dirname68(path7), { recursive: true });
|
|
878622
|
+
writeFileSync61(path7, `${JSON.stringify(payload, null, 2)}
|
|
878455
878623
|
`, "utf-8");
|
|
878456
878624
|
return readOnboardingMarker(shellPaths, scope, fileName);
|
|
878457
878625
|
}
|
|
@@ -878817,8 +878985,8 @@ function readConfigBoolean3(context, key, fallback) {
|
|
|
878817
878985
|
init_config6();
|
|
878818
878986
|
|
|
878819
878987
|
// src/agent/research-source-registry.ts
|
|
878820
|
-
import { existsSync as existsSync91, mkdirSync as
|
|
878821
|
-
import { dirname as
|
|
878988
|
+
import { existsSync as existsSync91, mkdirSync as mkdirSync70, readFileSync as readFileSync92, renameSync as renameSync22, writeFileSync as writeFileSync62 } from "fs";
|
|
878989
|
+
import { dirname as dirname69 } from "path";
|
|
878822
878990
|
var STORE_VERSION8 = 1;
|
|
878823
878991
|
var SECRETISH = /token|secret|password|authorization|credential|api[-_]?key/i;
|
|
878824
878992
|
function isRecord28(value) {
|
|
@@ -879140,15 +879308,15 @@ class AgentResearchSourceRegistry {
|
|
|
879140
879308
|
if (!existsSync91(this.storePath))
|
|
879141
879309
|
return { version: STORE_VERSION8, sources: [] };
|
|
879142
879310
|
try {
|
|
879143
|
-
return parseStore7(
|
|
879311
|
+
return parseStore7(readFileSync92(this.storePath, "utf-8"));
|
|
879144
879312
|
} catch (error51) {
|
|
879145
879313
|
throw new Error(`Could not read Agent research source store: ${error51 instanceof Error ? error51.message : String(error51)}`);
|
|
879146
879314
|
}
|
|
879147
879315
|
}
|
|
879148
879316
|
writeStore(store) {
|
|
879149
|
-
|
|
879317
|
+
mkdirSync70(dirname69(this.storePath), { recursive: true });
|
|
879150
879318
|
const tempPath = `${this.storePath}.tmp`;
|
|
879151
|
-
|
|
879319
|
+
writeFileSync62(tempPath, formatStore7(store), "utf-8");
|
|
879152
879320
|
renameSync22(tempPath, this.storePath);
|
|
879153
879321
|
}
|
|
879154
879322
|
nextId(title, sources) {
|
|
@@ -879172,8 +879340,8 @@ class AgentResearchSourceRegistry {
|
|
|
879172
879340
|
}
|
|
879173
879341
|
|
|
879174
879342
|
// src/agent/routine-schedule-receipts.ts
|
|
879175
|
-
import { existsSync as existsSync92, mkdirSync as
|
|
879176
|
-
import { dirname as
|
|
879343
|
+
import { existsSync as existsSync92, mkdirSync as mkdirSync71, readFileSync as readFileSync93, renameSync as renameSync23, writeFileSync as writeFileSync63 } from "fs";
|
|
879344
|
+
import { dirname as dirname70 } from "path";
|
|
879177
879345
|
init_automation2();
|
|
879178
879346
|
init_utils4();
|
|
879179
879347
|
|
|
@@ -879630,15 +879798,15 @@ class RoutineScheduleReceiptStore {
|
|
|
879630
879798
|
if (!existsSync92(this.storePath))
|
|
879631
879799
|
return { version: RECEIPT_STORE_VERSION, receipts: [] };
|
|
879632
879800
|
try {
|
|
879633
|
-
return parseReceiptStore(
|
|
879801
|
+
return parseReceiptStore(readFileSync93(this.storePath, "utf-8"));
|
|
879634
879802
|
} catch (error51) {
|
|
879635
879803
|
throw new Error(`Could not read Agent routine schedule receipt store ${summarizeError(error51)}`);
|
|
879636
879804
|
}
|
|
879637
879805
|
}
|
|
879638
879806
|
writeStore(store) {
|
|
879639
|
-
|
|
879807
|
+
mkdirSync71(dirname70(this.storePath), { recursive: true });
|
|
879640
879808
|
const tmpPath = `${this.storePath}.tmp`;
|
|
879641
|
-
|
|
879809
|
+
writeFileSync63(tmpPath, formatReceiptStore(store), "utf-8");
|
|
879642
879810
|
renameSync23(tmpPath, this.storePath);
|
|
879643
879811
|
}
|
|
879644
879812
|
}
|
|
@@ -882948,7 +883116,7 @@ function readReceiptFile(shellPaths) {
|
|
|
882948
883116
|
if (!existsSync93(path7))
|
|
882949
883117
|
return { version: 1, receipts: [] };
|
|
882950
883118
|
try {
|
|
882951
|
-
const parsed = JSON.parse(
|
|
883119
|
+
const parsed = JSON.parse(readFileSync94(path7, "utf-8"));
|
|
882952
883120
|
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
|
|
882953
883121
|
return { version: 1, receipts: [] };
|
|
882954
883122
|
const receipts = Array.isArray(parsed.receipts) ? parsed.receipts.map(parseReceipt2).filter((entry) => entry !== null) : [];
|
|
@@ -882964,9 +883132,9 @@ function writeReceipt(shellPaths, receipt) {
|
|
|
882964
883132
|
version: 1,
|
|
882965
883133
|
receipts: [receipt, ...current.filter((entry) => entry.id !== receipt.id)].slice(0, RECEIPT_LIMIT2)
|
|
882966
883134
|
};
|
|
882967
|
-
|
|
883135
|
+
mkdirSync72(dirname71(path7), { recursive: true });
|
|
882968
883136
|
const tmpPath = `${path7}.tmp`;
|
|
882969
|
-
|
|
883137
|
+
writeFileSync64(tmpPath, `${JSON.stringify(next, null, 2)}
|
|
882970
883138
|
`, "utf-8");
|
|
882971
883139
|
renameSync24(tmpPath, path7);
|
|
882972
883140
|
}
|
|
@@ -895217,8 +895385,8 @@ async function handleRecallCapture(args2, context) {
|
|
|
895217
895385
|
}
|
|
895218
895386
|
|
|
895219
895387
|
// src/input/commands/recall-bundle.ts
|
|
895220
|
-
import { dirname as
|
|
895221
|
-
import { mkdirSync as
|
|
895388
|
+
import { dirname as dirname72 } from "path";
|
|
895389
|
+
import { mkdirSync as mkdirSync73, readFileSync as readFileSync95, writeFileSync as writeFileSync65 } from "fs";
|
|
895222
895390
|
init_utils4();
|
|
895223
895391
|
function handleRecallExport(args2, context) {
|
|
895224
895392
|
const parsed = stripYesFlag(args2);
|
|
@@ -895257,8 +895425,8 @@ function handleRecallExport(args2, context) {
|
|
|
895257
895425
|
}
|
|
895258
895426
|
const bundle = memory.exportBundle(filter);
|
|
895259
895427
|
const targetPath = resolveBundlePath(pathArg, requireShellPaths(context));
|
|
895260
|
-
|
|
895261
|
-
|
|
895428
|
+
mkdirSync73(dirname72(targetPath), { recursive: true });
|
|
895429
|
+
writeFileSync65(targetPath, JSON.stringify(bundle, null, 2) + `
|
|
895262
895430
|
`, "utf-8");
|
|
895263
895431
|
context.print(`[memory] Exported ${bundle.recordCount} record(s) and ${bundle.linkCount} link(s) to ${targetPath}`);
|
|
895264
895432
|
}
|
|
@@ -895281,7 +895449,7 @@ async function handleRecallImport(args2, context) {
|
|
|
895281
895449
|
const targetPath = resolveBundlePath(pathArg, requireShellPaths(context));
|
|
895282
895450
|
let bundle;
|
|
895283
895451
|
try {
|
|
895284
|
-
bundle = JSON.parse(
|
|
895452
|
+
bundle = JSON.parse(readFileSync95(targetPath, "utf-8"));
|
|
895285
895453
|
} catch (error51) {
|
|
895286
895454
|
context.print(`[memory] Failed to read memory bundle ${summarizeError(error51)}`);
|
|
895287
895455
|
return;
|
|
@@ -895325,8 +895493,8 @@ function handleRecallHandoffExport(args2, context) {
|
|
|
895325
895493
|
}
|
|
895326
895494
|
const bundle = memory.exportBundle({ scope: scopeRaw });
|
|
895327
895495
|
const targetPath = resolveBundlePath(pathArg, requireShellPaths(context));
|
|
895328
|
-
|
|
895329
|
-
|
|
895496
|
+
mkdirSync73(dirname72(targetPath), { recursive: true });
|
|
895497
|
+
writeFileSync65(targetPath, JSON.stringify(bundle, null, 2) + `
|
|
895330
895498
|
`, "utf-8");
|
|
895331
895499
|
context.print(`[memory] Exported ${scopeRaw} handoff bundle to ${targetPath}`);
|
|
895332
895500
|
}
|
|
@@ -895338,7 +895506,7 @@ function handleRecallHandoffInspect(args2, context) {
|
|
|
895338
895506
|
}
|
|
895339
895507
|
const targetPath = resolveBundlePath(pathArg, requireShellPaths(context));
|
|
895340
895508
|
try {
|
|
895341
|
-
const bundle = JSON.parse(
|
|
895509
|
+
const bundle = JSON.parse(readFileSync95(targetPath, "utf-8"));
|
|
895342
895510
|
context.print(inspectBundle(bundle));
|
|
895343
895511
|
} catch (error51) {
|
|
895344
895512
|
context.print(`[memory] Failed to inspect handoff bundle ${summarizeError(error51)}`);
|
|
@@ -898119,8 +898287,8 @@ Example: /notify add https://ntfy.sh/my-topic --yes`);
|
|
|
898119
898287
|
}
|
|
898120
898288
|
|
|
898121
898289
|
// src/input/commands/product-runtime.ts
|
|
898122
|
-
import { mkdirSync as
|
|
898123
|
-
import { dirname as
|
|
898290
|
+
import { mkdirSync as mkdirSync74, readFileSync as readFileSync96, writeFileSync as writeFileSync66 } from "fs";
|
|
898291
|
+
import { dirname as dirname73 } from "path";
|
|
898124
898292
|
function countByMode(values2, mode) {
|
|
898125
898293
|
return values2.filter((value) => value === mode).length;
|
|
898126
898294
|
}
|
|
@@ -898167,7 +898335,7 @@ function formatTrustReview(bundle) {
|
|
|
898167
898335
|
`);
|
|
898168
898336
|
}
|
|
898169
898337
|
function inspectTrustBundle(path7) {
|
|
898170
|
-
const parsed = JSON.parse(
|
|
898338
|
+
const parsed = JSON.parse(readFileSync96(path7, "utf-8"));
|
|
898171
898339
|
return [
|
|
898172
898340
|
"Trust Bundle Review",
|
|
898173
898341
|
` captured: ${new Date(parsed.capturedAt).toISOString()}`,
|
|
@@ -898209,8 +898377,8 @@ function registerProductRuntimeCommands(registry5) {
|
|
|
898209
898377
|
}
|
|
898210
898378
|
const bundle = await buildTrustReviewBundle(ctx);
|
|
898211
898379
|
const targetPath = shellPaths.resolveWorkspacePath(pathArg);
|
|
898212
|
-
|
|
898213
|
-
|
|
898380
|
+
mkdirSync74(dirname73(targetPath), { recursive: true });
|
|
898381
|
+
writeFileSync66(targetPath, JSON.stringify(bundle, null, 2) + `
|
|
898214
898382
|
`, "utf-8");
|
|
898215
898383
|
ctx.print(`Trust bundle exported to ${targetPath}`);
|
|
898216
898384
|
return;
|
|
@@ -898231,8 +898399,8 @@ function registerProductRuntimeCommands(registry5) {
|
|
|
898231
898399
|
|
|
898232
898400
|
// src/input/commands/platform-access-runtime.ts
|
|
898233
898401
|
init_config6();
|
|
898234
|
-
import { mkdirSync as
|
|
898235
|
-
import { dirname as
|
|
898402
|
+
import { mkdirSync as mkdirSync75, readFileSync as readFileSync97, writeFileSync as writeFileSync67 } from "fs";
|
|
898403
|
+
import { dirname as dirname74 } from "path";
|
|
898236
898404
|
function inspectAuthBundle(bundle) {
|
|
898237
898405
|
return [
|
|
898238
898406
|
"Auth Review Bundle",
|
|
@@ -898387,15 +898555,15 @@ function registerPlatformAccessRuntimeCommands(registry5) {
|
|
|
898387
898555
|
activeSubscriptions: subscriptions.list().map((entry) => entry.provider),
|
|
898388
898556
|
pendingSubscriptions: subscriptions.listPending().map((entry) => entry.provider)
|
|
898389
898557
|
};
|
|
898390
|
-
|
|
898391
|
-
|
|
898558
|
+
mkdirSync75(dirname74(targetPath), { recursive: true });
|
|
898559
|
+
writeFileSync67(targetPath, JSON.stringify(bundle, null, 2) + `
|
|
898392
898560
|
`, "utf-8");
|
|
898393
898561
|
ctx.print(`Auth review bundle exported to ${targetPath}`);
|
|
898394
898562
|
return;
|
|
898395
898563
|
}
|
|
898396
898564
|
if (mode === "inspect") {
|
|
898397
898565
|
try {
|
|
898398
|
-
const bundle = JSON.parse(
|
|
898566
|
+
const bundle = JSON.parse(readFileSync97(targetPath, "utf-8"));
|
|
898399
898567
|
ctx.print(inspectAuthBundle(bundle));
|
|
898400
898568
|
} catch (error51) {
|
|
898401
898569
|
ctx.print(`Could not read that bundle file: ${error51 instanceof Error ? error51.message : String(error51)}`);
|
|
@@ -898450,8 +898618,8 @@ function registerGuidanceRuntimeCommands(registry5) {
|
|
|
898450
898618
|
// src/input/commands/subscription-runtime.ts
|
|
898451
898619
|
init_config6();
|
|
898452
898620
|
init_config6();
|
|
898453
|
-
import { mkdirSync as
|
|
898454
|
-
import { dirname as
|
|
898621
|
+
import { mkdirSync as mkdirSync76, readFileSync as readFileSync98, writeFileSync as writeFileSync68 } from "fs";
|
|
898622
|
+
import { dirname as dirname75 } from "path";
|
|
898455
898623
|
init_utils4();
|
|
898456
898624
|
function buildReviewText(ctx) {
|
|
898457
898625
|
const subscriptions = requireSubscriptionManager(ctx).list();
|
|
@@ -898471,7 +898639,7 @@ function buildReviewText(ctx) {
|
|
|
898471
898639
|
`);
|
|
898472
898640
|
}
|
|
898473
898641
|
function inspectBundle2(path7) {
|
|
898474
|
-
const bundle = JSON.parse(
|
|
898642
|
+
const bundle = JSON.parse(readFileSync98(path7, "utf-8"));
|
|
898475
898643
|
return [
|
|
898476
898644
|
"Subscription Bundle Review",
|
|
898477
898645
|
` exported at ${new Date(bundle.exportedAt).toISOString()}`,
|
|
@@ -898737,8 +898905,8 @@ function registerSubscriptionRuntimeCommands(registry5) {
|
|
|
898737
898905
|
exportedAt: Date.now(),
|
|
898738
898906
|
subscriptions: manager5.list()
|
|
898739
898907
|
};
|
|
898740
|
-
|
|
898741
|
-
|
|
898908
|
+
mkdirSync76(dirname75(targetPath), { recursive: true });
|
|
898909
|
+
writeFileSync68(targetPath, `${JSON.stringify(bundle, null, 2)}
|
|
898742
898910
|
`, "utf-8");
|
|
898743
898911
|
ctx.print(`Subscription bundle exported to ${targetPath}`);
|
|
898744
898912
|
ctx.print("This file contains active sign-in tokens. Keep it private and delete it after use.");
|
|
@@ -899430,7 +899598,7 @@ function formatMcpServerList(servers) {
|
|
|
899430
899598
|
}
|
|
899431
899599
|
|
|
899432
899600
|
// src/input/commands/session-content.ts
|
|
899433
|
-
import { existsSync as existsSync94, mkdirSync as
|
|
899601
|
+
import { existsSync as existsSync94, mkdirSync as mkdirSync77 } from "fs";
|
|
899434
899602
|
import { writeFile as writeFile11 } from "fs/promises";
|
|
899435
899603
|
|
|
899436
899604
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/export/markdown.js
|
|
@@ -899667,10 +899835,10 @@ function registerSessionContentCommands(registry5) {
|
|
|
899667
899835
|
fileContent = lines.join(`
|
|
899668
899836
|
`);
|
|
899669
899837
|
}
|
|
899670
|
-
const { dirname:
|
|
899671
|
-
const dir =
|
|
899838
|
+
const { dirname: dirname76 } = await import("path");
|
|
899839
|
+
const dir = dirname76(resolvedPath3);
|
|
899672
899840
|
if (!existsSync94(dir))
|
|
899673
|
-
|
|
899841
|
+
mkdirSync77(dir, { recursive: true });
|
|
899674
899842
|
await writeFile11(resolvedPath3, fileContent, "utf-8");
|
|
899675
899843
|
ctx.print([
|
|
899676
899844
|
"Exported conversation",
|
|
@@ -900320,8 +900488,8 @@ ${favorites2.pinned.map((entry) => ` \u2605 ${entry.registryKey ?? entry.modelI
|
|
|
900320
900488
|
}
|
|
900321
900489
|
|
|
900322
900490
|
// src/input/commands/experience-runtime.ts
|
|
900323
|
-
import { existsSync as existsSync96, mkdirSync as
|
|
900324
|
-
import { dirname as
|
|
900491
|
+
import { existsSync as existsSync96, mkdirSync as mkdirSync79, readFileSync as readFileSync100, writeFileSync as writeFileSync70 } from "fs";
|
|
900492
|
+
import { dirname as dirname76 } from "path";
|
|
900325
900493
|
function inspectVoiceBundle(bundle) {
|
|
900326
900494
|
return [
|
|
900327
900495
|
"Voice Review",
|
|
@@ -900435,8 +900603,8 @@ function registerExperienceRuntimeCommands(registry5) {
|
|
|
900435
900603
|
"Operator review remains the primary review path for risky actions."
|
|
900436
900604
|
]
|
|
900437
900605
|
};
|
|
900438
|
-
|
|
900439
|
-
|
|
900606
|
+
mkdirSync79(dirname76(targetPath), { recursive: true });
|
|
900607
|
+
writeFileSync70(targetPath, `${JSON.stringify(bundle, null, 2)}
|
|
900440
900608
|
`, "utf-8");
|
|
900441
900609
|
ctx.print(`Voice bundle exported to ${targetPath}`);
|
|
900442
900610
|
return;
|
|
@@ -900447,7 +900615,7 @@ function registerExperienceRuntimeCommands(registry5) {
|
|
|
900447
900615
|
return;
|
|
900448
900616
|
}
|
|
900449
900617
|
try {
|
|
900450
|
-
const bundle = JSON.parse(
|
|
900618
|
+
const bundle = JSON.parse(readFileSync100(targetPath, "utf-8"));
|
|
900451
900619
|
ctx.print(inspectVoiceBundle(bundle));
|
|
900452
900620
|
} catch {
|
|
900453
900621
|
ctx.print("could not read voice bundle");
|
|
@@ -900584,8 +900752,8 @@ function registerTasksRuntimeCommands(registry5) {
|
|
|
900584
900752
|
}
|
|
900585
900753
|
|
|
900586
900754
|
// src/input/commands/local-provider-runtime.ts
|
|
900587
|
-
import { join as
|
|
900588
|
-
import { existsSync as existsSync97, mkdirSync as
|
|
900755
|
+
import { join as join106 } from "path";
|
|
900756
|
+
import { existsSync as existsSync97, mkdirSync as mkdirSync80 } from "fs";
|
|
900589
900757
|
import { writeFile as writeFile12, unlink as unlink2 } from "fs/promises";
|
|
900590
900758
|
init_utils4();
|
|
900591
900759
|
function isValidProviderName(name51) {
|
|
@@ -900640,7 +900808,7 @@ Example: /provider add my-server http://192.168.0.85:8001/v1 --yes`);
|
|
|
900640
900808
|
return;
|
|
900641
900809
|
}
|
|
900642
900810
|
const providersDir = shellPaths.resolveUserPath(GOODVIBES_AGENT_SURFACE_ROOT, "providers");
|
|
900643
|
-
const providerFile =
|
|
900811
|
+
const providerFile = join106(providersDir, `${name51}.json`);
|
|
900644
900812
|
if (existsSync97(providerFile)) {
|
|
900645
900813
|
ctx.print(`Provider ${name51} already exists at ${providerFile}
|
|
900646
900814
|
Remove it first with /provider remove ${name51} --yes`);
|
|
@@ -900694,7 +900862,7 @@ Remove it first with /provider remove ${name51} --yes`);
|
|
|
900694
900862
|
models
|
|
900695
900863
|
};
|
|
900696
900864
|
try {
|
|
900697
|
-
|
|
900865
|
+
mkdirSync80(providersDir, { recursive: true });
|
|
900698
900866
|
await writeFile12(providerFile, JSON.stringify(config6, null, 2), "utf-8");
|
|
900699
900867
|
} catch (e4) {
|
|
900700
900868
|
ctx.print(`Error writing provider file ${summarizeError(e4)}`);
|
|
@@ -900834,7 +901002,7 @@ ${statusText(storePath, loadLanScanConsent(shellPaths, GOODVIBES_AGENT_SURFACE_R
|
|
|
900834
901002
|
}
|
|
900835
901003
|
|
|
900836
901004
|
// src/input/commands/local-setup-review.ts
|
|
900837
|
-
import { existsSync as existsSync98, readFileSync as
|
|
901005
|
+
import { existsSync as existsSync98, readFileSync as readFileSync101 } from "fs";
|
|
900838
901006
|
init_config6();
|
|
900839
901007
|
async function buildSetupReviewSnapshot(ctx) {
|
|
900840
901008
|
const shellPaths = requireShellPaths(ctx);
|
|
@@ -900871,7 +901039,7 @@ async function buildSetupReviewSnapshot(ctx) {
|
|
|
900871
901039
|
let managedHookChainCount = 0;
|
|
900872
901040
|
if (existsSync98(hooksPath)) {
|
|
900873
901041
|
try {
|
|
900874
|
-
const parsed = JSON.parse(
|
|
901042
|
+
const parsed = JSON.parse(readFileSync101(hooksPath, "utf-8"));
|
|
900875
901043
|
managedHookCount = parsed.hooks?.length ?? 0;
|
|
900876
901044
|
managedHookChainCount = parsed.chains?.length ?? 0;
|
|
900877
901045
|
} catch {}
|
|
@@ -902523,8 +902691,8 @@ function renderQrToString(matrix) {
|
|
|
902523
902691
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/pairing/companion-token.js
|
|
902524
902692
|
init_logger();
|
|
902525
902693
|
import { randomBytes as randomBytes10 } from "crypto";
|
|
902526
|
-
import { readFileSync as
|
|
902527
|
-
import { join as
|
|
902694
|
+
import { readFileSync as readFileSync102, writeFileSync as writeFileSync71, mkdirSync as mkdirSync81, existsSync as existsSync99, chmodSync as chmodSync3, unlinkSync as unlinkSync11 } from "fs";
|
|
902695
|
+
import { join as join107, dirname as dirname77, resolve as resolve43 } from "path";
|
|
902528
902696
|
var TOKEN_PREFIX = "gv_";
|
|
902529
902697
|
function generateTokenValue() {
|
|
902530
902698
|
return TOKEN_PREFIX + randomBytes10(24).toString("base64url");
|
|
@@ -902533,7 +902701,7 @@ function generatePeerId() {
|
|
|
902533
902701
|
return randomBytes10(12).toString("hex");
|
|
902534
902702
|
}
|
|
902535
902703
|
function resolveSharedTokenPath(daemonHomeDir) {
|
|
902536
|
-
return
|
|
902704
|
+
return join107(daemonHomeDir, "operator-tokens.json");
|
|
902537
902705
|
}
|
|
902538
902706
|
function normalizeCompanionTokenOptions(first2, second) {
|
|
902539
902707
|
if (typeof first2 === "string") {
|
|
@@ -902549,7 +902717,7 @@ function getOrCreateCompanionToken(first2, second) {
|
|
|
902549
902717
|
const tokenPath = resolveSharedTokenPath(options.daemonHomeDir);
|
|
902550
902718
|
if (!options.regenerate && existsSync99(tokenPath)) {
|
|
902551
902719
|
try {
|
|
902552
|
-
const raw =
|
|
902720
|
+
const raw = readFileSync102(tokenPath, "utf-8");
|
|
902553
902721
|
const record3 = JSON.parse(raw);
|
|
902554
902722
|
if (typeof record3.token === "string" && typeof record3.peerId === "string") {
|
|
902555
902723
|
return { token: record3.token, peerId: record3.peerId, createdAt: record3.createdAt };
|
|
@@ -902561,9 +902729,9 @@ function getOrCreateCompanionToken(first2, second) {
|
|
|
902561
902729
|
peerId: generatePeerId(),
|
|
902562
902730
|
createdAt: Date.now()
|
|
902563
902731
|
};
|
|
902564
|
-
const dir =
|
|
902565
|
-
|
|
902566
|
-
|
|
902732
|
+
const dir = dirname77(tokenPath);
|
|
902733
|
+
mkdirSync81(dir, { recursive: true });
|
|
902734
|
+
writeFileSync71(tokenPath, JSON.stringify(record2, null, 2), { encoding: "utf-8", mode: 384 });
|
|
902567
902735
|
try {
|
|
902568
902736
|
chmodSync3(tokenPath, 384);
|
|
902569
902737
|
} catch (error51) {
|
|
@@ -902862,8 +903030,8 @@ function registerAgentWorkspaceRuntimeCommands(registry5) {
|
|
|
902862
903030
|
}
|
|
902863
903031
|
|
|
902864
903032
|
// src/input/commands/agent-runtime-profile-runtime.ts
|
|
902865
|
-
import { mkdirSync as
|
|
902866
|
-
import { dirname as
|
|
903033
|
+
import { mkdirSync as mkdirSync82 } from "fs";
|
|
903034
|
+
import { dirname as dirname78 } from "path";
|
|
902867
903035
|
function parseFlag(args2, name51) {
|
|
902868
903036
|
const index = args2.indexOf(name51);
|
|
902869
903037
|
if (index < 0)
|
|
@@ -903089,7 +903257,7 @@ function registerAgentRuntimeProfileRuntimeCommands(registry5) {
|
|
|
903089
903257
|
return;
|
|
903090
903258
|
}
|
|
903091
903259
|
const targetPath = shellPaths.resolveWorkspacePath(pathArg);
|
|
903092
|
-
|
|
903260
|
+
mkdirSync82(dirname78(targetPath), { recursive: true });
|
|
903093
903261
|
const template = exportAgentRuntimeProfileTemplate(homeDirectory, templateId, targetPath, {
|
|
903094
903262
|
includeVibe: commandArgs.includes("--include-vibe"),
|
|
903095
903263
|
shellPaths
|
|
@@ -903925,7 +904093,7 @@ function registerVibeRuntimeCommands(registry5) {
|
|
|
903925
904093
|
}
|
|
903926
904094
|
|
|
903927
904095
|
// src/input/commands/agent-skills-runtime.ts
|
|
903928
|
-
import { readFileSync as
|
|
904096
|
+
import { readFileSync as readFileSync103 } from "fs";
|
|
903929
904097
|
var SKILL_VALUE_FLAGS = ["name", "description", "procedure", "tags", "triggers", "requires-env", "requires-command", "requires-commands", "skills"];
|
|
903930
904098
|
function parseSkillArgs(args2) {
|
|
903931
904099
|
return parseAgentLocalLibraryArgs(args2, { valueFlags: SKILL_VALUE_FLAGS });
|
|
@@ -904303,7 +904471,7 @@ async function runAgentSkillsRuntimeCommand(args2, ctx) {
|
|
|
904303
904471
|
`));
|
|
904304
904472
|
return;
|
|
904305
904473
|
}
|
|
904306
|
-
const content =
|
|
904474
|
+
const content = readFileSync103(filePath, "utf-8");
|
|
904307
904475
|
const parseResult = parseSkillStandardMarkdown(content);
|
|
904308
904476
|
if ("error" in parseResult) {
|
|
904309
904477
|
ctx.print(`Skill standard import rejected: ${parseResult.error}`);
|
|
@@ -904869,8 +905037,8 @@ function registerRoutinesRuntimeCommands(registry5) {
|
|
|
904869
905037
|
import { createHash as createHash28 } from "crypto";
|
|
904870
905038
|
|
|
904871
905039
|
// src/input/connected-host-routes.ts
|
|
904872
|
-
import { existsSync as existsSync100, readFileSync as
|
|
904873
|
-
import { join as
|
|
905040
|
+
import { existsSync as existsSync100, readFileSync as readFileSync104 } from "fs";
|
|
905041
|
+
import { join as join108 } from "path";
|
|
904874
905042
|
var CONNECTED_HOST_FAILURE_LABELS = {
|
|
904875
905043
|
auth_required: "auth required",
|
|
904876
905044
|
connected_host_unavailable: "connected host unavailable",
|
|
@@ -904886,11 +905054,11 @@ function resolveConnectedHostConnection2(context) {
|
|
|
904886
905054
|
const host = typeof hostValue === "string" && hostValue.trim().length > 0 ? hostValue.trim() : "127.0.0.1";
|
|
904887
905055
|
const port2 = typeof portValue === "number" && Number.isFinite(portValue) ? portValue : 3421;
|
|
904888
905056
|
const homeDirectory = context.workspace?.shellPaths?.homeDirectory ?? process.env.HOME ?? "";
|
|
904889
|
-
const tokenPath =
|
|
905057
|
+
const tokenPath = join108(homeDirectory, ".goodvibes", "daemon", "operator-tokens.json");
|
|
904890
905058
|
if (!existsSync100(tokenPath))
|
|
904891
905059
|
return { baseUrl: `http://${host}:${port2}`, token: null, tokenPath };
|
|
904892
905060
|
try {
|
|
904893
|
-
const parsed = JSON.parse(
|
|
905061
|
+
const parsed = JSON.parse(readFileSync104(tokenPath, "utf-8"));
|
|
904894
905062
|
const token = isRecord39(parsed) && typeof parsed.token === "string" ? parsed.token : null;
|
|
904895
905063
|
return { baseUrl: `http://${host}:${port2}`, token, tokenPath };
|
|
904896
905064
|
} catch {
|
|
@@ -905940,26 +906108,26 @@ function registerBriefRuntimeCommands(registry5) {
|
|
|
905940
906108
|
}
|
|
905941
906109
|
|
|
905942
906110
|
// src/cli/bundle-command.ts
|
|
905943
|
-
import { existsSync as existsSync103, mkdirSync as
|
|
905944
|
-
import { dirname as
|
|
906111
|
+
import { existsSync as existsSync103, mkdirSync as mkdirSync83, readFileSync as readFileSync106, writeFileSync as writeFileSync72 } from "fs";
|
|
906112
|
+
import { dirname as dirname80 } from "path";
|
|
905945
906113
|
|
|
905946
906114
|
// src/cli/help.ts
|
|
905947
|
-
import { existsSync as existsSync101, readFileSync as
|
|
905948
|
-
import { dirname as
|
|
906115
|
+
import { existsSync as existsSync101, readFileSync as readFileSync105 } from "fs";
|
|
906116
|
+
import { dirname as dirname79, join as join109 } from "path";
|
|
905949
906117
|
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
905950
906118
|
function readJsonVersion(path7) {
|
|
905951
906119
|
try {
|
|
905952
906120
|
if (!existsSync101(path7))
|
|
905953
906121
|
return null;
|
|
905954
|
-
const parsed = JSON.parse(
|
|
906122
|
+
const parsed = JSON.parse(readFileSync105(path7, "utf-8"));
|
|
905955
906123
|
return typeof parsed.version === "string" ? parsed.version : null;
|
|
905956
906124
|
} catch {
|
|
905957
906125
|
return null;
|
|
905958
906126
|
}
|
|
905959
906127
|
}
|
|
905960
906128
|
function getPackageVersion() {
|
|
905961
|
-
const here =
|
|
905962
|
-
return readJsonVersion(
|
|
906129
|
+
const here = dirname79(fileURLToPath4(import.meta.url));
|
|
906130
|
+
return readJsonVersion(join109(here, "..", "..", "package.json")) ?? VERSION;
|
|
905963
906131
|
}
|
|
905964
906132
|
function renderGoodVibesVersion(binary2 = "goodvibes-agent") {
|
|
905965
906133
|
return `${binary2} ${getPackageVersion()}`;
|
|
@@ -906478,7 +906646,7 @@ function classifyProviderSetup(input) {
|
|
|
906478
906646
|
init_config6();
|
|
906479
906647
|
import { closeSync as closeSync6, existsSync as existsSync102, openSync as openSync6, readSync as readSync2, statSync as statSync22 } from "fs";
|
|
906480
906648
|
import net3 from "net";
|
|
906481
|
-
import { isAbsolute as isAbsolute17, join as
|
|
906649
|
+
import { isAbsolute as isAbsolute17, join as join110 } from "path";
|
|
906482
906650
|
|
|
906483
906651
|
// src/cli/network-posture.ts
|
|
906484
906652
|
function isLoopbackHost(host) {
|
|
@@ -906678,7 +906846,7 @@ function resolveConfiguredLogPath(runtime2) {
|
|
|
906678
906846
|
const trimmed2 = value.trim();
|
|
906679
906847
|
if (!trimmed2)
|
|
906680
906848
|
return;
|
|
906681
|
-
return isAbsolute17(trimmed2) ? trimmed2 :
|
|
906849
|
+
return isAbsolute17(trimmed2) ? trimmed2 : join110(runtime2.homeDirectory, trimmed2);
|
|
906682
906850
|
}
|
|
906683
906851
|
function createExternalHostLifecycle(logPath) {
|
|
906684
906852
|
return {
|
|
@@ -906767,7 +906935,7 @@ function isRecord42(value) {
|
|
|
906767
906935
|
}
|
|
906768
906936
|
function readJsonFile2(path7) {
|
|
906769
906937
|
try {
|
|
906770
|
-
const value = JSON.parse(
|
|
906938
|
+
const value = JSON.parse(readFileSync106(path7, "utf-8"));
|
|
906771
906939
|
if (!isRecord42(value))
|
|
906772
906940
|
return { ok: false, error: "Bundle file must contain a JSON object." };
|
|
906773
906941
|
return { ok: true, value };
|
|
@@ -906906,8 +907074,8 @@ async function handleBundleCommand(runtime2) {
|
|
|
906906
907074
|
}
|
|
906907
907075
|
};
|
|
906908
907076
|
const targetPath = shellPaths.resolveWorkspacePath(outputPath);
|
|
906909
|
-
|
|
906910
|
-
|
|
907077
|
+
mkdirSync83(dirname80(targetPath), { recursive: true });
|
|
907078
|
+
writeFileSync72(targetPath, redactSerializedSecrets(JSON.stringify(bundle, null, 2), sensitiveValues) + `
|
|
906911
907079
|
`, "utf-8");
|
|
906912
907080
|
return {
|
|
906913
907081
|
output: formatJsonOrText(runtime2, {
|
|
@@ -907531,8 +907699,8 @@ function formatProviderAuthRoute(route) {
|
|
|
907531
907699
|
}
|
|
907532
907700
|
|
|
907533
907701
|
// src/cli/management-commands.ts
|
|
907534
|
-
import { mkdirSync as
|
|
907535
|
-
import { dirname as
|
|
907702
|
+
import { mkdirSync as mkdirSync84, writeFileSync as writeFileSync73 } from "fs";
|
|
907703
|
+
import { dirname as dirname81 } from "path";
|
|
907536
907704
|
init_config6();
|
|
907537
907705
|
init_config6();
|
|
907538
907706
|
init_config6();
|
|
@@ -907842,8 +908010,8 @@ async function handleSessions(runtime2) {
|
|
|
907842
908010
|
`;
|
|
907843
908011
|
if (outputPath) {
|
|
907844
908012
|
const targetPath = services.shellPaths.resolveWorkspacePath(outputPath);
|
|
907845
|
-
|
|
907846
|
-
|
|
908013
|
+
mkdirSync84(dirname81(targetPath), { recursive: true });
|
|
908014
|
+
writeFileSync73(targetPath, text, "utf-8");
|
|
907847
908015
|
return [
|
|
907848
908016
|
"Session exported",
|
|
907849
908017
|
` path ${targetPath}`
|
|
@@ -908729,8 +908897,8 @@ Run goodvibes-agent skills discover to inspect available skill files.`, 1);
|
|
|
908729
908897
|
|
|
908730
908898
|
// src/cli/memory-command.ts
|
|
908731
908899
|
init_state();
|
|
908732
|
-
import { mkdirSync as
|
|
908733
|
-
import { dirname as
|
|
908900
|
+
import { mkdirSync as mkdirSync85, readFileSync as readFileSync107, writeFileSync as writeFileSync74 } from "fs";
|
|
908901
|
+
import { dirname as dirname82, resolve as resolve44 } from "path";
|
|
908734
908902
|
|
|
908735
908903
|
// src/cli/memory-command-wire.ts
|
|
908736
908904
|
var WIRE_STORE_LABEL = "wire:connected-daemon";
|
|
@@ -909299,7 +909467,7 @@ function isMemoryBundle(value) {
|
|
|
909299
909467
|
return value.schemaVersion === "v1" && typeof value.exportedAt === "number" && (value.scope === "all" || typeof value.scope === "string" && isMemoryScope2(value.scope)) && typeof value.recordCount === "number" && typeof value.linkCount === "number" && Array.isArray(value.records) && value.records.every(isMemoryRecord) && Array.isArray(value.links) && value.links.every(isMemoryLink);
|
|
909300
909468
|
}
|
|
909301
909469
|
function readBundle(path7) {
|
|
909302
|
-
const parsed = JSON.parse(
|
|
909470
|
+
const parsed = JSON.parse(readFileSync107(path7, "utf-8"));
|
|
909303
909471
|
if (!isMemoryBundle(parsed))
|
|
909304
909472
|
throw new Error("Invalid Agent memory bundle.");
|
|
909305
909473
|
for (const record2 of parsed.records) {
|
|
@@ -909316,8 +909484,8 @@ function resolvePath4(runtime2, path7) {
|
|
|
909316
909484
|
return resolve44(runtime2.workingDirectory, path7);
|
|
909317
909485
|
}
|
|
909318
909486
|
function writeBundle(path7, bundle) {
|
|
909319
|
-
|
|
909320
|
-
|
|
909487
|
+
mkdirSync85(dirname82(path7), { recursive: true });
|
|
909488
|
+
writeFileSync74(path7, `${JSON.stringify(bundle, null, 2)}
|
|
909321
909489
|
`);
|
|
909322
909490
|
}
|
|
909323
909491
|
function renderBundleInspection(path7, bundle) {
|
|
@@ -912185,11 +912353,11 @@ function registerEmailRuntimeCommands(registry5) {
|
|
|
912185
912353
|
}
|
|
912186
912354
|
|
|
912187
912355
|
// src/input/commands/calendar-runtime.ts
|
|
912188
|
-
import { existsSync as existsSync106, readFileSync as
|
|
912356
|
+
import { existsSync as existsSync106, readFileSync as readFileSync109 } from "fs";
|
|
912189
912357
|
|
|
912190
912358
|
// src/agent/calendar-registry.ts
|
|
912191
|
-
import { existsSync as existsSync105, mkdirSync as
|
|
912192
|
-
import { dirname as
|
|
912359
|
+
import { existsSync as existsSync105, mkdirSync as mkdirSync87, readFileSync as readFileSync108, renameSync as renameSync25, writeFileSync as writeFileSync76 } from "fs";
|
|
912360
|
+
import { dirname as dirname83, resolve as resolve45 } from "path";
|
|
912193
912361
|
|
|
912194
912362
|
// src/agent/ics-timezone.ts
|
|
912195
912363
|
var fmtCache = new Map;
|
|
@@ -912705,8 +912873,8 @@ class AgentCalendarRegistry {
|
|
|
912705
912873
|
const abs2 = resolve45(destPath);
|
|
912706
912874
|
if (existsSync105(abs2))
|
|
912707
912875
|
throw new Error(`File already exists: ${abs2}. Remove it or choose a different path.`);
|
|
912708
|
-
|
|
912709
|
-
|
|
912876
|
+
mkdirSync87(dirname83(abs2), { recursive: true });
|
|
912877
|
+
writeFileSync76(abs2, icsContent, "utf-8");
|
|
912710
912878
|
}
|
|
912711
912879
|
return icsContent;
|
|
912712
912880
|
}
|
|
@@ -912732,15 +912900,15 @@ class AgentCalendarRegistry {
|
|
|
912732
912900
|
if (!existsSync105(this.storePath))
|
|
912733
912901
|
return { version: STORE_VERSION9, events: [] };
|
|
912734
912902
|
try {
|
|
912735
|
-
return parseStore8(
|
|
912903
|
+
return parseStore8(readFileSync108(this.storePath, "utf-8"));
|
|
912736
912904
|
} catch (error51) {
|
|
912737
912905
|
throw new Error(`Could not read calendar store: ${error51 instanceof Error ? error51.message : String(error51)}`);
|
|
912738
912906
|
}
|
|
912739
912907
|
}
|
|
912740
912908
|
writeStore(store) {
|
|
912741
|
-
|
|
912909
|
+
mkdirSync87(dirname83(this.storePath), { recursive: true });
|
|
912742
912910
|
const tmpPath = `${this.storePath}.tmp`;
|
|
912743
|
-
|
|
912911
|
+
writeFileSync76(tmpPath, formatStore8(store), "utf-8");
|
|
912744
912912
|
renameSync25(tmpPath, this.storePath);
|
|
912745
912913
|
}
|
|
912746
912914
|
}
|
|
@@ -913216,7 +913384,7 @@ async function runCalendarRuntimeCommand(args2, ctx) {
|
|
|
913216
913384
|
ctx.print(`File not found: ${filePath}`);
|
|
913217
913385
|
return;
|
|
913218
913386
|
}
|
|
913219
|
-
const content =
|
|
913387
|
+
const content = readFileSync109(filePath, "utf-8");
|
|
913220
913388
|
if (!parsed.yes) {
|
|
913221
913389
|
const preview5 = parseIcs2(content);
|
|
913222
913390
|
ctx.print([
|
|
@@ -914246,9 +914414,9 @@ async function reconcileMemorySpineAdoption(options) {
|
|
|
914246
914414
|
}
|
|
914247
914415
|
|
|
914248
914416
|
// src/agent/prompt-context-receipts.ts
|
|
914249
|
-
import { appendFileSync as appendFileSync4, existsSync as existsSync107, mkdirSync as
|
|
914417
|
+
import { appendFileSync as appendFileSync4, existsSync as existsSync107, mkdirSync as mkdirSync88, readFileSync as readFileSync110 } from "fs";
|
|
914250
914418
|
import { createHash as createHash29 } from "crypto";
|
|
914251
|
-
import { dirname as
|
|
914419
|
+
import { dirname as dirname84 } from "path";
|
|
914252
914420
|
var RECEIPT_STORE_LIMIT = 200;
|
|
914253
914421
|
var OUTCOME_DETAIL_LIMIT = 240;
|
|
914254
914422
|
function approxTokens(text) {
|
|
@@ -914613,21 +914781,21 @@ class AgentPromptContextReceiptStore {
|
|
|
914613
914781
|
append(receipt) {
|
|
914614
914782
|
if (!this.receiptPath)
|
|
914615
914783
|
return;
|
|
914616
|
-
|
|
914784
|
+
mkdirSync88(dirname84(this.receiptPath), { recursive: true });
|
|
914617
914785
|
appendFileSync4(this.receiptPath, `${JSON.stringify(receipt)}
|
|
914618
914786
|
`, "utf-8");
|
|
914619
914787
|
}
|
|
914620
914788
|
appendTurnOutcome(outcome) {
|
|
914621
914789
|
if (!this.receiptPath)
|
|
914622
914790
|
return;
|
|
914623
|
-
|
|
914791
|
+
mkdirSync88(dirname84(this.receiptPath), { recursive: true });
|
|
914624
914792
|
appendFileSync4(this.receiptPath, `${JSON.stringify({ kind: "turn_outcome", outcome })}
|
|
914625
914793
|
`, "utf-8");
|
|
914626
914794
|
}
|
|
914627
914795
|
load() {
|
|
914628
914796
|
if (!this.receiptPath || !existsSync107(this.receiptPath))
|
|
914629
914797
|
return;
|
|
914630
|
-
const lines =
|
|
914798
|
+
const lines = readFileSync110(this.receiptPath, "utf-8").split(`
|
|
914631
914799
|
`).filter(Boolean);
|
|
914632
914800
|
const parsed = lines.map(parseReceiptLine).filter((entry) => Boolean(entry));
|
|
914633
914801
|
const receipts = parsed.map((entry) => entry.receipt).filter((receipt) => Boolean(receipt));
|
|
@@ -921438,8 +921606,8 @@ function describeHarnessCommand(commandRegistry, args2) {
|
|
|
921438
921606
|
}
|
|
921439
921607
|
|
|
921440
921608
|
// src/agent/skill-draft-runner.ts
|
|
921441
|
-
import { existsSync as existsSync108, mkdirSync as
|
|
921442
|
-
import { dirname as
|
|
921609
|
+
import { existsSync as existsSync108, mkdirSync as mkdirSync89, readFileSync as readFileSync111, renameSync as renameSync26, writeFileSync as writeFileSync77 } from "fs";
|
|
921610
|
+
import { dirname as dirname85 } from "path";
|
|
921443
921611
|
|
|
921444
921612
|
// src/agent/skill-draft-proposer.ts
|
|
921445
921613
|
var MAX_PROPOSALS = 3;
|
|
@@ -921559,7 +921727,7 @@ function readLedger(ledgerPath) {
|
|
|
921559
921727
|
if (!existsSync108(ledgerPath))
|
|
921560
921728
|
return { version: LEDGER_VERSION, entries: [] };
|
|
921561
921729
|
try {
|
|
921562
|
-
const raw = JSON.parse(
|
|
921730
|
+
const raw = JSON.parse(readFileSync111(ledgerPath, "utf-8"));
|
|
921563
921731
|
if (!isRecord45(raw))
|
|
921564
921732
|
return { version: LEDGER_VERSION, entries: [] };
|
|
921565
921733
|
const entries = Array.isArray(raw.entries) ? raw.entries.filter(isRecord45).filter((e4) => typeof e4.skillId === "string" && typeof e4.name === "string" && typeof e4.candidateId === "string" && typeof e4.proposedAt === "string").map((e4) => ({
|
|
@@ -921574,9 +921742,9 @@ function readLedger(ledgerPath) {
|
|
|
921574
921742
|
}
|
|
921575
921743
|
}
|
|
921576
921744
|
function writeLedger(ledgerPath, file2) {
|
|
921577
|
-
|
|
921745
|
+
mkdirSync89(dirname85(ledgerPath), { recursive: true });
|
|
921578
921746
|
const tmpPath = `${ledgerPath}.tmp`;
|
|
921579
|
-
|
|
921747
|
+
writeFileSync77(tmpPath, `${JSON.stringify(file2, null, 2)}
|
|
921580
921748
|
`, "utf-8");
|
|
921581
921749
|
renameSync26(tmpPath, ledgerPath);
|
|
921582
921750
|
}
|
|
@@ -922183,8 +922351,8 @@ function describeHarnessDelegationRoute(context, args2) {
|
|
|
922183
922351
|
}
|
|
922184
922352
|
|
|
922185
922353
|
// src/tools/agent-harness-keybinding-metadata.ts
|
|
922186
|
-
import { existsSync as existsSync109, mkdirSync as
|
|
922187
|
-
import { dirname as
|
|
922354
|
+
import { existsSync as existsSync109, mkdirSync as mkdirSync90, readFileSync as readFileSync112, writeFileSync as writeFileSync78 } from "fs";
|
|
922355
|
+
import { dirname as dirname86 } from "path";
|
|
922188
922356
|
var FIXED_SHORTCUTS = [
|
|
922189
922357
|
{ key: "Enter", description: "Send prompt" },
|
|
922190
922358
|
{ key: "Shift+Enter / Ctrl+J", description: "Insert newline" },
|
|
@@ -922568,15 +922736,15 @@ function keybindingOperationRoute(action2) {
|
|
|
922568
922736
|
function readOverrideFile(configPath) {
|
|
922569
922737
|
if (!existsSync109(configPath))
|
|
922570
922738
|
return {};
|
|
922571
|
-
const parsed = JSON.parse(
|
|
922739
|
+
const parsed = JSON.parse(readFileSync112(configPath, "utf-8"));
|
|
922572
922740
|
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
922573
922741
|
throw new Error(`Keybindings config ${configPath} must contain a JSON object.`);
|
|
922574
922742
|
}
|
|
922575
922743
|
return parsed;
|
|
922576
922744
|
}
|
|
922577
922745
|
function writeOverrideFile(configPath, overrides) {
|
|
922578
|
-
|
|
922579
|
-
|
|
922746
|
+
mkdirSync90(dirname86(configPath), { recursive: true });
|
|
922747
|
+
writeFileSync78(configPath, `${JSON.stringify(overrides, null, 2)}
|
|
922580
922748
|
`, "utf-8");
|
|
922581
922749
|
}
|
|
922582
922750
|
function totalHarnessKeybindings(context) {
|
|
@@ -923944,7 +924112,7 @@ async function connectedHostStatusSummary(context, toolRegistry, options = {}) {
|
|
|
923944
924112
|
init_contracts3();
|
|
923945
924113
|
|
|
923946
924114
|
// src/tools/agent-harness-sudo-posture.ts
|
|
923947
|
-
import { join as
|
|
924115
|
+
import { join as join111 } from "path";
|
|
923948
924116
|
function homeDirectory(context) {
|
|
923949
924117
|
const shellPaths3 = context?.workspace.shellPaths;
|
|
923950
924118
|
const fromShellPaths = typeof shellPaths3?.homeDirectory === "string" && shellPaths3.homeDirectory.trim() ? shellPaths3.homeDirectory.trim() : "";
|
|
@@ -923955,7 +924123,7 @@ function homeDirectory(context) {
|
|
|
923955
924123
|
function sudoExecutionPosture(context) {
|
|
923956
924124
|
const sudoPasswordPresent = Boolean(process.env.SUDO_PASSWORD);
|
|
923957
924125
|
const home = homeDirectory(context);
|
|
923958
|
-
const envFilePath = home ?
|
|
924126
|
+
const envFilePath = home ? join111(home, ".goodvibes", ".env") : null;
|
|
923959
924127
|
const setupRoute = 'setup action:"item" setupItemId:"sudo-execution-posture"';
|
|
923960
924128
|
const foregroundRoute = 'execution action:"route" id:"local-shell-command"';
|
|
923961
924129
|
const processCapabilitiesRoute = 'process action:"capabilities"';
|
|
@@ -927876,7 +928044,7 @@ async function describeHarnessMcpServer(context, args2) {
|
|
|
927876
928044
|
}
|
|
927877
928045
|
|
|
927878
928046
|
// src/core/hardware-profile.ts
|
|
927879
|
-
import { readFileSync as
|
|
928047
|
+
import { readFileSync as readFileSync113 } from "fs";
|
|
927880
928048
|
import { cpus, freemem, totalmem } from "os";
|
|
927881
928049
|
import { spawn as spawn7 } from "child_process";
|
|
927882
928050
|
var BYTES_PER_WEIGHT = {
|
|
@@ -927971,7 +928139,7 @@ function _mergeProbeIntoCache(current, fresh) {
|
|
|
927971
928139
|
}
|
|
927972
928140
|
function probeRam() {
|
|
927973
928141
|
try {
|
|
927974
|
-
const raw =
|
|
928142
|
+
const raw = readFileSync113("/proc/meminfo", "utf-8");
|
|
927975
928143
|
const parsed = parseProcMeminfo(raw);
|
|
927976
928144
|
if (parsed.totalRamBytes !== null)
|
|
927977
928145
|
return parsed;
|
|
@@ -946166,8 +946334,8 @@ function planAgentTaskRoute(context, args2) {
|
|
|
946166
946334
|
}
|
|
946167
946335
|
|
|
946168
946336
|
// src/tools/agent-harness-release-evidence.ts
|
|
946169
|
-
import { existsSync as existsSync110, readFileSync as
|
|
946170
|
-
import { join as
|
|
946337
|
+
import { existsSync as existsSync110, readFileSync as readFileSync114, statSync as statSync24 } from "fs";
|
|
946338
|
+
import { join as join112 } from "path";
|
|
946171
946339
|
var RELEASE_EVIDENCE_ARTIFACTS = [
|
|
946172
946340
|
{
|
|
946173
946341
|
id: "release-notes",
|
|
@@ -946201,7 +946369,7 @@ var RELEASE_EVIDENCE_ARTIFACTS = [
|
|
|
946201
946369
|
}
|
|
946202
946370
|
];
|
|
946203
946371
|
function packageRoot() {
|
|
946204
|
-
return
|
|
946372
|
+
return join112(import.meta.dir, "..", "..");
|
|
946205
946373
|
}
|
|
946206
946374
|
function readString113(value) {
|
|
946207
946375
|
return typeof value === "string" ? value.trim() : "";
|
|
@@ -946251,7 +946419,7 @@ function evidenceLookupFromArgs(args2) {
|
|
|
946251
946419
|
return query2 ? { source: "query", input: query2 } : null;
|
|
946252
946420
|
}
|
|
946253
946421
|
function loadArtifact2(artifact) {
|
|
946254
|
-
const absolutePath =
|
|
946422
|
+
const absolutePath = join112(packageRoot(), artifact.path);
|
|
946255
946423
|
if (!existsSync110(absolutePath)) {
|
|
946256
946424
|
return {
|
|
946257
946425
|
status: "missing",
|
|
@@ -946261,7 +946429,7 @@ function loadArtifact2(artifact) {
|
|
|
946261
946429
|
};
|
|
946262
946430
|
}
|
|
946263
946431
|
try {
|
|
946264
|
-
const source =
|
|
946432
|
+
const source = readFileSync114(absolutePath, "utf-8");
|
|
946265
946433
|
const sizeBytes = statSync24(absolutePath).size;
|
|
946266
946434
|
if (artifact.kind === "json") {
|
|
946267
946435
|
return {
|
|
@@ -946473,10 +946641,10 @@ function describeHarnessReleaseEvidenceArtifact(args2) {
|
|
|
946473
946641
|
}
|
|
946474
946642
|
|
|
946475
946643
|
// src/tools/agent-harness-release-readiness.ts
|
|
946476
|
-
import { existsSync as existsSync111, readFileSync as
|
|
946477
|
-
import { join as
|
|
946644
|
+
import { existsSync as existsSync111, readFileSync as readFileSync115 } from "fs";
|
|
946645
|
+
import { join as join113 } from "path";
|
|
946478
946646
|
var RELEASE_READINESS_RELATIVE_PATH = "release/release-readiness.json";
|
|
946479
|
-
var RELEASE_READINESS_PATH =
|
|
946647
|
+
var RELEASE_READINESS_PATH = join113(import.meta.dir, "..", "..", RELEASE_READINESS_RELATIVE_PATH);
|
|
946480
946648
|
var QUALITY_DIMENSIONS = [
|
|
946481
946649
|
"capabilityCoverage",
|
|
946482
946650
|
"userAccess",
|
|
@@ -946501,7 +946669,7 @@ function loadReleaseReadiness() {
|
|
|
946501
946669
|
return { status: "unavailable", reason: `${RELEASE_READINESS_RELATIVE_PATH} is not present in this Agent installation.` };
|
|
946502
946670
|
}
|
|
946503
946671
|
try {
|
|
946504
|
-
const source =
|
|
946672
|
+
const source = readFileSync115(RELEASE_READINESS_PATH, "utf-8");
|
|
946505
946673
|
const parsed = JSON.parse(source);
|
|
946506
946674
|
if (!isRecord48(parsed))
|
|
946507
946675
|
return { status: "unavailable", reason: `${RELEASE_READINESS_RELATIVE_PATH} must contain a JSON object.` };
|
|
@@ -948235,7 +948403,7 @@ function describeResearchSource(context, args2) {
|
|
|
948235
948403
|
}
|
|
948236
948404
|
|
|
948237
948405
|
// src/tools/agent-harness-security-posture.ts
|
|
948238
|
-
import { existsSync as existsSync112, readFileSync as
|
|
948406
|
+
import { existsSync as existsSync112, readFileSync as readFileSync116 } from "fs";
|
|
948239
948407
|
init_config6();
|
|
948240
948408
|
var SUPPORT_BUNDLE_ROUTES = [
|
|
948241
948409
|
{
|
|
@@ -948813,7 +948981,7 @@ function describeHarnessSupportBundle(context, args2) {
|
|
|
948813
948981
|
}
|
|
948814
948982
|
let parsed;
|
|
948815
948983
|
try {
|
|
948816
|
-
parsed = JSON.parse(
|
|
948984
|
+
parsed = JSON.parse(readFileSync116(path7, "utf-8"));
|
|
948817
948985
|
} catch (error53) {
|
|
948818
948986
|
return {
|
|
948819
948987
|
status: "missing_lookup",
|
|
@@ -949245,10 +949413,10 @@ async function describeHarnessServiceEndpoint(context, args2) {
|
|
|
949245
949413
|
}
|
|
949246
949414
|
|
|
949247
949415
|
// src/tools/agent-harness-setup-posture.ts
|
|
949248
|
-
import { join as
|
|
949416
|
+
import { join as join114 } from "path";
|
|
949249
949417
|
|
|
949250
949418
|
// src/input/agent-workspace-settings.ts
|
|
949251
|
-
import { existsSync as existsSync113, readFileSync as
|
|
949419
|
+
import { existsSync as existsSync113, readFileSync as readFileSync117 } from "fs";
|
|
949252
949420
|
var GOODVIBES_TUI_SURFACE_ROOT = "tui";
|
|
949253
949421
|
var TUI_IMPORTABLE_SETTING_PREFIXES = [
|
|
949254
949422
|
"display.",
|
|
@@ -949280,7 +949448,7 @@ function isRecord50(value) {
|
|
|
949280
949448
|
function readJsonRecord(path7) {
|
|
949281
949449
|
if (!existsSync113(path7))
|
|
949282
949450
|
return null;
|
|
949283
|
-
const parsed = JSON.parse(
|
|
949451
|
+
const parsed = JSON.parse(readFileSync117(path7, "utf-8"));
|
|
949284
949452
|
return isRecord50(parsed) ? parsed : null;
|
|
949285
949453
|
}
|
|
949286
949454
|
function readNestedSettingValue(record2, key) {
|
|
@@ -952370,7 +952538,7 @@ function provisionConnectedHostOperatorToken(context, args2) {
|
|
|
952370
952538
|
}
|
|
952371
952539
|
};
|
|
952372
952540
|
}
|
|
952373
|
-
const daemonHomeDir =
|
|
952541
|
+
const daemonHomeDir = join114(shellPaths3.homeDirectory, ".goodvibes", "daemon");
|
|
952374
952542
|
const canonicalPath = connectedHostOperatorTokenPath(shellPaths3.homeDirectory);
|
|
952375
952543
|
try {
|
|
952376
952544
|
const record2 = getOrCreateCompanionToken(GOODVIBES_AGENT_PAIRING_SURFACE, { daemonHomeDir });
|
|
@@ -955991,8 +956159,8 @@ function formatUnifiedInbox(inbox) {
|
|
|
955991
956159
|
|
|
955992
956160
|
// src/agent/channel-draft.ts
|
|
955993
956161
|
import { createHash as createHash31, randomUUID as randomUUID58 } from "crypto";
|
|
955994
|
-
import { existsSync as existsSync114, mkdirSync as
|
|
955995
|
-
import { dirname as
|
|
956162
|
+
import { existsSync as existsSync114, mkdirSync as mkdirSync91, readFileSync as readFileSync118, renameSync as renameSync27, writeFileSync as writeFileSync79 } from "fs";
|
|
956163
|
+
import { dirname as dirname87 } from "path";
|
|
955996
956164
|
var DRAFT_VERSION = 1;
|
|
955997
956165
|
var DRAFT_FILE_VERSION = 1;
|
|
955998
956166
|
var DRAFT_LIMIT = 200;
|
|
@@ -956059,7 +956227,7 @@ function readChannelDrafts(shellPaths3) {
|
|
|
956059
956227
|
if (!existsSync114(path7))
|
|
956060
956228
|
return { path: path7, exists: false, drafts: [] };
|
|
956061
956229
|
try {
|
|
956062
|
-
const parsed = JSON.parse(
|
|
956230
|
+
const parsed = JSON.parse(readFileSync118(path7, "utf-8"));
|
|
956063
956231
|
return { path: path7, exists: true, drafts: parseDraftFile(parsed).drafts };
|
|
956064
956232
|
} catch (error53) {
|
|
956065
956233
|
return {
|
|
@@ -956072,9 +956240,9 @@ function readChannelDrafts(shellPaths3) {
|
|
|
956072
956240
|
}
|
|
956073
956241
|
function writeDrafts(path7, drafts) {
|
|
956074
956242
|
const file2 = { version: DRAFT_FILE_VERSION, drafts: drafts.slice(0, DRAFT_LIMIT) };
|
|
956075
|
-
|
|
956243
|
+
mkdirSync91(dirname87(path7), { recursive: true });
|
|
956076
956244
|
const tempPath = `${path7}.tmp`;
|
|
956077
|
-
|
|
956245
|
+
writeFileSync79(tempPath, `${JSON.stringify(file2, null, 2)}
|
|
956078
956246
|
`, "utf-8");
|
|
956079
956247
|
renameSync27(tempPath, path7);
|
|
956080
956248
|
}
|
|
@@ -956228,8 +956396,8 @@ function formatChannelDraftList(snapshot2) {
|
|
|
956228
956396
|
|
|
956229
956397
|
// src/agent/channel-profile-routing.ts
|
|
956230
956398
|
import { randomUUID as randomUUID59 } from "crypto";
|
|
956231
|
-
import { existsSync as existsSync115, mkdirSync as
|
|
956232
|
-
import { dirname as
|
|
956399
|
+
import { existsSync as existsSync115, mkdirSync as mkdirSync92, readFileSync as readFileSync119, renameSync as renameSync28, writeFileSync as writeFileSync80 } from "fs";
|
|
956400
|
+
import { dirname as dirname88 } from "path";
|
|
956233
956401
|
var ROUTE_VERSION = 1;
|
|
956234
956402
|
var ROUTE_FILE_VERSION = 1;
|
|
956235
956403
|
var ROUTE_LIMIT = 500;
|
|
@@ -956282,7 +956450,7 @@ function readChannelProfileRoutes(shellPaths3) {
|
|
|
956282
956450
|
if (!existsSync115(path7))
|
|
956283
956451
|
return { path: path7, exists: false, routes: [] };
|
|
956284
956452
|
try {
|
|
956285
|
-
const parsed = JSON.parse(
|
|
956453
|
+
const parsed = JSON.parse(readFileSync119(path7, "utf-8"));
|
|
956286
956454
|
return { path: path7, exists: true, routes: parseRouteFile(parsed).routes };
|
|
956287
956455
|
} catch (error53) {
|
|
956288
956456
|
return {
|
|
@@ -956298,9 +956466,9 @@ function writeRoutes(path7, routes3) {
|
|
|
956298
956466
|
version: ROUTE_FILE_VERSION,
|
|
956299
956467
|
routes: routes3.slice(0, ROUTE_LIMIT)
|
|
956300
956468
|
};
|
|
956301
|
-
|
|
956469
|
+
mkdirSync92(dirname88(path7), { recursive: true });
|
|
956302
956470
|
const tempPath = `${path7}.tmp`;
|
|
956303
|
-
|
|
956471
|
+
writeFileSync80(tempPath, `${JSON.stringify(file2, null, 2)}
|
|
956304
956472
|
`, "utf-8");
|
|
956305
956473
|
renameSync28(tempPath, path7);
|
|
956306
956474
|
}
|
|
@@ -967544,7 +967712,7 @@ function handleProfilePickerToken(state4, token) {
|
|
|
967544
967712
|
}
|
|
967545
967713
|
|
|
967546
967714
|
// src/input/handler-picker-routes.ts
|
|
967547
|
-
import { readFileSync as
|
|
967715
|
+
import { readFileSync as readFileSync120 } from "fs";
|
|
967548
967716
|
|
|
967549
967717
|
// src/renderer/model-picker-overlay.ts
|
|
967550
967718
|
var MODEL_PICKER_CHROME_LINES = 7;
|
|
@@ -967917,7 +968085,7 @@ function handleFilePickerToken(state4, token) {
|
|
|
967917
968085
|
throw new Error("working directory is unavailable");
|
|
967918
968086
|
}
|
|
967919
968087
|
const resolvedPath3 = resolveAndValidatePath(selected, projectRoot);
|
|
967920
|
-
const data =
|
|
968088
|
+
const data = readFileSync120(resolvedPath3);
|
|
967921
968089
|
const base645 = data.toString("base64");
|
|
967922
968090
|
const mediaType = state4.mediaTypeFromExt(ext);
|
|
967923
968091
|
const filename = selected.split("/").pop() ?? selected;
|
|
@@ -973624,7 +973792,7 @@ function wrapRequestPermissionWithApprovalAlert(original, deps) {
|
|
|
973624
973792
|
|
|
973625
973793
|
// src/cli/entrypoint.ts
|
|
973626
973794
|
import { existsSync as existsSync116 } from "fs";
|
|
973627
|
-
import { join as
|
|
973795
|
+
import { join as join115 } from "path";
|
|
973628
973796
|
init_utils4();
|
|
973629
973797
|
// src/cli/status.ts
|
|
973630
973798
|
function yesNo3(value) {
|
|
@@ -974199,7 +974367,7 @@ async function prepareShellCliRuntime(argv, roots, binary2 = "goodvibes-agent")
|
|
|
974199
974367
|
workingDirectory: bootstrapWorkingDir,
|
|
974200
974368
|
homeDirectory: bootstrapHomeDirectory
|
|
974201
974369
|
} = ownership;
|
|
974202
|
-
configureActivityLogger(
|
|
974370
|
+
configureActivityLogger(join115(bootstrapWorkingDir, ".goodvibes", "logs"));
|
|
974203
974371
|
const configManager = new ConfigManager({
|
|
974204
974372
|
workingDir: bootstrapWorkingDir,
|
|
974205
974373
|
homeDir: bootstrapHomeDirectory,
|
|
@@ -974250,7 +974418,7 @@ async function prepareShellCliRuntime(argv, roots, binary2 = "goodvibes-agent")
|
|
|
974250
974418
|
});
|
|
974251
974419
|
const userStorePath = shellPaths3.resolveUserPath(GOODVIBES_AGENT_SURFACE_ROOT, "auth-users.json");
|
|
974252
974420
|
const bootstrapCredentialPath = shellPaths3.resolveUserPath(GOODVIBES_AGENT_SURFACE_ROOT, "auth-bootstrap.txt");
|
|
974253
|
-
const operatorTokenPath =
|
|
974421
|
+
const operatorTokenPath = join115(bootstrapHomeDirectory, ".goodvibes", "daemon", "operator-tokens.json");
|
|
974254
974422
|
const onboardingMarkers = readOnboardingCheckMarkers(shellPaths3);
|
|
974255
974423
|
const service = await buildCliServicePosture({
|
|
974256
974424
|
configManager,
|
|
@@ -974473,7 +974641,7 @@ init_voice();
|
|
|
974473
974641
|
|
|
974474
974642
|
// src/audio/player.ts
|
|
974475
974643
|
import { accessSync as accessSync2, constants as constants5 } from "fs";
|
|
974476
|
-
import { delimiter as delimiter2, join as
|
|
974644
|
+
import { delimiter as delimiter2, join as join116 } from "path";
|
|
974477
974645
|
import { spawn as spawn8 } from "child_process";
|
|
974478
974646
|
|
|
974479
974647
|
class LocalStreamingAudioPlayer {
|
|
@@ -974616,7 +974784,7 @@ function findExecutable(name51, env2) {
|
|
|
974616
974784
|
if (!dir)
|
|
974617
974785
|
continue;
|
|
974618
974786
|
for (const ext of extensions14) {
|
|
974619
|
-
const candidate2 =
|
|
974787
|
+
const candidate2 = join116(dir, `${name51}${ext}`);
|
|
974620
974788
|
try {
|
|
974621
974789
|
accessSync2(candidate2, constants5.X_OK);
|
|
974622
974790
|
return candidate2;
|
|
@@ -974894,8 +975062,8 @@ function buildAwayDigest(input) {
|
|
|
974894
975062
|
}
|
|
974895
975063
|
|
|
974896
975064
|
// src/core/last-seen-store.ts
|
|
974897
|
-
import { readFileSync as
|
|
974898
|
-
import { dirname as
|
|
975065
|
+
import { readFileSync as readFileSync121, writeFileSync as writeFileSync81, mkdirSync as mkdirSync93 } from "fs";
|
|
975066
|
+
import { dirname as dirname89 } from "path";
|
|
974899
975067
|
function isRecord54(value) {
|
|
974900
975068
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
974901
975069
|
}
|
|
@@ -974928,7 +975096,7 @@ class LastSeenStore {
|
|
|
974928
975096
|
}
|
|
974929
975097
|
read() {
|
|
974930
975098
|
try {
|
|
974931
|
-
const raw =
|
|
975099
|
+
const raw = readFileSync121(this.storePath, "utf-8");
|
|
974932
975100
|
return parseFile(raw)?.lastSeenAt ?? null;
|
|
974933
975101
|
} catch {
|
|
974934
975102
|
return null;
|
|
@@ -974936,9 +975104,9 @@ class LastSeenStore {
|
|
|
974936
975104
|
}
|
|
974937
975105
|
save(at = Date.now()) {
|
|
974938
975106
|
try {
|
|
974939
|
-
|
|
975107
|
+
mkdirSync93(dirname89(this.storePath), { recursive: true });
|
|
974940
975108
|
const data = { version: 1, lastSeenAt: at };
|
|
974941
|
-
|
|
975109
|
+
writeFileSync81(this.storePath, JSON.stringify(data, null, 2), "utf-8");
|
|
974942
975110
|
} catch {}
|
|
974943
975111
|
}
|
|
974944
975112
|
}
|