@autohq/cli 0.1.102 → 0.1.104
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/agent-bridge.js +89 -5
- package/dist/index.js +664 -309
- package/package.json +1 -1
package/dist/agent-bridge.js
CHANGED
|
@@ -19558,7 +19558,17 @@ var RuntimeBridgeBootstrapEnvelopeSchema = external_exports.object({
|
|
|
19558
19558
|
var RuntimeBridgeBootstrapAckSchema = external_exports.object({
|
|
19559
19559
|
status: external_exports.enum(["ready", "failed"]),
|
|
19560
19560
|
error: external_exports.string().trim().min(1).optional(),
|
|
19561
|
-
at: external_exports.string().datetime()
|
|
19561
|
+
at: external_exports.string().datetime(),
|
|
19562
|
+
// The sandbox-baked CLI's own release version (e.g. "0.1.95"), so the
|
|
19563
|
+
// bridge can tag bootstrap observability with the runtime version that is
|
|
19564
|
+
// actually live. Optional because runtimes older than the field predate
|
|
19565
|
+
// reporting it; the bridge logs those as "unknown" instead of failing.
|
|
19566
|
+
cliVersion: external_exports.string().trim().min(1).optional(),
|
|
19567
|
+
// Top-level bootstrap plaintext fields the runtime's tolerant parse
|
|
19568
|
+
// stripped because its schema does not know them yet (worker-ahead skew).
|
|
19569
|
+
// Reported so the bridge can log the degradation instead of it staying
|
|
19570
|
+
// silent.
|
|
19571
|
+
ignoredBootstrapKeys: external_exports.array(external_exports.string().trim().min(1)).optional()
|
|
19562
19572
|
});
|
|
19563
19573
|
var RuntimeBridgeConnectedPayloadSchema = external_exports.object({
|
|
19564
19574
|
runId: SessionRunIdSchema,
|
|
@@ -22584,7 +22594,16 @@ function decryptRuntimeBridgeBootstrap(input) {
|
|
|
22584
22594
|
decipher.update(Buffer.from(envelope.bootstrap.ciphertext, "base64")),
|
|
22585
22595
|
decipher.final()
|
|
22586
22596
|
]).toString("utf8");
|
|
22587
|
-
|
|
22597
|
+
const raw = JSON.parse(plaintext);
|
|
22598
|
+
const bootstrap = RuntimeBridgeBootstrapPlaintextSchema.parse(raw);
|
|
22599
|
+
return { bootstrap, ignoredKeys: ignoredPlaintextKeys(raw) };
|
|
22600
|
+
}
|
|
22601
|
+
function ignoredPlaintextKeys(raw) {
|
|
22602
|
+
const record2 = external_exports.record(external_exports.string(), external_exports.unknown()).parse(raw);
|
|
22603
|
+
const knownKeys = new Set(
|
|
22604
|
+
Object.keys(RuntimeBridgeBootstrapPlaintextSchema.shape)
|
|
22605
|
+
);
|
|
22606
|
+
return Object.keys(record2).filter((key) => !knownKeys.has(key));
|
|
22588
22607
|
}
|
|
22589
22608
|
function deriveBootstrapKey(accessToken, salt) {
|
|
22590
22609
|
return Buffer.from(
|
|
@@ -26161,6 +26180,61 @@ Object.assign(lookup, {
|
|
|
26161
26180
|
connect: lookup
|
|
26162
26181
|
});
|
|
26163
26182
|
|
|
26183
|
+
// package.json
|
|
26184
|
+
var package_default = {
|
|
26185
|
+
name: "@autohq/cli",
|
|
26186
|
+
version: "0.1.104",
|
|
26187
|
+
license: "SEE LICENSE IN README.md",
|
|
26188
|
+
publishConfig: {
|
|
26189
|
+
access: "public"
|
|
26190
|
+
},
|
|
26191
|
+
repository: {
|
|
26192
|
+
type: "git",
|
|
26193
|
+
url: "git+https://github.com/fractal-works/auto.git",
|
|
26194
|
+
directory: "apps/cli"
|
|
26195
|
+
},
|
|
26196
|
+
engines: {
|
|
26197
|
+
node: ">=20"
|
|
26198
|
+
},
|
|
26199
|
+
type: "module",
|
|
26200
|
+
bin: {
|
|
26201
|
+
auto: "./dist/index.js"
|
|
26202
|
+
},
|
|
26203
|
+
files: ["dist"],
|
|
26204
|
+
scripts: {
|
|
26205
|
+
build: "tsup",
|
|
26206
|
+
dev: "tsx src/main.ts",
|
|
26207
|
+
"dev:tui": "node ../../scripts/cli-tui-dev-watch.mjs",
|
|
26208
|
+
"skill:generate": "tsx scripts/generate-skill-content.ts",
|
|
26209
|
+
test: "npm run test:unit",
|
|
26210
|
+
"test:unit": 'tsx --test "test/**/*.unit.test.ts"',
|
|
26211
|
+
typecheck: "tsc --noEmit"
|
|
26212
|
+
},
|
|
26213
|
+
dependencies: {
|
|
26214
|
+
"@anthropic-ai/claude-agent-sdk": "^0.3.153",
|
|
26215
|
+
"@inkjs/ui": "^2.0.0",
|
|
26216
|
+
"@tanstack/react-query": "^5.100.14",
|
|
26217
|
+
chalk: "^5.3.0",
|
|
26218
|
+
commander: "^14.0.2",
|
|
26219
|
+
ink: "^7",
|
|
26220
|
+
"ink-text-input": "^6.0.0",
|
|
26221
|
+
jose: "^5.9.6",
|
|
26222
|
+
marked: "^15.0.12",
|
|
26223
|
+
react: "^19",
|
|
26224
|
+
"socket.io-client": "^4.8.3",
|
|
26225
|
+
yaml: "^2.9.0"
|
|
26226
|
+
},
|
|
26227
|
+
devDependencies: {
|
|
26228
|
+
"@auto/protocol": "*",
|
|
26229
|
+
"@auto/schemas": "*",
|
|
26230
|
+
"@types/react": "^19",
|
|
26231
|
+
tsup: "^8.5.1"
|
|
26232
|
+
}
|
|
26233
|
+
};
|
|
26234
|
+
|
|
26235
|
+
// src/cli/version.ts
|
|
26236
|
+
var cliVersion = package_default.version;
|
|
26237
|
+
|
|
26164
26238
|
// src/commands/agent-bridge/socket.ts
|
|
26165
26239
|
async function runAgentBridgeSocket(options) {
|
|
26166
26240
|
const socket = lookup(`${options.bridgeUrl}${RUNTIME_BRIDGE_NAMESPACE}`, {
|
|
@@ -26296,13 +26370,18 @@ function createRuntimeBridgeBootstrapListener(input) {
|
|
|
26296
26370
|
bridgeLeaseId: envelope.bridgeLeaseId
|
|
26297
26371
|
});
|
|
26298
26372
|
const decryptStartedAt = Date.now();
|
|
26299
|
-
const bootstrap = decryptRuntimeBridgeBootstrap({
|
|
26373
|
+
const { bootstrap, ignoredKeys } = decryptRuntimeBridgeBootstrap({
|
|
26300
26374
|
accessToken: input.token,
|
|
26301
26375
|
envelope
|
|
26302
26376
|
});
|
|
26303
26377
|
input.writeOutput?.(
|
|
26304
26378
|
`agent_bridge_bootstrap_decrypted duration_ms=${Date.now() - decryptStartedAt}`
|
|
26305
26379
|
);
|
|
26380
|
+
if (ignoredKeys.length > 0) {
|
|
26381
|
+
input.writeOutput?.(
|
|
26382
|
+
`agent_bridge_bootstrap_ignored_keys cli_version=${cliVersion} keys=${ignoredKeys.join(",")}`
|
|
26383
|
+
);
|
|
26384
|
+
}
|
|
26306
26385
|
await input.onBootstrap?.(bootstrap);
|
|
26307
26386
|
let handler = input.getHandler();
|
|
26308
26387
|
if (!handler) {
|
|
@@ -26318,7 +26397,9 @@ function createRuntimeBridgeBootstrapListener(input) {
|
|
|
26318
26397
|
ack?.(
|
|
26319
26398
|
RuntimeBridgeBootstrapAckSchema.parse({
|
|
26320
26399
|
status: "ready",
|
|
26321
|
-
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
26400
|
+
at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
26401
|
+
cliVersion,
|
|
26402
|
+
ignoredBootstrapKeys: ignoredKeys.length > 0 ? ignoredKeys : void 0
|
|
26322
26403
|
})
|
|
26323
26404
|
);
|
|
26324
26405
|
prepare?.then(
|
|
@@ -26344,7 +26425,10 @@ function createRuntimeBridgeBootstrapListener(input) {
|
|
|
26344
26425
|
RuntimeBridgeBootstrapAckSchema.parse({
|
|
26345
26426
|
status: "failed",
|
|
26346
26427
|
error: message,
|
|
26347
|
-
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
26428
|
+
at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
26429
|
+
// Version skew is a leading cause of bootstrap failure, so failed
|
|
26430
|
+
// acks carry the version that could not bootstrap.
|
|
26431
|
+
cliVersion
|
|
26348
26432
|
})
|
|
26349
26433
|
);
|
|
26350
26434
|
input.onBootstrapError(error51);
|