@vostride/agent-qa-safety-local 0.2.4 → 0.2.5
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/index.cjs +42 -73
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -10
- package/dist/index.d.ts +7 -10
- package/dist/index.js +38 -43
- package/dist/index.js.map +1 -1
- package/package.json +18 -13
package/dist/index.cjs
CHANGED
|
@@ -1,88 +1,57 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/index.ts
|
|
21
|
-
var index_exports = {};
|
|
22
|
-
__export(index_exports, {
|
|
23
|
-
detectExecutionContext: () => detectExecutionContext,
|
|
24
|
-
fingerprint: () => fingerprint,
|
|
25
|
-
runSafetyScope: () => runSafetyScope
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(index_exports);
|
|
28
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let _vostride_agent_qa_schema = require("@vostride/agent-qa-schema");
|
|
3
|
+
let _vostride_agent_qa_safety = require("@vostride/agent-qa-safety");
|
|
4
|
+
let node_async_hooks = require("node:async_hooks");
|
|
29
5
|
// src/fingerprint.ts
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
6
|
+
/**
|
|
7
|
+
* One-way 16-hex fingerprint for redactedFingerprint. NOT detection; pure hashing.
|
|
8
|
+
*/
|
|
9
|
+
const fingerprint = (raw) => (0, _vostride_agent_qa_schema.sha256hex16)(raw);
|
|
33
10
|
// src/execution-context-detector.ts
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"TEAMCITY_VERSION"
|
|
11
|
+
const CI_VENDOR_VARS = /* @__PURE__ */ new Set([
|
|
12
|
+
"GITHUB_ACTIONS",
|
|
13
|
+
"GITLAB_CI",
|
|
14
|
+
"CIRCLECI",
|
|
15
|
+
"BUILDKITE",
|
|
16
|
+
"JENKINS_URL",
|
|
17
|
+
"TRAVIS",
|
|
18
|
+
"APPVEYOR",
|
|
19
|
+
"TF_BUILD",
|
|
20
|
+
"CODEBUILD_BUILD_ID",
|
|
21
|
+
"DRONE",
|
|
22
|
+
"SEMAPHORE",
|
|
23
|
+
"BITBUCKET_BUILD_NUMBER",
|
|
24
|
+
"TEAMCITY_VERSION"
|
|
49
25
|
]);
|
|
50
26
|
function isTruthy(value) {
|
|
51
|
-
|
|
52
|
-
|
|
27
|
+
const normalized = value?.trim().toLowerCase();
|
|
28
|
+
return normalized !== void 0 && normalized !== "" && normalized !== "0" && normalized !== "false";
|
|
53
29
|
}
|
|
54
30
|
function isPresent(value) {
|
|
55
|
-
|
|
31
|
+
return value !== void 0 && value.trim() !== "";
|
|
56
32
|
}
|
|
57
33
|
function readSignals(env = process.env) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
ciMarkers: isTruthy(env.CI) || hasVendorMarker
|
|
68
|
-
};
|
|
34
|
+
let hasVendorMarker = false;
|
|
35
|
+
for (const name of CI_VENDOR_VARS) if (isPresent(env[name])) {
|
|
36
|
+
hasVendorMarker = true;
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
isTty: Boolean(process.stdout?.isTTY) && Boolean(process.stdin?.isTTY),
|
|
41
|
+
ciMarkers: isTruthy(env.CI) || hasVendorMarker
|
|
42
|
+
};
|
|
69
43
|
}
|
|
70
44
|
function detectExecutionContext(override) {
|
|
71
|
-
|
|
45
|
+
return (0, _vostride_agent_qa_safety.resolveExecutionContext)(readSignals(), override);
|
|
72
46
|
}
|
|
73
|
-
|
|
74
47
|
// src/safety-scope.ts
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
var als = new import_node_async_hooks.AsyncLocalStorage();
|
|
78
|
-
(0, import_agent_qa_safety2.setActiveExecutionContextResolver)(() => als.getStore()?.executionContext ?? detectExecutionContext());
|
|
48
|
+
const als = new node_async_hooks.AsyncLocalStorage();
|
|
49
|
+
(0, _vostride_agent_qa_safety.setActiveExecutionContextResolver)(() => als.getStore()?.executionContext ?? detectExecutionContext());
|
|
79
50
|
function runSafetyScope(bundle, fn) {
|
|
80
|
-
|
|
51
|
+
return als.run(bundle, fn);
|
|
81
52
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
runSafetyScope
|
|
87
|
-
});
|
|
53
|
+
exports.detectExecutionContext = detectExecutionContext;
|
|
54
|
+
exports.fingerprint = fingerprint;
|
|
55
|
+
exports.runSafetyScope = runSafetyScope;
|
|
56
|
+
|
|
88
57
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["sha256hex16","resolveExecutionContext","AsyncLocalStorage","setActiveExecutionContextResolver"],"sources":["../src/fingerprint.ts","../src/execution-context-detector.ts","../src/safety-scope.ts"],"sourcesContent":["import { sha256hex16 } from '@vostride/agent-qa-schema'\n\n/**\n * One-way 16-hex fingerprint for redactedFingerprint. NOT detection; pure hashing.\n */\nexport const fingerprint = (raw: string): string => sha256hex16(raw)\n","import { resolveExecutionContext, type ExecutionContextSignals } from '@vostride/agent-qa-safety'\nimport type { ExecutionContext } from '@vostride/agent-qa-schema'\n\nexport const CI_VENDOR_VARS = new Set([\n 'GITHUB_ACTIONS',\n 'GITLAB_CI',\n 'CIRCLECI',\n 'BUILDKITE',\n 'JENKINS_URL',\n 'TRAVIS',\n 'APPVEYOR',\n 'TF_BUILD',\n 'CODEBUILD_BUILD_ID',\n 'DRONE',\n 'SEMAPHORE',\n 'BITBUCKET_BUILD_NUMBER',\n 'TEAMCITY_VERSION',\n] as const)\n\nfunction isTruthy(value?: string): boolean {\n const normalized = value?.trim().toLowerCase()\n return normalized !== undefined && normalized !== '' && normalized !== '0' && normalized !== 'false'\n}\n\nfunction isPresent(value?: string): boolean {\n return value !== undefined && value.trim() !== ''\n}\n\nexport function readSignals(env: NodeJS.ProcessEnv = process.env): ExecutionContextSignals {\n let hasVendorMarker = false\n\n for (const name of CI_VENDOR_VARS) {\n if (isPresent(env[name])) {\n hasVendorMarker = true\n break\n }\n }\n\n return {\n isTty: Boolean(process.stdout?.isTTY) && Boolean(process.stdin?.isTTY),\n ciMarkers: isTruthy(env.CI) || hasVendorMarker,\n }\n}\n\nexport function detectExecutionContext(override?: ExecutionContext): ExecutionContext {\n return resolveExecutionContext(readSignals(), override)\n}\n","import { AsyncLocalStorage } from 'node:async_hooks'\n\nimport { setActiveExecutionContextResolver } from '@vostride/agent-qa-safety'\nimport type { ExecutionContext } from '@vostride/agent-qa-schema'\n\nimport { detectExecutionContext } from './execution-context-detector'\n\nexport interface SafetyScopeBundle {\n executionContext?: ExecutionContext\n}\n\n// One `AsyncLocalStorage` store gives one nesting-safe, concurrency-safe scope.\nconst als = new AsyncLocalStorage<SafetyScopeBundle>()\n\n// The single install site, reached from the barrel so any import wires the scope.\nsetActiveExecutionContextResolver(() => als.getStore()?.executionContext ?? detectExecutionContext())\n\nexport function runSafetyScope<T>(bundle: SafetyScopeBundle, fn: () => T): T {\n return als.run(bundle, fn)\n}\n"],"mappings":";;;;;;;;AAKA,MAAa,eAAe,SAAA,GAAwBA,0BAAAA,YAAAA,CAAY,GAAG;;ACFnE,MAAa,iCAAiB,IAAI,IAAI;CACpC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAU;AAEV,SAAS,SAAS,OAAyB;CACzC,MAAM,aAAa,OAAO,KAAK,CAAC,CAAC,YAAY;CAC7C,OAAO,eAAe,KAAA,KAAa,eAAe,MAAM,eAAe,OAAO,eAAe;AAC/F;AAEA,SAAS,UAAU,OAAyB;CAC1C,OAAO,UAAU,KAAA,KAAa,MAAM,KAAK,MAAM;AACjD;AAEA,SAAgB,YAAY,MAAyB,QAAQ,KAA8B;CACzF,IAAI,kBAAkB;CAEtB,KAAK,MAAM,QAAQ,gBACjB,IAAI,UAAU,IAAI,KAAK,GAAG;EACxB,kBAAkB;EAClB;CACF;CAGF,OAAO;EACL,OAAO,QAAQ,QAAQ,QAAQ,KAAK,KAAK,QAAQ,QAAQ,OAAO,KAAK;EACrE,WAAW,SAAS,IAAI,EAAE,KAAK;CACjC;AACF;AAEA,SAAgB,uBAAuB,UAA+C;CACpF,QAAA,GAAOC,0BAAAA,wBAAAA,CAAwB,YAAY,GAAG,QAAQ;AACxD;;AClCA,MAAM,MAAM,IAAIC,iBAAAA,kBAAqC;CAGrDC,GAAAA,0BAAAA,kCAAAA,OAAwC,IAAI,SAAS,CAAC,EAAE,oBAAoB,uBAAuB,CAAC;AAEpG,SAAgB,eAAkB,QAA2B,IAAgB;CAC3E,OAAO,IAAI,IAAI,QAAQ,EAAE;AAC3B"}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import "@vostride/agent-qa-safety";
|
|
2
|
+
import { ExecutionContext } from "@vostride/agent-qa-schema";
|
|
3
3
|
/**
|
|
4
4
|
* One-way 16-hex fingerprint for redactedFingerprint. NOT detection; pure hashing.
|
|
5
5
|
*/
|
|
6
|
-
declare const fingerprint: (raw: string) => string;
|
|
7
|
-
|
|
8
|
-
declare function detectExecutionContext(override?: ExecutionContext): ExecutionContext;
|
|
9
|
-
|
|
6
|
+
export declare const fingerprint: (raw: string) => string;
|
|
7
|
+
export declare function detectExecutionContext(override?: ExecutionContext): ExecutionContext;
|
|
10
8
|
interface SafetyScopeBundle {
|
|
11
|
-
|
|
9
|
+
executionContext?: ExecutionContext;
|
|
12
10
|
}
|
|
13
|
-
declare function runSafetyScope<T>(bundle: SafetyScopeBundle, fn: () => T): T;
|
|
14
|
-
|
|
15
|
-
export { type SafetyScopeBundle, detectExecutionContext, fingerprint, runSafetyScope };
|
|
11
|
+
export declare function runSafetyScope<T>(bundle: SafetyScopeBundle, fn: () => T): T;
|
|
12
|
+
export type { SafetyScopeBundle };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import { ExecutionContext } from
|
|
2
|
-
|
|
1
|
+
import { ExecutionContext } from "@vostride/agent-qa-schema";
|
|
2
|
+
import "@vostride/agent-qa-safety";
|
|
3
3
|
/**
|
|
4
4
|
* One-way 16-hex fingerprint for redactedFingerprint. NOT detection; pure hashing.
|
|
5
5
|
*/
|
|
6
|
-
declare const fingerprint: (raw: string) => string;
|
|
7
|
-
|
|
8
|
-
declare function detectExecutionContext(override?: ExecutionContext): ExecutionContext;
|
|
9
|
-
|
|
6
|
+
export declare const fingerprint: (raw: string) => string;
|
|
7
|
+
export declare function detectExecutionContext(override?: ExecutionContext): ExecutionContext;
|
|
10
8
|
interface SafetyScopeBundle {
|
|
11
|
-
|
|
9
|
+
executionContext?: ExecutionContext;
|
|
12
10
|
}
|
|
13
|
-
declare function runSafetyScope<T>(bundle: SafetyScopeBundle, fn: () => T): T;
|
|
14
|
-
|
|
15
|
-
export { type SafetyScopeBundle, detectExecutionContext, fingerprint, runSafetyScope };
|
|
11
|
+
export declare function runSafetyScope<T>(bundle: SafetyScopeBundle, fn: () => T): T;
|
|
12
|
+
export type { SafetyScopeBundle };
|
package/dist/index.js
CHANGED
|
@@ -1,59 +1,54 @@
|
|
|
1
|
-
// src/fingerprint.ts
|
|
2
1
|
import { sha256hex16 } from "@vostride/agent-qa-schema";
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { resolveExecutionContext, setActiveExecutionContextResolver } from "@vostride/agent-qa-safety";
|
|
3
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
|
+
// src/fingerprint.ts
|
|
5
|
+
/**
|
|
6
|
+
* One-way 16-hex fingerprint for redactedFingerprint. NOT detection; pure hashing.
|
|
7
|
+
*/
|
|
8
|
+
const fingerprint = (raw) => sha256hex16(raw);
|
|
5
9
|
// src/execution-context-detector.ts
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"TEAMCITY_VERSION"
|
|
10
|
+
const CI_VENDOR_VARS = /* @__PURE__ */ new Set([
|
|
11
|
+
"GITHUB_ACTIONS",
|
|
12
|
+
"GITLAB_CI",
|
|
13
|
+
"CIRCLECI",
|
|
14
|
+
"BUILDKITE",
|
|
15
|
+
"JENKINS_URL",
|
|
16
|
+
"TRAVIS",
|
|
17
|
+
"APPVEYOR",
|
|
18
|
+
"TF_BUILD",
|
|
19
|
+
"CODEBUILD_BUILD_ID",
|
|
20
|
+
"DRONE",
|
|
21
|
+
"SEMAPHORE",
|
|
22
|
+
"BITBUCKET_BUILD_NUMBER",
|
|
23
|
+
"TEAMCITY_VERSION"
|
|
21
24
|
]);
|
|
22
25
|
function isTruthy(value) {
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
const normalized = value?.trim().toLowerCase();
|
|
27
|
+
return normalized !== void 0 && normalized !== "" && normalized !== "0" && normalized !== "false";
|
|
25
28
|
}
|
|
26
29
|
function isPresent(value) {
|
|
27
|
-
|
|
30
|
+
return value !== void 0 && value.trim() !== "";
|
|
28
31
|
}
|
|
29
32
|
function readSignals(env = process.env) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
ciMarkers: isTruthy(env.CI) || hasVendorMarker
|
|
40
|
-
};
|
|
33
|
+
let hasVendorMarker = false;
|
|
34
|
+
for (const name of CI_VENDOR_VARS) if (isPresent(env[name])) {
|
|
35
|
+
hasVendorMarker = true;
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
isTty: Boolean(process.stdout?.isTTY) && Boolean(process.stdin?.isTTY),
|
|
40
|
+
ciMarkers: isTruthy(env.CI) || hasVendorMarker
|
|
41
|
+
};
|
|
41
42
|
}
|
|
42
43
|
function detectExecutionContext(override) {
|
|
43
|
-
|
|
44
|
+
return resolveExecutionContext(readSignals(), override);
|
|
44
45
|
}
|
|
45
|
-
|
|
46
46
|
// src/safety-scope.ts
|
|
47
|
-
|
|
48
|
-
import { setActiveExecutionContextResolver } from "@vostride/agent-qa-safety";
|
|
49
|
-
var als = new AsyncLocalStorage();
|
|
47
|
+
const als = new AsyncLocalStorage();
|
|
50
48
|
setActiveExecutionContextResolver(() => als.getStore()?.executionContext ?? detectExecutionContext());
|
|
51
49
|
function runSafetyScope(bundle, fn) {
|
|
52
|
-
|
|
50
|
+
return als.run(bundle, fn);
|
|
53
51
|
}
|
|
54
|
-
export {
|
|
55
|
-
|
|
56
|
-
fingerprint,
|
|
57
|
-
runSafetyScope
|
|
58
|
-
};
|
|
52
|
+
export { detectExecutionContext, fingerprint, runSafetyScope };
|
|
53
|
+
|
|
59
54
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/fingerprint.ts","../src/execution-context-detector.ts","../src/safety-scope.ts"],"sourcesContent":["import { sha256hex16 } from '@vostride/agent-qa-schema'\n\n/**\n * One-way 16-hex fingerprint for redactedFingerprint. NOT detection; pure hashing.\n */\nexport const fingerprint = (raw: string): string => sha256hex16(raw)\n","import { resolveExecutionContext, type ExecutionContextSignals } from '@vostride/agent-qa-safety'\nimport type { ExecutionContext } from '@vostride/agent-qa-schema'\n\nexport const CI_VENDOR_VARS = new Set([\n 'GITHUB_ACTIONS',\n 'GITLAB_CI',\n 'CIRCLECI',\n 'BUILDKITE',\n 'JENKINS_URL',\n 'TRAVIS',\n 'APPVEYOR',\n 'TF_BUILD',\n 'CODEBUILD_BUILD_ID',\n 'DRONE',\n 'SEMAPHORE',\n 'BITBUCKET_BUILD_NUMBER',\n 'TEAMCITY_VERSION',\n] as const)\n\nfunction isTruthy(value?: string): boolean {\n const normalized = value?.trim().toLowerCase()\n return normalized !== undefined && normalized !== '' && normalized !== '0' && normalized !== 'false'\n}\n\nfunction isPresent(value?: string): boolean {\n return value !== undefined && value.trim() !== ''\n}\n\nexport function readSignals(env: NodeJS.ProcessEnv = process.env): ExecutionContextSignals {\n let hasVendorMarker = false\n\n for (const name of CI_VENDOR_VARS) {\n if (isPresent(env[name])) {\n hasVendorMarker = true\n break\n }\n }\n\n return {\n isTty: Boolean(process.stdout?.isTTY) && Boolean(process.stdin?.isTTY),\n ciMarkers: isTruthy(env.CI) || hasVendorMarker,\n }\n}\n\nexport function detectExecutionContext(override?: ExecutionContext): ExecutionContext {\n return resolveExecutionContext(readSignals(), override)\n}\n","import { AsyncLocalStorage } from 'node:async_hooks'\n\nimport { setActiveExecutionContextResolver } from '@vostride/agent-qa-safety'\nimport type { ExecutionContext } from '@vostride/agent-qa-schema'\n\nimport { detectExecutionContext } from './execution-context-detector'\n\nexport interface SafetyScopeBundle {\n executionContext?: ExecutionContext\n}\n\n// One `AsyncLocalStorage` store gives one nesting-safe, concurrency-safe scope.\nconst als = new AsyncLocalStorage<SafetyScopeBundle>()\n\n// The single install site, reached from the barrel so any import wires the scope.\nsetActiveExecutionContextResolver(() => als.getStore()?.executionContext ?? detectExecutionContext())\n\nexport function runSafetyScope<T>(bundle: SafetyScopeBundle, fn: () => T): T {\n return als.run(bundle, fn)\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/fingerprint.ts","../src/execution-context-detector.ts","../src/safety-scope.ts"],"sourcesContent":["import { sha256hex16 } from '@vostride/agent-qa-schema'\n\n/**\n * One-way 16-hex fingerprint for redactedFingerprint. NOT detection; pure hashing.\n */\nexport const fingerprint = (raw: string): string => sha256hex16(raw)\n","import { resolveExecutionContext, type ExecutionContextSignals } from '@vostride/agent-qa-safety'\nimport type { ExecutionContext } from '@vostride/agent-qa-schema'\n\nexport const CI_VENDOR_VARS = new Set([\n 'GITHUB_ACTIONS',\n 'GITLAB_CI',\n 'CIRCLECI',\n 'BUILDKITE',\n 'JENKINS_URL',\n 'TRAVIS',\n 'APPVEYOR',\n 'TF_BUILD',\n 'CODEBUILD_BUILD_ID',\n 'DRONE',\n 'SEMAPHORE',\n 'BITBUCKET_BUILD_NUMBER',\n 'TEAMCITY_VERSION',\n] as const)\n\nfunction isTruthy(value?: string): boolean {\n const normalized = value?.trim().toLowerCase()\n return normalized !== undefined && normalized !== '' && normalized !== '0' && normalized !== 'false'\n}\n\nfunction isPresent(value?: string): boolean {\n return value !== undefined && value.trim() !== ''\n}\n\nexport function readSignals(env: NodeJS.ProcessEnv = process.env): ExecutionContextSignals {\n let hasVendorMarker = false\n\n for (const name of CI_VENDOR_VARS) {\n if (isPresent(env[name])) {\n hasVendorMarker = true\n break\n }\n }\n\n return {\n isTty: Boolean(process.stdout?.isTTY) && Boolean(process.stdin?.isTTY),\n ciMarkers: isTruthy(env.CI) || hasVendorMarker,\n }\n}\n\nexport function detectExecutionContext(override?: ExecutionContext): ExecutionContext {\n return resolveExecutionContext(readSignals(), override)\n}\n","import { AsyncLocalStorage } from 'node:async_hooks'\n\nimport { setActiveExecutionContextResolver } from '@vostride/agent-qa-safety'\nimport type { ExecutionContext } from '@vostride/agent-qa-schema'\n\nimport { detectExecutionContext } from './execution-context-detector'\n\nexport interface SafetyScopeBundle {\n executionContext?: ExecutionContext\n}\n\n// One `AsyncLocalStorage` store gives one nesting-safe, concurrency-safe scope.\nconst als = new AsyncLocalStorage<SafetyScopeBundle>()\n\n// The single install site, reached from the barrel so any import wires the scope.\nsetActiveExecutionContextResolver(() => als.getStore()?.executionContext ?? detectExecutionContext())\n\nexport function runSafetyScope<T>(bundle: SafetyScopeBundle, fn: () => T): T {\n return als.run(bundle, fn)\n}\n"],"mappings":";;;;;;;AAKA,MAAa,eAAe,QAAwB,YAAY,GAAG;;ACFnE,MAAa,iCAAiB,IAAI,IAAI;CACpC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAU;AAEV,SAAS,SAAS,OAAyB;CACzC,MAAM,aAAa,OAAO,KAAK,CAAC,CAAC,YAAY;CAC7C,OAAO,eAAe,KAAA,KAAa,eAAe,MAAM,eAAe,OAAO,eAAe;AAC/F;AAEA,SAAS,UAAU,OAAyB;CAC1C,OAAO,UAAU,KAAA,KAAa,MAAM,KAAK,MAAM;AACjD;AAEA,SAAgB,YAAY,MAAyB,QAAQ,KAA8B;CACzF,IAAI,kBAAkB;CAEtB,KAAK,MAAM,QAAQ,gBACjB,IAAI,UAAU,IAAI,KAAK,GAAG;EACxB,kBAAkB;EAClB;CACF;CAGF,OAAO;EACL,OAAO,QAAQ,QAAQ,QAAQ,KAAK,KAAK,QAAQ,QAAQ,OAAO,KAAK;EACrE,WAAW,SAAS,IAAI,EAAE,KAAK;CACjC;AACF;AAEA,SAAgB,uBAAuB,UAA+C;CACpF,OAAO,wBAAwB,YAAY,GAAG,QAAQ;AACxD;;AClCA,MAAM,MAAM,IAAI,kBAAqC;AAGrD,wCAAwC,IAAI,SAAS,CAAC,EAAE,oBAAoB,uBAAuB,CAAC;AAEpG,SAAgB,eAAkB,QAA2B,IAAgB;CAC3E,OAAO,IAAI,IAAI,QAAQ,EAAE;AAC3B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vostride/agent-qa-safety-local",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "StorageImplementation shell for the local run-safety scope and execution-context detection in agent-qa.",
|
|
6
6
|
"keywords": [
|
|
@@ -29,9 +29,14 @@
|
|
|
29
29
|
"type": "module",
|
|
30
30
|
"exports": {
|
|
31
31
|
".": {
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
"import": {
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"default": "./dist/index.js"
|
|
35
|
+
},
|
|
36
|
+
"require": {
|
|
37
|
+
"types": "./dist/index.d.cts",
|
|
38
|
+
"default": "./dist/index.cjs"
|
|
39
|
+
}
|
|
35
40
|
}
|
|
36
41
|
},
|
|
37
42
|
"files": [
|
|
@@ -40,21 +45,21 @@
|
|
|
40
45
|
"NOTICE.md"
|
|
41
46
|
],
|
|
42
47
|
"scripts": {
|
|
43
|
-
"build": "
|
|
44
|
-
"dev": "
|
|
48
|
+
"build": "tsdown",
|
|
49
|
+
"dev": "tsdown --watch",
|
|
45
50
|
"test": "vitest run",
|
|
46
51
|
"typecheck": "tsc --noEmit",
|
|
47
52
|
"clean": "rm -rf dist .turbo"
|
|
48
53
|
},
|
|
49
54
|
"dependencies": {
|
|
50
|
-
"@vostride/agent-qa-safety": "0.2.
|
|
51
|
-
"@vostride/agent-qa-schema": "0.2.
|
|
55
|
+
"@vostride/agent-qa-safety": "0.2.5",
|
|
56
|
+
"@vostride/agent-qa-schema": "0.2.5"
|
|
52
57
|
},
|
|
53
58
|
"devDependencies": {
|
|
54
|
-
"@types/node": "~24.
|
|
55
|
-
"@vostride/agent-qa-arch": "0.2.
|
|
56
|
-
"
|
|
57
|
-
"typescript": "~
|
|
58
|
-
"vitest": "~
|
|
59
|
+
"@types/node": "~24.19.2",
|
|
60
|
+
"@vostride/agent-qa-arch": "0.2.5",
|
|
61
|
+
"tsdown": "~0.23.4",
|
|
62
|
+
"typescript": "~7.0.2",
|
|
63
|
+
"vitest": "~5.0.5"
|
|
59
64
|
}
|
|
60
65
|
}
|