@fastagent-sh/fastagent 0.21.1 → 0.22.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/README.md +9 -12
- package/dist/agent.d.ts +24 -37
- package/dist/agent.js +7 -15
- package/dist/atomic-write.d.ts +13 -17
- package/dist/atomic-write.js +18 -29
- package/dist/bind.d.ts +12 -22
- package/dist/bind.js +18 -27
- package/dist/channel.d.ts +11 -33
- package/dist/channels/agentcore-limits.d.ts +2 -13
- package/dist/channels/agentcore-limits.js +2 -13
- package/dist/channels/agentcore-protocol.d.ts +67 -58
- package/dist/channels/agentcore-protocol.js +23 -15
- package/dist/channels/agentcore-service.d.ts +19 -33
- package/dist/channels/agentcore-service.js +176 -59
- package/dist/channels/agentcore.d.ts +39 -33
- package/dist/channels/agentcore.js +90 -224
- package/dist/channels/body.d.ts +15 -2
- package/dist/channels/body.js +24 -2
- package/dist/channels/busy.d.ts +1 -21
- package/dist/channels/busy.js +2 -39
- package/dist/channels/control.d.ts +17 -62
- package/dist/channels/control.js +74 -182
- package/dist/channels/define-channel.d.ts +39 -0
- package/dist/channels/define-channel.js +9 -0
- package/dist/channels/discover.d.ts +10 -31
- package/dist/channels/discover.js +37 -31
- package/dist/channels/feishu/bootstrap-token.d.ts +1 -8
- package/dist/channels/feishu/bootstrap-token.js +7 -23
- package/dist/channels/feishu/card.d.ts +14 -28
- package/dist/channels/feishu/card.js +16 -30
- package/dist/channels/feishu/cloud.d.ts +1 -5
- package/dist/channels/feishu/context-buffer.d.ts +4 -23
- package/dist/channels/feishu/context-buffer.js +8 -31
- package/dist/channels/feishu/crypto.d.ts +10 -5
- package/dist/channels/feishu/crypto.js +12 -19
- package/dist/channels/feishu/feishu-api.d.ts +2 -1
- package/dist/channels/feishu/feishu-api.js +5 -4
- package/dist/channels/feishu/feishu.d.ts +4 -10
- package/dist/channels/feishu/feishu.js +113 -227
- package/dist/channels/feishu/invoke-turn.d.ts +5 -4
- package/dist/channels/feishu/invoke-turn.js +36 -54
- package/dist/channels/feishu/model.d.ts +4 -21
- package/dist/channels/feishu/model.js +1 -8
- package/dist/channels/feishu/normalize.d.ts +2 -10
- package/dist/channels/feishu/normalize.js +7 -42
- package/dist/channels/feishu/parse.d.ts +9 -29
- package/dist/channels/feishu/parse.js +8 -26
- package/dist/channels/feishu/preview.d.ts +12 -14
- package/dist/channels/feishu/preview.js +108 -207
- package/dist/channels/feishu/register-app.d.ts +8 -23
- package/dist/channels/feishu/register-app.js +7 -20
- package/dist/channels/feishu/register-webhook.d.ts +2 -9
- package/dist/channels/feishu/register-webhook.js +9 -33
- package/dist/channels/feishu/scaffold/channel.ts +27 -19
- package/dist/channels/feishu/scaffold/channel.websocket.ts +31 -0
- package/dist/channels/feishu/setup-mode.d.ts +11 -36
- package/dist/channels/feishu/setup-mode.js +7 -26
- package/dist/channels/feishu/ws-ingress.d.ts +1 -2
- package/dist/channels/feishu/ws-ingress.js +6 -8
- package/dist/channels/http.d.ts +15 -15
- package/dist/channels/http.js +19 -9
- package/dist/channels/kit/attachment-path.d.ts +4 -5
- package/dist/channels/kit/attachment-path.js +10 -34
- package/dist/channels/kit/context-buffer.d.ts +14 -21
- package/dist/channels/kit/context-buffer.js +25 -38
- package/dist/channels/kit/delivery.d.ts +35 -0
- package/dist/channels/kit/delivery.js +129 -0
- package/dist/channels/kit/event-stream.d.ts +5 -0
- package/dist/channels/kit/event-stream.js +29 -0
- package/dist/channels/kit/invoke-turn-kit.d.ts +53 -26
- package/dist/channels/kit/invoke-turn-kit.js +89 -32
- package/dist/channels/kit/preview-kit.d.ts +18 -72
- package/dist/channels/kit/preview-kit.js +22 -88
- package/dist/channels/kit/signature.d.ts +3 -9
- package/dist/channels/kit/signature.js +3 -9
- package/dist/channels/kit/state.d.ts +1 -2
- package/dist/channels/kit/state.js +5 -14
- package/dist/channels/kit/stop-command.d.ts +1 -2
- package/dist/channels/kit/stop-command.js +6 -9
- package/dist/channels/kit/tasks.d.ts +1 -1
- package/dist/channels/kit/tasks.js +8 -21
- package/dist/channels/kit/text.d.ts +2 -16
- package/dist/channels/kit/text.js +23 -31
- package/dist/channels/kit/thread-participants.d.ts +4 -17
- package/dist/channels/kit/thread-participants.js +8 -55
- package/dist/channels/kit/transport.d.ts +26 -0
- package/dist/channels/kit/transport.js +20 -0
- package/dist/channels/kit/turn-queue.d.ts +7 -11
- package/dist/channels/kit/turn-queue.js +21 -39
- package/dist/channels/kit/turn-runner.d.ts +32 -18
- package/dist/channels/kit/turn-runner.js +98 -53
- package/dist/channels/kit/turn-store.d.ts +32 -32
- package/dist/channels/kit/turn-store.js +45 -88
- package/dist/channels/lark/lark.d.ts +1 -5
- package/dist/channels/lark/onboard.d.ts +3 -12
- package/dist/channels/lark/onboard.js +3 -13
- package/dist/channels/lark/scaffold/channel.ts +27 -19
- package/dist/channels/lark/scaffold/channel.websocket.ts +31 -0
- package/dist/channels/registration.d.ts +9 -35
- package/dist/channels/registration.js +6 -37
- package/dist/channels/secret.js +2 -5
- package/dist/channels/serve.d.ts +47 -44
- package/dist/channels/serve.js +165 -101
- package/dist/channels/slack/config-api.d.ts +4 -27
- package/dist/channels/slack/config-api.js +5 -34
- package/dist/channels/slack/context-buffer.d.ts +2 -3
- package/dist/channels/slack/context-buffer.js +5 -5
- package/dist/channels/slack/invoke-turn.d.ts +3 -1
- package/dist/channels/slack/invoke-turn.js +25 -34
- package/dist/channels/slack/manifest.js +1 -3
- package/dist/channels/slack/model.d.ts +1 -2
- package/dist/channels/slack/model.js +1 -1
- package/dist/channels/slack/onboard.d.ts +4 -3
- package/dist/channels/slack/onboard.js +8 -11
- package/dist/channels/slack/onboarding-state.d.ts +3 -5
- package/dist/channels/slack/onboarding-state.js +9 -6
- package/dist/channels/slack/parse.d.ts +4 -13
- package/dist/channels/slack/parse.js +7 -28
- package/dist/channels/slack/preview.d.ts +12 -2
- package/dist/channels/slack/preview.js +292 -269
- package/dist/channels/slack/reaction.d.ts +11 -3
- package/dist/channels/slack/reaction.js +19 -8
- package/dist/channels/slack/register-webhook.js +4 -7
- package/dist/channels/slack/scaffold/channel.ts +20 -13
- package/dist/channels/slack/scaffold/slack-send.ts +2 -2
- package/dist/channels/slack/setup-server.d.ts +1 -5
- package/dist/channels/slack/setup-server.js +1 -5
- package/dist/channels/slack/shared-api.d.ts +1 -4
- package/dist/channels/slack/shared-api.js +2 -13
- package/dist/channels/slack/slack-api.d.ts +2 -1
- package/dist/channels/slack/slack-api.js +6 -4
- package/dist/channels/slack/slack.d.ts +11 -14
- package/dist/channels/slack/slack.js +121 -122
- package/dist/channels/sse.d.ts +1 -1
- package/dist/channels/sse.js +1 -1
- package/dist/channels/telegram/context-buffer.d.ts +7 -22
- package/dist/channels/telegram/context-buffer.js +6 -23
- package/dist/channels/telegram/invoke-turn.d.ts +7 -7
- package/dist/channels/telegram/invoke-turn.js +24 -43
- package/dist/channels/telegram/parse.d.ts +24 -51
- package/dist/channels/telegram/parse.js +32 -84
- package/dist/channels/telegram/preview.d.ts +10 -1
- package/dist/channels/telegram/preview.js +79 -100
- package/dist/channels/telegram/register-webhook.js +5 -23
- package/dist/channels/telegram/scaffold/channel.ts +25 -18
- package/dist/channels/telegram/scaffold/telegram-send.ts +6 -4
- package/dist/channels/telegram/telegram-api.d.ts +4 -3
- package/dist/channels/telegram/telegram-api.js +9 -7
- package/dist/channels/telegram/telegram.d.ts +4 -18
- package/dist/channels/telegram/telegram.js +38 -94
- package/dist/channels/telegram/turn-store.d.ts +11 -14
- package/dist/channels/telegram/turn-store.js +8 -6
- package/dist/channels/wait-health.d.ts +4 -6
- package/dist/channels/wait-health.js +10 -14
- package/dist/cli/add-feishu.d.ts +2 -12
- package/dist/cli/add-feishu.js +24 -71
- package/dist/cli/add-slack.d.ts +5 -3
- package/dist/cli/add-slack.js +53 -76
- package/dist/cli/auth-view.d.ts +2 -16
- package/dist/cli/auth-view.js +2 -16
- package/dist/cli/commands/add.js +25 -40
- package/dist/cli/commands/chat.d.ts +0 -1
- package/dist/cli/commands/chat.js +5 -6
- package/dist/cli/commands/deploy/agentcore.js +60 -65
- package/dist/cli/commands/deploy/docker.js +50 -23
- package/dist/cli/commands/deploy/fly.js +23 -61
- package/dist/cli/commands/deploy/railway.js +23 -18
- package/dist/cli/commands/deploy/shared.d.ts +38 -57
- package/dist/cli/commands/deploy/shared.js +40 -59
- package/dist/cli/commands/deploy.d.ts +10 -27
- package/dist/cli/commands/deploy.js +38 -60
- package/dist/cli/commands/destroy.d.ts +4 -0
- package/dist/cli/commands/destroy.js +56 -0
- package/dist/cli/commands/dev.d.ts +2 -1
- package/dist/cli/commands/dev.js +20 -23
- package/dist/cli/commands/info.d.ts +0 -2
- package/dist/cli/commands/info.js +83 -49
- package/dist/cli/commands/init.d.ts +1 -2
- package/dist/cli/commands/init.js +16 -55
- package/dist/cli/commands/invoke.d.ts +0 -1
- package/dist/cli/commands/invoke.js +5 -7
- package/dist/cli/commands/login.d.ts +2 -1
- package/dist/cli/commands/login.js +33 -38
- package/dist/cli/commands/logs.js +3 -4
- package/dist/cli/commands/models.js +1 -5
- package/dist/cli/commands/routine-run.d.ts +6 -0
- package/dist/cli/commands/routine-run.js +47 -0
- package/dist/cli/commands/routine.d.ts +25 -0
- package/dist/cli/commands/routine.js +122 -0
- package/dist/cli/commands/start.d.ts +31 -3
- package/dist/cli/commands/start.js +131 -81
- package/dist/cli/commands/tool.js +26 -12
- package/dist/cli/fail.d.ts +13 -23
- package/dist/cli/fail.js +20 -23
- package/dist/cli/invoke-stream.d.ts +1 -8
- package/dist/cli/kernel.d.ts +6 -38
- package/dist/cli/kernel.js +14 -77
- package/dist/cli/models-view.d.ts +1 -9
- package/dist/cli/models-view.js +11 -22
- package/dist/cli/program.d.ts +5 -6
- package/dist/cli/program.js +120 -157
- package/dist/cli/serve.d.ts +57 -41
- package/dist/cli/serve.js +94 -121
- package/dist/cli/shared.d.ts +15 -61
- package/dist/cli/shared.js +55 -181
- package/dist/cli.js +1 -8
- package/dist/collect.d.ts +6 -0
- package/dist/collect.js +6 -0
- package/dist/core.d.ts +4 -1
- package/dist/core.js +9 -7
- package/dist/declared-secrets.d.ts +55 -0
- package/dist/declared-secrets.js +88 -0
- package/dist/deploy/agentcore/aws-cli.d.ts +91 -0
- package/dist/deploy/agentcore/aws-cli.js +64 -0
- package/dist/deploy/agentcore/destroy.d.ts +51 -0
- package/dist/deploy/agentcore/destroy.js +273 -0
- package/dist/deploy/agentcore/forwarder.js +28 -79
- package/dist/deploy/agentcore/logs.d.ts +2 -18
- package/dist/deploy/agentcore/logs.js +27 -51
- package/dist/deploy/agentcore/plan.d.ts +85 -105
- package/dist/deploy/agentcore/plan.js +152 -314
- package/dist/deploy/agentcore/run.d.ts +28 -28
- package/dist/deploy/agentcore/run.js +227 -306
- package/dist/deploy/agentcore/zip.d.ts +2 -15
- package/dist/deploy/agentcore/zip.js +3 -17
- package/dist/deploy/build-context.d.ts +21 -0
- package/dist/deploy/build-context.js +137 -0
- package/dist/deploy/channel-ingress.d.ts +26 -39
- package/dist/deploy/channel-ingress.js +57 -28
- package/dist/deploy/container.d.ts +20 -34
- package/dist/deploy/container.js +49 -100
- package/dist/deploy/docker/plan.d.ts +12 -11
- package/dist/deploy/docker/plan.js +43 -24
- package/dist/deploy/docker/run.d.ts +22 -25
- package/dist/deploy/docker/run.js +39 -37
- package/dist/deploy/fly/plan.d.ts +15 -44
- package/dist/deploy/fly/plan.js +41 -73
- package/dist/deploy/fly/run.d.ts +16 -51
- package/dist/deploy/fly/run.js +42 -95
- package/dist/deploy/hosts.d.ts +24 -3
- package/dist/deploy/hosts.js +24 -3
- package/dist/deploy/preflight.d.ts +47 -41
- package/dist/deploy/preflight.js +282 -383
- package/dist/deploy/railway/plan.d.ts +16 -42
- package/dist/deploy/railway/plan.js +42 -60
- package/dist/deploy/railway/run.d.ts +30 -68
- package/dist/deploy/railway/run.js +86 -100
- package/dist/deploy/registration-gate.d.ts +6 -13
- package/dist/deploy/residency.d.ts +37 -0
- package/dist/deploy/residency.js +24 -0
- package/dist/deploy/runner.d.ts +10 -9
- package/dist/deploy/runner.js +7 -18
- package/dist/deploy/secrets.d.ts +40 -41
- package/dist/deploy/secrets.js +117 -103
- package/dist/deploy/workspace.d.ts +50 -0
- package/dist/deploy/workspace.js +197 -0
- package/dist/dev-supervisor.d.ts +1 -9
- package/dist/dev-supervisor.js +21 -64
- package/dist/effect-port.d.ts +50 -0
- package/dist/effect-port.js +77 -0
- package/dist/engines/pi/agent-session-factory.d.ts +50 -69
- package/dist/engines/pi/agent-session-factory.js +249 -146
- package/dist/engines/pi/auth.d.ts +15 -11
- package/dist/engines/pi/auth.js +96 -99
- package/dist/engines/pi/chat.d.ts +1 -5
- package/dist/engines/pi/chat.js +2 -14
- package/dist/engines/pi/config.d.ts +53 -51
- package/dist/engines/pi/config.js +83 -92
- package/dist/engines/pi/create.d.ts +60 -75
- package/dist/engines/pi/create.js +108 -141
- package/dist/engines/pi/definition.d.ts +14 -58
- package/dist/engines/pi/definition.js +21 -85
- package/dist/engines/pi/invoke-session.d.ts +5 -25
- package/dist/engines/pi/invoke-session.js +209 -244
- package/dist/engines/pi/login.d.ts +95 -35
- package/dist/engines/pi/login.js +259 -107
- package/dist/engines/pi/machine.d.ts +31 -0
- package/dist/engines/pi/machine.js +106 -0
- package/dist/engines/pi/models.d.ts +70 -89
- package/dist/engines/pi/models.js +188 -81
- package/dist/engines/pi/open.d.ts +65 -53
- package/dist/engines/pi/open.js +129 -69
- package/dist/engines/pi/report.d.ts +3 -12
- package/dist/engines/pi/report.js +2 -16
- package/dist/engines/pi/search-tools.d.ts +1 -9
- package/dist/engines/pi/search-tools.js +26 -57
- package/dist/engines/pi/service.d.ts +2 -16
- package/dist/engines/pi/service.js +2 -16
- package/dist/engines/pi/session-builder.d.ts +5 -9
- package/dist/engines/pi/session-builder.js +44 -82
- package/dist/engines/pi/session-control.js +286 -269
- package/dist/engines/pi/session-effects.d.ts +14 -0
- package/dist/engines/pi/session-effects.js +30 -0
- package/dist/engines/pi/session-inheritance.d.ts +9 -18
- package/dist/engines/pi/session-inheritance.js +103 -160
- package/dist/engines/pi/session-markers.d.ts +31 -30
- package/dist/engines/pi/session-markers.js +26 -25
- package/dist/engines/pi/session-settings.d.ts +6 -22
- package/dist/engines/pi/session-settings.js +10 -21
- package/dist/engines/pi/session-store.d.ts +26 -92
- package/dist/engines/pi/session-store.js +96 -310
- package/dist/engines/pi/tool-context.d.ts +17 -45
- package/dist/engines/pi/tool-context.js +7 -26
- package/dist/engines/pi/tool.d.ts +45 -36
- package/dist/engines/pi/tool.js +43 -57
- package/dist/engines/pi/turn-kit.d.ts +14 -52
- package/dist/engines/pi/turn-kit.js +18 -67
- package/dist/engines/pi/wake-tool.d.ts +2 -10
- package/dist/engines/pi/wake-tool.js +7 -27
- package/dist/env.d.ts +27 -28
- package/dist/env.js +45 -50
- package/dist/index.js +0 -2
- package/dist/lark.d.ts +1 -2
- package/dist/lark.js +1 -2
- package/dist/loader.d.ts +14 -55
- package/dist/loader.js +24 -43
- package/dist/log.d.ts +2 -12
- package/dist/log.js +3 -24
- package/dist/node.d.ts +2 -15
- package/dist/node.js +2 -18
- package/dist/observe.d.ts +2 -8
- package/dist/open-url.d.ts +1 -1
- package/dist/open-url.js +1 -1
- package/dist/paths.d.ts +70 -134
- package/dist/paths.js +165 -232
- package/dist/pi.d.ts +4 -6
- package/dist/pi.js +3 -3
- package/dist/proxy.d.ts +16 -6
- package/dist/proxy.js +52 -16
- package/dist/runtime.d.ts +18 -12
- package/dist/runtime.js +18 -11
- package/dist/scaffold/add-channel.d.ts +14 -31
- package/dist/scaffold/add-channel.js +48 -112
- package/dist/scaffold/init.d.ts +9 -31
- package/dist/scaffold/init.js +45 -138
- package/dist/scaffold/templates/env.example +6 -4
- package/dist/scaffold/templates/fastagent.config.ts +36 -0
- package/dist/scaffold/templates.d.ts +3 -3
- package/dist/scaffold/templates.js +5 -8
- package/dist/scaffold/vendor-skill.d.ts +2 -5
- package/dist/scaffold/vendor-skill.js +19 -29
- package/dist/schedule/cron.d.ts +9 -5
- package/dist/schedule/cron.js +9 -11
- package/dist/schedule/discover.d.ts +12 -12
- package/dist/schedule/discover.js +43 -34
- package/dist/schedule/routine.d.ts +43 -0
- package/dist/schedule/routine.js +32 -0
- package/dist/schedule/run.d.ts +55 -0
- package/dist/schedule/run.js +146 -0
- package/dist/schedule/scheduler.d.ts +44 -55
- package/dist/schedule/scheduler.js +291 -265
- package/dist/schedule/state.d.ts +105 -10
- package/dist/schedule/state.js +293 -19
- package/dist/schedule/wake-alarm.d.ts +10 -23
- package/dist/schedule/wake-alarm.js +91 -121
- package/dist/schedule/wakeups.d.ts +23 -39
- package/dist/schedule/wakeups.js +33 -75
- package/dist/secrets-gate.d.ts +32 -0
- package/dist/secrets-gate.js +33 -0
- package/dist/service.d.ts +137 -98
- package/dist/service.js +250 -252
- package/dist/session-remote.d.ts +33 -44
- package/dist/session-remote.js +203 -192
- package/dist/session.d.ts +153 -228
- package/dist/session.js +33 -55
- package/dist/tunnel.d.ts +8 -36
- package/dist/tunnel.js +24 -65
- package/dist/version.d.ts +2 -2
- package/dist/version.js +2 -2
- package/package.json +10 -16
- package/dist/channels/agentcore-state.d.ts +0 -77
- package/dist/channels/agentcore-state.js +0 -276
- package/dist/channels/github/github.d.ts +0 -31
- package/dist/channels/github/github.js +0 -89
- package/dist/channels/github/scaffold/channel.ts +0 -25
- package/dist/cli/commands/attach.d.ts +0 -108
- package/dist/cli/commands/attach.js +0 -637
- package/dist/cli/commands/fire.d.ts +0 -7
- package/dist/cli/commands/fire.js +0 -38
- package/dist/cli/commands/schedule.d.ts +0 -12
- package/dist/cli/commands/schedule.js +0 -87
- package/dist/github.d.ts +0 -3
- package/dist/github.js +0 -2
- package/dist/scaffold/templates/fastagent.config.mjs +0 -23
- package/dist/schedule/audit.d.ts +0 -18
- package/dist/schedule/audit.js +0 -57
- package/dist/schedule/schedule.d.ts +0 -35
- package/dist/schedule/schedule.js +0 -23
package/dist/cli/serve.js
CHANGED
|
@@ -1,53 +1,35 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* What `dev` (its worker) and `start` need beyond the service itself: binding a port, the shutdown
|
|
3
|
-
* order, the startup report, the optional Cloudflare quick tunnel, and the options the CLI hands the
|
|
4
|
-
* assembly (`cliMountOptions`, `resolveBindHost` — policy ABOUT the assembly, decided per command).
|
|
5
|
-
*
|
|
6
|
-
* The ASSEMBLY itself is not here — it lives in `src/service.ts`, which a public entry may import and
|
|
7
|
-
* this directory may not be (it decides process-level things: `fail.ts` calls `process.exit`).
|
|
8
|
-
*/
|
|
9
|
-
import { mkdirSync, rmSync } from "node:fs";
|
|
10
|
-
import { join } from "node:path";
|
|
1
|
+
/** What `dev` (its worker) and `start` need beyond the service itself. */
|
|
11
2
|
import { INVOKE_EXAMPLE_BODY } from "../channels/http.js";
|
|
12
|
-
import { answersLocalhost,
|
|
13
|
-
import {
|
|
3
|
+
import { answersLocalhost, bindLabel, classifyBind, clientHost } from "../bind.js";
|
|
4
|
+
import { describeAnonymousSurface, } from "../service.js";
|
|
14
5
|
import { serveNode } from "../channels/serve.js";
|
|
15
6
|
import { log } from "../log.js";
|
|
16
7
|
import { openExternalUrl } from "../open-url.js";
|
|
17
8
|
import { declaredChannels } from "../channels/discover.js";
|
|
18
9
|
import { announceWebhooks, startCloudflareTunnel } from "../tunnel.js";
|
|
19
10
|
import { failStartup, failUsage } from "./fail.js";
|
|
20
|
-
/**
|
|
21
|
-
|
|
22
|
-
* (the dev supervisor's tunnel too), so anything outside `127.0.0.1`/`::1`/wildcard — including a
|
|
23
|
-
* `127.0.0.2` bind, loopback though it is — would leave the tunnel up and 502ing every request.
|
|
24
|
-
* Checked BEFORE the bind (the flag alone pre-spawn in `dev`, again once config is loaded, since
|
|
25
|
-
* `http.host` can carry the address), so the failure is clean rather than a live-but-broken public URL.
|
|
26
|
-
* `source` decides the exit code, per fail.ts: a flag COMBINATION is a usage error (2), a value that
|
|
27
|
-
* came from config is broken runtime configuration (1).
|
|
28
|
-
*/
|
|
29
|
-
export function assertTunnelBindable(host, tunnel, source) {
|
|
11
|
+
/** Refuse `--tunnel` with a `--bind` that cloudflared cannot reach. */
|
|
12
|
+
export function assertTunnelBindable(host, tunnel) {
|
|
30
13
|
if (!tunnel || answersLocalhost(host))
|
|
31
14
|
return;
|
|
32
|
-
|
|
33
|
-
// to drop, so flag-only wording would send the reader looking for something they never typed.
|
|
34
|
-
const fix = source === "flag"
|
|
35
|
-
? "bind 0.0.0.0 (or 127.0.0.1), or drop --tunnel"
|
|
36
|
-
: "set http.host to 0.0.0.0 (or 127.0.0.1) in fastagent.config.*, override it with --bind, or drop --tunnel";
|
|
37
|
-
const message = `--tunnel reaches the serve by dialing localhost, which the bind address ${host} does not answer — ${fix}`;
|
|
38
|
-
if (source === "flag")
|
|
39
|
-
failUsage(message);
|
|
40
|
-
failStartup(new Error(message));
|
|
15
|
+
failUsage(`--tunnel reaches the serve by dialing localhost, which the bind address ${host} does not answer — bind 0.0.0.0 (or 127.0.0.1), or drop --tunnel`);
|
|
41
16
|
}
|
|
42
17
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
18
|
+
* Apply the flags that override what the definition said, for THIS run only.
|
|
19
|
+
*
|
|
20
|
+
* ONE place, because `dev` and `start` both do it and a mapping two call sites must each remember is one a third
|
|
21
|
+
* will not.
|
|
22
|
+
*
|
|
23
|
+
* `--no-invoke` outranks `http.invoke`: a config value travels into a deployed image, so "do not publish a turn
|
|
24
|
+
* endpoint on this tunnel" has to be sayable without editing the definition.
|
|
25
|
+
*
|
|
26
|
+
* It takes `POST /run` WITH it, including over a definition that said `http.run: true`. Both routes start a
|
|
27
|
+
* turn for an anonymous caller, and the flag's whole reason for existing is the case where the definition cannot be
|
|
28
|
+
* edited — `dev --tunnel --no-invoke` leaving the other one published at the tunnel URL would be the flag failing at
|
|
29
|
+
* exactly the job it was added for.
|
|
46
30
|
*/
|
|
47
|
-
export function
|
|
48
|
-
|
|
49
|
-
assertTunnelBindable(host, tunnel, bindFlag ? "flag" : "config");
|
|
50
|
-
return host;
|
|
31
|
+
export function withRunOverrides(opened, run) {
|
|
32
|
+
return run.invoke === false ? { ...opened, http: { ...opened.http, invoke: false, run: false } } : opened;
|
|
51
33
|
}
|
|
52
34
|
/** What the CLI adds to the assembly: its shutdown grace, and exit on a connection that drops. */
|
|
53
35
|
export function cliMountOptions(wrapAgent) {
|
|
@@ -58,111 +40,109 @@ export function cliMountOptions(wrapAgent) {
|
|
|
58
40
|
};
|
|
59
41
|
}
|
|
60
42
|
/**
|
|
61
|
-
* Bind, report, announce the control plane, open the tunnel, and close in order on a signal — the
|
|
62
|
-
*
|
|
43
|
+
* Bind, report, announce the control plane, open the tunnel, and close in order on a signal — the tail dev's worker
|
|
44
|
+
* and start share once the service is assembled.
|
|
63
45
|
*/
|
|
64
46
|
export function serveService(service, bind, posture) {
|
|
65
47
|
const { host } = bind;
|
|
66
48
|
const { tunnel, agentDir, stateRoot } = posture;
|
|
67
|
-
let unannounce = () => { };
|
|
68
49
|
serve(service.handler, bind, {
|
|
69
50
|
ready: service.ready,
|
|
70
51
|
onListening: (p) => {
|
|
71
52
|
reportServing(service, host, p);
|
|
72
|
-
|
|
53
|
+
announceControl(service, { host, tunnel });
|
|
73
54
|
maybeTunnel(agentDir, service.channels.routes, p, tunnel, stateRoot);
|
|
74
55
|
},
|
|
75
|
-
onShutdown: () =>
|
|
76
|
-
unannounce();
|
|
77
|
-
return service.close();
|
|
78
|
-
},
|
|
56
|
+
onShutdown: () => service.close(),
|
|
79
57
|
});
|
|
80
58
|
}
|
|
81
|
-
/**
|
|
82
|
-
* The "we are serving" report: the supervisor message `dev`'s watcher waits for, the addresses, and
|
|
83
|
-
* what mounted. One function because both commands must say the same thing at the same moment —
|
|
84
|
-
* after readiness, never at socket bind.
|
|
85
|
-
*/
|
|
59
|
+
/** The "we are serving" report: the supervisor message `dev`'s watcher waits for, the addresses, and what mounted. */
|
|
86
60
|
export function reportServing(service, host, boundPort) {
|
|
87
61
|
process.send?.({ type: "ready", port: boundPort, routeChannels: service.channels.routes });
|
|
88
|
-
for (const line of readyAddressLines(host, boundPort, service.
|
|
62
|
+
for (const line of readyAddressLines(host, boundPort, service.unverifiedRoutes.includes("POST /invoke"))) {
|
|
89
63
|
log.info(line);
|
|
64
|
+
}
|
|
90
65
|
log.info(`[fastagent] routes: ${Object.keys(service.routes).join(", ") || "(none)"}`);
|
|
91
66
|
if (service.channels.longConnections.length > 0) {
|
|
92
67
|
log.info(`[fastagent] long connections: ${service.channels.longConnections.join(", ")}`);
|
|
93
68
|
}
|
|
94
69
|
}
|
|
70
|
+
/** The line that names WHERE the serve is — every posture reports it, including AgentCore's own surface. */
|
|
71
|
+
export function bindLine(host, boundPort) {
|
|
72
|
+
return `[fastagent] http host on ${classifyBind(host) === "wildcard" ? `:${boundPort} (all interfaces)` : bindLabel(host, boundPort)}`;
|
|
73
|
+
}
|
|
95
74
|
/**
|
|
96
|
-
* The startup lines
|
|
97
|
-
* ONE function because they are one message — they were two, and `--bind` updated the first while the
|
|
98
|
-
* second went on dialing `localhost`, which is precisely what a non-wildcard bind stops answering. Now
|
|
99
|
-
* neither can be changed without the other in view, and the address has a single derivation.
|
|
75
|
+
* The startup lines for a serve of OUR surface: the bind report, and the curl the reader copies.
|
|
100
76
|
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
77
|
+
* `servesInvoke` is `AgentService.unverifiedRoutes`, never a guess from the route table: `http.invoke: false` leaves no
|
|
78
|
+
* `/invoke` to curl, and a channel may serve that path with a protocol of its own — both would turn this line into
|
|
79
|
+
* a copyable request that fails.
|
|
103
80
|
*/
|
|
104
|
-
export function readyAddressLines(host, boundPort,
|
|
81
|
+
export function readyAddressLines(host, boundPort, servesInvoke) {
|
|
105
82
|
const dial = `${clientHost(host)}:${boundPort}`;
|
|
106
|
-
|
|
107
|
-
|
|
83
|
+
return [
|
|
84
|
+
bindLine(host, boundPort),
|
|
85
|
+
...(servesInvoke
|
|
86
|
+
? [
|
|
87
|
+
`[fastagent] try it: curl -s ${dial}/invoke -X POST -H 'content-type: application/json' -d '${INVOKE_EXAMPLE_BODY}'`,
|
|
88
|
+
]
|
|
89
|
+
: []),
|
|
108
90
|
];
|
|
109
|
-
if (builtinInvoke) {
|
|
110
|
-
lines.push(`[fastagent] try it: curl -s ${dial}/invoke -X POST -H 'content-type: application/json' -d '${INVOKE_EXAMPLE_BODY}'`);
|
|
111
|
-
}
|
|
112
|
-
return lines;
|
|
113
91
|
}
|
|
114
92
|
/**
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
93
|
+
* Say what this port exposes and how far it reaches.
|
|
94
|
+
*
|
|
95
|
+
* NOTHING fastagent serves is authenticated — authentication belongs to the deployment (a gateway, a private
|
|
96
|
+
* network, AgentCore's IAM, an embedder's middleware). Two of the three warnings fire at a REACH the operator did
|
|
97
|
+
* not get by default: a bind off this machine, and `--tunnel`'s public URL.
|
|
120
98
|
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
99
|
+
* The cross-origin one is UNCONDITIONAL, including on a loopback `dev`, because the grant is. `*` is the default
|
|
100
|
+
* (`channels/serve.ts`), so a page the developer merely visits can drive this port from their browser and read the
|
|
101
|
+
* reply, loopback bind or not. Nobody opts into a default, so the one posture the decision costs is the one that
|
|
102
|
+
* has to hear about it.
|
|
103
|
+
*
|
|
104
|
+
* WHAT IS EXPOSED is read off `AgentService.unverifiedRoutes`, never assumed and never guessed from the route table.
|
|
105
|
+
* `POST /invoke` is on most serves but not all: AgentCore answers the Runtime's `/invocations` behind IAM,
|
|
106
|
+
* `http.invoke: false` withholds it, and a channel may serve that path itself — in which case the caller it is
|
|
107
|
+
* open to is the platform that signs its requests, not anyone at all. A warning naming an endpoint this process
|
|
108
|
+
* does not serve is how an operator learns to skim past all of them — the same reason `preflightDeploy` takes
|
|
109
|
+
* `publicUrl`.
|
|
123
110
|
*/
|
|
124
|
-
export function announceControl(
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
111
|
+
export function announceControl(service, bind) {
|
|
112
|
+
const { controlPrefix, corsOrigins } = service;
|
|
113
|
+
if (controlPrefix)
|
|
114
|
+
log.info(`[fastagent] session control on ${controlPrefix}/*`);
|
|
115
|
+
// What an unauthenticated caller of this port can do, worst first. From `unverifiedRoutes`, so a channel that serves
|
|
116
|
+
// `/invoke` itself is not described as our unauthenticated data plane — it has its own signature check.
|
|
117
|
+
const exposed = describeAnonymousSurface({
|
|
118
|
+
invoke: service.unverifiedRoutes.includes("POST /invoke"),
|
|
119
|
+
run: service.unverifiedRoutes.includes("POST /run"),
|
|
120
|
+
...(controlPrefix ? { controlPrefix } : {}),
|
|
121
|
+
});
|
|
122
|
+
if (exposed.length === 0)
|
|
123
|
+
return; // nothing of ours answers here (the AgentCore adapter's surface)
|
|
124
|
+
const what = `${exposed.join(" and ")} ${exposed.length > 1 ? "answer" : "answers"}`;
|
|
125
|
+
if (corsOrigins === undefined || corsOrigins.includes("*")) {
|
|
126
|
+
log.warn(`[fastagent] any web page your browser visits can call this serve cross-origin and read the reply: ${what} ` +
|
|
127
|
+
"with no credential. That is the default (`*`); pin the origins you actually use with http.cors " +
|
|
128
|
+
"(docs/design/session-control.md §14)");
|
|
129
|
+
}
|
|
135
130
|
const reach = classifyBind(bind.host);
|
|
136
131
|
if (reach !== "loopback") {
|
|
137
132
|
log.warn(`[fastagent] the port binds ${reach === "wildcard" ? "all interfaces" : `${bind.host} (off this machine)`}: ` +
|
|
138
|
-
|
|
139
|
-
"
|
|
133
|
+
`${what} UNAUTHENTICATED to anyone who can reach it — bind loopback (--bind 127.0.0.1), ` +
|
|
134
|
+
"firewall the port, or front it with a gateway (docs/design/session-control.md §14)");
|
|
140
135
|
}
|
|
141
136
|
if (bind.tunnel) {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
"protected ONLY by the bearer token — wrap it with real auth before sharing that URL (docs/design/session-control.md §14)");
|
|
137
|
+
log.warn(`[fastagent] --tunnel publishes this port at a public URL with NO authentication: ${what} to anyone with ` +
|
|
138
|
+
"that URL — put real auth in front before sharing it (docs/design/session-control.md §14)");
|
|
145
139
|
}
|
|
146
|
-
return () => {
|
|
147
|
-
try {
|
|
148
|
-
rmSync(path, { force: true });
|
|
149
|
-
}
|
|
150
|
-
catch {
|
|
151
|
-
/* the file is advisory — shutdown must not fail on it */
|
|
152
|
-
}
|
|
153
|
-
};
|
|
154
140
|
}
|
|
155
|
-
/** What the CLI gives a service to stop in, and the hard exit that follows it.
|
|
156
|
-
* a forced exit before the service answers would report a clean shutdown over a stuck channel. */
|
|
141
|
+
/** What the CLI gives a service to stop in, and the hard exit that follows it. */
|
|
157
142
|
const SHUTDOWN_GRACE_MS = 800;
|
|
158
143
|
const FORCED_EXIT_MS = 1_500;
|
|
159
|
-
/**
|
|
160
|
-
|
|
161
|
-
* socket is not a serving agent while a declared long-connection channel is still dialling, so this
|
|
162
|
-
* awaits `hooks.ready` (mountAgentService owns the connections themselves) before announcing
|
|
163
|
-
* anything. Signals are the sole clean-shutdown command; `host` unset binds all interfaces.
|
|
164
|
-
*/
|
|
165
|
-
function serve(handler, bind, hooks = {}) {
|
|
144
|
+
/** Bind HTTP and report ready — but only once the SERVICE is, which is not the same moment. */
|
|
145
|
+
export function serve(handler, bind, hooks = {}) {
|
|
166
146
|
const { port, host } = bind;
|
|
167
147
|
const hosted = serveNode(handler, { port, host });
|
|
168
148
|
let stopping = false;
|
|
@@ -170,21 +150,15 @@ function serve(handler, bind, hooks = {}) {
|
|
|
170
150
|
if (stopping)
|
|
171
151
|
return;
|
|
172
152
|
stopping = true;
|
|
173
|
-
// Bounded: shutdown must not hang on a channel that will not close, so the deadline fires
|
|
174
|
-
// regardless. No drain — an in-flight turn is cut, which is the existing contract.
|
|
175
|
-
// Later than the service's own close deadline (SHUTDOWN_GRACE_MS below), or the process leaves
|
|
176
|
-
// at 0 before `close()` has said a channel would not stop.
|
|
153
|
+
// Bounded: shutdown must not hang on a channel that will not close, so the deadline fires regardless.
|
|
177
154
|
const deadline = setTimeout(() => {
|
|
178
155
|
log.error(`[fastagent] shutdown did not finish within ${FORCED_EXIT_MS}ms; exiting`);
|
|
179
156
|
process.exit(1);
|
|
180
157
|
}, FORCED_EXIT_MS);
|
|
181
|
-
// Stop accepting FIRST, before anything is awaited.
|
|
182
|
-
// close, and a socket still listening through that wait would dispatch new work into channels
|
|
183
|
-
// and a scheduler that are already shutting down.
|
|
158
|
+
// Stop accepting FIRST, before anything is awaited.
|
|
184
159
|
const closingServer = hosted.close();
|
|
185
160
|
hosted.closeAllConnections();
|
|
186
|
-
// A cleanup that failed is not a clean exit
|
|
187
|
-
// and swallowing it here would end the process at 0 over a resource still holding on.
|
|
161
|
+
// A cleanup that failed is not a clean exit.
|
|
188
162
|
void Promise.allSettled([closingServer, Promise.resolve(hooks.onShutdown?.())]).then((outcomes) => {
|
|
189
163
|
let code = exitCode;
|
|
190
164
|
for (const outcome of outcomes) {
|
|
@@ -201,9 +175,9 @@ function serve(handler, bind, hooks = {}) {
|
|
|
201
175
|
process.once("SIGTERM", () => stop(0));
|
|
202
176
|
hosted.listening.then(async (boundPort) => {
|
|
203
177
|
try {
|
|
204
|
-
// A bound socket is NOT a serving agent: a declared socket-mode channel still has to come
|
|
205
|
-
//
|
|
206
|
-
//
|
|
178
|
+
// A bound socket is NOT a serving agent: a declared socket-mode channel still has to come up, and reporting
|
|
179
|
+
// ready before it does tells the supervisor (and --tunnel, and the operator) that a surface is live while a
|
|
180
|
+
// channel is dead.
|
|
207
181
|
await hooks.ready;
|
|
208
182
|
if (stopping)
|
|
209
183
|
return;
|
|
@@ -214,13 +188,12 @@ function serve(handler, bind, hooks = {}) {
|
|
|
214
188
|
}
|
|
215
189
|
}, (error) => {
|
|
216
190
|
if (error.code === "EADDRINUSE") {
|
|
217
|
-
// With a bind address the port is only taken ON THAT interface, so moving the bind is as valid
|
|
218
|
-
//
|
|
191
|
+
// With a bind address the port is only taken ON THAT interface, so moving the bind is as valid a fix as
|
|
192
|
+
// moving the port.
|
|
219
193
|
failStartup(new Error(`${bindLabel(host, port)} is already in use; choose another with ` +
|
|
220
194
|
`--port${classifyBind(host) === "wildcard" ? "" : " or --bind"}`));
|
|
221
195
|
}
|
|
222
|
-
// Through `bindLabel`, like every other message about a bind
|
|
223
|
-
// for an IPv6 bind and a bare `:8787` for the wildcard, which reads as an explicit bind of nothing.
|
|
196
|
+
// Through `bindLabel`, like every other message about a bind.
|
|
224
197
|
failStartup(new Error(`cannot bind http channel on ${bindLabel(host, port)}: ${error.message}`));
|
|
225
198
|
});
|
|
226
199
|
}
|
package/dist/cli/shared.d.ts
CHANGED
|
@@ -1,26 +1,19 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type AuthLayers } from "../engines/pi/config.ts";
|
|
2
|
+
import { type LoginIO } from "../engines/pi/login.ts";
|
|
2
3
|
import type { LoadedDefinition } from "../engines/pi/definition.ts";
|
|
3
|
-
import { type ModuleLoadFailure } from "../loader.ts";
|
|
4
4
|
import type { ToolCollision } from "../engines/pi/tool.ts";
|
|
5
|
-
import {
|
|
6
|
-
/**
|
|
7
|
-
* How every command that runs the model enters its agent directory, in the one order that works:
|
|
8
|
-
* placement decides whose `.env` to read; `.env` may carry the proxy and the provider keys the
|
|
9
|
-
* picker's auth probe needs; the picker runs last. Six commands wrote these steps out by hand, and
|
|
10
|
-
* one carried the order as a comment. The result is the placement every later step reads.
|
|
11
|
-
*/
|
|
5
|
+
import type { ResolvedPlacement } from "../paths.ts";
|
|
6
|
+
/** How every command that runs the model enters its agent directory, in the one order that works. */
|
|
12
7
|
export declare function enterAgentCommand(dirArg: string, opts: {
|
|
13
8
|
model?: string;
|
|
14
|
-
authPath?: string;
|
|
15
9
|
input?: boolean;
|
|
16
10
|
}): Promise<ResolvedPlacement>;
|
|
17
|
-
/** What the startup report reads off an opened directory
|
|
18
|
-
* spelled out so this module does not depend on that function's whole shape. */
|
|
11
|
+
/** What the startup report reads off an opened directory. */
|
|
19
12
|
export interface ReportableAssembly {
|
|
20
13
|
agentDir: string;
|
|
21
14
|
workspace: string;
|
|
22
15
|
modelSpec: string;
|
|
23
|
-
|
|
16
|
+
auth: AuthLayers;
|
|
24
17
|
config: {
|
|
25
18
|
thinkingLevel?: string;
|
|
26
19
|
};
|
|
@@ -28,63 +21,24 @@ export interface ReportableAssembly {
|
|
|
28
21
|
toolNames: string[];
|
|
29
22
|
deferredToolNames: string[];
|
|
30
23
|
toolCollisions: ToolCollision[];
|
|
31
|
-
toolFailures: ModuleLoadFailure[];
|
|
32
24
|
}
|
|
33
|
-
/**
|
|
34
|
-
* What `dev` and `start` say about the directory they just opened, in the order they say it.
|
|
35
|
-
*
|
|
36
|
-
* ONE function because it is one report: the two commands wrote it out line by line, and the copies
|
|
37
|
-
* had already diverged over which lines exist at all — `dev` naming the config file, `start` naming
|
|
38
|
-
* state and sessions. A line added to one of two hand-written copies is invisible in the other.
|
|
39
|
-
*
|
|
40
|
-
* The divergence itself is PRESERVED, not resolved: `start`'s `state:`/`sessions:` pair introduces the
|
|
41
|
-
* persistence warnings that follow it in production posture, and `dev`'s `config:` has no counterpart
|
|
42
|
-
* there. Both are passed as explicit extras by the caller, so the asymmetry is visible at the call
|
|
43
|
-
* site rather than buried in two copies of a list. Whether it is RIGHT is a separate question from
|
|
44
|
-
* whether it has one owner.
|
|
45
|
-
*
|
|
46
|
-
* Findings (skill collisions, definition diagnostics) CLOSE the report — they are about the assembly
|
|
47
|
-
* just printed. What a command says next is its own posture talk, not report: `start`'s persistence
|
|
48
|
-
* notes now follow them rather than precede them.
|
|
49
|
-
*/
|
|
25
|
+
/** What `dev` and `start` say about the directory they just opened, in the order they say it. */
|
|
50
26
|
export declare function reportAssembly(a: ReportableAssembly, extras?: {
|
|
51
|
-
/** Printed between `workspace
|
|
27
|
+
/** Printed between `workspace:` and `model:` (`dev` names the config file here). */
|
|
52
28
|
beforeModel?: [label: string, value: string][];
|
|
53
29
|
/** Printed after the tool lines, before findings (`start` names state + sessions here). */
|
|
54
30
|
afterTools?: [label: string, value: string][];
|
|
55
31
|
}): Promise<void>;
|
|
56
32
|
/** Both stdin and stdout are a terminal — the precondition for an interactive prompt. */
|
|
57
33
|
export declare function isInteractive(): boolean;
|
|
58
|
-
/**
|
|
59
|
-
* Parse + range-check a port string (CLI flag or env). Empty/whitespace is "not set" → undefined, so
|
|
60
|
-
* the `??` chain falls through instead of binding port 0 (`Number("")` is 0). The exit code follows
|
|
61
|
-
* RESPONSIBILITY, not the layer that discovers the problem: a bad `--port` is a usage error (2), a
|
|
62
|
-
* bad `PORT` env is broken runtime configuration (1).
|
|
63
|
-
*/
|
|
34
|
+
/** Parse + range-check a port string (CLI flag or env). */
|
|
64
35
|
export declare function parsePort(value: string | undefined, source: string, from: "flag" | "env"): number | undefined;
|
|
65
36
|
/**
|
|
66
|
-
* Parse a `--bind` address: empty/whitespace is "not set" → undefined (the `??` chain falls through to
|
|
67
|
-
*
|
|
68
|
-
* a node bind failure, or worse, as a "the interface you bound" diagnostic downstream.
|
|
37
|
+
* Parse a `--bind` address: empty/whitespace is "not set" → undefined (the `??` chain falls through to config, then
|
|
38
|
+
* all interfaces).
|
|
69
39
|
*/
|
|
70
40
|
export declare function parseBind(value: string | undefined): string | undefined;
|
|
71
|
-
/** Report which source provides the model's credentials, surfacing a remediation hint at startup.
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
export declare function
|
|
75
|
-
/**
|
|
76
|
-
* Interactive login with the api_key quick-fail probe closed into a LOOP: a definitively rejected key
|
|
77
|
-
* (HTTP 401) deletes the bad credential and RE-PROMPTS immediately — the user's hands are on the
|
|
78
|
-
* keyboard NOW; parking the failure for a later `fastagent login` would waste that. The loop exits on
|
|
79
|
-
* a verified/unverifiable key (kept), an OAuth login (completing the flow already proved the
|
|
80
|
-
* credential), or cancel (LoginCancelled propagates to the caller's cancel policy). Used by both the
|
|
81
|
-
* `login` command and the first-run picker's inline login.
|
|
82
|
-
*/
|
|
83
|
-
export declare function loginWithKeyCheck(provider: string | undefined, authPath: string, spec?: string, seams?: {
|
|
84
|
-
flow?: (io: LoginIO, options: {
|
|
85
|
-
provider?: string;
|
|
86
|
-
authPath?: string;
|
|
87
|
-
method?: LoginMethod;
|
|
88
|
-
}) => Promise<LoginResult>;
|
|
89
|
-
verify?: (provider: string, authPath: string, spec?: string) => Promise<"ok" | "rejected" | "unknown">;
|
|
90
|
-
}): Promise<LoginResult>;
|
|
41
|
+
/** Report which source provides the model's credentials, surfacing a remediation hint at startup. */
|
|
42
|
+
export declare function reportAuth(agentDir: string, modelSpec: string, auth: AuthLayers): Promise<void>;
|
|
43
|
+
/** Login terminal IO via @clack/prompts: a searchable list once long, a hidden prompt for keys. */
|
|
44
|
+
export declare function terminalLoginIO(): LoginIO;
|