@lobu/runtime-device 24.2.0 → 24.4.0
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/component.json +1 -1
- package/dist/dependencies.bun.lock +43 -129
- package/npm-shrinkwrap.json +206 -690
- package/package.json +1 -1
- package/vendor/cli/dist/bundled-skills/lobu/SKILL.md +21 -3
- package/vendor/cli/dist/bundled-skills/lobu-connect/SKILL.md +6 -0
- package/vendor/cli/dist/commands/chat.d.ts +0 -12
- package/vendor/cli/dist/commands/chat.js +1 -1
- package/vendor/cli/dist/commands/daemon.js +36 -19
- package/vendor/cli/dist/commands/doctor.d.ts +0 -6
- package/vendor/cli/dist/commands/doctor.js +1 -1
- package/vendor/cli/dist/commands/memory/_lib/seed-cmd.d.ts +0 -8
- package/vendor/cli/dist/commands/memory/_lib/seed-cmd.js +1 -1
- package/vendor/cli/dist/config/define.d.ts +1 -1
- package/vendor/cli/dist/connectors/gchat.ts +31 -1
- package/vendor/cli/dist/connectors/postgres.ts +9 -5
- package/vendor/cli/dist/internal/cli-update-check.d.ts +33 -0
- package/vendor/cli/dist/internal/cli-update-check.js +98 -0
- package/vendor/cli/dist/internal/credentials.js +10 -36
- package/vendor/cli/dist/internal/gateway-url.d.ts +0 -8
- package/vendor/cli/dist/internal/gateway-url.js +1 -1
- package/vendor/cli/dist/runtime-components.json +4 -4
- package/vendor/cli/package.json +1 -1
- package/vendor/connector-sdk/dist/connector-types.d.ts +29 -0
- package/vendor/connector-sdk/dist/index.d.ts +3 -1
- package/vendor/connector-sdk/dist/index.js +4 -0
- package/vendor/connector-sdk/dist/redact.d.ts +10 -0
- package/vendor/{connector-worker/dist/executor → connector-sdk/dist}/redact.js +0 -49
- package/vendor/connector-sdk/dist/types.d.ts +2 -1
- package/vendor/connector-sdk/package.json +6 -1
- package/vendor/connector-worker/dist/daemon/acp-adapters/THIRD_PARTY_LICENSES.txt +1 -1
- package/vendor/connector-worker/dist/daemon/acp-adapters/claude.js +7339 -2136
- package/vendor/connector-worker/dist/daemon/agent-turn.js +58 -3
- package/vendor/connector-worker/dist/daemon/automation.js +1 -1
- package/vendor/connector-worker/dist/daemon/client.d.ts +15 -1
- package/vendor/connector-worker/dist/daemon/client.js +57 -4
- package/vendor/connector-worker/dist/daemon/executor.d.ts +0 -28
- package/vendor/connector-worker/dist/daemon/executor.js +27 -12
- package/vendor/connector-worker/dist/daemon/index.d.ts +1 -1
- package/vendor/connector-worker/dist/daemon/index.js +1 -1
- package/vendor/connector-worker/dist/daemon/log.js +2 -1
- package/vendor/connector-worker/dist/daemon/poll-loop.js +32 -8
- package/vendor/connector-worker/dist/daemon/start.d.ts +0 -1
- package/vendor/connector-worker/dist/daemon/start.js +1 -1
- package/vendor/connector-worker/dist/daemon/terminal-delivery.d.ts +1 -0
- package/vendor/connector-worker/dist/daemon/terminal-delivery.js +10 -6
- package/vendor/connector-worker/dist/executor/isolate.js +1 -1
- package/vendor/connector-worker/dist/isolate/bridge.d.ts +6 -2
- package/vendor/connector-worker/dist/isolate/bridge.js +14 -8
- package/vendor/connector-worker/package.json +2 -2
- package/vendor/core/dist/connector-query-errors.d.ts +6 -0
- package/vendor/core/dist/connector-query-errors.js +4 -0
- package/vendor/core/dist/contracts/tools/manage-automations.js +1 -1
- package/vendor/core/dist/contracts/tools/manage-entity-schema.js +1 -1
- package/vendor/core/dist/contracts/tools/manage-entity.d.ts +49 -20
- package/vendor/core/dist/contracts/tools/manage-entity.js +23 -5
- package/vendor/core/dist/contracts/worker/device-automation.d.ts +1 -1
- package/vendor/core/dist/contracts/worker/device-automation.js +1 -1
- package/vendor/core/dist/errors.d.ts +0 -20
- package/vendor/core/dist/errors.js +1 -25
- package/vendor/core/dist/index.d.ts +1 -0
- package/vendor/core/dist/index.js +4 -1
- package/vendor/core/dist/logger.js +8 -2
- package/vendor/core/dist/otel.d.ts +13 -2
- package/vendor/core/dist/otel.js +98 -44
- package/vendor/core/dist/trace-context.d.ts +12 -0
- package/vendor/core/dist/trace-context.js +50 -0
- package/vendor/core/dist/utils/ajv.js +3 -1
- package/vendor/core/package.json +26 -5
- package/vendor/connector-worker/dist/executor/http-status.d.ts +0 -16
- package/vendor/connector-worker/dist/executor/http-status.js +0 -21
- package/vendor/connector-worker/dist/executor/redact.d.ts +0 -29
package/vendor/core/dist/otel.js
CHANGED
|
@@ -16,11 +16,8 @@ exports.getTraceparent = getTraceparent;
|
|
|
16
16
|
const api_1 = require("@opentelemetry/api");
|
|
17
17
|
Object.defineProperty(exports, "SpanKind", { enumerable: true, get: function () { return api_1.SpanKind; } });
|
|
18
18
|
Object.defineProperty(exports, "SpanStatusCode", { enumerable: true, get: function () { return api_1.SpanStatusCode; } });
|
|
19
|
-
const exporter_trace_otlp_grpc_1 = require("@opentelemetry/exporter-trace-otlp-grpc");
|
|
20
|
-
const resources_1 = require("@opentelemetry/resources");
|
|
21
|
-
const sdk_trace_node_1 = require("@opentelemetry/sdk-trace-node");
|
|
22
|
-
const semantic_conventions_1 = require("@opentelemetry/semantic-conventions");
|
|
23
19
|
const logger_1 = require("./logger");
|
|
20
|
+
const trace_context_1 = require("./trace-context");
|
|
24
21
|
const logger = (0, logger_1.createLogger)("otel");
|
|
25
22
|
let provider = null;
|
|
26
23
|
let tracer = null;
|
|
@@ -28,36 +25,104 @@ function initTracing(config) {
|
|
|
28
25
|
if (provider) {
|
|
29
26
|
return;
|
|
30
27
|
}
|
|
31
|
-
const
|
|
28
|
+
const customProcessors = config.spanProcessors;
|
|
29
|
+
const useCustomProcessors = (customProcessors?.length ?? 0) > 0;
|
|
30
|
+
const enabled = config.enabled ?? (!!config.otlpEndpoint || useCustomProcessors);
|
|
32
31
|
if (!enabled) {
|
|
33
32
|
logger.debug("Tracing disabled (no OTEL_EXPORTER_OTLP_ENDPOINT configured)");
|
|
34
33
|
return;
|
|
35
34
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
// Bare require (not createRequire(__filename)): tsc emits CJS with a native
|
|
36
|
+
// require, bun provides one for src TS, and the server ESM bundle banner
|
|
37
|
+
// defines `const require = __createRequire(import.meta.url)` for exactly
|
|
38
|
+
// these calls — while __filename has no shim there and would throw.
|
|
39
|
+
let resourceFromAttributes;
|
|
40
|
+
let NodeTracerProvider;
|
|
41
|
+
let ATTR_SERVICE_NAME;
|
|
42
|
+
let ATTR_SERVICE_VERSION;
|
|
43
|
+
let spanProcessors;
|
|
44
|
+
try {
|
|
45
|
+
resourceFromAttributes =
|
|
46
|
+
require("@opentelemetry/resources").resourceFromAttributes;
|
|
47
|
+
let BatchSpanProcessor;
|
|
48
|
+
({
|
|
49
|
+
BatchSpanProcessor,
|
|
50
|
+
NodeTracerProvider,
|
|
51
|
+
} = require("@opentelemetry/sdk-trace-node"));
|
|
52
|
+
({
|
|
53
|
+
ATTR_SERVICE_NAME,
|
|
54
|
+
ATTR_SERVICE_VERSION,
|
|
55
|
+
} = require("@opentelemetry/semantic-conventions"));
|
|
56
|
+
if (customProcessors?.length) {
|
|
57
|
+
// A caller-supplied processor (tests) never loads the gRPC exporter.
|
|
58
|
+
spanProcessors = customProcessors;
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
// The server is long-lived: a batch keeps export off the request path
|
|
62
|
+
// and bounds memory with a drop-on-full queue while a collector is
|
|
63
|
+
// down. shutdownTracing flushes it.
|
|
64
|
+
const exporterCtor = require("@opentelemetry/exporter-trace-otlp-grpc").OTLPTraceExporter;
|
|
65
|
+
spanProcessors = [
|
|
66
|
+
new BatchSpanProcessor(new exporterCtor({
|
|
67
|
+
url: config.otlpEndpoint,
|
|
68
|
+
timeoutMillis: 30000,
|
|
69
|
+
})),
|
|
70
|
+
];
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
catch (err) {
|
|
74
|
+
// Only a missing module means the optional peers aren't installed. A
|
|
75
|
+
// genuine load failure inside an installed OTel module (e.g. grpc native
|
|
76
|
+
// init) must surface as-is, not misreport as "not installed".
|
|
77
|
+
if (err?.code !== "MODULE_NOT_FOUND")
|
|
78
|
+
throw err;
|
|
79
|
+
throw new Error("Tracing is enabled (OTEL_EXPORTER_OTLP_ENDPOINT or enabled: true) but the optional OpenTelemetry peer dependencies are not installed (@opentelemetry/exporter-trace-otlp-grpc, @opentelemetry/resources, @opentelemetry/sdk-trace-node, @opentelemetry/semantic-conventions). Install them explicitly to enable tracing, or leave the endpoint unset to run without tracing.");
|
|
80
|
+
}
|
|
81
|
+
const resource = resourceFromAttributes({
|
|
82
|
+
[ATTR_SERVICE_NAME]: config.serviceName,
|
|
83
|
+
[ATTR_SERVICE_VERSION]: config.serviceVersion || "1.0.0",
|
|
43
84
|
});
|
|
44
|
-
|
|
45
|
-
provider = new sdk_trace_node_1.NodeTracerProvider({
|
|
85
|
+
provider = new NodeTracerProvider({
|
|
46
86
|
resource,
|
|
47
|
-
spanProcessors
|
|
87
|
+
spanProcessors,
|
|
48
88
|
});
|
|
49
89
|
provider.register();
|
|
50
|
-
tracer
|
|
51
|
-
|
|
90
|
+
// Bind the tracer we just built. trace.getTracer() stays on the first
|
|
91
|
+
// globally registered provider, so a later init would otherwise export
|
|
92
|
+
// into a provider this call does not own.
|
|
93
|
+
tracer = provider.getTracer(config.serviceName, config.serviceVersion);
|
|
94
|
+
logger.info(useCustomProcessors
|
|
95
|
+
? `Tracing initialized: ${config.serviceName} (custom span processors)`
|
|
96
|
+
: `Tracing initialized: ${config.serviceName} -> ${config.otlpEndpoint}`);
|
|
52
97
|
}
|
|
53
98
|
function getTracer() {
|
|
54
99
|
return tracer;
|
|
55
100
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
101
|
+
/**
|
|
102
|
+
* Flush and stop tracing. With `timeoutMs`, an unreachable collector cannot
|
|
103
|
+
* hold up process exit past that budget; the timeout rejects.
|
|
104
|
+
*/
|
|
105
|
+
async function shutdownTracing(timeoutMs) {
|
|
106
|
+
if (!provider)
|
|
107
|
+
return;
|
|
108
|
+
const shutdown = provider.shutdown();
|
|
109
|
+
provider = null;
|
|
110
|
+
tracer = null;
|
|
111
|
+
if (timeoutMs === undefined) {
|
|
112
|
+
await shutdown;
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
let timer;
|
|
116
|
+
try {
|
|
117
|
+
await Promise.race([
|
|
118
|
+
shutdown,
|
|
119
|
+
new Promise((_, reject) => {
|
|
120
|
+
timer = setTimeout(() => reject(new Error(`Tracing shutdown exceeded its ${timeoutMs}ms budget`)), timeoutMs);
|
|
121
|
+
}),
|
|
122
|
+
]);
|
|
123
|
+
}
|
|
124
|
+
finally {
|
|
125
|
+
clearTimeout(timer);
|
|
61
126
|
}
|
|
62
127
|
}
|
|
63
128
|
async function flushTracing() {
|
|
@@ -101,43 +166,33 @@ async function withSpan(name, fn, attributes) {
|
|
|
101
166
|
function getCurrentSpan() {
|
|
102
167
|
return api_1.trace.getActiveSpan();
|
|
103
168
|
}
|
|
169
|
+
/** Run `fn` with `span` active, or plainly when tracing produced no span. */
|
|
104
170
|
function runInSpanContext(span, fn) {
|
|
105
|
-
|
|
106
|
-
|
|
171
|
+
if (!span)
|
|
172
|
+
return fn();
|
|
173
|
+
return api_1.context.with(api_1.trace.setSpan(api_1.context.active(), span), fn);
|
|
107
174
|
}
|
|
108
175
|
function createRootSpan(name, attributes) {
|
|
109
176
|
if (!tracer) {
|
|
110
177
|
return { span: null, traceparent: null };
|
|
111
178
|
}
|
|
179
|
+
// Not the active context. Callers that want logs to see this span run
|
|
180
|
+
// the work through runInSpanContext.
|
|
112
181
|
const span = tracer.startSpan(name, {
|
|
113
182
|
kind: api_1.SpanKind.SERVER,
|
|
114
183
|
attributes,
|
|
115
184
|
});
|
|
116
|
-
|
|
117
|
-
const traceparent = `00-${spanContext.traceId}-${spanContext.spanId}-01`;
|
|
118
|
-
return { span, traceparent };
|
|
185
|
+
return { span, traceparent: (0, trace_context_1.formatTraceparent)(span.spanContext()) };
|
|
119
186
|
}
|
|
120
187
|
function createChildSpan(name, traceparent, attributes) {
|
|
121
188
|
if (!tracer) {
|
|
122
189
|
return null;
|
|
123
190
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
// W3C traceparent: 00-traceId-parentSpanId-flags
|
|
128
|
-
const parts = traceparent.split("-");
|
|
129
|
-
if (parts.length !== 4) {
|
|
191
|
+
const parent = (0, trace_context_1.parseTraceparent)(traceparent);
|
|
192
|
+
if (!parent) {
|
|
130
193
|
return createSpan(name, attributes);
|
|
131
194
|
}
|
|
132
|
-
|
|
133
|
-
const parentSpanId = parts[2];
|
|
134
|
-
const parentContext = api_1.trace.setSpanContext(api_1.context.active(), {
|
|
135
|
-
traceId,
|
|
136
|
-
spanId: parentSpanId,
|
|
137
|
-
traceFlags: 1,
|
|
138
|
-
isRemote: true,
|
|
139
|
-
});
|
|
140
|
-
return tracer.startSpan(name, { kind: api_1.SpanKind.INTERNAL, attributes }, parentContext);
|
|
195
|
+
return tracer.startSpan(name, { kind: api_1.SpanKind.INTERNAL, attributes }, api_1.trace.setSpanContext(api_1.context.active(), parent));
|
|
141
196
|
}
|
|
142
197
|
async function withChildSpan(name, traceparent, fn, attributes) {
|
|
143
198
|
return runInSpan(createChildSpan(name, traceparent, attributes), fn);
|
|
@@ -145,7 +200,6 @@ async function withChildSpan(name, traceparent, fn, attributes) {
|
|
|
145
200
|
function getTraceparent(span) {
|
|
146
201
|
if (!span)
|
|
147
202
|
return null;
|
|
148
|
-
|
|
149
|
-
return `00-${ctx.traceId}-${ctx.spanId}-01`;
|
|
203
|
+
return (0, trace_context_1.formatTraceparent)(span.spanContext());
|
|
150
204
|
}
|
|
151
205
|
//# sourceMappingURL=otel.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type SpanContext } from "@opentelemetry/api";
|
|
2
|
+
/** The remote parent a valid `traceparent` names, or null for anything else. */
|
|
3
|
+
export declare function parseTraceparent(value: unknown): SpanContext | null;
|
|
4
|
+
export declare function formatTraceparent(spanContext: SpanContext): string;
|
|
5
|
+
/** A W3C `traceparent` value, or null when the input is not one. */
|
|
6
|
+
export declare function traceparentHeader(value: unknown): string | null;
|
|
7
|
+
/** W3C ids of the active span. Empty when the log is outside a real span. */
|
|
8
|
+
export declare function currentTraceLogFields(): {
|
|
9
|
+
trace_id?: string;
|
|
10
|
+
span_id?: string;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=trace-context.d.ts.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseTraceparent = parseTraceparent;
|
|
4
|
+
exports.formatTraceparent = formatTraceparent;
|
|
5
|
+
exports.traceparentHeader = traceparentHeader;
|
|
6
|
+
exports.currentTraceLogFields = currentTraceLogFields;
|
|
7
|
+
const api_1 = require("@opentelemetry/api");
|
|
8
|
+
// The only W3C `traceparent` parser and formatter. Depends on the OTel API
|
|
9
|
+
// alone, so the logger can import it without a cycle through otel.ts.
|
|
10
|
+
/** The remote parent a valid `traceparent` names, or null for anything else. */
|
|
11
|
+
function parseTraceparent(value) {
|
|
12
|
+
if (typeof value !== "string" || value !== value.toLowerCase())
|
|
13
|
+
return null;
|
|
14
|
+
const [version, traceId, spanId, flags, ...rest] = value.split("-");
|
|
15
|
+
if (version !== "00" || rest.length > 0 || flags?.length !== 2)
|
|
16
|
+
return null;
|
|
17
|
+
const traceFlags = Number.parseInt(flags, 16);
|
|
18
|
+
const spanContext = {
|
|
19
|
+
traceId: traceId ?? "",
|
|
20
|
+
spanId: spanId ?? "",
|
|
21
|
+
traceFlags,
|
|
22
|
+
isRemote: true,
|
|
23
|
+
};
|
|
24
|
+
// The round trip rejects non-hex and signed flags without a pattern.
|
|
25
|
+
return traceFlags >= 0 &&
|
|
26
|
+
formatFlags(traceFlags) === flags &&
|
|
27
|
+
api_1.trace.isSpanContextValid(spanContext)
|
|
28
|
+
? spanContext
|
|
29
|
+
: null;
|
|
30
|
+
}
|
|
31
|
+
function formatTraceparent(spanContext) {
|
|
32
|
+
return `00-${spanContext.traceId}-${spanContext.spanId}-${formatFlags(spanContext.traceFlags)}`;
|
|
33
|
+
}
|
|
34
|
+
function formatFlags(traceFlags) {
|
|
35
|
+
return traceFlags.toString(16).padStart(2, "0");
|
|
36
|
+
}
|
|
37
|
+
/** A W3C `traceparent` value, or null when the input is not one. */
|
|
38
|
+
function traceparentHeader(value) {
|
|
39
|
+
const spanContext = parseTraceparent(value);
|
|
40
|
+
return spanContext ? formatTraceparent(spanContext) : null;
|
|
41
|
+
}
|
|
42
|
+
/** W3C ids of the active span. Empty when the log is outside a real span. */
|
|
43
|
+
function currentTraceLogFields() {
|
|
44
|
+
const spanContext = api_1.trace.getActiveSpan()?.spanContext();
|
|
45
|
+
if (!spanContext || !api_1.trace.isSpanContextValid(spanContext)) {
|
|
46
|
+
return {};
|
|
47
|
+
}
|
|
48
|
+
return { trace_id: spanContext.traceId, span_id: spanContext.spanId };
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=trace-context.js.map
|
|
@@ -50,7 +50,9 @@ function formatAjvError(error) {
|
|
|
50
50
|
case "type":
|
|
51
51
|
return `${field}: must be ${error.params.type}`;
|
|
52
52
|
case "required":
|
|
53
|
-
|
|
53
|
+
// A nested object reports `required` at the object's own path; name the
|
|
54
|
+
// field from the root so `ref/backend_node_id` is not read as `backend_node_id`.
|
|
55
|
+
return `missing required field: ${error.instancePath ? `${field}/` : ""}${error.params.missingProperty}`;
|
|
54
56
|
case "format":
|
|
55
57
|
return `${field}: must be a valid ${error.params.format}`;
|
|
56
58
|
case "minimum":
|
package/vendor/core/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobu/core",
|
|
3
|
-
"version": "24.
|
|
3
|
+
"version": "24.4.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Core types and utilities for Lobu agent platform",
|
|
6
6
|
"repository": {
|
|
@@ -66,6 +66,11 @@
|
|
|
66
66
|
"import": "./dist/utils/ajv.js",
|
|
67
67
|
"require": "./dist/utils/ajv.js"
|
|
68
68
|
},
|
|
69
|
+
"./diagnostic-scrubber": {
|
|
70
|
+
"types": "./dist/utils/diagnostic-scrubber.d.ts",
|
|
71
|
+
"import": "./dist/utils/diagnostic-scrubber.js",
|
|
72
|
+
"require": "./dist/utils/diagnostic-scrubber.js"
|
|
73
|
+
},
|
|
69
74
|
"./contracts/tools/manage-connections": {
|
|
70
75
|
"types": "./dist/contracts/tools/manage-connections.d.ts",
|
|
71
76
|
"import": "./dist/contracts/tools/manage-connections.js",
|
|
@@ -249,14 +254,30 @@
|
|
|
249
254
|
},
|
|
250
255
|
"dependencies": {
|
|
251
256
|
"@opentelemetry/api": "^1.9.0",
|
|
252
|
-
"@opentelemetry/exporter-trace-otlp-grpc": "^0.222.0",
|
|
253
|
-
"@opentelemetry/resources": "^2.11.0",
|
|
254
|
-
"@opentelemetry/sdk-trace-node": "^2.11.0",
|
|
255
|
-
"@opentelemetry/semantic-conventions": "^1.28.0",
|
|
256
257
|
"@sinclair/typebox": "^0.34.41",
|
|
257
258
|
"acorn": "^8.16.0",
|
|
258
259
|
"ajv": "^8.17.1",
|
|
259
260
|
"ajv-formats": "^3.0.1",
|
|
260
261
|
"winston": "^3.17.0"
|
|
262
|
+
},
|
|
263
|
+
"peerDependencies": {
|
|
264
|
+
"@opentelemetry/exporter-trace-otlp-grpc": "^0.221.0",
|
|
265
|
+
"@opentelemetry/resources": "^2.10.0",
|
|
266
|
+
"@opentelemetry/sdk-trace-node": "^2.10.0",
|
|
267
|
+
"@opentelemetry/semantic-conventions": "^1.28.0"
|
|
268
|
+
},
|
|
269
|
+
"peerDependenciesMeta": {
|
|
270
|
+
"@opentelemetry/exporter-trace-otlp-grpc": {
|
|
271
|
+
"optional": true
|
|
272
|
+
},
|
|
273
|
+
"@opentelemetry/resources": {
|
|
274
|
+
"optional": true
|
|
275
|
+
},
|
|
276
|
+
"@opentelemetry/sdk-trace-node": {
|
|
277
|
+
"optional": true
|
|
278
|
+
},
|
|
279
|
+
"@opentelemetry/semantic-conventions": {
|
|
280
|
+
"optional": true
|
|
281
|
+
}
|
|
261
282
|
}
|
|
262
283
|
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Extract a structured HTTP status from a connector-thrown error (lobu#2051 Item 2).
|
|
3
|
-
*
|
|
4
|
-
* Lives in its own side-effect-free module so tests can import it without
|
|
5
|
-
* pulling in the executor. The connector SDK's
|
|
6
|
-
* `HttpStatusError` sets a numeric `status`; carrying that number to the gateway
|
|
7
|
-
* lets it classify 429/5xx honestly instead of keyword-matching the redacted
|
|
8
|
-
* message string.
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* Pull a numeric HTTP status off a thrown error when the connector used the SDK's
|
|
12
|
-
* `HttpStatusError` (or any error carrying a numeric `status`). Returns undefined
|
|
13
|
-
* when there's no plausible status, so callers can omit the field entirely.
|
|
14
|
-
*/
|
|
15
|
-
export declare function extractHttpStatus(err: unknown): number | undefined;
|
|
16
|
-
//# sourceMappingURL=http-status.d.ts.map
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Extract a structured HTTP status from a connector-thrown error (lobu#2051 Item 2).
|
|
3
|
-
*
|
|
4
|
-
* Lives in its own side-effect-free module so tests can import it without
|
|
5
|
-
* pulling in the executor. The connector SDK's
|
|
6
|
-
* `HttpStatusError` sets a numeric `status`; carrying that number to the gateway
|
|
7
|
-
* lets it classify 429/5xx honestly instead of keyword-matching the redacted
|
|
8
|
-
* message string.
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* Pull a numeric HTTP status off a thrown error when the connector used the SDK's
|
|
12
|
-
* `HttpStatusError` (or any error carrying a numeric `status`). Returns undefined
|
|
13
|
-
* when there's no plausible status, so callers can omit the field entirely.
|
|
14
|
-
*/
|
|
15
|
-
export function extractHttpStatus(err) {
|
|
16
|
-
if (!err || typeof err !== 'object')
|
|
17
|
-
return undefined;
|
|
18
|
-
const status = err.status;
|
|
19
|
-
return typeof status === 'number' && status >= 100 && status < 600 ? status : undefined;
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=http-status.js.map
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Redact secrets from connector output before it leaves the worker.
|
|
3
|
-
*
|
|
4
|
-
* Patterns are deliberately broad — false positives are preferred to leaking a
|
|
5
|
-
* real credential into the runs table. Add new patterns here when a connector
|
|
6
|
-
* surfaces a new sensitive shape.
|
|
7
|
-
*/
|
|
8
|
-
export declare function isSecretOutputKey(key: string): boolean;
|
|
9
|
-
export declare function redactOutput(text: string): string;
|
|
10
|
-
/**
|
|
11
|
-
* Streaming redactor for live tee to parent stdout/stderr. Buffers up to the
|
|
12
|
-
* last newline so that secrets split across stream chunk boundaries — for
|
|
13
|
-
* example "Authorization: Bear" + "er abc..." in two `data` events — still
|
|
14
|
-
* get matched by `redactOutput()`. The persisted `output_tail` already runs
|
|
15
|
-
* `redactOutput()` over the full ring-buffer string and is unaffected; this
|
|
16
|
-
* class exists solely to make the live-forwarded stream as safe as the
|
|
17
|
-
* persisted tail.
|
|
18
|
-
*
|
|
19
|
-
* `flush()` MUST be called on stream end to release any trailing partial
|
|
20
|
-
* line; otherwise its (redacted) content is dropped from the live tee but
|
|
21
|
-
* still appears in the persisted tail.
|
|
22
|
-
*/
|
|
23
|
-
export declare class StreamRedactor {
|
|
24
|
-
private carryover;
|
|
25
|
-
private static readonly MAX_BUFFER;
|
|
26
|
-
process(chunk: string, emit: (redacted: string) => void): void;
|
|
27
|
-
flush(emit: (redacted: string) => void): void;
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=redact.d.ts.map
|