things-api 0.19.3 → 0.20.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/README.md +1 -1
- package/deputy/prebuilt/Things API Helper.app/Contents/CodeResources +0 -0
- package/deputy/prebuilt/Things API Helper.app/Contents/Helpers/things-reader.app/Contents/MacOS/things-reader +0 -0
- package/deputy/prebuilt/Things API Helper.app/Contents/MacOS/things-deputy +0 -0
- package/dist/audit/schema.d.ts +42 -10
- package/dist/audit/schema.js +21 -0
- package/dist/audit/schema.js.map +1 -1
- package/dist/cli/commands/doctor.js +3 -1
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/op-result.js +25 -7
- package/dist/cli/commands/op-result.js.map +1 -1
- package/dist/cli/commands/repeat-flags.d.ts +19 -1
- package/dist/cli/commands/repeat-flags.js +71 -0
- package/dist/cli/commands/repeat-flags.js.map +1 -1
- package/dist/cli/commands/rescue.d.ts +12 -0
- package/dist/cli/commands/rescue.js +83 -0
- package/dist/cli/commands/rescue.js.map +1 -0
- package/dist/cli/commands/writes.js +86 -32
- package/dist/cli/commands/writes.js.map +1 -1
- package/dist/cli/help.js +25 -25
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/main.js +12 -2
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/resolve-invocation.d.ts +9 -1
- package/dist/cli/resolve-invocation.js +71 -0
- package/dist/cli/resolve-invocation.js.map +1 -1
- package/dist/cli/unknown-command.d.ts +26 -0
- package/dist/cli/unknown-command.js +135 -0
- package/dist/cli/unknown-command.js.map +1 -0
- package/dist/contracts.d.ts +4 -3
- package/dist/contracts.js +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp/server.js +62 -10
- package/dist/mcp/server.js.map +1 -1
- package/dist/model/entities.d.ts +11 -0
- package/dist/model/entities.js.map +1 -1
- package/dist/model/mappers.js +15 -0
- package/dist/model/mappers.js.map +1 -1
- package/dist/op-result.d.ts +24 -2
- package/dist/op-result.js +77 -20
- package/dist/op-result.js.map +1 -1
- package/dist/process-instance.d.ts +41 -0
- package/dist/process-instance.js +82 -0
- package/dist/process-instance.js.map +1 -0
- package/dist/rescue.d.ts +247 -0
- package/dist/rescue.js +811 -0
- package/dist/rescue.js.map +1 -0
- package/dist/session-grant.js +4 -15
- package/dist/session-grant.js.map +1 -1
- package/dist/ui-state.d.ts +8 -4
- package/dist/ui-state.js +8 -4
- package/dist/ui-state.js.map +1 -1
- package/dist/write/batch.js +4 -1
- package/dist/write/batch.js.map +1 -1
- package/dist/write/clone.js +12 -6
- package/dist/write/clone.js.map +1 -1
- package/dist/write/commands.d.ts +9 -0
- package/dist/write/commands.js +135 -50
- package/dist/write/commands.js.map +1 -1
- package/dist/write/disclosures.d.ts +275 -0
- package/dist/write/disclosures.js +277 -0
- package/dist/write/disclosures.js.map +1 -0
- package/dist/write/experimental.d.ts +16 -0
- package/dist/write/experimental.js +19 -0
- package/dist/write/experimental.js.map +1 -1
- package/dist/write/failure-hints.js +3 -2
- package/dist/write/failure-hints.js.map +1 -1
- package/dist/write/guards.d.ts +1 -1
- package/dist/write/guards.js +102 -3
- package/dist/write/guards.js.map +1 -1
- package/dist/write/heading.js +4 -7
- package/dist/write/heading.js.map +1 -1
- package/dist/write/lock.d.ts +85 -1
- package/dist/write/lock.js +121 -6
- package/dist/write/lock.js.map +1 -1
- package/dist/write/make-repeating-project.js +2 -1
- package/dist/write/make-repeating-project.js.map +1 -1
- package/dist/write/operations.d.ts +52 -6
- package/dist/write/operations.js +22 -0
- package/dist/write/operations.js.map +1 -1
- package/dist/write/opid.d.ts +69 -8
- package/dist/write/opid.js +116 -20
- package/dist/write/opid.js.map +1 -1
- package/dist/write/param-schema.js +14 -2
- package/dist/write/param-schema.js.map +1 -1
- package/dist/write/pipeline.d.ts +82 -3
- package/dist/write/pipeline.js +204 -60
- package/dist/write/pipeline.js.map +1 -1
- package/dist/write/planner.d.ts +7 -0
- package/dist/write/planner.js +12 -0
- package/dist/write/planner.js.map +1 -1
- package/dist/write/preserve-modified.d.ts +17 -8
- package/dist/write/preserve-modified.js.map +1 -1
- package/dist/write/promote-clone.js +106 -53
- package/dist/write/promote-clone.js.map +1 -1
- package/dist/write/reorder.js +45 -39
- package/dist/write/reorder.js.map +1 -1
- package/dist/write/repeat-rule.d.ts +25 -1
- package/dist/write/repeat-rule.js +69 -0
- package/dist/write/repeat-rule.js.map +1 -1
- package/dist/write/resolution-timestamps.js +104 -78
- package/dist/write/resolution-timestamps.js.map +1 -1
- package/dist/write/reversibility.js +2 -2
- package/dist/write/reversibility.js.map +1 -1
- package/dist/write/spawn-expectation.d.ts +135 -0
- package/dist/write/spawn-expectation.js +237 -0
- package/dist/write/spawn-expectation.js.map +1 -0
- package/dist/write/template-mutation.js +34 -35
- package/dist/write/template-mutation.js.map +1 -1
- package/dist/write/undo.js +45 -5
- package/dist/write/undo.js.map +1 -1
- package/dist/write/vectors/simulator.js +48 -2
- package/dist/write/vectors/simulator.js.map +1 -1
- package/dist/write/vectors/types.d.ts +12 -0
- package/dist/write/vectors/ui-recipes.js +11 -1
- package/dist/write/vectors/ui-recipes.js.map +1 -1
- package/dist/write/vectors/ui-state.d.ts +64 -6
- package/dist/write/vectors/ui-state.js +91 -4
- package/dist/write/vectors/ui-state.js.map +1 -1
- package/dist/write/vectors/ui.d.ts +69 -3
- package/dist/write/vectors/ui.js +293 -146
- package/dist/write/vectors/ui.js.map +1 -1
- package/dist/write/vectors/url-scheme.js +26 -0
- package/dist/write/vectors/url-scheme.js.map +1 -1
- package/dist/write/verify/delta.d.ts +17 -2
- package/dist/write/verify/delta.js +46 -16
- package/dist/write/verify/delta.js.map +1 -1
- package/dist/write/verify/poller.d.ts +3 -2
- package/dist/write/verify/poller.js +3 -1
- package/dist/write/verify/poller.js.map +1 -1
- package/package.json +1 -1
- package/schema/envelope.schema.json +1 -2
- package/skills/things-cli/SKILL.md +4 -2
- package/skills/things-cli/references/repeating.md +1 -1
- package/dist/cli/commands/ui-state.d.ts +0 -11
- package/dist/cli/commands/ui-state.js +0 -27
- package/dist/cli/commands/ui-state.js.map +0 -1
|
@@ -25,7 +25,9 @@ export async function pollUntilVerified(evaluate, timeoutMs, deps = {}) {
|
|
|
25
25
|
observed: last.observed,
|
|
26
26
|
...(last.discoveredUuid !== undefined && { discoveredUuid: last.discoveredUuid }),
|
|
27
27
|
...(last.repeating !== undefined && { repeating: last.repeating }),
|
|
28
|
-
...(last.
|
|
28
|
+
...(last.repeatingDisclosures !== undefined && {
|
|
29
|
+
repeatingDisclosures: last.repeatingDisclosures,
|
|
30
|
+
}),
|
|
29
31
|
};
|
|
30
32
|
}
|
|
31
33
|
// UNEXPLAINED DELTA (CGRD1 guard 3): the requested change LANDED — the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"poller.js","sourceRoot":"","sources":["../../../src/write/verify/poller.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"poller.js","sourceRoot":"","sources":["../../../src/write/verify/poller.ts"],"names":[],"mappings":"AA4BA,6FAA6F;AAC7F,MAAM,yBAAyB,GAAG,CAAC,CAAC;AACpC,6FAA6F;AAC7F,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAuBpC,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,QAA+B,EAC/B,SAAiB,EACjB,OAAmB,EAAE;IAErB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAC3C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,EAAU,EAAE,EAAE,CAAC,IAAI,OAAO,CAAO,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IAC1F,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC;IACtB,MAAM,QAAQ,GAAG,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C;gBACN,SAAS,GAAG,GAAG,CAAC;gBAChB,WAAW,GAAG,GAAG,EAAE,CAAC;gBACpB,WAAW,GAAG,CAAC,CAAC;YAClB,CAAC;YACD,IACE,WAAW,IAAI,yBAAyB;gBACxC,GAAG,EAAE,GAAG,WAAW,IAAI,sBAAsB,EAC7C,CAAC;gBACD,OAAO;oBACL,IAAI,EAAE,UAAU;oBAChB,QAAQ;oBACR,SAAS,EAAE,GAAG,EAAE,GAAG,OAAO;oBAC1B,QAAQ,EAAE,IAAI,CAAC,QAAQ;oBACvB,GAAG,CAAC,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;iBAC1D,CAAC;YACJ,CAAC;QACH,CAAC;aAAM,CAAC;YACN,SAAS,GAAG,IAAI,CAAC;YACjB,WAAW,GAAG,CAAC,CAAC;QAClB,CAAC;QACD,0HAA0H;QAC1H,MAAM,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAC1C,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "things-api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"description": "Typed TypeScript library + CLI for Things 3 (Cultured Code) — verified writes, audit trail, schema-drift detection",
|
|
5
5
|
"homepage": "https://github.com/mikegreiling/things-api#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -67,7 +67,6 @@
|
|
|
67
67
|
"move-plan",
|
|
68
68
|
"project-reopen",
|
|
69
69
|
"doctor",
|
|
70
|
-
"ui-state",
|
|
71
70
|
"capabilities",
|
|
72
71
|
"config",
|
|
73
72
|
"legend",
|
|
@@ -363,7 +362,7 @@
|
|
|
363
362
|
},
|
|
364
363
|
"ErrorCode": {
|
|
365
364
|
"type": "string",
|
|
366
|
-
"description": "The registry of stable machine-readable error codes an error envelope can carry — the compiler IS the registry. Every `error.code` value the surfaces emit is a member of this union, and the human-readable meaning of each is frozen at v1.0 (new codes may still be ADDED after v1.0 — that is non-breaking; a documented code's MEANING never changes). The canonical per-code table (meaning + the `detail` keys each may carry) lives in `docs/contract.md` (The error-code registry).\n\nTwo members are template-literal families rather than fixed strings, because their suffix is minted in the write layer and the core deliberately never depends on it (see {@link blockedCode } / {@link verifyFailedCode } ): - `verify-failed:${reason}` — a single mutation executed but read-after-write verification failed; the suffix is the reason (`timeout` | `mismatch` | `silent-noop` | `ui-unreachable` | `collateral`). The bare `verify-failed` (no suffix) is the multi-leg move/reorder failure. - `blocked:${suffix}` — a mutation refused before touching the app; the suffix is the specific hazard id (`H-…`) when one is named, else the block reason (`drift` | `disruption-tier` | `lock` | `environment` | `clock` | `scope`). The bare `blocked` is a policy
|
|
365
|
+
"description": "The registry of stable machine-readable error codes an error envelope can carry — the compiler IS the registry. Every `error.code` value the surfaces emit is a member of this union, and the human-readable meaning of each is frozen at v1.0 (new codes may still be ADDED after v1.0 — that is non-breaking; a documented code's MEANING never changes). The canonical per-code table (meaning + the `detail` keys each may carry) lives in `docs/contract.md` (The error-code registry).\n\nTwo members are template-literal families rather than fixed strings, because their suffix is minted in the write layer and the core deliberately never depends on it (see {@link blockedCode } / {@link verifyFailedCode } ): - `verify-failed:${reason}` — a single mutation executed but read-after-write verification failed; the suffix is the reason (`timeout` | `mismatch` | `silent-noop` | `ui-unreachable` | `collateral`). The bare `verify-failed` (no suffix) is the multi-leg move/reorder failure. - `blocked:${suffix}` — a mutation refused before touching the app; the suffix is the specific hazard id (`H-…`) when one is named, else the block reason (`drift` | `disruption-tier` | `lock` | `environment` | `clock` | `scope` | `reconcile` | `in-flight`). The bare `blocked` is a policy refusal from the move planner.\n\n`blocked:drift` maps to exit code 5 (DriftBlocked); every other `blocked:*` maps to exit code 4 (Blocked)."
|
|
367
366
|
}
|
|
368
367
|
},
|
|
369
368
|
"title": "things-api envelope",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: things-cli
|
|
3
3
|
description: Read and manage a user's tasks in the Things 3 app (macOS) through the `things` CLI — list views like Today/Inbox/Upcoming, search, and create, edit, schedule, complete, move, or organize to-dos, projects, areas, headings, and tags. Use whenever the user asks about their tasks, to-dos, projects, or anything in Things.
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.20.0
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Things CLI
|
|
@@ -67,7 +67,9 @@ Namespaced verb families — run `things <group> --help` for the verbs and `thin
|
|
|
67
67
|
|
|
68
68
|
**Guarded writes** surface their consequence and require an explicit flag: deleting a NON-EMPTY area needs `--allow-non-empty`, a permanent delete needs `--dangerously-permanent`, and a UI-driving op (e.g. `area reorder`, `make-repeating`) needs `--dangerously-drive-gui` plus `things config set ui-enabled true`. The full acknowledgment contract is in [references/errors.md](references/errors.md).
|
|
69
69
|
|
|
70
|
-
**
|
|
70
|
+
**Put `--op-id <key>` on every write you might retry.** It costs nothing and it is the only thing that makes a retry safe: a resubmission under the same key replays the first result instead of repeating the change, and if the first is *still running* the second is refused rather than executed. Without a key, a retry after a timeout is a second execution.
|
|
71
|
+
|
|
72
|
+
**UI-driving ops are slow — allow a generous timeout, and NEVER read a timeout as success.** A `--dangerously-drive-gui` op visibly drives the Things app and takes SECONDS, over a minute on a large, syncing database. Order your two budgets so the app's outlasts yours in neither direction by accident: pass `--verify-timeout 120000` or more, and set your wrapper/tool timeout ABOVE it — **at least 180s** when your harness allows it (120s is the floor). The cardinal rule: **a timeout, EMPTY output, or a silent no-op is NOT a success** — treat it as "outcome unknown". If your own timeout kills the command first you get EMPTY output (not a result, not an error) and the change MAY STILL have landed; if the app's budget is exceeded first you get a structured timeout that says the outcome is uncertain. **In both cases, do not read the item and guess — run `things op-result <key>`.** It reads the change history the killed process already wrote and answers with one of: `found` (the real result), `in-flight` (still running — call it again in a few seconds; do NOT re-send the write), `orphaned` (it started and its process ended without recording an outcome — outcome UNCERTAIN), or `unknown` (never recorded). Only when you have no key does re-reading with `things show <uuid>` become the fallback. **Do NOT fire an identical retry** — repeated blind retries after a timeout or a kill are exactly how you get duplicate or half-configured series (the original item trashed, a wrong template created). If the state is wrong or ambiguous and `op-result` does not clarify it, **STOP and file a bug** with the trace (`~/.local/state/things-api/trace/`, on a dev checkout) rather than retrying. A genuine success always returns a structured JSON result (with `--json`) naming the new/updated uuid; anything else is not a success. **If a drive reports that a dialog may still be open in Things, run `things rescue status --json` before anything else** — it reports, without touching anything, whether a dialog is open, which one, which application currently owns the keyboard, and whether another command is holding the change lock. An open dialog is not cosmetic: while one stands, Things ignores this kind of change and stops sending anything to Things Cloud, so the next command will fail the same way until it is dismissed. The trace can hold real task titles, so never paste it into a public issue.
|
|
71
73
|
|
|
72
74
|
**Quick skeletons**: `things todo add "T1" "T2" "T3" [shared flags]` creates several to-dos in one call (every shared flag — `--project`/`--area`/`--when`/`--tags`/… — applies to each; `--id-only` prints the new uuids one per line for chaining; one `undoToken` removes the set). To stand up a new project with children, `things project add "<title>" --todo "T1" --todo "T2" …` (repeatable). For richer per-item metadata or cross-item references, use `things batch`.
|
|
73
75
|
|
|
@@ -69,7 +69,7 @@ These commands visibly drive the Things app and are slow — often OVER A MINUTE
|
|
|
69
69
|
|
|
70
70
|
- Allow a generous wrapper timeout — **at least 180s** where your harness permits (120s floor) — and pass `--verify-timeout 120000` or more so the app's own budget outlasts the drive.
|
|
71
71
|
- **A timeout, empty output, or a silent no-op is NOT success** — treat it as "outcome unknown". Before doing anything else, re-read the item with `things show <ref>` (and, on a dev checkout, the trace under `~/.local/state/things-api/trace/`) to learn what actually landed.
|
|
72
|
-
- **
|
|
72
|
+
- **Pass `--op-id <key>` on any of these you might retry**, and if the command dies (a hard wall-time cap you cannot raise), run **`things op-result <key>`** in a fresh command rather than inferring the outcome from the kill. It reads the local change history the killed process already wrote and reports `found` (the final result + target), `in-flight` (still running — call it again in a few seconds, do NOT re-send the write), `orphaned` (started, then its process ended without recording an outcome — UNCERTAIN), or `unknown`. The key also makes the retry itself safe: a resubmission replays the first result, and one sent while the first is still running is refused rather than executed. Every repeat verb takes it, `make-repeating` / `add-repeating` included — those are multi-leg but record ONE result, so the key addresses the whole verb.
|
|
73
73
|
- **Never fire an identical retry** after a timeout or a kill — a blind retry is how you get a duplicate or half-configured series (original trashed, wrong template created). Learn the real outcome first (`things op-result` / `things show`); if the state is wrong or ambiguous, STOP and file a bug with the trace.
|
|
74
74
|
- These ops need Things reachable on the current desktop (not a locked screen or a covering full-screen app); a session it cannot reach is refused cleanly with a remediation, touching nothing.
|
|
75
75
|
- A genuine success always returns a structured JSON result (with `--json`) naming the new/updated uuid.
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `things ui-state` — a read-only look at what is on the screen: whether a
|
|
3
|
-
* dialog is open in Things, which dialog it is, whether Things is frontmost,
|
|
4
|
-
* and which application owns the keyboard. Thin surface over the library's
|
|
5
|
-
* readUiStateReport().
|
|
6
|
-
*
|
|
7
|
-
* Nothing is clicked, typed, activated or dismissed. Always exit 0: an
|
|
8
|
-
* unreadable screen is a reported state, not a command failure.
|
|
9
|
-
*/
|
|
10
|
-
import type { Command } from "commander";
|
|
11
|
-
export declare function registerUiState(program: Command): void;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { okEnvelope, readUiStateReport, uiStateLines } from "../../index.js";
|
|
2
|
-
export function registerUiState(program) {
|
|
3
|
-
program
|
|
4
|
-
.command("ui-state")
|
|
5
|
-
.description("Report what is on the screen right now: whether a dialog is open in Things and which one, " +
|
|
6
|
-
"whether Things is the frontmost app, and which application owns the keyboard. Reads " +
|
|
7
|
-
"only — nothing is clicked, typed or dismissed. Says so plainly when a system dialog is " +
|
|
8
|
-
"covering the screen, since macOS does not let any app inspect one. Always exit 0.")
|
|
9
|
-
.option("--json", "emit versioned JSON envelope on stdout")
|
|
10
|
-
.action(async (opts) => {
|
|
11
|
-
const started = Date.now();
|
|
12
|
-
const report = await readUiStateReport();
|
|
13
|
-
const meta = {
|
|
14
|
-
dbVersion: null,
|
|
15
|
-
fingerprint: "unknown",
|
|
16
|
-
elapsedMs: Date.now() - started,
|
|
17
|
-
};
|
|
18
|
-
if (opts.json) {
|
|
19
|
-
process.stdout.write(`${JSON.stringify(okEnvelope("ui-state", report, meta))}\n`);
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
process.stdout.write(`${uiStateLines(report).join("\n")}\n`);
|
|
23
|
-
}
|
|
24
|
-
process.exitCode = 0;
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=ui-state.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ui-state.js","sourceRoot":"","sources":["../../../src/cli/commands/ui-state.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,YAAY,EAAqB,MAAM,gBAAgB,CAAC;AAEhG,MAAM,UAAU,eAAe,CAAC,OAAgB;IAC9C,OAAO;SACJ,OAAO,CAAC,UAAU,CAAC;SACnB,WAAW,CACV,4FAA4F;QAC1F,sFAAsF;QACtF,yFAAyF;QACzF,mFAAmF,CACtF;SACA,MAAM,CAAC,QAAQ,EAAE,wCAAwC,CAAC;SAC1D,MAAM,CAAC,KAAK,EAAE,IAAwB,EAAE,EAAE;QACzC,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,MAAM,iBAAiB,EAAE,CAAC;QACzC,MAAM,IAAI,GAAiB;YACzB,SAAS,EAAE,IAAI;YACf,WAAW,EAAE,SAAS;YACtB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO;SAChC,CAAC;QACF,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YACd,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;QACpF,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/D,CAAC;QACD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;AACP,CAAC"}
|