@pinta-ai/pinta-opencode 0.12.3-rc.1 → 0.12.3-rc.3
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.mjs +43 -5
- package/dist/plugin.js +47 -47
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -8211,6 +8211,7 @@ var require_otlp = __commonJS({
|
|
|
8211
8211
|
exports.newSpanId = newSpanId;
|
|
8212
8212
|
exports.snakeCase = snakeCase;
|
|
8213
8213
|
exports.guardVersionOf = guardVersionOf;
|
|
8214
|
+
exports.originalGuardVersionOf = originalGuardVersionOf;
|
|
8214
8215
|
exports.toOtlpValue = toOtlpValue;
|
|
8215
8216
|
exports.attrsFromRecord = attrsFromRecord2;
|
|
8216
8217
|
exports.guardAttrs = guardAttrs;
|
|
@@ -8256,6 +8257,10 @@ var require_otlp = __commonJS({
|
|
|
8256
8257
|
function guardVersionOf(payload) {
|
|
8257
8258
|
return guardVersions.get(payload) ?? payload;
|
|
8258
8259
|
}
|
|
8260
|
+
var originalGuardVersions = /* @__PURE__ */ new WeakMap();
|
|
8261
|
+
function originalGuardVersionOf(payload) {
|
|
8262
|
+
return originalGuardVersions.get(payload)?.();
|
|
8263
|
+
}
|
|
8259
8264
|
function sourceText(value) {
|
|
8260
8265
|
if (typeof value === "string")
|
|
8261
8266
|
return value;
|
|
@@ -8648,6 +8653,17 @@ var require_otlp = __commonJS({
|
|
|
8648
8653
|
payloadMaskers.set(built.payload, stored);
|
|
8649
8654
|
if (guard !== null)
|
|
8650
8655
|
guardVersions.set(built.payload, guard.payload);
|
|
8656
|
+
originalGuardVersions.set(built.payload, () => {
|
|
8657
|
+
for (const source of sources) {
|
|
8658
|
+
if (Buffer.byteLength(source.original, "utf-8") > redact_js_1.MAX_BYTES && source.main.some((match) => !match.fake))
|
|
8659
|
+
return void 0;
|
|
8660
|
+
}
|
|
8661
|
+
try {
|
|
8662
|
+
return make({ source: (source) => (0, redact_js_1.truncate)(source.original), plain: (text) => text }, []).payload;
|
|
8663
|
+
} catch {
|
|
8664
|
+
return void 0;
|
|
8665
|
+
}
|
|
8666
|
+
});
|
|
8651
8667
|
return attachGuard3(built.payload, args.guard, args.clientTiming);
|
|
8652
8668
|
}
|
|
8653
8669
|
var LABEL_KEYS = /* @__PURE__ */ new Set([
|
|
@@ -8711,8 +8727,9 @@ var require_guard = __commonJS({
|
|
|
8711
8727
|
"node_modules/@pinta-ai/core/dist/guard.js"(exports) {
|
|
8712
8728
|
"use strict";
|
|
8713
8729
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8714
|
-
exports.GUARD_STATUS_REFUSED = exports.GUARD_BUDGET_HEADER = exports.MAX_LONG_INPUT_TIMEOUT_MS = exports.DEFAULT_LONG_INPUT_TIMEOUT_MS = exports.LONG_INPUT_BYTES = exports.GUARD_HOLD_REASONS = exports.GUARD_REQUIRED_RULES_HEADER = exports.GUARD_MODE_HEADER = exports.GUARD_HOLD_PROTOCOL = void 0;
|
|
8730
|
+
exports.GUARD_COPY_PARAM = exports.GUARD_STATUS_REFUSED = exports.GUARD_BUDGET_HEADER = exports.MAX_LONG_INPUT_TIMEOUT_MS = exports.DEFAULT_LONG_INPUT_TIMEOUT_MS = exports.LONG_INPUT_BYTES = exports.GUARD_HOLD_REASONS = exports.GUARD_REQUIRED_RULES_HEADER = exports.GUARD_MODE_HEADER = exports.GUARD_HOLD_PROTOCOL = void 0;
|
|
8715
8731
|
exports.guardWaitMs = guardWaitMs;
|
|
8732
|
+
exports.wantsOriginalGuardCopy = wantsOriginalGuardCopy;
|
|
8716
8733
|
exports.holdGuard = holdGuard;
|
|
8717
8734
|
exports.evaluateGuard = evaluateGuard2;
|
|
8718
8735
|
var otlp_js_1 = require_otlp();
|
|
@@ -8781,6 +8798,16 @@ var require_guard = __commonJS({
|
|
|
8781
8798
|
return out.length > 0 ? out : void 0;
|
|
8782
8799
|
}
|
|
8783
8800
|
exports.GUARD_STATUS_REFUSED = 410;
|
|
8801
|
+
exports.GUARD_COPY_PARAM = "guard_copy";
|
|
8802
|
+
var LOOPBACK_HOSTS = /* @__PURE__ */ new Set(["127.0.0.1", "localhost", "[::1]"]);
|
|
8803
|
+
function wantsOriginalGuardCopy(endpoint) {
|
|
8804
|
+
try {
|
|
8805
|
+
const url = new URL(endpoint);
|
|
8806
|
+
return url.searchParams.get(exports.GUARD_COPY_PARAM) === "original" && LOOPBACK_HOSTS.has(url.hostname);
|
|
8807
|
+
} catch {
|
|
8808
|
+
return false;
|
|
8809
|
+
}
|
|
8810
|
+
}
|
|
8784
8811
|
async function evaluateOpenGuard(payload, endpoint, opts = {}) {
|
|
8785
8812
|
if (!endpoint)
|
|
8786
8813
|
return null;
|
|
@@ -8790,7 +8817,8 @@ var require_guard = __commonJS({
|
|
|
8790
8817
|
const controller = new AbortController();
|
|
8791
8818
|
let timer;
|
|
8792
8819
|
try {
|
|
8793
|
-
const
|
|
8820
|
+
const copy = (wantsOriginalGuardCopy(endpoint) ? (0, otlp_js_1.originalGuardVersionOf)(payload) : void 0) ?? (0, otlp_js_1.guardVersionOf)(payload);
|
|
8821
|
+
const requestBody = JSON.stringify(copy);
|
|
8794
8822
|
const timeoutMs = guardWaitMs(Buffer.byteLength(requestBody, "utf-8"), opts);
|
|
8795
8823
|
timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
8796
8824
|
const res = await fetch(endpoint, {
|
|
@@ -9585,8 +9613,8 @@ var require_dist = __commonJS({
|
|
|
9585
9613
|
"node_modules/@pinta-ai/core/dist/index.js"(exports) {
|
|
9586
9614
|
"use strict";
|
|
9587
9615
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9588
|
-
exports.
|
|
9589
|
-
exports.loadEnvFile = exports.parseEnvFile = exports.envFilePath = exports.MemorySessionTraceManager = exports.DiskSessionTraceManager = exports.generateUlid = exports.TraceManager = exports.MAX_POST_BYTES = exports.parseHeadersEnv = exports.envOptionsResolver = exports.postOtlp = void 0;
|
|
9616
|
+
exports.DiskRetryQueue = exports.TRUNCATION_MARKER = exports.WITHHELD_TEXT = exports.GUIDANCE_WITHHOLD = exports.GUIDANCE_MASK = exports.DEFAULT_NOTICE = exports.buildNotice = exports.buildOutputDenial = exports.GUARD_HOLD_REASONS = exports.GUARD_REQUIRED_RULES_HEADER = exports.GUARD_MODE_HEADER = exports.GUARD_HOLD_PROTOCOL = exports.holdGuard = exports.MAX_LONG_INPUT_TIMEOUT_MS = exports.DEFAULT_LONG_INPUT_TIMEOUT_MS = exports.LONG_INPUT_BYTES = exports.GUARD_BUDGET_HEADER = exports.GUARD_STATUS_REFUSED = exports.wantsOriginalGuardCopy = exports.GUARD_COPY_PARAM = exports.guardWaitMs = exports.evaluateGuard = exports.MAX_SPAN_BYTES = exports.enforceSpanBudget = exports.mergeBatch = exports.originalGuardVersionOf = exports.guardVersionOf = exports.attachGuard = exports.buildPayload = exports.clientAttrs = exports.guardAttrs = exports.attrsFromRecord = exports.toOtlpValue = exports.snakeCase = exports.newSpanId = exports.ulidToTraceId = exports.sensitiveValues = exports.maskOtlpEnvelope = exports.maskJsonValue = exports.decodeJsonTextForScan = exports.createValueMasker = exports.inspectCredentialSemantics = exports.MAX_BYTES = exports.PATTERNS = exports.applyMatches = exports.resolveOverlaps = exports.collectMatches = exports.truncateTo = exports.truncate = exports.redact = void 0;
|
|
9617
|
+
exports.loadEnvFile = exports.parseEnvFile = exports.envFilePath = exports.MemorySessionTraceManager = exports.DiskSessionTraceManager = exports.generateUlid = exports.TraceManager = exports.MAX_POST_BYTES = exports.parseHeadersEnv = exports.envOptionsResolver = exports.postOtlp = exports.MemoryTransport = exports.DiskTransport = exports.MemoryRetryQueue = void 0;
|
|
9590
9618
|
var redact_js_1 = require_redact();
|
|
9591
9619
|
Object.defineProperty(exports, "redact", { enumerable: true, get: function() {
|
|
9592
9620
|
return redact_js_1.redact;
|
|
@@ -9663,6 +9691,9 @@ var require_dist = __commonJS({
|
|
|
9663
9691
|
Object.defineProperty(exports, "guardVersionOf", { enumerable: true, get: function() {
|
|
9664
9692
|
return otlp_js_1.guardVersionOf;
|
|
9665
9693
|
} });
|
|
9694
|
+
Object.defineProperty(exports, "originalGuardVersionOf", { enumerable: true, get: function() {
|
|
9695
|
+
return otlp_js_1.originalGuardVersionOf;
|
|
9696
|
+
} });
|
|
9666
9697
|
Object.defineProperty(exports, "mergeBatch", { enumerable: true, get: function() {
|
|
9667
9698
|
return otlp_js_1.mergeBatch;
|
|
9668
9699
|
} });
|
|
@@ -9679,6 +9710,12 @@ var require_dist = __commonJS({
|
|
|
9679
9710
|
Object.defineProperty(exports, "guardWaitMs", { enumerable: true, get: function() {
|
|
9680
9711
|
return guard_js_1.guardWaitMs;
|
|
9681
9712
|
} });
|
|
9713
|
+
Object.defineProperty(exports, "GUARD_COPY_PARAM", { enumerable: true, get: function() {
|
|
9714
|
+
return guard_js_1.GUARD_COPY_PARAM;
|
|
9715
|
+
} });
|
|
9716
|
+
Object.defineProperty(exports, "wantsOriginalGuardCopy", { enumerable: true, get: function() {
|
|
9717
|
+
return guard_js_1.wantsOriginalGuardCopy;
|
|
9718
|
+
} });
|
|
9682
9719
|
Object.defineProperty(exports, "GUARD_STATUS_REFUSED", { enumerable: true, get: function() {
|
|
9683
9720
|
return guard_js_1.GUARD_STATUS_REFUSED;
|
|
9684
9721
|
} });
|
|
@@ -9895,7 +9932,7 @@ var import_core8 = __toESM(require_dist(), 1);
|
|
|
9895
9932
|
var import_core5 = __toESM(require_dist(), 1);
|
|
9896
9933
|
|
|
9897
9934
|
// src/core/version.ts
|
|
9898
|
-
var ADAPTER_VERSION = "0.12.3-rc.
|
|
9935
|
+
var ADAPTER_VERSION = "0.12.3-rc.3";
|
|
9899
9936
|
|
|
9900
9937
|
// src/core/guard.ts
|
|
9901
9938
|
var DEFAULT_TIMEOUT_MS = 100;
|
|
@@ -10649,6 +10686,7 @@ var lifecycle = {
|
|
|
10649
10686
|
roots,
|
|
10650
10687
|
scan,
|
|
10651
10688
|
classify,
|
|
10689
|
+
isExcluded,
|
|
10652
10690
|
// `database` files (opencode.db) must be snapshot()'d before read — the live
|
|
10653
10691
|
// file has `-wal`/`-shm` and would torn-read (plan §4.2, §6).
|
|
10654
10692
|
snapshot
|