@hasna/economy 0.5.3 → 0.5.5
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/CHANGELOG.md +12 -0
- package/README.md +7 -3
- package/dist/chunks/{index-s9mvven6.js → index-61c0vz9p.js} +223 -100
- package/dist/chunks/{index-bn04v378.js → index-7k1xt8mj.js} +1 -1
- package/dist/chunks/{index-1vz1arz5.js → index-pnnqdv3r.js} +1 -1
- package/dist/chunks/{index-mhrkwvtk.js → index-z9psed59.js} +1 -1
- package/dist/chunks/{serve-8yqe7nhs.js → serve-zp5a3qzw.js} +2 -2
- package/dist/chunks/{tui-fe94bvp9.js → tui-2yea642b.js} +3 -3
- package/dist/chunks/{watch-ct8dvrpr.js → watch-811vncjz.js} +3 -3
- package/dist/cli/index.js +10 -10
- package/dist/index.js +1 -1
- package/dist/ingest/claude.d.ts.map +1 -1
- package/dist/ingest/codex.d.ts.map +1 -1
- package/dist/lib/accounts-store.d.ts +25 -1
- package/dist/lib/accounts-store.d.ts.map +1 -1
- package/dist/lib/accounts.d.ts.map +1 -1
- package/dist/lib/paths.d.ts.map +1 -1
- package/dist/lib/subscriptions-registry.d.ts +26 -0
- package/dist/lib/subscriptions-registry.d.ts.map +1 -0
- package/dist/lib/test-keychain-fixture.d.ts +3 -2
- package/dist/lib/test-keychain-fixture.d.ts.map +1 -1
- package/dist/mcp/index.js +290 -167
- package/dist/otel/index.js +87 -65
- package/dist/server/index.js +231 -110
- package/dist/server/service-worker.js +222 -101
- package/package.json +1 -1
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import {
|
|
3
3
|
agentPaths,
|
|
4
4
|
syncAll
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-61c0vz9p.js";
|
|
6
6
|
import {
|
|
7
7
|
getStore,
|
|
8
8
|
isCloudStore
|
|
9
|
-
} from "./index-
|
|
10
|
-
import"./index-
|
|
9
|
+
} from "./index-z9psed59.js";
|
|
10
|
+
import"./index-pnnqdv3r.js";
|
|
11
11
|
import {
|
|
12
12
|
formatSummaryValue
|
|
13
13
|
} from "./index-f5jv6q5q.js";
|
package/dist/cli/index.js
CHANGED
|
@@ -8,22 +8,22 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
buildStatusLine,
|
|
10
10
|
gatherStatusData
|
|
11
|
-
} from "../chunks/index-
|
|
11
|
+
} from "../chunks/index-7k1xt8mj.js";
|
|
12
12
|
import"../chunks/index-w3bvv0ns.js";
|
|
13
13
|
import {
|
|
14
14
|
agentPaths,
|
|
15
15
|
syncAll
|
|
16
|
-
} from "../chunks/index-
|
|
16
|
+
} from "../chunks/index-61c0vz9p.js";
|
|
17
17
|
import {
|
|
18
18
|
getStore,
|
|
19
19
|
isCloudStore
|
|
20
|
-
} from "../chunks/index-
|
|
20
|
+
} from "../chunks/index-z9psed59.js";
|
|
21
21
|
import {
|
|
22
22
|
billingDriftCheck,
|
|
23
23
|
economyCloudStorage,
|
|
24
24
|
economyTransportReport,
|
|
25
25
|
packageMetadata
|
|
26
|
-
} from "../chunks/index-
|
|
26
|
+
} from "../chunks/index-pnnqdv3r.js";
|
|
27
27
|
import {
|
|
28
28
|
AGENTS,
|
|
29
29
|
MAX_INGEST_BYTES,
|
|
@@ -1357,23 +1357,23 @@ function registerExtendedCommands(program) {
|
|
|
1357
1357
|
console.log();
|
|
1358
1358
|
});
|
|
1359
1359
|
program.command("tui").description("Terminal status dashboard (Linux/SSH friendly)").option("--watch", "Live refresh").option("--interval <seconds>", "Refresh interval", "30").action(async (opts) => {
|
|
1360
|
-
const { runTui } = await import("../chunks/tui-
|
|
1360
|
+
const { runTui } = await import("../chunks/tui-2yea642b.js");
|
|
1361
1361
|
await runTui({
|
|
1362
1362
|
watch: Boolean(opts.watch),
|
|
1363
1363
|
interval: Number(opts.interval ?? 30)
|
|
1364
1364
|
});
|
|
1365
1365
|
});
|
|
1366
1366
|
program.command("waybar").description("Print waybar-compatible JSON status line").action(async () => {
|
|
1367
|
-
const { printWaybarJson } = await import("../chunks/tui-
|
|
1367
|
+
const { printWaybarJson } = await import("../chunks/tui-2yea642b.js");
|
|
1368
1368
|
await printWaybarJson();
|
|
1369
1369
|
});
|
|
1370
1370
|
const barCmd = program.command("bar").description("Status bar helpers (Linux)");
|
|
1371
1371
|
barCmd.command("tui").description("Alias for economy tui").option("--watch", "Live refresh").action(async (opts) => {
|
|
1372
|
-
const { runTui } = await import("../chunks/tui-
|
|
1372
|
+
const { runTui } = await import("../chunks/tui-2yea642b.js");
|
|
1373
1373
|
await runTui({ watch: Boolean(opts.watch) });
|
|
1374
1374
|
});
|
|
1375
1375
|
barCmd.command("waybar").description("Alias for economy waybar").action(async () => {
|
|
1376
|
-
const { printWaybarJson } = await import("../chunks/tui-
|
|
1376
|
+
const { printWaybarJson } = await import("../chunks/tui-2yea642b.js");
|
|
1377
1377
|
await printWaybarJson();
|
|
1378
1378
|
});
|
|
1379
1379
|
program.command("estimate").description("Estimate cost for token counts").requiredOption("--model <model>", "Model name").option("--input <n>", "Input tokens", "0").option("--output <n>", "Output tokens", "0").action(async (opts) => {
|
|
@@ -3198,7 +3198,7 @@ program.command("accounts [period]").description("List account usage by email ad
|
|
|
3198
3198
|
console.log();
|
|
3199
3199
|
});
|
|
3200
3200
|
program.command("watch").description("Live stream of incoming costs").option("--interval <seconds>", "Poll interval in seconds", "10").option("--daemon", "Watch agent data directories and sync on change").option("--agent <agent>", `Filter by agent (${AGENTS.join("|")})`).option("--notify <amount>", "Fire macOS notification when cumulative cost crosses this USD threshold").action(async (opts) => {
|
|
3201
|
-
const { watchCosts } = await import("../chunks/watch-
|
|
3201
|
+
const { watchCosts } = await import("../chunks/watch-811vncjz.js");
|
|
3202
3202
|
await watchCosts({
|
|
3203
3203
|
interval: parsePositiveCliInteger(opts.interval ?? "10", "--interval"),
|
|
3204
3204
|
daemon: Boolean(opts.daemon),
|
|
@@ -3434,7 +3434,7 @@ pricingCmd.command("remove <model>").description("Remove pricing for a model").a
|
|
|
3434
3434
|
});
|
|
3435
3435
|
program.command("serve").description("Start the REST API server").option("-p, --port <port>", "Port", "3456").action(async (opts) => {
|
|
3436
3436
|
const port = parseCliPort(opts.port ?? "3456", "--port");
|
|
3437
|
-
const { startServer } = await import("../chunks/serve-
|
|
3437
|
+
const { startServer } = await import("../chunks/serve-zp5a3qzw.js");
|
|
3438
3438
|
startServer(port);
|
|
3439
3439
|
});
|
|
3440
3440
|
program.command("mcp").description("Show MCP server install commands").option("--claude", "Install into Claude Code").option("--codex", "Install into Codex").option("--gemini", "Install into Gemini CLI").option("--all", "Install into all agents").action(async (opts) => {
|
package/dist/index.js
CHANGED
|
@@ -62,7 +62,7 @@ import { randomUUID } from "crypto";
|
|
|
62
62
|
// package.json
|
|
63
63
|
var package_default = {
|
|
64
64
|
name: "@hasna/economy",
|
|
65
|
-
version: "0.5.
|
|
65
|
+
version: "0.5.5",
|
|
66
66
|
description: "AI coding cost tracker \u2014 CLI + MCP server + REST API for Claude Code, Codex, OpenCode, Cursor, Pi, and Hermes, with legacy Gemini CLI session and Gemini API billing ingestion",
|
|
67
67
|
repository: {
|
|
68
68
|
type: "git",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude.d.ts","sourceRoot":"","sources":["../../src/ingest/claude.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,IAAI,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAWxE,OAAO,KAAK,EAAkB,KAAK,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"claude.d.ts","sourceRoot":"","sources":["../../src/ingest/claude.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,IAAI,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAWxE,OAAO,KAAK,EAAkB,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAsE9D,wBAAsB,YAAY,CAChC,EAAE,EAAE,QAAQ,EACZ,OAAO,UAAQ,EACf,WAAW,SAAsB,GAChC,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAEhE;AAED,wBAAsB,YAAY,CAChC,EAAE,EAAE,QAAQ,EACZ,OAAO,UAAQ,EACf,WAAW,SAAsB,GAChC,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAEhE;AAED,wBAAsB,mBAAmB,CACvC,EAAE,EAAE,QAAQ,EACZ,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,KAAK,EAChB,OAAO,UAAQ,GACd,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAoJhE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../src/ingest/codex.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../src/ingest/codex.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,IAAI,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAsBxE,UAAU,eAAe;IACvB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,uBAAuB,CAAC,EAAE,MAAM,CAAA;IAChC,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,UAAU,eAAe;IACvB,KAAK,EAAE,eAAe,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;CACjB;AAuDD,iBAAS,cAAc,CAAC,UAAU,SAAoB,GAAG,MAAM,CAS9D;AAkCD;;uEAEuE;AACvE,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,eAAe,EAAE,CAAC;IAAC,UAAU,EAAE,OAAO,CAAA;CAAE,CA0CpG;AAED,MAAM,WAAW,gBAAgB;IAAG,IAAI,EAAE,qCAAqC,GAAG,0BAA0B,GAAG,yBAAyB,GAAG,mBAAmB,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE;AACrL,wBAAsB,WAAW,CAAC,EAAE,EAAE,QAAQ,EAAE,OAAO,UAAQ,GAAG,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,gBAAgB,EAAE,CAAA;CAAE,CAAC,CAmG7I;AAED,OAAO,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { type CredentialChainOptions } from '@hasna/contracts/client';
|
|
3
|
+
import { type SubscriptionsMetadataReader } from './subscriptions-registry.js';
|
|
3
4
|
/** Test injection for the accounts credential chain (keychain runner, tier-1 key). */
|
|
4
5
|
export interface ResolveAccountsStoreOptions {
|
|
5
6
|
credentials?: CredentialChainOptions;
|
|
7
|
+
subscriptionsCredentials?: CredentialChainOptions;
|
|
8
|
+
readSubscriptionsMetadata?: SubscriptionsMetadataReader;
|
|
6
9
|
}
|
|
7
10
|
/** Minimal profile record — the fields economy's attribution reads. */
|
|
8
11
|
declare const profileSchema: z.ZodObject<{
|
|
@@ -14,6 +17,16 @@ declare const profileSchema: z.ZodObject<{
|
|
|
14
17
|
description: z.ZodOptional<z.ZodString>;
|
|
15
18
|
createdAt: z.ZodString;
|
|
16
19
|
lastUsedAt: z.ZodOptional<z.ZodString>;
|
|
20
|
+
switchedAway: z.ZodOptional<z.ZodObject<{
|
|
21
|
+
profile: z.ZodString;
|
|
22
|
+
email: z.ZodOptional<z.ZodString>;
|
|
23
|
+
}, "strip", z.ZodTypeAny, {
|
|
24
|
+
profile: string;
|
|
25
|
+
email?: string | undefined;
|
|
26
|
+
}, {
|
|
27
|
+
profile: string;
|
|
28
|
+
email?: string | undefined;
|
|
29
|
+
}>>;
|
|
17
30
|
}, "strip", z.ZodTypeAny, {
|
|
18
31
|
name: string;
|
|
19
32
|
dir: string;
|
|
@@ -23,6 +36,10 @@ declare const profileSchema: z.ZodObject<{
|
|
|
23
36
|
email?: string | undefined;
|
|
24
37
|
displayName?: string | undefined;
|
|
25
38
|
lastUsedAt?: string | undefined;
|
|
39
|
+
switchedAway?: {
|
|
40
|
+
profile: string;
|
|
41
|
+
email?: string | undefined;
|
|
42
|
+
} | undefined;
|
|
26
43
|
}, {
|
|
27
44
|
name: string;
|
|
28
45
|
dir: string;
|
|
@@ -32,6 +49,10 @@ declare const profileSchema: z.ZodObject<{
|
|
|
32
49
|
email?: string | undefined;
|
|
33
50
|
displayName?: string | undefined;
|
|
34
51
|
lastUsedAt?: string | undefined;
|
|
52
|
+
switchedAway?: {
|
|
53
|
+
profile: string;
|
|
54
|
+
email?: string | undefined;
|
|
55
|
+
} | undefined;
|
|
35
56
|
}>;
|
|
36
57
|
/** Minimal tool definition — economy reads `id` and `envVar` (dir matching). */
|
|
37
58
|
declare const toolDefSchema: z.ZodObject<{
|
|
@@ -62,9 +83,11 @@ export type ToolDef = z.infer<typeof toolDefSchema>;
|
|
|
62
83
|
*/
|
|
63
84
|
export interface AccountsStore {
|
|
64
85
|
readonly transport: 'local' | 'api' | 'none';
|
|
86
|
+
readonly registry?: 'accounts' | 'subscriptions';
|
|
65
87
|
listProfiles(tool?: string): Promise<Profile[]>;
|
|
66
88
|
findProfile(name: string, tool?: string): Promise<Profile | undefined>;
|
|
67
89
|
currentProfile(tool: string): Promise<Profile | undefined>;
|
|
90
|
+
appliedProfile?(tool: string): Promise<Profile | undefined>;
|
|
68
91
|
listTools(): Promise<ToolDef[]>;
|
|
69
92
|
}
|
|
70
93
|
/**
|
|
@@ -84,7 +107,8 @@ export declare function appliedProfileName(toolId: string): string | undefined;
|
|
|
84
107
|
* Stale `*_STORAGE_MODE` / `*_MODE` variables are ignored — they never select
|
|
85
108
|
* a store and never error (owner directive 2026-08-15).
|
|
86
109
|
*
|
|
87
|
-
*
|
|
110
|
+
* With neither a legacy Accounts nor current Subscriptions credential, the
|
|
111
|
+
* on-box JSON registry is served ONLY under economy's
|
|
88
112
|
* explicit local opt-in (`HASNA_ECONOMY_LOCAL=1` / `ECONOMY_LOCAL=1`); every
|
|
89
113
|
* other run gets {@link NoRegistryStore} — no on-box read, attribution absent,
|
|
90
114
|
* one stderr line. Serving the on-box registry to a hosted client was the last
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accounts-store.d.ts","sourceRoot":"","sources":["../../src/lib/accounts-store.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"accounts-store.d.ts","sourceRoot":"","sources":["../../src/lib/accounts-store.ts"],"names":[],"mappings":"AA4CA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAA6C,KAAK,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AAEhH,OAAO,EAAyB,KAAK,2BAA2B,EAAE,MAAM,6BAA6B,CAAA;AAKrG,sFAAsF;AACtF,MAAM,WAAW,2BAA2B;IAC1C,WAAW,CAAC,EAAE,sBAAsB,CAAA;IACpC,wBAAwB,CAAC,EAAE,sBAAsB,CAAA;IACjD,yBAAyB,CAAC,EAAE,2BAA2B,CAAA;CACxD;AAKD,uEAAuE;AACvE,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUjB,CAAA;AAEF,gFAAgF;AAChF,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;EAMjB,CAAA;AAYF,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,a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C,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,cAAc,EAAE,UAAU,GAAG,KAAK,GAAG,SAAS,GAAG,SAAS,CAAA;CAC3D;
|
|
1
|
+
{"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../src/lib/accounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,KAAK,2BAA2B,EAAE,MAAM,qBAAqB,CAAA;AAExG,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAExC,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,cAAc,EAAE,UAAU,GAAG,KAAK,GAAG,SAAS,GAAG,SAAS,CAAA;CAC3D;AAuFD,wBAAsB,sBAAsB,CAC1C,KAAK,EAAE,KAAK,EACZ,GAAG,GAAE,MAAM,CAAC,UAAwB,EACpC,OAAO,GAAE,2BAAgC,GACxC,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAmCpC;AAED,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,EAC1C,MAAM,EAAE,CAAC,EACT,OAAO,EAAE,kBAAkB,GAAG,IAAI,GACjC,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAUjC"}
|
package/dist/lib/paths.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/lib/paths.ts"],"names":[],"mappings":"AAIA,sEAAsE;AACtE,wBAAgB,UAAU,IAAI,MAAM,CAEnC;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG/C;AAED,wBAAgB,UAAU;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/lib/paths.ts"],"names":[],"mappings":"AAIA,sEAAsE;AACtE,wBAAgB,UAAU,IAAI,MAAM,CAEnC;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG/C;AAED,wBAAgB,UAAU;;;;;;;;;;;;;;EAmBzB;AAED,wBAAgB,kBAAkB,IAAI,MAAM,EAAE,CAE7C"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { AccountsStore, Profile, ToolDef } from './accounts-store.js';
|
|
2
|
+
/** Read-only, package-owned metadata. Never project a credential into argv. */
|
|
3
|
+
export type SubscriptionsMetadataReader = (args: string[], env: NodeJS.ProcessEnv) => Promise<unknown>;
|
|
4
|
+
export declare const readSubscriptionsMetadata: SubscriptionsMetadataReader;
|
|
5
|
+
/**
|
|
6
|
+
* The installed Subscriptions package owns station-local paths and applied
|
|
7
|
+
* bindings. Its hosted list combines those with the authoritative API records.
|
|
8
|
+
* Do not copy its home migration rules, read its registry file, or infer that
|
|
9
|
+
* the fleet-wide "current" selection identifies this station's running account.
|
|
10
|
+
*/
|
|
11
|
+
export declare class SubscriptionsRegistry implements AccountsStore {
|
|
12
|
+
private readonly read;
|
|
13
|
+
readonly transport: "api";
|
|
14
|
+
readonly registry: "subscriptions";
|
|
15
|
+
private readonly env;
|
|
16
|
+
private profiles?;
|
|
17
|
+
private tools?;
|
|
18
|
+
constructor(baseUrl: string, env: NodeJS.ProcessEnv, read?: SubscriptionsMetadataReader);
|
|
19
|
+
private allProfiles;
|
|
20
|
+
listProfiles(tool?: string): Promise<Profile[]>;
|
|
21
|
+
findProfile(name: string, tool?: string): Promise<Profile | undefined>;
|
|
22
|
+
appliedProfile(tool: string): Promise<Profile | undefined>;
|
|
23
|
+
currentProfile(_tool: string): Promise<Profile | undefined>;
|
|
24
|
+
listTools(): Promise<ToolDef[]>;
|
|
25
|
+
}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OAAO,EAAE,CAAC;CAOtC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { CredentialChainOptions } from '@hasna/contracts/client';
|
|
2
2
|
export declare const FIXTURE_STATION = "economy-hermetic-fixture";
|
|
3
|
-
export declare function fixtureKeychainArgs(app: 'economy' | 'accounts', kind: 'api-key' | 'api-url'): string[];
|
|
4
|
-
export declare function absentFixtureKeychain(app: 'economy' | 'accounts'): {
|
|
3
|
+
export declare function fixtureKeychainArgs(app: 'economy' | 'accounts' | 'subscriptions', kind: 'api-key' | 'api-url'): string[];
|
|
4
|
+
export declare function absentFixtureKeychain(app: 'economy' | 'accounts' | 'subscriptions'): {
|
|
5
5
|
credentials: CredentialChainOptions;
|
|
6
|
+
subscriptionsCredentials?: CredentialChainOptions;
|
|
6
7
|
};
|
|
7
8
|
/** Explicit --preload is confined to the test child; installed clients are unchanged. */
|
|
8
9
|
export declare function fixtureBunArgs(home: string): string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-keychain-fixture.d.ts","sourceRoot":"","sources":["../../src/lib/test-keychain-fixture.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AAErE,eAAO,MAAM,eAAe,6BAA6B,CAAA;AAEzD,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,SAAS,GAAG,UAAU,EAAE,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"test-keychain-fixture.d.ts","sourceRoot":"","sources":["../../src/lib/test-keychain-fixture.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AAErE,eAAO,MAAM,eAAe,6BAA6B,CAAA;AAEzD,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,SAAS,GAAG,UAAU,GAAG,eAAe,EAAE,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,EAAE,CAExH;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,SAAS,GAAG,UAAU,GAAG,eAAe,GAAG;IAAE,WAAW,EAAE,sBAAsB,CAAC;IAAC,wBAAwB,CAAC,EAAE,sBAAsB,CAAA;CAAE,CAS/K;AAED,yFAAyF;AACzF,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAerD"}
|