@lobu/runtime-device 24.2.0 → 24.3.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 +38 -124
- package/npm-shrinkwrap.json +169 -653
- package/package.json +1 -1
- package/vendor/cli/dist/bundled-skills/lobu/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/automation.js +1 -1
- package/vendor/connector-worker/dist/daemon/client.d.ts +15 -1
- package/vendor/connector-worker/dist/daemon/client.js +51 -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/poll-loop.js +6 -1
- 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 +4 -0
- package/vendor/core/dist/contracts/tools/manage-entity.js +6 -0
- 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/otel.js +38 -10
- 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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PROVIDER_WINDOWED_QUOTA = exports.PROVIDER_BALANCE_EXHAUSTED = exports.AGENT_ERRORS = exports.AgentErrorCode = exports.ConfigError = exports.
|
|
3
|
+
exports.PROVIDER_WINDOWED_QUOTA = exports.PROVIDER_BALANCE_EXHAUSTED = exports.AGENT_ERRORS = exports.AgentErrorCode = exports.ConfigError = exports.OrchestratorError = exports.ErrorCode = exports.WorkspaceError = exports.WorkerError = exports.BaseError = void 0;
|
|
4
4
|
exports.getErrorMessage = getErrorMessage;
|
|
5
5
|
exports.toAgentErrorCode = toAgentErrorCode;
|
|
6
6
|
/**
|
|
@@ -93,30 +93,6 @@ class OrchestratorError extends BaseError {
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
exports.OrchestratorError = OrchestratorError;
|
|
96
|
-
/**
|
|
97
|
-
* Thrown when a worker spawn is declined because another replica already holds
|
|
98
|
-
* the per-conversation lock for this turn — i.e. another pod legitimately OWNS
|
|
99
|
-
* this conversation turn and is running it to completion.
|
|
100
|
-
*
|
|
101
|
-
* This is NOT a failure. It is the cross-pod "handled elsewhere" signal. Under
|
|
102
|
-
* N>1 app replicas both pods drain the shared `thread_message` queue and race to
|
|
103
|
-
* spawn the same per-conversation worker; exactly one wins the advisory lock.
|
|
104
|
-
* The loser MUST drop silently — no user-facing error, no Critical log, no
|
|
105
|
-
* retry (the winner holds the lock for the entire worker subprocess lifetime, so
|
|
106
|
-
* retrying can never win). The winning pod discharges the shared turn-liveness
|
|
107
|
-
* marker on its successful reply, so the user still receives the answer.
|
|
108
|
-
*
|
|
109
|
-
* Distinguished by type (not a magic message string) so the orchestrator can
|
|
110
|
-
* tell "owned by another pod" apart from a genuine worker-startup failure (OOM,
|
|
111
|
-
* spawn failure, bad config) which MUST still surface an error to the user.
|
|
112
|
-
*/
|
|
113
|
-
class ConversationOwnedElsewhereError extends BaseError {
|
|
114
|
-
constructor() {
|
|
115
|
-
super(...arguments);
|
|
116
|
-
this.name = "ConversationOwnedElsewhereError";
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
exports.ConversationOwnedElsewhereError = ConversationOwnedElsewhereError;
|
|
120
96
|
class ConfigError extends BaseError {
|
|
121
97
|
constructor() {
|
|
122
98
|
super(...arguments);
|
package/vendor/core/dist/otel.js
CHANGED
|
@@ -16,10 +16,6 @@ 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");
|
|
24
20
|
const logger = (0, logger_1.createLogger)("otel");
|
|
25
21
|
let provider = null;
|
|
@@ -33,18 +29,50 @@ function initTracing(config) {
|
|
|
33
29
|
logger.debug("Tracing disabled (no OTEL_EXPORTER_OTLP_ENDPOINT configured)");
|
|
34
30
|
return;
|
|
35
31
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
// Bare require (not createRequire(__filename)): tsc emits CJS with a native
|
|
33
|
+
// require, bun provides one for src TS, and the server ESM bundle banner
|
|
34
|
+
// defines `const require = __createRequire(import.meta.url)` for exactly
|
|
35
|
+
// these calls — while __filename has no shim there and would throw.
|
|
36
|
+
let exporterCtor;
|
|
37
|
+
let resourceFromAttributes;
|
|
38
|
+
let NodeTracerProvider;
|
|
39
|
+
let SimpleSpanProcessor;
|
|
40
|
+
let ATTR_SERVICE_NAME;
|
|
41
|
+
let ATTR_SERVICE_VERSION;
|
|
42
|
+
try {
|
|
43
|
+
exporterCtor =
|
|
44
|
+
require("@opentelemetry/exporter-trace-otlp-grpc").OTLPTraceExporter;
|
|
45
|
+
resourceFromAttributes =
|
|
46
|
+
require("@opentelemetry/resources").resourceFromAttributes;
|
|
47
|
+
({
|
|
48
|
+
NodeTracerProvider,
|
|
49
|
+
SimpleSpanProcessor,
|
|
50
|
+
} = require("@opentelemetry/sdk-trace-node"));
|
|
51
|
+
({
|
|
52
|
+
ATTR_SERVICE_NAME,
|
|
53
|
+
ATTR_SERVICE_VERSION,
|
|
54
|
+
} = require("@opentelemetry/semantic-conventions"));
|
|
55
|
+
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
// Only a missing module means the optional peers aren't installed. A
|
|
58
|
+
// genuine load failure inside an installed OTel module (e.g. grpc native
|
|
59
|
+
// init) must surface as-is, not misreport as "not installed".
|
|
60
|
+
if (err?.code !== "MODULE_NOT_FOUND")
|
|
61
|
+
throw err;
|
|
62
|
+
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.");
|
|
63
|
+
}
|
|
64
|
+
const resource = resourceFromAttributes({
|
|
65
|
+
[ATTR_SERVICE_NAME]: config.serviceName,
|
|
66
|
+
[ATTR_SERVICE_VERSION]: config.serviceVersion || "1.0.0",
|
|
39
67
|
});
|
|
40
|
-
const exporter = new
|
|
68
|
+
const exporter = new exporterCtor({
|
|
41
69
|
url: config.otlpEndpoint,
|
|
42
70
|
timeoutMillis: 30000,
|
|
43
71
|
});
|
|
44
72
|
// SimpleSpanProcessor exports immediately — workers are short-lived
|
|
45
|
-
provider = new
|
|
73
|
+
provider = new NodeTracerProvider({
|
|
46
74
|
resource,
|
|
47
|
-
spanProcessors: [new
|
|
75
|
+
spanProcessors: [new SimpleSpanProcessor(exporter)],
|
|
48
76
|
});
|
|
49
77
|
provider.register();
|
|
50
78
|
tracer = api_1.trace.getTracer(config.serviceName, config.serviceVersion);
|
|
@@ -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.3.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
|