@indigoai-us/hq-cli 5.115.6 → 5.117.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/CHANGELOG.md +169 -11
- package/dist/command-catalog.generated.d.ts +220 -2
- package/dist/command-catalog.generated.js +281 -2
- package/dist/command-registration-plan.d.ts +6 -0
- package/dist/command-registration-plan.js +1 -0
- package/dist/commands/agent-enroll.d.ts +105 -0
- package/dist/commands/agent-enroll.js +273 -0
- package/dist/commands/agent-kit.d.ts +53 -0
- package/dist/commands/agent-kit.js +260 -0
- package/dist/commands/agent-mcp.d.ts +22 -0
- package/dist/commands/agent-mcp.js +104 -0
- package/dist/commands/agent-probe.d.ts +71 -0
- package/dist/commands/agent-probe.js +294 -0
- package/dist/commands/agent.d.ts +12 -0
- package/dist/commands/agent.js +23 -0
- package/dist/commands/agents.d.ts +27 -0
- package/dist/commands/agents.js +280 -6
- package/dist/commands/bot.d.ts +140 -1
- package/dist/commands/bot.js +757 -22
- package/dist/commands/secrets.js +17 -5
- package/dist/lib/agent-kit/creds.d.ts +60 -0
- package/dist/lib/agent-kit/creds.js +123 -0
- package/dist/lib/agent-kit/kit-config.d.ts +29 -0
- package/dist/lib/agent-kit/kit-config.js +54 -0
- package/dist/lib/agent-kit/log.d.ts +17 -0
- package/dist/lib/agent-kit/log.js +46 -0
- package/dist/lib/agent-kit/mcp/jsonrpc.d.ts +84 -0
- package/dist/lib/agent-kit/mcp/jsonrpc.js +164 -0
- package/dist/lib/agent-kit/mcp/tools.d.ts +45 -0
- package/dist/lib/agent-kit/mcp/tools.js +280 -0
- package/dist/lib/agent-kit/paths.d.ts +42 -0
- package/dist/lib/agent-kit/paths.js +56 -0
- package/dist/lib/agent-kit/run/heartbeat.d.ts +52 -0
- package/dist/lib/agent-kit/run/heartbeat.js +97 -0
- package/dist/lib/agent-kit/run/inbox.d.ts +59 -0
- package/dist/lib/agent-kit/run/inbox.js +152 -0
- package/dist/lib/agent-kit/run/mesh-listener.d.ts +58 -0
- package/dist/lib/agent-kit/run/mesh-listener.js +193 -0
- package/dist/lib/agent-kit/run/sync.d.ts +33 -0
- package/dist/lib/agent-kit/run/sync.js +58 -0
- package/dist/lib/agent-kit/services.d.ts +21 -0
- package/dist/lib/agent-kit/services.js +46 -0
- package/dist/lib/agent-kit/skills.d.ts +18 -0
- package/dist/lib/agent-kit/skills.js +149 -0
- package/dist/lib/bot/api.d.ts +51 -0
- package/dist/lib/bot/api.js +32 -0
- package/dist/lib/bot/daemon.d.ts +17 -0
- package/dist/lib/bot/daemon.js +44 -3
- package/dist/lib/bot/index.d.ts +4 -0
- package/dist/lib/bot/index.js +4 -0
- package/dist/lib/bot/inflight.d.ts +14 -0
- package/dist/lib/bot/local-config.d.ts +70 -0
- package/dist/lib/bot/local-config.js +147 -0
- package/dist/lib/bot/local-name.d.ts +54 -0
- package/dist/lib/bot/local-name.js +114 -0
- package/dist/lib/bot/run.d.ts +9 -0
- package/dist/lib/bot/run.js +117 -24
- package/dist/lib/bot/runnable.d.ts +51 -0
- package/dist/lib/bot/runnable.js +65 -0
- package/dist/lib/bot/self-heal.d.ts +52 -0
- package/dist/lib/bot/self-heal.js +79 -0
- package/dist/lib/bot/split.d.ts +32 -0
- package/dist/lib/bot/split.js +241 -0
- package/dist/lib/service-manager/index.d.ts +43 -0
- package/dist/lib/service-manager/index.js +114 -0
- package/dist/lib/service-manager/launchd.d.ts +23 -0
- package/dist/lib/service-manager/launchd.js +81 -0
- package/dist/lib/service-manager/systemd.d.ts +19 -0
- package/dist/lib/service-manager/systemd.js +72 -0
- package/dist/lib/service-manager/types.d.ts +32 -0
- package/dist/lib/service-manager/types.js +26 -0
- package/dist/utils/self-update.js +2 -30
- package/dist/utils/update-command-supervisor.cjs +194 -0
- package/dist/utils/version-gate.d.ts +18 -0
- package/dist/utils/version-gate.js +126 -7
- package/package.json +2 -2
|
@@ -4979,10 +4979,10 @@ export const COMMAND_CATALOG = [
|
|
|
4979
4979
|
"description": "Show an agent's setup state and runtime detail",
|
|
4980
4980
|
"aliases": [],
|
|
4981
4981
|
"hidden": false,
|
|
4982
|
-
"usage": "[options] <
|
|
4982
|
+
"usage": "[options] <agent>",
|
|
4983
4983
|
"arguments": [
|
|
4984
4984
|
{
|
|
4985
|
-
"name": "
|
|
4985
|
+
"name": "agent",
|
|
4986
4986
|
"required": true,
|
|
4987
4987
|
"variadic": false
|
|
4988
4988
|
}
|
|
@@ -5205,6 +5205,60 @@ export const COMMAND_CATALOG = [
|
|
|
5205
5205
|
],
|
|
5206
5206
|
"subcommands": []
|
|
5207
5207
|
},
|
|
5208
|
+
{
|
|
5209
|
+
"name": "rotate",
|
|
5210
|
+
"description": "Issue a fresh enrollment code for an external agent (old secret + host key stop minting)",
|
|
5211
|
+
"aliases": [],
|
|
5212
|
+
"hidden": false,
|
|
5213
|
+
"usage": "[options] <agentUid>",
|
|
5214
|
+
"arguments": [
|
|
5215
|
+
{
|
|
5216
|
+
"name": "agentUid",
|
|
5217
|
+
"required": true,
|
|
5218
|
+
"variadic": false
|
|
5219
|
+
}
|
|
5220
|
+
],
|
|
5221
|
+
"options": [
|
|
5222
|
+
{
|
|
5223
|
+
"flags": "--company <slug>",
|
|
5224
|
+
"description": "Company slug (resolves to companyUid)"
|
|
5225
|
+
},
|
|
5226
|
+
{
|
|
5227
|
+
"flags": "--json",
|
|
5228
|
+
"description": "Emit raw JSON (code included — pipe carefully)"
|
|
5229
|
+
}
|
|
5230
|
+
],
|
|
5231
|
+
"subcommands": []
|
|
5232
|
+
},
|
|
5233
|
+
{
|
|
5234
|
+
"name": "revoke",
|
|
5235
|
+
"description": "Revoke an external agent: disable its login and drop it from the team",
|
|
5236
|
+
"aliases": [],
|
|
5237
|
+
"hidden": false,
|
|
5238
|
+
"usage": "[options] <agentUid>",
|
|
5239
|
+
"arguments": [
|
|
5240
|
+
{
|
|
5241
|
+
"name": "agentUid",
|
|
5242
|
+
"required": true,
|
|
5243
|
+
"variadic": false
|
|
5244
|
+
}
|
|
5245
|
+
],
|
|
5246
|
+
"options": [
|
|
5247
|
+
{
|
|
5248
|
+
"flags": "--company <slug>",
|
|
5249
|
+
"description": "Company slug (resolves to companyUid)"
|
|
5250
|
+
},
|
|
5251
|
+
{
|
|
5252
|
+
"flags": "--remove",
|
|
5253
|
+
"description": "Also delete the agent entity (it disappears from the roster)"
|
|
5254
|
+
},
|
|
5255
|
+
{
|
|
5256
|
+
"flags": "--yes",
|
|
5257
|
+
"description": "Confirm the revoke (required)"
|
|
5258
|
+
}
|
|
5259
|
+
],
|
|
5260
|
+
"subcommands": []
|
|
5261
|
+
},
|
|
5208
5262
|
{
|
|
5209
5263
|
"name": "jobs",
|
|
5210
5264
|
"description": "List, pause, or cancel an agent's scheduled jobs",
|
|
@@ -5295,6 +5349,155 @@ export const COMMAND_CATALOG = [
|
|
|
5295
5349
|
}
|
|
5296
5350
|
]
|
|
5297
5351
|
},
|
|
5352
|
+
{
|
|
5353
|
+
"name": "agent",
|
|
5354
|
+
"description": "Enroll and run this host as an external HQ agent",
|
|
5355
|
+
"aliases": [],
|
|
5356
|
+
"hidden": false,
|
|
5357
|
+
"usage": "[options] [command]",
|
|
5358
|
+
"arguments": [],
|
|
5359
|
+
"options": [],
|
|
5360
|
+
"subcommands": [
|
|
5361
|
+
{
|
|
5362
|
+
"name": "enroll",
|
|
5363
|
+
"description": "Enroll this host as an external HQ agent using a one-time code",
|
|
5364
|
+
"aliases": [],
|
|
5365
|
+
"hidden": false,
|
|
5366
|
+
"usage": "[options] <code>",
|
|
5367
|
+
"arguments": [
|
|
5368
|
+
{
|
|
5369
|
+
"name": "code",
|
|
5370
|
+
"required": true,
|
|
5371
|
+
"variadic": false
|
|
5372
|
+
}
|
|
5373
|
+
],
|
|
5374
|
+
"options": [
|
|
5375
|
+
{
|
|
5376
|
+
"flags": "--company <slug>",
|
|
5377
|
+
"description": "Expected company slug (warns when the code belongs elsewhere)"
|
|
5378
|
+
},
|
|
5379
|
+
{
|
|
5380
|
+
"flags": "--replace",
|
|
5381
|
+
"description": "Overwrite an existing machine identity on this host"
|
|
5382
|
+
},
|
|
5383
|
+
{
|
|
5384
|
+
"flags": "--api-base-url <url>",
|
|
5385
|
+
"description": "hq-pro control plane (default: HQ_VAULT_API_URL or production)"
|
|
5386
|
+
}
|
|
5387
|
+
],
|
|
5388
|
+
"subcommands": []
|
|
5389
|
+
},
|
|
5390
|
+
{
|
|
5391
|
+
"name": "kit",
|
|
5392
|
+
"description": "Install, inspect, or run the external-agent background services",
|
|
5393
|
+
"aliases": [],
|
|
5394
|
+
"hidden": false,
|
|
5395
|
+
"usage": "[options] [command]",
|
|
5396
|
+
"arguments": [],
|
|
5397
|
+
"options": [],
|
|
5398
|
+
"subcommands": [
|
|
5399
|
+
{
|
|
5400
|
+
"name": "install",
|
|
5401
|
+
"description": "Install sync, work-mesh, inbox and heartbeat services plus the skills directory",
|
|
5402
|
+
"aliases": [],
|
|
5403
|
+
"hidden": false,
|
|
5404
|
+
"usage": "[options]",
|
|
5405
|
+
"arguments": [],
|
|
5406
|
+
"options": [
|
|
5407
|
+
{
|
|
5408
|
+
"flags": "--hq-root <path>",
|
|
5409
|
+
"description": "Local HQ tree to sync the company vault into (default: ~/.hq-agent/hq)"
|
|
5410
|
+
},
|
|
5411
|
+
{
|
|
5412
|
+
"flags": "--inbox-ack",
|
|
5413
|
+
"description": "Ack mirrored inbox items on the server (default: leave acking to the bot)"
|
|
5414
|
+
},
|
|
5415
|
+
{
|
|
5416
|
+
"flags": "--no-activate",
|
|
5417
|
+
"description": "Write unit files but do not load them"
|
|
5418
|
+
},
|
|
5419
|
+
{
|
|
5420
|
+
"flags": "--json",
|
|
5421
|
+
"description": "Print machine-readable JSON"
|
|
5422
|
+
}
|
|
5423
|
+
],
|
|
5424
|
+
"subcommands": []
|
|
5425
|
+
},
|
|
5426
|
+
{
|
|
5427
|
+
"name": "status",
|
|
5428
|
+
"description": "Show whether each kit service is installed and running",
|
|
5429
|
+
"aliases": [],
|
|
5430
|
+
"hidden": false,
|
|
5431
|
+
"usage": "[options]",
|
|
5432
|
+
"arguments": [],
|
|
5433
|
+
"options": [
|
|
5434
|
+
{
|
|
5435
|
+
"flags": "--json",
|
|
5436
|
+
"description": "Print machine-readable JSON"
|
|
5437
|
+
}
|
|
5438
|
+
],
|
|
5439
|
+
"subcommands": []
|
|
5440
|
+
},
|
|
5441
|
+
{
|
|
5442
|
+
"name": "uninstall",
|
|
5443
|
+
"description": "Stop and remove the kit services (credentials and skills are kept)",
|
|
5444
|
+
"aliases": [],
|
|
5445
|
+
"hidden": false,
|
|
5446
|
+
"usage": "[options]",
|
|
5447
|
+
"arguments": [],
|
|
5448
|
+
"options": [
|
|
5449
|
+
{
|
|
5450
|
+
"flags": "--json",
|
|
5451
|
+
"description": "Print machine-readable JSON"
|
|
5452
|
+
}
|
|
5453
|
+
],
|
|
5454
|
+
"subcommands": []
|
|
5455
|
+
},
|
|
5456
|
+
{
|
|
5457
|
+
"name": "run",
|
|
5458
|
+
"description": "Run one kit service in the foreground (sync|mesh|inbox|heartbeat)",
|
|
5459
|
+
"aliases": [],
|
|
5460
|
+
"hidden": false,
|
|
5461
|
+
"usage": "[options] <service>",
|
|
5462
|
+
"arguments": [
|
|
5463
|
+
{
|
|
5464
|
+
"name": "service",
|
|
5465
|
+
"required": true,
|
|
5466
|
+
"variadic": false
|
|
5467
|
+
}
|
|
5468
|
+
],
|
|
5469
|
+
"options": [],
|
|
5470
|
+
"subcommands": []
|
|
5471
|
+
}
|
|
5472
|
+
]
|
|
5473
|
+
},
|
|
5474
|
+
{
|
|
5475
|
+
"name": "probe",
|
|
5476
|
+
"description": "Verify identity, vault sync, work-mesh presence, DMs and secrets; report to the console",
|
|
5477
|
+
"aliases": [],
|
|
5478
|
+
"hidden": false,
|
|
5479
|
+
"usage": "[options]",
|
|
5480
|
+
"arguments": [],
|
|
5481
|
+
"options": [
|
|
5482
|
+
{
|
|
5483
|
+
"flags": "--json",
|
|
5484
|
+
"description": "Print machine-readable JSON"
|
|
5485
|
+
}
|
|
5486
|
+
],
|
|
5487
|
+
"subcommands": []
|
|
5488
|
+
},
|
|
5489
|
+
{
|
|
5490
|
+
"name": "mcp",
|
|
5491
|
+
"description": "Serve HQ as a stdio MCP server for the bot framework (whoami, search, files, secrets-exec, dm, inbox, work-mesh)",
|
|
5492
|
+
"aliases": [],
|
|
5493
|
+
"hidden": false,
|
|
5494
|
+
"usage": "[options]",
|
|
5495
|
+
"arguments": [],
|
|
5496
|
+
"options": [],
|
|
5497
|
+
"subcommands": []
|
|
5498
|
+
}
|
|
5499
|
+
]
|
|
5500
|
+
},
|
|
5298
5501
|
{
|
|
5299
5502
|
"name": "outposts",
|
|
5300
5503
|
"description": "Manage your personal HQ Outposts (EC2 boxes)",
|
|
@@ -8034,6 +8237,78 @@ export const COMMAND_CATALOG = [
|
|
|
8034
8237
|
"usage": "[options]",
|
|
8035
8238
|
"arguments": [],
|
|
8036
8239
|
"options": [
|
|
8240
|
+
{
|
|
8241
|
+
"flags": "--remote",
|
|
8242
|
+
"description": "List the local bots your HQ account owns instead, with a here column saying which are set up on this computer"
|
|
8243
|
+
},
|
|
8244
|
+
{
|
|
8245
|
+
"flags": "--json",
|
|
8246
|
+
"description": "Print machine-readable JSON"
|
|
8247
|
+
}
|
|
8248
|
+
],
|
|
8249
|
+
"subcommands": []
|
|
8250
|
+
},
|
|
8251
|
+
{
|
|
8252
|
+
"name": "adopt",
|
|
8253
|
+
"description": "Bring a bot you already own back to this computer: new machine credentials, its saved settings, worker folder, and startup agent",
|
|
8254
|
+
"aliases": [],
|
|
8255
|
+
"hidden": false,
|
|
8256
|
+
"usage": "[options] <name>",
|
|
8257
|
+
"arguments": [
|
|
8258
|
+
{
|
|
8259
|
+
"name": "name",
|
|
8260
|
+
"required": true,
|
|
8261
|
+
"variadic": false
|
|
8262
|
+
}
|
|
8263
|
+
],
|
|
8264
|
+
"options": [
|
|
8265
|
+
{
|
|
8266
|
+
"flags": "--runtime <runtime>",
|
|
8267
|
+
"description": "Model CLI to run it with, overriding its saved one: claude|codex|grok"
|
|
8268
|
+
},
|
|
8269
|
+
{
|
|
8270
|
+
"flags": "--model <model>",
|
|
8271
|
+
"description": "Model override passed to the runtime CLI, replacing its saved one"
|
|
8272
|
+
},
|
|
8273
|
+
{
|
|
8274
|
+
"flags": "--no-daemon",
|
|
8275
|
+
"description": "Do not install the launchd agent (macOS)"
|
|
8276
|
+
},
|
|
8277
|
+
{
|
|
8278
|
+
"flags": "--no-start",
|
|
8279
|
+
"description": "Bring it back without starting it"
|
|
8280
|
+
},
|
|
8281
|
+
{
|
|
8282
|
+
"flags": "--json",
|
|
8283
|
+
"description": "Print machine-readable JSON"
|
|
8284
|
+
}
|
|
8285
|
+
],
|
|
8286
|
+
"subcommands": []
|
|
8287
|
+
},
|
|
8288
|
+
{
|
|
8289
|
+
"name": "restore",
|
|
8290
|
+
"description": "Bring back every local bot your HQ account owns that is not set up on this computer (after a reinstall, or on a new Mac)",
|
|
8291
|
+
"aliases": [],
|
|
8292
|
+
"hidden": false,
|
|
8293
|
+
"usage": "[options]",
|
|
8294
|
+
"arguments": [],
|
|
8295
|
+
"options": [
|
|
8296
|
+
{
|
|
8297
|
+
"flags": "--all",
|
|
8298
|
+
"description": "Also re-issue credentials and reinstall the startup agent for the bots already set up here"
|
|
8299
|
+
},
|
|
8300
|
+
{
|
|
8301
|
+
"flags": "--dry-run",
|
|
8302
|
+
"description": "Show what would be brought back, change nothing"
|
|
8303
|
+
},
|
|
8304
|
+
{
|
|
8305
|
+
"flags": "--no-daemon",
|
|
8306
|
+
"description": "Do not install the launchd agents (macOS)"
|
|
8307
|
+
},
|
|
8308
|
+
{
|
|
8309
|
+
"flags": "--no-start",
|
|
8310
|
+
"description": "Bring them back without starting them"
|
|
8311
|
+
},
|
|
8037
8312
|
{
|
|
8038
8313
|
"flags": "--json",
|
|
8039
8314
|
"description": "Print machine-readable JSON"
|
|
@@ -8184,6 +8459,10 @@ export const COMMAND_CATALOG = [
|
|
|
8184
8459
|
"flags": "-y, --yes",
|
|
8185
8460
|
"description": "Skip the confirmation prompt"
|
|
8186
8461
|
},
|
|
8462
|
+
{
|
|
8463
|
+
"flags": "--remote",
|
|
8464
|
+
"description": "When the bot's local settings are already gone, also delete the bot HQ still has under that name"
|
|
8465
|
+
},
|
|
8187
8466
|
{
|
|
8188
8467
|
"flags": "--json",
|
|
8189
8468
|
"description": "Print machine-readable JSON"
|
|
@@ -340,6 +340,12 @@ export declare const REGISTRATION_PLAN: readonly [{
|
|
|
340
340
|
readonly parent: "program";
|
|
341
341
|
readonly module: "./commands/agents.js";
|
|
342
342
|
readonly exportName: "registerAgentsCommand";
|
|
343
|
+
}, {
|
|
344
|
+
readonly type: "registrar";
|
|
345
|
+
readonly root: "agent";
|
|
346
|
+
readonly parent: "program";
|
|
347
|
+
readonly module: "./commands/agent.js";
|
|
348
|
+
readonly exportName: "registerAgentCommand";
|
|
343
349
|
}, {
|
|
344
350
|
readonly type: "registrar";
|
|
345
351
|
readonly root: "outposts";
|
|
@@ -59,6 +59,7 @@ export const REGISTRATION_PLAN = [
|
|
|
59
59
|
{ type: "registrar", root: "crm", parent: "program", module: "./commands/crm.js", exportName: "registerCrmCommand" },
|
|
60
60
|
{ type: "registrar", root: "company", parent: "program", module: "./commands/company.js", exportName: "registerCompanyCommand" },
|
|
61
61
|
{ type: "registrar", root: "agents", parent: "program", module: "./commands/agents.js", exportName: "registerAgentsCommand" },
|
|
62
|
+
{ type: "registrar", root: "agent", parent: "program", module: "./commands/agent.js", exportName: "registerAgentCommand" },
|
|
62
63
|
{ type: "registrar", root: "outposts", parent: "program", module: "./commands/outposts.js", exportName: "registerOutpostsCommand" },
|
|
63
64
|
{ type: "registrar", root: "billing", parent: "program", module: "./commands/billing.js", exportName: "registerBillingCommand" },
|
|
64
65
|
{ type: "registrar", root: "core", parent: "program", module: "./commands/core.js", exportName: "registerCoreCommands" },
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `hq agent enroll <code>` — turn this host into an external HQ agent.
|
|
3
|
+
*
|
|
4
|
+
* Flow (api-contract v1, POST /v1/agents/enroll):
|
|
5
|
+
* 1. refuse if this host already carries an identity (human session file or
|
|
6
|
+
* a machine-creds file) unless --replace
|
|
7
|
+
* 2. generate an Ed25519 key pair at ~/.hq-agent/host-key{,.pub} (0600)
|
|
8
|
+
* 3. POST { code, hostPublicKey, hostInfo } — unauthenticated, one-shot
|
|
9
|
+
* 4. write ~/.hq-agent/machine-creds.json (0600) with runtime "external",
|
|
10
|
+
* hostKeyPath, companySlug and apiBaseUrl
|
|
11
|
+
*
|
|
12
|
+
* The code is single-use and expires 15 minutes after an admin creates it,
|
|
13
|
+
* so every failure names the fix. The human session file is only checked
|
|
14
|
+
* for EXISTENCE — its contents are never read (policy
|
|
15
|
+
* never-extract-stored-session-tokens-to-forge-privileged-calls).
|
|
16
|
+
*/
|
|
17
|
+
import { Command } from "commander";
|
|
18
|
+
import { generateHostKeyPair } from "../lib/agent-kit/creds.js";
|
|
19
|
+
import { type AgentKitPaths } from "../lib/agent-kit/paths.js";
|
|
20
|
+
export declare const ENROLL_PATH = "/v1/agents/enroll";
|
|
21
|
+
/** Canonical code: un-grouped, uppercase (server hashes exactly this). */
|
|
22
|
+
export declare function normalizeEnrollmentCode(raw: string): string;
|
|
23
|
+
/** 24 chars of Crockford base32 (no I, L, O, U). */
|
|
24
|
+
export declare function isWellFormedEnrollmentCode(code: string): boolean;
|
|
25
|
+
export interface HostInfo {
|
|
26
|
+
os: string;
|
|
27
|
+
arch: string;
|
|
28
|
+
hostname: string;
|
|
29
|
+
cliVersion: string;
|
|
30
|
+
}
|
|
31
|
+
export declare function collectHostInfo(): HostInfo;
|
|
32
|
+
export type ExistingIdentity = {
|
|
33
|
+
kind: "none";
|
|
34
|
+
} | {
|
|
35
|
+
kind: "human";
|
|
36
|
+
file: string;
|
|
37
|
+
} | {
|
|
38
|
+
kind: "machine";
|
|
39
|
+
file: string;
|
|
40
|
+
agentUid?: string;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* What identity already lives on this host. Existence checks only: the
|
|
44
|
+
* human token file is never opened.
|
|
45
|
+
*/
|
|
46
|
+
export declare function detectExistingIdentity(paths: Pick<AgentKitPaths, "machineCredsPath" | "home">, env?: NodeJS.ProcessEnv): ExistingIdentity;
|
|
47
|
+
export declare function refusalMessage(existing: ExistingIdentity): string | null;
|
|
48
|
+
export declare class EnrollError extends Error {
|
|
49
|
+
readonly status?: number | undefined;
|
|
50
|
+
readonly code?: string | undefined;
|
|
51
|
+
constructor(message: string, status?: number | undefined, code?: string | undefined);
|
|
52
|
+
}
|
|
53
|
+
/** Map a non-2xx enroll response to an actionable message (contract codes). */
|
|
54
|
+
export declare function mapEnrollFailure(status: number, body: {
|
|
55
|
+
code?: unknown;
|
|
56
|
+
error?: unknown;
|
|
57
|
+
message?: unknown;
|
|
58
|
+
attemptsRemaining?: unknown;
|
|
59
|
+
}, headers?: {
|
|
60
|
+
retryAfter?: string | null;
|
|
61
|
+
}): EnrollError;
|
|
62
|
+
export declare function mapEnrollTransportError(err: unknown, apiBaseUrl: string): EnrollError;
|
|
63
|
+
export interface EnrollResponse {
|
|
64
|
+
agentUid: string;
|
|
65
|
+
companyUid: string;
|
|
66
|
+
companySlug: string;
|
|
67
|
+
credentials: {
|
|
68
|
+
username: string;
|
|
69
|
+
secret: string;
|
|
70
|
+
userPoolId?: string;
|
|
71
|
+
clientId: string;
|
|
72
|
+
region: string;
|
|
73
|
+
entityType: "agent";
|
|
74
|
+
entityUid: string;
|
|
75
|
+
runtime: "external";
|
|
76
|
+
};
|
|
77
|
+
hostFingerprint: string;
|
|
78
|
+
}
|
|
79
|
+
export interface EnrollDeps {
|
|
80
|
+
fetch?: typeof fetch;
|
|
81
|
+
paths?: AgentKitPaths;
|
|
82
|
+
env?: NodeJS.ProcessEnv;
|
|
83
|
+
hostInfo?: HostInfo;
|
|
84
|
+
generateKeyPair?: typeof generateHostKeyPair;
|
|
85
|
+
}
|
|
86
|
+
export interface EnrollOptions {
|
|
87
|
+
code: string;
|
|
88
|
+
company?: string;
|
|
89
|
+
replace?: boolean;
|
|
90
|
+
apiBaseUrl?: string;
|
|
91
|
+
}
|
|
92
|
+
export interface EnrollResult {
|
|
93
|
+
agentUid: string;
|
|
94
|
+
companySlug: string;
|
|
95
|
+
companyUid: string;
|
|
96
|
+
hostFingerprint: string;
|
|
97
|
+
credsPath: string;
|
|
98
|
+
hostKeyPath: string;
|
|
99
|
+
/** Set when --company disagreed with the server's company. */
|
|
100
|
+
companyMismatch?: string;
|
|
101
|
+
}
|
|
102
|
+
/** Pure-ish orchestration so tests can drive it without a TTY or network. */
|
|
103
|
+
export declare function enrollHost(opts: EnrollOptions, deps?: EnrollDeps): Promise<EnrollResult>;
|
|
104
|
+
export declare function registerAgentEnrollCommand(agent: Command): void;
|
|
105
|
+
//# sourceMappingURL=agent-enroll.d.ts.map
|