@adonis-agora/agent 0.93.0 → 0.95.0
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 +20 -0
- package/dist/assets/spa/assets/{index-DUq09Q_k.js → index-DBu17cDY.js} +1 -1
- package/dist/assets/spa/index.html +1 -1
- package/dist/providers/agent_provider.d.ts.map +1 -1
- package/dist/providers/agent_provider.js +20 -2
- package/dist/providers/agent_provider.js.map +1 -1
- package/dist/providers/poppy_connections_provider.d.ts +1 -1
- package/dist/providers/poppy_connections_provider.js +1 -1
- package/dist/providers/poppy_provider.d.ts +1 -1
- package/dist/providers/poppy_provider.d.ts.map +1 -1
- package/dist/providers/poppy_provider.js +6 -6
- package/dist/providers/poppy_provider.js.map +1 -1
- package/dist/src/agent-service.d.ts +11 -1
- package/dist/src/agent-service.d.ts.map +1 -1
- package/dist/src/agent-service.js +13 -4
- package/dist/src/agent-service.js.map +1 -1
- package/dist/src/diagnostics.d.ts +2 -0
- package/dist/src/diagnostics.d.ts.map +1 -1
- package/dist/src/diagnostics.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/mcp/auth.d.ts +3 -3
- package/dist/src/mcp/auth.d.ts.map +1 -1
- package/dist/src/mcp/auth.js +2 -29
- package/dist/src/mcp/auth.js.map +1 -1
- package/dist/src/mcp/discovery.d.ts +3 -3
- package/dist/src/mcp/discovery.d.ts.map +1 -1
- package/dist/src/mcp/discovery.js +2 -2
- package/dist/src/poppy/auth.d.ts +20 -16
- package/dist/src/poppy/auth.d.ts.map +1 -1
- package/dist/src/poppy/auth.js.map +1 -1
- package/dist/src/poppy/conversations.d.ts +25 -25
- package/dist/src/poppy/conversations.d.ts.map +1 -1
- package/dist/src/poppy/conversations.js +37 -37
- package/dist/src/poppy/conversations.js.map +1 -1
- package/dist/src/poppy/define_config.d.ts +7 -7
- package/dist/src/poppy/define_config.d.ts.map +1 -1
- package/dist/src/poppy/define_config.js +1 -1
- package/dist/src/poppy/endpoints.d.ts +2 -2
- package/dist/src/poppy/endpoints.js +1 -1
- package/dist/src/poppy/handler.d.ts +5 -5
- package/dist/src/poppy/handler.d.ts.map +1 -1
- package/dist/src/poppy/handler.js +23 -21
- package/dist/src/poppy/handler.js.map +1 -1
- package/dist/src/poppy/index.d.ts +2 -2
- package/dist/src/poppy/index.d.ts.map +1 -1
- package/dist/src/poppy/index.js +1 -1
- package/dist/src/poppy/index.js.map +1 -1
- package/dist/src/poppy/protocol.d.ts +30 -23
- package/dist/src/poppy/protocol.d.ts.map +1 -1
- package/dist/src/poppy/protocol.js +16 -17
- package/dist/src/poppy/protocol.js.map +1 -1
- package/dist/src/poppy/redis-store.d.ts +1 -1
- package/dist/src/poppy/redis-store.js +1 -1
- package/dist/src/poppy/store.d.ts +7 -7
- package/dist/src/poppy/store.js +1 -1
- package/dist/src/poppy-client/api.d.ts +5 -4
- package/dist/src/poppy-client/api.d.ts.map +1 -1
- package/dist/src/poppy-client/api.js +14 -9
- package/dist/src/poppy-client/api.js.map +1 -1
- package/dist/src/poppy-client/browser.d.ts +12 -18
- package/dist/src/poppy-client/browser.d.ts.map +1 -1
- package/dist/src/poppy-client/browser.js +33 -73
- package/dist/src/poppy-client/browser.js.map +1 -1
- package/dist/src/poppy-client/cli/main.d.ts.map +1 -1
- package/dist/src/poppy-client/cli/main.js +48 -56
- package/dist/src/poppy-client/cli/main.js.map +1 -1
- package/dist/src/poppy-client/company.d.ts +43 -28
- package/dist/src/poppy-client/company.d.ts.map +1 -1
- package/dist/src/poppy-client/company.js +216 -160
- package/dist/src/poppy-client/company.js.map +1 -1
- package/dist/src/poppy-client/conversations.d.ts +12 -13
- package/dist/src/poppy-client/conversations.d.ts.map +1 -1
- package/dist/src/poppy-client/conversations.js +24 -22
- package/dist/src/poppy-client/conversations.js.map +1 -1
- package/dist/src/poppy-client/discovery.d.ts +32 -10
- package/dist/src/poppy-client/discovery.d.ts.map +1 -1
- package/dist/src/poppy-client/discovery.js +134 -68
- package/dist/src/poppy-client/discovery.js.map +1 -1
- package/dist/src/poppy-client/dpop.d.ts +2 -1
- package/dist/src/poppy-client/dpop.d.ts.map +1 -1
- package/dist/src/poppy-client/dpop.js +2 -1
- package/dist/src/poppy-client/dpop.js.map +1 -1
- package/dist/src/poppy-client/errors.d.ts +5 -4
- package/dist/src/poppy-client/errors.d.ts.map +1 -1
- package/dist/src/poppy-client/errors.js +5 -4
- package/dist/src/poppy-client/errors.js.map +1 -1
- package/dist/src/poppy-client/http.d.ts +4 -2
- package/dist/src/poppy-client/http.d.ts.map +1 -1
- package/dist/src/poppy-client/http.js +9 -5
- package/dist/src/poppy-client/http.js.map +1 -1
- package/dist/src/poppy-client/identity.d.ts +15 -15
- package/dist/src/poppy-client/identity.d.ts.map +1 -1
- package/dist/src/poppy-client/identity.js +17 -33
- package/dist/src/poppy-client/identity.js.map +1 -1
- package/dist/src/poppy-client/index.d.ts +6 -3
- package/dist/src/poppy-client/index.d.ts.map +1 -1
- package/dist/src/poppy-client/index.js +6 -3
- package/dist/src/poppy-client/index.js.map +1 -1
- package/dist/src/poppy-client/llm.js +4 -4
- package/dist/src/poppy-client/llm.js.map +1 -1
- package/dist/src/poppy-client/mcp.d.ts +3 -4
- package/dist/src/poppy-client/mcp.d.ts.map +1 -1
- package/dist/src/poppy-client/mcp.js +26 -38
- package/dist/src/poppy-client/mcp.js.map +1 -1
- package/dist/src/poppy-client/safe_fetch.d.ts +30 -0
- package/dist/src/poppy-client/safe_fetch.d.ts.map +1 -0
- package/dist/src/poppy-client/safe_fetch.js +210 -0
- package/dist/src/poppy-client/safe_fetch.js.map +1 -0
- package/dist/src/poppy-client/session_jwt.d.ts +20 -0
- package/dist/src/poppy-client/session_jwt.d.ts.map +1 -0
- package/dist/src/poppy-client/session_jwt.js +37 -0
- package/dist/src/poppy-client/session_jwt.js.map +1 -0
- package/dist/src/poppy-client/signin.d.ts +34 -11
- package/dist/src/poppy-client/signin.d.ts.map +1 -1
- package/dist/src/poppy-client/signin.js +134 -80
- package/dist/src/poppy-client/signin.js.map +1 -1
- package/dist/src/poppy-client/store.d.ts +23 -11
- package/dist/src/poppy-client/store.d.ts.map +1 -1
- package/dist/src/poppy-client/store.js +1 -1
- package/dist/src/poppy-client/store.js.map +1 -1
- package/dist/src/poppy-client/task_coverage.d.ts +13 -0
- package/dist/src/poppy-client/task_coverage.d.ts.map +1 -0
- package/dist/src/poppy-client/task_coverage.js +66 -0
- package/dist/src/poppy-client/task_coverage.js.map +1 -0
- package/dist/src/poppy-client/token_client.d.ts +36 -33
- package/dist/src/poppy-client/token_client.d.ts.map +1 -1
- package/dist/src/poppy-client/token_client.js +47 -47
- package/dist/src/poppy-client/token_client.js.map +1 -1
- package/dist/src/poppy-client/types.d.ts +81 -42
- package/dist/src/poppy-client/types.d.ts.map +1 -1
- package/dist/src/poppy-client/types.js +1 -1
- package/dist/src/poppy-client/util.d.ts +12 -3
- package/dist/src/poppy-client/util.d.ts.map +1 -1
- package/dist/src/poppy-client/util.js +29 -9
- package/dist/src/poppy-client/util.js.map +1 -1
- package/dist/src/poppy-connections/config.d.ts +2 -2
- package/dist/src/poppy-connections/config.js +1 -1
- package/dist/src/poppy-connections/config.js.map +1 -1
- package/dist/src/poppy-connections/crypto.d.ts +2 -2
- package/dist/src/poppy-connections/crypto.js +2 -2
- package/dist/src/poppy-connections/index.d.ts +1 -1
- package/dist/src/poppy-connections/index.js +1 -1
- package/dist/src/poppy-connections/service.d.ts +11 -10
- package/dist/src/poppy-connections/service.d.ts.map +1 -1
- package/dist/src/poppy-connections/service.js +33 -21
- package/dist/src/poppy-connections/service.js.map +1 -1
- package/dist/src/poppy-connections/store.d.ts +2 -2
- package/dist/src/poppy-connections/tools.d.ts.map +1 -1
- package/dist/src/poppy-connections/tools.js +5 -4
- package/dist/src/poppy-connections/tools.js.map +1 -1
- package/dist/src/spi/agent-store.d.ts +6 -0
- package/dist/src/spi/agent-store.d.ts.map +1 -1
- package/dist/src/spi/agent-store.js.map +1 -1
- package/dist/src/spi/governance-queries.d.ts +23 -1
- package/dist/src/spi/governance-queries.d.ts.map +1 -1
- package/dist/src/spi/governance-queries.js +16 -1
- package/dist/src/spi/governance-queries.js.map +1 -1
- package/dist/src/stores/lucid-governance-queries.d.ts +2 -2
- package/dist/src/stores/lucid-governance-queries.d.ts.map +1 -1
- package/dist/src/stores/lucid-governance-queries.js +11 -7
- package/dist/src/stores/lucid-governance-queries.js.map +1 -1
- package/dist/src/stores/lucid-schema.d.ts +2 -0
- package/dist/src/stores/lucid-schema.d.ts.map +1 -1
- package/dist/src/stores/lucid-schema.js +12 -0
- package/dist/src/stores/lucid-schema.js.map +1 -1
- package/dist/src/stores/lucid.d.ts +7 -0
- package/dist/src/stores/lucid.d.ts.map +1 -1
- package/dist/src/stores/lucid.js +21 -3
- package/dist/src/stores/lucid.js.map +1 -1
- package/dist/src/testing/in-memory-governance-queries.d.ts +2 -2
- package/dist/src/testing/in-memory-governance-queries.d.ts.map +1 -1
- package/dist/src/testing/in-memory-governance-queries.js +11 -2
- package/dist/src/testing/in-memory-governance-queries.js.map +1 -1
- package/dist/src/testing/in-memory-store.d.ts +2 -0
- package/dist/src/testing/in-memory-store.d.ts.map +1 -1
- package/dist/src/testing/in-memory-store.js +7 -2
- package/dist/src/testing/in-memory-store.js.map +1 -1
- package/dist/src/usage-ledger.d.ts.map +1 -1
- package/dist/src/usage-ledger.js +1 -0
- package/dist/src/usage-ledger.js.map +1 -1
- package/package.json +6 -6
- package/skills/agent-governance/SKILL.md +3 -3
- package/skills/agent-tools/SKILL.md +3 -3
|
@@ -5,21 +5,26 @@ export interface TokenRecord {
|
|
|
5
5
|
/** Epoch ms. */
|
|
6
6
|
expiresAt: number;
|
|
7
7
|
scope: string;
|
|
8
|
-
sessionId: string;
|
|
9
|
-
signedIn: boolean;
|
|
10
8
|
/** RFC 8707 resource this token was issued for, if any. */
|
|
11
9
|
resource?: string | undefined;
|
|
12
10
|
}
|
|
11
|
+
/** The refresh token of a sign-in (4.4). Stored as `accountToken`, its name before Draft 0.3. */
|
|
13
12
|
export interface AccountTokenRecord {
|
|
14
|
-
/**
|
|
13
|
+
/** A secret: never logged or shown (10.2). */
|
|
15
14
|
refreshToken: string;
|
|
16
15
|
scope: string;
|
|
17
16
|
obtainedAt: number;
|
|
18
|
-
/** Epoch ms, from `refresh_token_expires_in` when the Company sets one. */
|
|
19
|
-
expiresAt?: number | undefined;
|
|
20
17
|
/** Which sign-in type produced it. */
|
|
21
18
|
via: 'direct' | 'device' | 'mediated';
|
|
22
19
|
}
|
|
20
|
+
/** The delegated key that signs this User ID's Session JWTs, with its delegation (5.2). */
|
|
21
|
+
export interface DelegationRecord {
|
|
22
|
+
key: StoredKey;
|
|
23
|
+
/** The `pap-delegation+jwt`, compact. */
|
|
24
|
+
jwt: string;
|
|
25
|
+
/** Epoch seconds: the delegation's `exp`. */
|
|
26
|
+
exp: number;
|
|
27
|
+
}
|
|
23
28
|
export interface ConversationRecord {
|
|
24
29
|
endpoint: string;
|
|
25
30
|
/** Last event handled (a cursor / Last-Event-ID). */
|
|
@@ -28,18 +33,25 @@ export interface ConversationRecord {
|
|
|
28
33
|
createdAt: number;
|
|
29
34
|
closed?: boolean | undefined;
|
|
30
35
|
}
|
|
31
|
-
/** Everything the agent remembers about one User at one Company
|
|
36
|
+
/** Everything the agent remembers about one User at one Company, by its identifier (3.2). */
|
|
32
37
|
export interface CompanyState {
|
|
38
|
+
/** The Company's identifier: its issuer, or `https://{domain}` without one (3.2). */
|
|
33
39
|
issuer: string;
|
|
40
|
+
/** Whether `issuer` is a real OAuth issuer, not the domain fallback. */
|
|
41
|
+
hasIssuer?: boolean | undefined;
|
|
42
|
+
/** The protocol version this state was written for; an older one drops tokens and Session. */
|
|
43
|
+
protocol?: string | undefined;
|
|
34
44
|
domains: string[];
|
|
35
|
-
/** Opaque, random, per-Company User ID (
|
|
45
|
+
/** Opaque, random, per-Company User ID (5.1). Never derived from personal information. */
|
|
36
46
|
userId: string;
|
|
37
|
-
/** DPoP key for this User at this Company
|
|
47
|
+
/** DPoP key for this User at this Company. Never published. */
|
|
38
48
|
dpopKey: StoredKey;
|
|
49
|
+
/** One User ID's delegated key: never shared with another User ID (5.2). */
|
|
50
|
+
delegation?: DelegationRecord | undefined;
|
|
39
51
|
accountToken?: AccountTokenRecord | undefined;
|
|
40
|
-
/**
|
|
52
|
+
/** Access tokens by key: `default`, or `{resource}|{scope}|{bearer}`. */
|
|
41
53
|
tokens: Record<string, TokenRecord>;
|
|
42
|
-
/** The current Session's
|
|
54
|
+
/** The current Session's `sid`: random, used for no other Session (5.2). Not a credential. */
|
|
43
55
|
sessionId?: string | undefined;
|
|
44
56
|
conversations: Record<string, ConversationRecord>;
|
|
45
57
|
}
|
|
@@ -59,7 +71,7 @@ export interface StateFile {
|
|
|
59
71
|
}
|
|
60
72
|
export declare function defaultStatePath(): string;
|
|
61
73
|
/**
|
|
62
|
-
* The local state file. It holds private keys and
|
|
74
|
+
* The local state file. It holds private keys and refresh tokens, so it is written with mode
|
|
63
75
|
* 0600 (directory 0700) and atomically (temp file + rename).
|
|
64
76
|
*/
|
|
65
77
|
export declare class StateStore {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/poppy-client/store.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/poppy-client/store.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,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E,YAAY,CAAC;MAuDjE;IAID;;;;OAIG;IACH,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAIpB;CAYF"}
|
|
@@ -9,7 +9,7 @@ export function defaultStatePath() {
|
|
|
9
9
|
return join(base, 'poppy-agent', 'state.json');
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
|
-
* The local state file. It holds private keys and
|
|
12
|
+
* The local state file. It holds private keys and refresh tokens, so it is written with mode
|
|
13
13
|
* 0600 (directory 0700) and atomically (temp file + rename).
|
|
14
14
|
*/
|
|
15
15
|
export class StateStore {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../../src/poppy-client/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../../src/poppy-client/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AA8E1C,MAAM,UAAU,gBAAgB;IAC9B,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB;QAAE,OAAO,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;IACxE,MAAM,IAAI,GAAG,OAAO,CA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EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QACjF,MAAM,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACxB,MAAM,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;CACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CompanyClient } from './company.js';
|
|
2
|
+
import type { ExcludedTask, TaskAlternative } from './types.js';
|
|
3
|
+
/** The public list of tasks the Company chose not to offer (9.1): a GET with no token. */
|
|
4
|
+
export declare function excludedTasks(company: CompanyClient): Promise<ExcludedTask[]>;
|
|
5
|
+
/**
|
|
6
|
+
* Reports a task that can't be done through this protocol (9.3). Answers the Company's alternative
|
|
7
|
+
* when it has one (HTTP 200), or `null` (HTTP 202). No personal data or secrets in the report.
|
|
8
|
+
*/
|
|
9
|
+
export declare function sendFeedback(company: CompanyClient, report: {
|
|
10
|
+
task: string;
|
|
11
|
+
description: string;
|
|
12
|
+
}): Promise<TaskAlternative | null>;
|
|
13
|
+
//# sourceMappingURL=task_coverage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task_coverage.d.ts","sourceRoot":"","sources":["../../../src/poppy-client/task_coverage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAIlD,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAiB,MAAM,YAAY,CAAC;AAyB/E,0FAA0F;AAC1F,wBAAsB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAenF;AAED;;;GAGG;AACH,wBAAsB,YAAY,CAChC,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAC5C,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAajC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { throwForResponse } from './company.js';
|
|
2
|
+
import { PoppyError } from './errors.js';
|
|
3
|
+
import { readJson } from './http.js';
|
|
4
|
+
import { requireSecureUrl } from './util.js';
|
|
5
|
+
/**
|
|
6
|
+
* Drops what 9.2 says to ignore: references of a type this client doesn't know, and `openapi` or
|
|
7
|
+
* `mcp` references to an API the Company doesn't list, so an alternative can't aim it elsewhere.
|
|
8
|
+
*/
|
|
9
|
+
function safeAlternative(company, alternative) {
|
|
10
|
+
if (!alternative || typeof alternative !== 'object')
|
|
11
|
+
return undefined;
|
|
12
|
+
const listed = (type, url) => (company.document.apis ?? []).some((a) => a?.type === type && a.url === url);
|
|
13
|
+
const references = Array.isArray(alternative.references)
|
|
14
|
+
? alternative.references.filter((r) => {
|
|
15
|
+
if (r?.type === 'web')
|
|
16
|
+
return typeof r.url === 'string';
|
|
17
|
+
return (r?.type === 'openapi' || r?.type === 'mcp') && listed(r.type, r.url);
|
|
18
|
+
})
|
|
19
|
+
: undefined;
|
|
20
|
+
if (typeof alternative.instructions !== 'string' && !references?.length)
|
|
21
|
+
return undefined;
|
|
22
|
+
const { references: _raw, ...rest } = alternative;
|
|
23
|
+
return { ...rest, ...(references ? { references } : {}) };
|
|
24
|
+
}
|
|
25
|
+
/** The public list of tasks the Company chose not to offer (9.1): a GET with no token. */
|
|
26
|
+
export async function excludedTasks(company) {
|
|
27
|
+
const url = company.document.excluded_tasks?.url;
|
|
28
|
+
if (!url)
|
|
29
|
+
return [];
|
|
30
|
+
requireSecureUrl(url, 'excluded_tasks.url', company.security);
|
|
31
|
+
const res = await company.http.request(url, { headers: { accept: 'application/json' } });
|
|
32
|
+
if (!res.ok)
|
|
33
|
+
throw new PoppyError(`http_${res.status}`, `could not load ${url}`);
|
|
34
|
+
const doc = await readJson(res);
|
|
35
|
+
if (!Array.isArray(doc?.tasks))
|
|
36
|
+
throw new PoppyError('invalid_response', 'tasks must be a list');
|
|
37
|
+
return doc.tasks
|
|
38
|
+
.filter((t) => typeof t?.task === 'string')
|
|
39
|
+
.map((t) => {
|
|
40
|
+
const alternative = safeAlternative(company, t.alternative);
|
|
41
|
+
const { alternative: _raw, ...rest } = t;
|
|
42
|
+
return alternative ? { ...rest, alternative } : rest;
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Reports a task that can't be done through this protocol (9.3). Answers the Company's alternative
|
|
47
|
+
* when it has one (HTTP 200), or `null` (HTTP 202). No personal data or secrets in the report.
|
|
48
|
+
*/
|
|
49
|
+
export async function sendFeedback(company, report) {
|
|
50
|
+
const endpoint = company.document.feedback?.endpoint;
|
|
51
|
+
if (!endpoint)
|
|
52
|
+
throw new PoppyError('no_feedback_endpoint', 'Company lists no feedback endpoint');
|
|
53
|
+
requireSecureUrl(endpoint, 'feedback.endpoint', company.security);
|
|
54
|
+
const res = await company.fetch(endpoint, {
|
|
55
|
+
method: 'POST',
|
|
56
|
+
headers: { 'content-type': 'application/json', accept: 'application/json' },
|
|
57
|
+
body: JSON.stringify({ task: report.task, description: report.description }),
|
|
58
|
+
signedOut: true,
|
|
59
|
+
});
|
|
60
|
+
if (res.status === 202)
|
|
61
|
+
return null;
|
|
62
|
+
if (!res.ok)
|
|
63
|
+
await throwForResponse(res);
|
|
64
|
+
return safeAlternative(company, await readJson(res)) ?? null;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=task_coverage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task_coverage.js","sourceRoot":"","sources":["../../../src/poppy-client/task_coverage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C;;;GAGG;AACH,SAAS,eAAe,CAC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,CAAC,QAAQ,EAAE,QAAQ,CAAC;IACrD,IAAI,CAAC,QAAQ;QAAE,MAAM,IAAI,UAAU,CAAC,sBAAsB,EAAE,oCAAoC,CAAC,CAAC;IAClG,gBAAgB,CAAC,QAAQ,EAAE,mBAAmB,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAClE,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE;QACxC,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,EAAE,kBAAkB,EAAE;QAC3E,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,CAAC;QAC5E,SAAS,EAAE,IAAI;KAChB,CAAC,CAAC;IACH,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG;QAAE,OAAO,IAAI,CAAC;IACpC,IAAI,CAAC,GAAG,CAAC,EAAE;QAAE,MAAM,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACzC,OAAO,eAAe,CAAC,OAAO,EAAE,MAAM,QAAQ,CAAkB,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC;AAChF,CAAC"}
|
|
@@ -2,68 +2,71 @@ import type { DpopKey } from './dpop.js';
|
|
|
2
2
|
import { type PoppyHttp } from './http.js';
|
|
3
3
|
import type { AgentIdentity } from './identity.js';
|
|
4
4
|
import type { AuthServerMetadata, DeviceAuthorizationResponse, TokenResponse } from './types.js';
|
|
5
|
-
export declare const GRANT_JWT_BEARER = "urn:ietf:params:oauth:grant-type:jwt-bearer";
|
|
6
5
|
export declare const GRANT_DEVICE_CODE = "urn:ietf:params:oauth:grant-type:device_code";
|
|
6
|
+
export declare const GRANT_MEDIATED_SIGN_IN = "https://personalagentprotocol.org/grant/mediated-sign-in";
|
|
7
7
|
export declare const CLIENT_ASSERTION_TYPE = "urn:ietf:params:oauth:client-assertion-type:jwt-bearer";
|
|
8
|
-
export interface TokenClientOptions {
|
|
9
|
-
/**
|
|
10
|
-
* `aud` of the client assertion. RFC 7523 allows the token endpoint URL (the default here,
|
|
11
|
-
* matching the spec's examples) or the issuer identifier.
|
|
12
|
-
*/
|
|
13
|
-
clientAssertionAudience?: 'token_endpoint' | 'issuer' | undefined;
|
|
14
|
-
}
|
|
15
8
|
export interface NarrowingParams {
|
|
16
|
-
/** Ask for fewer scopes than the
|
|
9
|
+
/** Ask for fewer scopes than the refresh token has (4.4). */
|
|
17
10
|
scope?: string | undefined;
|
|
18
|
-
/** RFC 8707 resource indicator. */
|
|
11
|
+
/** RFC 8707 resource indicator (4.5). */
|
|
19
12
|
resource?: string | undefined;
|
|
20
13
|
}
|
|
21
14
|
/**
|
|
22
|
-
* OAuth calls against the Company's authorization server (section 4): every request carries
|
|
23
|
-
*
|
|
24
|
-
*
|
|
15
|
+
* OAuth calls against the Company's authorization server (section 4): every request carries a
|
|
16
|
+
* `private_key_jwt` client assertion addressed to the issuer (4.1). Token requests carry a DPoP
|
|
17
|
+
* proof when one is given, and the response's `token_type` says what the Company did with it (4.5).
|
|
25
18
|
*/
|
|
26
19
|
export declare class TokenClient {
|
|
27
20
|
private readonly identity;
|
|
28
21
|
readonly metadata: AuthServerMetadata;
|
|
29
22
|
private readonly http;
|
|
30
|
-
|
|
31
|
-
constructor(identity: AgentIdentity, metadata: AuthServerMetadata, http: PoppyHttp, opts?: TokenClientOptions);
|
|
23
|
+
constructor(identity: AgentIdentity, metadata: AuthServerMetadata, http: PoppyHttp);
|
|
32
24
|
private clientAuth;
|
|
33
25
|
/** POSTs a form; the builder runs per attempt so retries get fresh assertions. */
|
|
34
26
|
private post;
|
|
35
27
|
private toError;
|
|
36
|
-
/**
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
dpop?: DpopKey | undefined;
|
|
43
|
-
} & NarrowingParams): Promise<TokenResponse>;
|
|
44
|
-
/** Account Token grant (4.8): signs a Session in, or starts a new signed-in Session. */
|
|
28
|
+
/**
|
|
29
|
+
* Any token-endpoint grant (4.7). `requested` is what `scope` means when the response leaves it
|
|
30
|
+
* out: the Company granted exactly the scopes requested (RFC 6749 section 5.1).
|
|
31
|
+
*/
|
|
32
|
+
token(params: () => Promise<Record<string, string | undefined>>, requested: string | undefined, dpop?: DpopKey | undefined): Promise<TokenResponse>;
|
|
33
|
+
/** Refresh (4.4). A token response may leave `refresh_token` out: keep using the one you have. */
|
|
45
34
|
refresh(input: {
|
|
46
35
|
refreshToken: string;
|
|
47
|
-
|
|
36
|
+
/** The refresh token's scopes: what `scope` means when the response omits it. */
|
|
37
|
+
grantedScope: string;
|
|
48
38
|
dpop?: DpopKey | undefined;
|
|
49
39
|
} & NarrowingParams): Promise<TokenResponse>;
|
|
50
|
-
/** Direct Sign-In code exchange (4.
|
|
40
|
+
/** Direct Sign-In code exchange (4.2). */
|
|
51
41
|
authorizationCode(input: {
|
|
52
42
|
code: string;
|
|
53
43
|
redirectUri: string;
|
|
54
44
|
codeVerifier: string;
|
|
55
|
-
|
|
56
|
-
dpop
|
|
45
|
+
scope: string;
|
|
46
|
+
dpop?: DpopKey | undefined;
|
|
57
47
|
}): Promise<TokenResponse>;
|
|
58
|
-
/** Device Sign-In step 1 (4.
|
|
48
|
+
/** Device Sign-In step 1 (4.3). */
|
|
59
49
|
deviceAuthorization(scope: string): Promise<DeviceAuthorizationResponse>;
|
|
60
|
-
/** Device Sign-In polling (4.
|
|
50
|
+
/** Device Sign-In polling (4.3). Throws `authorization_pending` / `slow_down` etc. */
|
|
61
51
|
deviceToken(input: {
|
|
62
52
|
deviceCode: string;
|
|
63
|
-
|
|
64
|
-
dpop
|
|
53
|
+
scope: string;
|
|
54
|
+
dpop?: DpopKey | undefined;
|
|
55
|
+
}): Promise<TokenResponse>;
|
|
56
|
+
/** The Mediated Sign-In grant (extension, section 3): credentials as form parameters. */
|
|
57
|
+
mediated(input: {
|
|
58
|
+
scope: string;
|
|
59
|
+
credentials: Record<string, string>;
|
|
60
|
+
dpop?: DpopKey | undefined;
|
|
61
|
+
}): Promise<TokenResponse>;
|
|
62
|
+
/** The same grant again with the one-time code, without credentials or `scope` (section 4). */
|
|
63
|
+
mediatedCode(input: {
|
|
64
|
+
signInId: string;
|
|
65
|
+
code: string;
|
|
66
|
+
scope: string;
|
|
67
|
+
dpop?: DpopKey | undefined;
|
|
65
68
|
}): Promise<TokenResponse>;
|
|
66
|
-
/** RFC 7009 revocation of
|
|
69
|
+
/** RFC 7009 revocation of a refresh token (4.6). */
|
|
67
70
|
revoke(token: string, hint?: 'refresh_token' | 'access_token'): Promise<void>;
|
|
68
71
|
}
|
|
69
72
|
//# sourceMappingURL=token_client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token_client.d.ts","sourceRoot":"","sources":["../../../src/poppy-client/token_client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,WAAW,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGjG,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"token_client.d.ts","sourceRoot":"","sources":["../../../src/poppy-client/token_client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,WAAW,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGjG,eAAO,MAAM,iBAAiB,iDAAiD,CAAC;AA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AO,CAAC,aAAa,CAAC,CAWzB;IAED,mCAAmC;IAC7B,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAa7E;IAED,sFAAsF;IACtF,WAAW,CAAC,KAAK,EAAE;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;KAC5B,GAAG,OAAO,CAAC,aAAa,CAAC,CAMzB;IAED,yFAAyF;IACzF,QAAQ,CAAC,KAAK,EAAE;QACd,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACpC,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;KAC5B,GAAG,OAAO,CAAC,aAAa,CAAC,CAUzB;IAED,+FAA+F;IAC/F,YAAY,CAAC,KAAK,EAAE;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;KAC5B,GAAG,OAAO,CAAC,aAAa,CAAC,CAUzB;IAED,oDAAoD;IAC9C,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,GAAE,eAAe,GAAG,cAAgC,iBAMnF;CACF"}
|
|
@@ -1,33 +1,30 @@
|
|
|
1
1
|
import { OAuthError } from './errors.js';
|
|
2
2
|
import { readJson } from './http.js';
|
|
3
3
|
import { parseRetryAfter } from './util.js';
|
|
4
|
-
export const GRANT_JWT_BEARER = 'urn:ietf:params:oauth:grant-type:jwt-bearer';
|
|
5
4
|
export const GRANT_DEVICE_CODE = 'urn:ietf:params:oauth:grant-type:device_code';
|
|
5
|
+
export const GRANT_MEDIATED_SIGN_IN = 'https://personalagentprotocol.org/grant/mediated-sign-in';
|
|
6
6
|
export const CLIENT_ASSERTION_TYPE = 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer';
|
|
7
|
+
/** Client-side RFC 6749 defaults for what a token response may leave out. */
|
|
8
|
+
const DEFAULT_EXPIRES_IN = 3600;
|
|
7
9
|
/**
|
|
8
|
-
* OAuth calls against the Company's authorization server (section 4): every request carries
|
|
9
|
-
*
|
|
10
|
-
*
|
|
10
|
+
* OAuth calls against the Company's authorization server (section 4): every request carries a
|
|
11
|
+
* `private_key_jwt` client assertion addressed to the issuer (4.1). Token requests carry a DPoP
|
|
12
|
+
* proof when one is given, and the response's `token_type` says what the Company did with it (4.5).
|
|
11
13
|
*/
|
|
12
14
|
export class TokenClient {
|
|
13
15
|
identity;
|
|
14
16
|
metadata;
|
|
15
17
|
http;
|
|
16
|
-
|
|
17
|
-
constructor(identity, metadata, http, opts = {}) {
|
|
18
|
+
constructor(identity, metadata, http) {
|
|
18
19
|
this.identity = identity;
|
|
19
20
|
this.metadata = metadata;
|
|
20
21
|
this.http = http;
|
|
21
|
-
this.opts = opts;
|
|
22
22
|
}
|
|
23
23
|
async clientAuth() {
|
|
24
|
-
const aud = this.opts.clientAssertionAudience === 'issuer'
|
|
25
|
-
? this.metadata.issuer
|
|
26
|
-
: this.metadata.token_endpoint;
|
|
27
24
|
return {
|
|
28
25
|
client_id: this.identity.clientId,
|
|
29
26
|
client_assertion_type: CLIENT_ASSERTION_TYPE,
|
|
30
|
-
client_assertion: await this.identity.clientAssertion(
|
|
27
|
+
client_assertion: await this.identity.clientAssertion(this.metadata.issuer),
|
|
31
28
|
};
|
|
32
29
|
}
|
|
33
30
|
/** POSTs a form; the builder runs per attempt so retries get fresh assertions. */
|
|
@@ -39,6 +36,7 @@ export class TokenClient {
|
|
|
39
36
|
accept: 'application/json',
|
|
40
37
|
},
|
|
41
38
|
dpop,
|
|
39
|
+
redirect: 'manual',
|
|
42
40
|
body: async () => {
|
|
43
41
|
const params = { ...(await build()), ...(await this.clientAuth()) };
|
|
44
42
|
const form = new URLSearchParams();
|
|
@@ -59,8 +57,11 @@ export class TokenClient {
|
|
|
59
57
|
details: r.body,
|
|
60
58
|
});
|
|
61
59
|
}
|
|
62
|
-
/**
|
|
63
|
-
|
|
60
|
+
/**
|
|
61
|
+
* Any token-endpoint grant (4.7). `requested` is what `scope` means when the response leaves it
|
|
62
|
+
* out: the Company granted exactly the scopes requested (RFC 6749 section 5.1).
|
|
63
|
+
*/
|
|
64
|
+
async token(params, requested, dpop) {
|
|
64
65
|
const r = await this.post(this.metadata.token_endpoint, params, dpop);
|
|
65
66
|
if (r.status !== 200 || !r.body)
|
|
66
67
|
throw this.toError(r);
|
|
@@ -70,54 +71,41 @@ export class TokenClient {
|
|
|
70
71
|
description: 'no access_token in token response',
|
|
71
72
|
});
|
|
72
73
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
const type = String(t.token_type).toLowerCase();
|
|
75
|
+
if (type !== 'bearer' && type !== 'dpop') {
|
|
76
|
+
throw new OAuthError('invalid_response', {
|
|
77
|
+
description: `unsupported token_type ${t.token_type}`,
|
|
78
|
+
});
|
|
78
79
|
}
|
|
79
|
-
|
|
80
|
-
if (String(t.token_type).toLowerCase() !== expected) {
|
|
81
|
-
// RFC 9449 section 5: a client that sent a proof must not accept a downgraded token.
|
|
80
|
+
if (type === 'dpop' && !dpop) {
|
|
82
81
|
throw new OAuthError('invalid_response', {
|
|
83
|
-
description:
|
|
82
|
+
description: 'a DPoP-bound token for a request without a proof',
|
|
84
83
|
});
|
|
85
84
|
}
|
|
86
|
-
t.
|
|
87
|
-
|
|
85
|
+
if (typeof t.expires_in !== 'number' || !(t.expires_in > 0))
|
|
86
|
+
t.expires_in = DEFAULT_EXPIRES_IN;
|
|
87
|
+
t.scope = typeof t.scope === 'string' ? t.scope : (requested ?? '');
|
|
88
88
|
return t;
|
|
89
89
|
}
|
|
90
|
-
/**
|
|
91
|
-
jwtBearer(input) {
|
|
92
|
-
return this.token(async () => ({
|
|
93
|
-
grant_type: GRANT_JWT_BEARER,
|
|
94
|
-
assertion: await this.identity.sessionAssertion(input.userId, this.metadata.token_endpoint),
|
|
95
|
-
session_id: input.sessionId,
|
|
96
|
-
scope: input.scope,
|
|
97
|
-
resource: input.resource,
|
|
98
|
-
}), input.dpop);
|
|
99
|
-
}
|
|
100
|
-
/** Account Token grant (4.8): signs a Session in, or starts a new signed-in Session. */
|
|
90
|
+
/** Refresh (4.4). A token response may leave `refresh_token` out: keep using the one you have. */
|
|
101
91
|
refresh(input) {
|
|
102
92
|
return this.token(async () => ({
|
|
103
93
|
grant_type: 'refresh_token',
|
|
104
94
|
refresh_token: input.refreshToken,
|
|
105
|
-
session_id: input.sessionId,
|
|
106
95
|
scope: input.scope,
|
|
107
96
|
resource: input.resource,
|
|
108
|
-
}), input.dpop);
|
|
97
|
+
}), input.scope ?? input.grantedScope, input.dpop);
|
|
109
98
|
}
|
|
110
|
-
/** Direct Sign-In code exchange (4.
|
|
99
|
+
/** Direct Sign-In code exchange (4.2). */
|
|
111
100
|
authorizationCode(input) {
|
|
112
101
|
return this.token(async () => ({
|
|
113
102
|
grant_type: 'authorization_code',
|
|
114
103
|
code: input.code,
|
|
115
104
|
redirect_uri: input.redirectUri,
|
|
116
105
|
code_verifier: input.codeVerifier,
|
|
117
|
-
|
|
118
|
-
}), input.dpop);
|
|
106
|
+
}), input.scope, input.dpop);
|
|
119
107
|
}
|
|
120
|
-
/** Device Sign-In step 1 (4.
|
|
108
|
+
/** Device Sign-In step 1 (4.3). */
|
|
121
109
|
async deviceAuthorization(scope) {
|
|
122
110
|
const endpoint = this.metadata.device_authorization_endpoint;
|
|
123
111
|
if (!endpoint)
|
|
@@ -133,15 +121,27 @@ export class TokenClient {
|
|
|
133
121
|
}
|
|
134
122
|
return d;
|
|
135
123
|
}
|
|
136
|
-
/** Device Sign-In polling (4.
|
|
124
|
+
/** Device Sign-In polling (4.3). Throws `authorization_pending` / `slow_down` etc. */
|
|
137
125
|
deviceToken(input) {
|
|
126
|
+
return this.token(async () => ({ grant_type: GRANT_DEVICE_CODE, device_code: input.deviceCode }), input.scope, input.dpop);
|
|
127
|
+
}
|
|
128
|
+
/** The Mediated Sign-In grant (extension, section 3): credentials as form parameters. */
|
|
129
|
+
mediated(input) {
|
|
130
|
+
return this.token(async () => ({
|
|
131
|
+
...input.credentials,
|
|
132
|
+
grant_type: GRANT_MEDIATED_SIGN_IN,
|
|
133
|
+
scope: input.scope,
|
|
134
|
+
}), input.scope, input.dpop);
|
|
135
|
+
}
|
|
136
|
+
/** The same grant again with the one-time code, without credentials or `scope` (section 4). */
|
|
137
|
+
mediatedCode(input) {
|
|
138
138
|
return this.token(async () => ({
|
|
139
|
-
grant_type:
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}), input.dpop);
|
|
139
|
+
grant_type: GRANT_MEDIATED_SIGN_IN,
|
|
140
|
+
sign_in_id: input.signInId,
|
|
141
|
+
one_time_code: input.code,
|
|
142
|
+
}), input.scope, input.dpop);
|
|
143
143
|
}
|
|
144
|
-
/** RFC 7009 revocation of
|
|
144
|
+
/** RFC 7009 revocation of a refresh token (4.6). */
|
|
145
145
|
async revoke(token, hint = 'refresh_token') {
|
|
146
146
|
const r = await this.post(this.metadata.revocation_endpoint, async () => ({
|
|
147
147
|
token,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token_client.js","sourceRoot":"","sources":["../../../src/poppy-client/token_client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAkB,QAAQ,EAAE,MAAM,WAAW,CAAC;AAGrD,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"token_client.js","sourceRoot":"","sources":["../../../src/poppy-client/token_client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAkB,QAAQ,EAAE,MAAM,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