@agenshield/broker 0.6.1 → 0.6.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.
@@ -1 +1 @@
1
- {"version":3,"file":"http-fallback.d.ts","sourceRoot":"","sources":["../src/http-fallback.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EACV,YAAY,EAIb,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAsBxE,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,YAAY,CAAC;IACrB,cAAc,EAAE,cAAc,CAAC;IAC/B,WAAW,EAAE,WAAW,CAAC;IACzB,gBAAgB,EAAE,gBAAgB,CAAC;CACpC;AAED,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,gBAAgB,CAAmB;gBAE/B,OAAO,EAAE,yBAAyB;IAO9C;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAoB5B;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAY3B;;OAEG;YACW,aAAa;IA6C3B;;OAEG;IACH,OAAO,CAAC,WAAW;IAUnB;;OAEG;YACW,cAAc;IAuI5B;;OAEG;IACH,OAAO,CAAC,UAAU;IAsBlB;;OAEG;IACH,OAAO,CAAC,aAAa;IAWrB;;OAEG;IACH,OAAO,CAAC,aAAa;CAWtB"}
1
+ {"version":3,"file":"http-fallback.d.ts","sourceRoot":"","sources":["../src/http-fallback.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EACV,YAAY,EAIb,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAsBxE,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,YAAY,CAAC;IACrB,cAAc,EAAE,cAAc,CAAC;IAC/B,WAAW,EAAE,WAAW,CAAC;IACzB,gBAAgB,EAAE,gBAAgB,CAAC;CACpC;AAED,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,gBAAgB,CAAmB;gBAE/B,OAAO,EAAE,yBAAyB;IAO9C;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAoB5B;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAY3B;;OAEG;YACW,aAAa;IA6C3B;;OAEG;IACH,OAAO,CAAC,WAAW;IAUnB;;OAEG;YACW,cAAc;IAqI5B;;OAEG;IACH,OAAO,CAAC,UAAU;IAsBlB;;OAEG;IACH,OAAO,CAAC,aAAa;IAWrB;;OAEG;IACH,OAAO,CAAC,aAAa;CAWtB"}
package/index.js CHANGED
@@ -1043,13 +1043,9 @@ var UnixSocketServer = class {
1043
1043
  config: this.config
1044
1044
  // Socket credentials would be extracted here on supported platforms
1045
1045
  };
1046
- const policyResult = await this.policyEnforcer.check(
1047
- request.method,
1048
- request.params,
1049
- context
1050
- );
1046
+ const policyResult = request.method === "policy_check" ? { allowed: true, policyId: void 0, reason: void 0 } : await this.policyEnforcer.check(request.method, request.params, context);
1051
1047
  let finalPolicy = policyResult;
1052
- if (!policyResult.allowed && request.method !== "policy_check") {
1048
+ if (!policyResult.allowed) {
1053
1049
  const target = this.extractTarget(request);
1054
1050
  const daemonUrl = this.config.daemonUrl || "http://127.0.0.1:5200";
1055
1051
  const override = await forwardPolicyToDaemon(request.method, target, daemonUrl);
@@ -1100,7 +1096,7 @@ var UnixSocketServer = class {
1100
1096
  return {
1101
1097
  jsonrpc: "2.0",
1102
1098
  id: request.id,
1103
- result: result.data
1099
+ result: { success: true, data: result.data }
1104
1100
  };
1105
1101
  } else {
1106
1102
  return this.errorResponse(
@@ -1296,13 +1292,9 @@ var HttpFallbackServer = class {
1296
1292
  timestamp: /* @__PURE__ */ new Date(),
1297
1293
  config: this.config
1298
1294
  };
1299
- const policyResult = await this.policyEnforcer.check(
1300
- request.method,
1301
- request.params,
1302
- context
1303
- );
1295
+ const policyResult = request.method === "policy_check" ? { allowed: true, policyId: void 0, reason: void 0 } : await this.policyEnforcer.check(request.method, request.params, context);
1304
1296
  let finalPolicy = policyResult;
1305
- if (!policyResult.allowed && request.method !== "policy_check") {
1297
+ if (!policyResult.allowed) {
1306
1298
  const target = this.extractTarget(request);
1307
1299
  const daemonUrl = this.config.daemonUrl || "http://127.0.0.1:5200";
1308
1300
  const override = await forwardPolicyToDaemon(request.method, target, daemonUrl);
package/main.js CHANGED
@@ -1045,13 +1045,9 @@ var UnixSocketServer = class {
1045
1045
  config: this.config
1046
1046
  // Socket credentials would be extracted here on supported platforms
1047
1047
  };
1048
- const policyResult = await this.policyEnforcer.check(
1049
- request.method,
1050
- request.params,
1051
- context
1052
- );
1048
+ const policyResult = request.method === "policy_check" ? { allowed: true, policyId: void 0, reason: void 0 } : await this.policyEnforcer.check(request.method, request.params, context);
1053
1049
  let finalPolicy = policyResult;
1054
- if (!policyResult.allowed && request.method !== "policy_check") {
1050
+ if (!policyResult.allowed) {
1055
1051
  const target = this.extractTarget(request);
1056
1052
  const daemonUrl = this.config.daemonUrl || "http://127.0.0.1:5200";
1057
1053
  const override = await forwardPolicyToDaemon(request.method, target, daemonUrl);
@@ -1102,7 +1098,7 @@ var UnixSocketServer = class {
1102
1098
  return {
1103
1099
  jsonrpc: "2.0",
1104
1100
  id: request.id,
1105
- result: result.data
1101
+ result: { success: true, data: result.data }
1106
1102
  };
1107
1103
  } else {
1108
1104
  return this.errorResponse(
@@ -1298,13 +1294,9 @@ var HttpFallbackServer = class {
1298
1294
  timestamp: /* @__PURE__ */ new Date(),
1299
1295
  config: this.config
1300
1296
  };
1301
- const policyResult = await this.policyEnforcer.check(
1302
- request.method,
1303
- request.params,
1304
- context
1305
- );
1297
+ const policyResult = request.method === "policy_check" ? { allowed: true, policyId: void 0, reason: void 0 } : await this.policyEnforcer.check(request.method, request.params, context);
1306
1298
  let finalPolicy = policyResult;
1307
- if (!policyResult.allowed && request.method !== "policy_check") {
1299
+ if (!policyResult.allowed) {
1308
1300
  const target = this.extractTarget(request);
1309
1301
  const daemonUrl = this.config.daemonUrl || "http://127.0.0.1:5200";
1310
1302
  const override = await forwardPolicyToDaemon(request.method, target, daemonUrl);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agenshield/broker",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "type": "module",
5
5
  "description": "AgenShield broker daemon with Unix socket and HTTP fallback",
6
6
  "main": "./index.js",
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "license": "MIT",
26
26
  "dependencies": {
27
- "@agenshield/ipc": "0.6.1"
27
+ "@agenshield/ipc": "0.6.2"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/node": "^24.0.0",
package/server.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EACV,YAAY,EAIb,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,m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