@lobu/runtime-device 20.1.0 → 20.2.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 +13 -13
- package/npm-shrinkwrap.json +55 -55
- package/package.json +1 -1
- package/vendor/cli/dist/commands/login.js +3 -0
- package/vendor/cli/dist/connectors/chat-user-identity.ts +41 -0
- package/vendor/cli/dist/connectors/google-identity.ts +11 -0
- package/vendor/cli/dist/connectors/slack-identity.ts +19 -0
- package/vendor/cli/dist/internal/credentials.js +5 -1
- package/vendor/cli/dist/internal/oauth.d.ts +15 -1
- package/vendor/cli/dist/internal/oauth.js +9 -1
- package/vendor/cli/dist/runtime-components.json +4 -4
- package/vendor/cli/package.json +1 -1
- package/vendor/connector-sdk/package.json +1 -1
- package/vendor/connector-worker/dist/daemon/automation-process.d.ts +32 -0
- package/vendor/connector-worker/dist/daemon/automation-process.js +102 -1
- package/vendor/connector-worker/dist/daemon/builtins/index.js +8 -0
- package/vendor/connector-worker/dist/daemon/builtins/os-shell.d.ts +13 -1
- package/vendor/connector-worker/dist/daemon/builtins/os-shell.js +28 -2
- package/vendor/connector-worker/package.json +1 -1
- package/vendor/core/dist/credentials.d.ts +16 -1
- package/vendor/core/dist/credentials.js +10 -1
- package/vendor/core/package.json +1 -1
package/dist/component.json
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
"@anthropic-ai/sdk": ["@anthropic-ai/sdk@0.91.1", "", { "dependencies": { "json-schema-to-ts": "^3.1.1" }, "peerDependencies": { "zod": "^3.25.0 || ^4.0.0" }, "bin": { "anthropic-ai-sdk": "bin/cli" } }, "sha512-LAmu761tSN9r66ixvmciswUj/ZC+1Q4iAfpedTfSVLeswRwnY3n2Nb6Tsk+cLPP28aLOPWeMgIuTuCcMC6W/iw=="],
|
|
24
24
|
|
|
25
|
-
"@aws-sdk/client-bedrock-runtime": ["@aws-sdk/client-bedrock-runtime@3.
|
|
25
|
+
"@aws-sdk/client-bedrock-runtime": ["@aws-sdk/client-bedrock-runtime@3.1135.0", "", { "dependencies": { "@aws-sdk/core": "^3.978.0", "@aws-sdk/credential-provider-node": "^3.972.83", "@aws-sdk/eventstream-handler-node": "^3.972.34", "@aws-sdk/middleware-eventstream": "^3.972.29", "@aws-sdk/middleware-websocket": "^3.972.53", "@aws-sdk/token-providers": "3.1135.0", "@aws-sdk/types": "^3.974.5", "@smithy/core": "^3.33.3", "@smithy/fetch-http-handler": "^5.7.2", "@smithy/node-http-handler": "^4.11.3", "@smithy/types": "^4.17.2", "tslib": "^2.6.2" } }, "sha512-DDTMmWwVAJYsOOb83thk8AkBAJMQIJDm89n/doYbtlks9KGc//mbPYYvxfWgVTqFlUu+oCqwF2sJT2FxnSMk1Q=="],
|
|
26
26
|
|
|
27
27
|
"@aws-sdk/core": ["@aws-sdk/core@3.978.0", "", { "dependencies": { "@aws-sdk/types": "^3.974.5", "@aws-sdk/xml-builder": "^3.972.40", "@aws/lambda-invoke-store": "^0.3.0", "@smithy/core": "^3.33.3", "@smithy/signature-v4": "^5.6.12", "@smithy/types": "^4.17.2", "bowser": "^2.11.0", "tslib": "^2.6.2" } }, "sha512-2yX9LUmxPklVjSGTb8dfnWRJSiFQ3TeH2nn7G1mdKHTfnabzF0+gfrS8rYfLWmZrQ8A3mEcxMJjRc51dL5KWaA=="],
|
|
28
28
|
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
|
|
53
53
|
"@aws-sdk/signature-v4-multi-region": ["@aws-sdk/signature-v4-multi-region@3.996.46", "", { "dependencies": { "@aws-sdk/types": "^3.974.5", "@smithy/signature-v4": "^5.6.12", "@smithy/types": "^4.17.2", "tslib": "^2.6.2" } }, "sha512-L+2xZTye/2T96f3lwCws0Zw6GG2JHZW9e8FpVgGBeeExSKyeoZ6CWRpBml/7DNiK/O26jrgPM9F+Ay8VkgzUWQ=="],
|
|
54
54
|
|
|
55
|
-
"@aws-sdk/token-providers": ["@aws-sdk/token-providers@3.
|
|
55
|
+
"@aws-sdk/token-providers": ["@aws-sdk/token-providers@3.1135.0", "", { "dependencies": { "@aws-sdk/core": "^3.978.0", "@aws-sdk/nested-clients": "^3.997.45", "@aws-sdk/types": "^3.974.5", "@smithy/core": "^3.33.3", "@smithy/types": "^4.17.2", "tslib": "^2.6.2" } }, "sha512-JEYc/NHSDKGLmtQtaG5xZ1hmyFZ0Lav6GGAG417VaYyUURT0EeQEAnfVIkZQsLg5+P8BxCAv8YLIEpU2aNh++A=="],
|
|
56
56
|
|
|
57
57
|
"@aws-sdk/types": ["@aws-sdk/types@3.974.5", "", { "dependencies": { "@smithy/types": "^4.17.2", "tslib": "^2.6.2" } }, "sha512-LkwLL2BLbC6wNNm4JaH9mbEqBMdOZCct6VAYqhdN4U1xrWM+fUJQEfbHwQgDypapOWTRtlk25akb5afM0P8CIQ=="],
|
|
58
58
|
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
|
|
127
127
|
"@google/genai": ["@google/genai@1.52.0", "", { "dependencies": { "google-auth-library": "^10.3.0", "p-retry": "^4.6.2", "protobufjs": "^7.5.4", "ws": "^8.18.0" }, "peerDependencies": { "@modelcontextprotocol/sdk": "^1.25.2" }, "optionalPeers": ["@modelcontextprotocol/sdk"] }, "sha512-gwSvbpiN/17O9TbsqSsE/OzZcpv5Fo4RQjdngGgogtuB9RsyJ8ZHhX5KjHj1bp5N9snN2eK8LDGXSaWW2hof8Q=="],
|
|
128
128
|
|
|
129
|
-
"@grpc/grpc-js": ["@grpc/grpc-js@1.14.
|
|
129
|
+
"@grpc/grpc-js": ["@grpc/grpc-js@1.14.5", "", { "dependencies": { "@grpc/proto-loader": "^0.8.0", "@js-sdsl/ordered-map": "^4.4.2" } }, "sha512-7VZM+SVdEcUUqSQeNI3zM8Qs/BhQKZndPo2h5VkYkAM8Iz0wJIa8mKV5ekQGqG8UUsnkQ0NMxIxwkIHYvj0qOw=="],
|
|
130
130
|
|
|
131
131
|
"@grpc/proto-loader": ["@grpc/proto-loader@0.8.1", "", { "dependencies": { "lodash.camelcase": "^4.3.0", "long": "^5.0.0", "protobufjs": "^7.5.5", "yargs": "^17.7.2" }, "bin": { "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" } }, "sha512-wtF6h+DY6M3YaDBPAmvuuA6jV8Sif9MjtOI5euKFWRgCDl5PeDpPsHR9u2l6St5ceY8AZgoNDww5+HvEsXFsGg=="],
|
|
132
132
|
|
|
@@ -248,15 +248,15 @@
|
|
|
248
248
|
|
|
249
249
|
"@sentry/conventions": ["@sentry/conventions@0.16.0", "", {}, "sha512-fO9PLmHdVURcSPUpWCItWAtgKiMwGdJHbovoSEyLplX5sxs2ugvI4CBPTrkkgqhObnZOD0CnWBKDzSVQYBKEyQ=="],
|
|
250
250
|
|
|
251
|
-
"@sentry/core": ["@sentry/core@10.
|
|
251
|
+
"@sentry/core": ["@sentry/core@10.75.0", "", { "dependencies": { "@sentry/conventions": "^0.16.0" } }, "sha512-5wDQpQqjJ6RHdPR+z6Q+47XlwoxRKBv0yyB0LKHqL/1azPOQbR+nllyLmmQDcoJpaksuLSmLA1q6hFX7gjDT2w=="],
|
|
252
252
|
|
|
253
|
-
"@sentry/node": ["@sentry/node@10.
|
|
253
|
+
"@sentry/node": ["@sentry/node@10.75.0", "", { "dependencies": { "@opentelemetry/api": "^1.9.1", "@opentelemetry/instrumentation": "^0.220.0", "@opentelemetry/sdk-trace-base": "^2.9.0", "@sentry/conventions": "^0.16.0", "@sentry/core": "10.75.0", "@sentry/node-core": "10.75.0", "@sentry/opentelemetry": "10.75.0", "@sentry/server-utils": "10.75.0", "import-in-the-middle": "^3.0.0" } }, "sha512-XdYW+SEiscQnuugh1hMldfnHurmleKSTSDqgfro6Y1yd7s0r2csnZ5/SEYxIeL4lSl1QXg1lIA1pBmAXjcdnKA=="],
|
|
254
254
|
|
|
255
|
-
"@sentry/node-core": ["@sentry/node-core@10.
|
|
255
|
+
"@sentry/node-core": ["@sentry/node-core@10.75.0", "", { "dependencies": { "@sentry/conventions": "^0.16.0", "@sentry/core": "10.75.0", "@sentry/opentelemetry": "10.75.0", "import-in-the-middle": "^3.0.0" }, "peerDependencies": { "@opentelemetry/api": "^1.9.0", "@opentelemetry/core": "^1.30.1 || ^2.1.0", "@opentelemetry/exporter-trace-otlp-http": ">=0.57.0 <1", "@opentelemetry/instrumentation": ">=0.57.1 <1", "@opentelemetry/sdk-trace-base": "^1.30.1 || ^2.1.0" }, "optionalPeers": ["@opentelemetry/exporter-trace-otlp-http"] }, "sha512-+E3KSX1oMqhpWQ23hj6NblIVUzLy3T2oceU7DfMX1s1ar+npaQZxR5K0/cMGcQgS1LLm8Jqwqo/lrZlKTCDm5A=="],
|
|
256
256
|
|
|
257
|
-
"@sentry/opentelemetry": ["@sentry/opentelemetry@10.
|
|
257
|
+
"@sentry/opentelemetry": ["@sentry/opentelemetry@10.75.0", "", { "dependencies": { "@sentry/conventions": "^0.16.0", "@sentry/core": "10.75.0" }, "peerDependencies": { "@opentelemetry/api": "^1.9.0", "@opentelemetry/core": "^1.30.1 || ^2.1.0", "@opentelemetry/sdk-trace-base": "^1.30.1 || ^2.1.0" } }, "sha512-reJoMtuHMuaiztoDVoaeitc22eHlTAvz2qpFhibWyzukJlF8oXB+o8EvDN9mmDDMedU89c//cXRcnPBlJvUxcw=="],
|
|
258
258
|
|
|
259
|
-
"@sentry/server-utils": ["@sentry/server-utils@10.
|
|
259
|
+
"@sentry/server-utils": ["@sentry/server-utils@10.75.0", "", { "dependencies": { "@sentry/conventions": "^0.16.0", "@sentry/core": "10.75.0" } }, "sha512-7fIa9vFGNzB13hmxl8Sip3xImSkqpc4wETzuQ7CLzVOwPvwI6y/gVEm0pxRhtJSq8SzfOp26eJWl80u8v78Osg=="],
|
|
260
260
|
|
|
261
261
|
"@sinclair/typebox": ["@sinclair/typebox@0.34.52", "", {}, "sha512-XiMQh7qqVlxZzcVD+kkGMNGMzcTrDMLWI7S4x7z1MkCkbDPrekpZXEUK0eZqZFMuHQg2a2DZOcDIh9o5v3Gonw=="],
|
|
262
262
|
|
|
@@ -282,7 +282,7 @@
|
|
|
282
282
|
|
|
283
283
|
"@tootallnate/quickjs-emscripten": ["@tootallnate/quickjs-emscripten@0.23.0", "", {}, "sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA=="],
|
|
284
284
|
|
|
285
|
-
"@types/node": ["@types/node@
|
|
285
|
+
"@types/node": ["@types/node@26.6.1", "", { "dependencies": { "undici-types": "~8.9.0" } }, "sha512-VqGJBMCtdhqkBUCcBLvywI0NJ+KLuVzgNnlBUNFOQjqVxzo2lxLUNg1DSey8+u2u6ktswSAxg+s68QLzWHNOuA=="],
|
|
286
286
|
|
|
287
287
|
"@types/retry": ["@types/retry@0.12.0", "", {}, "sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA=="],
|
|
288
288
|
|
|
@@ -480,7 +480,7 @@
|
|
|
480
480
|
|
|
481
481
|
"get-caller-file": ["get-caller-file@2.0.5", "", {}, "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg=="],
|
|
482
482
|
|
|
483
|
-
"get-east-asian-width": ["get-east-asian-width@1.
|
|
483
|
+
"get-east-asian-width": ["get-east-asian-width@1.7.0", "", {}, "sha512-XjH1AECxf0giL2V1aU8vKyRR2ppRUb5c0EvT7zuJTokQ74bNo52zOtghqdWIqrhUD79fo3x0WfKZdOqxF6LG1Q=="],
|
|
484
484
|
|
|
485
485
|
"get-intrinsic": ["get-intrinsic@1.3.0", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", "math-intrinsics": "^1.1.0" } }, "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ=="],
|
|
486
486
|
|
|
@@ -796,7 +796,7 @@
|
|
|
796
796
|
|
|
797
797
|
"turndown": ["turndown@7.2.2", "", { "dependencies": { "@mixmark-io/domino": "^2.2.0" } }, "sha512-1F7db8BiExOKxjSMU2b7if62D/XOyQyZbPKq/nUwopfgnHlqXHqQ0lvfUTeUIr1lZJzOPFn43dODyMSIfvWRKQ=="],
|
|
798
798
|
|
|
799
|
-
"typebox": ["typebox@1.3.
|
|
799
|
+
"typebox": ["typebox@1.3.34", "", {}, "sha512-wbnzrXXDW8xEFHDZZs2jo1MkhaYlKAY4FRhpBc1+2LF1fZVBGCXGdLEhA/Z/NBbgzJMFfeM8m7elKPa/+KxaUQ=="],
|
|
800
800
|
|
|
801
801
|
"typed-array-buffer": ["typed-array-buffer@1.0.3", "", { "dependencies": { "call-bound": "^1.0.3", "es-errors": "^1.3.0", "is-typed-array": "^1.1.14" } }, "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw=="],
|
|
802
802
|
|
|
@@ -804,7 +804,7 @@
|
|
|
804
804
|
|
|
805
805
|
"undici": ["undici@7.29.0", "", {}, "sha512-IDxfleLmmbSskfWSUATiN1nfn2rDuvnMOqb5CWR92iIfojA0Ud+ulOAAEQ57LPr9rWmsreUyf5lwyao+7GNNVw=="],
|
|
806
806
|
|
|
807
|
-
"undici-types": ["undici-types@
|
|
807
|
+
"undici-types": ["undici-types@8.9.0", "", {}, "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg=="],
|
|
808
808
|
|
|
809
809
|
"unicode-emoji-modifier-base": ["unicode-emoji-modifier-base@1.0.0", "", {}, "sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g=="],
|
|
810
810
|
|
|
@@ -812,7 +812,7 @@
|
|
|
812
812
|
|
|
813
813
|
"web-streams-polyfill": ["web-streams-polyfill@3.3.3", "", {}, "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw=="],
|
|
814
814
|
|
|
815
|
-
"which-typed-array": ["which-typed-array@1.1.
|
|
815
|
+
"which-typed-array": ["which-typed-array@1.1.23", "", { "dependencies": { "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.9", "call-bound": "^1.0.4", "for-each": "^0.3.5", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-tostringtag": "^1.0.2" } }, "sha512-JMh8aK+1B/0bk/YNupICmH5MgCq6yNLKYQUfsZtSDLLCCmxUkHjUY+oOlIa90lO7lHN1woAfpenLdlKpXy9o+A=="],
|
|
816
816
|
|
|
817
817
|
"winston": ["winston@3.19.0", "", { "dependencies": { "@colors/colors": "^1.6.0", "@dabh/diagnostics": "^2.0.8", "async": "^3.2.3", "is-stream": "^2.0.0", "logform": "^2.7.0", "one-time": "^1.0.0", "readable-stream": "^3.4.0", "safe-stable-stringify": "^2.3.1", "stack-trace": "0.0.x", "triple-beam": "^1.3.0", "winston-transport": "^4.9.0" } }, "sha512-LZNJgPzfKR+/J3cHkxcpHKpKKvGfDZVPS4hfJCc4cCG0CgYzvlD6yE/S3CIL/Yt91ak327YCpiF/0MyeZHEHKA=="],
|
|
818
818
|
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobu/runtime-device",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.2.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@lobu/runtime-device",
|
|
9
|
-
"version": "20.
|
|
9
|
+
"version": "20.2.0",
|
|
10
10
|
"license": "BUSL-1.1",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@lobu/cli": "file:vendor/cli",
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
52
|
"node_modules/@aws-sdk/client-bedrock-runtime": {
|
|
53
|
-
"version": "3.
|
|
54
|
-
"resolved": "https://registry.npmjs.org/@aws-sdk/client-bedrock-runtime/-/client-bedrock-runtime-3.
|
|
55
|
-
"integrity": "sha512-
|
|
53
|
+
"version": "3.1135.0",
|
|
54
|
+
"resolved": "https://registry.npmjs.org/@aws-sdk/client-bedrock-runtime/-/client-bedrock-runtime-3.1135.0.tgz",
|
|
55
|
+
"integrity": "sha512-DDTMmWwVAJYsOOb83thk8AkBAJMQIJDm89n/doYbtlks9KGc//mbPYYvxfWgVTqFlUu+oCqwF2sJT2FxnSMk1Q==",
|
|
56
56
|
"license": "Apache-2.0",
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@aws-sdk/core": "^3.978.0",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@aws-sdk/eventstream-handler-node": "^3.972.34",
|
|
61
61
|
"@aws-sdk/middleware-eventstream": "^3.972.29",
|
|
62
62
|
"@aws-sdk/middleware-websocket": "^3.972.53",
|
|
63
|
-
"@aws-sdk/token-providers": "3.
|
|
63
|
+
"@aws-sdk/token-providers": "3.1135.0",
|
|
64
64
|
"@aws-sdk/types": "^3.974.5",
|
|
65
65
|
"@smithy/core": "^3.33.3",
|
|
66
66
|
"@smithy/fetch-http-handler": "^5.7.2",
|
|
@@ -339,9 +339,9 @@
|
|
|
339
339
|
}
|
|
340
340
|
},
|
|
341
341
|
"node_modules/@aws-sdk/token-providers": {
|
|
342
|
-
"version": "3.
|
|
343
|
-
"resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.
|
|
344
|
-
"integrity": "sha512-
|
|
342
|
+
"version": "3.1135.0",
|
|
343
|
+
"resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.1135.0.tgz",
|
|
344
|
+
"integrity": "sha512-JEYc/NHSDKGLmtQtaG5xZ1hmyFZ0Lav6GGAG417VaYyUURT0EeQEAnfVIkZQsLg5+P8BxCAv8YLIEpU2aNh++A==",
|
|
345
345
|
"license": "Apache-2.0",
|
|
346
346
|
"dependencies": {
|
|
347
347
|
"@aws-sdk/core": "^3.978.0",
|
|
@@ -899,9 +899,9 @@
|
|
|
899
899
|
}
|
|
900
900
|
},
|
|
901
901
|
"node_modules/@grpc/grpc-js": {
|
|
902
|
-
"version": "1.14.
|
|
903
|
-
"resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.14.
|
|
904
|
-
"integrity": "sha512-
|
|
902
|
+
"version": "1.14.5",
|
|
903
|
+
"resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.14.5.tgz",
|
|
904
|
+
"integrity": "sha512-7VZM+SVdEcUUqSQeNI3zM8Qs/BhQKZndPo2h5VkYkAM8Iz0wJIa8mKV5ekQGqG8UUsnkQ0NMxIxwkIHYvj0qOw==",
|
|
905
905
|
"license": "Apache-2.0",
|
|
906
906
|
"dependencies": {
|
|
907
907
|
"@grpc/proto-loader": "^0.8.0",
|
|
@@ -1775,9 +1775,9 @@
|
|
|
1775
1775
|
}
|
|
1776
1776
|
},
|
|
1777
1777
|
"node_modules/@sentry/core": {
|
|
1778
|
-
"version": "10.
|
|
1779
|
-
"resolved": "https://registry.npmjs.org/@sentry/core/-/core-10.
|
|
1780
|
-
"integrity": "sha512-
|
|
1778
|
+
"version": "10.75.0",
|
|
1779
|
+
"resolved": "https://registry.npmjs.org/@sentry/core/-/core-10.75.0.tgz",
|
|
1780
|
+
"integrity": "sha512-5wDQpQqjJ6RHdPR+z6Q+47XlwoxRKBv0yyB0LKHqL/1azPOQbR+nllyLmmQDcoJpaksuLSmLA1q6hFX7gjDT2w==",
|
|
1781
1781
|
"license": "MIT",
|
|
1782
1782
|
"dependencies": {
|
|
1783
1783
|
"@sentry/conventions": "^0.16.0"
|
|
@@ -1787,19 +1787,19 @@
|
|
|
1787
1787
|
}
|
|
1788
1788
|
},
|
|
1789
1789
|
"node_modules/@sentry/node": {
|
|
1790
|
-
"version": "10.
|
|
1791
|
-
"resolved": "https://registry.npmjs.org/@sentry/node/-/node-10.
|
|
1792
|
-
"integrity": "sha512-
|
|
1790
|
+
"version": "10.75.0",
|
|
1791
|
+
"resolved": "https://registry.npmjs.org/@sentry/node/-/node-10.75.0.tgz",
|
|
1792
|
+
"integrity": "sha512-XdYW+SEiscQnuugh1hMldfnHurmleKSTSDqgfro6Y1yd7s0r2csnZ5/SEYxIeL4lSl1QXg1lIA1pBmAXjcdnKA==",
|
|
1793
1793
|
"license": "MIT",
|
|
1794
1794
|
"dependencies": {
|
|
1795
1795
|
"@opentelemetry/api": "^1.9.1",
|
|
1796
1796
|
"@opentelemetry/instrumentation": "^0.220.0",
|
|
1797
1797
|
"@opentelemetry/sdk-trace-base": "^2.9.0",
|
|
1798
1798
|
"@sentry/conventions": "^0.16.0",
|
|
1799
|
-
"@sentry/core": "10.
|
|
1800
|
-
"@sentry/node-core": "10.
|
|
1801
|
-
"@sentry/opentelemetry": "10.
|
|
1802
|
-
"@sentry/server-utils": "10.
|
|
1799
|
+
"@sentry/core": "10.75.0",
|
|
1800
|
+
"@sentry/node-core": "10.75.0",
|
|
1801
|
+
"@sentry/opentelemetry": "10.75.0",
|
|
1802
|
+
"@sentry/server-utils": "10.75.0",
|
|
1803
1803
|
"import-in-the-middle": "^3.0.0"
|
|
1804
1804
|
},
|
|
1805
1805
|
"engines": {
|
|
@@ -1807,14 +1807,14 @@
|
|
|
1807
1807
|
}
|
|
1808
1808
|
},
|
|
1809
1809
|
"node_modules/@sentry/node-core": {
|
|
1810
|
-
"version": "10.
|
|
1811
|
-
"resolved": "https://registry.npmjs.org/@sentry/node-core/-/node-core-10.
|
|
1812
|
-
"integrity": "sha512
|
|
1810
|
+
"version": "10.75.0",
|
|
1811
|
+
"resolved": "https://registry.npmjs.org/@sentry/node-core/-/node-core-10.75.0.tgz",
|
|
1812
|
+
"integrity": "sha512-+E3KSX1oMqhpWQ23hj6NblIVUzLy3T2oceU7DfMX1s1ar+npaQZxR5K0/cMGcQgS1LLm8Jqwqo/lrZlKTCDm5A==",
|
|
1813
1813
|
"license": "MIT",
|
|
1814
1814
|
"dependencies": {
|
|
1815
1815
|
"@sentry/conventions": "^0.16.0",
|
|
1816
|
-
"@sentry/core": "10.
|
|
1817
|
-
"@sentry/opentelemetry": "10.
|
|
1816
|
+
"@sentry/core": "10.75.0",
|
|
1817
|
+
"@sentry/opentelemetry": "10.75.0",
|
|
1818
1818
|
"import-in-the-middle": "^3.0.0"
|
|
1819
1819
|
},
|
|
1820
1820
|
"engines": {
|
|
@@ -1846,13 +1846,13 @@
|
|
|
1846
1846
|
}
|
|
1847
1847
|
},
|
|
1848
1848
|
"node_modules/@sentry/opentelemetry": {
|
|
1849
|
-
"version": "10.
|
|
1850
|
-
"resolved": "https://registry.npmjs.org/@sentry/opentelemetry/-/opentelemetry-10.
|
|
1851
|
-
"integrity": "sha512-
|
|
1849
|
+
"version": "10.75.0",
|
|
1850
|
+
"resolved": "https://registry.npmjs.org/@sentry/opentelemetry/-/opentelemetry-10.75.0.tgz",
|
|
1851
|
+
"integrity": "sha512-reJoMtuHMuaiztoDVoaeitc22eHlTAvz2qpFhibWyzukJlF8oXB+o8EvDN9mmDDMedU89c//cXRcnPBlJvUxcw==",
|
|
1852
1852
|
"license": "MIT",
|
|
1853
1853
|
"dependencies": {
|
|
1854
1854
|
"@sentry/conventions": "^0.16.0",
|
|
1855
|
-
"@sentry/core": "10.
|
|
1855
|
+
"@sentry/core": "10.75.0"
|
|
1856
1856
|
},
|
|
1857
1857
|
"engines": {
|
|
1858
1858
|
"node": ">=18"
|
|
@@ -1864,13 +1864,13 @@
|
|
|
1864
1864
|
}
|
|
1865
1865
|
},
|
|
1866
1866
|
"node_modules/@sentry/server-utils": {
|
|
1867
|
-
"version": "10.
|
|
1868
|
-
"resolved": "https://registry.npmjs.org/@sentry/server-utils/-/server-utils-10.
|
|
1869
|
-
"integrity": "sha512-
|
|
1867
|
+
"version": "10.75.0",
|
|
1868
|
+
"resolved": "https://registry.npmjs.org/@sentry/server-utils/-/server-utils-10.75.0.tgz",
|
|
1869
|
+
"integrity": "sha512-7fIa9vFGNzB13hmxl8Sip3xImSkqpc4wETzuQ7CLzVOwPvwI6y/gVEm0pxRhtJSq8SzfOp26eJWl80u8v78Osg==",
|
|
1870
1870
|
"license": "MIT",
|
|
1871
1871
|
"dependencies": {
|
|
1872
1872
|
"@sentry/conventions": "^0.16.0",
|
|
1873
|
-
"@sentry/core": "10.
|
|
1873
|
+
"@sentry/core": "10.75.0"
|
|
1874
1874
|
},
|
|
1875
1875
|
"engines": {
|
|
1876
1876
|
"node": ">=18"
|
|
@@ -2015,12 +2015,12 @@
|
|
|
2015
2015
|
"license": "MIT"
|
|
2016
2016
|
},
|
|
2017
2017
|
"node_modules/@types/node": {
|
|
2018
|
-
"version": "
|
|
2019
|
-
"resolved": "https://registry.npmjs.org/@types/node/-/node-
|
|
2020
|
-
"integrity": "sha512-
|
|
2018
|
+
"version": "26.6.1",
|
|
2019
|
+
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.1.tgz",
|
|
2020
|
+
"integrity": "sha512-VqGJBMCtdhqkBUCcBLvywI0NJ+KLuVzgNnlBUNFOQjqVxzo2lxLUNg1DSey8+u2u6ktswSAxg+s68QLzWHNOuA==",
|
|
2021
2021
|
"license": "MIT",
|
|
2022
2022
|
"dependencies": {
|
|
2023
|
-
"undici-types": "~
|
|
2023
|
+
"undici-types": "~8.9.0"
|
|
2024
2024
|
}
|
|
2025
2025
|
},
|
|
2026
2026
|
"node_modules/@types/retry": {
|
|
@@ -3359,9 +3359,9 @@
|
|
|
3359
3359
|
}
|
|
3360
3360
|
},
|
|
3361
3361
|
"node_modules/get-east-asian-width": {
|
|
3362
|
-
"version": "1.
|
|
3363
|
-
"resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.
|
|
3364
|
-
"integrity": "sha512-
|
|
3362
|
+
"version": "1.7.0",
|
|
3363
|
+
"resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.7.0.tgz",
|
|
3364
|
+
"integrity": "sha512-XjH1AECxf0giL2V1aU8vKyRR2ppRUb5c0EvT7zuJTokQ74bNo52zOtghqdWIqrhUD79fo3x0WfKZdOqxF6LG1Q==",
|
|
3365
3365
|
"license": "MIT",
|
|
3366
3366
|
"engines": {
|
|
3367
3367
|
"node": ">=18"
|
|
@@ -5425,9 +5425,9 @@
|
|
|
5425
5425
|
}
|
|
5426
5426
|
},
|
|
5427
5427
|
"node_modules/typebox": {
|
|
5428
|
-
"version": "1.3.
|
|
5429
|
-
"resolved": "https://registry.npmjs.org/typebox/-/typebox-1.3.
|
|
5430
|
-
"integrity": "sha512-
|
|
5428
|
+
"version": "1.3.34",
|
|
5429
|
+
"resolved": "https://registry.npmjs.org/typebox/-/typebox-1.3.34.tgz",
|
|
5430
|
+
"integrity": "sha512-wbnzrXXDW8xEFHDZZs2jo1MkhaYlKAY4FRhpBc1+2LF1fZVBGCXGdLEhA/Z/NBbgzJMFfeM8m7elKPa/+KxaUQ==",
|
|
5431
5431
|
"license": "MIT"
|
|
5432
5432
|
},
|
|
5433
5433
|
"node_modules/typed-array-buffer": {
|
|
@@ -5466,9 +5466,9 @@
|
|
|
5466
5466
|
}
|
|
5467
5467
|
},
|
|
5468
5468
|
"node_modules/undici-types": {
|
|
5469
|
-
"version": "
|
|
5470
|
-
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-
|
|
5471
|
-
"integrity": "sha512-
|
|
5469
|
+
"version": "8.9.0",
|
|
5470
|
+
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.9.0.tgz",
|
|
5471
|
+
"integrity": "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==",
|
|
5472
5472
|
"license": "MIT"
|
|
5473
5473
|
},
|
|
5474
5474
|
"node_modules/unicode-emoji-modifier-base": {
|
|
@@ -5496,9 +5496,9 @@
|
|
|
5496
5496
|
}
|
|
5497
5497
|
},
|
|
5498
5498
|
"node_modules/which-typed-array": {
|
|
5499
|
-
"version": "1.1.
|
|
5500
|
-
"resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.
|
|
5501
|
-
"integrity": "sha512-
|
|
5499
|
+
"version": "1.1.23",
|
|
5500
|
+
"resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.23.tgz",
|
|
5501
|
+
"integrity": "sha512-JMh8aK+1B/0bk/YNupICmH5MgCq6yNLKYQUfsZtSDLLCCmxUkHjUY+oOlIa90lO7lHN1woAfpenLdlKpXy9o+A==",
|
|
5502
5502
|
"license": "MIT",
|
|
5503
5503
|
"dependencies": {
|
|
5504
5504
|
"available-typed-arrays": "^1.0.7",
|
|
@@ -5773,7 +5773,7 @@
|
|
|
5773
5773
|
},
|
|
5774
5774
|
"vendor/cli": {
|
|
5775
5775
|
"name": "@lobu/cli",
|
|
5776
|
-
"version": "20.
|
|
5776
|
+
"version": "20.2.0",
|
|
5777
5777
|
"license": "Apache-2.0",
|
|
5778
5778
|
"dependencies": {
|
|
5779
5779
|
"@clack/prompts": "^1.2.0",
|
|
@@ -5815,7 +5815,7 @@
|
|
|
5815
5815
|
},
|
|
5816
5816
|
"vendor/connector-sdk": {
|
|
5817
5817
|
"name": "@lobu/connector-sdk",
|
|
5818
|
-
"version": "20.
|
|
5818
|
+
"version": "20.2.0",
|
|
5819
5819
|
"license": "BUSL-1.1",
|
|
5820
5820
|
"dependencies": {
|
|
5821
5821
|
"@lobu/core": "file:../core",
|
|
@@ -5830,7 +5830,7 @@
|
|
|
5830
5830
|
},
|
|
5831
5831
|
"vendor/connector-worker": {
|
|
5832
5832
|
"name": "@lobu/connector-worker",
|
|
5833
|
-
"version": "20.
|
|
5833
|
+
"version": "20.2.0",
|
|
5834
5834
|
"license": "BUSL-1.1",
|
|
5835
5835
|
"dependencies": {
|
|
5836
5836
|
"@agentclientprotocol/sdk": "1.4.0",
|
|
@@ -5856,7 +5856,7 @@
|
|
|
5856
5856
|
},
|
|
5857
5857
|
"vendor/core": {
|
|
5858
5858
|
"name": "@lobu/core",
|
|
5859
|
-
"version": "20.
|
|
5859
|
+
"version": "20.2.0",
|
|
5860
5860
|
"license": "Apache-2.0",
|
|
5861
5861
|
"dependencies": {
|
|
5862
5862
|
"@opentelemetry/api": "^1.9.0",
|
package/package.json
CHANGED
|
@@ -213,6 +213,9 @@ export async function loginCommand(options) {
|
|
|
213
213
|
tokenEndpoint: discovery.tokenEndpoint,
|
|
214
214
|
revocationEndpoint: discovery.revocationEndpoint,
|
|
215
215
|
userinfoEndpoint: discovery.userinfoEndpoint,
|
|
216
|
+
// Record the audience the issuer bound this grant to (RFC 8707, echoed
|
|
217
|
+
// on the token response). Refresh must replay it verbatim.
|
|
218
|
+
...(tokens.resource ? { resource: tokens.resource } : {}),
|
|
216
219
|
};
|
|
217
220
|
await saveCredentials({
|
|
218
221
|
accessToken: tokens.accessToken,
|
|
@@ -18,6 +18,18 @@
|
|
|
18
18
|
* these links authorize approvals and agent re-binding.
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
+
/**
|
|
22
|
+
* How a platform's stored user keys are scoped for a reverse lookup.
|
|
23
|
+
*
|
|
24
|
+
* `team-prefix` — keys for one tenant all begin with `prefix`, so a search must
|
|
25
|
+
* be constrained to it (Slack: `T0XYZ:`).
|
|
26
|
+
* `global` — ids are unique platform-wide, so the namespace needs no narrowing
|
|
27
|
+
* (Google: one account can only ever have one id).
|
|
28
|
+
*/
|
|
29
|
+
export type ChatUserKeyScope =
|
|
30
|
+
| { kind: 'team-prefix'; prefix: string }
|
|
31
|
+
| { kind: 'global' };
|
|
32
|
+
|
|
21
33
|
/** How one chat platform keys a sender identity. */
|
|
22
34
|
export interface ChatUserIdentity {
|
|
23
35
|
/** Chat platform key an inbound message arrives on (`slack`, `gchat`, …). */
|
|
@@ -42,4 +54,33 @@ export interface ChatUserIdentity {
|
|
|
42
54
|
teamId: string | null | undefined,
|
|
43
55
|
platformUserId: string | null | undefined,
|
|
44
56
|
): string | null;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The REVERSE of `buildUserKey`, for "which platform id does this Lobu user
|
|
60
|
+
* have here?": how stored keys are scoped when searching within `teamId`.
|
|
61
|
+
*
|
|
62
|
+
* Required, not optional, and deliberately NOT a bare nullable string. The
|
|
63
|
+
* two failure shapes must not collapse into one value: `global` means the
|
|
64
|
+
* platform has no tenant axis so the whole namespace is in scope, while null
|
|
65
|
+
* means this platform REQUIRES a team and did not get a usable one. A caller
|
|
66
|
+
* that treats those alike widens a Slack search past its `TEAM:` prefix and
|
|
67
|
+
* can return an id from a DIFFERENT workspace — the exact cross-tenant bleed
|
|
68
|
+
* `buildUserKey` exists to prevent. Callers must refuse on null.
|
|
69
|
+
*/
|
|
70
|
+
userKeyScope(teamId: string | null | undefined): ChatUserKeyScope | null;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Recover from a stored key the id the PLATFORM addresses this user by — the
|
|
74
|
+
* form its API takes (`openDM`, a mention), which is also the form
|
|
75
|
+
* `buildUserKey` accepts back.
|
|
76
|
+
*
|
|
77
|
+
* NOT "the key minus its scope prefix". Google stores the bare account id but
|
|
78
|
+
* addresses `users/<id>`, and the chat SDK routes a DM by inferring the
|
|
79
|
+
* adapter from exactly that prefix, so a bare id does not reach Google Chat
|
|
80
|
+
* at all. Each platform owns the difference; core must never re-derive it.
|
|
81
|
+
*
|
|
82
|
+
* Returns null when the stored key is not one this platform could have
|
|
83
|
+
* written — fail closed rather than address a malformed id.
|
|
84
|
+
*/
|
|
85
|
+
platformUserIdFromKey(key: string): string | null;
|
|
45
86
|
}
|
|
@@ -104,4 +104,15 @@ export const gchatChatUserIdentity: ChatUserIdentity = {
|
|
|
104
104
|
buildUserKey(_teamId, platformUserId) {
|
|
105
105
|
return normalizeGoogleUserId(platformUserId);
|
|
106
106
|
},
|
|
107
|
+
// Global for the same reason `buildUserKey` ignores the team: one Google
|
|
108
|
+
// account has exactly one id, so there is no tenant axis to narrow by and
|
|
109
|
+
// nothing to bleed across. Never null — a missing team is not an error here.
|
|
110
|
+
userKeyScope: () => ({ kind: 'global' }),
|
|
111
|
+
// Re-wraps the bare stored id as the resource name Chat addresses people by.
|
|
112
|
+
// The `users/` prefix is load-bearing on the way out as well as in: the chat
|
|
113
|
+
// SDK picks the Google Chat adapter off it, so a bare id is not routable.
|
|
114
|
+
platformUserIdFromKey(key) {
|
|
115
|
+
const bare = normalizeGoogleUserId(key);
|
|
116
|
+
return bare ? `${GCHAT_USER_PREFIX}${bare}` : null;
|
|
117
|
+
},
|
|
107
118
|
};
|
|
@@ -143,6 +143,25 @@ export const slackChatUserIdentity: ChatUserIdentity = {
|
|
|
143
143
|
buildUserKey(teamId, platformUserId) {
|
|
144
144
|
return normalizeSlackUserId(teamId, platformUserId);
|
|
145
145
|
},
|
|
146
|
+
userKeyScope(teamId) {
|
|
147
|
+
// No usable team = REFUSE, never "search the whole namespace". Two
|
|
148
|
+
// workspaces can both hold `U12345`, so an unconstrained search here would
|
|
149
|
+
// hand back an id from the wrong one. Validate exactly as
|
|
150
|
+
// `normalizeSlackUserId` does so the prefix cannot disagree with the keys
|
|
151
|
+
// it wrote.
|
|
152
|
+
if (typeof teamId !== 'string') return null;
|
|
153
|
+
const t = teamId.trim();
|
|
154
|
+
if (!t || !/^[a-z0-9_-]+$/i.test(t)) return null;
|
|
155
|
+
return { kind: 'team-prefix', prefix: `${t.toUpperCase()}:` };
|
|
156
|
+
},
|
|
157
|
+
// Slack addresses a user by the BARE `U…`; the team prefix is storage scoping
|
|
158
|
+
// only and would not resolve if sent back. Re-validating through
|
|
159
|
+
// `normalizeTeamScopedId` first means a key this connector could not have
|
|
160
|
+
// written (no prefix, bad chars) yields null rather than a half-parsed id.
|
|
161
|
+
platformUserIdFromKey(key) {
|
|
162
|
+
const normalized = normalizeTeamScopedId(key);
|
|
163
|
+
return normalized ? normalized.slice(normalized.indexOf(':') + 1) : null;
|
|
164
|
+
},
|
|
146
165
|
};
|
|
147
166
|
|
|
148
167
|
/** A Slack channel and the (bare `U…`) ids of its members. */
|
|
@@ -250,7 +250,11 @@ async function doRefreshCredentials(target, existing) {
|
|
|
250
250
|
async function attemptRefresh(target, creds) {
|
|
251
251
|
if (!credentialCanRefresh(creds))
|
|
252
252
|
return null;
|
|
253
|
-
const refreshed = await refreshTokens(creds.oauth.tokenEndpoint, { clientId: creds.oauth.clientId, clientSecret: creds.oauth.clientSecret }, creds.refreshToken
|
|
253
|
+
const refreshed = await refreshTokens(creds.oauth.tokenEndpoint, { clientId: creds.oauth.clientId, clientSecret: creds.oauth.clientSecret }, creds.refreshToken,
|
|
254
|
+
// Replay the RFC 8707 indicator the grant was minted with. Without it the
|
|
255
|
+
// issuer rejects a resource-scoped refresh outright (invalid_grant). An
|
|
256
|
+
// unbound grant must send no indicator at all, so pass nothing.
|
|
257
|
+
...(creds.oauth.resource ? [{ resource: creds.oauth.resource }] : []));
|
|
254
258
|
if (!refreshed)
|
|
255
259
|
return null;
|
|
256
260
|
const updated = {
|
|
@@ -34,6 +34,12 @@ interface TokenResponse {
|
|
|
34
34
|
accessToken: string;
|
|
35
35
|
refreshToken?: string;
|
|
36
36
|
expiresIn?: number;
|
|
37
|
+
/**
|
|
38
|
+
* RFC 8707 resource the issuer bound these tokens to, echoed back on the
|
|
39
|
+
* token response. Persisted with the credential so every later refresh can
|
|
40
|
+
* replay it — a resource-scoped grant refreshed without it is rejected.
|
|
41
|
+
*/
|
|
42
|
+
resource?: string;
|
|
37
43
|
}
|
|
38
44
|
interface UserInfo {
|
|
39
45
|
sub: string;
|
|
@@ -76,7 +82,15 @@ type DevicePollResult = {
|
|
|
76
82
|
* `error` for terminal failures.
|
|
77
83
|
*/
|
|
78
84
|
export declare function pollDeviceToken(tokenEndpoint: string, client: RegisteredClient, deviceCode: string): Promise<DevicePollResult>;
|
|
79
|
-
|
|
85
|
+
/**
|
|
86
|
+
* RFC 6749 §6 refresh grant. `options.resource` MUST carry the RFC 8707
|
|
87
|
+
* indicator the grant was minted with: the Lobu issuer compares it against the
|
|
88
|
+
* resource stored on the refresh row and answers `invalid_grant` when it is
|
|
89
|
+
* absent or different, so a resource-scoped login cannot be renewed without it.
|
|
90
|
+
*/
|
|
91
|
+
export declare function refreshTokens(tokenEndpoint: string, client: RegisteredClient, refreshToken: string, options?: {
|
|
92
|
+
resource?: string;
|
|
93
|
+
}): Promise<TokenResponse | null>;
|
|
80
94
|
export declare function fetchUserInfo(userinfoEndpoint: string, accessToken: string): Promise<UserInfo | null>;
|
|
81
95
|
/** RFC 7009 — best-effort. Network failures are intentionally swallowed. */
|
|
82
96
|
export declare function revokeToken(revocationEndpoint: string, client: RegisteredClient, token: string, hint: "access_token" | "refresh_token"): Promise<void>;
|
|
@@ -130,10 +130,17 @@ export async function pollDeviceToken(tokenEndpoint, client, deviceCode) {
|
|
|
130
130
|
`Token endpoint returned ${body.status}.`,
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
|
-
|
|
133
|
+
/**
|
|
134
|
+
* RFC 6749 §6 refresh grant. `options.resource` MUST carry the RFC 8707
|
|
135
|
+
* indicator the grant was minted with: the Lobu issuer compares it against the
|
|
136
|
+
* resource stored on the refresh row and answers `invalid_grant` when it is
|
|
137
|
+
* absent or different, so a resource-scoped login cannot be renewed without it.
|
|
138
|
+
*/
|
|
139
|
+
export async function refreshTokens(tokenEndpoint, client, refreshToken, options = {}) {
|
|
134
140
|
const body = await postJson(tokenEndpoint, withClient(client, {
|
|
135
141
|
grant_type: GRANT_REFRESH_TOKEN,
|
|
136
142
|
refresh_token: refreshToken,
|
|
143
|
+
...(options.resource ? { resource: options.resource } : {}),
|
|
137
144
|
}));
|
|
138
145
|
if (!body.ok || typeof body.data.access_token !== "string")
|
|
139
146
|
return null;
|
|
@@ -182,6 +189,7 @@ function parseTokenResponse(data) {
|
|
|
182
189
|
accessToken,
|
|
183
190
|
refreshToken: pickString(data, "refresh_token"),
|
|
184
191
|
expiresIn: pickNumber(data, "expires_in"),
|
|
192
|
+
resource: pickString(data, "resource"),
|
|
185
193
|
};
|
|
186
194
|
}
|
|
187
195
|
async function postJson(url, body) {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"server": "dist/server.bundle.mjs",
|
|
6
6
|
"embeddingsServer": "dist/embeddings-server.mjs"
|
|
7
7
|
},
|
|
8
|
-
"version": "20.
|
|
8
|
+
"version": "20.2.0",
|
|
9
9
|
"verify": "dist/verify.mjs"
|
|
10
10
|
},
|
|
11
11
|
"device": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"connector": "node_modules/@lobu/cli/dist/commands/connector.js",
|
|
17
17
|
"worker": "node_modules/@lobu/connector-worker/dist/bin.js"
|
|
18
18
|
},
|
|
19
|
-
"version": "20.
|
|
19
|
+
"version": "20.2.0",
|
|
20
20
|
"verify": "dist/verify.mjs"
|
|
21
21
|
},
|
|
22
22
|
"postgres": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"entries": {
|
|
25
25
|
"postgres": "dist/index.mjs"
|
|
26
26
|
},
|
|
27
|
-
"version": "20.
|
|
27
|
+
"version": "20.2.0",
|
|
28
28
|
"verify": "dist/verify.mjs"
|
|
29
29
|
},
|
|
30
30
|
"embeddings": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"entries": {
|
|
33
33
|
"embeddings": "dist/embeddings.js"
|
|
34
34
|
},
|
|
35
|
-
"version": "20.
|
|
35
|
+
"version": "20.2.0",
|
|
36
36
|
"verify": "dist/verify.mjs"
|
|
37
37
|
}
|
|
38
38
|
}
|
package/vendor/cli/package.json
CHANGED
|
@@ -40,6 +40,38 @@ type ProcessGroupOwner = Pick<ChildProcess, 'pid' | 'exitCode' | 'signalCode'>;
|
|
|
40
40
|
* Exported only so the PID-reuse safety invariant has a direct regression test.
|
|
41
41
|
*/
|
|
42
42
|
export declare function signalOwnedPosixProcessGroup(owner: ProcessGroupOwner, signal: NodeJS.Signals, sendSignal?: typeof process.kill): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Count the members of an owned POSIX process group other than the supervisor
|
|
45
|
+
* itself. Used to tell "the command cleaned up after itself" apart from "the
|
|
46
|
+
* command left background work that the group SIGKILL is about to destroy".
|
|
47
|
+
*
|
|
48
|
+
* The supervisor is spawned `detached`, so its pgid equals its pid; every
|
|
49
|
+
* process the command started without deliberately leaving the group shares
|
|
50
|
+
* that pgid. Anything still listed under it once the target has exited is a
|
|
51
|
+
* descendant the caller backgrounded, so reaping it is a caller-visible event
|
|
52
|
+
* rather than routine cleanup (#3629).
|
|
53
|
+
*
|
|
54
|
+
* POSIX exposes no syscall to list a group, and kill(-pgid, 0) cannot answer
|
|
55
|
+
* this because the live supervisor is itself a member and always makes the
|
|
56
|
+
* probe succeed -- so the group has to be enumerated from the process table.
|
|
57
|
+
* On Linux that is read from `/proc`, because the images this daemon ships in
|
|
58
|
+
* are slim ones that carry no `procps`: shelling out to `ps` there would fail
|
|
59
|
+
* with ENOENT and silently report "nothing was reaped" on exactly the hosts
|
|
60
|
+
* this fix is for. `ps` remains the reader everywhere else (macOS dev hosts).
|
|
61
|
+
*
|
|
62
|
+
* Zombies are not survivors. The daemon is PID 1 in the worker image with no
|
|
63
|
+
* init in front of it, and libuv only reaps the children it spawned itself, so
|
|
64
|
+
* a grandchild the command backgrounded and that exited before the command
|
|
65
|
+
* returned is reparented to the daemon and stays a zombie -- still listed
|
|
66
|
+
* under the supervisor's pgid -- for the life of the container. Counting it
|
|
67
|
+
* would fail a run that left nothing running, and would later charge it to an
|
|
68
|
+
* unrelated run when the kernel reuses the pid as a new supervisor's pgid.
|
|
69
|
+
*
|
|
70
|
+
* A failure is reported as "no survivors": this drives a report field, never
|
|
71
|
+
* the cleanup itself, so an unreadable process table must never change what
|
|
72
|
+
* gets killed.
|
|
73
|
+
*/
|
|
74
|
+
export declare function countOwnedGroupSurvivors(owner: ProcessGroupOwner, readProcessTable?: () => string): number;
|
|
43
75
|
/** Ask the supervisor to release its non-reusable group identity and reap it. */
|
|
44
76
|
export declare function releaseSupervisor(proc: ChildProcess, timeoutMs?: number): Promise<boolean>;
|
|
45
77
|
/** Windows has no negative-pid process groups; taskkill supplies bounded tree cleanup. */
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
* share a control-flow surface with POSIX group ownership and Windows tree
|
|
6
6
|
* termination.
|
|
7
7
|
*/
|
|
8
|
-
import { spawn } from 'node:child_process';
|
|
8
|
+
import { execFileSync, spawn } from 'node:child_process';
|
|
9
|
+
import { readFileSync, readdirSync } from 'node:fs';
|
|
9
10
|
const SUPPORTS_PROCESS_GROUPS = process.platform !== 'win32';
|
|
10
11
|
const TREE_TERM_GRACE_MS = 3000;
|
|
11
12
|
const PROCESS_REAP_GRACE_MS = 5000;
|
|
@@ -240,6 +241,106 @@ export function signalOwnedPosixProcessGroup(owner, signal, sendSignal = process
|
|
|
240
241
|
throw err;
|
|
241
242
|
}
|
|
242
243
|
}
|
|
244
|
+
/**
|
|
245
|
+
* The process table as `<pid> <pgid> <state>` lines, however this host will
|
|
246
|
+
* give it up. Linux reads `/proc` directly so the daemon depends on no packaged
|
|
247
|
+
* binary; in `/proc/<pid>/stat` the state and pgid are the 1st and 3rd fields
|
|
248
|
+
* after the `)` that closes comm, and they are read from there because a
|
|
249
|
+
* process name may itself contain spaces or brackets.
|
|
250
|
+
*/
|
|
251
|
+
function defaultProcessTableReader() {
|
|
252
|
+
if (process.platform === 'linux') {
|
|
253
|
+
const lines = [];
|
|
254
|
+
for (const entry of readdirSync('/proc')) {
|
|
255
|
+
if (!/^\d+$/.test(entry))
|
|
256
|
+
continue;
|
|
257
|
+
let stat;
|
|
258
|
+
try {
|
|
259
|
+
stat = readFileSync(`/proc/${entry}/stat`, 'utf8');
|
|
260
|
+
}
|
|
261
|
+
catch {
|
|
262
|
+
// The process exited between listing and reading; it is not a survivor.
|
|
263
|
+
continue;
|
|
264
|
+
}
|
|
265
|
+
const afterComm = stat.slice(stat.lastIndexOf(') ') + 2).split(' ');
|
|
266
|
+
// afterComm[0] is state, then ppid, then pgid.
|
|
267
|
+
const state = afterComm[0];
|
|
268
|
+
const pgid = afterComm[2];
|
|
269
|
+
if (pgid)
|
|
270
|
+
lines.push(`${entry} ${pgid} ${state}`);
|
|
271
|
+
}
|
|
272
|
+
return lines.join('\n');
|
|
273
|
+
}
|
|
274
|
+
return execFileSync('ps', ['-A', '-o', 'pid=,pgid=,stat='], {
|
|
275
|
+
encoding: 'utf8',
|
|
276
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
277
|
+
// The default 1 MiB overflows on a busy host, and an overflow throws --
|
|
278
|
+
// which the caller degrades to "no survivors", the silent loss #3629 is
|
|
279
|
+
// here to remove. A line is ~20 bytes; this covers millions of processes.
|
|
280
|
+
maxBuffer: 64 * 1024 * 1024,
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Count the members of an owned POSIX process group other than the supervisor
|
|
285
|
+
* itself. Used to tell "the command cleaned up after itself" apart from "the
|
|
286
|
+
* command left background work that the group SIGKILL is about to destroy".
|
|
287
|
+
*
|
|
288
|
+
* The supervisor is spawned `detached`, so its pgid equals its pid; every
|
|
289
|
+
* process the command started without deliberately leaving the group shares
|
|
290
|
+
* that pgid. Anything still listed under it once the target has exited is a
|
|
291
|
+
* descendant the caller backgrounded, so reaping it is a caller-visible event
|
|
292
|
+
* rather than routine cleanup (#3629).
|
|
293
|
+
*
|
|
294
|
+
* POSIX exposes no syscall to list a group, and kill(-pgid, 0) cannot answer
|
|
295
|
+
* this because the live supervisor is itself a member and always makes the
|
|
296
|
+
* probe succeed -- so the group has to be enumerated from the process table.
|
|
297
|
+
* On Linux that is read from `/proc`, because the images this daemon ships in
|
|
298
|
+
* are slim ones that carry no `procps`: shelling out to `ps` there would fail
|
|
299
|
+
* with ENOENT and silently report "nothing was reaped" on exactly the hosts
|
|
300
|
+
* this fix is for. `ps` remains the reader everywhere else (macOS dev hosts).
|
|
301
|
+
*
|
|
302
|
+
* Zombies are not survivors. The daemon is PID 1 in the worker image with no
|
|
303
|
+
* init in front of it, and libuv only reaps the children it spawned itself, so
|
|
304
|
+
* a grandchild the command backgrounded and that exited before the command
|
|
305
|
+
* returned is reparented to the daemon and stays a zombie -- still listed
|
|
306
|
+
* under the supervisor's pgid -- for the life of the container. Counting it
|
|
307
|
+
* would fail a run that left nothing running, and would later charge it to an
|
|
308
|
+
* unrelated run when the kernel reuses the pid as a new supervisor's pgid.
|
|
309
|
+
*
|
|
310
|
+
* A failure is reported as "no survivors": this drives a report field, never
|
|
311
|
+
* the cleanup itself, so an unreadable process table must never change what
|
|
312
|
+
* gets killed.
|
|
313
|
+
*/
|
|
314
|
+
export function countOwnedGroupSurvivors(owner, readProcessTable = defaultProcessTableReader) {
|
|
315
|
+
if (!SUPPORTS_PROCESS_GROUPS ||
|
|
316
|
+
owner.pid == null ||
|
|
317
|
+
owner.exitCode !== null ||
|
|
318
|
+
owner.signalCode !== null) {
|
|
319
|
+
return 0;
|
|
320
|
+
}
|
|
321
|
+
const pgid = owner.pid;
|
|
322
|
+
let table;
|
|
323
|
+
try {
|
|
324
|
+
table = readProcessTable();
|
|
325
|
+
}
|
|
326
|
+
catch {
|
|
327
|
+
return 0;
|
|
328
|
+
}
|
|
329
|
+
let survivors = 0;
|
|
330
|
+
for (const line of table.split('\n')) {
|
|
331
|
+
const [pidField, pgidField, stateField] = line.trim().split(/\s+/);
|
|
332
|
+
if (Number(pgidField) !== pgid)
|
|
333
|
+
continue;
|
|
334
|
+
// The supervisor is the anchor, not a survivor; the daemon always reaps it.
|
|
335
|
+
if (Number(pidField) === pgid)
|
|
336
|
+
continue;
|
|
337
|
+
// `Z` from /proc and from `ps -o stat=` alike: already dead, nothing to reap.
|
|
338
|
+
if (stateField?.startsWith('Z'))
|
|
339
|
+
continue;
|
|
340
|
+
survivors += 1;
|
|
341
|
+
}
|
|
342
|
+
return survivors;
|
|
343
|
+
}
|
|
243
344
|
/** Ask the supervisor to release its non-reusable group identity and reap it. */
|
|
244
345
|
export async function releaseSupervisor(proc, timeoutMs = 1000) {
|
|
245
346
|
if (proc.exitCode !== null || proc.signalCode !== null)
|
|
@@ -21,6 +21,14 @@ function describeShellFailure(output) {
|
|
|
21
21
|
if (output.exit_signal) {
|
|
22
22
|
return `Shell command terminated by ${output.exit_signal}`;
|
|
23
23
|
}
|
|
24
|
+
// After the failures that name their own cause -- a signal death that also
|
|
25
|
+
// left survivors is reported as the signal death, with `reaped_descendants`
|
|
26
|
+
// still on the output -- but before the exit-code default: a reaped run
|
|
27
|
+
// exits 0, so falling through would report "exited with code 0" as the
|
|
28
|
+
// reason it failed, the silent loss #3629 exists to remove.
|
|
29
|
+
if (output.reaped_descendants) {
|
|
30
|
+
return `Shell command exited with code ${output.exit_code} but left background processes running in its process group; they were killed when the command returned. A command's background work does not outlive the call -- hand a durable process to a host service manager instead.`;
|
|
31
|
+
}
|
|
24
32
|
return `Shell command exited with code ${output.exit_code}`;
|
|
25
33
|
}
|
|
26
34
|
/**
|
|
@@ -14,7 +14,19 @@ export interface ShellRunOutput {
|
|
|
14
14
|
exit_signal?: NodeJS.Signals;
|
|
15
15
|
process_error?: string;
|
|
16
16
|
process_error_code?: string;
|
|
17
|
-
process_stage?: TargetExit['stage'] | 'timeout' | 'shutdown';
|
|
17
|
+
process_stage?: TargetExit['stage'] | 'timeout' | 'shutdown' | 'descendants_reaped';
|
|
18
|
+
/**
|
|
19
|
+
* Set when the command exited while background work it started was still
|
|
20
|
+
* running inside the owned process group, and that work was therefore killed
|
|
21
|
+
* during cleanup. Absent -- never `false` -- on the ordinary path, so the
|
|
22
|
+
* field only ever appears when there is something to report.
|
|
23
|
+
*
|
|
24
|
+
* Scoped to a run that ended by its own exit. A timeout or a shutdown kills
|
|
25
|
+
* the group while the command is still IN it, so the group cannot be told
|
|
26
|
+
* apart from the work it backgrounded there; those paths already fail with
|
|
27
|
+
* `timeout`/`shutdown` as the named cause.
|
|
28
|
+
*/
|
|
29
|
+
reaped_descendants?: boolean;
|
|
18
30
|
success: boolean;
|
|
19
31
|
timed_out: boolean;
|
|
20
32
|
duration_ms: number;
|
|
@@ -18,11 +18,22 @@
|
|
|
18
18
|
* This runs in the daemon's own process, so it REPLACES the environment rather
|
|
19
19
|
* than inheriting it: an inherited env would hand the command the daemon's
|
|
20
20
|
* credentials.
|
|
21
|
+
*
|
|
22
|
+
* LIFETIME: a run owns a process group for the duration of the call and no
|
|
23
|
+
* longer. Everything still in that group when the command returns is killed,
|
|
24
|
+
* which is what keeps a daemon from leaking processes, and it means `&`,
|
|
25
|
+
* `nohup` and `setsid` do not buy a caller a surviving daemon. That cleanup is
|
|
26
|
+
* deliberate; what was a bug (#3629) is doing it QUIETLY -- a run used to
|
|
27
|
+
* report exit 0 while the poller it had just launched was being killed, so the
|
|
28
|
+
* loss surfaced as an unrelated failure much later. A run that leaves
|
|
29
|
+
* background work now reports `reaped_descendants` and fails. Callers that
|
|
30
|
+
* need a durable process hand it to a host service manager; this contract
|
|
31
|
+
* deliberately offers no detached-lifetime primitive.
|
|
21
32
|
*/
|
|
22
33
|
import { existsSync } from 'node:fs';
|
|
23
34
|
import { homedir } from 'node:os';
|
|
24
35
|
import { isAbsolute } from 'node:path';
|
|
25
|
-
import { releaseSupervisor, signalOwnedPosixProcessGroup, spawnSupervisedCli, terminateChild, } from '../automation-process.js';
|
|
36
|
+
import { countOwnedGroupSurvivors, releaseSupervisor, signalOwnedPosixProcessGroup, spawnSupervisedCli, terminateChild, } from '../automation-process.js';
|
|
26
37
|
/**
|
|
27
38
|
* A caller-supplied argument the builtin rejects before spawning anything.
|
|
28
39
|
* Distinguishes an input fault from a runtime one so the caller can classify
|
|
@@ -111,6 +122,7 @@ export async function runShellBuiltin(input, shutdownSignal) {
|
|
|
111
122
|
let stdout = '';
|
|
112
123
|
let stderr = '';
|
|
113
124
|
let timedOut = false;
|
|
125
|
+
let reapedDescendants = false;
|
|
114
126
|
let settled = false;
|
|
115
127
|
let finishing = false;
|
|
116
128
|
let timeoutTimer;
|
|
@@ -145,12 +157,23 @@ export async function runShellBuiltin(input, shutdownSignal) {
|
|
|
145
157
|
...(outcome.errorCode
|
|
146
158
|
? { process_error_code: outcome.errorCode }
|
|
147
159
|
: {}),
|
|
160
|
+
// A real lifecycle stage (a signal death, a spawn failure) wins over
|
|
161
|
+
// the reaped marker: the marker is only the stage of a run that would
|
|
162
|
+
// otherwise have reported none, and `reaped_descendants` carries the
|
|
163
|
+
// fact either way.
|
|
148
164
|
...(outcome.stage !== 'target_exit' ||
|
|
149
165
|
outcome.signalCode ||
|
|
150
166
|
outcome.error
|
|
151
167
|
? { process_stage: outcome.stage }
|
|
152
|
-
:
|
|
168
|
+
: reapedDescendants
|
|
169
|
+
? { process_stage: 'descendants_reaped' }
|
|
170
|
+
: {}),
|
|
171
|
+
...(reapedDescendants ? { reaped_descendants: true } : {}),
|
|
172
|
+
// Killing work the caller deliberately backgrounded is not a success,
|
|
173
|
+
// whatever the shell's own exit code said. Reporting it as one is the
|
|
174
|
+
// whole of #3629: the caller banked a launch that no longer exists.
|
|
153
175
|
success: !timedOut &&
|
|
176
|
+
!reapedDescendants &&
|
|
154
177
|
outcome.exitCode === 0 &&
|
|
155
178
|
outcome.signalCode === null &&
|
|
156
179
|
outcome.error === null,
|
|
@@ -231,6 +254,9 @@ export async function runShellBuiltin(input, shutdownSignal) {
|
|
|
231
254
|
// created it: signalling a numeric PGID we no longer own risks hitting a
|
|
232
255
|
// reused one, so ownership ending is the end of our reach.
|
|
233
256
|
if (process.platform !== 'win32') {
|
|
257
|
+
// Ask BEFORE the group SIGKILL: afterwards there is nothing left to
|
|
258
|
+
// count, and the caller would be told a clean exit either way.
|
|
259
|
+
reapedDescendants = countOwnedGroupSurvivors(child) > 0;
|
|
234
260
|
try {
|
|
235
261
|
if (child.pid == null ||
|
|
236
262
|
!signalOwnedPosixProcessGroup(child, 'SIGKILL')) {
|
|
@@ -17,6 +17,13 @@ export interface OAuthClientInfo {
|
|
|
17
17
|
tokenEndpoint?: string;
|
|
18
18
|
revocationEndpoint?: string;
|
|
19
19
|
userinfoEndpoint?: string;
|
|
20
|
+
/**
|
|
21
|
+
* RFC 8707 resource indicator this grant was minted for (e.g.
|
|
22
|
+
* `https://app.lobu.ai/mcp/<workspace>`). Recorded at login so every later
|
|
23
|
+
* refresh can replay it — the issuer rejects a resource-scoped refresh that
|
|
24
|
+
* omits or changes the indicator.
|
|
25
|
+
*/
|
|
26
|
+
resource?: string;
|
|
20
27
|
}
|
|
21
28
|
/**
|
|
22
29
|
* The auth-relevant fields every stored credential carries. Consumers may store
|
|
@@ -74,9 +81,17 @@ export interface RefreshedToken {
|
|
|
74
81
|
* body). Returns null on any network / non-2xx / parse failure. The issuer may
|
|
75
82
|
* rotate the refresh token, so callers MUST persist the returned `refreshToken`
|
|
76
83
|
* when present.
|
|
84
|
+
*
|
|
85
|
+
* When the grant was minted for a specific protected resource, `options.resource`
|
|
86
|
+
* MUST be the one recorded at authorization time. The Lobu issuer compares the
|
|
87
|
+
* refresh request's indicator against the stored one and answers `invalid_grant`
|
|
88
|
+
* on any mismatch — including an omitted indicator — so a resource-scoped
|
|
89
|
+
* credential that refreshes without it can never be renewed.
|
|
77
90
|
*/
|
|
78
91
|
export declare function refreshOAuthToken(tokenEndpoint: string, client: {
|
|
79
92
|
clientId: string;
|
|
80
93
|
clientSecret?: string;
|
|
81
|
-
}, refreshToken: string
|
|
94
|
+
}, refreshToken: string, options?: {
|
|
95
|
+
resource?: string;
|
|
96
|
+
}): Promise<RefreshedToken | null>;
|
|
82
97
|
//# sourceMappingURL=credentials.d.ts.map
|
|
@@ -133,8 +133,14 @@ function credentialCanRefresh(cred) {
|
|
|
133
133
|
* body). Returns null on any network / non-2xx / parse failure. The issuer may
|
|
134
134
|
* rotate the refresh token, so callers MUST persist the returned `refreshToken`
|
|
135
135
|
* when present.
|
|
136
|
+
*
|
|
137
|
+
* When the grant was minted for a specific protected resource, `options.resource`
|
|
138
|
+
* MUST be the one recorded at authorization time. The Lobu issuer compares the
|
|
139
|
+
* refresh request's indicator against the stored one and answers `invalid_grant`
|
|
140
|
+
* on any mismatch — including an omitted indicator — so a resource-scoped
|
|
141
|
+
* credential that refreshes without it can never be renewed.
|
|
136
142
|
*/
|
|
137
|
-
async function refreshOAuthToken(tokenEndpoint, client, refreshToken) {
|
|
143
|
+
async function refreshOAuthToken(tokenEndpoint, client, refreshToken, options = {}) {
|
|
138
144
|
const body = {
|
|
139
145
|
grant_type: "refresh_token",
|
|
140
146
|
refresh_token: refreshToken,
|
|
@@ -142,6 +148,9 @@ async function refreshOAuthToken(tokenEndpoint, client, refreshToken) {
|
|
|
142
148
|
};
|
|
143
149
|
if (client.clientSecret)
|
|
144
150
|
body.client_secret = client.clientSecret;
|
|
151
|
+
// RFC 8707: echo the authorized resource so the issuer's audience check passes.
|
|
152
|
+
if (options.resource)
|
|
153
|
+
body.resource = options.resource;
|
|
145
154
|
let response;
|
|
146
155
|
try {
|
|
147
156
|
response = await fetch(tokenEndpoint, {
|