@fastagent-sh/fastagent 0.12.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/LICENSE +21 -0
- package/README.md +214 -0
- package/dist/agent.d.ts +72 -0
- package/dist/agent.js +14 -0
- package/dist/channels/body.d.ts +9 -0
- package/dist/channels/body.js +29 -0
- package/dist/channels/github/github.d.ts +31 -0
- package/dist/channels/github/github.js +80 -0
- package/dist/channels/github/scaffold/channel.ts +25 -0
- package/dist/channels/http.d.ts +13 -0
- package/dist/channels/http.js +161 -0
- package/dist/channels/respond.d.ts +5 -0
- package/dist/channels/respond.js +3 -0
- package/dist/channels/telegram/context-buffer.d.ts +59 -0
- package/dist/channels/telegram/context-buffer.js +139 -0
- package/dist/channels/telegram/invoke-turn.d.ts +53 -0
- package/dist/channels/telegram/invoke-turn.js +127 -0
- package/dist/channels/telegram/parse.d.ts +160 -0
- package/dist/channels/telegram/parse.js +153 -0
- package/dist/channels/telegram/preview.d.ts +22 -0
- package/dist/channels/telegram/preview.js +266 -0
- package/dist/channels/telegram/register-webhook.d.ts +13 -0
- package/dist/channels/telegram/register-webhook.js +73 -0
- package/dist/channels/telegram/scaffold/channel.ts +25 -0
- package/dist/channels/telegram/scaffold/telegram-send.ts +107 -0
- package/dist/channels/telegram/state.d.ts +9 -0
- package/dist/channels/telegram/state.js +58 -0
- package/dist/channels/telegram/telegram-api.d.ts +77 -0
- package/dist/channels/telegram/telegram-api.js +345 -0
- package/dist/channels/telegram/telegram.d.ts +35 -0
- package/dist/channels/telegram/telegram.js +352 -0
- package/dist/channels/telegram/turn-queue.d.ts +21 -0
- package/dist/channels/telegram/turn-queue.js +47 -0
- package/dist/channels/telegram/turn-store.d.ts +38 -0
- package/dist/channels/telegram/turn-store.js +150 -0
- package/dist/cli-auth.d.ts +24 -0
- package/dist/cli-auth.js +30 -0
- package/dist/cli-models.d.ts +11 -0
- package/dist/cli-models.js +20 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +1288 -0
- package/dist/collect.d.ts +20 -0
- package/dist/collect.js +27 -0
- package/dist/core.d.ts +10 -0
- package/dist/core.js +8 -0
- package/dist/deploy/container.d.ts +56 -0
- package/dist/deploy/container.js +169 -0
- package/dist/deploy/fly/plan.d.ts +65 -0
- package/dist/deploy/fly/plan.js +142 -0
- package/dist/deploy/fly/run.d.ts +51 -0
- package/dist/deploy/fly/run.js +89 -0
- package/dist/deploy/preflight.d.ts +59 -0
- package/dist/deploy/preflight.js +191 -0
- package/dist/deploy/railway/plan.d.ts +48 -0
- package/dist/deploy/railway/plan.js +91 -0
- package/dist/deploy/railway/run.d.ts +81 -0
- package/dist/deploy/railway/run.js +176 -0
- package/dist/deploy/runner.d.ts +18 -0
- package/dist/deploy/runner.js +25 -0
- package/dist/deploy/secrets.d.ts +49 -0
- package/dist/deploy/secrets.js +88 -0
- package/dist/dev-supervisor.d.ts +14 -0
- package/dist/dev-supervisor.js +158 -0
- package/dist/engines/pi/auth.d.ts +17 -0
- package/dist/engines/pi/auth.js +118 -0
- package/dist/engines/pi/channel.d.ts +31 -0
- package/dist/engines/pi/channel.js +113 -0
- package/dist/engines/pi/chat.d.ts +19 -0
- package/dist/engines/pi/chat.js +200 -0
- package/dist/engines/pi/config.d.ts +110 -0
- package/dist/engines/pi/config.js +285 -0
- package/dist/engines/pi/create.d.ts +127 -0
- package/dist/engines/pi/create.js +222 -0
- package/dist/engines/pi/definition.d.ts +72 -0
- package/dist/engines/pi/definition.js +129 -0
- package/dist/engines/pi/harness.d.ts +50 -0
- package/dist/engines/pi/harness.js +41 -0
- package/dist/engines/pi/invoke.d.ts +28 -0
- package/dist/engines/pi/invoke.js +298 -0
- package/dist/engines/pi/login.d.ts +51 -0
- package/dist/engines/pi/login.js +125 -0
- package/dist/engines/pi/models.d.ts +41 -0
- package/dist/engines/pi/models.js +76 -0
- package/dist/engines/pi/report.d.ts +13 -0
- package/dist/engines/pi/report.js +21 -0
- package/dist/engines/pi/sessions.d.ts +15 -0
- package/dist/engines/pi/sessions.js +130 -0
- package/dist/engines/pi/tool-context.d.ts +17 -0
- package/dist/engines/pi/tool-context.js +13 -0
- package/dist/engines/pi/tool.d.ts +45 -0
- package/dist/engines/pi/tool.js +85 -0
- package/dist/engines/pi/wake-tool.d.ts +20 -0
- package/dist/engines/pi/wake-tool.js +110 -0
- package/dist/engines/pi/workspace.d.ts +53 -0
- package/dist/engines/pi/workspace.js +70 -0
- package/dist/env.d.ts +24 -0
- package/dist/env.js +57 -0
- package/dist/github.d.ts +3 -0
- package/dist/github.js +2 -0
- package/dist/host/node.d.ts +41 -0
- package/dist/host/node.js +50 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5 -0
- package/dist/invoke-stream.d.ts +10 -0
- package/dist/invoke-stream.js +26 -0
- package/dist/loader.d.ts +38 -0
- package/dist/loader.js +69 -0
- package/dist/log.d.ts +26 -0
- package/dist/log.js +51 -0
- package/dist/observe.d.ts +12 -0
- package/dist/observe.js +44 -0
- package/dist/pi.d.ts +16 -0
- package/dist/pi.js +12 -0
- package/dist/proxy.d.ts +9 -0
- package/dist/proxy.js +23 -0
- package/dist/runtime.d.ts +26 -0
- package/dist/runtime.js +29 -0
- package/dist/scaffold/add-channel.d.ts +46 -0
- package/dist/scaffold/add-channel.js +227 -0
- package/dist/scaffold/init.d.ts +54 -0
- package/dist/scaffold/init.js +249 -0
- package/dist/scaffold/templates/env.example +24 -0
- package/dist/scaffold/templates/fastagent.config.mjs +19 -0
- package/dist/scaffold/templates/gitignore +8 -0
- package/dist/scaffold/templates/gitignore.agentdir-root +5 -0
- package/dist/scaffold/templates/gitignore.kit +2 -0
- package/dist/scaffold/templates/persona.md +10 -0
- package/dist/scaffold/templates/skills/writing-great-skills/GLOSSARY.md +195 -0
- package/dist/scaffold/templates/skills/writing-great-skills/LICENSE +21 -0
- package/dist/scaffold/templates/skills/writing-great-skills/SKILL.md +82 -0
- package/dist/scaffold/templates/tools/fetch-url.ts +27 -0
- package/dist/scaffold/templates.d.ts +17 -0
- package/dist/scaffold/templates.js +56 -0
- package/dist/scaffold/vendor-skill.d.ts +24 -0
- package/dist/scaffold/vendor-skill.js +157 -0
- package/dist/schedule/audit.d.ts +18 -0
- package/dist/schedule/audit.js +57 -0
- package/dist/schedule/cron.d.ts +7 -0
- package/dist/schedule/cron.js +33 -0
- package/dist/schedule/discover.d.ts +17 -0
- package/dist/schedule/discover.js +64 -0
- package/dist/schedule/schedule.d.ts +35 -0
- package/dist/schedule/schedule.js +23 -0
- package/dist/schedule/scheduler.d.ts +36 -0
- package/dist/schedule/scheduler.js +253 -0
- package/dist/schedule/state.d.ts +14 -0
- package/dist/schedule/state.js +56 -0
- package/dist/schedule/wakeups.d.ts +82 -0
- package/dist/schedule/wakeups.js +196 -0
- package/dist/telegram.d.ts +2 -0
- package/dist/telegram.js +2 -0
- package/dist/tunnel.d.ts +31 -0
- package/dist/tunnel.js +139 -0
- package/dist/version.d.ts +5 -0
- package/dist/version.js +13 -0
- package/dist/workspace.d.ts +9 -0
- package/dist/workspace.js +45 -0
- package/package.json +97 -0
package/dist/cli-auth.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI presenter for the auth-status line `reportAuth` prints (invoke/dev/start). Kept out of cli.ts —
|
|
3
|
+
* which self-executes on import — so the expired-vs-missing DECISION is unit-testable without a real
|
|
4
|
+
* credential round-trip, mirroring cli-models.ts.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Format the auth status for `spec`'s provider. `source` is {@link probeAuthSource}'s label (an env-var
|
|
8
|
+
* name, "OAuth", a stored-key label) or undefined when nothing currently SATISFIES auth. Undefined has
|
|
9
|
+
* TWO causes probeAuthSource can't distinguish (it swallows the throw): nothing stored, OR a credential
|
|
10
|
+
* that IS stored but couldn't be made usable (an expired/revoked OAuth whose refresh failed). `stored`
|
|
11
|
+
* — a refresh-FREE store read the caller does only in that case — tells them apart, so an expired login
|
|
12
|
+
* reports "expired/unusable → `fastagent login`" instead of a misleading "(none found)" (which would then
|
|
13
|
+
* be contradicted by the actual "OAuth refresh failed"). A malformed/unreadable store also reads as
|
|
14
|
+
* undefined `stored` and lands in "(none found)" — but the store's own read warns about the corrupt file,
|
|
15
|
+
* so the real signal is surfaced there; this line stays about credential PRESENCE.
|
|
16
|
+
*/
|
|
17
|
+
export function formatAuthReport(provider, authPath, source, stored) {
|
|
18
|
+
if (source !== undefined)
|
|
19
|
+
return { line: `auth: ${source} (${provider}) — ${authPath}` };
|
|
20
|
+
if (stored) {
|
|
21
|
+
return {
|
|
22
|
+
line: `auth: stored ${provider} ${stored.type}, expired/unusable — ${authPath}`,
|
|
23
|
+
warn: `the "${provider}" login is expired or unusable — run \`fastagent login\` to refresh it`,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
line: `auth: (none found) — ${authPath}`,
|
|
28
|
+
warn: `no credentials for "${provider}" — run \`fastagent login\`, or set the provider's API key in .env; invokes will fail until then`,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI presenter for `fastagent models [search]`: the stdout/stderr output DECISION, kept out of the
|
|
3
|
+
* engine config layer (config.ts owns model resolution / listModels) so this process-boundary behavior
|
|
4
|
+
* is unit-testable without spawning the CLI.
|
|
5
|
+
*/
|
|
6
|
+
/** The output of `fastagent models [search]`: the spec `lines` to print to stdout (a case-insensitive
|
|
7
|
+
* substring filter; no search → all), and an stderr `error` diagnostic when a search matches nothing. */
|
|
8
|
+
export declare function formatModelsCommand(specs: string[], search?: string): {
|
|
9
|
+
lines: string[];
|
|
10
|
+
error?: string;
|
|
11
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI presenter for `fastagent models [search]`: the stdout/stderr output DECISION, kept out of the
|
|
3
|
+
* engine config layer (config.ts owns model resolution / listModels) so this process-boundary behavior
|
|
4
|
+
* is unit-testable without spawning the CLI.
|
|
5
|
+
*/
|
|
6
|
+
/** The output of `fastagent models [search]`: the spec `lines` to print to stdout (a case-insensitive
|
|
7
|
+
* substring filter; no search → all), and an stderr `error` diagnostic when a search matches nothing. */
|
|
8
|
+
export function formatModelsCommand(specs, search) {
|
|
9
|
+
if (!search)
|
|
10
|
+
return { lines: specs };
|
|
11
|
+
const q = search.toLowerCase();
|
|
12
|
+
const matches = specs.filter((spec) => spec.toLowerCase().includes(q));
|
|
13
|
+
if (matches.length === 0)
|
|
14
|
+
return { lines: matches, error: `no model matches "${search}"` };
|
|
15
|
+
// Rank a PROVIDER-name match (query in the part before "/") above an incidental model-id match, so
|
|
16
|
+
// `models anthropic` leads with anthropic/* rather than burying it under amazon-bedrock/anthropic.*
|
|
17
|
+
// and google-vertex/…-anthropic-… (which only match in the model id). Order within each group is kept.
|
|
18
|
+
const providerMatch = (spec) => spec.slice(0, spec.indexOf("/")).toLowerCase().includes(q);
|
|
19
|
+
return { lines: [...matches.filter(providerMatch), ...matches.filter((s) => !providerMatch(s))] };
|
|
20
|
+
}
|
package/dist/cli.d.ts
ADDED