@adecore/agents 0.33.0 → 0.33.1

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.
@@ -21,7 +21,7 @@ export interface UsageMonitorOptions {
21
21
  providers: ProviderRegistry;
22
22
  accounts?: LimitAccounts;
23
23
  probe?: (kind: UsageProvider, command: readonly string[], env: ProbeEnv) => Promise<ProbeResult>;
24
- plans?: Partial<Record<UsageProvider, () => Promise<ProbeResult>>>;
24
+ plans?: Partial<Record<UsageProvider, (account: LimitAccount) => Promise<ProbeResult>>>;
25
25
  now?: () => number;
26
26
  client?: CodexClientInfo;
27
27
  }
@@ -177,7 +177,7 @@ export class UsageMonitor {
177
177
  const plan = this.plans[account.kind];
178
178
  if (plan !== undefined) {
179
179
  try {
180
- return await plan();
180
+ return await plan(account);
181
181
  }
182
182
  catch (e) {
183
183
  return { unavailable: { reason: 'failed', message: errorText(e) } };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adecore/agents",
3
- "version": "0.33.0",
3
+ "version": "0.33.1",
4
4
  "description": "Node-compatible agent chat hosts, providers, accounts, usage and durable task coordination.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -81,8 +81,8 @@
81
81
  "test": "bun --conditions=source test"
82
82
  },
83
83
  "dependencies": {
84
- "@adecore/agent-contracts": "0.33.0",
85
- "@adecore/intelligent-ui": "0.33.0",
84
+ "@adecore/agent-contracts": "0.33.1",
85
+ "@adecore/intelligent-ui": "0.33.1",
86
86
  "zod": "^4.6.5"
87
87
  },
88
88
  "devDependencies": {
@@ -65,11 +65,11 @@ export interface UsageMonitorOptions {
65
65
  /* How to ask; a test answers without starting a CLI. */
66
66
  probe?: (kind: UsageProvider, command: readonly string[], env: ProbeEnv) => Promise<ProbeResult>;
67
67
  /*
68
- * A plan the host reads itself, for a provider with no CLI to ask (a subscription API the host calls with
69
- * its own key). It answers in place of the probe, with no environment and no check that a CLI is installed:
70
- * what it says is the whole story, a missing key included.
68
+ * A plan the host reads itself, for a provider whose CLI cannot be asked (a subscription API the host calls,
69
+ * or a billing endpoint only the CLI's interface shows). It answers in place of the probe, once per account,
70
+ * with no environment and no check that a CLI is installed: what it says is the whole story, a missing key included.
71
71
  */
72
- plans?: Partial<Record<UsageProvider, () => Promise<ProbeResult>>>;
72
+ plans?: Partial<Record<UsageProvider, (account: LimitAccount) => Promise<ProbeResult>>>;
73
73
  now?: () => number;
74
74
  // How the host names itself to the app-server a probe opens.
75
75
  client?: CodexClientInfo;
@@ -242,7 +242,7 @@ export class UsageMonitor {
242
242
  const plan = this.plans[account.kind];
243
243
  if (plan !== undefined) {
244
244
  try {
245
- return await plan();
245
+ return await plan(account);
246
246
  } catch (e) {
247
247
  return { unavailable: { reason: 'failed', message: errorText(e) } };
248
248
  }