dsh-xdpool 3.0.8 → 3.0.9

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/lib/index.d.ts CHANGED
@@ -1393,6 +1393,8 @@ export declare class WorkBuddyAccountPool {
1393
1393
  */
1394
1394
  private lastUsedAt;
1395
1395
  private refreshInflight;
1396
+ /** Three-way reconciliation anchor: only advanced after a successful store write. */
1397
+ private persistedCredentials;
1396
1398
  /**
1397
1399
  * Whether `scan()` seeds from and writes back the durable account store.
1398
1400
  *
@@ -1476,6 +1478,7 @@ export declare class WorkBuddyAccountPool {
1476
1478
  private pruneExpiredSnapshots;
1477
1479
  /** Rescan the auth directories and merge newly discovered accounts. */
1478
1480
  scan(): Promise<WorkBuddyAccount[]>;
1481
+ private scanTransaction;
1479
1482
  /**
1480
1483
  * Warm the deadline readings that `expiry` mode sorts on.
1481
1484
  *
@@ -1946,29 +1949,43 @@ export declare class WorkBuddyAccountPool {
1946
1949
  * browser card renders. Route paths are plugin-owned and mounted on the Host's
1947
1950
  * same-origin web server (see `src/web-status.ts`).
1948
1951
  *
1952
+ * ## Why `/dsh-xdpool`, and not `/plugins/dsh-xdpool`
1953
+ *
1954
+ * DSH 0.2.x gives the `/plugins/` namespace to the client-module asset server
1955
+ * (`/plugins/??@scope/pkg/client.js`). That server answers every request under
1956
+ * the prefix before named routes are considered: an unknown asset path is a
1957
+ * bodyless 404 and a non-GET is `405 Allow: GET, HEAD`. Routes this plugin
1958
+ * registered under `/dsh-xdpool/...` were therefore unreachable on that
1959
+ * line — status answered 404, the settings card's rescan answered 405 — while
1960
+ * the plugin logged "routes ... ok" because registration itself succeeded.
1961
+ *
1962
+ * A plugin-owned top-level prefix is what the host's own plugins use
1963
+ * (`/dsh-prompt-optimizer/optimize`), so these paths live under `/dsh-xdpool/`.
1964
+ * Keep them there.
1965
+ *
1949
1966
  * @module dsh-xdpool/status-paths
1950
1967
  */
1951
1968
  /** Plugin-owned read-only pool status endpoint (account rows + models + shim). */
1952
- export declare const POOL_STATUS_PATH = "/plugins/dsh-xdpool/status";
1969
+ export declare const POOL_STATUS_PATH = "/dsh-xdpool/status";
1953
1970
  /** Plugin-owned local account rescan endpoint (re-read desktop snapshots). */
1954
- export declare const POOL_RESCAN_PATH = "/plugins/dsh-xdpool/accounts/rescan";
1971
+ export declare const POOL_RESCAN_PATH = "/dsh-xdpool/accounts/rescan";
1955
1972
  /** Plugin-owned cooldown reset endpoint (clear all 429 cooldowns). */
1956
- export declare const POOL_RESET_COOLDOWN_PATH = "/plugins/dsh-xdpool/cooldowns/reset";
1973
+ export declare const POOL_RESET_COOLDOWN_PATH = "/dsh-xdpool/cooldowns/reset";
1957
1974
  /** Plugin-owned daily check-in action endpoint (claim today's reward). */
1958
- export declare const POOL_CHECKIN_PATH = "/plugins/dsh-xdpool/checkin";
1975
+ export declare const POOL_CHECKIN_PATH = "/dsh-xdpool/checkin";
1959
1976
  /** Plugin-owned model-selection save endpoint (writes the settings section). */
1960
- export declare const POOL_MODELS_SAVE_PATH = "/plugins/dsh-xdpool/models/save";
1977
+ export declare const POOL_MODELS_SAVE_PATH = "/dsh-xdpool/models/save";
1961
1978
  /**
1962
1979
  * Throw one account out of the pool for good, or take it back.
1963
1980
  *
1964
1981
  * Separate from the disable route because the semantics differ: disabling is a
1965
1982
  * rotation preference the account survives, ignoring survives the account.
1966
1983
  */
1967
- export declare const POOL_ACCOUNT_IGNORE_PATH = "/plugins/dsh-xdpool/accounts/ignored";
1984
+ export declare const POOL_ACCOUNT_IGNORE_PATH = "/dsh-xdpool/accounts/ignored";
1968
1985
  /** Run one automation job immediately, so the card can verify it on demand. */
1969
- export declare const POOL_AUTOMATION_RUN_PATH = "/plugins/dsh-xdpool/automation/run";
1986
+ export declare const POOL_AUTOMATION_RUN_PATH = "/dsh-xdpool/automation/run";
1970
1987
  /** Set or clear one account's reserved-credit floor. */
1971
- export declare const POOL_CREDIT_RESERVE_PATH = "/plugins/dsh-xdpool/accounts/credit-reserve";
1988
+ export declare const POOL_CREDIT_RESERVE_PATH = "/dsh-xdpool/accounts/credit-reserve";
1972
1989
  /**
1973
1990
  * One model's facts, exactly as the host's catalogue spells them.
1974
1991
  *
@@ -4551,7 +4568,18 @@ export declare class WorkBuddyScheduler {
4551
4568
  * ignored rather than queued: pressing the button twice means hurry up, and
4552
4569
  * the run already under way covers it.
4553
4570
  */
4554
- startRunAll(job?: AutomationJobKind | 'all', force?: boolean): boolean;
4571
+ startRunAll(): boolean;
4572
+ /**
4573
+ * Start one job — or the whole pass — in the background.
4574
+ *
4575
+ * The card's automation row names a job, and `force` is what a second press
4576
+ * within the same hour means. Both used to be dropped on the floor by the
4577
+ * route wiring, so "run check-in" ran every job and a repeat press inside the
4578
+ * hour silently did nothing. A single-job start goes through the same
4579
+ * in-flight guard as a full pass: overlapping passes would double-spend the
4580
+ * per-account delays and interleave two runs into one status document.
4581
+ */
4582
+ startRun(kind: 'all' | AutomationJobKind, force?: boolean): boolean;
4555
4583
  /**
4556
4584
  * issue #222:启动一个指定 job 的后台运行,供「立即执行」按任务调用。
4557
4585
  *
@@ -5178,6 +5206,10 @@ interface PoolStatusRouteOptions {
5178
5206
  * own cadence.
5179
5207
  */
5180
5208
  creditsSpend?: (days: number | undefined) => Promise<unknown>;
5209
+ /** Credits actually spent today, measured by the cost meter. */
5210
+ creditsToday?: () => Promise<unknown>;
5211
+ /** Cached credit history for the dashboard; `refresh=1` bypasses the cache. */
5212
+ spendReport?: (days: number | undefined, refresh: boolean) => Promise<unknown>;
5181
5213
  /**
5182
5214
  * The relay's current state, or undefined when this build has no relay.
5183
5215
  *