veryfront 0.1.1069 → 0.1.1072
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/esm/_dnt.polyfills.d.ts +13 -13
- package/esm/_dnt.polyfills.d.ts.map +1 -1
- package/esm/_dnt.polyfills.js +11 -11
- package/esm/deno.js +2 -2
- package/esm/src/agent/runtime/index.d.ts.map +1 -1
- package/esm/src/agent/runtime/index.js +26 -3
- package/esm/src/agent/runtime/tool-result-continuation.d.ts.map +1 -1
- package/esm/src/agent/runtime/tool-result-continuation.js +10 -2
- package/esm/src/cache/cache-key-builder.d.ts +30 -0
- package/esm/src/cache/cache-key-builder.d.ts.map +1 -1
- package/esm/src/cache/cache-key-builder.js +65 -0
- package/esm/src/cache/keys/builders/render.d.ts +1 -1
- package/esm/src/cache/keys/builders/render.d.ts.map +1 -1
- package/esm/src/cache/keys/builders/render.js +7 -4
- package/esm/src/observability/tracing/otlp-setup.d.ts +2 -0
- package/esm/src/observability/tracing/otlp-setup.d.ts.map +1 -1
- package/esm/src/observability/tracing/otlp-setup.js +7 -1
- package/esm/src/platform/adapters/fs/veryfront/proxy-manager.d.ts +2 -2
- package/esm/src/platform/adapters/fs/veryfront/proxy-manager.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/proxy-manager.js +12 -6
- package/esm/src/registry/project-scoped-registry-manager.d.ts +31 -1
- package/esm/src/registry/project-scoped-registry-manager.d.ts.map +1 -1
- package/esm/src/registry/project-scoped-registry-manager.js +241 -21
- package/esm/src/server/handlers/request/api/project-discovery.d.ts.map +1 -1
- package/esm/src/server/handlers/request/api/project-discovery.js +45 -41
- package/esm/src/tool/registry.d.ts.map +1 -1
- package/esm/src/tool/registry.js +14 -9
- package/esm/src/tool/remote-mcp.d.ts.map +1 -1
- package/esm/src/tool/remote-mcp.js +14 -2
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/esm/src/workflow/executor/step-executor.d.ts.map +1 -1
- package/esm/src/workflow/executor/step-executor.js +24 -4
- package/package.json +5 -5
package/esm/_dnt.polyfills.d.ts
CHANGED
|
@@ -109,6 +109,19 @@ interface ImportMetaPonyfill extends ImportMetaPonyfillCommonjs, ImportMetaPonyf
|
|
|
109
109
|
export declare let import_meta_ponyfill_commonjs: ImportMetaPonyfillCommonjs;
|
|
110
110
|
export declare let import_meta_ponyfill_esmodule: ImportMetaPonyfillEsmodule;
|
|
111
111
|
export declare let import_meta_ponyfill: ImportMetaPonyfill;
|
|
112
|
+
declare global {
|
|
113
|
+
interface PromiseConstructor {
|
|
114
|
+
/**
|
|
115
|
+
* Creates a Promise that can be resolved or rejected using provided functions.
|
|
116
|
+
* @returns An object containing `promise` promise object, `resolve` and `reject` functions.
|
|
117
|
+
*/
|
|
118
|
+
withResolvers<T>(): {
|
|
119
|
+
promise: Promise<T>;
|
|
120
|
+
resolve: (value: T | PromiseLike<T>) => void;
|
|
121
|
+
reject: (reason?: any) => void;
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
}
|
|
112
125
|
declare global {
|
|
113
126
|
interface Object {
|
|
114
127
|
/**
|
|
@@ -169,17 +182,4 @@ declare global {
|
|
|
169
182
|
}
|
|
170
183
|
}
|
|
171
184
|
export {};
|
|
172
|
-
declare global {
|
|
173
|
-
interface PromiseConstructor {
|
|
174
|
-
/**
|
|
175
|
-
* Creates a Promise that can be resolved or rejected using provided functions.
|
|
176
|
-
* @returns An object containing `promise` promise object, `resolve` and `reject` functions.
|
|
177
|
-
*/
|
|
178
|
-
withResolvers<T>(): {
|
|
179
|
-
promise: Promise<T>;
|
|
180
|
-
resolve: (value: T | PromiseLike<T>) => void;
|
|
181
|
-
reject: (reason?: any) => void;
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
185
|
//# sourceMappingURL=_dnt.polyfills.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_dnt.polyfills.d.ts","s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WAQG;QACH,QAAQ,CAAC,CAAC,SAAS,MAAM,EACvB,SAAS,EAAE,CACP,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,UAAU,KAChB,KAAK,IAAI,CAAC,EACf,OAAO,CAAC,EAAE,GAAG,GACZ,CAAC,GAAG,SAAS,CAAC;QACjB,QAAQ,CACJ,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,KAAK,OAAO,EACvE,OAAO,CAAC,EAAE,GAAG,GACd,MAAM,GAAG,SAAS,CAAC;QAEtB;;;;;;;;WAQG;QACH,aAAa,CACT,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,KAAK,OAAO,EACvE,OAAO,CAAC,EAAE,GAAG,GACd,MAAM,CAAC;KACX;CACF;AA4CD,OAAO,EAAE,CAAC"}
|
package/esm/_dnt.polyfills.js
CHANGED
|
@@ -222,6 +222,17 @@ export let import_meta_ponyfill = ((...args) => {
|
|
|
222
222
|
//@ts-ignore
|
|
223
223
|
return import_meta_ponyfill(...args);
|
|
224
224
|
});
|
|
225
|
+
// https://github.com/tc39/proposal-promise-with-resolvers/blob/3a78801e073e99217dbeb2c43ba7212f3bdc8b83/polyfills.js#L1C1-L9C2
|
|
226
|
+
if (Promise.withResolvers === undefined) {
|
|
227
|
+
Promise.withResolvers = () => {
|
|
228
|
+
const out = {};
|
|
229
|
+
out.promise = new Promise((resolve_, reject_) => {
|
|
230
|
+
out.resolve = resolve_;
|
|
231
|
+
out.reject = reject_;
|
|
232
|
+
});
|
|
233
|
+
return out;
|
|
234
|
+
};
|
|
235
|
+
}
|
|
225
236
|
// https://github.com/tc39/proposal-accessible-object-hasownproperty/blob/main/polyfill.js
|
|
226
237
|
if (!Object.hasOwn) {
|
|
227
238
|
Object.defineProperty(Object, "hasOwn", {
|
|
@@ -272,14 +283,3 @@ if (!Uint8Array.prototype.findLast) {
|
|
|
272
283
|
return findLast(this, callbackfn, that);
|
|
273
284
|
};
|
|
274
285
|
}
|
|
275
|
-
// https://github.com/tc39/proposal-promise-with-resolvers/blob/3a78801e073e99217dbeb2c43ba7212f3bdc8b83/polyfills.js#L1C1-L9C2
|
|
276
|
-
if (Promise.withResolvers === undefined) {
|
|
277
|
-
Promise.withResolvers = () => {
|
|
278
|
-
const out = {};
|
|
279
|
-
out.promise = new Promise((resolve_, reject_) => {
|
|
280
|
-
out.resolve = resolve_;
|
|
281
|
-
out.reject = reject_;
|
|
282
|
-
});
|
|
283
|
-
return out;
|
|
284
|
-
};
|
|
285
|
-
}
|
package/esm/deno.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
"name": "veryfront",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1072",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"nodeModulesDir": "auto",
|
|
6
6
|
"minimumDependencyAge": {
|
|
@@ -458,7 +458,7 @@ export default {
|
|
|
458
458
|
"lint:ban-test-only": "deno run --allow-read scripts/lint/ban-test-only.ts",
|
|
459
459
|
"lint:sanitizer-baseline": "deno run --allow-read scripts/lint/check-sanitizer-baseline.ts",
|
|
460
460
|
"lint:skipped-tests": "deno run --allow-read scripts/lint/check-skipped-tests-baseline.ts",
|
|
461
|
-
"test:scripts": "deno test --config=scripts/test.deno.json --no-check --allow-read --allow-write --allow-run scripts/build/dnt-polyfill.test.ts scripts/build/generate-sbom.test.ts scripts/build/npm-dependency-sources.test.ts scripts/build/npm-extension-package-metadata.test.ts scripts/build/npm-package-metadata.test.ts scripts/build/npm-react-shims.test.ts scripts/docs/docs-coverage.test.ts scripts/docs/generate-api-reference.test.ts scripts/docs/guide-validation.test.ts scripts/lint/audit-core-deps.test.ts scripts/lint/audit-dependency-boundaries.test.ts scripts/lint/audit-extension-capabilities.test.ts scripts/lint/audit-extension-contracts.test.ts scripts/lint/audit-deps.test.ts scripts/lint/check-circular-baseline.test.ts scripts/lint/ban-test-only.test.ts scripts/lint/check-sanitizer-baseline.test.ts scripts/lint/check-skipped-tests-baseline.test.ts scripts/lint/check-coverage.test.ts scripts/security/audit-npm.test.ts scripts/security/submit-dependency-snapshot.test.ts",
|
|
461
|
+
"test:scripts": "deno test --config=scripts/test.deno.json --no-check --allow-read --allow-write --allow-run scripts/ci/publish-npm-packages.test.ts scripts/build/dnt-polyfill.test.ts scripts/build/generate-sbom.test.ts scripts/build/npm-dependency-sources.test.ts scripts/build/npm-extension-package-metadata.test.ts scripts/build/npm-package-metadata.test.ts scripts/build/npm-react-shims.test.ts scripts/docs/docs-coverage.test.ts scripts/docs/generate-api-reference.test.ts scripts/docs/guide-validation.test.ts scripts/lint/audit-core-deps.test.ts scripts/lint/audit-dependency-boundaries.test.ts scripts/lint/audit-extension-capabilities.test.ts scripts/lint/audit-extension-contracts.test.ts scripts/lint/audit-deps.test.ts scripts/lint/check-circular-baseline.test.ts scripts/lint/ban-test-only.test.ts scripts/lint/check-sanitizer-baseline.test.ts scripts/lint/check-skipped-tests-baseline.test.ts scripts/lint/check-coverage.test.ts scripts/security/audit-npm.test.ts scripts/security/submit-dependency-snapshot.test.ts",
|
|
462
462
|
"test:cross-runtime": "deno run --allow-all src/platform/compat/cross-runtime.test.ts",
|
|
463
463
|
"test:node": "node ./tests/node/run-tests.mjs 'src/**/*.test.ts'",
|
|
464
464
|
"test:bun": "node ./tests/bun/run-tests.mjs src/",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/runtime/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,aAAa,EAGlB,KAAK,OAAO,EAIZ,KAAK,QAAQ,EAGd,MAAM,aAAa,CAAC;AAIrB,OAAO,EAAqB,KAAK,MAAM,EAAE,MAAM,oBA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AAC,UAAU,CAAC,CAAC;IA0JtC;;OAEG;YACW,gBAAgB;IA8b9B;;;;OAIG;YACW,yBAAyB;IAqiBvC;;OAEG;YACW,eAAe;IAgC7B;;OAEG;YACW,mBAAmB;IAOjC;;OAEG;IACH,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,kBAAkB;IAY1B,OAAO,CAAC,sBAAsB;IAoB9B;;OAEG;IACH,SAAS,IAAI,MAAM,CAAC,OAAO,CAAC;IAI5B;;OAEG;IACG,cAAc,IAAI,OAAO,CAAC;QAC9B,aAAa,EAAE,MAAM,CAAC;QACtB,eAAe,EAAE,MAAM,CAAC;QACxB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IAIF;;OAEG;IACG,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;CAGnC"}
|
|
@@ -16,7 +16,7 @@ import { generateId } from "../../utils/id.js";
|
|
|
16
16
|
import { detectPlatform, getPlatformCapabilities } from "../../platform/core-platform.js";
|
|
17
17
|
import { createAgentMemory } from "../memory/index.js";
|
|
18
18
|
import { serverLogger } from "../../utils/index.js";
|
|
19
|
-
import { addSpanEvent, setActiveSpanAttributes as setOtelActiveSpanAttributes, setSpanAttributes, withSpan, } from "../../observability/tracing/otlp-setup.js";
|
|
19
|
+
import { addSpanEvent, setActiveSpanAttributes as setOtelActiveSpanAttributes, setActiveSpanErrorStatus as setOtelActiveSpanErrorStatus, setSpanAttributes, withSpan, } from "../../observability/tracing/otlp-setup.js";
|
|
20
20
|
import { convertToTextGenerationRuntimeRequestMessages } from "./text-generation-runtime-message-converter.js";
|
|
21
21
|
import { convertToolsToRuntimeTools } from "./model-tool-converter.js";
|
|
22
22
|
import { getRuntimeRemoteToolSources } from "./mcp-server-tool-sources.js";
|
|
@@ -208,6 +208,9 @@ async function traceConfiguredToolExecution(input) {
|
|
|
208
208
|
try {
|
|
209
209
|
const result = await executeConfiguredTool(input.toolName, input.args, input.toolsConfig, input.context, input.allowedRemoteToolNames, input.remoteToolSources);
|
|
210
210
|
const resultError = getToolResultError(result);
|
|
211
|
+
if (resultError !== undefined) {
|
|
212
|
+
setOtelActiveSpanErrorStatus(resultError);
|
|
213
|
+
}
|
|
211
214
|
setOtelActiveSpanAttributes(buildRuntimeToolTraceAttributes({
|
|
212
215
|
mode: input.mode,
|
|
213
216
|
agentId: input.agentId,
|
|
@@ -256,6 +259,9 @@ async function traceProviderExecutedTool(input) {
|
|
|
256
259
|
const status = input.isError === true ? "failed" : "completed";
|
|
257
260
|
const errorMessage = input.isError === true ? stringifyToolError(input.result) : undefined;
|
|
258
261
|
await withSpan("agent.tool_execute", async () => {
|
|
262
|
+
if (errorMessage !== undefined) {
|
|
263
|
+
setOtelActiveSpanErrorStatus(errorMessage);
|
|
264
|
+
}
|
|
259
265
|
setOtelActiveSpanAttributes(buildRuntimeToolTraceAttributes({
|
|
260
266
|
...input,
|
|
261
267
|
status,
|
|
@@ -540,6 +546,7 @@ export class AgentRuntime {
|
|
|
540
546
|
const remoteToolSources = getRuntimeRemoteToolSources(this.config);
|
|
541
547
|
let currentSystemPrompt = systemPrompt;
|
|
542
548
|
let currentRuntimeContext = runtimeContext;
|
|
549
|
+
let agentWriteFinalResponseToolGuardEnabled = false;
|
|
543
550
|
for (let step = 0; step < maxSteps; step++) {
|
|
544
551
|
this.status = "thinking";
|
|
545
552
|
addSpanEvent(loopSpan, "step_start", { step });
|
|
@@ -568,7 +575,10 @@ export class AgentRuntime {
|
|
|
568
575
|
currentSystemPrompt = preparedStep.systemPrompt;
|
|
569
576
|
currentRuntimeContext = preparedStep.runtimeContext;
|
|
570
577
|
const toolContext = preparedStep.toolContext;
|
|
571
|
-
const tools =
|
|
578
|
+
const tools = agentWriteFinalResponseToolGuardEnabled
|
|
579
|
+
? preparedStep.tools.filter((tool) => !shouldHideProjectToolAfterAgentWriteSuccess(tool.name))
|
|
580
|
+
: preparedStep.tools;
|
|
581
|
+
const stepProviderTools = agentWriteFinalResponseToolGuardEnabled ? [] : providerTools;
|
|
572
582
|
const temperature = this.resolveTemperature(temperatureModelString ?? effectiveModel, providerOptions);
|
|
573
583
|
const response = await withSpan("agent.generate_text", async (span) => {
|
|
574
584
|
setSpanAttributes(span, {
|
|
@@ -581,7 +591,7 @@ export class AgentRuntime {
|
|
|
581
591
|
messages: convertToTextGenerationRuntimeRequestMessages(currentMessages),
|
|
582
592
|
tools: convertToolsToRuntimeTools(tools, {
|
|
583
593
|
model: effectiveModel,
|
|
584
|
-
providerTools,
|
|
594
|
+
providerTools: stepProviderTools,
|
|
585
595
|
}),
|
|
586
596
|
experimental_repairToolCall: repairToolCall,
|
|
587
597
|
maxOutputTokens: this.resolveMaxOutputTokens(effectiveModel, maxOutputTokensOverride),
|
|
@@ -714,6 +724,13 @@ export class AgentRuntime {
|
|
|
714
724
|
toolCall.error = generatedToolResult.isError === true
|
|
715
725
|
? stringifyToolError(generatedToolResult.result)
|
|
716
726
|
: undefined;
|
|
727
|
+
if (toolCall.error !== undefined) {
|
|
728
|
+
setOtelActiveSpanErrorStatus(toolCall.error);
|
|
729
|
+
}
|
|
730
|
+
if (generatedToolResult.isError !== true &&
|
|
731
|
+
shouldHideProjectToolAfterAgentWriteSuccess(tc.toolName)) {
|
|
732
|
+
agentWriteFinalResponseToolGuardEnabled = true;
|
|
733
|
+
}
|
|
717
734
|
setSpanAttributes(toolSpan, compactRuntimeTraceAttributes({
|
|
718
735
|
"tool.status": generatedToolResult.isError === true ? "failed" : "completed",
|
|
719
736
|
"tool.provider_executed": generatedToolResult.providerExecuted === true,
|
|
@@ -791,6 +808,9 @@ export class AgentRuntime {
|
|
|
791
808
|
context: executionContext,
|
|
792
809
|
});
|
|
793
810
|
const resultError = getToolResultError(result);
|
|
811
|
+
if (resultError !== undefined) {
|
|
812
|
+
setOtelActiveSpanErrorStatus(resultError);
|
|
813
|
+
}
|
|
794
814
|
toolCall.status = resultError === undefined ? "completed" : "error";
|
|
795
815
|
toolCall.result = result;
|
|
796
816
|
toolCall.error = resultError;
|
|
@@ -806,6 +826,9 @@ export class AgentRuntime {
|
|
|
806
826
|
}),
|
|
807
827
|
}));
|
|
808
828
|
if (resultError === undefined) {
|
|
829
|
+
if (shouldHideProjectToolAfterAgentWriteSuccess(tc.toolName)) {
|
|
830
|
+
agentWriteFinalResponseToolGuardEnabled = true;
|
|
831
|
+
}
|
|
809
832
|
// Track skill policy from successful load_skill results
|
|
810
833
|
if (tc.toolName === LOAD_SKILL_TOOL_ID) {
|
|
811
834
|
activeSkillId = extractSkillId(result);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-result-continuation.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/runtime/tool-result-continuation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"tool-result-continuation.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/runtime/tool-result-continuation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAGlF,OAAO,KAAK,EACV,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,KAAK,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAmBzF,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAoBtE;AAED,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,OAAO,EACf,gBAAgB,UAAQ,GACvB,OAAO,CAeT;AAED,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,GACZ,OAAO,CAcT;AAED,wBAAgB,4BAA4B,CAAC,YAAY,EA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E,WAAW,CAAC,GAC7C;IACD,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAOA;AAED,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,IAAI,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,GAClD,OAAO,CAET;AAED,wBAAgB,gCAAgC,CAC9C,QAAQ,EAAE,IAAI,CAAC,iBAAiB,EAAE,gBAAgB,GAAG,WAAW,CAAC,GAChE,OAAO,CAMT;AAED,MAAM,MAAM,+BAA+B,GACvC;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;CAAE,GACzD;IACA,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B,GACC;IACA,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,sBAAsB,EAAE,MAAM,CAAC;IACxC,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;CAC1C,CAAC;AAEJ,wBAAgB,2BAA2B,CACzC,EAAE,EAAE,iBAAiB,GACpB,+BAA+B,CAoCjC;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,IAAI,cAAc,CAE1E"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { stripLeadingEmptyObjectPlaceholder } from "../streaming/data-stream.js";
|
|
2
|
+
import { hasToolExecutionErrorMarker } from "../../tool/result.js";
|
|
2
3
|
import { parseToolArgs } from "./tool-helpers.js";
|
|
3
4
|
import { stringifyToolError } from "./error-utils.js";
|
|
4
5
|
function getMcpToolErrorMessage(result) {
|
|
@@ -15,14 +16,21 @@ function getMcpToolErrorMessage(result) {
|
|
|
15
16
|
return record.error;
|
|
16
17
|
}
|
|
17
18
|
export function getToolResultError(result) {
|
|
18
|
-
if (!
|
|
19
|
+
if (!hasToolExecutionErrorMarker(result)) {
|
|
19
20
|
return undefined;
|
|
20
21
|
}
|
|
21
22
|
const mcpToolErrorMessage = getMcpToolErrorMessage(result);
|
|
22
23
|
if (mcpToolErrorMessage !== undefined) {
|
|
23
24
|
return mcpToolErrorMessage;
|
|
24
25
|
}
|
|
25
|
-
|
|
26
|
+
const record = result;
|
|
27
|
+
if (typeof record.error === "string") {
|
|
28
|
+
return stringifyToolError(record.error);
|
|
29
|
+
}
|
|
30
|
+
if (typeof record.message === "string" && record.message.trim().length > 0) {
|
|
31
|
+
return record.message;
|
|
32
|
+
}
|
|
33
|
+
return "Tool execution failed";
|
|
26
34
|
}
|
|
27
35
|
export function createToolResultMessage(toolCallId, toolName, result, providerExecuted = false) {
|
|
28
36
|
return {
|
|
@@ -10,10 +10,40 @@ type MultiProjectRequestContextType = {
|
|
|
10
10
|
environmentName?: string | null;
|
|
11
11
|
};
|
|
12
12
|
export type { CacheKeyContext };
|
|
13
|
+
export interface RegistryScopeContext {
|
|
14
|
+
scopeId: string;
|
|
15
|
+
/** Whether completed discovery is safe to retain for this immutable source. */
|
|
16
|
+
immutable: boolean;
|
|
17
|
+
}
|
|
13
18
|
export declare function getContentHashKey(prefix: string, filePath: string, contentHash: string, suffix?: string): string;
|
|
14
19
|
export declare function runWithCacheKeyContext<T>(ctx: CacheKeyContext, fn: () => T): T;
|
|
20
|
+
/**
|
|
21
|
+
* Suppress an inherited explicit cache scope for a callback. This is used when
|
|
22
|
+
* a restored tenant has a mutable source (for example, a production
|
|
23
|
+
* environment without a pinned release) that cannot safely use distributed
|
|
24
|
+
* caching. Ambient request context remains available for in-process registry
|
|
25
|
+
* isolation.
|
|
26
|
+
*/
|
|
27
|
+
export declare function runWithoutCacheKeyContext<T>(fn: () => T): T;
|
|
15
28
|
export declare function getCurrentCacheKeyContext(): CacheKeyContext;
|
|
16
29
|
export declare function tryGetCacheKeyContext(): CacheKeyContext | null;
|
|
30
|
+
/**
|
|
31
|
+
* Returns a stable scope identifier for in-process registry isolation.
|
|
32
|
+
*
|
|
33
|
+
* Unlike tryGetCacheKeyContext(), this function does NOT return null when the
|
|
34
|
+
* request context lacks a field that would be required for a safe distributed
|
|
35
|
+
* cache key (e.g. productionMode=true without a releaseId). For in-process
|
|
36
|
+
* registries (ProjectScopedRegistryManager), project identity and the active
|
|
37
|
+
* content source still provide a safe process-local scope. Collapsing to
|
|
38
|
+
* "__default__" would let concurrent projects overwrite one another's
|
|
39
|
+
* registered skills, tools, and agents.
|
|
40
|
+
*
|
|
41
|
+
* Returns null only when no project identity is available at all (e.g. CLI /
|
|
42
|
+
* local dev without a multi-project context), in which case the caller should
|
|
43
|
+
* fall back to DEFAULT_SCOPE_ID.
|
|
44
|
+
*/
|
|
45
|
+
export declare function tryGetRegistryScopeContext(): RegistryScopeContext | null;
|
|
46
|
+
export declare function tryGetRegistryScopeId(): string | null;
|
|
17
47
|
export declare function getProjectScopedKey(prefix: string, resourceKey: string): string | null;
|
|
18
48
|
export declare function getProjectScopedKeyAlways(prefix: string, resourceKey: string): string | null;
|
|
19
49
|
export declare function extractCacheKeyContext(handlerCtx: HandlerContext): CacheKeyContext | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache-key-builder.d.ts","sourceRoot":"","sources":["../../../src/src/cache/cache-key-builder.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,KAAK,eAAe,EAAyB,MAAM,oBAAoB,CAAC;AAIjF,KAAK,8BAA8B,GAAG;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,O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,yBAAyB,IAAI,eAAe,CAQ3D;AA+CD,wBAAgB,qBAAqB,IAAI,eAAe,GAAG,IAAI,CAQ9D;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,0BAA0B,IAAI,oBAAoB,GAAG,IAAI,CAwCxE;AAED,wBAAgB,qBAAqB,IAAI,MAAM,GAAG,IAAI,CAErD;AAMD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAKtF;AAED,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAK5F;AAED,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,cAAc,GAAG,eAAe,GAAG,IAAI,CAyBzF;AAED,YAAY,EAAE,8BAA8B,IAAI,0BAA0B,EAAE,CAAC"}
|
|
@@ -14,6 +14,16 @@ export function getContentHashKey(prefix, filePath, contentHash, suffix) {
|
|
|
14
14
|
export function runWithCacheKeyContext(ctx, fn) {
|
|
15
15
|
return cacheKeyContextStorage.run(validateCacheKeyContext(ctx), fn);
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Suppress an inherited explicit cache scope for a callback. This is used when
|
|
19
|
+
* a restored tenant has a mutable source (for example, a production
|
|
20
|
+
* environment without a pinned release) that cannot safely use distributed
|
|
21
|
+
* caching. Ambient request context remains available for in-process registry
|
|
22
|
+
* isolation.
|
|
23
|
+
*/
|
|
24
|
+
export function runWithoutCacheKeyContext(fn) {
|
|
25
|
+
return cacheKeyContextStorage.run(null, fn);
|
|
26
|
+
}
|
|
17
27
|
export function getCurrentCacheKeyContext() {
|
|
18
28
|
const ctx = cacheKeyContextStorage.getStore();
|
|
19
29
|
if (ctx)
|
|
@@ -73,6 +83,61 @@ export function tryGetCacheKeyContext() {
|
|
|
73
83
|
return null;
|
|
74
84
|
return extractCacheKeyContextFromMultiProjectContext(reqCtx);
|
|
75
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* Returns a stable scope identifier for in-process registry isolation.
|
|
88
|
+
*
|
|
89
|
+
* Unlike tryGetCacheKeyContext(), this function does NOT return null when the
|
|
90
|
+
* request context lacks a field that would be required for a safe distributed
|
|
91
|
+
* cache key (e.g. productionMode=true without a releaseId). For in-process
|
|
92
|
+
* registries (ProjectScopedRegistryManager), project identity and the active
|
|
93
|
+
* content source still provide a safe process-local scope. Collapsing to
|
|
94
|
+
* "__default__" would let concurrent projects overwrite one another's
|
|
95
|
+
* registered skills, tools, and agents.
|
|
96
|
+
*
|
|
97
|
+
* Returns null only when no project identity is available at all (e.g. CLI /
|
|
98
|
+
* local dev without a multi-project context), in which case the caller should
|
|
99
|
+
* fall back to DEFAULT_SCOPE_ID.
|
|
100
|
+
*/
|
|
101
|
+
export function tryGetRegistryScopeContext() {
|
|
102
|
+
// Explicit contexts are authoritative for workflows and other callers that
|
|
103
|
+
// intentionally override ambient filesystem tenancy.
|
|
104
|
+
const cacheCtx = cacheKeyContextStorage.getStore();
|
|
105
|
+
if (cacheCtx) {
|
|
106
|
+
return {
|
|
107
|
+
scopeId: `${cacheCtx.projectId}:${cacheCtx.mode}:${cacheCtx.versionId}`,
|
|
108
|
+
immutable: cacheCtx.mode === "production",
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
const reqCtx = getRequestContextFn()?.();
|
|
112
|
+
if (reqCtx) {
|
|
113
|
+
const projectId = reqCtx.projectId || reqCtx.projectSlug;
|
|
114
|
+
if (!projectId)
|
|
115
|
+
return null;
|
|
116
|
+
if (reqCtx.productionMode) {
|
|
117
|
+
if (reqCtx.releaseId) {
|
|
118
|
+
return {
|
|
119
|
+
scopeId: `${projectId}:production:${reqCtx.releaseId}`,
|
|
120
|
+
immutable: true,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
// Match ProxyFSAdapterManager's canonical default so registry,
|
|
124
|
+
// discovery, and adapter caches all describe the same content source.
|
|
125
|
+
const environmentName = reqCtx.environmentName || "production";
|
|
126
|
+
return {
|
|
127
|
+
scopeId: `${projectId}:production:environment:${environmentName}`,
|
|
128
|
+
immutable: false,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
return {
|
|
132
|
+
scopeId: `${projectId}:preview:${reqCtx.branch || "main"}`,
|
|
133
|
+
immutable: false,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
export function tryGetRegistryScopeId() {
|
|
139
|
+
return tryGetRegistryScopeContext()?.scopeId ?? null;
|
|
140
|
+
}
|
|
76
141
|
function buildProjectScopedKey(prefix, resourceKey, ctx) {
|
|
77
142
|
return `${prefix}:${ctx.projectId}:${ctx.mode}:${ctx.versionId}:${resourceKey}`;
|
|
78
143
|
}
|
|
@@ -35,7 +35,7 @@ export declare function buildRenderCacheKey(cachePrefix: string, contentKey: str
|
|
|
35
35
|
export declare function buildComponentCacheKey(projectId: string, filePath: string, contentHash: string): string;
|
|
36
36
|
export declare function buildLayoutComponentCacheKey(projectId: string, componentPath: string, hash: string, contentSourceId: string): string;
|
|
37
37
|
export declare function buildErrorPageCacheKey(projectId: string | undefined, projectDir: string, pageType: string): string;
|
|
38
|
-
export declare function buildProxyManagerCacheKey(projectSlug: string, productionMode: boolean, releaseId: string | null, branch: string | null): string;
|
|
38
|
+
export declare function buildProxyManagerCacheKey(projectSlug: string, productionMode: boolean, releaseId: string | null, branch: string | null, environmentName?: string | null): string;
|
|
39
39
|
/**
|
|
40
40
|
* Build a query-aware cache key that is safe for multi-tenant caching.
|
|
41
41
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../../../src/src/cache/keys/builders/render.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAIlF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAI7D,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,SAAS,GAAG,YAAY,EACrC,UAAU,EAAE,MAAM;AAClB;;;;;GAKG;AACH,eAAe,CAAC,EAAE,MAAM,GACvB,MAAM,CAGR;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,SAAS,GAAG,YAAY,EACrC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACjC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GACnC,MAAM,CAaR;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAEnF;AAED,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,GAClB,MAAM,CAER;AAED,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,MAAM,EACZ,eAAe,EAAE,MAAM,GACtB,MAAM,CAER;AAED,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GACf,MAAM,CAER;AAED,wBAAgB,yBAAyB,CACvC,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,OAAO,EACvB,SAAS,EAAE,MAAM,GAAG,IAAI,EACxB,MAAM,EAAE,MAAM,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../../../src/src/cache/keys/builders/render.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAIlF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAI7D,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,SAAS,GAAG,YAAY,EACrC,UAAU,EAAE,MAAM;AAClB;;;;;GAKG;AACH,eAAe,CAAC,EAAE,MAAM,GACvB,MAAM,CAGR;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,SAAS,GAAG,YAAY,EACrC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACjC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GACnC,MAAM,CAaR;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAEnF;AAED,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,GAClB,MAAM,CAER;AAED,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,MAAM,EACZ,eAAe,EAAE,MAAM,GACtB,MAAM,CAER;AAED,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GACf,MAAM,CAER;AAED,wBAAgB,yBAAyB,CACvC,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,OAAO,EACvB,SAAS,EAAE,MAAM,GAAG,IAAI,EACxB,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,GAC9B,MAAM,CAgBR;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,EACZ,GAAG,CAAC,EAAE,GAAG,EACT,OAAO,CAAC,EAAE,sBAAsB,GAC/B,MAAM,CAMR"}
|
|
@@ -61,15 +61,18 @@ export function buildLayoutComponentCacheKey(projectId, componentPath, hash, con
|
|
|
61
61
|
export function buildErrorPageCacheKey(projectId, projectDir, pageType) {
|
|
62
62
|
return `${CacheKeyPrefix.ERROR_PAGE}:${projectId ?? projectDir}:${pageType}`;
|
|
63
63
|
}
|
|
64
|
-
export function buildProxyManagerCacheKey(projectSlug, productionMode, releaseId, branch) {
|
|
64
|
+
export function buildProxyManagerCacheKey(projectSlug, productionMode, releaseId, branch, environmentName) {
|
|
65
65
|
const mode = productionMode ? "production" : "preview";
|
|
66
66
|
if (productionMode) {
|
|
67
|
-
if (
|
|
67
|
+
if (releaseId) {
|
|
68
|
+
return `${CacheKeyPrefix.PROXY}:${projectSlug}:${mode}:${releaseId}`;
|
|
69
|
+
}
|
|
70
|
+
if (!environmentName) {
|
|
68
71
|
throw CACHE_INVARIANT_VIOLATION.create({
|
|
69
|
-
detail: `Missing releaseId in production for ${projectSlug}`,
|
|
72
|
+
detail: `Missing releaseId or environmentName in production for ${projectSlug}`,
|
|
70
73
|
});
|
|
71
74
|
}
|
|
72
|
-
return `${CacheKeyPrefix.PROXY}:${projectSlug}:${mode}:${
|
|
75
|
+
return `${CacheKeyPrefix.PROXY}:${projectSlug}:${mode}:environment:${environmentName}`;
|
|
73
76
|
}
|
|
74
77
|
return `${CacheKeyPrefix.PROXY}:${projectSlug}:${mode}:${branch ?? "main"}`;
|
|
75
78
|
}
|
|
@@ -52,6 +52,8 @@ export declare function setSpanAttributes(span: unknown, attributes: Record<stri
|
|
|
52
52
|
export declare function addSpanEvent(span: unknown, name: string, attributes?: Record<string, AttributeValue>): void;
|
|
53
53
|
/** Sets active span attributes. */
|
|
54
54
|
export declare function setActiveSpanAttributes(attributes: Record<string, AttributeValue>): void;
|
|
55
|
+
/** Marks the active span as failed. */
|
|
56
|
+
export declare function setActiveSpanErrorStatus(error: unknown): void;
|
|
55
57
|
/** Context for with. */
|
|
56
58
|
export declare function withContext<T>(spanContext: unknown, fn: () => Promise<T>): Promise<T>;
|
|
57
59
|
/** Context for get trace. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otlp-setup.d.ts","sourceRoot":"","sources":["../../../../src/src/observability/tracing/otlp-setup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;4BAY4B;AAC5B,OAAO,4BAA4B,CAAC;AAKpC,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,OAAO,EAOZ,KAAK,IAAI,EACT,QAAQ,EAIT,MAAM,eAAe,CAAC;AAKvB,wCAAwC;AACxC,MAAM,WAAW,UAAU;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,OAAO,EAAE,OAAO,CAAC;CAClB;AA6DD,sCAAsC;AACtC,wBAAsB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CASpD;AAED,qCAAqC;AACrC,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAGlD;AAED,4CAA4C;AAC5C,wBAAgB,aAAa,IAAI,OAAO,CAEvC;AAED,0DAA0D;AAC1D,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC,CAE5D;AAcD,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,CAAC,EAAE,QAAQ,CAAC;CACjB,CAAC;AAEF,oBAAoB;AACpB,wBAAsB,QAAQ,CAAC,CAAC,EAC9B,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,EAC9B,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,EAC3C,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"otlp-setup.d.ts","sourceRoot":"","sources":["../../../../src/src/observability/tracing/otlp-setup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;4BAY4B;AAC5B,OAAO,4BAA4B,CAAC;AAKpC,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,OAAO,EAOZ,KAAK,IAAI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AG,IAAI,CAIpD;AAED,0BAA0B;AAC1B,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,aAAa,CAAC,EAAE,OAAO,GACtB;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CASzC;AAED,yCAAyC;AACzC,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,CAoBpF;AAED,4BAA4B;AAC5B,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,OAAO,EACb,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,GACzC,IAAI,CAKN;AAED,+BAA+B;AAC/B,wBAAgB,YAAY,CAC1B,IAAI,EAAE,OAAO,EACb,IAAI,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,GAC1C,IAAI,CAKN;AAED,mCAAmC;AACnC,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,GACzC,IAAI,CAKN;AAED,uCAAuC;AACvC,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAK7D;AAED,wBAAwB;AACxB,wBAAsB,WAAW,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAE3F;AAED,6BAA6B;AAC7B,wBAAgB,eAAe,IAAI;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAMvE"}
|
|
@@ -106,7 +106,6 @@ export async function withSpan(name, fn, attributes, options) {
|
|
|
106
106
|
const spanContext = shimTrace.setSpan(parentContext, span);
|
|
107
107
|
try {
|
|
108
108
|
const result = await shimContext.with(spanContext, () => fn(span));
|
|
109
|
-
span.setStatus({ code: SpanStatusCode.OK });
|
|
110
109
|
return result;
|
|
111
110
|
}
|
|
112
111
|
catch (error) {
|
|
@@ -200,6 +199,13 @@ export function setActiveSpanAttributes(attributes) {
|
|
|
200
199
|
for (const [key, value] of Object.entries(attributes))
|
|
201
200
|
span.setAttribute(key, value);
|
|
202
201
|
}
|
|
202
|
+
/** Marks the active span as failed. */
|
|
203
|
+
export function setActiveSpanErrorStatus(error) {
|
|
204
|
+
const span = shimTrace.getActiveSpan?.();
|
|
205
|
+
if (!span)
|
|
206
|
+
return;
|
|
207
|
+
setSpanErrorStatus(span, error);
|
|
208
|
+
}
|
|
203
209
|
/** Context for with. */
|
|
204
210
|
export async function withContext(spanContext, fn) {
|
|
205
211
|
return shimContext.with(spanContext, fn);
|
|
@@ -22,8 +22,8 @@ export declare class ProxyFSAdapterManager {
|
|
|
22
22
|
private createAdapter;
|
|
23
23
|
private evictLeastRecentlyUsed;
|
|
24
24
|
private cleanupIdleAdapters;
|
|
25
|
-
hasAdapter(projectSlug: string, productionMode?: boolean, releaseId?: string | null, branch?: string | null): boolean;
|
|
26
|
-
evictAdapter(projectSlug: string, productionMode?: boolean, releaseId?: string | null, branch?: string | null): void;
|
|
25
|
+
hasAdapter(projectSlug: string, productionMode?: boolean, releaseId?: string | null, branch?: string | null, environmentName?: string | null): boolean;
|
|
26
|
+
evictAdapter(projectSlug: string, productionMode?: boolean, releaseId?: string | null, branch?: string | null, environmentName?: string | null): void;
|
|
27
27
|
getStats(): {
|
|
28
28
|
adapters: number;
|
|
29
29
|
stats: Record<string, CacheStats>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy-manager.d.ts","sourceRoot":"","sources":["../../../../../../src/src/platform/adapters/fs/veryfront/proxy-manager.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAA0B,MAAM,YAAY,CAAC;AAetF,UAAU,2BAA2B;IACnC,UAAU,EAAE,eAAe,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAoCD,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACjC,cAAc,UAAQ,GACrB,MAAM,GAAG,IAAI,CAgBf;AAED,qBAAa,qBAAqB;IAChC,OAAO,CAAC,QAAQ,CAAqC;IACrD,OAAO,CAAC,eAAe,CAAkD;IACzE,OAAO,CAAC,oBAAoB,CAAyC;IACrE,OAAO,CAAC,UAAU,CAAkB;IACpC,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,YAAY,CAAC,CAAiC;gBAE1C,MAAM,EAAE,2BAA2B;IAkBzC,UAAU,CACd,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,SAAS,CAAC,EAAE,MAAM,EAClB,cAAc,CAAC,EAAE,OAAO,EACxB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,EACzB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,EAC/B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GACrB,OAAO,CAAC,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"proxy-manager.d.ts","sourceRoot":"","sources":["../../../../../../src/src/platform/adapters/fs/veryfront/proxy-manager.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAA0B,MAAM,YAAY,CAAC;AAetF,UAAU,2BAA2B;IACnC,UAAU,EAAE,eAAe,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,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,GAAG,IAAI,EACzB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,EACtB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,GAC9B,IAAI;IAuBP,QAAQ,IAAI;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;KAAE;IAUnE,OAAO,IAAI,IAAI;CAoBhB"}
|
|
@@ -104,7 +104,7 @@ export class ProxyFSAdapterManager {
|
|
|
104
104
|
detail: `[ProxyFSAdapterManager] Invalid getAdapter parameters: ${detailMessage}`,
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
|
-
const cacheKey = buildProxyManagerCacheKey(projectSlug, effectiveProductionMode, effectiveReleaseId, effectiveBranch);
|
|
107
|
+
const cacheKey = buildProxyManagerCacheKey(projectSlug, effectiveProductionMode, effectiveReleaseId, effectiveBranch, effectiveEnvironmentName);
|
|
108
108
|
logger.debug("getAdapter called", {
|
|
109
109
|
projectSlug,
|
|
110
110
|
productionMode: effectiveProductionMode,
|
|
@@ -250,7 +250,7 @@ export class ProxyFSAdapterManager {
|
|
|
250
250
|
},
|
|
251
251
|
invalidationCallbacks: createDefaultInvalidationCallbacks({
|
|
252
252
|
...this.baseConfig.invalidationCallbacks,
|
|
253
|
-
evictCurrentAdapter: () => this.evictAdapter(projectSlug, productionMode, releaseId, branch),
|
|
253
|
+
evictCurrentAdapter: () => this.evictAdapter(projectSlug, productionMode, releaseId, branch, environmentName),
|
|
254
254
|
}),
|
|
255
255
|
};
|
|
256
256
|
const adapter = new VeryfrontFSAdapter(config);
|
|
@@ -374,12 +374,18 @@ export class ProxyFSAdapterManager {
|
|
|
374
374
|
this.adapters.delete(cacheKey);
|
|
375
375
|
}
|
|
376
376
|
}
|
|
377
|
-
hasAdapter(projectSlug, productionMode, releaseId, branch) {
|
|
378
|
-
const
|
|
377
|
+
hasAdapter(projectSlug, productionMode, releaseId, branch, environmentName) {
|
|
378
|
+
const effectiveProductionMode = productionMode ?? false;
|
|
379
|
+
const effectiveEnvironmentName = environmentName ??
|
|
380
|
+
(effectiveProductionMode ? "production" : null);
|
|
381
|
+
const cacheKey = buildProxyManagerCacheKey(projectSlug, effectiveProductionMode, releaseId ?? null, branch ?? null, effectiveEnvironmentName);
|
|
379
382
|
return this.adapters.has(cacheKey);
|
|
380
383
|
}
|
|
381
|
-
evictAdapter(projectSlug, productionMode, releaseId, branch) {
|
|
382
|
-
const
|
|
384
|
+
evictAdapter(projectSlug, productionMode, releaseId, branch, environmentName) {
|
|
385
|
+
const effectiveProductionMode = productionMode ?? false;
|
|
386
|
+
const effectiveEnvironmentName = environmentName ??
|
|
387
|
+
(effectiveProductionMode ? "production" : null);
|
|
388
|
+
const cacheKey = buildProxyManagerCacheKey(projectSlug, effectiveProductionMode, releaseId ?? null, branch ?? null, effectiveEnvironmentName);
|
|
383
389
|
const adapter = this.adapters.get(cacheKey);
|
|
384
390
|
if (!adapter) {
|
|
385
391
|
logger.debug("No adapter to evict", { cacheKey });
|
|
@@ -22,6 +22,25 @@
|
|
|
22
22
|
*
|
|
23
23
|
* @module
|
|
24
24
|
*/
|
|
25
|
+
interface ProjectScopedRegistryManagerOptions<T> {
|
|
26
|
+
/** Must be side-effect free; transaction preparation may invoke it again. */
|
|
27
|
+
validateRegistration?(id: string, existing: T, incoming: T): void;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Stage project-scoped registry mutations and publish them as one synchronous
|
|
31
|
+
* commit after the callback succeeds. Reads inside the callback see staged
|
|
32
|
+
* state; concurrent requests keep seeing the previous live state.
|
|
33
|
+
* Transactions for the same scope are serialized. Live writes made outside
|
|
34
|
+
* the transaction while discovery is in flight are journaled alongside staged
|
|
35
|
+
* mutations and replayed in call order, preserving the previous immediate-
|
|
36
|
+
* mutation semantics without exposing a partially discovered generation.
|
|
37
|
+
* Use this for complete discovery generations, not incremental updates.
|
|
38
|
+
*
|
|
39
|
+
* Nested calls participate in the existing transaction. If a nested tenant
|
|
40
|
+
* context changes the registry scope, the first registry access throws rather
|
|
41
|
+
* than committing data into the wrong tenant.
|
|
42
|
+
*/
|
|
43
|
+
export declare function runWithRegistryTransaction<T>(fn: () => Promise<T>): Promise<T>;
|
|
25
44
|
/**
|
|
26
45
|
* Base class for project-scoped registries.
|
|
27
46
|
* Provides isolation between projects while allowing
|
|
@@ -29,14 +48,24 @@
|
|
|
29
48
|
*/
|
|
30
49
|
export declare class ProjectScopedRegistryManager<T> {
|
|
31
50
|
private registryName;
|
|
51
|
+
private options;
|
|
32
52
|
private registriesByScope;
|
|
33
53
|
private sharedRegistry;
|
|
34
|
-
|
|
54
|
+
private activeStagesByScope;
|
|
55
|
+
constructor(registryName: string, options?: ProjectScopedRegistryManagerOptions<T>);
|
|
56
|
+
private validateRegistration;
|
|
57
|
+
private applyMutation;
|
|
35
58
|
/**
|
|
36
59
|
* Get the current project ID from AsyncLocalStorage context.
|
|
37
60
|
* Falls back to default for CLI/test scenarios.
|
|
38
61
|
*/
|
|
39
62
|
private getCurrentScopeId;
|
|
63
|
+
/** Return the transaction-local stage for this manager and scope. */
|
|
64
|
+
private getTransactionStage;
|
|
65
|
+
/** Record a live mutation in any in-flight transaction for this scope. */
|
|
66
|
+
private recordLiveMutation;
|
|
67
|
+
/** Read the active registry, routing transaction access to its staged copy. */
|
|
68
|
+
private getActiveScopeRegistry;
|
|
40
69
|
/**
|
|
41
70
|
* Get or create registry for a specific project.
|
|
42
71
|
*/
|
|
@@ -100,4 +129,5 @@ export declare class ProjectScopedRegistryManager<T> {
|
|
|
100
129
|
currentProjectItems: number;
|
|
101
130
|
};
|
|
102
131
|
}
|
|
132
|
+
export {};
|
|
103
133
|
//# sourceMappingURL=project-scoped-registry-manager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-scoped-registry-manager.d.ts","sourceRoot":"","sources":["../../../src/src/registry/project-scoped-registry-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;
|
|
1
|
+
{"version":3,"file":"project-scoped-registry-manager.d.ts","sourceRoot":"","sources":["../../../src/src/registry/project-scoped-registry-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AA4BH,UAAU,mCAAmC,CAAC,CAAC;IAC7C,6EAA6E;IAC7E,oBAAoB,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,CAAC;CACnE;AAsCD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,0BAA0B,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAyCpF;AAED;;;;GAIG;AACH,qBAAa,4BAA4B,CAAC,CAAC;IAMvC,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,OAAO;IANjB,OAAO,CAAC,iBAAiB,CAAqC;IAC9D,OAAO,CAAC,cAAc,CAAwB;IAC9C,OAAO,CAAC,mBAAmB,CAA8D;gBAG/E,YAAY,EAAE,MAAM,EACpB,OAAO,GAAE,mCAAmC,CAAC,CAAC,CAAM;IAG9D,OAAO,CAAC,oBAAoB;IAS5B,OAAO,CAAC,aAAa;IAqBrB;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAIzB,qEAAqE;IACrE,OAAO,CAAC,mBAAmB;IA0E3B,0EAA0E;IAC1E,OAAO,CAAC,kBAAkB;IAM1B,+EAA+E;IAC/E,OAAO,CAAC,sBAAsB;IAI9B;;OAEG;IACH,OAAO,CAAC,gBAAgB;IASxB;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI;IAoBnC;;;OAGG;IACH,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI;IAYzC;;;OAGG;IACH,GAAG,CAAC,EAAE,EAAE,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