@astrasyncai/verification-gateway 3.11.0 → 3.11.1
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/adapter-interface/interface.d.mts +1 -1
- package/dist/adapter-interface/interface.d.ts +1 -1
- package/dist/adapters/express.js +1 -1
- package/dist/adapters/express.js.map +1 -1
- package/dist/adapters/express.mjs +1 -1
- package/dist/adapters/express.mjs.map +1 -1
- package/dist/adapters/mcp.js +1 -1
- package/dist/adapters/mcp.js.map +1 -1
- package/dist/adapters/mcp.mjs +1 -1
- package/dist/adapters/mcp.mjs.map +1 -1
- package/dist/adapters/nextjs.js +1 -1
- package/dist/adapters/nextjs.js.map +1 -1
- package/dist/adapters/nextjs.mjs +1 -1
- package/dist/adapters/nextjs.mjs.map +1 -1
- package/dist/adapters/sdk.js +1 -1
- package/dist/adapters/sdk.js.map +1 -1
- package/dist/adapters/sdk.mjs +1 -1
- package/dist/adapters/sdk.mjs.map +1 -1
- package/dist/bin/astrasync-claude-hook.js +63 -19
- package/dist/bin/astrasync-codex-hook.js +63 -19
- package/dist/bin/astrasync-guard.js +63 -19
- package/dist/bin/astrasync.js +63 -19
- package/dist/browser/background.js +63 -19
- package/dist/browser/background.js.map +1 -1
- package/dist/browser/background.mjs +63 -19
- package/dist/browser/background.mjs.map +1 -1
- package/dist/browser/browser-adapter.d.mts +1 -1
- package/dist/browser/browser-adapter.d.ts +1 -1
- package/dist/claude-code/claude-code-adapter.d.mts +1 -1
- package/dist/claude-code/claude-code-adapter.d.ts +1 -1
- package/dist/cli/index.d.mts +1 -1
- package/dist/cli/index.d.ts +1 -1
- package/dist/codex/index.d.mts +1 -1
- package/dist/codex/index.d.ts +1 -1
- package/dist/codex/index.js +63 -19
- package/dist/codex/index.js.map +1 -1
- package/dist/codex/index.mjs +63 -19
- package/dist/codex/index.mjs.map +1 -1
- package/dist/cursor/cursor-adapter.d.mts +1 -1
- package/dist/cursor/cursor-adapter.d.ts +1 -1
- package/dist/cursor/extension.d.mts +1 -1
- package/dist/cursor/extension.d.ts +1 -1
- package/dist/cursor/extension.js +63 -19
- package/dist/cursor/extension.js.map +1 -1
- package/dist/cursor/extension.mjs +63 -19
- package/dist/cursor/extension.mjs.map +1 -1
- package/dist/gateway/gateway.d.mts +1 -1
- package/dist/gateway/gateway.d.ts +1 -1
- package/dist/gateway/gateway.js +63 -19
- package/dist/gateway/gateway.js.map +1 -1
- package/dist/gateway/gateway.mjs +63 -19
- package/dist/gateway/gateway.mjs.map +1 -1
- package/dist/git-trigger/git-hooks.d.mts +1 -1
- package/dist/git-trigger/git-hooks.d.ts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/local-evaluator/evaluator.d.mts +10 -1
- package/dist/local-evaluator/evaluator.d.ts +10 -1
- package/dist/local-evaluator/evaluator.js +20 -9
- package/dist/local-evaluator/evaluator.js.map +1 -1
- package/dist/local-evaluator/evaluator.mjs +20 -9
- package/dist/local-evaluator/evaluator.mjs.map +1 -1
- package/dist/{types-C23_uaY8.d.ts → types-DhFPiZ3t.d.ts} +6 -1
- package/dist/{types-BV6abBnF.d.mts → types-cQVCMeNV.d.mts} +6 -1
- package/dist/verify.js +1 -1
- package/dist/verify.js.map +1 -1
- package/dist/verify.mjs +1 -1
- package/dist/verify.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PlatformAdapter, AdapterConfig } from '../adapter-interface/interface.mjs';
|
|
2
|
-
import { P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-
|
|
2
|
+
import { P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-cQVCMeNV.mjs';
|
|
3
3
|
import '../gateway/gateway.mjs';
|
|
4
4
|
import '../types-sy3tq8lp.mjs';
|
|
5
5
|
import '../metadata-capture.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PlatformAdapter, AdapterConfig } from '../adapter-interface/interface.js';
|
|
2
|
-
import { P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-
|
|
2
|
+
import { P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-DhFPiZ3t.js';
|
|
3
3
|
import '../gateway/gateway.js';
|
|
4
4
|
import '../types-9tns4wyl.js';
|
|
5
5
|
import '../metadata-capture.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PlatformAdapter, AdapterConfig } from '../adapter-interface/interface.mjs';
|
|
2
|
-
import { A as AgentAction, I as InterceptResult, P as PDLSSContext, V as VerificationDecision } from '../types-
|
|
2
|
+
import { A as AgentAction, I as InterceptResult, P as PDLSSContext, V as VerificationDecision } from '../types-cQVCMeNV.mjs';
|
|
3
3
|
import '../gateway/gateway.mjs';
|
|
4
4
|
import '../types-sy3tq8lp.mjs';
|
|
5
5
|
import '../metadata-capture.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PlatformAdapter, AdapterConfig } from '../adapter-interface/interface.js';
|
|
2
|
-
import { A as AgentAction, I as InterceptResult, P as PDLSSContext, V as VerificationDecision } from '../types-
|
|
2
|
+
import { A as AgentAction, I as InterceptResult, P as PDLSSContext, V as VerificationDecision } from '../types-DhFPiZ3t.js';
|
|
3
3
|
import '../gateway/gateway.js';
|
|
4
4
|
import '../types-9tns4wyl.js';
|
|
5
5
|
import '../metadata-capture.js';
|
package/dist/cli/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as LocalPurposeRule, d as LocalScope, c as LocalRiskThresholds, L as LocalPolicy, P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-
|
|
1
|
+
import { b as LocalPurposeRule, d as LocalScope, c as LocalRiskThresholds, L as LocalPolicy, P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-cQVCMeNV.mjs';
|
|
2
2
|
import { PlatformAdapter, AdapterConfig } from '../adapter-interface/interface.mjs';
|
|
3
3
|
import '../types-sy3tq8lp.mjs';
|
|
4
4
|
import '../metadata-capture.mjs';
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as LocalPurposeRule, d as LocalScope, c as LocalRiskThresholds, L as LocalPolicy, P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-
|
|
1
|
+
import { b as LocalPurposeRule, d as LocalScope, c as LocalRiskThresholds, L as LocalPolicy, P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-DhFPiZ3t.js';
|
|
2
2
|
import { PlatformAdapter, AdapterConfig } from '../adapter-interface/interface.js';
|
|
3
3
|
import '../types-9tns4wyl.js';
|
|
4
4
|
import '../metadata-capture.js';
|
package/dist/codex/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PlatformAdapter, AdapterConfig } from '../adapter-interface/interface.mjs';
|
|
2
|
-
import { A as AgentAction, I as InterceptResult, P as PDLSSContext, V as VerificationDecision } from '../types-
|
|
2
|
+
import { A as AgentAction, I as InterceptResult, P as PDLSSContext, V as VerificationDecision } from '../types-cQVCMeNV.mjs';
|
|
3
3
|
import { AstraSyncGateway } from '../gateway/gateway.mjs';
|
|
4
4
|
import '../types-sy3tq8lp.mjs';
|
|
5
5
|
import '../metadata-capture.mjs';
|
package/dist/codex/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PlatformAdapter, AdapterConfig } from '../adapter-interface/interface.js';
|
|
2
|
-
import { A as AgentAction, I as InterceptResult, P as PDLSSContext, V as VerificationDecision } from '../types-
|
|
2
|
+
import { A as AgentAction, I as InterceptResult, P as PDLSSContext, V as VerificationDecision } from '../types-DhFPiZ3t.js';
|
|
3
3
|
import { AstraSyncGateway } from '../gateway/gateway.js';
|
|
4
4
|
import '../types-9tns4wyl.js';
|
|
5
5
|
import '../metadata-capture.js';
|
package/dist/codex/index.js
CHANGED
|
@@ -434,8 +434,9 @@ function extractBacktickSubstitutions(text, collect) {
|
|
|
434
434
|
return kept.join(" ");
|
|
435
435
|
}
|
|
436
436
|
function basename(token) {
|
|
437
|
-
const slash = token.lastIndexOf("/");
|
|
438
|
-
|
|
437
|
+
const slash = Math.max(token.lastIndexOf("/"), token.lastIndexOf("\\"));
|
|
438
|
+
const name = slash === -1 ? token : token.slice(slash + 1);
|
|
439
|
+
return name.replace(/\.(exe|cmd|bat|ps1)$/i, "");
|
|
439
440
|
}
|
|
440
441
|
function matchSegment(segment, list) {
|
|
441
442
|
const tokens = segment.split(/\s+/).filter((t) => /[a-z0-9]/.test(t));
|
|
@@ -568,7 +569,9 @@ var LocalEvaluator = class {
|
|
|
568
569
|
}
|
|
569
570
|
return {
|
|
570
571
|
recommendation: "ALLOW",
|
|
571
|
-
|
|
572
|
+
// "evaluated": dimensions absent from the policy are skipped, not
|
|
573
|
+
// failed — evaluatedDimensions below records which ones ran.
|
|
574
|
+
reason: "All evaluated PDLSS checks passed",
|
|
572
575
|
evaluatedDimensions: {
|
|
573
576
|
purpose: true,
|
|
574
577
|
scope: !!this.policy.scope,
|
|
@@ -667,7 +670,7 @@ var LocalEvaluator = class {
|
|
|
667
670
|
}
|
|
668
671
|
}
|
|
669
672
|
if ((context.purpose === "file.read" || context.purpose === "file.write" || context.purpose === "file.delete") && context.target) {
|
|
670
|
-
const targetLower = context.target.toLowerCase();
|
|
673
|
+
const targetLower = context.target.toLowerCase().replace(/\\/g, "/");
|
|
671
674
|
for (const sensitivePath of SENSITIVE_PATHS) {
|
|
672
675
|
if (targetLower.includes(sensitivePath.toLowerCase())) {
|
|
673
676
|
score = Math.max(score, 50);
|
|
@@ -696,12 +699,20 @@ var LocalEvaluator = class {
|
|
|
696
699
|
matchesAnyPattern(value, patterns) {
|
|
697
700
|
return patterns.some((pattern) => this.matchGlob(value, pattern));
|
|
698
701
|
}
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
702
|
+
homePrefix() {
|
|
703
|
+
if (this.cachedHomePrefix !== void 0) return this.cachedHomePrefix;
|
|
704
|
+
const env = typeof process !== "undefined" ? process.env : void 0;
|
|
705
|
+
const home = env?.HOME || env?.USERPROFILE;
|
|
706
|
+
this.cachedHomePrefix = home ? home.replace(/\\/g, "/") : null;
|
|
707
|
+
return this.cachedHomePrefix;
|
|
708
|
+
}
|
|
704
709
|
matchGlob(value, pattern) {
|
|
710
|
+
value = value.replace(/\\/g, "/");
|
|
711
|
+
pattern = pattern.replace(/\\/g, "/");
|
|
712
|
+
if (pattern === "~" || pattern.startsWith("~/")) {
|
|
713
|
+
const home = this.homePrefix();
|
|
714
|
+
if (home) pattern = home + pattern.slice(1);
|
|
715
|
+
}
|
|
705
716
|
if (pattern === value) return true;
|
|
706
717
|
const starCount = (pattern.match(/\*/g) ?? []).length;
|
|
707
718
|
if (starCount > 8) {
|
|
@@ -3974,7 +3985,7 @@ function getTrustLevel(score) {
|
|
|
3974
3985
|
}
|
|
3975
3986
|
|
|
3976
3987
|
// src/version.ts
|
|
3977
|
-
var SDK_VERSION = "3.11.
|
|
3988
|
+
var SDK_VERSION = "3.11.1";
|
|
3978
3989
|
|
|
3979
3990
|
// src/well-known.ts
|
|
3980
3991
|
var CACHE_TTL_MS = 60 * 60 * 1e3;
|
|
@@ -4738,13 +4749,29 @@ var TraceLogger = class {
|
|
|
4738
4749
|
*/
|
|
4739
4750
|
logEvaluation(context, decision) {
|
|
4740
4751
|
if (!this.enabled) return;
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4752
|
+
let event;
|
|
4753
|
+
try {
|
|
4754
|
+
event = {
|
|
4755
|
+
id: this.generateId(),
|
|
4756
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
4757
|
+
type: "evaluation",
|
|
4758
|
+
context: redactDeep(context),
|
|
4759
|
+
decision: redactDeep(decision)
|
|
4760
|
+
};
|
|
4761
|
+
} catch (err) {
|
|
4762
|
+
event = {
|
|
4763
|
+
id: this.generateId(),
|
|
4764
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
4765
|
+
type: "error",
|
|
4766
|
+
metadata: {
|
|
4767
|
+
error: `trace redaction failed: ${err instanceof Error ? err.message : String(err)}`,
|
|
4768
|
+
recommendation: decision.recommendation,
|
|
4769
|
+
purpose: context.purpose,
|
|
4770
|
+
action: context.action
|
|
4771
|
+
}
|
|
4772
|
+
};
|
|
4773
|
+
}
|
|
4774
|
+
this.write(event);
|
|
4748
4775
|
}
|
|
4749
4776
|
/**
|
|
4750
4777
|
* Log a tool call the guard saw but did not govern. One line per skip
|
|
@@ -4786,17 +4813,34 @@ var TraceLogger = class {
|
|
|
4786
4813
|
});
|
|
4787
4814
|
}
|
|
4788
4815
|
write(event) {
|
|
4816
|
+
let line;
|
|
4817
|
+
try {
|
|
4818
|
+
line = JSON.stringify(event) + "\n";
|
|
4819
|
+
} catch {
|
|
4820
|
+
return;
|
|
4821
|
+
}
|
|
4789
4822
|
try {
|
|
4790
4823
|
const filePath = this.getCurrentFilePath();
|
|
4791
|
-
const line = JSON.stringify(event) + "\n";
|
|
4792
4824
|
if ((0, import_fs3.existsSync)(filePath)) {
|
|
4793
4825
|
const stats = (0, import_fs3.statSync)(filePath);
|
|
4794
4826
|
if (stats.size > MAX_FILE_SIZE) {
|
|
4795
4827
|
this.rotate();
|
|
4796
4828
|
}
|
|
4797
4829
|
}
|
|
4798
|
-
(0
|
|
4830
|
+
for (let attempt = 0; attempt < 3; attempt++) {
|
|
4831
|
+
try {
|
|
4832
|
+
(0, import_fs3.appendFileSync)(filePath, line);
|
|
4833
|
+
return;
|
|
4834
|
+
} catch {
|
|
4835
|
+
}
|
|
4836
|
+
}
|
|
4837
|
+
const fallbackPath = filePath.replace(/\.jsonl$/, `-r${process.pid}.jsonl`);
|
|
4838
|
+
(0, import_fs3.appendFileSync)(fallbackPath, line);
|
|
4799
4839
|
} catch {
|
|
4840
|
+
try {
|
|
4841
|
+
console.error(`[AstraSync TraceLogger] failed to persist trace line: ${line.trim()}`);
|
|
4842
|
+
} catch {
|
|
4843
|
+
}
|
|
4800
4844
|
}
|
|
4801
4845
|
}
|
|
4802
4846
|
getCurrentFilePath() {
|