@moxt-ai/mobius 0.0.4 → 0.0.6

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.
Files changed (115) hide show
  1. package/dist/acp/native-session.d.ts +30 -0
  2. package/dist/acp/native-session.d.ts.map +1 -0
  3. package/dist/acp/native-session.js +25 -0
  4. package/dist/acp/native-session.js.map +1 -0
  5. package/dist/acp/session-history.d.ts +9 -0
  6. package/dist/acp/session-history.d.ts.map +1 -0
  7. package/dist/acp/session-history.js +69 -0
  8. package/dist/acp/session-history.js.map +1 -0
  9. package/dist/acp/session-manager.d.ts +16 -5
  10. package/dist/acp/session-manager.d.ts.map +1 -1
  11. package/dist/acp/session-manager.js +226 -41
  12. package/dist/acp/session-manager.js.map +1 -1
  13. package/dist/acp/session-store.d.ts +9 -0
  14. package/dist/acp/session-store.d.ts.map +1 -1
  15. package/dist/acp/session-store.js +43 -0
  16. package/dist/acp/session-store.js.map +1 -1
  17. package/dist/agent-catalog/agent-diagnostics.d.ts +3 -0
  18. package/dist/agent-catalog/agent-diagnostics.d.ts.map +1 -0
  19. package/dist/agent-catalog/agent-diagnostics.js +62 -0
  20. package/dist/agent-catalog/agent-diagnostics.js.map +1 -0
  21. package/dist/agent-catalog/discover-local-agents.d.ts +77 -0
  22. package/dist/agent-catalog/discover-local-agents.d.ts.map +1 -0
  23. package/dist/agent-catalog/discover-local-agents.js +467 -0
  24. package/dist/agent-catalog/discover-local-agents.js.map +1 -0
  25. package/dist/agent-catalog/local-agent.d.ts +38 -0
  26. package/dist/agent-catalog/local-agent.d.ts.map +1 -0
  27. package/dist/agent-catalog/local-agent.js +93 -0
  28. package/dist/agent-catalog/local-agent.js.map +1 -0
  29. package/dist/agent-catalog/publish-agent-catalog.d.ts +3 -0
  30. package/dist/agent-catalog/publish-agent-catalog.d.ts.map +1 -0
  31. package/dist/agent-catalog/publish-agent-catalog.js +58 -0
  32. package/dist/agent-catalog/publish-agent-catalog.js.map +1 -0
  33. package/dist/agent-installation/agent-installation-manager.d.ts +60 -0
  34. package/dist/agent-installation/agent-installation-manager.d.ts.map +1 -0
  35. package/dist/agent-installation/agent-installation-manager.js +242 -0
  36. package/dist/agent-installation/agent-installation-manager.js.map +1 -0
  37. package/dist/agent-installation/automatic-adapter-provisioner.d.ts +18 -0
  38. package/dist/agent-installation/automatic-adapter-provisioner.d.ts.map +1 -0
  39. package/dist/agent-installation/automatic-adapter-provisioner.js +116 -0
  40. package/dist/agent-installation/automatic-adapter-provisioner.js.map +1 -0
  41. package/dist/agent-installation/fixed-agent-install-recipes.d.ts +20 -0
  42. package/dist/agent-installation/fixed-agent-install-recipes.d.ts.map +1 -0
  43. package/dist/agent-installation/fixed-agent-install-recipes.js +163 -0
  44. package/dist/agent-installation/fixed-agent-install-recipes.js.map +1 -0
  45. package/dist/agent-installation/fixed-installation-executor.d.ts +20 -0
  46. package/dist/agent-installation/fixed-installation-executor.d.ts.map +1 -0
  47. package/dist/agent-installation/fixed-installation-executor.js +204 -0
  48. package/dist/agent-installation/fixed-installation-executor.js.map +1 -0
  49. package/dist/agent-installation/installation-grants.d.ts +2 -0
  50. package/dist/agent-installation/installation-grants.d.ts.map +1 -0
  51. package/dist/agent-installation/installation-grants.js +52 -0
  52. package/dist/agent-installation/installation-grants.js.map +1 -0
  53. package/dist/agent-installation/local-installation-authorizer.d.ts +7 -0
  54. package/dist/agent-installation/local-installation-authorizer.d.ts.map +1 -0
  55. package/dist/agent-installation/local-installation-authorizer.js +32 -0
  56. package/dist/agent-installation/local-installation-authorizer.js.map +1 -0
  57. package/dist/agent-installation/managed-adapter-installer.d.ts +20 -0
  58. package/dist/agent-installation/managed-adapter-installer.d.ts.map +1 -0
  59. package/dist/agent-installation/managed-adapter-installer.js +159 -0
  60. package/dist/agent-installation/managed-adapter-installer.js.map +1 -0
  61. package/dist/agent-installation/verified-download.d.ts +24 -0
  62. package/dist/agent-installation/verified-download.d.ts.map +1 -0
  63. package/dist/agent-installation/verified-download.js +158 -0
  64. package/dist/agent-installation/verified-download.js.map +1 -0
  65. package/dist/audit/audit-store.d.ts +1 -0
  66. package/dist/audit/audit-store.d.ts.map +1 -1
  67. package/dist/audit/audit-store.js +12 -4
  68. package/dist/audit/audit-store.js.map +1 -1
  69. package/dist/authorization/local-authorization-error.d.ts +5 -0
  70. package/dist/authorization/local-authorization-error.d.ts.map +1 -0
  71. package/dist/authorization/local-authorization-error.js +8 -0
  72. package/dist/authorization/local-authorization-error.js.map +1 -0
  73. package/dist/authorization/workspace-directory.d.ts +16 -5
  74. package/dist/authorization/workspace-directory.d.ts.map +1 -1
  75. package/dist/authorization/workspace-directory.js +109 -119
  76. package/dist/authorization/workspace-directory.js.map +1 -1
  77. package/dist/cli.js +6289 -2124
  78. package/dist/cli.js.map +4 -4
  79. package/dist/config.d.ts +8 -12
  80. package/dist/config.d.ts.map +1 -1
  81. package/dist/config.js +14 -55
  82. package/dist/config.js.map +1 -1
  83. package/dist/index.d.ts +1 -1
  84. package/dist/index.d.ts.map +1 -1
  85. package/dist/index.js +4894 -852
  86. package/dist/index.js.map +4 -4
  87. package/dist/native-sessions/codex-history.d.ts +11 -0
  88. package/dist/native-sessions/codex-history.d.ts.map +1 -0
  89. package/dist/native-sessions/codex-history.js +223 -0
  90. package/dist/native-sessions/codex-history.js.map +1 -0
  91. package/dist/native-sessions/service.d.ts +14 -0
  92. package/dist/native-sessions/service.d.ts.map +1 -0
  93. package/dist/native-sessions/service.js +249 -0
  94. package/dist/native-sessions/service.js.map +1 -0
  95. package/dist/pairing/pair-local-machine.d.ts +2 -2
  96. package/dist/pairing/pair-local-machine.d.ts.map +1 -1
  97. package/dist/pairing/pair-local-machine.js +65 -41
  98. package/dist/pairing/pair-local-machine.js.map +1 -1
  99. package/dist/process/executable.d.ts +40 -0
  100. package/dist/process/executable.d.ts.map +1 -0
  101. package/dist/process/executable.js +305 -0
  102. package/dist/process/executable.js.map +1 -0
  103. package/dist/run-daemon.d.ts +1 -1
  104. package/dist/run-daemon.d.ts.map +1 -1
  105. package/dist/run-daemon.js +431 -180
  106. package/dist/run-daemon.js.map +1 -1
  107. package/dist/storage/state-directory.d.ts +2 -0
  108. package/dist/storage/state-directory.d.ts.map +1 -0
  109. package/dist/storage/state-directory.js +10 -0
  110. package/dist/storage/state-directory.js.map +1 -0
  111. package/package.json +5 -6
  112. package/dist/authorization/authorize-binding.d.ts +0 -6
  113. package/dist/authorization/authorize-binding.d.ts.map +0 -1
  114. package/dist/authorization/authorize-binding.js +0 -30
  115. package/dist/authorization/authorize-binding.js.map +0 -1
@@ -1,9 +1,7 @@
1
1
  import { readdir, realpath, stat } from "node:fs/promises";
2
+ import { homedir } from "node:os";
2
3
  import { basename, dirname, isAbsolute, join, normalize, relative, } from "node:path";
3
- import { LocalAuthorizationError } from "./authorize-binding.js";
4
- const ROOT_DIRECTORY_ID = "root";
5
- const DIRECTORY_ID_PREFIX = "dir-";
6
- const DIRECTORY_ID_PATTERN = /^[a-zA-Z0-9_-]+$/;
4
+ import { LocalAuthorizationError } from "./local-authorization-error.js";
7
5
  export class WorkspaceDirectoryListing {
8
6
  directoryId;
9
7
  directoryLabel;
@@ -16,149 +14,141 @@ export class WorkspaceDirectoryListing {
16
14
  this.parentDirectoryId = parentDirectoryId;
17
15
  }
18
16
  }
19
- function directoryId(relativePath) {
20
- if (relativePath.length === 0) {
21
- return ROOT_DIRECTORY_ID;
17
+ function encodePath(path) {
18
+ const encoded = Buffer.from(path, "utf8").toString("base64url");
19
+ if (encoded.length === 0 || encoded.length > 2_000) {
20
+ throw new LocalAuthorizationError("The local directory path is too long to select");
22
21
  }
23
- return `${DIRECTORY_ID_PREFIX}${Buffer.from(relativePath, "utf8").toString("base64url")}`;
22
+ return `path-${encoded}`;
24
23
  }
25
- function decodeDirectoryId(value) {
26
- if (value === ROOT_DIRECTORY_ID) {
27
- return "";
28
- }
29
- if (!value.startsWith(DIRECTORY_ID_PREFIX)) {
30
- throw new LocalAuthorizationError("The workspace directory is invalid");
31
- }
32
- const encoded = value.slice(DIRECTORY_ID_PREFIX.length);
24
+ function decodePath(value, prefix) {
25
+ const encoded = value.slice(prefix.length);
33
26
  if (encoded.length === 0 ||
34
27
  encoded.length > 2_000 ||
35
- !DIRECTORY_ID_PATTERN.test(encoded)) {
36
- throw new LocalAuthorizationError("The workspace directory is invalid");
37
- }
28
+ !/^[a-zA-Z0-9_-]+$/.test(encoded))
29
+ throw new LocalAuthorizationError("The directory identifier is invalid");
38
30
  const decoded = Buffer.from(encoded, "base64url").toString("utf8");
39
- if (Buffer.from(decoded, "utf8").toString("base64url") !== encoded) {
40
- throw new LocalAuthorizationError("The workspace directory is invalid");
41
- }
42
- const normalized = normalize(decoded);
43
- if (decoded.includes("\0") ||
44
- isAbsolute(decoded) ||
45
- normalized === ".." ||
46
- normalized.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`) ||
47
- normalized !== decoded) {
48
- throw new LocalAuthorizationError("The workspace directory is invalid");
49
- }
50
- return normalized;
51
- }
52
- function isContained(root, target) {
53
- const remainder = relative(root, target);
54
- return (remainder.length === 0 ||
55
- (!isAbsolute(remainder) &&
56
- remainder !== ".." &&
57
- !remainder.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`)));
31
+ if (Buffer.from(decoded, "utf8").toString("base64url") !== encoded ||
32
+ decoded.includes("\0") ||
33
+ normalize(decoded) !== decoded)
34
+ throw new LocalAuthorizationError("The directory identifier is invalid");
35
+ return decoded;
58
36
  }
37
+ /** Pairing authorizes the machine. Directory identifiers select a working
38
+ * directory; they do not grant additional filesystem capabilities. */
59
39
  export class WorkspaceDirectoryService {
60
- #approvedBindingId;
61
- #approvedRoot;
62
- constructor(approvedBindingId, approvedRoot) {
63
- this.#approvedBindingId = approvedBindingId;
64
- this.#approvedRoot = approvedRoot;
40
+ #bindingId;
41
+ #defaultWorkspace;
42
+ constructor(bindingId, defaultWorkspace) {
43
+ this.#bindingId = bindingId;
44
+ this.#defaultWorkspace = defaultWorkspace;
65
45
  }
66
- resolve = async (requestedBindingId, requestedDirectoryId) => {
67
- if (requestedBindingId !== this.#approvedBindingId) {
46
+ authorizeMachine = (bindingId) => {
47
+ if (bindingId !== this.#bindingId)
68
48
  throw new LocalAuthorizationError("The runtime binding is not authorized");
49
+ };
50
+ requestedPath = (id) => {
51
+ if (id === "default")
52
+ return this.#defaultWorkspace;
53
+ if (id === "home")
54
+ return homedir();
55
+ if (id.startsWith("path-")) {
56
+ const path = decodePath(id, "path-");
57
+ if (isAbsolute(path))
58
+ return path;
69
59
  }
70
- const root = await this.resolveRoot();
71
- const relativePath = decodeDirectoryId(requestedDirectoryId);
60
+ throw new LocalAuthorizationError("The directory identifier is invalid");
61
+ };
62
+ resolvePath = async (requested, signal) => {
63
+ signal.throwIfAborted();
64
+ if (!isAbsolute(requested) ||
65
+ requested.includes("\0") ||
66
+ normalize(requested) !== requested)
67
+ throw new LocalAuthorizationError("The local directory path is invalid");
72
68
  try {
73
- const target = await realpath(join(root, relativePath));
69
+ const target = await realpath(requested);
70
+ signal.throwIfAborted();
74
71
  const metadata = await stat(target);
75
- if (!metadata.isDirectory() || !isContained(root, target)) {
76
- throw new LocalAuthorizationError("The workspace directory is not authorized");
77
- }
72
+ signal.throwIfAborted();
73
+ if (!isAbsolute(target) ||
74
+ normalize(target) !== target ||
75
+ !metadata.isDirectory())
76
+ throw new LocalAuthorizationError("The selected location is not a directory");
78
77
  return target;
79
78
  }
80
- catch (error) {
81
- if (error instanceof LocalAuthorizationError) {
82
- throw error;
83
- }
84
- throw new LocalAuthorizationError("The workspace directory cannot be resolved", { cause: error });
79
+ catch (cause) {
80
+ signal.throwIfAborted();
81
+ if (cause instanceof LocalAuthorizationError)
82
+ throw cause;
83
+ throw new LocalAuthorizationError("This directory is missing or unavailable to your user account", { cause });
85
84
  }
86
85
  };
87
- list = async (requestedBindingId, requestedDirectoryId) => {
88
- const root = await this.resolveRoot();
89
- const logicalRelativePath = decodeDirectoryId(requestedDirectoryId);
90
- const target = await this.resolve(requestedBindingId, requestedDirectoryId);
86
+ label = (path) => {
87
+ const suffix = relative(homedir(), path);
88
+ return suffix === ""
89
+ ? "~"
90
+ : !isAbsolute(suffix) &&
91
+ suffix !== ".." &&
92
+ !suffix.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`)
93
+ ? `~/${suffix.replaceAll("\\", "/")}`
94
+ : path;
95
+ };
96
+ identify = async (bindingId, requestedPath, signal) => {
97
+ this.authorizeMachine(bindingId);
98
+ const path = await this.resolvePath(requestedPath, signal);
99
+ return {
100
+ path,
101
+ directoryId: encodePath(path),
102
+ name: basename(path) || path,
103
+ label: this.label(path),
104
+ };
105
+ };
106
+ resolve = async (bindingId, id, signal) => {
107
+ this.authorizeMachine(bindingId);
108
+ return await this.resolvePath(this.requestedPath(id), signal);
109
+ };
110
+ list = async (bindingId, id, signal) => {
111
+ const target = await this.resolve(bindingId, id, signal);
91
112
  try {
92
- const entries = [];
93
113
  const children = await readdir(target, { withFileTypes: true });
114
+ signal.throwIfAborted();
115
+ const entries = [];
94
116
  for (const child of children) {
95
- if (entries.length === 500) {
117
+ if (entries.length === 500)
96
118
  break;
119
+ if (child.isFile() ||
120
+ child.isBlockDevice() ||
121
+ child.isCharacterDevice() ||
122
+ child.isFIFO() ||
123
+ child.isSocket()) {
124
+ continue;
97
125
  }
98
- const logicalChild = logicalRelativePath.length === 0
99
- ? child.name
100
- : join(logicalRelativePath, child.name);
101
126
  try {
102
- const resolvedChild = await realpath(join(target, child.name));
103
- const metadata = await stat(resolvedChild);
104
- if (metadata.isDirectory() && isContained(root, resolvedChild)) {
105
- entries.push({
106
- directoryId: directoryId(logicalChild),
107
- name: child.name,
108
- });
109
- }
127
+ const path = await this.resolvePath(join(target, child.name), signal);
128
+ entries.push({ directoryId: encodePath(path), name: child.name });
110
129
  }
111
- catch {
112
- // Unreadable and broken directory entries are omitted.
130
+ catch (cause) {
131
+ signal.throwIfAborted();
132
+ if (!(cause instanceof LocalAuthorizationError))
133
+ throw cause;
113
134
  }
114
135
  }
115
- entries.sort((left, right) => left.name.localeCompare(right.name));
116
- const labelSuffix = logicalRelativePath.replaceAll("\\", "/");
117
- const parentRelative = logicalRelativePath.length === 0 || dirname(logicalRelativePath) === "."
118
- ? ""
119
- : dirname(logicalRelativePath);
120
- return new WorkspaceDirectoryListing(requestedDirectoryId, labelSuffix.length === 0
121
- ? basename(root)
122
- : `${basename(root)}/${labelSuffix}`, entries, requestedDirectoryId === ROOT_DIRECTORY_ID
123
- ? ""
124
- : directoryId(parentRelative));
136
+ entries.sort((a, b) => a.name.localeCompare(b.name));
137
+ const parent = dirname(target);
138
+ return new WorkspaceDirectoryListing(id, this.label(target), entries, parent === target ? "" : encodePath(parent));
125
139
  }
126
- catch (error) {
127
- if (error instanceof LocalAuthorizationError) {
128
- throw error;
129
- }
130
- throw new LocalAuthorizationError("The workspace directory cannot be listed", { cause: error });
131
- }
132
- };
133
- resolveMany = async (requestedBindingId, directoryIds) => {
134
- const resolved = [];
135
- const unique = new Set();
136
- for (const requestedDirectoryId of directoryIds) {
137
- const directory = await this.resolve(requestedBindingId, requestedDirectoryId);
138
- if (!unique.has(directory)) {
139
- unique.add(directory);
140
- resolved.push(directory);
141
- }
140
+ catch (cause) {
141
+ signal.throwIfAborted();
142
+ if (cause instanceof LocalAuthorizationError)
143
+ throw cause;
144
+ throw new LocalAuthorizationError("This directory cannot be browsed by your user account", { cause });
142
145
  }
143
- return resolved;
144
146
  };
145
- resolveRoot = async () => {
146
- try {
147
- const root = await realpath(this.#approvedRoot);
148
- const metadata = await stat(root);
149
- if (!metadata.isDirectory()) {
150
- throw new LocalAuthorizationError("The approved root is not a directory");
151
- }
152
- return root;
153
- }
154
- catch (error) {
155
- if (error instanceof LocalAuthorizationError) {
156
- throw error;
157
- }
158
- throw new LocalAuthorizationError("The approved root cannot be resolved", {
159
- cause: error,
160
- });
161
- }
147
+ resolveMany = async (bindingId, ids, signal) => {
148
+ const paths = new Set();
149
+ for (const id of ids)
150
+ paths.add(await this.resolve(bindingId, id, signal));
151
+ return [...paths];
162
152
  };
163
153
  }
164
154
  //# sourceMappingURL=workspace-directory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-directory.js","sourceRoot":"","sources":["../../src/authorization/workspace-directory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EACL,QAAQ,EACR,OAAO,EACP,UAAU,EACV,IAAI,EACJ,SAAS,EACT,QAAQ,GACT,MAAM,WAAW,CAAC;AAInB,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,MAAM,iBAAiB,GAAG,MAAM,CAAC;AACjC,MAAM,mBAAmB,GAAG,MAAM,CAAC;AACnC,MAAM,oBAAoB,GAAG,kBAAkB,CAAC;AAEhD,MAAM,OAAO,yBAAyB;IAC3B,WAAW,CAAS;IACpB,cAAc,CAAS;IACvB,OAAO,CAA4B;IACnC,iBAAiB,CAAS;IAEnC,YACE,WAAmB,EACnB,cAAsB,EACtB,OAAkC,EAClC,iBAAyB;QAEzB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;IAC7C,CAAC;CACF;AAED,SAAS,WAAW,CAAC,YAAoB;IACvC,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9B,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IACD,OAAO,GAAG,mBAAmB,GAAG,MAAM,CAAC,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;AAC5F,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAa;IACtC,IAAI,KAAK,KAAK,iBAAiB,EAAE,CAAC;QAChC,OAAO,EAAE,CAAC;IACZ,CAA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9B,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;QACjC,KAAK,MAAM,oBAAoB,IAAI,YAAY,EAAE,CAAC;YAChD,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,OAAO,CAClC,kBAAkB,EAClB,oBAAoB,CACrB,CAAC;YACF,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;gBAC3B,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;gBACtB,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC3B,CAAC;QACH,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC;IAEO,WAAW,GAAG,KAAK,IAAqB,EAAE;QACjD,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YAChD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC;YAClC,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,CAAC;gBAC5B,MAAM,IAAI,uBAAuB,CAC/B,sCAAsC,CACvC,CAAC;YACJ,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,uBAAuB,EAAE,CAAC;gBAC7C,MAAM,KAAK,CAAC;YACd,CAAC;YACD,MAAM,IAAI,uBAAuB,CAC/B,sCAAsC,EACtC;gBACE,KAAK,EAAE,KAAK;aACb,CACF,CAAC;QACJ,CAAC;IACH,CAAC,CAAC;CACH"}
1
+ {"version":3,"file":"workspace-directory.js","sourceRoot":"","sources":["../../src/authorization/workspace-directory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EACL,QAAQ,EACR,O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