@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 CHANGED
@@ -1,88 +1,57 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
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
- var import_agent_qa_schema = require("@vostride/agent-qa-schema");
31
- var fingerprint = (raw) => (0, import_agent_qa_schema.sha256hex16)(raw);
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
- var import_agent_qa_safety = require("@vostride/agent-qa-safety");
35
- var CI_VENDOR_VARS = /* @__PURE__ */ new Set([
36
- "GITHUB_ACTIONS",
37
- "GITLAB_CI",
38
- "CIRCLECI",
39
- "BUILDKITE",
40
- "JENKINS_URL",
41
- "TRAVIS",
42
- "APPVEYOR",
43
- "TF_BUILD",
44
- "CODEBUILD_BUILD_ID",
45
- "DRONE",
46
- "SEMAPHORE",
47
- "BITBUCKET_BUILD_NUMBER",
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
- const normalized = value?.trim().toLowerCase();
52
- return normalized !== void 0 && normalized !== "" && normalized !== "0" && normalized !== "false";
27
+ const normalized = value?.trim().toLowerCase();
28
+ return normalized !== void 0 && normalized !== "" && normalized !== "0" && normalized !== "false";
53
29
  }
54
30
  function isPresent(value) {
55
- return value !== void 0 && value.trim() !== "";
31
+ return value !== void 0 && value.trim() !== "";
56
32
  }
57
33
  function readSignals(env = process.env) {
58
- let hasVendorMarker = false;
59
- for (const name of CI_VENDOR_VARS) {
60
- if (isPresent(env[name])) {
61
- hasVendorMarker = true;
62
- break;
63
- }
64
- }
65
- return {
66
- isTty: Boolean(process.stdout?.isTTY) && Boolean(process.stdin?.isTTY),
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
- return (0, import_agent_qa_safety.resolveExecutionContext)(readSignals(), override);
45
+ return (0, _vostride_agent_qa_safety.resolveExecutionContext)(readSignals(), override);
72
46
  }
73
-
74
47
  // src/safety-scope.ts
75
- var import_node_async_hooks = require("async_hooks");
76
- var import_agent_qa_safety2 = require("@vostride/agent-qa-safety");
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
- return als.run(bundle, fn);
51
+ return als.run(bundle, fn);
81
52
  }
82
- // Annotate the CommonJS export names for ESM import in node:
83
- 0 && (module.exports = {
84
- detectExecutionContext,
85
- fingerprint,
86
- runSafetyScope
87
- });
53
+ exports.detectExecutionContext = detectExecutionContext;
54
+ exports.fingerprint = fingerprint;
55
+ exports.runSafetyScope = runSafetyScope;
56
+
88
57
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/fingerprint.ts","../src/execution-context-detector.ts","../src/safety-scope.ts"],"sourcesContent":["export { fingerprint } from './fingerprint'\nexport { detectExecutionContext } from './execution-context-detector'\nexport { runSafetyScope } from './safety-scope'\nexport type { SafetyScopeBundle } from './safety-scope'\n","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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,6BAA4B;AAKrB,IAAM,cAAc,CAAC,YAAwB,oCAAY,GAAG;;;ACLnE,6BAAsE;AAG/D,IAAM,iBAAiB,oBAAI,IAAI;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAU;AAEV,SAAS,SAAS,OAAyB;AACzC,QAAM,aAAa,OAAO,KAAK,EAAE,YAAY;AAC7C,SAAO,eAAe,UAAa,eAAe,MAAM,eAAe,OAAO,eAAe;AAC/F;AAEA,SAAS,UAAU,OAAyB;AAC1C,SAAO,UAAU,UAAa,MAAM,KAAK,MAAM;AACjD;AAEO,SAAS,YAAY,MAAyB,QAAQ,KAA8B;AACzF,MAAI,kBAAkB;AAEtB,aAAW,QAAQ,gBAAgB;AACjC,QAAI,UAAU,IAAI,IAAI,CAAC,GAAG;AACxB,wBAAkB;AAClB;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AAAA,IACL,OAAO,QAAQ,QAAQ,QAAQ,KAAK,KAAK,QAAQ,QAAQ,OAAO,KAAK;AAAA,IACrE,WAAW,SAAS,IAAI,EAAE,KAAK;AAAA,EACjC;AACF;AAEO,SAAS,uBAAuB,UAA+C;AACpF,aAAO,gDAAwB,YAAY,GAAG,QAAQ;AACxD;;;AC9CA,8BAAkC;AAElC,IAAAA,0BAAkD;AAUlD,IAAM,MAAM,IAAI,0CAAqC;AAAA,IAGrD,2DAAkC,MAAM,IAAI,SAAS,GAAG,oBAAoB,uBAAuB,CAAC;AAE7F,SAAS,eAAkB,QAA2B,IAAgB;AAC3E,SAAO,IAAI,IAAI,QAAQ,EAAE;AAC3B;","names":["import_agent_qa_safety"]}
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 { ExecutionContext } from '@vostride/agent-qa-schema';
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
- executionContext?: ExecutionContext;
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 '@vostride/agent-qa-schema';
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
- executionContext?: ExecutionContext;
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
- var fingerprint = (raw) => sha256hex16(raw);
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
- import { resolveExecutionContext } from "@vostride/agent-qa-safety";
7
- var CI_VENDOR_VARS = /* @__PURE__ */ new Set([
8
- "GITHUB_ACTIONS",
9
- "GITLAB_CI",
10
- "CIRCLECI",
11
- "BUILDKITE",
12
- "JENKINS_URL",
13
- "TRAVIS",
14
- "APPVEYOR",
15
- "TF_BUILD",
16
- "CODEBUILD_BUILD_ID",
17
- "DRONE",
18
- "SEMAPHORE",
19
- "BITBUCKET_BUILD_NUMBER",
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
- const normalized = value?.trim().toLowerCase();
24
- return normalized !== void 0 && normalized !== "" && normalized !== "0" && normalized !== "false";
26
+ const normalized = value?.trim().toLowerCase();
27
+ return normalized !== void 0 && normalized !== "" && normalized !== "0" && normalized !== "false";
25
28
  }
26
29
  function isPresent(value) {
27
- return value !== void 0 && value.trim() !== "";
30
+ return value !== void 0 && value.trim() !== "";
28
31
  }
29
32
  function readSignals(env = process.env) {
30
- let hasVendorMarker = false;
31
- for (const name of CI_VENDOR_VARS) {
32
- if (isPresent(env[name])) {
33
- hasVendorMarker = true;
34
- break;
35
- }
36
- }
37
- return {
38
- isTty: Boolean(process.stdout?.isTTY) && Boolean(process.stdin?.isTTY),
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
- return resolveExecutionContext(readSignals(), override);
44
+ return resolveExecutionContext(readSignals(), override);
44
45
  }
45
-
46
46
  // src/safety-scope.ts
47
- import { AsyncLocalStorage } from "async_hooks";
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
- return als.run(bundle, fn);
50
+ return als.run(bundle, fn);
53
51
  }
54
- export {
55
- detectExecutionContext,
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":";AAAA,SAAS,mBAAmB;AAKrB,IAAM,cAAc,CAAC,QAAwB,YAAY,GAAG;;;ACLnE,SAAS,+BAA6D;AAG/D,IAAM,iBAAiB,oBAAI,IAAI;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAU;AAEV,SAAS,SAAS,OAAyB;AACzC,QAAM,aAAa,OAAO,KAAK,EAAE,YAAY;AAC7C,SAAO,eAAe,UAAa,eAAe,MAAM,eAAe,OAAO,eAAe;AAC/F;AAEA,SAAS,UAAU,OAAyB;AAC1C,SAAO,UAAU,UAAa,MAAM,KAAK,MAAM;AACjD;AAEO,SAAS,YAAY,MAAyB,QAAQ,KAA8B;AACzF,MAAI,kBAAkB;AAEtB,aAAW,QAAQ,gBAAgB;AACjC,QAAI,UAAU,IAAI,IAAI,CAAC,GAAG;AACxB,wBAAkB;AAClB;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AAAA,IACL,OAAO,QAAQ,QAAQ,QAAQ,KAAK,KAAK,QAAQ,QAAQ,OAAO,KAAK;AAAA,IACrE,WAAW,SAAS,IAAI,EAAE,KAAK;AAAA,EACjC;AACF;AAEO,SAAS,uBAAuB,UAA+C;AACpF,SAAO,wBAAwB,YAAY,GAAG,QAAQ;AACxD;;;AC9CA,SAAS,yBAAyB;AAElC,SAAS,yCAAyC;AAUlD,IAAM,MAAM,IAAI,kBAAqC;AAGrD,kCAAkC,MAAM,IAAI,SAAS,GAAG,oBAAoB,uBAAuB,CAAC;AAE7F,SAAS,eAAkB,QAA2B,IAAgB;AAC3E,SAAO,IAAI,IAAI,QAAQ,EAAE;AAC3B;","names":[]}
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.4",
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
- "types": "./dist/index.d.ts",
33
- "import": "./dist/index.js",
34
- "require": "./dist/index.cjs"
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": "tsup",
44
- "dev": "tsup --watch",
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.4",
51
- "@vostride/agent-qa-schema": "0.2.4"
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.12.2",
55
- "@vostride/agent-qa-arch": "0.2.4",
56
- "tsup": "~8.5.1",
57
- "typescript": "~6.0.3",
58
- "vitest": "~4.1.5"
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
  }