@ait-co/devtools 0.1.28 → 0.1.30
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/dist/in-app/index.d.ts +53 -20
- package/dist/in-app/index.d.ts.map +1 -1
- package/dist/in-app/index.js +40 -5
- package/dist/in-app/index.js.map +1 -1
- package/dist/mcp/cli.js +2 -2
- package/dist/mcp/server.js +1 -1
- package/dist/mock/index.d.ts +35 -2
- package/dist/mock/index.d.ts.map +1 -1
- package/dist/mock/index.js +72 -2
- package/dist/mock/index.js.map +1 -1
- package/dist/panel/index.js +63 -3
- package/dist/panel/index.js.map +1 -1
- package/package.json +4 -3
package/dist/in-app/index.d.ts
CHANGED
|
@@ -18,13 +18,23 @@
|
|
|
18
18
|
* `false` and could never pass. Layer A is the consumer guard; B and C are
|
|
19
19
|
* here.
|
|
20
20
|
*
|
|
21
|
+
* Layer B has two parts. Both must pass:
|
|
22
|
+
* B1 — host allowlist: `hostname` must be a `*.private-apps.tossmini.com`
|
|
23
|
+
* subdomain. The Toss app serves dogfood / private mini-apps from a
|
|
24
|
+
* separate `private-apps` host; a production (`intoss://`) entry is
|
|
25
|
+
* served from `*.apps.tossmini.com` WITHOUT the `private-apps` segment.
|
|
26
|
+
* This is the security gate against a dogfood build that somehow lands
|
|
27
|
+
* on a production entry — see the comment on {@link isPrivateAppsHost}.
|
|
28
|
+
* B2 — entry query: `_deploymentId` must be present and non-empty.
|
|
29
|
+
*
|
|
21
30
|
* Decision matrix (the gate only ever runs in a debug build — Layer A already
|
|
22
31
|
* passed by the time this code is reachable):
|
|
23
32
|
*
|
|
24
|
-
* _deploymentId | debug=1 | result
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* present |
|
|
33
|
+
* private-apps host | _deploymentId | debug=1 | result
|
|
34
|
+
* no | (any) | (any) | BLOCKED (Layer B1 — host)
|
|
35
|
+
* yes | absent | (any) | BLOCKED (Layer B2 — entry)
|
|
36
|
+
* yes | present | absent | BLOCKED (Layer C — opt-in)
|
|
37
|
+
* yes | present | present | ATTACH
|
|
28
38
|
*/
|
|
29
39
|
/** Shape returned when the gate allows attachment. */
|
|
30
40
|
interface GateResultAttach {
|
|
@@ -38,38 +48,57 @@ interface GateResultAttach {
|
|
|
38
48
|
interface GateResultBlocked {
|
|
39
49
|
readonly attach: false;
|
|
40
50
|
/**
|
|
41
|
-
* - `'
|
|
51
|
+
* - `'host'` Layer B1: `hostname` is not a `*.private-apps.tossmini.com` host.
|
|
52
|
+
* - `'entry'` Layer B2: `_deploymentId` param is absent or empty.
|
|
42
53
|
* - `'opt-in'` Layer C: `debug=1` param is absent.
|
|
43
54
|
* - `'invalid-relay'` Layer C: `relay` param is absent, empty, or not a `wss:` URL.
|
|
44
55
|
*
|
|
45
56
|
* There is no `'build'` reason: Layer A is enforced by the consumer's
|
|
46
57
|
* `if (__DEBUG_BUILD__)` guard, not by this function.
|
|
47
58
|
*/
|
|
48
|
-
readonly reason: 'entry' | 'opt-in' | 'invalid-relay';
|
|
59
|
+
readonly reason: 'host' | 'entry' | 'opt-in' | 'invalid-relay';
|
|
49
60
|
}
|
|
50
61
|
type GateResult = GateResultAttach | GateResultBlocked;
|
|
51
62
|
/**
|
|
52
63
|
* Input for {@link evaluateDebugGate}.
|
|
53
64
|
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
65
|
+
* Both fields are explicit so the function is trivially testable without
|
|
66
|
+
* touching `window`.
|
|
56
67
|
*/
|
|
57
68
|
interface GateInput {
|
|
58
69
|
/**
|
|
59
|
-
* The
|
|
70
|
+
* The host the page is served from — `window.location.hostname`.
|
|
71
|
+
*
|
|
72
|
+
* This is the Layer B1 security signal. Why hostname and not the entry
|
|
73
|
+
* scheme: the Toss SDK normalises `intoss-private://` to `intoss://` in
|
|
74
|
+
* `getSchemeUri()`, and `getOperationalEnvironment()` / `getWebViewType()`
|
|
75
|
+
* return the same value (`"toss"` / `"partner"`) for both dogfood and
|
|
76
|
+
* production entries — none of them distinguish a dogfood entry. The host
|
|
77
|
+
* does: a dogfood / private-apps entry is served from
|
|
78
|
+
* `*.private-apps.tossmini.com`, a production entry is not. This was
|
|
79
|
+
* confirmed live over CDP against mini-app 31146 (see spec open question 2).
|
|
80
|
+
*/
|
|
81
|
+
readonly hostname: string;
|
|
82
|
+
/**
|
|
83
|
+
* The URL search params to inspect for gate signals (Layers B2 and C).
|
|
60
84
|
*
|
|
61
85
|
* Prefer `URLSearchParams` so callers can pass `new URLSearchParams(location.search)`
|
|
62
86
|
* without coupling the pure function to `window`.
|
|
63
|
-
*
|
|
64
|
-
* Layer B open seam (spec open question 2): if the Toss SDK ever exposes
|
|
65
|
-
* `getEntryScheme()` or a similar API that reliably signals a dogfood entry,
|
|
66
|
-
* that signal should be checked before `_deploymentId` here. For now only the
|
|
67
|
-
* `_deploymentId` query param fallback is implemented. Pass a custom
|
|
68
|
-
* `URLSearchParams` to inject the SDK signal at the call site without
|
|
69
|
-
* modifying this function.
|
|
70
87
|
*/
|
|
71
88
|
readonly searchParams: URLSearchParams;
|
|
72
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* Returns whether `hostname` is a `*.private-apps.tossmini.com` subdomain —
|
|
92
|
+
* the host the Toss app reserves for dogfood / private mini-app entries.
|
|
93
|
+
*
|
|
94
|
+
* The match is an exact suffix check, not a substring `.includes()`: a
|
|
95
|
+
* substring test would also accept an attacker-controlled host like
|
|
96
|
+
* `private-apps.tossmini.com.evil.example`, which ends in `.example`, not in
|
|
97
|
+
* `.tossmini.com`. Requiring the string to END with the suffix closes that.
|
|
98
|
+
* The leading `.` in the suffix also forces a real subdomain label, so a
|
|
99
|
+
* bare `private-apps.tossmini.com` (no mini-app subdomain) does not match.
|
|
100
|
+
*/
|
|
101
|
+
declare function isPrivateAppsHost(hostname: string): boolean;
|
|
73
102
|
/**
|
|
74
103
|
* Pure function that evaluates the runtime debug activation layers (B and C).
|
|
75
104
|
*
|
|
@@ -83,6 +112,7 @@ interface GateInput {
|
|
|
83
112
|
* @example
|
|
84
113
|
* ```ts
|
|
85
114
|
* const result = evaluateDebugGate({
|
|
115
|
+
* hostname: window.location.hostname,
|
|
86
116
|
* searchParams: new URLSearchParams(window.location.search),
|
|
87
117
|
* });
|
|
88
118
|
* if (result.attach) {
|
|
@@ -135,11 +165,14 @@ declare function maybeAttach(gateResult?: GateResult): void;
|
|
|
135
165
|
* Returns the gate result. Callers can check `result.attach` to decide whether
|
|
136
166
|
* to proceed with debug surface attachment.
|
|
137
167
|
*
|
|
138
|
-
* This function reads `window.location` only
|
|
139
|
-
*
|
|
140
|
-
*
|
|
168
|
+
* This function reads `window.location` only — both the hostname (Layer B1
|
|
169
|
+
* host allowlist) and the search params (Layers B2 and C). Layer A
|
|
170
|
+
* (build-time) is enforced by the consumer's `if (__DEBUG_BUILD__)` guard
|
|
171
|
+
* around the import site, not here — see the file-level comment. Consumers
|
|
172
|
+
* call this with no arguments, so the Layer B1 host check is picked up with
|
|
173
|
+
* no change at the call site.
|
|
141
174
|
*/
|
|
142
175
|
declare function checkDebugGate(): GateResult;
|
|
143
176
|
//#endregion
|
|
144
|
-
export { type GateInput, type GateResult, type GateResultAttach, type GateResultBlocked, checkDebugGate, deriveTargetScriptUrl, evaluateDebugGate, maybeAttach };
|
|
177
|
+
export { type GateInput, type GateResult, type GateResultAttach, type GateResultBlocked, checkDebugGate, deriveTargetScriptUrl, evaluateDebugGate, isPrivateAppsHost, maybeAttach };
|
|
145
178
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/in-app/gate.ts","../../src/in-app/attach.ts","../../src/in-app/index.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/in-app/gate.ts","../../src/in-app/attach.ts","../../src/in-app/index.ts"],"mappings":";;AAuCA;;;;;;;;;AASA;;;;;AAcA;;;;;AAQA;;;;;;;;;AA8CA;;;;;AAyBA;;;;UAtGiB,gBAAA;EAAA,SACN,MAAA;EAqG0C;EAAA,SAnG1C,QAAA;EAmGoD;EAAA,SAjGpD,YAAA;AAAA;;UAIM,iBAAA;EAAA,SACN,MAAA;;;;ACQX;;;;;;WDEW,MAAA;AAAA;AAAA,KAGC,UAAA,GAAa,gBAAA,GAAmB,iBAAA;;;;;;;UAQ3B,SAAA;;;;;;;;;;;;;WAaN,QAAA;;;;;;;WAQA,YAAA,EAAc,eAAA;AAAA;;;;;;;;;;;;iBAyBT,iBAAA,CAAkB,QAAA;;;;;;;;;;;;;;;;;;;;;;iBAyBlB,iBAAA,CAAkB,KAAA,EAAO,SAAA,GAAY,UAAA;;;;;;AA/ErD;;;;;AAQA;;;;;;;iBCzCgB,qBAAA,CAAsB,QAAA;;ADuFtC;;;;;AAyBA;;;;;;;;;;iBCpFgB,WAAA,CAAY,UAAA,GAAY,UAAA;;;;;AD2DxC;;;;;AAyBA;;;;;;;iBEjGgB,cAAA,CAAA,GAAkB,UAAA"}
|
package/dist/in-app/index.js
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
//#region src/in-app/gate.ts
|
|
2
2
|
/**
|
|
3
|
+
* The host suffix the Toss app uses to serve dogfood / private mini-apps.
|
|
4
|
+
*
|
|
5
|
+
* A `intoss-private://` (dogfood) entry maps to a host such as
|
|
6
|
+
* `aitc-sdk-example.private-apps.tossmini.com`. A production `intoss://`
|
|
7
|
+
* entry is served from `*.apps.tossmini.com` — the `.private-apps.` segment
|
|
8
|
+
* is absent. Confirmed live over CDP for mini-app 31146; the exact production
|
|
9
|
+
* host is to be re-confirmed once 31146 passes review (spec open question 2).
|
|
10
|
+
*/
|
|
11
|
+
const PRIVATE_APPS_HOST_SUFFIX = ".private-apps.tossmini.com";
|
|
12
|
+
/**
|
|
13
|
+
* Returns whether `hostname` is a `*.private-apps.tossmini.com` subdomain —
|
|
14
|
+
* the host the Toss app reserves for dogfood / private mini-app entries.
|
|
15
|
+
*
|
|
16
|
+
* The match is an exact suffix check, not a substring `.includes()`: a
|
|
17
|
+
* substring test would also accept an attacker-controlled host like
|
|
18
|
+
* `private-apps.tossmini.com.evil.example`, which ends in `.example`, not in
|
|
19
|
+
* `.tossmini.com`. Requiring the string to END with the suffix closes that.
|
|
20
|
+
* The leading `.` in the suffix also forces a real subdomain label, so a
|
|
21
|
+
* bare `private-apps.tossmini.com` (no mini-app subdomain) does not match.
|
|
22
|
+
*/
|
|
23
|
+
function isPrivateAppsHost(hostname) {
|
|
24
|
+
return hostname.endsWith(PRIVATE_APPS_HOST_SUFFIX);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
3
27
|
* Pure function that evaluates the runtime debug activation layers (B and C).
|
|
4
28
|
*
|
|
5
29
|
* Has no side effects. The input is explicit. Returns a discriminated union
|
|
@@ -12,6 +36,7 @@
|
|
|
12
36
|
* @example
|
|
13
37
|
* ```ts
|
|
14
38
|
* const result = evaluateDebugGate({
|
|
39
|
+
* hostname: window.location.hostname,
|
|
15
40
|
* searchParams: new URLSearchParams(window.location.search),
|
|
16
41
|
* });
|
|
17
42
|
* if (result.attach) {
|
|
@@ -20,6 +45,10 @@
|
|
|
20
45
|
* ```
|
|
21
46
|
*/
|
|
22
47
|
function evaluateDebugGate(input) {
|
|
48
|
+
if (!isPrivateAppsHost(input.hostname)) return {
|
|
49
|
+
attach: false,
|
|
50
|
+
reason: "host"
|
|
51
|
+
};
|
|
23
52
|
const deploymentId = input.searchParams.get("_deploymentId") ?? "";
|
|
24
53
|
if (deploymentId === "") return {
|
|
25
54
|
attach: false,
|
|
@@ -157,14 +186,20 @@ function maybeAttach(gateResult = checkDebugGate()) {
|
|
|
157
186
|
* Returns the gate result. Callers can check `result.attach` to decide whether
|
|
158
187
|
* to proceed with debug surface attachment.
|
|
159
188
|
*
|
|
160
|
-
* This function reads `window.location` only
|
|
161
|
-
*
|
|
162
|
-
*
|
|
189
|
+
* This function reads `window.location` only — both the hostname (Layer B1
|
|
190
|
+
* host allowlist) and the search params (Layers B2 and C). Layer A
|
|
191
|
+
* (build-time) is enforced by the consumer's `if (__DEBUG_BUILD__)` guard
|
|
192
|
+
* around the import site, not here — see the file-level comment. Consumers
|
|
193
|
+
* call this with no arguments, so the Layer B1 host check is picked up with
|
|
194
|
+
* no change at the call site.
|
|
163
195
|
*/
|
|
164
196
|
function checkDebugGate() {
|
|
165
|
-
return evaluateDebugGate({
|
|
197
|
+
return evaluateDebugGate({
|
|
198
|
+
hostname: window.location.hostname,
|
|
199
|
+
searchParams: new URLSearchParams(window.location.search)
|
|
200
|
+
});
|
|
166
201
|
}
|
|
167
202
|
//#endregion
|
|
168
|
-
export { checkDebugGate, deriveTargetScriptUrl, evaluateDebugGate, maybeAttach };
|
|
203
|
+
export { checkDebugGate, deriveTargetScriptUrl, evaluateDebugGate, isPrivateAppsHost, maybeAttach };
|
|
169
204
|
|
|
170
205
|
//# sourceMappingURL=index.js.map
|
package/dist/in-app/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/in-app/gate.ts","../../src/in-app/attach.ts","../../src/in-app/index.ts"],"sourcesContent":["/**\n * Runtime activation gate for the in-app debug surface.\n *\n * Spec: docs/superpowers/specs/2026-05-18-in-app-debug-mcp.md\n * \"3-layer activation gate\". This is the pure gate decision; the Chii client,\n * WebSocket transport, MCP server, and CLI that consume it live in src/mcp/.\n *\n * This function evaluates the two RUNTIME layers, B and C. Layer A — the\n * build-time gate — is NOT evaluated here, and deliberately so: it is enforced\n * entirely by the consumer's `if (__DEBUG_BUILD__) { … }` guard around the\n * import site (see sdk-example `src/main.tsx`). `__DEBUG_BUILD__` is a\n * consumer-build-time constant; a release consumer build folds it to `false`\n * and dead-code-eliminates the whole import of `@ait-co/devtools/in-app`, so\n * this code is simply absent from release bundles. A pre-built npm package\n * cannot re-check that flag — it was already baked at devtools' own publish\n * time — so any `isDebugBuild` check inside this function would be permanently\n * `false` and could never pass. Layer A is the consumer guard; B and C are\n * here.\n *\n * Decision matrix (the gate only ever runs in a debug build — Layer A already\n * passed by the time this code is reachable):\n *\n * _deploymentId | debug=1 | result\n * absent | (any) | BLOCKED (Layer B — entry gate)\n * present | absent | BLOCKED (Layer C — opt-in gate)\n * present | present | ATTACH\n */\n\n/** Shape returned when the gate allows attachment. */\nexport interface GateResultAttach {\n readonly attach: true;\n /** The validated `wss:` relay URL from the `relay` query param. */\n readonly relayUrl: string;\n /** The deployment ID extracted from the `_deploymentId` query param. */\n readonly deploymentId: string;\n}\n\n/** Shape returned when the gate blocks attachment, with a reason code. */\nexport interface GateResultBlocked {\n readonly attach: false;\n /**\n * - `'entry'` Layer B: `_deploymentId` param is absent or empty.\n * - `'opt-in'` Layer C: `debug=1` param is absent.\n * - `'invalid-relay'` Layer C: `relay` param is absent, empty, or not a `wss:` URL.\n *\n * There is no `'build'` reason: Layer A is enforced by the consumer's\n * `if (__DEBUG_BUILD__)` guard, not by this function.\n */\n readonly reason: 'entry' | 'opt-in' | 'invalid-relay';\n}\n\nexport type GateResult = GateResultAttach | GateResultBlocked;\n\n/**\n * Input for {@link evaluateDebugGate}.\n *\n * Keeping the field explicit makes the function trivially testable without\n * needing to manipulate `window.location`.\n */\nexport interface GateInput {\n /**\n * The URL search params to inspect for gate signals.\n *\n * Prefer `URLSearchParams` so callers can pass `new URLSearchParams(location.search)`\n * without coupling the pure function to `window`.\n *\n * Layer B open seam (spec open question 2): if the Toss SDK ever exposes\n * `getEntryScheme()` or a similar API that reliably signals a dogfood entry,\n * that signal should be checked before `_deploymentId` here. For now only the\n * `_deploymentId` query param fallback is implemented. Pass a custom\n * `URLSearchParams` to inject the SDK signal at the call site without\n * modifying this function.\n */\n readonly searchParams: URLSearchParams;\n}\n\n/**\n * Pure function that evaluates the runtime debug activation layers (B and C).\n *\n * Has no side effects. The input is explicit. Returns a discriminated union\n * so callers can pattern-match on `result.attach`.\n *\n * Layer A (build-time) is intentionally not evaluated here — see the file-level\n * comment. By the time this function runs, the consumer's `if (__DEBUG_BUILD__)`\n * guard has already passed; this function only decides B and C.\n *\n * @example\n * ```ts\n * const result = evaluateDebugGate({\n * searchParams: new URLSearchParams(window.location.search),\n * });\n * if (result.attach) {\n * // Proceed to load Chii client\n * }\n * ```\n */\nexport function evaluateDebugGate(input: GateInput): GateResult {\n // Layer B — runtime entry scheme gate.\n // `_deploymentId` must be present and non-empty. The `intoss-private://`\n // scheme used for dogfood entries includes this param; general user entry\n // paths do not.\n //\n // Open seam (spec open question 2): if the Toss SDK exposes getEntryScheme()\n // or similar, that should be the 1st-priority signal checked here, with\n // `_deploymentId` as fallback. Extend this check at the call site by\n // pre-populating `searchParams` with the SDK signal, or add an optional\n // `entryScheme` field to `GateInput` in a later phase.\n const deploymentId = input.searchParams.get('_deploymentId') ?? '';\n if (deploymentId === '') {\n return { attach: false, reason: 'entry' };\n }\n\n // Layer C — explicit opt-in gate.\n // Require `debug=1` so that an operator who opens a dogfood URL by accident\n // does not inadvertently trigger the debug surface.\n const debugParam = input.searchParams.get('debug');\n if (debugParam !== '1') {\n return { attach: false, reason: 'opt-in' };\n }\n\n // Layer C continued — relay URL validation.\n // `relay=<wss-url>` must be present and must use the `wss:` scheme.\n // Plain `ws:` is rejected (no TLS). `http:`/`https:` are rejected.\n const relayRaw = input.searchParams.get('relay') ?? '';\n if (relayRaw === '') {\n return { attach: false, reason: 'invalid-relay' };\n }\n\n let relayUrl: URL;\n try {\n relayUrl = new URL(relayRaw);\n } catch {\n return { attach: false, reason: 'invalid-relay' };\n }\n\n if (relayUrl.protocol !== 'wss:') {\n return { attach: false, reason: 'invalid-relay' };\n }\n\n return { attach: true, relayUrl: relayUrl.href, deploymentId };\n}\n","/**\n * In-app Chii target injection for the debug attach flow.\n *\n * Spec: docs/superpowers/specs/2026-05-18-in-app-debug-mcp.md\n * \"MCP attach\" topology section — Phase 1 browser-side implementation.\n *\n * This module bridges the 3-layer gate result to a Chii `target.js` script\n * injection. The Chii npm package is the relay SERVER — the in-app side is\n * a plain `<script src=\"…/target.js\">` pointing at the relay host. No chii\n * npm dependency is needed here.\n */\n\nimport { checkDebugGate, type GateResult } from './index.js';\n\n/**\n * Converts a validated `wss:` relay URL into the Chii `target.js` script URL.\n *\n * Scheme is mapped `wss:` → `https:`. Host and port are preserved.\n * Pathname is set to `/target.js` regardless of the relay path.\n * Query params and hash from the relay URL are dropped — the target script\n * URL is a static asset path on the same host.\n *\n * @example\n * deriveTargetScriptUrl('wss://abc.trycloudflare.com/relay')\n * // → 'https://abc.trycloudflare.com/target.js'\n *\n * deriveTargetScriptUrl('wss://h.example.com:9100/')\n * // → 'https://h.example.com:9100/target.js'\n */\nexport function deriveTargetScriptUrl(relayUrl: string): string {\n const u = new URL(relayUrl);\n u.protocol = 'https:';\n u.pathname = '/target.js';\n u.search = '';\n u.hash = '';\n return u.toString();\n}\n\n/** Module-level guard against double-injection within a page lifecycle. */\nlet attached = false;\n\n/**\n * Evaluates the 3-layer debug gate and, if the gate passes, injects the Chii\n * `target.js` script into `document.head`.\n *\n * Idempotent — calling more than once is safe. The second call is a no-op if\n * a script with the same `src` is already present in the document, and the\n * module-level `attached` flag prevents redundant DOM queries after the first\n * successful injection.\n *\n * Safe to call even if `document` is somehow unavailable (defensive boundary\n * guard — in practice this always runs in a real WebView).\n *\n * @param gateResult - Optional pre-evaluated gate result for testability.\n * Defaults to `checkDebugGate()` which reads the current page URL. Passing a\n * custom value avoids the need to manipulate `window.location` in tests.\n */\nexport function maybeAttach(gateResult: GateResult = checkDebugGate()): void {\n if (!gateResult.attach) {\n console.debug(\n `[@ait-co/devtools] debug attach skipped — gate blocked (reason: ${gateResult.reason})`,\n );\n return;\n }\n\n // Guard against double-injection across repeated calls.\n if (attached) {\n return;\n }\n\n // Defensive: if document is not available (unusual, but possible in some\n // SSR-adjacent edge cases), bail silently rather than throwing.\n if (typeof document === 'undefined') {\n return;\n }\n\n const src = deriveTargetScriptUrl(gateResult.relayUrl);\n\n // Also guard against a script with the same src already in the DOM\n // (e.g. injected by a different code path or a page reload within SPA).\n const existing = document.querySelector<HTMLScriptElement>(`script[src=\"${src}\"]`);\n if (existing !== null) {\n attached = true;\n return;\n }\n\n const script = document.createElement('script');\n script.src = src;\n script.async = true;\n (document.head ?? document.documentElement).appendChild(script);\n\n attached = true;\n}\n","/**\n * @ait-co/devtools/in-app entry point.\n *\n * Spec: docs/superpowers/specs/2026-05-18-in-app-debug-mcp.md\n *\n * Phase 1 — gate + browser-side Chii target injection.\n * WebSocket relay, QR/paste UI, and AI-host MCP bin are later phases that\n * require real-device validation and are not included here.\n *\n * This thin entry reads `window.location` and calls the pure\n * {@link evaluateDebugGate} function. All testable logic lives in `./gate.ts`\n * and `./attach.ts`, not here.\n *\n * Layer A of the activation gate (build-time) is NOT enforced in this module.\n * It is the consumer's responsibility: the consumer wraps its\n * `import('@ait-co/devtools/in-app')` call site in `if (__DEBUG_BUILD__) { … }`\n * (see sdk-example `src/main.tsx`), where `__DEBUG_BUILD__` is a\n * consumer-build-time constant. A release consumer build folds that constant\n * to `false` and dead-code-eliminates this whole module. This package is\n * pre-built and ships with `__DEBUG_BUILD__` already resolved at devtools'\n * publish time, so it could never re-evaluate the consumer's build channel —\n * which is exactly why Layer A lives at the consumer guard, not here.\n */\n\nimport { evaluateDebugGate, type GateResult } from './gate.js';\n\nexport { deriveTargetScriptUrl, maybeAttach } from './attach.js';\nexport type { GateInput, GateResult, GateResultAttach, GateResultBlocked } from './gate.js';\nexport { evaluateDebugGate } from './gate.js';\n\n/**\n * Evaluates the runtime debug activation layers (B and C) against the current\n * page URL.\n *\n * Returns the gate result. Callers can check `result.attach` to decide whether\n * to proceed with debug surface attachment.\n *\n * This function reads `window.location` only. Layer A (build-time) is enforced\n * by the consumer's `if (__DEBUG_BUILD__)` guard around the import site, not\n * here — see the file-level comment.\n */\nexport function checkDebugGate(): GateResult {\n return evaluateDebugGate({\n searchParams: new URLSearchParams(window.location.search),\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAgGA,SAAgB,kBAAkB,OAA8B;CA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;;;;;;;;;;;;;;;;;;;;AClDb,SAAgB,iBAA6B;AAC3C,QAAO,kBAAkB,EACvB,cAAc,IAAI,gBAAgB,OAAO,SAAS,OAAO,EAC1D,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/in-app/gate.ts","../../src/in-app/attach.ts","../../src/in-app/index.ts"],"sourcesContent":["/**\n * Runtime activation gate for the in-app debug surface.\n *\n * Spec: docs/superpowers/specs/2026-05-18-in-app-debug-mcp.md\n * \"3-layer activation gate\". This is the pure gate decision; the Chii client,\n * WebSocket transport, MCP server, and CLI that consume it live in src/mcp/.\n *\n * This function evaluates the two RUNTIME layers, B and C. Layer A — the\n * build-time gate — is NOT evaluated here, and deliberately so: it is enforced\n * entirely by the consumer's `if (__DEBUG_BUILD__) { … }` guard around the\n * import site (see sdk-example `src/main.tsx`). `__DEBUG_BUILD__` is a\n * consumer-build-time constant; a release consumer build folds it to `false`\n * and dead-code-eliminates the whole import of `@ait-co/devtools/in-app`, so\n * this code is simply absent from release bundles. A pre-built npm package\n * cannot re-check that flag — it was already baked at devtools' own publish\n * time — so any `isDebugBuild` check inside this function would be permanently\n * `false` and could never pass. Layer A is the consumer guard; B and C are\n * here.\n *\n * Layer B has two parts. Both must pass:\n * B1 — host allowlist: `hostname` must be a `*.private-apps.tossmini.com`\n * subdomain. The Toss app serves dogfood / private mini-apps from a\n * separate `private-apps` host; a production (`intoss://`) entry is\n * served from `*.apps.tossmini.com` WITHOUT the `private-apps` segment.\n * This is the security gate against a dogfood build that somehow lands\n * on a production entry — see the comment on {@link isPrivateAppsHost}.\n * B2 — entry query: `_deploymentId` must be present and non-empty.\n *\n * Decision matrix (the gate only ever runs in a debug build — Layer A already\n * passed by the time this code is reachable):\n *\n * private-apps host | _deploymentId | debug=1 | result\n * no | (any) | (any) | BLOCKED (Layer B1 — host)\n * yes | absent | (any) | BLOCKED (Layer B2 — entry)\n * yes | present | absent | BLOCKED (Layer C — opt-in)\n * yes | present | present | ATTACH\n */\n\n/** Shape returned when the gate allows attachment. */\nexport interface GateResultAttach {\n readonly attach: true;\n /** The validated `wss:` relay URL from the `relay` query param. */\n readonly relayUrl: string;\n /** The deployment ID extracted from the `_deploymentId` query param. */\n readonly deploymentId: string;\n}\n\n/** Shape returned when the gate blocks attachment, with a reason code. */\nexport interface GateResultBlocked {\n readonly attach: false;\n /**\n * - `'host'` Layer B1: `hostname` is not a `*.private-apps.tossmini.com` host.\n * - `'entry'` Layer B2: `_deploymentId` param is absent or empty.\n * - `'opt-in'` Layer C: `debug=1` param is absent.\n * - `'invalid-relay'` Layer C: `relay` param is absent, empty, or not a `wss:` URL.\n *\n * There is no `'build'` reason: Layer A is enforced by the consumer's\n * `if (__DEBUG_BUILD__)` guard, not by this function.\n */\n readonly reason: 'host' | 'entry' | 'opt-in' | 'invalid-relay';\n}\n\nexport type GateResult = GateResultAttach | GateResultBlocked;\n\n/**\n * Input for {@link evaluateDebugGate}.\n *\n * Both fields are explicit so the function is trivially testable without\n * touching `window`.\n */\nexport interface GateInput {\n /**\n * The host the page is served from — `window.location.hostname`.\n *\n * This is the Layer B1 security signal. Why hostname and not the entry\n * scheme: the Toss SDK normalises `intoss-private://` to `intoss://` in\n * `getSchemeUri()`, and `getOperationalEnvironment()` / `getWebViewType()`\n * return the same value (`\"toss\"` / `\"partner\"`) for both dogfood and\n * production entries — none of them distinguish a dogfood entry. The host\n * does: a dogfood / private-apps entry is served from\n * `*.private-apps.tossmini.com`, a production entry is not. This was\n * confirmed live over CDP against mini-app 31146 (see spec open question 2).\n */\n readonly hostname: string;\n\n /**\n * The URL search params to inspect for gate signals (Layers B2 and C).\n *\n * Prefer `URLSearchParams` so callers can pass `new URLSearchParams(location.search)`\n * without coupling the pure function to `window`.\n */\n readonly searchParams: URLSearchParams;\n}\n\n/**\n * The host suffix the Toss app uses to serve dogfood / private mini-apps.\n *\n * A `intoss-private://` (dogfood) entry maps to a host such as\n * `aitc-sdk-example.private-apps.tossmini.com`. A production `intoss://`\n * entry is served from `*.apps.tossmini.com` — the `.private-apps.` segment\n * is absent. Confirmed live over CDP for mini-app 31146; the exact production\n * host is to be re-confirmed once 31146 passes review (spec open question 2).\n */\nconst PRIVATE_APPS_HOST_SUFFIX = '.private-apps.tossmini.com';\n\n/**\n * Returns whether `hostname` is a `*.private-apps.tossmini.com` subdomain —\n * the host the Toss app reserves for dogfood / private mini-app entries.\n *\n * The match is an exact suffix check, not a substring `.includes()`: a\n * substring test would also accept an attacker-controlled host like\n * `private-apps.tossmini.com.evil.example`, which ends in `.example`, not in\n * `.tossmini.com`. Requiring the string to END with the suffix closes that.\n * The leading `.` in the suffix also forces a real subdomain label, so a\n * bare `private-apps.tossmini.com` (no mini-app subdomain) does not match.\n */\nexport function isPrivateAppsHost(hostname: string): boolean {\n return hostname.endsWith(PRIVATE_APPS_HOST_SUFFIX);\n}\n\n/**\n * Pure function that evaluates the runtime debug activation layers (B and C).\n *\n * Has no side effects. The input is explicit. Returns a discriminated union\n * so callers can pattern-match on `result.attach`.\n *\n * Layer A (build-time) is intentionally not evaluated here — see the file-level\n * comment. By the time this function runs, the consumer's `if (__DEBUG_BUILD__)`\n * guard has already passed; this function only decides B and C.\n *\n * @example\n * ```ts\n * const result = evaluateDebugGate({\n * hostname: window.location.hostname,\n * searchParams: new URLSearchParams(window.location.search),\n * });\n * if (result.attach) {\n * // Proceed to load Chii client\n * }\n * ```\n */\nexport function evaluateDebugGate(input: GateInput): GateResult {\n // Layer B1 — host allowlist (the security gate).\n // The page must be served from a `*.private-apps.tossmini.com` host. A\n // production `intoss://` entry is served from `*.apps.tossmini.com` and is\n // rejected here. This is what stops a dogfood build that somehow reaches a\n // production entry from attaching: Layer A keeps debug code out of release\n // bundles, and this layer keeps a dogfood bundle that lands on a production\n // host from attaching even though its code is present.\n if (!isPrivateAppsHost(input.hostname)) {\n return { attach: false, reason: 'host' };\n }\n\n // Layer B2 — runtime entry query gate.\n // `_deploymentId` must be present and non-empty. The `intoss-private://`\n // scheme used for dogfood entries includes this param; general user entry\n // paths do not.\n const deploymentId = input.searchParams.get('_deploymentId') ?? '';\n if (deploymentId === '') {\n return { attach: false, reason: 'entry' };\n }\n\n // Layer C — explicit opt-in gate.\n // Require `debug=1` so that an operator who opens a dogfood URL by accident\n // does not inadvertently trigger the debug surface.\n const debugParam = input.searchParams.get('debug');\n if (debugParam !== '1') {\n return { attach: false, reason: 'opt-in' };\n }\n\n // Layer C continued — relay URL validation.\n // `relay=<wss-url>` must be present and must use the `wss:` scheme.\n // Plain `ws:` is rejected (no TLS). `http:`/`https:` are rejected.\n const relayRaw = input.searchParams.get('relay') ?? '';\n if (relayRaw === '') {\n return { attach: false, reason: 'invalid-relay' };\n }\n\n let relayUrl: URL;\n try {\n relayUrl = new URL(relayRaw);\n } catch {\n return { attach: false, reason: 'invalid-relay' };\n }\n\n if (relayUrl.protocol !== 'wss:') {\n return { attach: false, reason: 'invalid-relay' };\n }\n\n return { attach: true, relayUrl: relayUrl.href, deploymentId };\n}\n","/**\n * In-app Chii target injection for the debug attach flow.\n *\n * Spec: docs/superpowers/specs/2026-05-18-in-app-debug-mcp.md\n * \"MCP attach\" topology section — Phase 1 browser-side implementation.\n *\n * This module bridges the 3-layer gate result to a Chii `target.js` script\n * injection. The Chii npm package is the relay SERVER — the in-app side is\n * a plain `<script src=\"…/target.js\">` pointing at the relay host. No chii\n * npm dependency is needed here.\n */\n\nimport { checkDebugGate, type GateResult } from './index.js';\n\n/**\n * Converts a validated `wss:` relay URL into the Chii `target.js` script URL.\n *\n * Scheme is mapped `wss:` → `https:`. Host and port are preserved.\n * Pathname is set to `/target.js` regardless of the relay path.\n * Query params and hash from the relay URL are dropped — the target script\n * URL is a static asset path on the same host.\n *\n * @example\n * deriveTargetScriptUrl('wss://abc.trycloudflare.com/relay')\n * // → 'https://abc.trycloudflare.com/target.js'\n *\n * deriveTargetScriptUrl('wss://h.example.com:9100/')\n * // → 'https://h.example.com:9100/target.js'\n */\nexport function deriveTargetScriptUrl(relayUrl: string): string {\n const u = new URL(relayUrl);\n u.protocol = 'https:';\n u.pathname = '/target.js';\n u.search = '';\n u.hash = '';\n return u.toString();\n}\n\n/** Module-level guard against double-injection within a page lifecycle. */\nlet attached = false;\n\n/**\n * Evaluates the 3-layer debug gate and, if the gate passes, injects the Chii\n * `target.js` script into `document.head`.\n *\n * Idempotent — calling more than once is safe. The second call is a no-op if\n * a script with the same `src` is already present in the document, and the\n * module-level `attached` flag prevents redundant DOM queries after the first\n * successful injection.\n *\n * Safe to call even if `document` is somehow unavailable (defensive boundary\n * guard — in practice this always runs in a real WebView).\n *\n * @param gateResult - Optional pre-evaluated gate result for testability.\n * Defaults to `checkDebugGate()` which reads the current page URL. Passing a\n * custom value avoids the need to manipulate `window.location` in tests.\n */\nexport function maybeAttach(gateResult: GateResult = checkDebugGate()): void {\n if (!gateResult.attach) {\n console.debug(\n `[@ait-co/devtools] debug attach skipped — gate blocked (reason: ${gateResult.reason})`,\n );\n return;\n }\n\n // Guard against double-injection across repeated calls.\n if (attached) {\n return;\n }\n\n // Defensive: if document is not available (unusual, but possible in some\n // SSR-adjacent edge cases), bail silently rather than throwing.\n if (typeof document === 'undefined') {\n return;\n }\n\n const src = deriveTargetScriptUrl(gateResult.relayUrl);\n\n // Also guard against a script with the same src already in the DOM\n // (e.g. injected by a different code path or a page reload within SPA).\n const existing = document.querySelector<HTMLScriptElement>(`script[src=\"${src}\"]`);\n if (existing !== null) {\n attached = true;\n return;\n }\n\n const script = document.createElement('script');\n script.src = src;\n script.async = true;\n (document.head ?? document.documentElement).appendChild(script);\n\n attached = true;\n}\n","/**\n * @ait-co/devtools/in-app entry point.\n *\n * Spec: docs/superpowers/specs/2026-05-18-in-app-debug-mcp.md\n *\n * Phase 1 — gate + browser-side Chii target injection.\n * WebSocket relay, QR/paste UI, and AI-host MCP bin are later phases that\n * require real-device validation and are not included here.\n *\n * This thin entry reads `window.location` and calls the pure\n * {@link evaluateDebugGate} function. All testable logic lives in `./gate.ts`\n * and `./attach.ts`, not here.\n *\n * Layer A of the activation gate (build-time) is NOT enforced in this module.\n * It is the consumer's responsibility: the consumer wraps its\n * `import('@ait-co/devtools/in-app')` call site in `if (__DEBUG_BUILD__) { … }`\n * (see sdk-example `src/main.tsx`), where `__DEBUG_BUILD__` is a\n * consumer-build-time constant. A release consumer build folds that constant\n * to `false` and dead-code-eliminates this whole module. This package is\n * pre-built and ships with `__DEBUG_BUILD__` already resolved at devtools'\n * publish time, so it could never re-evaluate the consumer's build channel —\n * which is exactly why Layer A lives at the consumer guard, not here.\n */\n\nimport { evaluateDebugGate, type GateResult } from './gate.js';\n\nexport { deriveTargetScriptUrl, maybeAttach } from './attach.js';\nexport type { GateInput, GateResult, GateResultAttach, GateResultBlocked } from './gate.js';\nexport { evaluateDebugGate, isPrivateAppsHost } from './gate.js';\n\n/**\n * Evaluates the runtime debug activation layers (B and C) against the current\n * page URL.\n *\n * Returns the gate result. Callers can check `result.attach` to decide whether\n * to proceed with debug surface attachment.\n *\n * This function reads `window.location` only — both the hostname (Layer B1\n * host allowlist) and the search params (Layers B2 and C). Layer A\n * (build-time) is enforced by the consumer's `if (__DEBUG_BUILD__)` guard\n * around the import site, not here — see the file-level comment. Consumers\n * call this with no arguments, so the Layer B1 host check is picked up with\n * no change at the call site.\n */\nexport function checkDebugGate(): GateResult {\n return evaluateDebugGate({\n hostname: window.location.hostname,\n searchParams: new URLSearchParams(window.location.search),\n });\n}\n"],"mappings":";;;;;;;;;;AAuGA,MAAM,2BAA2B;;;;;;;;;;;;AAajC,SAAgB,kBAAkB,UAA2B;AAC3D,QAAO,SAAS,SAAS,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;AAwBpD,SAAgB,kBAAkB,OAA8B;AAQ9D,KAAI,CAAC,kBAAkB,MAAM,SAAS,CACpC,QAAO;EAAE,QAAQ;EAAO,QAAQ;EAAQ;CAO1C,MAAM,eAAe,MAAM,aAAa,IAAI,gBAAgB,IAAI;AAChE,KAAI,iBAAiB,GACnB,QAAO;EAAE,QAA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AAS;EAC1B,cAAc,IAAI,gBAAgB,OAAO,SAAS,OAAO;EAC1D,CAAC"}
|
package/dist/mcp/cli.js
CHANGED
|
@@ -636,7 +636,7 @@ function createDebugServer(deps) {
|
|
|
636
636
|
const { connection, aitSource, getTunnelStatus } = deps;
|
|
637
637
|
const server = new Server({
|
|
638
638
|
name: "ait-debug",
|
|
639
|
-
version: "0.1.
|
|
639
|
+
version: "0.1.30"
|
|
640
640
|
}, { capabilities: { tools: {} } });
|
|
641
641
|
server.setRequestHandler(ListToolsRequestSchema, () => ({ tools: DEBUG_TOOL_DEFINITIONS.map((tool) => ({ ...tool })) }));
|
|
642
642
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
@@ -898,7 +898,7 @@ function createDevServer(deps = {}) {
|
|
|
898
898
|
const aitSource = deps.aitSource ?? new HttpAitSource({ stateEndpoint });
|
|
899
899
|
const server = new Server({
|
|
900
900
|
name: "ait-devtools",
|
|
901
|
-
version: "0.1.
|
|
901
|
+
version: "0.1.30"
|
|
902
902
|
}, { capabilities: { tools: {} } });
|
|
903
903
|
server.setRequestHandler(ListToolsRequestSchema, () => ({ tools: DEV_TOOL_DEFINITIONS.map((tool) => ({ ...tool })) }));
|
|
904
904
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
package/dist/mcp/server.js
CHANGED
|
@@ -234,7 +234,7 @@ function createDevServer(deps = {}) {
|
|
|
234
234
|
const aitSource = deps.aitSource ?? new HttpAitSource({ stateEndpoint });
|
|
235
235
|
const server = new Server({
|
|
236
236
|
name: "ait-devtools",
|
|
237
|
-
version: "0.1.
|
|
237
|
+
version: "0.1.30"
|
|
238
238
|
}, { capabilities: { tools: {} } });
|
|
239
239
|
server.setRequestHandler(ListToolsRequestSchema, () => ({ tools: DEV_TOOL_DEFINITIONS.map((tool) => ({ ...tool })) }));
|
|
240
240
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
package/dist/mock/index.d.ts
CHANGED
|
@@ -227,9 +227,10 @@ interface ViewportState {
|
|
|
227
227
|
//#endregion
|
|
228
228
|
//#region src/mock/device/camera.d.ts
|
|
229
229
|
/**
|
|
230
|
-
* Camera & Album Photos mock
|
|
230
|
+
* Camera & Album Photos & Album Items mock
|
|
231
231
|
* mock/web/prompt 모드 지원
|
|
232
232
|
*/
|
|
233
|
+
type AlbumItemType = 'PHOTO' | 'VIDEO';
|
|
233
234
|
declare const openCamera: ((_options?: {
|
|
234
235
|
base64?: boolean;
|
|
235
236
|
maxWidth?: number;
|
|
@@ -251,6 +252,21 @@ declare const fetchAlbumPhotos: ((options?: {
|
|
|
251
252
|
getPermission: () => Promise<PermissionStatus>;
|
|
252
253
|
openPermissionDialog: () => Promise<"allowed" | "denied">;
|
|
253
254
|
};
|
|
255
|
+
interface FetchAlbumItemsOptions {
|
|
256
|
+
types?: AlbumItemType[];
|
|
257
|
+
maxCount?: number;
|
|
258
|
+
maxWidth?: number;
|
|
259
|
+
base64?: boolean;
|
|
260
|
+
}
|
|
261
|
+
interface AlbumItemResponse {
|
|
262
|
+
id: string;
|
|
263
|
+
dataUri: string;
|
|
264
|
+
type: AlbumItemType;
|
|
265
|
+
}
|
|
266
|
+
declare const fetchAlbumItems: ((options?: FetchAlbumItemsOptions) => Promise<AlbumItemResponse[]>) & {
|
|
267
|
+
getPermission: () => Promise<PermissionStatus>;
|
|
268
|
+
openPermissionDialog: () => Promise<"allowed" | "denied">;
|
|
269
|
+
};
|
|
254
270
|
//#endregion
|
|
255
271
|
//#region src/mock/device/clipboard.d.ts
|
|
256
272
|
/**
|
|
@@ -327,6 +343,23 @@ declare const startUpdateLocation: ((eventParams: StartUpdateLocationEventParams
|
|
|
327
343
|
openPermissionDialog: () => Promise<"allowed" | "denied">;
|
|
328
344
|
};
|
|
329
345
|
//#endregion
|
|
346
|
+
//#region src/mock/device/pdf.d.ts
|
|
347
|
+
/**
|
|
348
|
+
* PDF Viewer mock
|
|
349
|
+
* 네이티브 PDF 뷰어 동작을 시뮬레이션한다.
|
|
350
|
+
* 권한 게이트 없음. 모드 분기 없음.
|
|
351
|
+
*/
|
|
352
|
+
interface OpenPDFViewerParams {
|
|
353
|
+
data: string;
|
|
354
|
+
filename?: string;
|
|
355
|
+
}
|
|
356
|
+
type OpenPDFViewerResult = 'CLOSE';
|
|
357
|
+
/**
|
|
358
|
+
* Base64로 인코딩된 PDF 데이터를 네이티브 PDF 뷰어로 여는 mock.
|
|
359
|
+
* mock 환경에서는 즉시 `'CLOSE'`를 반환한다.
|
|
360
|
+
*/
|
|
361
|
+
declare function openPDFViewer(_params: OpenPDFViewerParams): Promise<OpenPDFViewerResult>;
|
|
362
|
+
//#endregion
|
|
330
363
|
//#region src/mock/device/storage.d.ts
|
|
331
364
|
/**
|
|
332
365
|
* Storage mock
|
|
@@ -820,5 +853,5 @@ declare function listUserPresets(): MockPreset[];
|
|
|
820
853
|
declare function saveUserPreset(label: string, state: MockPresetState, description?: string): MockPreset;
|
|
821
854
|
declare function deleteUserPreset(id: string): void;
|
|
822
855
|
//#endregion
|
|
823
|
-
export { Accuracy, type AitDevtoolsState, Analytics, type AnalyticsLogEntry, type DeviceApiMode, type DeviceModes, GoogleAdMob, type HapticFeedbackType, IAP, type IapNextResult, type LocationCoords, type MockContact, type MockData, type MockIapProduct, type MockLocation, type MockPreset, type MockPresetState, type NetworkStatus, type OperationalEnvironment, type PermissionName, type PermissionStatus, type PlatformOS, type Primitive, type SafeAreaInsets, type SafeAreaInsets$1 as SafeAreaInsetsType, Storage, TossAds, aitState, appLogin, applyPreset, appsInTossEvent, appsInTossSignTossCert, builtInPresets, captureCurrentState, checkoutPayment, closeView, contactsViral, deleteUserPreset, env, eventLog, fetchAlbumPhotos, fetchContacts, generateHapticFeedback, getAnonymousKey, getAppsInTossGlobals, getClipboardText, getCurrentLocation, getDefaultPlaceholderImages, getDeviceId, getGameCenterGameProfile, getGroupId, getIsTossLoginIntegratedService, getLocale, getNetworkStatus, getOperationalEnvironment, getPermission, getPlatformOS, getSafeAreaInsets, getSchemeUri, getServerTime, getTossAppVersion, getTossShareLink, getUserKeyForGame, graniteEvent, grantPromotionReward, grantPromotionRewardForGame, isMinVersionSupported, listUserPresets, loadFullScreenAd, matchesPreset, onVisibilityChangedByTransparentServiceWeb, openCamera, openGameCenterLeaderboard, openPermissionDialog, openURL, partner, requestNotificationAgreement, requestPermission, requestReview, requestTossPayPaysBilling, saveBase64Data, saveUserPreset, setClipboardText, setDeviceOrientation, setIosSwipeGestureEnabled, setScreenAwakeMode, setSecureScreen, share, showFullScreenAd, startUpdateLocation, submitGameCenterLeaderBoardScore, tdsEvent };
|
|
856
|
+
export { Accuracy, type AitDevtoolsState, Analytics, type AnalyticsLogEntry, type DeviceApiMode, type DeviceModes, GoogleAdMob, type HapticFeedbackType, IAP, type IapNextResult, type LocationCoords, type MockContact, type MockData, type MockIapProduct, type MockLocation, type MockPreset, type MockPresetState, type NetworkStatus, type OperationalEnvironment, type PermissionName, type PermissionStatus, type PlatformOS, type Primitive, type SafeAreaInsets, type SafeAreaInsets$1 as SafeAreaInsetsType, Storage, TossAds, aitState, appLogin, applyPreset, appsInTossEvent, appsInTossSignTossCert, builtInPresets, captureCurrentState, checkoutPayment, closeView, contactsViral, deleteUserPreset, env, eventLog, fetchAlbumItems, fetchAlbumPhotos, fetchContacts, generateHapticFeedback, getAnonymousKey, getAppsInTossGlobals, getClipboardText, getCurrentLocation, getDefaultPlaceholderImages, getDeviceId, getGameCenterGameProfile, getGroupId, getIsTossLoginIntegratedService, getLocale, getNetworkStatus, getOperationalEnvironment, getPermission, getPlatformOS, getSafeAreaInsets, getSchemeUri, getServerTime, getTossAppVersion, getTossShareLink, getUserKeyForGame, graniteEvent, grantPromotionReward, grantPromotionRewardForGame, isMinVersionSupported, listUserPresets, loadFullScreenAd, matchesPreset, onVisibilityChangedByTransparentServiceWeb, openCamera, openGameCenterLeaderboard, openPDFViewer, openPermissionDialog, openURL, partner, requestNotificationAgreement, requestPermission, requestReview, requestTossPayPaysBilling, saveBase64Data, saveUserPreset, setClipboardText, setDeviceOrientation, setIosSwipeGestureEnabled, setScreenAwakeMode, setSecureScreen, share, showFullScreenAd, startUpdateLocation, submitGameCenterLeaderBoardScore, tdsEvent };
|
|
824
857
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/mock/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/mock/ads/index.ts","../../src/mock/analytics/index.ts","../../src/mock/auth/index.ts","../../src/mock/device/_helpers.ts","../../src/mock/types.ts","../../src/mock/device/camera.ts","../../src/mock/device/clipboard.ts","../../src/mock/device/contacts.ts","../../src/mock/device/haptic.ts","../../src/mock/device/location.ts","../../src/mock/device/storage.ts","../../src/mock/game/index.ts","../../src/mock/iap/index.ts","../../src/mock/navigation/index.ts","../../src/mock/notification.ts","../../src/mock/partner/index.ts","../../src/mock/permissions.ts","../../src/mock/state.ts","../../src/mock/presets.ts","../../src/mock/preset-store.ts"],"mappings":";;AAgBA;;cAAa,WAAA;;IAGP,OAAA,GAAU,IAAA;MAAQ,IAAA;MAAc,IAAA;IAAA;IAChC,OAAA,GAAU,KAAA,EAAO,KAAA;IACjB,OAAA;MAAY,SAAA;IAAA;EAAA;;;;IAgBZ,OAAA,GAAU,IAAA;MAAQ,IAAA;MAAc,IAAA;IAAA;IAChC,OAAA,GAAU,KAAA,EAAO,KAAA;IACjB,OAAA;MAAY,SAAA;IAAA;EAAA;;;;IAqBK,SAAA;EAAA,MAAuB,OAAA;;;;cAMjC,OAAA;;;;gCAKU,MAAA,WAAmB,WAAA,EAAW,QAAA;;;sCAY9B,MAAA,WAAmB,WAAA,EAAW,QAAA;;;;;;;;;;;;cAkBxC,gBAAA,IAAgB,IAAA;EAEzB,OAAA,GAAU,IAAA;IAAQ,IAAA;IAAc,IAAA;EAAA;EAChC,OAAA,GAAU,KAAA,EAAO,KAAA;EACjB,OAAA;IAAY,SAAA;EAAA;AAAA;;;cAcH,gBAAA,IAAgB,IAAA;EA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AAmB,eAAA;;;iBC1LjD,eAAA,CAAA,GAAmB,UAAA;;;;;;;;;;iBAwBnB,cAAA,CACd,KAAA,UACA,KAAA,EAAO,eAAA,EACP,WAAA,YACC,UAAA;AAAA,iBAkBa,gBAAA,CAAiB,EAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/mock/ads/index.ts","../../src/mock/analytics/index.ts","../../src/mock/auth/index.ts","../../src/mock/device/_helpers.ts","../../src/mock/types.ts","../../src/mock/device/camera.ts","../../src/mock/device/clipboard.ts","../../src/mock/device/contacts.ts","../../src/mock/device/haptic.ts","../../src/mock/device/location.ts","../../src/mock/device/pdf.ts","../../src/mock/device/storage.ts","../../src/mock/game/index.ts","../../src/mock/iap/index.ts","../../src/mock/navigation/index.ts","../../src/mock/notification.ts","../../src/mock/partner/index.ts","../../src/mock/permissions.ts","../../src/mock/state.ts","../../src/mock/presets.ts","../../src/mock/preset-store.ts"],"mappings":";;AAgBA;;cAAa,WAAA;;IAGP,OAAA,GAAU,IAAA;MAAQ,IAAA;MAAc,IAAA;IAAA;IAChC,OAAA,GAAU,KAAA,EAAO,KAAA;IACjB,OAAA;MAAY,SAAA;IAAA;EAAA;;;;IAgBZ,OAAA,GAAU,IAAA;MAAQ,IAAA;MAAc,IAAA;IAAA;IAChC,OAAA,GAAU,KAAA,EAAO,KAAA;IACjB,OAAA;MAAY,SAAA;IAAA;EAAA;;;;IAqBK,SAAA;EAAA,MAAuB,OAAA;;;;cAMjC,OAAA;;;;gCAKU,MAAA,WAAmB,WAAA,EAAW,QAAA;;;sCAY9B,MAAA,WAAmB,WAAA,EAAW,QAAA;;;;;;;;;;;;cAkBxC,gBAAA,IAAgB,IAAA;EAEzB,OAAA,GAAU,IAAA;IAAQ,IAAA;IAAc,IAAA;EAAA;EAChC,OAAA,GAAU,KAAA,EAAO,KAAA;EACjB,OAAA;IAAY,SAAA;EAAA;AAAA;;;cAcH,gBAAA,IAAgB,IAAA;EAEzB,OAAA,GAA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A;EAAA;EACrB,GAAA,GAAM,OAAA,CAAQ,gBAAA;EACd,OAAA,GAAU,OAAA,CAAQ,gBAAA;AAAA;AAAA,UAGH,UAAA;EACf,EAAA;EACA,KAAA;EACA,WAAA;EACA,KAAA,EAAO,eAAA;AAAA;AAAA,cAGI,cAAA,WAAyB,UAAA;AnBwBtC;;;;;AAAA,iBmB6FgB,WAAA,CAAY,KAAA,EAAO,eAAA;;;;;;;;iBAwCnB,aAAA,CAAc,QAAA,EAAU,gBAAA,EAAkB,MAAA,EAAQ,eAAA;;;;iBAyClD,mBAAA,CAAoB,QAAA,EAAU,gBAAA,GAAmB,eAAA;;;iBC1LjD,eAAA,CAAA,GAAmB,UAAA;;;;;;;;;;iBAwBnB,cAAA,CACd,KAAA,UACA,KAAA,EAAO,eAAA,EACP,WAAA,YACC,UAAA;AAAA,iBAkBa,gBAAA,CAAiB,EAAA"}
|
package/dist/mock/index.js
CHANGED
|
@@ -512,7 +512,7 @@ function checkPermission(name, fnName) {
|
|
|
512
512
|
//#endregion
|
|
513
513
|
//#region src/mock/device/camera.ts
|
|
514
514
|
/**
|
|
515
|
-
* Camera & Album Photos mock
|
|
515
|
+
* Camera & Album Photos & Album Items mock
|
|
516
516
|
* mock/web/prompt 모드 지원
|
|
517
517
|
*/
|
|
518
518
|
async function openCameraMock() {
|
|
@@ -624,6 +624,66 @@ const _fetchAlbumPhotos = async (options) => {
|
|
|
624
624
|
return fetchAlbumPhotosMock(maxCount);
|
|
625
625
|
};
|
|
626
626
|
const fetchAlbumPhotos = withPermission(_fetchAlbumPhotos, "photos");
|
|
627
|
+
async function fetchAlbumItemsMock(maxCount, types) {
|
|
628
|
+
return getMockImages().slice(0, maxCount).filter(() => types.includes("PHOTO")).map((dataUri) => ({
|
|
629
|
+
id: crypto.randomUUID(),
|
|
630
|
+
dataUri,
|
|
631
|
+
type: "PHOTO"
|
|
632
|
+
}));
|
|
633
|
+
}
|
|
634
|
+
async function fetchAlbumItemsWeb(maxCount, types) {
|
|
635
|
+
return new Promise((resolve) => {
|
|
636
|
+
const input = document.createElement("input");
|
|
637
|
+
input.type = "file";
|
|
638
|
+
input.accept = types.includes("VIDEO") ? "image/*,video/*" : "image/*";
|
|
639
|
+
input.multiple = true;
|
|
640
|
+
let settled = false;
|
|
641
|
+
input.onchange = async () => {
|
|
642
|
+
settled = true;
|
|
643
|
+
const files = Array.from(input.files ?? []).slice(0, maxCount);
|
|
644
|
+
if (files.length === 0) {
|
|
645
|
+
resolve([]);
|
|
646
|
+
return;
|
|
647
|
+
}
|
|
648
|
+
resolve(await Promise.all(files.map((file) => new Promise((res, rej) => {
|
|
649
|
+
const itemType = file.type.startsWith("video/") ? "VIDEO" : "PHOTO";
|
|
650
|
+
const reader = new FileReader();
|
|
651
|
+
reader.onload = () => res({
|
|
652
|
+
id: crypto.randomUUID(),
|
|
653
|
+
dataUri: reader.result,
|
|
654
|
+
type: itemType
|
|
655
|
+
});
|
|
656
|
+
reader.onerror = () => rej(/* @__PURE__ */ new Error("Failed to read file"));
|
|
657
|
+
reader.readAsDataURL(file);
|
|
658
|
+
}))));
|
|
659
|
+
};
|
|
660
|
+
const onFocus = () => {
|
|
661
|
+
setTimeout(() => {
|
|
662
|
+
if (!settled) resolve([]);
|
|
663
|
+
window.removeEventListener("focus", onFocus);
|
|
664
|
+
}, 300);
|
|
665
|
+
};
|
|
666
|
+
window.addEventListener("focus", onFocus);
|
|
667
|
+
input.click();
|
|
668
|
+
});
|
|
669
|
+
}
|
|
670
|
+
async function fetchAlbumItemsPrompt(maxCount) {
|
|
671
|
+
return (await waitForPromptResponse("photos")).slice(0, maxCount).map((dataUri) => ({
|
|
672
|
+
id: crypto.randomUUID(),
|
|
673
|
+
dataUri,
|
|
674
|
+
type: "PHOTO"
|
|
675
|
+
}));
|
|
676
|
+
}
|
|
677
|
+
const _fetchAlbumItems = async (options) => {
|
|
678
|
+
checkPermission("photos", "fetchAlbumItems");
|
|
679
|
+
const maxCount = options?.maxCount ?? 10;
|
|
680
|
+
const types = options?.types ?? ["PHOTO"];
|
|
681
|
+
const mode = aitState.state.deviceModes.photos;
|
|
682
|
+
if (mode === "web") return fetchAlbumItemsWeb(maxCount, types);
|
|
683
|
+
if (mode === "prompt") return fetchAlbumItemsPrompt(maxCount);
|
|
684
|
+
return fetchAlbumItemsMock(maxCount, types);
|
|
685
|
+
};
|
|
686
|
+
const fetchAlbumItems = withPermission(_fetchAlbumItems, "photos");
|
|
627
687
|
//#endregion
|
|
628
688
|
//#region src/mock/device/clipboard.ts
|
|
629
689
|
/**
|
|
@@ -827,6 +887,16 @@ function getNetworkStatusByMode() {
|
|
|
827
887
|
return null;
|
|
828
888
|
}
|
|
829
889
|
//#endregion
|
|
890
|
+
//#region src/mock/device/pdf.ts
|
|
891
|
+
/**
|
|
892
|
+
* Base64로 인코딩된 PDF 데이터를 네이티브 PDF 뷰어로 여는 mock.
|
|
893
|
+
* mock 환경에서는 즉시 `'CLOSE'`를 반환한다.
|
|
894
|
+
*/
|
|
895
|
+
async function openPDFViewer(_params) {
|
|
896
|
+
await Promise.resolve();
|
|
897
|
+
return "CLOSE";
|
|
898
|
+
}
|
|
899
|
+
//#endregion
|
|
830
900
|
//#region src/mock/device/storage.ts
|
|
831
901
|
/**
|
|
832
902
|
* Storage mock
|
|
@@ -1466,6 +1536,6 @@ function captureCurrentState(snapshot) {
|
|
|
1466
1536
|
};
|
|
1467
1537
|
}
|
|
1468
1538
|
//#endregion
|
|
1469
|
-
export { Accuracy, Analytics, GoogleAdMob, IAP, SafeAreaInsets, Storage, TossAds, aitState, appLogin, applyPreset, appsInTossEvent, appsInTossSignTossCert, builtInPresets, captureCurrentState, checkoutPayment, closeView, contactsViral, deleteUserPreset, env, eventLog, fetchAlbumPhotos, fetchContacts, generateHapticFeedback, getAnonymousKey, getAppsInTossGlobals, getClipboardText, getCurrentLocation, getDefaultPlaceholderImages, getDeviceId, getGameCenterGameProfile, getGroupId, getIsTossLoginIntegratedService, getLocale, getNetworkStatus, getOperationalEnvironment, getPermission, getPlatformOS, getSafeAreaInsets, getSchemeUri, getServerTime, getTossAppVersion, getTossShareLink, getUserKeyForGame, graniteEvent, grantPromotionReward, grantPromotionRewardForGame, isMinVersionSupported, listUserPresets, loadFullScreenAd, matchesPreset, onVisibilityChangedByTransparentServiceWeb, openCamera, openGameCenterLeaderboard, openPermissionDialog, openURL, partner, requestNotificationAgreement, requestPermission, requestReview, requestTossPayPaysBilling, saveBase64Data, saveUserPreset, setClipboardText, setDeviceOrientation, setIosSwipeGestureEnabled, setScreenAwakeMode, setSecureScreen, share, showFullScreenAd, startUpdateLocation, submitGameCenterLeaderBoardScore, tdsEvent };
|
|
1539
|
+
export { Accuracy, Analytics, GoogleAdMob, IAP, SafeAreaInsets, Storage, TossAds, aitState, appLogin, applyPreset, appsInTossEvent, appsInTossSignTossCert, builtInPresets, captureCurrentState, checkoutPayment, closeView, contactsViral, deleteUserPreset, env, eventLog, fetchAlbumItems, fetchAlbumPhotos, fetchContacts, generateHapticFeedback, getAnonymousKey, getAppsInTossGlobals, getClipboardText, getCurrentLocation, getDefaultPlaceholderImages, getDeviceId, getGameCenterGameProfile, getGroupId, getIsTossLoginIntegratedService, getLocale, getNetworkStatus, getOperationalEnvironment, getPermission, getPlatformOS, getSafeAreaInsets, getSchemeUri, getServerTime, getTossAppVersion, getTossShareLink, getUserKeyForGame, graniteEvent, grantPromotionReward, grantPromotionRewardForGame, isMinVersionSupported, listUserPresets, loadFullScreenAd, matchesPreset, onVisibilityChangedByTransparentServiceWeb, openCamera, openGameCenterLeaderboard, openPDFViewer, openPermissionDialog, openURL, partner, requestNotificationAgreement, requestPermission, requestReview, requestTossPayPaysBilling, saveBase64Data, saveUserPreset, setClipboardText, setDeviceOrientation, setIosSwipeGestureEnabled, setScreenAwakeMode, setSecureScreen, share, showFullScreenAd, startUpdateLocation, submitGameCenterLeaderBoardScore, tdsEvent };
|
|
1470
1540
|
|
|
1471
1541
|
//# sourceMappingURL=index.js.map
|