@rudderhq/agent-runtime-claude-local 0.1.0-canary.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.
Files changed (64) hide show
  1. package/LICENSE +14 -0
  2. package/dist/cli/format-event.d.ts +2 -0
  3. package/dist/cli/format-event.d.ts.map +1 -0
  4. package/dist/cli/format-event.js +94 -0
  5. package/dist/cli/format-event.js.map +1 -0
  6. package/dist/cli/index.d.ts +2 -0
  7. package/dist/cli/index.d.ts.map +1 -0
  8. package/dist/cli/index.js +2 -0
  9. package/dist/cli/index.js.map +1 -0
  10. package/dist/cli/quota-probe.d.ts +3 -0
  11. package/dist/cli/quota-probe.d.ts.map +1 -0
  12. package/dist/cli/quota-probe.js +106 -0
  13. package/dist/cli/quota-probe.js.map +1 -0
  14. package/dist/index.d.ts +8 -0
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +37 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/server/execute.d.ts +18 -0
  19. package/dist/server/execute.d.ts.map +1 -0
  20. package/dist/server/execute.js +578 -0
  21. package/dist/server/execute.js.map +1 -0
  22. package/dist/server/index.d.ts +8 -0
  23. package/dist/server/index.d.ts.map +1 -0
  24. package/dist/server/index.js +57 -0
  25. package/dist/server/index.js.map +1 -0
  26. package/dist/server/parse.d.ts +22 -0
  27. package/dist/server/parse.d.ts.map +1 -0
  28. package/dist/server/parse.js +158 -0
  29. package/dist/server/parse.js.map +1 -0
  30. package/dist/server/quota.d.ts +20 -0
  31. package/dist/server/quota.d.ts.map +1 -0
  32. package/dist/server/quota.js +477 -0
  33. package/dist/server/quota.js.map +1 -0
  34. package/dist/server/skills.d.ts +8 -0
  35. package/dist/server/skills.d.ts.map +1 -0
  36. package/dist/server/skills.js +102 -0
  37. package/dist/server/skills.js.map +1 -0
  38. package/dist/server/test.d.ts +3 -0
  39. package/dist/server/test.d.ts.map +1 -0
  40. package/dist/server/test.js +201 -0
  41. package/dist/server/test.js.map +1 -0
  42. package/dist/ui/build-config.d.ts +3 -0
  43. package/dist/ui/build-config.d.ts.map +1 -0
  44. package/dist/ui/build-config.js +115 -0
  45. package/dist/ui/build-config.js.map +1 -0
  46. package/dist/ui/index.d.ts +3 -0
  47. package/dist/ui/index.d.ts.map +1 -0
  48. package/dist/ui/index.js +3 -0
  49. package/dist/ui/index.js.map +1 -0
  50. package/dist/ui/parse-stdout.d.ts +3 -0
  51. package/dist/ui/parse-stdout.d.ts.map +1 -0
  52. package/dist/ui/parse-stdout.js +149 -0
  53. package/dist/ui/parse-stdout.js.map +1 -0
  54. package/package.json +63 -0
  55. package/skills/para-memory-files/SKILL.md +114 -0
  56. package/skills/para-memory-files/references/schemas.md +35 -0
  57. package/skills/rudder/SKILL.md +265 -0
  58. package/skills/rudder/references/api-reference.md +253 -0
  59. package/skills/rudder/references/cli-reference.md +67 -0
  60. package/skills/rudder/references/organization-skills.md +155 -0
  61. package/skills/rudder-create-agent/SKILL.md +166 -0
  62. package/skills/rudder-create-agent/references/api-reference.md +172 -0
  63. package/skills/rudder-create-agent/references/cli-reference.md +126 -0
  64. package/skills/rudder-create-plugin/SKILL.md +103 -0
package/LICENSE ADDED
@@ -0,0 +1,14 @@
1
+ This package is part of the Rudder project.
2
+
3
+ Rudder began as a fork of an early version of Paperclip.
4
+
5
+ Licensing for this package follows the repository-level transition:
6
+ - new Rudder contributions are made under the Apache License, Version 2.0
7
+ - upstream-derived Paperclip portions preserve the original MIT notice where applicable
8
+
9
+ Canonical project-level license and attribution texts live in the source repository:
10
+ - `LICENSE`
11
+ - `NOTICE`
12
+ - `LICENSES/MIT-PAPERCLIP`
13
+
14
+ Source repository: https://github.com/Undertone0809/rudder
@@ -0,0 +1,2 @@
1
+ export declare function printClaudeStreamEvent(raw: string, debug: boolean): void;
2
+ //# sourceMappingURL=format-event.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-event.d.ts","sourceRoot":"","sources":["../../src/cli/format-event.ts"],"names":[],"mappings":"AAmBA,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CA+ExE"}
@@ -0,0 +1,94 @@
1
+ import pc from "picocolors";
2
+ function asErrorText(value) {
3
+ if (typeof value === "string")
4
+ return value;
5
+ if (typeof value !== "object" || value === null || Array.isArray(value))
6
+ return "";
7
+ const obj = value;
8
+ const message = (typeof obj.message === "string" && obj.message) ||
9
+ (typeof obj.error === "string" && obj.error) ||
10
+ (typeof obj.code === "string" && obj.code) ||
11
+ "";
12
+ if (message)
13
+ return message;
14
+ try {
15
+ return JSON.stringify(obj);
16
+ }
17
+ catch {
18
+ return "";
19
+ }
20
+ }
21
+ export function printClaudeStreamEvent(raw, debug) {
22
+ const line = raw.trim();
23
+ if (!line)
24
+ return;
25
+ let parsed = null;
26
+ try {
27
+ parsed = JSON.parse(line);
28
+ }
29
+ catch {
30
+ console.log(line);
31
+ return;
32
+ }
33
+ const type = typeof parsed.type === "string" ? parsed.type : "";
34
+ if (type === "system" && parsed.subtype === "init") {
35
+ const model = typeof parsed.model === "string" ? parsed.model : "unknown";
36
+ const sessionId = typeof parsed.session_id === "string" ? parsed.session_id : "";
37
+ console.log(pc.blue(`Claude initialized (model: ${model}${sessionId ? `, session: ${sessionId}` : ""})`));
38
+ return;
39
+ }
40
+ if (type === "assistant") {
41
+ const message = typeof parsed.message === "object" && parsed.message !== null && !Array.isArray(parsed.message)
42
+ ? parsed.message
43
+ : {};
44
+ const content = Array.isArray(message.content) ? message.content : [];
45
+ for (const blockRaw of content) {
46
+ if (typeof blockRaw !== "object" || blockRaw === null || Array.isArray(blockRaw))
47
+ continue;
48
+ const block = blockRaw;
49
+ const blockType = typeof block.type === "string" ? block.type : "";
50
+ if (blockType === "text") {
51
+ const text = typeof block.text === "string" ? block.text : "";
52
+ if (text)
53
+ console.log(pc.green(`assistant: ${text}`));
54
+ }
55
+ else if (blockType === "tool_use") {
56
+ const name = typeof block.name === "string" ? block.name : "unknown";
57
+ console.log(pc.yellow(`tool_call: ${name}`));
58
+ if (block.input !== undefined) {
59
+ console.log(pc.gray(JSON.stringify(block.input, null, 2)));
60
+ }
61
+ }
62
+ }
63
+ return;
64
+ }
65
+ if (type === "result") {
66
+ const usage = typeof parsed.usage === "object" && parsed.usage !== null && !Array.isArray(parsed.usage)
67
+ ? parsed.usage
68
+ : {};
69
+ const input = Number(usage.input_tokens ?? 0);
70
+ const output = Number(usage.output_tokens ?? 0);
71
+ const cached = Number(usage.cache_read_input_tokens ?? 0);
72
+ const cost = Number(parsed.total_cost_usd ?? 0);
73
+ const subtype = typeof parsed.subtype === "string" ? parsed.subtype : "";
74
+ const isError = parsed.is_error === true;
75
+ const resultText = typeof parsed.result === "string" ? parsed.result : "";
76
+ if (resultText) {
77
+ console.log(pc.green("result:"));
78
+ console.log(resultText);
79
+ }
80
+ const errors = Array.isArray(parsed.errors) ? parsed.errors.map(asErrorText).filter(Boolean) : [];
81
+ if (subtype.startsWith("error") || isError || errors.length > 0) {
82
+ console.log(pc.red(`claude_result: subtype=${subtype || "unknown"} is_error=${isError ? "true" : "false"}`));
83
+ if (errors.length > 0) {
84
+ console.log(pc.red(`claude_errors: ${errors.join(" | ")}`));
85
+ }
86
+ }
87
+ console.log(pc.blue(`tokens: in=${Number.isFinite(input) ? input : 0} out=${Number.isFinite(output) ? output : 0} cached=${Number.isFinite(cached) ? cached : 0} cost=$${Number.isFinite(cost) ? cost.toFixed(6) : "0.000000"}`));
88
+ return;
89
+ }
90
+ if (debug) {
91
+ console.log(pc.gray(line));
92
+ }
93
+ }
94
+ //# sourceMappingURL=format-event.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-event.js","sourceRoot":"","sources":["../../src/cli/format-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,SAAS,WAAW,CAAC,KAAc;IACjC,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,IA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CAAC;QACD,OAAO,CAAC,GAAG,CACT,EAAE,CAAC,IAAI,CACL,cAAc,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,CAC5M,CACF,CAAC;QACF,OAAO;IACT,CAAC;IAED,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7B,CAAC;AACH,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { printClaudeStreamEvent } from "./format-event.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { printClaudeStreamEvent } from "./format-event.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=quota-probe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quota-probe.d.ts","sourceRoot":"","sources":["../../src/cli/quota-probe.ts"],"names":[],"mappings":""}
@@ -0,0 +1,106 @@
1
+ #!/usr/bin/env node
2
+ import { captureClaudeCliUsageText, fetchClaudeCliQuota, fetchClaudeQuota, getQuotaWindows, parseClaudeCliUsageText, readClaudeAuthStatus, readClaudeToken, } from "../server/quota.js";
3
+ function parseArgs(argv) {
4
+ return {
5
+ json: argv.includes("--json"),
6
+ includeRawCli: argv.includes("--raw-cli"),
7
+ oauthOnly: argv.includes("--oauth-only"),
8
+ cliOnly: argv.includes("--cli-only"),
9
+ };
10
+ }
11
+ function stringifyError(error) {
12
+ return error instanceof Error ? error.message : String(error);
13
+ }
14
+ async function main() {
15
+ const args = parseArgs(process.argv.slice(2));
16
+ if (args.oauthOnly && args.cliOnly) {
17
+ throw new Error("Choose either --oauth-only or --cli-only, not both.");
18
+ }
19
+ const authStatus = await readClaudeAuthStatus();
20
+ const token = await readClaudeToken();
21
+ const result = {
22
+ timestamp: new Date().toISOString(),
23
+ authStatus,
24
+ tokenAvailable: token != null,
25
+ };
26
+ if (!args.cliOnly) {
27
+ if (!token) {
28
+ result.oauth = {
29
+ ok: false,
30
+ error: "No Claude OAuth access token found in local credentials files.",
31
+ windows: [],
32
+ };
33
+ }
34
+ else {
35
+ try {
36
+ result.oauth = {
37
+ ok: true,
38
+ windows: await fetchClaudeQuota(token),
39
+ };
40
+ }
41
+ catch (error) {
42
+ result.oauth = {
43
+ ok: false,
44
+ error: stringifyError(error),
45
+ windows: [],
46
+ };
47
+ }
48
+ }
49
+ }
50
+ if (!args.oauthOnly) {
51
+ try {
52
+ const rawCliText = args.includeRawCli ? await captureClaudeCliUsageText() : null;
53
+ const windows = rawCliText ? parseClaudeCliUsageText(rawCliText) : await fetchClaudeCliQuota();
54
+ result.cli = rawCliText
55
+ ? {
56
+ ok: true,
57
+ windows,
58
+ rawText: rawCliText,
59
+ }
60
+ : {
61
+ ok: true,
62
+ windows,
63
+ };
64
+ }
65
+ catch (error) {
66
+ result.cli = {
67
+ ok: false,
68
+ error: stringifyError(error),
69
+ windows: [],
70
+ };
71
+ }
72
+ }
73
+ if (!args.oauthOnly && !args.cliOnly) {
74
+ try {
75
+ result.aggregated = await getQuotaWindows();
76
+ }
77
+ catch (error) {
78
+ result.aggregated = {
79
+ ok: false,
80
+ error: stringifyError(error),
81
+ };
82
+ }
83
+ }
84
+ const oauthOk = result.oauth?.ok === true;
85
+ const cliOk = result.cli?.ok === true;
86
+ const aggregatedOk = result.aggregated?.ok === true;
87
+ const ok = oauthOk || cliOk || aggregatedOk;
88
+ if (args.json || process.stdout.isTTY === false) {
89
+ console.log(JSON.stringify({ ok, ...result }, null, 2));
90
+ }
91
+ else {
92
+ console.log(`timestamp: ${result.timestamp}`);
93
+ console.log(`auth: ${JSON.stringify(authStatus)}`);
94
+ console.log(`tokenAvailable: ${token != null}`);
95
+ if (result.oauth)
96
+ console.log(`oauth: ${JSON.stringify(result.oauth, null, 2)}`);
97
+ if (result.cli)
98
+ console.log(`cli: ${JSON.stringify(result.cli, null, 2)}`);
99
+ if (result.aggregated)
100
+ console.log(`aggregated: ${JSON.stringify(result.aggregated, null, 2)}`);
101
+ }
102
+ if (!ok)
103
+ process.exitCode = 1;
104
+ }
105
+ await main();
106
+ //# sourceMappingURL=quota-probe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quota-probe.js","sourceRoot":"","sources":["../../src/cli/quota-probe.ts"],"names":[],"mappings":";AAEA,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,uBAAuB,EACvB,oBAAoB,EACpB,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAS5B,SAAS,SAAS,CAAC,IAAc;IAC/B,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAC7B,aAAa,EAAE,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC;QACzC,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC;QACxC,OAAO,EAAE,IAAI,CA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3
+ export declare const models: {
4
+ id: string;
5
+ label: string;
6
+ }[];
7
+ export declare const agentConfigurationDoc = "# claude_local agent configuration\n\nAdapter: claude_local\n\nCore fields:\n- cwd (string, optional): default absolute working directory fallback for the agent process (created if missing when possible)\n- instructionsFilePath (string, optional): absolute path to a markdown instructions file injected at runtime\n- model (string, optional): Claude model id\n- effort (string, optional): reasoning effort passed via --effort (low|medium|high)\n- chrome (boolean, optional): pass --chrome when running Claude\n- promptTemplate (string, optional): run prompt template\n- maxTurnsPerRun (number, optional): max turns for one run\n- dangerouslySkipPermissions (boolean, optional): pass --dangerously-skip-permissions to claude\n- command (string, optional): defaults to \"claude\"\n- extraArgs (string[], optional): additional CLI args\n- env (object, optional): KEY=VALUE environment variables\n- workspaceStrategy (object, optional): execution workspace strategy; currently supports { type: \"git_worktree\", baseRef?, branchTemplate?, worktreeParentDir? }\n- workspaceRuntime (object, optional): workspace runtime service intents; local host-managed services are realized before Claude starts and exposed back via context/env\n\nOperational fields:\n- timeoutSec (number, optional): run timeout in seconds\n- graceSec (number, optional): SIGTERM grace period in seconds\n\nNotes:\n- When Rudder realizes a workspace/runtime for a run, it injects RUDDER_WORKSPACE_* and RUDDER_RUNTIME_* env vars for agent-side tooling.\n- Claude loads only the bundled Rudder skills plus the skills explicitly enabled on the agent's Skills page. Unselected skills already present in the real user home do not load.\n";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,iBAAiB,CAAC;AACnC,eAAO,MAAM,KAAK,wBAAwB,CAAC;AAE3C,eAAO,MAAM,MAAM;;;GAMlB,CAAC;AAEF,eAAO,MAAM,qBAAqB,wqDA0BjC,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,37 @@
1
+ export const type = "claude_local";
2
+ export const label = "Claude Code (local)";
3
+ export const models = [
4
+ { id: "claude-opus-4-6", label: "Claude Opus 4.6" },
5
+ { id: "claude-sonnet-4-6", label: "Claude Sonnet 4.6" },
6
+ { id: "claude-haiku-4-6", label: "Claude Haiku 4.6" },
7
+ { id: "claude-sonnet-4-5-20250929", label: "Claude Sonnet 4.5" },
8
+ { id: "claude-haiku-4-5-20251001", label: "Claude Haiku 4.5" },
9
+ ];
10
+ export const agentConfigurationDoc = `# claude_local agent configuration
11
+
12
+ Adapter: claude_local
13
+
14
+ Core fields:
15
+ - cwd (string, optional): default absolute working directory fallback for the agent process (created if missing when possible)
16
+ - instructionsFilePath (string, optional): absolute path to a markdown instructions file injected at runtime
17
+ - model (string, optional): Claude model id
18
+ - effort (string, optional): reasoning effort passed via --effort (low|medium|high)
19
+ - chrome (boolean, optional): pass --chrome when running Claude
20
+ - promptTemplate (string, optional): run prompt template
21
+ - maxTurnsPerRun (number, optional): max turns for one run
22
+ - dangerouslySkipPermissions (boolean, optional): pass --dangerously-skip-permissions to claude
23
+ - command (string, optional): defaults to "claude"
24
+ - extraArgs (string[], optional): additional CLI args
25
+ - env (object, optional): KEY=VALUE environment variables
26
+ - workspaceStrategy (object, optional): execution workspace strategy; currently supports { type: "git_worktree", baseRef?, branchTemplate?, worktreeParentDir? }
27
+ - workspaceRuntime (object, optional): workspace runtime service intents; local host-managed services are realized before Claude starts and exposed back via context/env
28
+
29
+ Operational fields:
30
+ - timeoutSec (number, optional): run timeout in seconds
31
+ - graceSec (number, optional): SIGTERM grace period in seconds
32
+
33
+ Notes:
34
+ - When Rudder realizes a workspace/runtime for a run, it injects RUDDER_WORKSPACE_* and RUDDER_RUNTIME_* env vars for agent-side tooling.
35
+ - Claude loads only the bundled Rudder skills plus the skills explicitly enabled on the agent's Skills page. Unselected skills already present in the real user home do not load.
36
+ `;
37
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,IAAI,GAAG,cAAc,CAAC;AACnC,MAAM,CAAC,MAAM,KAAK,GAAG,qBAAqB,CAAC;AAE3C,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,EAAE,EAAE,EAAE,iBAAiB,EAAE,KAAK,EAAE,iBAAiB,EAAE;IACnD,EAAE,EAAE,EAAE,mBAAmB,EAAE,KAAK,EAAE,mBAAmB,EAAE;IACvD,EAAE,EAAE,EAAE,kBAAkB,EAAE,KAAK,EAAE,kBAAkB,EAAE;IACrD,EAAE,EAAE,EAAE,4BAA4B,EAAE,KAAK,EAAE,mBAAmB,EAAE;IAChE,EAAE,EAAE,EAAE,2BAA2B,EAAE,KAAK,EAAE,kBAAkB,EAAE;CAC/D,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BpC,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { AgentRuntimeExecutionContext, AgentRuntimeExecutionResult } from "@rudderhq/agent-runtime-utils";
2
+ export declare function runClaudeLogin(input: {
3
+ runId: string;
4
+ agent: AgentRuntimeExecutionContext["agent"];
5
+ config: Record<string, unknown>;
6
+ context?: Record<string, unknown>;
7
+ authToken?: string;
8
+ onLog?: (stream: "stdout" | "stderr", chunk: string) => Promise<void>;
9
+ }): Promise<{
10
+ exitCode: number | null;
11
+ signal: string | null;
12
+ timedOut: boolean;
13
+ stdout: string;
14
+ stderr: string;
15
+ loginUrl: string | null;
16
+ }>;
17
+ export declare function execute(ctx: AgentRuntimeExecutionContext): Promise<AgentRuntimeExecutionResult>;
18
+ //# sourceMappingURL=execute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../src/server/execute.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,4BAA4B,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAuX/G,wBAAsB,cAAc,CAAC,KAAK,EAAE;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,4BAA4B,CAAC,OAAO,CAAC,CAAC;IAC7C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,GAAG,QAAQ,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACvE;;;;;;;GA6BA;AAED,wBAAsB,OAAO,CAAC,GAAG,EAAE,4BAA4B,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAoUrG"}