@songsid/agend 2.1.6-beta.8 → 2.1.6

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.
Files changed (45) hide show
  1. package/dist/backend/codex.d.ts +52 -0
  2. package/dist/backend/codex.js +618 -35
  3. package/dist/backend/codex.js.map +1 -1
  4. package/dist/backend/kiro.d.ts +9 -0
  5. package/dist/backend/kiro.js +129 -0
  6. package/dist/backend/kiro.js.map +1 -1
  7. package/dist/backend/muse.d.ts +37 -4
  8. package/dist/backend/muse.js +150 -61
  9. package/dist/backend/muse.js.map +1 -1
  10. package/dist/backend/types.d.ts +25 -1
  11. package/dist/backend/types.js.map +1 -1
  12. package/dist/daemon.d.ts +98 -10
  13. package/dist/daemon.js +836 -94
  14. package/dist/daemon.js.map +1 -1
  15. package/dist/fleet-manager.d.ts +68 -2
  16. package/dist/fleet-manager.js +290 -81
  17. package/dist/fleet-manager.js.map +1 -1
  18. package/dist/instance-lifecycle.d.ts +17 -0
  19. package/dist/instance-lifecycle.js +118 -5
  20. package/dist/instance-lifecycle.js.map +1 -1
  21. package/dist/locale.js +22 -0
  22. package/dist/locale.js.map +1 -1
  23. package/dist/muse-usage-relay.d.ts +72 -0
  24. package/dist/muse-usage-relay.js +431 -0
  25. package/dist/muse-usage-relay.js.map +1 -0
  26. package/dist/tmux-manager.d.ts +2 -0
  27. package/dist/tmux-manager.js +20 -0
  28. package/dist/tmux-manager.js.map +1 -1
  29. package/dist/tool-permissions.d.ts +27 -0
  30. package/dist/tool-permissions.js +64 -3
  31. package/dist/tool-permissions.js.map +1 -1
  32. package/dist/topic-commands.d.ts +9 -0
  33. package/dist/topic-commands.js +36 -2
  34. package/dist/topic-commands.js.map +1 -1
  35. package/dist/ui/view.html +2 -2
  36. package/dist/usage/i18n-keys.d.ts +1 -1
  37. package/dist/usage/i18n-keys.js +1 -1
  38. package/dist/usage/i18n-keys.js.map +1 -1
  39. package/dist/usage/providers.d.ts +4 -0
  40. package/dist/usage/providers.js +86 -9
  41. package/dist/usage/providers.js.map +1 -1
  42. package/dist/usage/usage-api.d.ts +0 -11
  43. package/dist/usage/usage-api.js +50 -8
  44. package/dist/usage/usage-api.js.map +1 -1
  45. package/package.json +2 -1
@@ -292,6 +292,8 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
292
292
  private eventLogPruneTimer;
293
293
  private logRotateTimer;
294
294
  private discordPresenceTimer;
295
+ private discordPresenceEagerTimer;
296
+ private discordPresenceEagerPending;
295
297
  private discordPresenceInFlight;
296
298
  private static readonly DISCORD_PRESENCE_REFRESH_MS;
297
299
  /** Days of event/activity history to keep. */
@@ -479,6 +481,8 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
479
481
  * Classic channels use their effective backend merge chain, not the raw row.
480
482
  */
481
483
  getActiveUsageProviderIds(): ReadonlySet<string>;
484
+ /** Subscription providers used by the running/paused instances owned by one adapter. */
485
+ getUsageProviderIdsForAdapter(adapterId: string): ReadonlySet<string>;
482
486
  /** `[instance, effective backend, credential profile]` for everything that is
483
487
  * running or paused — the one place both usage views agree on who is live. */
484
488
  private activeBackendBindings;
@@ -679,6 +683,12 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
679
683
  startAll(configPath: string): Promise<void>;
680
684
  /** Keep Discord profile activity aligned with the same cached usage source as /usage. */
681
685
  private startDiscordUsagePresence;
686
+ /**
687
+ * Request one prompt presence refresh after an instance/adapter comes online.
688
+ * Startup can bring several instances up together; a short coalescing window
689
+ * keeps that herd on the existing shared refresh path and one usage fetch.
690
+ */
691
+ private requestDiscordUsagePresenceRefresh;
682
692
  private refreshDiscordUsagePresence;
683
693
  /**
684
694
  * Delete inbox files older than retentionDays (by mtime). Cleans the shared
@@ -916,6 +926,19 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
916
926
  private handleSetDisplayName;
917
927
  private handleSetDescription;
918
928
  handleScheduleCrudHttp(instance: string, op: string, args: Record<string, unknown>): Promise<unknown>;
929
+ /**
930
+ * The only place an agent's request creates, changes or removes a schedule
931
+ * (#895). The IPC handler (MCP calls, direct channel.sock writes) and the
932
+ * agent endpoint (agent-cli, HTTP agent mode) are adapters over this, so the
933
+ * target check cannot be present on one face and missing on the other — the
934
+ * shape #804 had to close twice.
935
+ *
936
+ * `caller` is the instance the server resolved for the request; any
937
+ * `source` in `args` is ignored, and a schedule's source is always its caller.
938
+ * A refusal is a ToolNotPermittedError: 403 on the agent endpoint, the error
939
+ * of the schedule response on IPC.
940
+ */
941
+ private performScheduleOp;
919
942
  handleDecisionCrudHttp(instance: string, op: string, args: Record<string, unknown>): Promise<unknown>;
920
943
  handleTaskCrudHttp(instance: string, args: Record<string, unknown>): Promise<unknown>;
921
944
  handleSetDisplayNameHttp(instance: string, name: string): Promise<unknown>;
@@ -1598,12 +1621,35 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1598
1621
  /** Human-readable effective model, e.g. `auto (default)`. Used by /ctx. */
1599
1622
  modelDisplayForInstance(instanceName: string): string;
1600
1623
  private modelChoiceLabel;
1601
- /** Probe one backend's CLI env and cache it. Best-effort; never throws. */
1624
+ /**
1625
+ * Probe one backend's CLI env and cache it. Best-effort; never throws.
1626
+ *
1627
+ * `refreshVendorCatalog` is the "🔄 Refresh models" path only (#886): first
1628
+ * ask the CLI to refetch its own catalog, for backends whose probe merely
1629
+ * reads a file the CLI maintains. Every other caller leaves it off, so the
1630
+ * startup and /model probes behave exactly as before. A failed vendor
1631
+ * refresh fails the probe (null), which the menu reports instead of passing
1632
+ * the old list off as fresh.
1633
+ */
1602
1634
  private probeBackend;
1603
1635
  /** Background-probe every distinct backend in use at startup (non-blocking). */
1604
1636
  private probeCliEnvs;
1605
1637
  /** Best-effort model list for `/model`: cached CLI env first, else live probe. Never throws. */
1606
1638
  private getModelOptions;
1639
+ /**
1640
+ * The model list plus where it came from. `source` is "live" only when a probe
1641
+ * actually ran and answered; a refresh that failed or ran out of time reports
1642
+ * "cache" with the previous list, so a menu can say "could not refresh"
1643
+ * instead of presenting an old list as a fresh one.
1644
+ */
1645
+ private getModelOptionsWithSource;
1646
+ /**
1647
+ * The /model menu's choices, in the one order all three pickers share:
1648
+ * 🔄 Refresh first, then models, then (claude) "More models…". Refresh takes
1649
+ * a slot inside Discord's 25-option select cap, so it is paid for from the
1650
+ * model rows, never from "More models…".
1651
+ */
1652
+ private modelMenuChoices;
1607
1653
  /**
1608
1654
  * Model catalog behind the `list_models` tool.
1609
1655
  *
@@ -1630,7 +1676,15 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1630
1676
  private customProviderFor;
1631
1677
  /** Ask a backend for its catalog using ONE instance's real config. Never throws. */
1632
1678
  private instanceScopedModels;
1633
- /** Account-wide catalog: probe cache first, live probe on miss. */
1679
+ /**
1680
+ * Account-wide catalog: probe cache first, live probe when the cache is
1681
+ * missing or older than the same ~1h window `/model` uses (#888).
1682
+ *
1683
+ * Previously this served anything inside the 24h hard TTL, so `list_models`
1684
+ * could answer with a day-old list `/model` had already re-probed past.
1685
+ * The probe runs under the same deadline `/model` uses: a vendor that stops
1686
+ * answering degrades to the previous list, never stalls the tool call.
1687
+ */
1634
1688
  private globalModelCatalog;
1635
1689
  /** `/model` slash handler (admin only). No arg → DC menu; `/model <name>` → apply directly. */
1636
1690
  /** Label an effort choice, marking the one currently configured. */
@@ -1653,6 +1707,18 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1653
1707
  private claudeApiModelOptions;
1654
1708
  /** Replace a consumed "/model" menu with the full account catalog tier. */
1655
1709
  private expandClaudeModelMenu;
1710
+ /**
1711
+ * "🔄 Refresh models" (#886): probe live past both caches and redraw the menu.
1712
+ *
1713
+ * Past AgEnD's cli-env cache (refresh=true) and, where the backend supports
1714
+ * it, past the CLI's own catalog cache too (codex: `codex debug models`).
1715
+ * Without the second half, a codex refresh re-read the same models_cache.json
1716
+ * and showed the old list as new.
1717
+ *
1718
+ * A failed refresh keeps the previous list and says so. It never blanks the
1719
+ * menu, because a picker with no rows cannot even offer another refresh.
1720
+ */
1721
+ private refreshModelMenu;
1656
1722
  /** Consume a `/model` selection callback. Returns true for all model-select ids (incl. stale). */
1657
1723
  private handleModelSelection;
1658
1724
  /** Apply a model to an instance: runtime paste (claude-code) or persist + restart (others). */