@pellux/goodvibes-sdk 0.33.38 → 0.34.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/contracts/artifacts/operator-contract.json +1383 -4
- package/dist/events/workflows.d.ts +4 -0
- package/dist/events/workflows.d.ts.map +1 -1
- package/dist/platform/agents/message-bus-core.d.ts +11 -0
- package/dist/platform/agents/message-bus-core.d.ts.map +1 -1
- package/dist/platform/agents/message-bus-core.js +28 -21
- package/dist/platform/agents/orchestrator-runner.d.ts.map +1 -1
- package/dist/platform/agents/orchestrator-runner.js +6 -4
- package/dist/platform/agents/wrfc-config.d.ts.map +1 -1
- package/dist/platform/agents/wrfc-config.js +16 -10
- package/dist/platform/agents/wrfc-controller.d.ts +26 -0
- package/dist/platform/agents/wrfc-controller.d.ts.map +1 -1
- package/dist/platform/agents/wrfc-controller.js +134 -138
- package/dist/platform/agents/wrfc-runtime-events.d.ts +1 -0
- package/dist/platform/agents/wrfc-runtime-events.d.ts.map +1 -1
- package/dist/platform/agents/wrfc-runtime-events.js +4 -1
- package/dist/platform/automation/delivery-manager.d.ts.map +1 -1
- package/dist/platform/automation/delivery-manager.js +1 -6
- package/dist/platform/batch/manager.d.ts.map +1 -1
- package/dist/platform/batch/manager.js +1 -3
- package/dist/platform/channels/policy-manager.d.ts.map +1 -1
- package/dist/platform/channels/policy-manager.js +1 -3
- package/dist/platform/channels/reply-pipeline.d.ts.map +1 -1
- package/dist/platform/channels/reply-pipeline.js +4 -0
- package/dist/platform/config/schema-domain-core.d.ts +1 -1
- package/dist/platform/config/schema-domain-core.d.ts.map +1 -1
- package/dist/platform/config/schema-domain-core.js +12 -12
- package/dist/platform/config/schema-domain-runtime.d.ts +1 -1
- package/dist/platform/config/schema-domain-runtime.d.ts.map +1 -1
- package/dist/platform/config/schema-domain-runtime.js +19 -18
- package/dist/platform/config/schema-domain-surfaces.d.ts +1 -1
- package/dist/platform/config/schema-domain-surfaces.d.ts.map +1 -1
- package/dist/platform/config/schema-domain-surfaces.js +4 -3
- package/dist/platform/config/schema-shared.d.ts +6 -0
- package/dist/platform/config/schema-shared.d.ts.map +1 -1
- package/dist/platform/config/schema-shared.js +21 -1
- package/dist/platform/control-plane/approval-broker.d.ts.map +1 -1
- package/dist/platform/control-plane/approval-broker.js +1 -3
- package/dist/platform/control-plane/method-catalog-calendar.d.ts +9 -0
- package/dist/platform/control-plane/method-catalog-calendar.d.ts.map +1 -0
- package/dist/platform/control-plane/method-catalog-calendar.js +117 -0
- package/dist/platform/control-plane/method-catalog-channels.d.ts.map +1 -1
- package/dist/platform/control-plane/method-catalog-channels.js +174 -0
- package/dist/platform/control-plane/method-catalog-email.d.ts +9 -0
- package/dist/platform/control-plane/method-catalog-email.d.ts.map +1 -0
- package/dist/platform/control-plane/method-catalog-email.js +101 -0
- package/dist/platform/control-plane/method-catalog.d.ts.map +1 -1
- package/dist/platform/control-plane/method-catalog.js +4 -0
- package/dist/platform/control-plane/session-broker-state.d.ts.map +1 -1
- package/dist/platform/control-plane/session-broker-state.js +1 -3
- package/dist/platform/core/compaction-sections.d.ts +5 -1
- package/dist/platform/core/compaction-sections.d.ts.map +1 -1
- package/dist/platform/core/compaction-sections.js +73 -66
- package/dist/platform/core/context-compaction.d.ts.map +1 -1
- package/dist/platform/core/context-compaction.js +9 -16
- package/dist/platform/core/orchestrator-context-runtime.d.ts +2 -2
- package/dist/platform/core/orchestrator-context-runtime.d.ts.map +1 -1
- package/dist/platform/core/orchestrator-context-runtime.js +24 -21
- package/dist/platform/core/orchestrator-tool-runtime.d.ts.map +1 -1
- package/dist/platform/core/orchestrator-tool-runtime.js +2 -1
- package/dist/platform/core/session-lineage.d.ts +2 -5
- package/dist/platform/core/session-lineage.d.ts.map +1 -1
- package/dist/platform/core/session-lineage.js +4 -16
- package/dist/platform/core/wrfc-routing.d.ts.map +1 -1
- package/dist/platform/core/wrfc-routing.js +1 -3
- package/dist/platform/daemon/http/mcp-routes.d.ts.map +1 -1
- package/dist/platform/daemon/http/mcp-routes.js +1 -3
- package/dist/platform/daemon/http/openai-compatible-routes.d.ts.map +1 -1
- package/dist/platform/daemon/http/openai-compatible-routes.js +1 -3
- package/dist/platform/daemon/http/runtime-routes.d.ts.map +1 -1
- package/dist/platform/daemon/http/runtime-routes.js +1 -3
- package/dist/platform/hooks/runners/http.d.ts.map +1 -1
- package/dist/platform/hooks/runners/http.js +9 -19
- package/dist/platform/integrations/webhooks.js +2 -11
- package/dist/platform/knowledge/semantic/self-improvement.d.ts.map +1 -1
- package/dist/platform/knowledge/semantic/self-improvement.js +2 -21
- package/dist/platform/mcp/client.d.ts.map +1 -1
- package/dist/platform/mcp/client.js +1 -3
- package/dist/platform/mcp/config.d.ts.map +1 -1
- package/dist/platform/mcp/config.js +1 -3
- package/dist/platform/media/builtin-generation-providers.d.ts.map +1 -1
- package/dist/platform/media/builtin-generation-providers.js +1 -6
- package/dist/platform/providers/anthropic-compat.d.ts.map +1 -1
- package/dist/platform/providers/anthropic-compat.js +11 -131
- package/dist/platform/providers/anthropic-sdk-provider.d.ts.map +1 -1
- package/dist/platform/providers/anthropic-sdk-provider.js +8 -42
- package/dist/platform/providers/anthropic-sse-assembler.d.ts +80 -0
- package/dist/platform/providers/anthropic-sse-assembler.d.ts.map +1 -0
- package/dist/platform/providers/anthropic-sse-assembler.js +146 -0
- package/dist/platform/providers/anthropic-stream.d.ts +30 -0
- package/dist/platform/providers/anthropic-stream.d.ts.map +1 -0
- package/dist/platform/providers/anthropic-stream.js +44 -0
- package/dist/platform/providers/anthropic-vertex.d.ts.map +1 -1
- package/dist/platform/providers/anthropic-vertex.js +1 -3
- package/dist/platform/providers/anthropic.d.ts.map +1 -1
- package/dist/platform/providers/anthropic.js +15 -151
- package/dist/platform/providers/capabilities.d.ts.map +1 -1
- package/dist/platform/providers/capabilities.js +11 -7
- package/dist/platform/providers/context-discovery.d.ts.map +1 -1
- package/dist/platform/providers/context-discovery.js +9 -16
- package/dist/platform/providers/context-window-fallback.d.ts +24 -0
- package/dist/platform/providers/context-window-fallback.d.ts.map +1 -0
- package/dist/platform/providers/context-window-fallback.js +48 -0
- package/dist/platform/providers/gemini.d.ts.map +1 -1
- package/dist/platform/providers/gemini.js +3 -6
- package/dist/platform/providers/json-ttl-cache.d.ts +35 -0
- package/dist/platform/providers/json-ttl-cache.d.ts.map +1 -0
- package/dist/platform/providers/json-ttl-cache.js +52 -0
- package/dist/platform/providers/llama-cpp.d.ts.map +1 -1
- package/dist/platform/providers/llama-cpp.js +2 -23
- package/dist/platform/providers/lm-studio-helpers.d.ts +1 -1
- package/dist/platform/providers/lm-studio-helpers.d.ts.map +1 -1
- package/dist/platform/providers/lm-studio-helpers.js +5 -25
- package/dist/platform/providers/model-benchmarks.d.ts.map +1 -1
- package/dist/platform/providers/model-benchmarks.js +11 -34
- package/dist/platform/providers/model-catalog-cache.d.ts.map +1 -1
- package/dist/platform/providers/model-catalog-cache.js +15 -38
- package/dist/platform/providers/model-catalog-synthetic.d.ts.map +1 -1
- package/dist/platform/providers/model-catalog-synthetic.js +3 -2
- package/dist/platform/providers/model-catalog.d.ts.map +1 -1
- package/dist/platform/providers/model-catalog.js +3 -2
- package/dist/platform/providers/model-limits.d.ts.map +1 -1
- package/dist/platform/providers/model-limits.js +18 -42
- package/dist/platform/providers/ollama.d.ts.map +1 -1
- package/dist/platform/providers/ollama.js +3 -24
- package/dist/platform/providers/openai-codex.d.ts.map +1 -1
- package/dist/platform/providers/openai-codex.js +8 -9
- package/dist/platform/providers/openai-compat.d.ts.map +1 -1
- package/dist/platform/providers/openai-compat.js +13 -40
- package/dist/platform/providers/openai-stream-helpers.d.ts +62 -0
- package/dist/platform/providers/openai-stream-helpers.d.ts.map +1 -0
- package/dist/platform/providers/openai-stream-helpers.js +73 -0
- package/dist/platform/providers/openai.d.ts.map +1 -1
- package/dist/platform/providers/openai.js +13 -41
- package/dist/platform/providers/provider-error.d.ts +17 -0
- package/dist/platform/providers/provider-error.d.ts.map +1 -0
- package/dist/platform/providers/provider-error.js +33 -0
- package/dist/platform/providers/provider-stop-reason.d.ts +15 -0
- package/dist/platform/providers/provider-stop-reason.d.ts.map +1 -0
- package/dist/platform/providers/provider-stop-reason.js +15 -0
- package/dist/platform/providers/sse-line-buffer.d.ts +13 -0
- package/dist/platform/providers/sse-line-buffer.d.ts.map +1 -0
- package/dist/platform/providers/sse-line-buffer.js +23 -0
- package/dist/platform/providers/tool-formats.d.ts +5 -0
- package/dist/platform/providers/tool-formats.d.ts.map +1 -1
- package/dist/platform/providers/tool-formats.js +14 -0
- package/dist/platform/runtime/bootstrap-runtime-events.d.ts.map +1 -1
- package/dist/platform/runtime/bootstrap-runtime-events.js +6 -0
- package/dist/platform/runtime/bootstrap-services.d.ts.map +1 -1
- package/dist/platform/runtime/bootstrap-services.js +4 -5
- package/dist/platform/runtime/emitters/workflows.d.ts +4 -0
- package/dist/platform/runtime/emitters/workflows.d.ts.map +1 -1
- package/dist/platform/runtime/emitters/workflows.js +3 -0
- package/dist/platform/runtime/remote/distributed-runtime-store.d.ts.map +1 -1
- package/dist/platform/runtime/remote/distributed-runtime-store.js +1 -3
- package/dist/platform/runtime/retention/pruner.js +2 -5
- package/dist/platform/runtime/store/helpers/reducers/lifecycle.d.ts.map +1 -1
- package/dist/platform/runtime/store/helpers/reducers/lifecycle.js +15 -14
- package/dist/platform/runtime/store/helpers/reducers/shared.d.ts +6 -0
- package/dist/platform/runtime/store/helpers/reducers/shared.d.ts.map +1 -1
- package/dist/platform/runtime/store/helpers/reducers/shared.js +8 -1
- package/dist/platform/runtime/telemetry/exporters/queue.d.ts.map +1 -1
- package/dist/platform/runtime/telemetry/exporters/queue.js +1 -7
- package/dist/platform/runtime/transports/http-helpers.d.ts +0 -1
- package/dist/platform/runtime/transports/http-helpers.d.ts.map +1 -1
- package/dist/platform/runtime/transports/http-helpers.js +1 -3
- package/dist/platform/runtime/ui-read-model-helpers.d.ts +2 -0
- package/dist/platform/runtime/ui-read-model-helpers.d.ts.map +1 -1
- package/dist/platform/runtime/ui-read-model-helpers.js +8 -0
- package/dist/platform/runtime/ui-read-models-core.d.ts.map +1 -1
- package/dist/platform/runtime/ui-read-models-core.js +3 -5
- package/dist/platform/runtime/ui-read-models-observability-remote.d.ts.map +1 -1
- package/dist/platform/runtime/ui-read-models-observability-remote.js +2 -4
- package/dist/platform/runtime/ui-read-models-operations.d.ts.map +1 -1
- package/dist/platform/runtime/ui-read-models-operations.js +8 -26
- package/dist/platform/scheduler/scheduler.d.ts.map +1 -1
- package/dist/platform/scheduler/scheduler.js +1 -3
- package/dist/platform/tools/exec/runtime.d.ts.map +1 -1
- package/dist/platform/tools/exec/runtime.js +1 -7
- package/dist/platform/tools/fetch/runtime.d.ts.map +1 -1
- package/dist/platform/tools/fetch/runtime.js +9 -20
- package/dist/platform/tools/shared/process-manager.d.ts.map +1 -1
- package/dist/platform/tools/shared/process-manager.js +1 -6
- package/dist/platform/utils/concurrency.d.ts +1 -0
- package/dist/platform/utils/concurrency.d.ts.map +1 -1
- package/dist/platform/utils/concurrency.js +1 -0
- package/dist/platform/utils/error-display.d.ts +9 -0
- package/dist/platform/utils/error-display.d.ts.map +1 -1
- package/dist/platform/utils/error-display.js +11 -0
- package/dist/platform/utils/fetch-with-timeout.d.ts +22 -2
- package/dist/platform/utils/fetch-with-timeout.d.ts.map +1 -1
- package/dist/platform/utils/fetch-with-timeout.js +33 -15
- package/dist/platform/utils/record-coerce.d.ts +5 -0
- package/dist/platform/utils/record-coerce.d.ts.map +1 -1
- package/dist/platform/utils/record-coerce.js +7 -0
- package/dist/platform/utils/retry.d.ts.map +1 -1
- package/dist/platform/utils/retry.js +2 -4
- package/dist/platform/version.js +1 -1
- package/package.json +9 -9
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
import { logger } from '../utils/logger.js';
|
|
26
26
|
import { DEFAULT_COMPACTION_CONFIG, estimateTokens } from './compaction-types.js';
|
|
27
27
|
import { summarizeError } from '../utils/error-display.js';
|
|
28
|
-
import { buildHandoffHeader, buildSessionMemories, buildCurrentTask, buildRunningAgents, gatherRecentConversation, buildConversationFilterPrompt, buildToolResultsPrompt, buildAgentActivityTable, buildOlderAgentSummaryPrompt, buildResolvedProblemsPrompt, buildPlanProgress, buildSessionLineage, } from './compaction-sections.js';
|
|
28
|
+
import { buildHandoffHeader, buildSessionMemories, buildCurrentTask, buildRunningAgents, gatherRecentConversation, buildConversationFilterPrompt, buildToolResultsPrompt, buildAgentActivityTable, buildOlderAgentSummaryPrompt, buildResolvedProblemsPrompt, buildPlanProgress, buildSessionLineage, extractText, isActiveAgent, } from './compaction-sections.js';
|
|
29
29
|
// ---------------------------------------------------------------------------
|
|
30
30
|
// Compaction trigger constants
|
|
31
31
|
// ---------------------------------------------------------------------------
|
|
@@ -208,7 +208,7 @@ function validateCompaction(sections, ctx, totalTokens, config) {
|
|
|
208
208
|
if (!sectionIds.has('current-task')) {
|
|
209
209
|
warnings.push('WARNING: current-task section is missing');
|
|
210
210
|
}
|
|
211
|
-
const hasRunningAgents = ctx.agents.some(
|
|
211
|
+
const hasRunningAgents = ctx.agents.some(isActiveAgent);
|
|
212
212
|
if (hasRunningAgents && !sectionIds.has('running-agents')) {
|
|
213
213
|
warnings.push('WARNING: running agents exist but running-agents section is missing');
|
|
214
214
|
}
|
|
@@ -272,9 +272,7 @@ async function runCompaction(ctx, registry) {
|
|
|
272
272
|
for (let i = ctx.messages.length - 1; i >= 0; i--) {
|
|
273
273
|
const msg = ctx.messages[i];
|
|
274
274
|
if (msg?.role === 'user') {
|
|
275
|
-
const text =
|
|
276
|
-
? msg.content
|
|
277
|
-
: msg.content.filter((p) => p.type === 'text').map((p) => p.text).join('');
|
|
275
|
+
const text = extractText(msg.content);
|
|
278
276
|
if (text.trim())
|
|
279
277
|
return text.trim();
|
|
280
278
|
}
|
|
@@ -333,18 +331,13 @@ async function runCompaction(ctx, registry) {
|
|
|
333
331
|
id: 'recent-conversation',
|
|
334
332
|
header: '## Recent Conversation',
|
|
335
333
|
content: filteredText,
|
|
336
|
-
tokens: estimateTokens(filteredText),
|
|
334
|
+
tokens: estimateTokens('## Recent Conversation\n' + filteredText),
|
|
337
335
|
});
|
|
338
336
|
}
|
|
339
337
|
else {
|
|
340
338
|
// Include raw gathered messages if the LLM filter fails.
|
|
341
339
|
const fallbackLines = gatheredMessages.map((m) => {
|
|
342
|
-
const text =
|
|
343
|
-
? m.content
|
|
344
|
-
: m.content
|
|
345
|
-
.filter((p) => p.type === 'text')
|
|
346
|
-
.map((p) => p.text)
|
|
347
|
-
.join('');
|
|
340
|
+
const text = extractText(m.content);
|
|
348
341
|
return `[${m.role}]: ${text.trim()}`;
|
|
349
342
|
});
|
|
350
343
|
const fallbackContent = fallbackLines.join('\n\n');
|
|
@@ -352,7 +345,7 @@ async function runCompaction(ctx, registry) {
|
|
|
352
345
|
id: 'recent-conversation',
|
|
353
346
|
header: '## Recent Conversation',
|
|
354
347
|
content: fallbackContent,
|
|
355
|
-
tokens: estimateTokens(fallbackContent),
|
|
348
|
+
tokens: estimateTokens('## Recent Conversation\n' + fallbackContent),
|
|
356
349
|
});
|
|
357
350
|
}
|
|
358
351
|
}
|
|
@@ -362,7 +355,7 @@ async function runCompaction(ctx, registry) {
|
|
|
362
355
|
id: 'tool-results',
|
|
363
356
|
header: '## Tool Results & Files Modified',
|
|
364
357
|
content: toolSummary,
|
|
365
|
-
tokens: estimateTokens(toolSummary),
|
|
358
|
+
tokens: estimateTokens('## Tool Results & Files Modified\n' + toolSummary),
|
|
366
359
|
});
|
|
367
360
|
}
|
|
368
361
|
// Older agent summary
|
|
@@ -371,7 +364,7 @@ async function runCompaction(ctx, registry) {
|
|
|
371
364
|
id: 'older-agent-summary',
|
|
372
365
|
header: '## Older Work Summary',
|
|
373
366
|
content: olderSummary,
|
|
374
|
-
tokens: estimateTokens(olderSummary),
|
|
367
|
+
tokens: estimateTokens('## Older Work Summary\n' + olderSummary),
|
|
375
368
|
});
|
|
376
369
|
}
|
|
377
370
|
// Resolved problems
|
|
@@ -381,7 +374,7 @@ async function runCompaction(ctx, registry) {
|
|
|
381
374
|
id: 'resolved-problems',
|
|
382
375
|
header: '## Resolved Problems',
|
|
383
376
|
content: problemsText,
|
|
384
|
-
tokens: estimateTokens(problemsText),
|
|
377
|
+
tokens: estimateTokens('## Resolved Problems\n' + problemsText),
|
|
385
378
|
});
|
|
386
379
|
}
|
|
387
380
|
// Plan progress (rule-based)
|
|
@@ -19,7 +19,7 @@ export type PreflightDeps = {
|
|
|
19
19
|
hookDispatcher: HookDispatcherLike | null;
|
|
20
20
|
configManager: Pick<ConfigManager, 'get'>;
|
|
21
21
|
providerRegistry: ProviderRegistry;
|
|
22
|
-
sessionLineageTracker: Pick<SessionLineageTracker, 'getEntries' | 'getCompactionCount'>;
|
|
22
|
+
sessionLineageTracker: Pick<SessionLineageTracker, 'getEntries' | 'getCompactionCount' | 'getOriginalTask'>;
|
|
23
23
|
sessionId: string;
|
|
24
24
|
agentManager: Pick<AgentManager, 'list'>;
|
|
25
25
|
wrfcController: Pick<WrfcController, 'listChains'>;
|
|
@@ -45,7 +45,7 @@ export type PostTurnContextDeps = {
|
|
|
45
45
|
hookDispatcher: HookDispatcherLike | null;
|
|
46
46
|
configManager: Pick<ConfigManager, 'get'>;
|
|
47
47
|
providerRegistry: ProviderRegistry;
|
|
48
|
-
sessionLineageTracker: Pick<SessionLineageTracker, 'getEntries' | 'getCompactionCount'>;
|
|
48
|
+
sessionLineageTracker: Pick<SessionLineageTracker, 'getEntries' | 'getCompactionCount' | 'getOriginalTask'>;
|
|
49
49
|
sessionId: string;
|
|
50
50
|
requestRender: () => void;
|
|
51
51
|
isCompacting: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator-context-runtime.d.ts","sourceRoot":"","sources":["../../../src/platform/core/orchestrator-context-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EA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BAAmB,CAAC;IAClC,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IACzC,cAAc,EAAE,IAAI,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;IACnD,WAAW,EAAE,IAAI,CAAC,oBAAoB,EAAE,WAAW,CAAC,GAAG,IAAI,CAAC;IAC5D,kBAAkB,EAAE,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IAC5D,UAAU,EAAE,eAAe,GAAG,IAAI,CAAC;IACnC,cAAc,EAAE,qBAAqB,CAAC;IACtC,cAAc,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAC1C,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;IAC1C,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,qBAAqB,EAAE,IAAI,CAAC,qBAAqB,EAAE,YAAY,GAAG,oBAAoB,GAAG,iBAAiB,CAAC,CAAC;IAC5G,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,kBAAkB,EAAE,MAAM,CAAC;IAC3B,qBAAqB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,wBAAsB,gCAAgC,CACpD,IAAI,EAAE,mBAAmB,EACzB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAuMf"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { logger } from '../utils/logger.js';
|
|
2
2
|
import { estimateConversationTokens, COMPACTION_BUFFER_TOKENS, SMALL_WINDOW_THRESHOLD, compactSmallWindow, getAutoCompactDecision } from './context-compaction.js';
|
|
3
|
+
import { isActiveAgent } from './compaction-sections.js';
|
|
3
4
|
import { emitOpsContextWarning } from '../runtime/emitters/index.js';
|
|
4
5
|
import { summarizeError } from '../utils/error-display.js';
|
|
5
6
|
function normalizeCatalogTier(tier) {
|
|
@@ -36,6 +37,22 @@ function formatAutoCompactTrigger(decision) {
|
|
|
36
37
|
}
|
|
37
38
|
return `crossing the ${decision.thresholdPercent}% auto-compact threshold`;
|
|
38
39
|
}
|
|
40
|
+
function buildAutoCompactionContext(deps, params) {
|
|
41
|
+
return {
|
|
42
|
+
messages: params.messages,
|
|
43
|
+
sessionMemories: deps.sessionMemoryStore?.list() ?? [],
|
|
44
|
+
lineageEntries: deps.sessionLineageTracker.getEntries(),
|
|
45
|
+
agents: deps.agentManager.list().filter(isActiveAgent),
|
|
46
|
+
wrfcChains: deps.wrfcController.listChains(),
|
|
47
|
+
activePlan: deps.planManager?.getActive(deps.sessionId) ?? null,
|
|
48
|
+
compactionCount: deps.sessionLineageTracker.getCompactionCount(),
|
|
49
|
+
originalTask: deps.sessionLineageTracker.getOriginalTask() ?? undefined,
|
|
50
|
+
contextWindow: params.contextWindow,
|
|
51
|
+
trigger: 'auto',
|
|
52
|
+
extractionModelId: params.extractionModelId,
|
|
53
|
+
extractionProvider: params.extractionProvider,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
39
56
|
export async function checkContextWindowPreflight(deps, turnId, model) {
|
|
40
57
|
const contextWindow = deps.providerRegistry.getContextWindowForModel(model);
|
|
41
58
|
const tier = normalizeCatalogTier(model.tier);
|
|
@@ -98,19 +115,12 @@ export async function checkContextWindowPreflight(deps, turnId, model) {
|
|
|
98
115
|
}
|
|
99
116
|
}
|
|
100
117
|
try {
|
|
101
|
-
const preflightCtx = {
|
|
118
|
+
const preflightCtx = buildAutoCompactionContext(deps, {
|
|
102
119
|
messages,
|
|
103
|
-
sessionMemories: deps.sessionMemoryStore?.list() ?? [],
|
|
104
|
-
lineageEntries: deps.sessionLineageTracker.getEntries(),
|
|
105
|
-
agents: deps.agentManager.list().filter(a => a.status === 'running' || a.status === 'pending'),
|
|
106
|
-
wrfcChains: deps.wrfcController.listChains(),
|
|
107
|
-
activePlan: deps.planManager?.getActive(deps.sessionId) ?? null,
|
|
108
|
-
compactionCount: deps.sessionLineageTracker.getCompactionCount(),
|
|
109
120
|
contextWindow,
|
|
110
|
-
trigger: 'auto',
|
|
111
121
|
extractionModelId: model.registryKey,
|
|
112
122
|
extractionProvider: model.provider,
|
|
113
|
-
};
|
|
123
|
+
});
|
|
114
124
|
await deps.conversation.compact(deps.providerRegistry, model.registryKey, 'auto', model.provider, preflightCtx);
|
|
115
125
|
deps.conversation.addSystemMessage('Context compacted. Retrying request...');
|
|
116
126
|
if (deps.hookDispatcher) {
|
|
@@ -278,19 +288,12 @@ export async function handlePostTurnContextMaintenance(deps, turnId, totalTokens
|
|
|
278
288
|
}
|
|
279
289
|
}
|
|
280
290
|
else if (!skipAutoCompact) {
|
|
281
|
-
const compactionCtx = {
|
|
291
|
+
const compactionCtx = buildAutoCompactionContext(deps, {
|
|
282
292
|
messages: currentMsgs,
|
|
283
|
-
sessionMemories: deps.sessionMemoryStore?.list() ?? [],
|
|
284
|
-
lineageEntries: deps.sessionLineageTracker.getEntries(),
|
|
285
|
-
agents: deps.agentManager.list().filter(a => a.status === 'running' || a.status === 'pending'),
|
|
286
|
-
wrfcChains: deps.wrfcController.listChains(),
|
|
287
|
-
activePlan: deps.planManager?.getActive(deps.sessionId) ?? null,
|
|
288
|
-
compactionCount: deps.sessionLineageTracker.getCompactionCount(),
|
|
289
293
|
contextWindow: maxTokens,
|
|
290
|
-
trigger: 'auto',
|
|
291
294
|
extractionModelId: currentModel.registryKey,
|
|
292
295
|
extractionProvider: currentModel.provider,
|
|
293
|
-
};
|
|
296
|
+
});
|
|
294
297
|
void deps.conversation.compact(deps.providerRegistry, currentModel.registryKey, 'auto', currentModel.provider, compactionCtx).then(() => {
|
|
295
298
|
deps.setIsCompacting(false);
|
|
296
299
|
deps.setLastWarningBracket(0);
|
|
@@ -378,9 +381,9 @@ export async function handlePostTurnContextMaintenance(deps, turnId, totalTokens
|
|
|
378
381
|
threshold: configuredThreshold,
|
|
379
382
|
currentTokens: totalTokens,
|
|
380
383
|
contextWindow: maxTokens,
|
|
381
|
-
thresholdTokens:
|
|
382
|
-
remainingTokens:
|
|
383
|
-
safetyBufferTokens:
|
|
384
|
+
thresholdTokens: autoDecision.thresholdTokens,
|
|
385
|
+
remainingTokens: autoDecision.remainingTokens,
|
|
386
|
+
safetyBufferTokens: autoDecision.safetyBufferTokens,
|
|
384
387
|
reason: 'threshold',
|
|
385
388
|
});
|
|
386
389
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator-tool-runtime.d.ts","sourceRoot":"","sources":["../../../src/platform/core/orchestrator-tool-runtime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAiB,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAclE,OAAO,EAAmD,KAAK,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEtH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACzF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"orchestrator-tool-runtime.d.ts","sourceRoot":"","sources":["../../../src/platform/core/orchestrator-tool-runtime.ts"],"names":[],"mappings":"AACA,OAAO,K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utils/logger.js';
|
|
5
5
|
import { evaluateOrchestrationSpawn } from '../runtime/orchestration/spawn-policy.js';
|
|
6
6
|
import { summarizeError } from '../utils/error-display.js';
|
|
7
|
+
import { isActiveAgent } from './compaction-sections.js';
|
|
7
8
|
export async function executeToolCalls(deps, turnId, calls) {
|
|
8
9
|
const results = [];
|
|
9
10
|
for (const call of calls) {
|
|
@@ -287,7 +288,7 @@ export function autoSpawnPendingItems(conversation, plan, items, agentManager, c
|
|
|
287
288
|
mode: 'graph-execute',
|
|
288
289
|
});
|
|
289
290
|
}
|
|
290
|
-
let running = agentManager.list().filter(a => a
|
|
291
|
+
let running = agentManager.list().filter(a => isActiveAgent(a)).length;
|
|
291
292
|
const spawnDecision = evaluateOrchestrationSpawn({
|
|
292
293
|
configManager,
|
|
293
294
|
mode: 'plan-auto',
|
|
@@ -31,12 +31,9 @@ export declare class SessionLineageTracker {
|
|
|
31
31
|
reset(): void;
|
|
32
32
|
/** Get the number of compactions performed. */
|
|
33
33
|
getCompactionCount(): number;
|
|
34
|
+
/** Get the original task for this session, or null if never set. */
|
|
35
|
+
getOriginalTask(): string | null;
|
|
34
36
|
/** Get a copy of the lineage entries (read-only snapshot). */
|
|
35
37
|
getEntries(): string[];
|
|
36
|
-
/**
|
|
37
|
-
* Format the lineage for compaction output.
|
|
38
|
-
* Returns null if originalTask was never set (section is omitted).
|
|
39
|
-
*/
|
|
40
|
-
format(): string | null;
|
|
41
38
|
}
|
|
42
39
|
//# sourceMappingURL=session-lineage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-lineage.d.ts","sourceRoot":"","sources":["../../../src/platform/core/session-lineage.ts"],"names":[],"mappings":"AAAA,qFAAqF;AAErF;;;;;;;;;;;;GAYG;AACH,qBAAa,qBAAqB;IAChC,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,CAAC,OAAO,CAAgB;IAE/B;;;;OAIG;IACH,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAKnC;;;;OAIG;IACH,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAMzC,+DAA+D;IAC/D,KAAK,IAAI,IAAI;IAKb,+CAA+C;IAC/C,kBAAkB,IAAI,MAAM;IAI5B,
|
|
1
|
+
{"version":3,"file":"session-lineage.d.ts","sourceRoot":"","sources":["../../../src/platform/core/session-lineage.ts"],"names":[],"mappings":"AAAA,qFAAqF;AAErF;;;;;;;;;;;;GAYG;AACH,qBAAa,qBAAqB;IAChC,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,CAAC,OAAO,CAAgB;IAE/B;;;;OAIG;IACH,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAKnC;;;;OAIG;IACH,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAMzC,+DAA+D;IAC/D,KAAK,IAAI,IAAI;IAKb,+CAA+C;IAC/C,kBAAkB,IAAI,MAAM;IAI5B,oEAAoE;IACpE,eAAe,IAAI,MAAM,GAAG,IAAI;IAIhC,8DAA8D;IAC9D,UAAU,IAAI,MAAM,EAAE;CAGvB"}
|
|
@@ -45,24 +45,12 @@ export class SessionLineageTracker {
|
|
|
45
45
|
getCompactionCount() {
|
|
46
46
|
return this.entries.length;
|
|
47
47
|
}
|
|
48
|
+
/** Get the original task for this session, or null if never set. */
|
|
49
|
+
getOriginalTask() {
|
|
50
|
+
return this.originalTask;
|
|
51
|
+
}
|
|
48
52
|
/** Get a copy of the lineage entries (read-only snapshot). */
|
|
49
53
|
getEntries() {
|
|
50
54
|
return [...this.entries];
|
|
51
55
|
}
|
|
52
|
-
/**
|
|
53
|
-
* Format the lineage for compaction output.
|
|
54
|
-
* Returns null if originalTask was never set (section is omitted).
|
|
55
|
-
*/
|
|
56
|
-
format() {
|
|
57
|
-
if (this.originalTask === null) {
|
|
58
|
-
return null;
|
|
59
|
-
}
|
|
60
|
-
const lines = [
|
|
61
|
-
`## Session Lineage`,
|
|
62
|
-
`Original task: "${this.originalTask}"`,
|
|
63
|
-
`Compactions: ${this.entries.length}`,
|
|
64
|
-
...this.entries,
|
|
65
|
-
];
|
|
66
|
-
return lines.join('\n');
|
|
67
|
-
}
|
|
68
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrfc-routing.d.ts","sourceRoot":"","sources":["../../../src/platform/core/wrfc-routing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"wrfc-routing.d.ts","sourceRoot":"","sources":["../../../src/platform/core/wrfc-routing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGpD,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAM3D;AAED,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAG1E;AAsBD,wBAAgB,yCAAyC,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAQrF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isRecord } from '../utils/record-coerce.js';
|
|
1
2
|
export function isWrfcWorkflowRequest(text) {
|
|
2
3
|
const normalized = text.trim().toLowerCase();
|
|
3
4
|
if (!/\bwrfc\b/.test(normalized))
|
|
@@ -12,9 +13,6 @@ export function buildWrfcWorkflowRoutingPrompt(text) {
|
|
|
12
13
|
return null;
|
|
13
14
|
return '[WRFC routing] The user is asking for WRFC-owned work. Use the agent tool to start exactly one WRFC owner chain with mode=spawn, template=engineer, reviewMode=wrfc. Do not answer by describing WRFC, and do not spawn reviewer/tester/verifier roots.';
|
|
14
15
|
}
|
|
15
|
-
function isRecord(value) {
|
|
16
|
-
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
17
|
-
}
|
|
18
16
|
function parseToolOutput(output) {
|
|
19
17
|
if (!output)
|
|
20
18
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-routes.d.ts","sourceRoot":"","sources":["../../../../src/platform/daemon/http/mcp-routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EACV,cAAc,EAIf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"mcp-routes.d.ts","sourceRoot":"","sources":["../../../../src/platform/daemon/http/mcp-routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EACV,cAAc,EAIf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAIhD,UAAU,eAAe;IACvB,QAAQ,CAAC,WAAW,EAAE,IAAI,CACxB,WAAW,EACT,oBAAoB,GACpB,QAAQ,GACR,oBAAoB,GACpB,oBAAoB,GACpB,aAAa,GACb,oBAAoB,GACpB,2BAA2B,GAC3B,cAAc,CACjB,CAAC;IACF,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;IAC/B,QAAQ,CAAC,aAAa,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,UAAU,GAAG,QAAQ,CAAC,CAAC;IACzE,QAAQ,CAAC,qBAAqB,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,UAAU,GAAG,IAAI,GAAG,QAAQ,CAAC,CAAC;IACxF,QAAQ,CAAC,YAAY,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,QAAQ,GAAG,IAAI,CAAC;CAC1D;AAiED,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAkExG"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { jsonErrorResponse } from './error-response.js';
|
|
2
|
-
|
|
3
|
-
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
4
|
-
}
|
|
2
|
+
import { isRecord } from '../../utils/record-coerce.js';
|
|
5
3
|
function stringArray(value) {
|
|
6
4
|
return Array.isArray(value) && value.every((entry) => typeof entry === 'string')
|
|
7
5
|
? [...value]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openai-compatible-routes.d.ts","sourceRoot":"","sources":["../../../../src/platform/daemon/http/openai-compatible-routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"openai-compatible-routes.d.ts","sourceRoot":"","sources":["../../../../src/platform/daemon/http/openai-compatible-routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAMpE,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE1C,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,EAAE,YAAY,GAAG,iBAAiB,GAAG,aAAa,CAAC,CAAC;IACpG,QAAQ,CAAC,aAAa,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,UAAU,GAAG,QAAQ,CAAC,CAAC;IAC7E,QAAQ,CAAC,iBAAiB,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,KAAK,QAAQ,CAAC;CAC9F;AAoBD,wBAAsB,8BAA8B,CAClD,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,4BAA4B,EACrC,UAAU,SAA4B,GACrC,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAgB1B"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { summarizeError } from '../../utils/error-display.js';
|
|
2
|
+
import { isRecord } from '../../utils/record-coerce.js';
|
|
2
3
|
const OPENAI_COMPAT_PATH_PREFIX = '/v1';
|
|
3
4
|
export async function dispatchOpenAICompatibleRoutes(request, context, pathPrefix = OPENAI_COMPAT_PATH_PREFIX) {
|
|
4
5
|
const url = new URL(request.url);
|
|
@@ -418,9 +419,6 @@ function parseDataUrl(value) {
|
|
|
418
419
|
return null;
|
|
419
420
|
return { mediaType: match[1], data: match[2] };
|
|
420
421
|
}
|
|
421
|
-
function isRecord(value) {
|
|
422
|
-
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
423
|
-
}
|
|
424
422
|
function readString(value) {
|
|
425
423
|
return typeof value === 'string' ? value : undefined;
|
|
426
424
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-routes.d.ts","sourceRoot":"","sources":["../../../../src/platform/daemon/http/runtime-routes.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,yBAAyB,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"runtime-routes.d.ts","sourceRoot":"","sources":["../../../../src/platform/daemon/http/runtime-routes.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,yBAAyB,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC;AAGxG,YAAY,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAkQ1E,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,yBAAyB,GACjC,4BAA4B,CAgB9B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createDaemonRuntimeRouteHandlers as createSdkDaemonRuntimeRouteHandlers } from '@pellux/goodvibes-daemon-sdk';
|
|
2
2
|
import { EXECUTION_FILESYSTEM_POLICIES, EXECUTION_NETWORK_POLICIES, EXECUTION_RISK_CLASSES, } from '../../runtime/execution-intents.js';
|
|
3
|
+
import { isRecord } from '../../utils/record-coerce.js';
|
|
3
4
|
const providerSelections = new Set(['inherit-current', 'concrete', 'synthetic']);
|
|
4
5
|
const providerFailurePolicies = new Set(['ordered-fallbacks', 'fail']);
|
|
5
6
|
const executionTargetKinds = new Set(['isolated', 'current', 'pinned', 'background', 'main', 'session', 'route']);
|
|
@@ -47,9 +48,6 @@ const communicationLanes = new Set(['parent-only', 'parent-and-children', 'cohor
|
|
|
47
48
|
const executionRiskClasses = new Set(EXECUTION_RISK_CLASSES);
|
|
48
49
|
const executionNetworkPolicies = new Set(EXECUTION_NETWORK_POLICIES);
|
|
49
50
|
const executionFilesystemPolicies = new Set(EXECUTION_FILESYSTEM_POLICIES);
|
|
50
|
-
function isRecord(value) {
|
|
51
|
-
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
52
|
-
}
|
|
53
51
|
function isFiniteNumber(value) {
|
|
54
52
|
return typeof value === 'number' && Number.isFinite(value);
|
|
55
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../../src/platform/hooks/runners/http.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAMzE;;;GAGG;AACH,wBAAsB,GAAG,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../../src/platform/hooks/runners/http.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAMzE;;;GAGG;AACH,wBAAsB,GAAG,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAsDrF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { logger } from '../../utils/logger.js';
|
|
2
2
|
import { summarizeError } from '../../utils/error-display.js';
|
|
3
3
|
import { classifyHostTrustTier, extractHostname, emitSsrfDeny } from '../../tools/fetch/trust-tiers.js';
|
|
4
|
-
import { instrumentedFetch } from '../../utils/fetch-with-timeout.js';
|
|
4
|
+
import { instrumentedFetch, fetchWithTimeout } from '../../utils/fetch-with-timeout.js';
|
|
5
5
|
/**
|
|
6
6
|
* HTTP hook runner.
|
|
7
7
|
* POSTs the event JSON to the configured URL and parses the response as HookResult.
|
|
@@ -25,24 +25,14 @@ export async function run(hook, event) {
|
|
|
25
25
|
}
|
|
26
26
|
const timeoutMs = (hook.timeout ?? 30) * 1000;
|
|
27
27
|
try {
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
'Content-Type': 'application/json',
|
|
37
|
-
...hook.headers,
|
|
38
|
-
},
|
|
39
|
-
body: JSON.stringify(event),
|
|
40
|
-
signal: controller.signal,
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
finally {
|
|
44
|
-
clearTimeout(timer);
|
|
45
|
-
}
|
|
28
|
+
const response = await fetchWithTimeout(url, {
|
|
29
|
+
method: 'POST',
|
|
30
|
+
headers: {
|
|
31
|
+
'Content-Type': 'application/json',
|
|
32
|
+
...hook.headers,
|
|
33
|
+
},
|
|
34
|
+
body: JSON.stringify(event),
|
|
35
|
+
}, timeoutMs, instrumentedFetch);
|
|
46
36
|
if (!response.ok) {
|
|
47
37
|
return {
|
|
48
38
|
ok: false,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { logger } from '../utils/logger.js';
|
|
2
2
|
import { classifyHostTrustTier, extractHostname, emitSsrfDeny } from '../tools/fetch/trust-tiers.js';
|
|
3
|
-
import { instrumentedFetch } from '../utils/fetch-with-timeout.js';
|
|
3
|
+
import { instrumentedFetch, createTimeoutController } from '../utils/fetch-with-timeout.js';
|
|
4
4
|
// ---------------------------------------------------------------------------
|
|
5
5
|
// WebhookNotifier
|
|
6
6
|
// ---------------------------------------------------------------------------
|
|
@@ -159,7 +159,7 @@ export class WebhookNotifier {
|
|
|
159
159
|
throw new Error(`WebhookNotifier: blocked URL — ${trustResult.reason}`);
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
|
-
const signal =
|
|
162
|
+
const signal = createTimeoutController(this.timeoutMs);
|
|
163
163
|
try {
|
|
164
164
|
const body = truncateUtf8(text, this.maxBodyBytes);
|
|
165
165
|
const headers = { 'Content-Type': 'text/plain' };
|
|
@@ -238,15 +238,6 @@ function truncateUtf8(value, maxBytes) {
|
|
|
238
238
|
}
|
|
239
239
|
return out;
|
|
240
240
|
}
|
|
241
|
-
function createTimeoutSignal(timeoutMs) {
|
|
242
|
-
if (typeof AbortSignal.timeout === 'function') {
|
|
243
|
-
return { signal: AbortSignal.timeout(timeoutMs), dispose: () => { } };
|
|
244
|
-
}
|
|
245
|
-
const controller = new AbortController();
|
|
246
|
-
const timer = setTimeout(() => controller.abort(new Error('Request timed out')), timeoutMs);
|
|
247
|
-
timer.unref?.();
|
|
248
|
-
return { signal: controller.signal, dispose: () => clearTimeout(timer) };
|
|
249
|
-
}
|
|
250
241
|
async function createWebhookSignatureHeaders(body, secret) {
|
|
251
242
|
const timestamp = String(Math.floor(Date.now() / 1000));
|
|
252
243
|
const encoder = new TextEncoder();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"self-improvement.d.ts","sourceRoot":"","sources":["../../../../src/platform/knowledge/semantic/self-improvement.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AAOrE,OAAO,KAAK,EACV,4BAA4B,EAC5B,iCAAiC,EACjC,kCAAkC,EACnC,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"self-improvement.d.ts","sourceRoot":"","sources":["../../../../src/platform/knowledge/semantic/self-improvement.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AAOrE,OAAO,KAAK,EACV,4BAA4B,EAC5B,iCAAiC,EACjC,kCAAkC,EACnC,MAAM,YAAY,CAAC;AA0BpB,UAAU,kBAAkB;IAC1B,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;IAC/B,QAAQ,CAAC,WAAW,CAAC,EAAE,4BAA4B,GAAG,IAAI,GAAG,SAAS,CAAC;IACvE,QAAQ,CAAC,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACvC,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS,4BAA4B,EAAE,GAAG,SAAS,CAAC;IAC9E,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CAC3I;AAmDD,wBAAsB,mCAAmC,CACvD,OAAO,EAAE,kBAAkB,EAC3B,KAAK,GAAE,iCAAsC,GAC5C,OAAO,CAAC,kCAAkC,CAAC,CAsF7C"}
|
|
@@ -3,6 +3,7 @@ import { getKnowledgeSpaceId, normalizeKnowledgeSpaceId } from '../spaces.js';
|
|
|
3
3
|
import { recoverNoRepairerTasks, recoverStaleActiveTasks } from './self-improvement-recovery.js';
|
|
4
4
|
import { sourceKnowledgeSpace, uniqueStrings } from './utils.js';
|
|
5
5
|
import { withTimeout } from './timeouts.js';
|
|
6
|
+
import { createTimeoutController } from '../../utils/fetch-with-timeout.js';
|
|
6
7
|
import { updateRefinementTask, upsertRefinementTaskForGap } from './self-improvement-tasks.js';
|
|
7
8
|
import { promoteRepairSources } from './self-improvement-promotion.js';
|
|
8
9
|
import { discoverIntrinsicGaps } from './self-improvement-intrinsic-gaps.js';
|
|
@@ -299,7 +300,7 @@ async function executeGapRepair(options) {
|
|
|
299
300
|
}
|
|
300
301
|
async function runGapRepairerWithBudget(input) {
|
|
301
302
|
const { input: runInput, spaceId, gap, gapContext, gapRepairer, remainingMs } = input;
|
|
302
|
-
const budget =
|
|
303
|
+
const budget = createTimeoutController(remainingMs, runInput.signal);
|
|
303
304
|
try {
|
|
304
305
|
return await withTimeout(gapRepairer({
|
|
305
306
|
spaceId,
|
|
@@ -317,26 +318,6 @@ async function runGapRepairerWithBudget(input) {
|
|
|
317
318
|
budget.dispose();
|
|
318
319
|
}
|
|
319
320
|
}
|
|
320
|
-
function createAbortBudget(parentSignal, timeoutMs) {
|
|
321
|
-
const controller = new AbortController();
|
|
322
|
-
const abortRepair = () => controller.abort();
|
|
323
|
-
if (parentSignal?.aborted) {
|
|
324
|
-
controller.abort();
|
|
325
|
-
}
|
|
326
|
-
else {
|
|
327
|
-
parentSignal?.addEventListener('abort', abortRepair, { once: true });
|
|
328
|
-
}
|
|
329
|
-
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
330
|
-
timer.unref?.();
|
|
331
|
-
return {
|
|
332
|
-
signal: controller.signal,
|
|
333
|
-
dispose() {
|
|
334
|
-
clearTimeout(timer);
|
|
335
|
-
parentSignal?.removeEventListener('abort', abortRepair);
|
|
336
|
-
controller.abort();
|
|
337
|
-
},
|
|
338
|
-
};
|
|
339
|
-
}
|
|
340
321
|
async function recordGapRepairAssessment(store, task, gap, result) {
|
|
341
322
|
const ingestedSourceIds = result?.ingestedSourceIds ?? [];
|
|
342
323
|
const acceptedSourceIds = uniqueStrings([...(result?.acceptedSourceIds ?? []), ...ingestedSourceIds]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/platform/mcp/client.ts"],"names":[],"mapp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AQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAWjF;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;YA4BnB,aAAa;IAyB3B,wCAAwC;YAC1B,WAAW;IAgBzB,mDAAmD;IACnD,OAAO,CAAC,QAAQ;IAkChB,2DAA2D;IAC3D,OAAO,CAAC,OAAO;IAaf,OAAO,CAAC,cAAc;IAqCtB,OAAO,CAAC,cAAc;IAUtB,OAAO,CAAC,aAAa;IAgCrB,OAAO,CAAC,eAAe;IAqBvB,OAAO,CAAC,mBAAmB;IAa3B,OAAO,CAAC,oBAAoB;IAgB5B,OAAO,CAAC,wBAAwB;IAmBhC,OAAO,CAAC,iBAAiB;IAkBzB,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,gBAAgB;IAoBxB;;;OAGG;IACG,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC;CAS/B"}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
import { logger } from '../utils/logger.js';
|
|
9
9
|
import { VERSION } from '../version.js';
|
|
10
10
|
import { summarizeError } from '../utils/error-display.js';
|
|
11
|
+
import { isRecord } from '../utils/record-coerce.js';
|
|
11
12
|
const DEFAULT_TIMEOUT_MS = 30_000;
|
|
12
13
|
const PING_TIMEOUT_MS = 5_000;
|
|
13
14
|
const RESTART_DELAY_MS = 2_000;
|
|
@@ -18,9 +19,6 @@ function isJsonRpcId(value) {
|
|
|
18
19
|
function jsonRpcIdKey(id) {
|
|
19
20
|
return `${typeof id}:${String(id)}`;
|
|
20
21
|
}
|
|
21
|
-
function isRecord(value) {
|
|
22
|
-
return typeof value === 'object' && value !== null;
|
|
23
|
-
}
|
|
24
22
|
function isJsonRpcResponse(value) {
|
|
25
23
|
return isRecord(value)
|
|
26
24
|
&& 'id' in value
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/platform/mcp/config.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/platform/mcp/config.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAIlE,MAAM,WAAW,eAAe;IAC9B,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,yDAAyD;IACzD,OAAO,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IAC5B,+DAA+D;IAC/D,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;IACzC,sDAAsD;IACtD,IAAI,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,YAAY,GAAG,KAAK,GAAG,UAAU,GAAG,SAAS,GAAG,YAAY,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,CAAC;IACxH,mEAAmE;IACnE,SAAS,CAAC,EAAE,aAAa,GAAG,aAAa,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,CAAC;IAChF,oEAAoE;IACpE,YAAY,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IACpC,qEAAqE;IACrE,YAAY,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;CACrC;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,eAAe,EAAE,CAAC;CAC5B;AAED,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,gBAAgB,EAAE,kBAAkB,GAAG,eAAe,CAAC,CAAC;AAC1F,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,QAAQ,CAAC;AAElD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,KAAK,EAAE,cAAc,GAAG,UAAU,CAAC;IAC5C,QAAQ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@@ import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs';
|
|
|
5
5
|
import { dirname, join } from 'path';
|
|
6
6
|
import { logger } from '../utils/logger.js';
|
|
7
7
|
import { summarizeError } from '../utils/error-display.js';
|
|
8
|
-
|
|
9
|
-
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
10
|
-
}
|
|
8
|
+
import { isRecord } from '../utils/record-coerce.js';
|
|
11
9
|
function optionalStringArray(value) {
|
|
12
10
|
return Array.isArray(value) && value.every((entry) => typeof entry === 'string')
|
|
13
11
|
? [...value]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builtin-generation-providers.d.ts","sourceRoot":"","sources":["../../../src/platform/media/builtin-generation-providers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAIV,aAAa,EAEd,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"builtin-generation-providers.d.ts","sourceRoot":"","sources":["../../../src/platform/media/builtin-generation-providers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAIV,aAAa,EAEd,MAAM,wBAAwB,CAAC;AA4pBhC,wBAAgB,0BAA0B,IAAI,SAAS,aAAa,EAAE,CAQrE"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { instrumentedFetch } from '../utils/fetch-with-timeout.js';
|
|
2
2
|
import { logger } from '../utils/logger.js';
|
|
3
3
|
import { summarizeError } from '../utils/error-display.js';
|
|
4
|
+
import { sleep } from '../utils/concurrency.js';
|
|
4
5
|
function readFirstEnv(envVars) {
|
|
5
6
|
for (const envVar of envVars) {
|
|
6
7
|
const value = process.env[envVar];
|
|
@@ -68,12 +69,6 @@ function buildRemoteArtifactMetadata(providerId, url, input) {
|
|
|
68
69
|
} : {}),
|
|
69
70
|
};
|
|
70
71
|
}
|
|
71
|
-
function sleep(ms) {
|
|
72
|
-
return new Promise((resolve) => {
|
|
73
|
-
const timer = setTimeout(resolve, ms);
|
|
74
|
-
timer.unref?.();
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
72
|
function resolveReferenceArtifact(request) {
|
|
78
73
|
const options = asRecord(request.options);
|
|
79
74
|
const candidate = asRecord(options?.['referenceArtifact']) ?? asRecord(options?.['sourceArtifact']);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic-compat.d.ts","sourceRoot":"","sources":["../../../src/platform/providers/anthropic-compat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,WAAW,EACX,YAAY,EAEZ,uBAAuB,EACvB,2BAA2B,EAC5B,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"anthropic-compat.d.ts","sourceRoot":"","sources":["../../../src/platform/providers/anthropic-compat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,WAAW,EACX,YAAY,EAEZ,uBAAuB,EACvB,2BAA2B,EAC5B,MAAM,gBAAgB,CAAC;AAiBxB,MAAM,WAAW,sBAAsB;IACrC,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,sFAAsF;IACtF,OAAO,EAAE,MAAM,CAAC;IAChB,2CAA2C;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf,4DAA4D;IAC5D,YAAY,EAAE,MAAM,CAAC;IACrB,iDAAiD;IACjD,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,0DAA0D;IAC1D,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;IACpD,gFAAgF;IAChF,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;IAC5C,gFAAgF;IAChF,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;IAC7C,uEAAuE;IACvE,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;IACxC,iGAAiG;IACjG,sBAAsB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5C,+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