@vostride/agent-qa-safety-local 0.0.1 → 0.2.2
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/LICENSE.md +105 -0
- package/NOTICE.md +11 -0
- package/dist/index.cjs +88 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +15 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +59 -0
- package/dist/index.js.map +1 -0
- package/package.json +57 -3
package/LICENSE.md
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Functional Source License, Version 1.1, ALv2 Future License
|
|
2
|
+
|
|
3
|
+
## Abbreviation
|
|
4
|
+
|
|
5
|
+
FSL-1.1-ALv2
|
|
6
|
+
|
|
7
|
+
## Notice
|
|
8
|
+
|
|
9
|
+
Copyright 2026 Pranshu Chittora
|
|
10
|
+
|
|
11
|
+
## Terms and Conditions
|
|
12
|
+
|
|
13
|
+
### Licensor ("We")
|
|
14
|
+
|
|
15
|
+
The party offering the Software under these Terms and Conditions.
|
|
16
|
+
|
|
17
|
+
### The Software
|
|
18
|
+
|
|
19
|
+
The "Software" is each version of the software that we make available under
|
|
20
|
+
these Terms and Conditions, as indicated by our inclusion of these Terms and
|
|
21
|
+
Conditions with the Software.
|
|
22
|
+
|
|
23
|
+
### License Grant
|
|
24
|
+
|
|
25
|
+
Subject to your compliance with this License Grant and the Patents,
|
|
26
|
+
Redistribution and Trademark clauses below, we hereby grant you the right to
|
|
27
|
+
use, copy, modify, create derivative works, publicly perform, publicly display
|
|
28
|
+
and redistribute the Software for any Permitted Purpose identified below.
|
|
29
|
+
|
|
30
|
+
### Permitted Purpose
|
|
31
|
+
|
|
32
|
+
A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
|
|
33
|
+
means making the Software available to others in a commercial product or
|
|
34
|
+
service that:
|
|
35
|
+
|
|
36
|
+
1. substitutes for the Software;
|
|
37
|
+
|
|
38
|
+
2. substitutes for any other product or service we offer using the Software
|
|
39
|
+
that exists as of the date we make the Software available; or
|
|
40
|
+
|
|
41
|
+
3. offers the same or substantially similar functionality as the Software.
|
|
42
|
+
|
|
43
|
+
Permitted Purposes specifically include using the Software:
|
|
44
|
+
|
|
45
|
+
1. for your internal use and access;
|
|
46
|
+
|
|
47
|
+
2. for non-commercial education;
|
|
48
|
+
|
|
49
|
+
3. for non-commercial research; and
|
|
50
|
+
|
|
51
|
+
4. in connection with professional services that you provide to a licensee
|
|
52
|
+
using the Software in accordance with these Terms and Conditions.
|
|
53
|
+
|
|
54
|
+
### Patents
|
|
55
|
+
|
|
56
|
+
To the extent your use for a Permitted Purpose would necessarily infringe our
|
|
57
|
+
patents, the license grant above includes a license under our patents. If you
|
|
58
|
+
make a claim against any party that the Software infringes or contributes to
|
|
59
|
+
the infringement of any patent, then your patent license to the Software ends
|
|
60
|
+
immediately.
|
|
61
|
+
|
|
62
|
+
### Redistribution
|
|
63
|
+
|
|
64
|
+
The Terms and Conditions apply to all copies, modifications and derivatives of
|
|
65
|
+
the Software.
|
|
66
|
+
|
|
67
|
+
If you redistribute any copies, modifications or derivatives of the Software,
|
|
68
|
+
you must include a copy of or a link to these Terms and Conditions and not
|
|
69
|
+
remove any copyright notices provided in or with the Software.
|
|
70
|
+
|
|
71
|
+
### Disclaimer
|
|
72
|
+
|
|
73
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
|
|
74
|
+
IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
|
|
75
|
+
PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
|
|
76
|
+
|
|
77
|
+
IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
|
|
78
|
+
SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
|
|
79
|
+
EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
|
|
80
|
+
|
|
81
|
+
### Trademarks
|
|
82
|
+
|
|
83
|
+
Except for displaying the License Details and identifying us as the origin of
|
|
84
|
+
the Software, you have no right under these Terms and Conditions to use our
|
|
85
|
+
trademarks, trade names, service marks or product names.
|
|
86
|
+
|
|
87
|
+
## Grant of Future License
|
|
88
|
+
|
|
89
|
+
We hereby irrevocably grant you an additional license to use the Software under
|
|
90
|
+
the Apache License, Version 2.0 that is effective on the second anniversary of
|
|
91
|
+
the date we make the Software available. On or after that date, you may use the
|
|
92
|
+
Software under the Apache License, Version 2.0, in which case the following
|
|
93
|
+
will apply:
|
|
94
|
+
|
|
95
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
96
|
+
this file except in compliance with the License.
|
|
97
|
+
|
|
98
|
+
You may obtain a copy of the License at
|
|
99
|
+
|
|
100
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
101
|
+
|
|
102
|
+
Unless required by applicable law or agreed to in writing, software distributed
|
|
103
|
+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
104
|
+
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
105
|
+
specific language governing permissions and limitations under the License.
|
package/NOTICE.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# agent-qa Notice
|
|
2
|
+
|
|
3
|
+
agent-qa is provided by Pranshu Chittora.
|
|
4
|
+
|
|
5
|
+
Copyright 2026 Pranshu Chittora
|
|
6
|
+
|
|
7
|
+
agent-qa is licensed under the Functional Source License, Version 1.1, ALv2 Future License (FSL-1.1-ALv2). See `LICENSE.md` for the full license terms.
|
|
8
|
+
|
|
9
|
+
Under the Grant of Future License in `LICENSE.md`, each version of the Software is also granted under the Apache License, Version 2.0 effective on the second anniversary of the date that version was made available.
|
|
10
|
+
|
|
11
|
+
Third-party dependencies are distributed under their own license terms. This notice covers agent-qa itself and does not replace or modify notices required by third-party dependency owners.
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
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
|
+
|
|
29
|
+
// 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
|
+
|
|
33
|
+
// 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"
|
|
49
|
+
]);
|
|
50
|
+
function isTruthy(value) {
|
|
51
|
+
const normalized = value?.trim().toLowerCase();
|
|
52
|
+
return normalized !== void 0 && normalized !== "" && normalized !== "0" && normalized !== "false";
|
|
53
|
+
}
|
|
54
|
+
function isPresent(value) {
|
|
55
|
+
return value !== void 0 && value.trim() !== "";
|
|
56
|
+
}
|
|
57
|
+
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
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function detectExecutionContext(override) {
|
|
71
|
+
return (0, import_agent_qa_safety.resolveExecutionContext)(readSignals(), override);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// 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());
|
|
79
|
+
function runSafetyScope(bundle, fn) {
|
|
80
|
+
return als.run(bundle, fn);
|
|
81
|
+
}
|
|
82
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
83
|
+
0 && (module.exports = {
|
|
84
|
+
detectExecutionContext,
|
|
85
|
+
fingerprint,
|
|
86
|
+
runSafetyScope
|
|
87
|
+
});
|
|
88
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +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// D-02: exactly ONE AsyncLocalStorage store carries the run-safety bundle, feeding the active\n// execution-context resolver with one nesting-safe, concurrency-safe scope.\nconst als = new AsyncLocalStorage<SafetyScopeBundle>()\n\n// Single install site (Pitfall 9). Reachable from the package barrel so any import of\n// @vostride/agent-qa-safety-local 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;AAWlD,IAAM,MAAM,IAAI,0CAAqC;AAAA,IAIrD,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"]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ExecutionContext } from '@vostride/agent-qa-schema';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* One-way 16-hex fingerprint for redactedFingerprint. NOT detection; pure hashing.
|
|
5
|
+
*/
|
|
6
|
+
declare const fingerprint: (raw: string) => string;
|
|
7
|
+
|
|
8
|
+
declare function detectExecutionContext(override?: ExecutionContext): ExecutionContext;
|
|
9
|
+
|
|
10
|
+
interface SafetyScopeBundle {
|
|
11
|
+
executionContext?: ExecutionContext;
|
|
12
|
+
}
|
|
13
|
+
declare function runSafetyScope<T>(bundle: SafetyScopeBundle, fn: () => T): T;
|
|
14
|
+
|
|
15
|
+
export { type SafetyScopeBundle, detectExecutionContext, fingerprint, runSafetyScope };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ExecutionContext } from '@vostride/agent-qa-schema';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* One-way 16-hex fingerprint for redactedFingerprint. NOT detection; pure hashing.
|
|
5
|
+
*/
|
|
6
|
+
declare const fingerprint: (raw: string) => string;
|
|
7
|
+
|
|
8
|
+
declare function detectExecutionContext(override?: ExecutionContext): ExecutionContext;
|
|
9
|
+
|
|
10
|
+
interface SafetyScopeBundle {
|
|
11
|
+
executionContext?: ExecutionContext;
|
|
12
|
+
}
|
|
13
|
+
declare function runSafetyScope<T>(bundle: SafetyScopeBundle, fn: () => T): T;
|
|
14
|
+
|
|
15
|
+
export { type SafetyScopeBundle, detectExecutionContext, fingerprint, runSafetyScope };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// src/fingerprint.ts
|
|
2
|
+
import { sha256hex16 } from "@vostride/agent-qa-schema";
|
|
3
|
+
var fingerprint = (raw) => sha256hex16(raw);
|
|
4
|
+
|
|
5
|
+
// 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"
|
|
21
|
+
]);
|
|
22
|
+
function isTruthy(value) {
|
|
23
|
+
const normalized = value?.trim().toLowerCase();
|
|
24
|
+
return normalized !== void 0 && normalized !== "" && normalized !== "0" && normalized !== "false";
|
|
25
|
+
}
|
|
26
|
+
function isPresent(value) {
|
|
27
|
+
return value !== void 0 && value.trim() !== "";
|
|
28
|
+
}
|
|
29
|
+
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
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function detectExecutionContext(override) {
|
|
43
|
+
return resolveExecutionContext(readSignals(), override);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// src/safety-scope.ts
|
|
47
|
+
import { AsyncLocalStorage } from "async_hooks";
|
|
48
|
+
import { setActiveExecutionContextResolver } from "@vostride/agent-qa-safety";
|
|
49
|
+
var als = new AsyncLocalStorage();
|
|
50
|
+
setActiveExecutionContextResolver(() => als.getStore()?.executionContext ?? detectExecutionContext());
|
|
51
|
+
function runSafetyScope(bundle, fn) {
|
|
52
|
+
return als.run(bundle, fn);
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
detectExecutionContext,
|
|
56
|
+
fingerprint,
|
|
57
|
+
runSafetyScope
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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// D-02: exactly ONE AsyncLocalStorage store carries the run-safety bundle, feeding the active\n// execution-context resolver with one nesting-safe, concurrency-safe scope.\nconst als = new AsyncLocalStorage<SafetyScopeBundle>()\n\n// Single install site (Pitfall 9). Reachable from the package barrel so any import of\n// @vostride/agent-qa-safety-local 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;AAWlD,IAAM,MAAM,IAAI,kBAAqC;AAIrD,kCAAkC,MAAM,IAAI,SAAS,GAAG,oBAAoB,uBAAuB,CAAC;AAE7F,SAAS,eAAkB,QAA2B,IAAgB;AAC3E,SAAO,IAAI,IAAI,QAAQ,EAAE;AAC3B;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,60 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vostride/agent-qa-safety-local",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.2.2",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "StorageImplementation shell for the local run-safety scope and execution-context detection in agent-qa.",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"agent-qa",
|
|
8
|
+
"testing",
|
|
9
|
+
"agent",
|
|
10
|
+
"ports"
|
|
11
|
+
],
|
|
12
|
+
"license": "FSL-1.1-ALv2",
|
|
13
|
+
"homepage": "https://github.com/vostride/agent-qa#readme",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/vostride/agent-qa/issues"
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/vostride/agent-qa.git",
|
|
20
|
+
"directory": "packages/safety-local"
|
|
21
|
+
},
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">=24"
|
|
24
|
+
},
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public",
|
|
27
|
+
"registry": "https://registry.npmjs.org/"
|
|
28
|
+
},
|
|
29
|
+
"type": "module",
|
|
30
|
+
"exports": {
|
|
31
|
+
".": {
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"import": "./dist/index.js",
|
|
34
|
+
"require": "./dist/index.cjs"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"files": [
|
|
38
|
+
"dist",
|
|
39
|
+
"LICENSE.md",
|
|
40
|
+
"NOTICE.md"
|
|
41
|
+
],
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "tsup",
|
|
44
|
+
"dev": "tsup --watch",
|
|
45
|
+
"test": "vitest run",
|
|
46
|
+
"typecheck": "tsc --noEmit",
|
|
47
|
+
"clean": "rm -rf dist .turbo"
|
|
48
|
+
},
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"@vostride/agent-qa-safety": "0.2.2",
|
|
51
|
+
"@vostride/agent-qa-schema": "0.2.2"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@types/node": "~24.12.2",
|
|
55
|
+
"@vostride/agent-qa-arch": "0.2.2",
|
|
56
|
+
"tsup": "~8.5.1",
|
|
57
|
+
"typescript": "~6.0.3",
|
|
58
|
+
"vitest": "~4.1.5"
|
|
59
|
+
}
|
|
6
60
|
}
|