@songsid/agend 2.1.5 → 2.1.6-beta.10
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-endpoint.d.ts +18 -0
- package/dist/agent-endpoint.js +53 -2
- package/dist/agent-endpoint.js.map +1 -1
- package/dist/apply-job.d.ts +114 -0
- package/dist/apply-job.js +214 -0
- package/dist/apply-job.js.map +1 -0
- package/dist/backend/claude-code.d.ts +25 -0
- package/dist/backend/claude-code.js +127 -0
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/codex.d.ts +57 -0
- package/dist/backend/codex.js +183 -0
- package/dist/backend/codex.js.map +1 -1
- package/dist/backend/credential-profile.d.ts +159 -0
- package/dist/backend/credential-profile.js +340 -0
- package/dist/backend/credential-profile.js.map +1 -0
- package/dist/backend/factory.js +4 -1
- package/dist/backend/factory.js.map +1 -1
- package/dist/backend/kiro-auth-store.d.ts +25 -0
- package/dist/backend/kiro-auth-store.js +61 -0
- package/dist/backend/kiro-auth-store.js.map +1 -0
- package/dist/backend/kiro.d.ts +8 -0
- package/dist/backend/kiro.js +31 -2
- package/dist/backend/kiro.js.map +1 -1
- package/dist/backend/muse.d.ts +90 -0
- package/dist/backend/muse.js +437 -0
- package/dist/backend/muse.js.map +1 -0
- package/dist/backend/types.d.ts +54 -0
- package/dist/backend/types.js.map +1 -1
- package/dist/channel/access-manager.d.ts +20 -0
- package/dist/channel/access-manager.js +25 -0
- package/dist/channel/access-manager.js.map +1 -1
- package/dist/channel/adapters/discord.d.ts +17 -0
- package/dist/channel/adapters/discord.js +72 -11
- package/dist/channel/adapters/discord.js.map +1 -1
- package/dist/channel/adapters/telegram.d.ts +6 -0
- package/dist/channel/adapters/telegram.js +36 -0
- package/dist/channel/adapters/telegram.js.map +1 -1
- package/dist/channel/markdown-chunk.d.ts +8 -3
- package/dist/channel/markdown-chunk.js +12 -3
- package/dist/channel/markdown-chunk.js.map +1 -1
- package/dist/channel/mcp-server.js +9 -12
- package/dist/channel/mcp-server.js.map +1 -1
- package/dist/channel/mcp-tools.d.ts +6 -2
- package/dist/channel/mcp-tools.js +6 -36
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/channel/tool-router.js +32 -3
- package/dist/channel/tool-router.js.map +1 -1
- package/dist/channel/types.d.ts +18 -0
- package/dist/cli.js +113 -0
- package/dist/cli.js.map +1 -1
- package/dist/config-validator.js +45 -5
- package/dist/config-validator.js.map +1 -1
- package/dist/connection-secrets.d.ts +96 -0
- package/dist/connection-secrets.js +25 -0
- package/dist/connection-secrets.js.map +1 -0
- package/dist/daemon.d.ts +76 -0
- package/dist/daemon.js +489 -103
- package/dist/daemon.js.map +1 -1
- package/dist/event-log.d.ts +9 -0
- package/dist/event-log.js +21 -0
- package/dist/event-log.js.map +1 -1
- package/dist/fleet-level-config.d.ts +42 -0
- package/dist/fleet-level-config.js +78 -0
- package/dist/fleet-level-config.js.map +1 -0
- package/dist/fleet-lock.d.ts +21 -0
- package/dist/fleet-lock.js +42 -8
- package/dist/fleet-lock.js.map +1 -1
- package/dist/fleet-manager.d.ts +425 -2
- package/dist/fleet-manager.js +2055 -182
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/skills/credential-profiles/SKILL.md +145 -0
- package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +11 -1
- package/dist/instance-config-impact.d.ts +55 -0
- package/dist/instance-config-impact.js +152 -0
- package/dist/instance-config-impact.js.map +1 -0
- package/dist/instance-lifecycle.js +8 -4
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/locale.js +24 -0
- package/dist/locale.js.map +1 -1
- package/dist/logger.js +42 -25
- package/dist/logger.js.map +1 -1
- package/dist/muse-usage-relay.d.ts +72 -0
- package/dist/muse-usage-relay.js +419 -0
- package/dist/muse-usage-relay.js.map +1 -0
- package/dist/outbound-handlers.d.ts +5 -1
- package/dist/outbound-handlers.js +199 -1
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +7 -5
- package/dist/outbound-schemas.js +3 -2
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/provider-probe.d.ts +48 -0
- package/dist/provider-probe.js +121 -0
- package/dist/provider-probe.js.map +1 -0
- package/dist/provider-secret-registry.d.ts +98 -0
- package/dist/provider-secret-registry.js +334 -0
- package/dist/provider-secret-registry.js.map +1 -0
- package/dist/quickstart-api.d.ts +164 -0
- package/dist/quickstart-api.js +351 -0
- package/dist/quickstart-api.js.map +1 -0
- package/dist/quickstart.js +23 -50
- package/dist/quickstart.js.map +1 -1
- package/dist/scheduler/db.js +17 -5
- package/dist/scheduler/db.js.map +1 -1
- package/dist/scheduler/db.test.js +34 -1
- package/dist/scheduler/db.test.js.map +1 -1
- package/dist/scheduler/types.d.ts +4 -0
- package/dist/scheduler/types.js.map +1 -1
- package/dist/secret-store.d.ts +25 -0
- package/dist/secret-store.js +165 -0
- package/dist/secret-store.js.map +1 -0
- package/dist/self-restart-limit.d.ts +21 -0
- package/dist/self-restart-limit.js +129 -0
- package/dist/self-restart-limit.js.map +1 -0
- package/dist/settings-api.d.ts +116 -0
- package/dist/settings-api.js +530 -5
- package/dist/settings-api.js.map +1 -1
- package/dist/setup-auth.d.ts +113 -0
- package/dist/setup-auth.js +181 -0
- package/dist/setup-auth.js.map +1 -0
- package/dist/setup-form.d.ts +18 -0
- package/dist/setup-form.js +315 -0
- package/dist/setup-form.js.map +1 -0
- package/dist/setup-host.d.ts +162 -0
- package/dist/setup-host.js +496 -0
- package/dist/setup-host.js.map +1 -0
- package/dist/setup-marker.d.ts +8 -0
- package/dist/setup-marker.js +39 -0
- package/dist/setup-marker.js.map +1 -0
- package/dist/setup-tunnel-consent.d.ts +53 -0
- package/dist/setup-tunnel-consent.js +82 -0
- package/dist/setup-tunnel-consent.js.map +1 -0
- package/dist/setup-wizard.js +4 -0
- package/dist/setup-wizard.js.map +1 -1
- package/dist/steer-capability.js +4 -1
- package/dist/steer-capability.js.map +1 -1
- package/dist/tips.js +1 -1
- package/dist/tips.js.map +1 -1
- package/dist/tmux-manager.js +29 -4
- package/dist/tmux-manager.js.map +1 -1
- package/dist/tool-permissions-notice.d.ts +38 -0
- package/dist/tool-permissions-notice.js +92 -0
- package/dist/tool-permissions-notice.js.map +1 -0
- package/dist/tool-permissions.d.ts +120 -0
- package/dist/tool-permissions.js +277 -0
- package/dist/tool-permissions.js.map +1 -0
- package/dist/topic-commands.js +1 -0
- package/dist/topic-commands.js.map +1 -1
- package/dist/transcript-sources.d.ts +12 -1
- package/dist/transcript-sources.js +19 -3
- package/dist/transcript-sources.js.map +1 -1
- package/dist/tunnel/cloudflared.d.ts +71 -0
- package/dist/tunnel/cloudflared.js +447 -0
- package/dist/tunnel/cloudflared.js.map +1 -0
- package/dist/tunnel/lease.d.ts +75 -0
- package/dist/tunnel/lease.js +209 -0
- package/dist/tunnel/lease.js.map +1 -0
- package/dist/tunnel/manager.d.ts +56 -0
- package/dist/tunnel/manager.js +167 -0
- package/dist/tunnel/manager.js.map +1 -0
- package/dist/tunnel/types.d.ts +119 -0
- package/dist/tunnel/types.js +33 -0
- package/dist/tunnel/types.js.map +1 -0
- package/dist/types.d.ts +2 -0
- package/dist/ui/dashboard.html +4 -3
- package/dist/ui/settings.html +808 -156
- package/dist/ui/view.html +2 -2
- package/dist/usage/i18n-keys.d.ts +1 -1
- package/dist/usage/i18n-keys.js +1 -1
- package/dist/usage/i18n-keys.js.map +1 -1
- package/dist/usage/providers.d.ts +23 -14
- package/dist/usage/providers.js +220 -58
- package/dist/usage/providers.js.map +1 -1
- package/dist/usage/usage-api.d.ts +13 -0
- package/dist/usage/usage-api.js +69 -1
- package/dist/usage/usage-api.js.map +1 -1
- package/dist/web-api.js +8 -5
- package/dist/web-api.js.map +1 -1
- package/dist/web-auth.d.ts +75 -0
- package/dist/web-auth.js +208 -2
- package/dist/web-auth.js.map +1 -1
- package/dist/web-terminal.d.ts +30 -1
- package/dist/web-terminal.js +86 -3
- package/dist/web-terminal.js.map +1 -1
- package/package.json +2 -1
package/dist/cli.js
CHANGED
|
@@ -1659,6 +1659,101 @@ program
|
|
|
1659
1659
|
console.log("Fleet not running. Start with: agend start");
|
|
1660
1660
|
process.exitCode = 1;
|
|
1661
1661
|
});
|
|
1662
|
+
program
|
|
1663
|
+
.command("setup")
|
|
1664
|
+
.description("Open the guided setup page in a browser (before a fleet exists)")
|
|
1665
|
+
.option("--reset", "Allow setup again after it has already been completed")
|
|
1666
|
+
.option("--port <port>", "Port for the setup page (default: the health port)")
|
|
1667
|
+
.option("--tunnel", "Expose the setup page through a Cloudflare quick tunnel so a phone can open it")
|
|
1668
|
+
.action(async (opts) => {
|
|
1669
|
+
const { clearSetupComplete, isSetupComplete } = await import("./setup-marker.js");
|
|
1670
|
+
if (opts.reset) {
|
|
1671
|
+
console.log(clearSetupComplete(DATA_DIR) ? "Setup marker cleared." : "No setup marker to clear.");
|
|
1672
|
+
}
|
|
1673
|
+
else if (isSetupComplete(DATA_DIR)) {
|
|
1674
|
+
// Not keyed on fleet.yaml existing: a deleted or truncated config must not
|
|
1675
|
+
// reopen a setup page that starts out reachable to whoever finds it.
|
|
1676
|
+
console.error("Setup has already been completed. Use `agend setup --reset` to run it again, or edit settings from the dashboard.");
|
|
1677
|
+
process.exit(1);
|
|
1678
|
+
}
|
|
1679
|
+
if (opts.tunnel && opts.port) {
|
|
1680
|
+
// Not "ignored": a fixed port behind a tunnel is the one arrangement this
|
|
1681
|
+
// whole design exists to prevent, and silently overriding the flag would
|
|
1682
|
+
// leave someone believing they got the port they asked for.
|
|
1683
|
+
console.error("--tunnel and --port cannot be combined: a tunnelled setup page always binds an ephemeral port.");
|
|
1684
|
+
process.exit(1);
|
|
1685
|
+
}
|
|
1686
|
+
const { loadFleetConfig } = await import("./config.js");
|
|
1687
|
+
const fleet = existsSync(FLEET_CONFIG_PATH) ? loadFleetConfig(FLEET_CONFIG_PATH) : { defaults: {}, instances: {} };
|
|
1688
|
+
const { SetupHost, resolvePort, SETUP_HOST_TTL_MS } = await import("./setup-host.js");
|
|
1689
|
+
// Asked before anything is created: no lock taken, no listener bound, no
|
|
1690
|
+
// cloudflared spawned. Every time, because there is no configuration that
|
|
1691
|
+
// makes the consequences smaller, and there is no chat channel yet to put a
|
|
1692
|
+
// confirmation button in.
|
|
1693
|
+
if (opts.tunnel) {
|
|
1694
|
+
const { confirmPublicTunnel } = await import("./setup-tunnel-consent.js");
|
|
1695
|
+
const { createInterface } = await import("node:readline/promises");
|
|
1696
|
+
const consent = await confirmPublicTunnel({
|
|
1697
|
+
isTTY: !!process.stdin.isTTY,
|
|
1698
|
+
say: line => console.log(line),
|
|
1699
|
+
ask: async (question) => {
|
|
1700
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
1701
|
+
try {
|
|
1702
|
+
return await rl.question(question);
|
|
1703
|
+
}
|
|
1704
|
+
finally {
|
|
1705
|
+
rl.close();
|
|
1706
|
+
}
|
|
1707
|
+
},
|
|
1708
|
+
}, Math.round(SETUP_HOST_TTL_MS / 60_000));
|
|
1709
|
+
if (!consent.granted) {
|
|
1710
|
+
process.exit(1);
|
|
1711
|
+
}
|
|
1712
|
+
}
|
|
1713
|
+
// In tunnel mode this ignores `--port`, `health_port` and the default
|
|
1714
|
+
// alike: the health port is what the fleet will bind later, and a tunnel
|
|
1715
|
+
// that outlived this process would then be pointed at its dashboard.
|
|
1716
|
+
const port = resolvePort({
|
|
1717
|
+
tunnel: opts.tunnel,
|
|
1718
|
+
port: opts.port === undefined ? undefined : Number(opts.port),
|
|
1719
|
+
healthPort: fleet.health_port,
|
|
1720
|
+
});
|
|
1721
|
+
const host = new SetupHost({ dataDir: DATA_DIR, configPath: FLEET_CONFIG_PATH, port, tunnel: opts.tunnel });
|
|
1722
|
+
let started;
|
|
1723
|
+
try {
|
|
1724
|
+
started = await host.start();
|
|
1725
|
+
}
|
|
1726
|
+
catch (err) {
|
|
1727
|
+
console.error(err.message);
|
|
1728
|
+
process.exit(1);
|
|
1729
|
+
}
|
|
1730
|
+
// Two things, and only the second one is a credential. The link is where
|
|
1731
|
+
// the page lives — a random path so nothing finds it by looking — and the
|
|
1732
|
+
// code is what proves you are the person who ran this command. Putting the
|
|
1733
|
+
// credential in the link would mean a preview fetch, a shell history or a
|
|
1734
|
+
// forwarded message carries the whole thing.
|
|
1735
|
+
const { formatSetupCode } = await import("./setup-auth.js");
|
|
1736
|
+
const pageUrl = started.publicUrl ?? `http://127.0.0.1:${started.port}${started.path}`;
|
|
1737
|
+
// A tunnel was asked for and there is no public URL: say why, and say what
|
|
1738
|
+
// that means, rather than printing a loopback link under a flag that
|
|
1739
|
+
// promised a phone could open it.
|
|
1740
|
+
if (opts.tunnel && !started.publicUrl) {
|
|
1741
|
+
const { noTunnelBinaryMessage } = await import("./setup-tunnel-consent.js");
|
|
1742
|
+
console.log("");
|
|
1743
|
+
for (const line of noTunnelBinaryMessage())
|
|
1744
|
+
console.log(line);
|
|
1745
|
+
}
|
|
1746
|
+
console.log(`\n Setup page: ${pageUrl}`);
|
|
1747
|
+
console.log(` Setup code: ${formatSetupCode(started.code)}`);
|
|
1748
|
+
console.log(" Open the page, type the code. Five wrong attempts closes it,");
|
|
1749
|
+
console.log(" and it closes itself after 15 minutes.\n");
|
|
1750
|
+
// Every way this command is asked to stop, not just Ctrl-C: a host that
|
|
1751
|
+
// exits without releasing the lock leaves the next `agend start` to prove
|
|
1752
|
+
// the pid is stale before it can run.
|
|
1753
|
+
for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"]) {
|
|
1754
|
+
process.on(signal, () => { void host.shutdown(false, signal.toLowerCase()).then(() => process.exit(0)); });
|
|
1755
|
+
}
|
|
1756
|
+
});
|
|
1662
1757
|
program
|
|
1663
1758
|
.command("quickstart")
|
|
1664
1759
|
.description("Guided setup for a Backend, chat channel, projects, and fleet service")
|
|
@@ -1702,6 +1797,24 @@ program
|
|
|
1702
1797
|
const child = spawn(cmd, [htmlPath], { detached: true, stdio: "ignore" });
|
|
1703
1798
|
child.unref();
|
|
1704
1799
|
});
|
|
1800
|
+
program
|
|
1801
|
+
.command("web-token")
|
|
1802
|
+
.description("Rotate the web dashboard access token")
|
|
1803
|
+
.argument("<action>", "rotate")
|
|
1804
|
+
.action(async (action) => {
|
|
1805
|
+
if (action !== "rotate") {
|
|
1806
|
+
console.error(`Unknown action "${action}". Only "rotate" is supported.`);
|
|
1807
|
+
process.exit(1);
|
|
1808
|
+
}
|
|
1809
|
+
const { rotateWebToken } = await import("./web-auth.js");
|
|
1810
|
+
rotateWebToken(DATA_DIR);
|
|
1811
|
+
// The new token is deliberately not printed: it would land in shell history
|
|
1812
|
+
// and scrollback, which is what moving it out of URLs and logs was for.
|
|
1813
|
+
console.log("Web token rotated.");
|
|
1814
|
+
console.log("Every previously issued dashboard link and browser session is now rejected.");
|
|
1815
|
+
console.log("A running fleet picks this up immediately — no restart needed.");
|
|
1816
|
+
console.log("Get a new link with `agend web`, or /dashboard in your chat channel.");
|
|
1817
|
+
});
|
|
1705
1818
|
program
|
|
1706
1819
|
.command("view")
|
|
1707
1820
|
.description("Open the read-only View dashboard in your browser")
|