@vostride/agent-qa-safety-local 0.2.3 → 0.2.4

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.
@@ -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// 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"]}
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"]}
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// 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":[]}
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":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vostride/agent-qa-safety-local",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
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": [
@@ -47,12 +47,12 @@
47
47
  "clean": "rm -rf dist .turbo"
48
48
  },
49
49
  "dependencies": {
50
- "@vostride/agent-qa-safety": "0.2.3",
51
- "@vostride/agent-qa-schema": "0.2.3"
50
+ "@vostride/agent-qa-safety": "0.2.4",
51
+ "@vostride/agent-qa-schema": "0.2.4"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@types/node": "~24.12.2",
55
- "@vostride/agent-qa-arch": "0.2.3",
55
+ "@vostride/agent-qa-arch": "0.2.4",
56
56
  "tsup": "~8.5.1",
57
57
  "typescript": "~6.0.3",
58
58
  "vitest": "~4.1.5"