@true-and-useful/janee 0.8.4 → 0.9.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 +81 -1
- package/SKILL.md +5 -0
- package/dist/cli/commands/add.d.ts +6 -0
- package/dist/cli/commands/add.d.ts.map +1 -1
- package/dist/cli/commands/add.js +216 -6
- package/dist/cli/commands/add.js.map +1 -1
- package/dist/cli/commands/serve-mcp.d.ts.map +1 -1
- package/dist/cli/commands/serve-mcp.js +71 -1
- package/dist/cli/commands/serve-mcp.js.map +1 -1
- package/dist/cli/commands/status.d.ts +4 -0
- package/dist/cli/commands/status.d.ts.map +1 -0
- package/dist/cli/commands/status.js +127 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/config-yaml.d.ts +22 -1
- package/dist/cli/config-yaml.d.ts.map +1 -1
- package/dist/cli/config-yaml.js +34 -1
- package/dist/cli/config-yaml.js.map +1 -1
- package/dist/cli/index.js +16 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/core/agent-scope.d.ts +81 -0
- package/dist/core/agent-scope.d.ts.map +1 -0
- package/dist/core/agent-scope.js +146 -0
- package/dist/core/agent-scope.js.map +1 -0
- package/dist/core/directory.d.ts +1 -1
- package/dist/core/directory.d.ts.map +1 -1
- package/dist/core/directory.js +8 -0
- package/dist/core/directory.js.map +1 -1
- package/dist/core/exec.d.ts +86 -0
- package/dist/core/exec.d.ts.map +1 -0
- package/dist/core/exec.js +149 -0
- package/dist/core/exec.js.map +1 -0
- package/dist/core/github-app.d.ts +32 -0
- package/dist/core/github-app.d.ts.map +1 -0
- package/dist/core/github-app.js +105 -0
- package/dist/core/github-app.js.map +1 -0
- package/dist/core/health.d.ts +27 -0
- package/dist/core/health.d.ts.map +1 -0
- package/dist/core/health.js +73 -0
- package/dist/core/health.js.map +1 -0
- package/dist/core/mcp-server.d.ts +17 -1
- package/dist/core/mcp-server.d.ts.map +1 -1
- package/dist/core/mcp-server.js +299 -11
- package/dist/core/mcp-server.js.map +1 -1
- package/dist/core/sessions.d.ts.map +1 -1
- package/dist/core/sessions.js +11 -1
- package/dist/core/sessions.js.map +1 -1
- package/dist/providers/env.d.ts +27 -0
- package/dist/providers/env.d.ts.map +1 -0
- package/dist/providers/env.js +64 -0
- package/dist/providers/env.js.map +1 -0
- package/dist/providers/filesystem.d.ts +34 -0
- package/dist/providers/filesystem.d.ts.map +1 -0
- package/dist/providers/filesystem.js +143 -0
- package/dist/providers/filesystem.js.map +1 -0
- package/dist/providers/index.d.ts +25 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +39 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/providers/registry.d.ts +40 -0
- package/dist/providers/registry.d.ts.map +1 -0
- package/dist/providers/registry.js +113 -0
- package/dist/providers/registry.js.map +1 -0
- package/dist/providers/types.d.ts +137 -0
- package/dist/providers/types.d.ts.map +1 -0
- package/dist/providers/types.js +135 -0
- package/dist/providers/types.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Secrets Provider Plugin Interface
|
|
3
|
+
*
|
|
4
|
+
* Defines the contract all secrets providers must implement.
|
|
5
|
+
* See RFC 0005 for full design: docs/rfcs/0005-plugin-architecture.md
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Error codes for categorizing secrets operation failures.
|
|
9
|
+
* Enables callers to handle errors programmatically without message matching.
|
|
10
|
+
*/
|
|
11
|
+
export declare enum SecretErrorCode {
|
|
12
|
+
/** Provider is not initialized (call initialize() first) */
|
|
13
|
+
NOT_INITIALIZED = "NOT_INITIALIZED",
|
|
14
|
+
/** Secret was not found (normal -- not an error for most callers) */
|
|
15
|
+
NOT_FOUND = "NOT_FOUND",
|
|
16
|
+
/** Authentication failure (bad credentials, expired token) */
|
|
17
|
+
AUTH_FAILED = "AUTH_FAILED",
|
|
18
|
+
/** Permission denied (authenticated but not authorized) */
|
|
19
|
+
ACCESS_DENIED = "ACCESS_DENIED",
|
|
20
|
+
/** Provider unreachable (network error, timeout) */
|
|
21
|
+
PROVIDER_UNAVAILABLE = "PROVIDER_UNAVAILABLE",
|
|
22
|
+
/** Secret path is invalid (traversal attempt, bad characters) */
|
|
23
|
+
INVALID_PATH = "INVALID_PATH",
|
|
24
|
+
/** URI format is invalid */
|
|
25
|
+
INVALID_URI = "INVALID_URI",
|
|
26
|
+
/** Encryption/decryption failure */
|
|
27
|
+
CRYPTO_ERROR = "CRYPTO_ERROR",
|
|
28
|
+
/** Provider-specific configuration error */
|
|
29
|
+
CONFIG_ERROR = "CONFIG_ERROR",
|
|
30
|
+
/** Generic internal error */
|
|
31
|
+
INTERNAL = "INTERNAL"
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Typed error for secrets operations.
|
|
35
|
+
* Enables programmatic error handling without message parsing.
|
|
36
|
+
*/
|
|
37
|
+
export declare class SecretError extends Error {
|
|
38
|
+
readonly code: SecretErrorCode;
|
|
39
|
+
readonly provider?: string;
|
|
40
|
+
readonly secretPath?: string;
|
|
41
|
+
constructor(code: SecretErrorCode, message: string, options?: {
|
|
42
|
+
provider?: string;
|
|
43
|
+
secretPath?: string;
|
|
44
|
+
cause?: Error;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Core interface that all secrets providers must implement.
|
|
49
|
+
*/
|
|
50
|
+
export interface SecretsProvider {
|
|
51
|
+
/** Human-readable provider name (e.g., "my-vault") */
|
|
52
|
+
readonly name: string;
|
|
53
|
+
/** Provider type identifier (e.g., "hashicorp-vault", "aws-secrets-manager") */
|
|
54
|
+
readonly type: string;
|
|
55
|
+
/**
|
|
56
|
+
* Initialize the provider (connect, authenticate, validate config).
|
|
57
|
+
* Called once before any secret operations.
|
|
58
|
+
* @throws SecretError if provider cannot be initialized
|
|
59
|
+
*/
|
|
60
|
+
initialize(): Promise<void>;
|
|
61
|
+
/**
|
|
62
|
+
* Retrieve a secret by path.
|
|
63
|
+
* @param path - Provider-specific path (e.g., "mcp/agents/stripe/api-key")
|
|
64
|
+
* @returns The secret value, or null if not found
|
|
65
|
+
* @throws SecretError on connection/auth errors (NOT on missing secrets)
|
|
66
|
+
*/
|
|
67
|
+
getSecret(path: string): Promise<string | null>;
|
|
68
|
+
/**
|
|
69
|
+
* Store a secret. Optional -- not all providers support writes.
|
|
70
|
+
* @param path - Provider-specific path
|
|
71
|
+
* @param value - Secret value to store
|
|
72
|
+
*/
|
|
73
|
+
setSecret?(path: string, value: string): Promise<void>;
|
|
74
|
+
/**
|
|
75
|
+
* Delete a secret. Optional.
|
|
76
|
+
*/
|
|
77
|
+
deleteSecret?(path: string): Promise<void>;
|
|
78
|
+
/**
|
|
79
|
+
* List available secret paths. Optional -- useful for CLI tooling.
|
|
80
|
+
*/
|
|
81
|
+
listSecrets?(prefix?: string): Promise<string[]>;
|
|
82
|
+
/**
|
|
83
|
+
* Clean up resources (close connections, etc.).
|
|
84
|
+
*/
|
|
85
|
+
dispose(): Promise<void>;
|
|
86
|
+
/**
|
|
87
|
+
* Health check -- is the provider accessible and authenticated?
|
|
88
|
+
*/
|
|
89
|
+
healthCheck(): Promise<HealthCheckResult>;
|
|
90
|
+
}
|
|
91
|
+
export interface HealthCheckResult {
|
|
92
|
+
healthy: boolean;
|
|
93
|
+
error?: string;
|
|
94
|
+
/** Optional latency in milliseconds */
|
|
95
|
+
latencyMs?: number;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Configuration for a provider instance.
|
|
99
|
+
* The `config` field is provider-type-specific.
|
|
100
|
+
*/
|
|
101
|
+
export interface ProviderConfig {
|
|
102
|
+
/** Instance name (referenced in service configs) */
|
|
103
|
+
name: string;
|
|
104
|
+
/** Provider type (determines which class to instantiate) */
|
|
105
|
+
type: string;
|
|
106
|
+
/** Type-specific configuration */
|
|
107
|
+
config: Record<string, unknown>;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Factory function type for creating provider instances.
|
|
111
|
+
*/
|
|
112
|
+
export type ProviderFactory = (config: ProviderConfig) => SecretsProvider;
|
|
113
|
+
/**
|
|
114
|
+
* Parse a provider URI like "vault://mcp/stripe/api-key"
|
|
115
|
+
* Returns { provider: "vault", path: "mcp/stripe/api-key" }
|
|
116
|
+
* If no scheme, returns { provider: null, path: original }
|
|
117
|
+
*
|
|
118
|
+
* Enforces:
|
|
119
|
+
* - Provider names normalized to lowercase, 1-64 chars
|
|
120
|
+
* - Percent-decoding of path components
|
|
121
|
+
* - Rejection of ".." path segments (traversal prevention)
|
|
122
|
+
* - Max path length of 1024 characters
|
|
123
|
+
*
|
|
124
|
+
* @throws SecretError with INVALID_URI code on validation failure
|
|
125
|
+
*/
|
|
126
|
+
export declare function parseProviderURI(uri: string): {
|
|
127
|
+
provider: string | null;
|
|
128
|
+
path: string;
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* Validate a secret path for safety.
|
|
132
|
+
* Rejects traversal attempts, overly long paths, and empty paths.
|
|
133
|
+
*
|
|
134
|
+
* @throws SecretError with INVALID_PATH code on validation failure
|
|
135
|
+
*/
|
|
136
|
+
export declare function validateSecretPath(secretPath: string): void;
|
|
137
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/providers/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;;GAGG;AACH,oBAAY,eAAe;IACzB,4DAA4D;IAC5D,eAAe,oBAAoB;IACnC,qEAAqE;IACrE,SAAS,cAAc;IACvB,8DAA8D;IAC9D,WAAW,gBAAgB;IAC3B,2DAA2D;IAC3D,aAAa,kBAAkB;IAC/B,oDAAoD;IACpD,oBAAoB,yBAAyB;IAC7C,iEAAiE;IACjE,YAAY,iBAAiB;IAC7B,4BAA4B;IAC5B,WAAW,gBAAgB;IAC3B,oCAAoC;IACpC,YAAY,iBAAiB;IAC7B,4CAA4C;IAC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B;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,cAAc,KAAK,eAAe,CAAC;AAW1E;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAgDvF;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CA8B3D"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Secrets Provider Plugin Interface
|
|
4
|
+
*
|
|
5
|
+
* Defines the contract all secrets providers must implement.
|
|
6
|
+
* See RFC 0005 for full design: docs/rfcs/0005-plugin-architecture.md
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.SecretError = exports.SecretErrorCode = void 0;
|
|
10
|
+
exports.parseProviderURI = parseProviderURI;
|
|
11
|
+
exports.validateSecretPath = validateSecretPath;
|
|
12
|
+
// --- Error Taxonomy --------------------------------------
|
|
13
|
+
/**
|
|
14
|
+
* Error codes for categorizing secrets operation failures.
|
|
15
|
+
* Enables callers to handle errors programmatically without message matching.
|
|
16
|
+
*/
|
|
17
|
+
var SecretErrorCode;
|
|
18
|
+
(function (SecretErrorCode) {
|
|
19
|
+
/** Provider is not initialized (call initialize() first) */
|
|
20
|
+
SecretErrorCode["NOT_INITIALIZED"] = "NOT_INITIALIZED";
|
|
21
|
+
/** Secret was not found (normal -- not an error for most callers) */
|
|
22
|
+
SecretErrorCode["NOT_FOUND"] = "NOT_FOUND";
|
|
23
|
+
/** Authentication failure (bad credentials, expired token) */
|
|
24
|
+
SecretErrorCode["AUTH_FAILED"] = "AUTH_FAILED";
|
|
25
|
+
/** Permission denied (authenticated but not authorized) */
|
|
26
|
+
SecretErrorCode["ACCESS_DENIED"] = "ACCESS_DENIED";
|
|
27
|
+
/** Provider unreachable (network error, timeout) */
|
|
28
|
+
SecretErrorCode["PROVIDER_UNAVAILABLE"] = "PROVIDER_UNAVAILABLE";
|
|
29
|
+
/** Secret path is invalid (traversal attempt, bad characters) */
|
|
30
|
+
SecretErrorCode["INVALID_PATH"] = "INVALID_PATH";
|
|
31
|
+
/** URI format is invalid */
|
|
32
|
+
SecretErrorCode["INVALID_URI"] = "INVALID_URI";
|
|
33
|
+
/** Encryption/decryption failure */
|
|
34
|
+
SecretErrorCode["CRYPTO_ERROR"] = "CRYPTO_ERROR";
|
|
35
|
+
/** Provider-specific configuration error */
|
|
36
|
+
SecretErrorCode["CONFIG_ERROR"] = "CONFIG_ERROR";
|
|
37
|
+
/** Generic internal error */
|
|
38
|
+
SecretErrorCode["INTERNAL"] = "INTERNAL";
|
|
39
|
+
})(SecretErrorCode || (exports.SecretErrorCode = SecretErrorCode = {}));
|
|
40
|
+
/**
|
|
41
|
+
* Typed error for secrets operations.
|
|
42
|
+
* Enables programmatic error handling without message parsing.
|
|
43
|
+
*/
|
|
44
|
+
class SecretError extends Error {
|
|
45
|
+
code;
|
|
46
|
+
provider;
|
|
47
|
+
secretPath;
|
|
48
|
+
constructor(code, message, options) {
|
|
49
|
+
super(message, options?.cause ? { cause: options.cause } : undefined);
|
|
50
|
+
this.name = 'SecretError';
|
|
51
|
+
this.code = code;
|
|
52
|
+
this.provider = options?.provider;
|
|
53
|
+
this.secretPath = options?.secretPath;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.SecretError = SecretError;
|
|
57
|
+
// --- URI Parsing -----------------------------------------
|
|
58
|
+
/** Maximum length of a provider name */
|
|
59
|
+
const MAX_PROVIDER_NAME_LENGTH = 64;
|
|
60
|
+
/** Maximum length of a secret path */
|
|
61
|
+
const MAX_SECRET_PATH_LENGTH = 1024;
|
|
62
|
+
/** Valid provider name: lowercase alphanumeric, hyphens, underscores, 1-64 chars */
|
|
63
|
+
const PROVIDER_NAME_PATTERN = /^[a-z][a-z0-9_-]{0,63}$/;
|
|
64
|
+
/**
|
|
65
|
+
* Parse a provider URI like "vault://mcp/stripe/api-key"
|
|
66
|
+
* Returns { provider: "vault", path: "mcp/stripe/api-key" }
|
|
67
|
+
* If no scheme, returns { provider: null, path: original }
|
|
68
|
+
*
|
|
69
|
+
* Enforces:
|
|
70
|
+
* - Provider names normalized to lowercase, 1-64 chars
|
|
71
|
+
* - Percent-decoding of path components
|
|
72
|
+
* - Rejection of ".." path segments (traversal prevention)
|
|
73
|
+
* - Max path length of 1024 characters
|
|
74
|
+
*
|
|
75
|
+
* @throws SecretError with INVALID_URI code on validation failure
|
|
76
|
+
*/
|
|
77
|
+
function parseProviderURI(uri) {
|
|
78
|
+
if (!uri || typeof uri !== 'string') {
|
|
79
|
+
throw new SecretError(SecretErrorCode.INVALID_URI, 'URI must be a non-empty string');
|
|
80
|
+
}
|
|
81
|
+
const match = uri.match(/^([a-zA-Z][a-zA-Z0-9_-]*):\/\/(.+)$/);
|
|
82
|
+
if (!match) {
|
|
83
|
+
// Plain path -- validate and return
|
|
84
|
+
validateSecretPath(uri);
|
|
85
|
+
return { provider: null, path: uri };
|
|
86
|
+
}
|
|
87
|
+
const rawProvider = match[1];
|
|
88
|
+
const rawPath = match[2];
|
|
89
|
+
// Normalize provider name to lowercase
|
|
90
|
+
const provider = rawProvider.toLowerCase();
|
|
91
|
+
// Validate provider name length
|
|
92
|
+
if (provider.length > MAX_PROVIDER_NAME_LENGTH) {
|
|
93
|
+
throw new SecretError(SecretErrorCode.INVALID_URI, `Provider name exceeds maximum length of ${MAX_PROVIDER_NAME_LENGTH} characters: "${provider}"`);
|
|
94
|
+
}
|
|
95
|
+
// Validate provider name format
|
|
96
|
+
if (!PROVIDER_NAME_PATTERN.test(provider)) {
|
|
97
|
+
throw new SecretError(SecretErrorCode.INVALID_URI, `Invalid provider name "${provider}": must be lowercase alphanumeric with hyphens/underscores, starting with a letter`);
|
|
98
|
+
}
|
|
99
|
+
// Percent-decode the path
|
|
100
|
+
let decodedPath;
|
|
101
|
+
try {
|
|
102
|
+
decodedPath = decodeURIComponent(rawPath);
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
throw new SecretError(SecretErrorCode.INVALID_URI, `Invalid percent-encoding in URI path: "${rawPath}"`);
|
|
106
|
+
}
|
|
107
|
+
validateSecretPath(decodedPath);
|
|
108
|
+
return { provider, path: decodedPath };
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Validate a secret path for safety.
|
|
112
|
+
* Rejects traversal attempts, overly long paths, and empty paths.
|
|
113
|
+
*
|
|
114
|
+
* @throws SecretError with INVALID_PATH code on validation failure
|
|
115
|
+
*/
|
|
116
|
+
function validateSecretPath(secretPath) {
|
|
117
|
+
if (!secretPath || secretPath.length === 0) {
|
|
118
|
+
throw new SecretError(SecretErrorCode.INVALID_PATH, 'Secret path must not be empty');
|
|
119
|
+
}
|
|
120
|
+
if (secretPath.length > MAX_SECRET_PATH_LENGTH) {
|
|
121
|
+
throw new SecretError(SecretErrorCode.INVALID_PATH, `Secret path exceeds maximum length of ${MAX_SECRET_PATH_LENGTH} characters`);
|
|
122
|
+
}
|
|
123
|
+
// Reject absolute paths
|
|
124
|
+
if (secretPath.startsWith('/') || /^[A-Za-z]:/.test(secretPath)) {
|
|
125
|
+
throw new SecretError(SecretErrorCode.INVALID_PATH, `Secret path must be relative, got: "${secretPath}"`);
|
|
126
|
+
}
|
|
127
|
+
// Reject ".." segments (path traversal)
|
|
128
|
+
const segments = secretPath.split(/[/\\]/);
|
|
129
|
+
for (const segment of segments) {
|
|
130
|
+
if (segment === '..') {
|
|
131
|
+
throw new SecretError(SecretErrorCode.INVALID_PATH, `Secret path must not contain ".." segments: "${secretPath}"`);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/providers/types.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AA2JH,4CAgDC;AAQD,gDA8BC;AA/OD,4DAA4D;AAE5D;;;GAGG;AACH,IAAY,eAqBX;AArBD,WAAY,eAAe;IACzB,4DAA4D;IAC5D,sDAAmC,CAAA;IACnC,qEAAqE;IACrE,0CAAuB,CAAA;IACvB,8DAA8D;IAC9D,8CAA2B,CAAA;IAC3B,2DAA2D;IAC3D,kDAA+B,CAAA;IAC/B,oDAAoD;IACpD,gEAA6C,CAAA;IAC7C,iEAAiE;IACjE,gDAA6B,CAAA;IAC7B,4BAA4B;IAC5B,8CAA2B,CAAA;IAC3B,oCAAoC;IACpC,gDAA6B,CAAA;IAC7B,4CAA4C;IAC5C,gDAA6B,CAAA;IAC7B,6BAA6B;IAC7B,wCAAqB,CAAA;AACvB,CAAC,EArBW,eAAe,+BAAf,eAAe,QAqB1B;AAED;;;GAGG;AACH,MAAa,WAAY,SAAQ,KAAK;IAC3B,IAAI,CAAkB;IACtB,QAAQ,CAAU;IAClB,UAAU,CAAU;IAE7B,YACE,IAAqB,EACrB,OAAe,EACf,OAAmE;QAEnE,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QACtE,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;Q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