@codemieai/code 0.10.1 → 0.12.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/dist/agents/core/AgentCLI.d.ts.map +1 -1
- package/dist/agents/core/AgentCLI.js +11 -3
- package/dist/agents/core/AgentCLI.js.map +1 -1
- package/dist/agents/core/BaseAgentAdapter.d.ts +3 -1
- package/dist/agents/core/BaseAgentAdapter.d.ts.map +1 -1
- package/dist/agents/core/BaseAgentAdapter.js +34 -2
- package/dist/agents/core/BaseAgentAdapter.js.map +1 -1
- package/dist/agents/core/config-redaction.d.ts +7 -0
- package/dist/agents/core/config-redaction.d.ts.map +1 -0
- package/dist/agents/core/config-redaction.js +20 -0
- package/dist/agents/core/config-redaction.js.map +1 -0
- package/dist/agents/core/print-config.d.ts +8 -0
- package/dist/agents/core/print-config.d.ts.map +1 -0
- package/dist/agents/core/print-config.js +17 -0
- package/dist/agents/core/print-config.js.map +1 -0
- package/dist/agents/core/session/BaseSessionAdapter.d.ts +24 -1
- package/dist/agents/core/session/BaseSessionAdapter.d.ts.map +1 -1
- package/dist/agents/core/types.d.ts +44 -4
- package/dist/agents/core/types.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude.plugin.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude.plugin.js +73 -0
- package/dist/agents/plugins/claude/claude.plugin.js.map +1 -1
- package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.d.ts.map +1 -1
- package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.js +115 -32
- package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.js.map +1 -1
- package/dist/agents/plugins/claude/settings-conflict.d.ts +8 -0
- package/dist/agents/plugins/claude/settings-conflict.d.ts.map +1 -0
- package/dist/agents/plugins/claude/settings-conflict.js +35 -0
- package/dist/agents/plugins/claude/settings-conflict.js.map +1 -0
- package/dist/agents/plugins/codemie-code-hooks/shell-hooks-source.d.ts +14 -2
- package/dist/agents/plugins/codemie-code-hooks/shell-hooks-source.d.ts.map +1 -1
- package/dist/agents/plugins/codemie-code-hooks/shell-hooks-source.js +218 -263
- package/dist/agents/plugins/codemie-code-hooks/shell-hooks-source.js.map +1 -1
- package/dist/agents/plugins/copilot-cli/copilot-cli-event-types.d.ts +146 -0
- package/dist/agents/plugins/copilot-cli/copilot-cli-event-types.d.ts.map +1 -0
- package/dist/agents/plugins/copilot-cli/copilot-cli-event-types.js +12 -0
- package/dist/agents/plugins/copilot-cli/copilot-cli-event-types.js.map +1 -0
- package/dist/agents/plugins/copilot-cli/copilot-cli.constants.d.ts +11 -0
- package/dist/agents/plugins/copilot-cli/copilot-cli.constants.d.ts.map +1 -0
- package/dist/agents/plugins/copilot-cli/copilot-cli.constants.js +11 -0
- package/dist/agents/plugins/copilot-cli/copilot-cli.constants.js.map +1 -0
- package/dist/agents/plugins/copilot-cli/copilot-cli.paths.d.ts +11 -0
- package/dist/agents/plugins/copilot-cli/copilot-cli.paths.d.ts.map +1 -0
- package/dist/agents/plugins/copilot-cli/copilot-cli.paths.js +21 -0
- package/dist/agents/plugins/copilot-cli/copilot-cli.paths.js.map +1 -0
- package/dist/agents/plugins/copilot-cli/copilot-cli.plugin.d.ts +30 -0
- package/dist/agents/plugins/copilot-cli/copilot-cli.plugin.d.ts.map +1 -0
- package/dist/agents/plugins/copilot-cli/copilot-cli.plugin.js +64 -0
- package/dist/agents/plugins/copilot-cli/copilot-cli.plugin.js.map +1 -0
- package/dist/agents/plugins/copilot-cli/copilot-cli.session.d.ts +43 -0
- package/dist/agents/plugins/copilot-cli/copilot-cli.session.d.ts.map +1 -0
- package/dist/agents/plugins/copilot-cli/copilot-cli.session.js +331 -0
- package/dist/agents/plugins/copilot-cli/copilot-cli.session.js.map +1 -0
- package/dist/agents/plugins/copilot-cli/copilot-cli.storage-utils.d.ts +10 -0
- package/dist/agents/plugins/copilot-cli/copilot-cli.storage-utils.d.ts.map +1 -0
- package/dist/agents/plugins/copilot-cli/copilot-cli.storage-utils.js +41 -0
- package/dist/agents/plugins/copilot-cli/copilot-cli.storage-utils.js.map +1 -0
- package/dist/agents/plugins/copilot-cli/copilot-cli.usage.d.ts +37 -0
- package/dist/agents/plugins/copilot-cli/copilot-cli.usage.d.ts.map +1 -0
- package/dist/agents/plugins/copilot-cli/copilot-cli.usage.js +96 -0
- package/dist/agents/plugins/copilot-cli/copilot-cli.usage.js.map +1 -0
- package/dist/agents/plugins/copilot-cli/copilot-cli.workspace.d.ts +17 -0
- package/dist/agents/plugins/copilot-cli/copilot-cli.workspace.d.ts.map +1 -0
- package/dist/agents/plugins/copilot-cli/copilot-cli.workspace.js +58 -0
- package/dist/agents/plugins/copilot-cli/copilot-cli.workspace.js.map +1 -0
- package/dist/agents/plugins/copilot-cli/index.d.ts +2 -0
- package/dist/agents/plugins/copilot-cli/index.d.ts.map +1 -0
- package/dist/agents/plugins/copilot-cli/index.js +2 -0
- package/dist/agents/plugins/copilot-cli/index.js.map +1 -0
- package/dist/agents/plugins/copilot-cli/session/processors/copilot-cli.conversations-processor.d.ts +15 -0
- package/dist/agents/plugins/copilot-cli/session/processors/copilot-cli.conversations-processor.d.ts.map +1 -0
- package/dist/agents/plugins/copilot-cli/session/processors/copilot-cli.conversations-processor.js +20 -0
- package/dist/agents/plugins/copilot-cli/session/processors/copilot-cli.conversations-processor.js.map +1 -0
- package/dist/agents/plugins/copilot-cli/session/processors/copilot-cli.metrics-processor.d.ts +16 -0
- package/dist/agents/plugins/copilot-cli/session/processors/copilot-cli.metrics-processor.d.ts.map +1 -0
- package/dist/agents/plugins/copilot-cli/session/processors/copilot-cli.metrics-processor.js +22 -0
- package/dist/agents/plugins/copilot-cli/session/processors/copilot-cli.metrics-processor.js.map +1 -0
- package/dist/agents/plugins/opencode/opencode-message-types.d.ts +13 -0
- package/dist/agents/plugins/opencode/opencode-message-types.d.ts.map +1 -1
- package/dist/agents/plugins/opencode/opencode-message-types.js.map +1 -1
- package/dist/agents/plugins/opencode/opencode.incremental-sync.d.ts +38 -0
- package/dist/agents/plugins/opencode/opencode.incremental-sync.d.ts.map +1 -0
- package/dist/agents/plugins/opencode/opencode.incremental-sync.js +153 -0
- package/dist/agents/plugins/opencode/opencode.incremental-sync.js.map +1 -0
- package/dist/agents/plugins/opencode/opencode.paths.d.ts +18 -2
- package/dist/agents/plugins/opencode/opencode.paths.d.ts.map +1 -1
- package/dist/agents/plugins/opencode/opencode.paths.js +39 -6
- package/dist/agents/plugins/opencode/opencode.paths.js.map +1 -1
- package/dist/agents/plugins/opencode/opencode.plugin.d.ts.map +1 -1
- package/dist/agents/plugins/opencode/opencode.plugin.js +241 -75
- package/dist/agents/plugins/opencode/opencode.plugin.js.map +1 -1
- package/dist/agents/plugins/opencode/opencode.session.d.ts +18 -1
- package/dist/agents/plugins/opencode/opencode.session.d.ts.map +1 -1
- package/dist/agents/plugins/opencode/opencode.session.js +58 -17
- package/dist/agents/plugins/opencode/opencode.session.js.map +1 -1
- package/dist/agents/plugins/opencode/opencode.sqlite-reader.d.ts +8 -2
- package/dist/agents/plugins/opencode/opencode.sqlite-reader.d.ts.map +1 -1
- package/dist/agents/plugins/opencode/opencode.sqlite-reader.js +67 -42
- package/dist/agents/plugins/opencode/opencode.sqlite-reader.js.map +1 -1
- package/dist/agents/plugins/opencode/opencode.storage-utils.d.ts +19 -0
- package/dist/agents/plugins/opencode/opencode.storage-utils.d.ts.map +1 -1
- package/dist/agents/plugins/opencode/opencode.storage-utils.js +51 -0
- package/dist/agents/plugins/opencode/opencode.storage-utils.js.map +1 -1
- package/dist/agents/plugins/opencode/session/processors/opencode.conversations-processor.d.ts +13 -19
- package/dist/agents/plugins/opencode/session/processors/opencode.conversations-processor.d.ts.map +1 -1
- package/dist/agents/plugins/opencode/session/processors/opencode.conversations-processor.js +339 -82
- package/dist/agents/plugins/opencode/session/processors/opencode.conversations-processor.js.map +1 -1
- package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.d.ts +37 -33
- package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.d.ts.map +1 -1
- package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.js +204 -246
- package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.js.map +1 -1
- package/dist/agents/registry.d.ts +20 -0
- package/dist/agents/registry.d.ts.map +1 -1
- package/dist/agents/registry.js +29 -2
- package/dist/agents/registry.js.map +1 -1
- package/dist/cli/commands/analytics/agent-labels.d.ts +3 -0
- package/dist/cli/commands/analytics/agent-labels.d.ts.map +1 -0
- package/dist/cli/commands/analytics/agent-labels.js +19 -0
- package/dist/cli/commands/analytics/agent-labels.js.map +1 -0
- package/dist/cli/commands/analytics/cost/cost-enricher.d.ts.map +1 -1
- package/dist/cli/commands/analytics/cost/cost-enricher.js +12 -0
- package/dist/cli/commands/analytics/cost/cost-enricher.js.map +1 -1
- package/dist/cli/commands/analytics/cost/types.d.ts +10 -0
- package/dist/cli/commands/analytics/cost/types.d.ts.map +1 -1
- package/dist/cli/commands/analytics/cost/usage-readers.d.ts.map +1 -1
- package/dist/cli/commands/analytics/cost/usage-readers.js +54 -0
- package/dist/cli/commands/analytics/cost/usage-readers.js.map +1 -1
- package/dist/cli/commands/analytics/formatter.d.ts.map +1 -1
- package/dist/cli/commands/analytics/formatter.js +10 -2
- package/dist/cli/commands/analytics/formatter.js.map +1 -1
- package/dist/cli/commands/analytics/index.d.ts.map +1 -1
- package/dist/cli/commands/analytics/index.js +21 -0
- package/dist/cli/commands/analytics/index.js.map +1 -1
- package/dist/cli/commands/analytics/native-loader.d.ts.map +1 -1
- package/dist/cli/commands/analytics/native-loader.js +28 -3
- package/dist/cli/commands/analytics/native-loader.js.map +1 -1
- package/dist/cli/commands/analytics/report/client/app.js +32 -14
- package/dist/cli/commands/analytics/report/payload-builder.d.ts.map +1 -1
- package/dist/cli/commands/analytics/report/payload-builder.js +7 -0
- package/dist/cli/commands/analytics/report/payload-builder.js.map +1 -1
- package/dist/cli/commands/analytics/report/types.d.ts +10 -0
- package/dist/cli/commands/analytics/report/types.d.ts.map +1 -1
- package/dist/cli/commands/install.js +2 -2
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/cli/commands/list.js +1 -1
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/proxy/connectors/desktop.d.ts.map +1 -1
- package/dist/cli/commands/proxy/connectors/desktop.js +6 -0
- package/dist/cli/commands/proxy/connectors/desktop.js.map +1 -1
- package/dist/cli/commands/proxy/connectors/vscode-models.d.ts +1 -0
- package/dist/cli/commands/proxy/connectors/vscode-models.d.ts.map +1 -1
- package/dist/cli/commands/proxy/connectors/vscode-models.js +36 -12
- package/dist/cli/commands/proxy/connectors/vscode-models.js.map +1 -1
- package/dist/cli/commands/proxy/connectors/vscode.d.ts.map +1 -1
- package/dist/cli/commands/proxy/connectors/vscode.js +3 -0
- package/dist/cli/commands/proxy/connectors/vscode.js.map +1 -1
- package/dist/cli/commands/proxy/health-check.d.ts.map +1 -1
- package/dist/cli/commands/proxy/health-check.js +9 -0
- package/dist/cli/commands/proxy/health-check.js.map +1 -1
- package/dist/cli/commands/setup.d.ts +33 -0
- package/dist/cli/commands/setup.d.ts.map +1 -1
- package/dist/cli/commands/setup.js +151 -35
- package/dist/cli/commands/setup.js.map +1 -1
- package/dist/cli/commands/uninstall.js +1 -1
- package/dist/cli/commands/uninstall.js.map +1 -1
- package/dist/cli/commands/update.js +2 -2
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/first-time.js +3 -3
- package/dist/cli/first-time.js.map +1 -1
- package/dist/providers/core/types.d.ts +28 -1
- package/dist/providers/core/types.d.ts.map +1 -1
- package/dist/providers/core/types.js.map +1 -1
- package/dist/providers/plugins/bedrock/bedrock.template.d.ts.map +1 -1
- package/dist/providers/plugins/bedrock/bedrock.template.js +21 -2
- package/dist/providers/plugins/bedrock/bedrock.template.js.map +1 -1
- package/dist/providers/plugins/litellm/litellm.setup-steps.d.ts.map +1 -1
- package/dist/providers/plugins/litellm/litellm.setup-steps.js +21 -5
- package/dist/providers/plugins/litellm/litellm.setup-steps.js.map +1 -1
- package/dist/providers/plugins/sso/proxy/plugins/codex-encrypted-content-sanitizer.plugin.d.ts +7 -6
- package/dist/providers/plugins/sso/proxy/plugins/codex-encrypted-content-sanitizer.plugin.d.ts.map +1 -1
- package/dist/providers/plugins/sso/proxy/plugins/codex-encrypted-content-sanitizer.plugin.js +13 -7
- package/dist/providers/plugins/sso/proxy/plugins/codex-encrypted-content-sanitizer.plugin.js.map +1 -1
- package/dist/providers/plugins/sso/proxy/plugins/index.js +1 -1
- package/dist/providers/plugins/sso/proxy/plugins/index.js.map +1 -1
- package/dist/providers/plugins/sso/session/processors/conversations/syncProcessor.js +3 -0
- package/dist/providers/plugins/sso/session/processors/conversations/syncProcessor.js.map +1 -1
- package/dist/providers/plugins/sso/sso.setup-steps.d.ts.map +1 -1
- package/dist/providers/plugins/sso/sso.setup-steps.js +39 -22
- package/dist/providers/plugins/sso/sso.setup-steps.js.map +1 -1
- package/dist/utils/config.d.ts +6 -2
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +30 -8
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/extensions-scan.d.ts.map +1 -1
- package/dist/utils/extensions-scan.js +59 -22
- package/dist/utils/extensions-scan.js.map +1 -1
- package/dist/utils/mcp-config.d.ts.map +1 -1
- package/dist/utils/mcp-config.js +11 -6
- package/dist/utils/mcp-config.js.map +1 -1
- package/package.json +1 -2
- package/scripts/release.sh +54 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shapes for GitHub Copilot CLI local session state.
|
|
3
|
+
*
|
|
4
|
+
* Two sources per session directory (`~/.copilot/session-state/<uuid>/`):
|
|
5
|
+
* - `workspace.yaml` — manifest; present in every session directory
|
|
6
|
+
* - `events.jsonl` — transcript; present only from the schema-bearing CLI versions
|
|
7
|
+
*
|
|
8
|
+
* The `events.jsonl` schema is undocumented by GitHub. Every field is therefore optional
|
|
9
|
+
* and every consumer must degrade rather than throw.
|
|
10
|
+
*/
|
|
11
|
+
/** Parsed `~/.copilot/session-state/<uuid>/workspace.yaml`. */
|
|
12
|
+
export interface CopilotWorkspaceManifest {
|
|
13
|
+
id: string;
|
|
14
|
+
cwd?: string;
|
|
15
|
+
gitRoot?: string;
|
|
16
|
+
repository?: string;
|
|
17
|
+
hostType?: string;
|
|
18
|
+
branch?: string;
|
|
19
|
+
name?: string;
|
|
20
|
+
/** Epoch ms. */
|
|
21
|
+
createdAt?: number;
|
|
22
|
+
/** Epoch ms. */
|
|
23
|
+
updatedAt?: number;
|
|
24
|
+
}
|
|
25
|
+
/** Raw `workspace.yaml` key shape, before camelCase normalization. */
|
|
26
|
+
export interface RawWorkspaceYaml {
|
|
27
|
+
id?: string;
|
|
28
|
+
cwd?: string;
|
|
29
|
+
git_root?: string;
|
|
30
|
+
repository?: string;
|
|
31
|
+
host_type?: string;
|
|
32
|
+
branch?: string;
|
|
33
|
+
name?: string;
|
|
34
|
+
created_at?: string;
|
|
35
|
+
updated_at?: string;
|
|
36
|
+
}
|
|
37
|
+
/** One line of `events.jsonl`. */
|
|
38
|
+
export interface CopilotEvent {
|
|
39
|
+
type?: string;
|
|
40
|
+
data?: unknown;
|
|
41
|
+
id?: string;
|
|
42
|
+
parentId?: string | null;
|
|
43
|
+
timestamp?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Per-model usage buckets exactly as Copilot writes them.
|
|
47
|
+
*
|
|
48
|
+
* These follow the OpenAI convention: `inputTokens` is INCLUSIVE of `cacheReadTokens`,
|
|
49
|
+
* and `reasoningTokens` is a subset of `outputTokens`. Copilot applies that convention to
|
|
50
|
+
* every provider it proxies, including Anthropic models. Conversion into the repository's
|
|
51
|
+
* Anthropic-convention `TokenUsage` happens in exactly one place — `readCopilotCli` in
|
|
52
|
+
* `src/cli/commands/analytics/cost/usage-readers.ts`.
|
|
53
|
+
*/
|
|
54
|
+
export interface CopilotUsageBuckets {
|
|
55
|
+
inputTokens?: number;
|
|
56
|
+
outputTokens?: number;
|
|
57
|
+
cacheReadTokens?: number;
|
|
58
|
+
cacheWriteTokens?: number;
|
|
59
|
+
reasoningTokens?: number;
|
|
60
|
+
}
|
|
61
|
+
/** `data` of a `session.shutdown` event — the authoritative per-model usage rollup. */
|
|
62
|
+
export interface CopilotShutdownData {
|
|
63
|
+
shutdownType?: string;
|
|
64
|
+
/** GitHub's actual billing unit; does not track token volume. */
|
|
65
|
+
totalPremiumRequests?: number;
|
|
66
|
+
totalApiDurationMs?: number;
|
|
67
|
+
codeChanges?: {
|
|
68
|
+
linesAdded?: number;
|
|
69
|
+
linesRemoved?: number;
|
|
70
|
+
filesModified?: string[];
|
|
71
|
+
};
|
|
72
|
+
modelMetrics?: Record<string, {
|
|
73
|
+
requests?: {
|
|
74
|
+
count?: number;
|
|
75
|
+
cost?: number;
|
|
76
|
+
};
|
|
77
|
+
usage?: CopilotUsageBuckets;
|
|
78
|
+
}>;
|
|
79
|
+
}
|
|
80
|
+
/** `data` of a `session.start` event. */
|
|
81
|
+
export interface CopilotSessionStartData {
|
|
82
|
+
sessionId?: string;
|
|
83
|
+
copilotVersion?: string;
|
|
84
|
+
producer?: string;
|
|
85
|
+
startTime?: string;
|
|
86
|
+
context?: {
|
|
87
|
+
cwd?: string;
|
|
88
|
+
gitRoot?: string;
|
|
89
|
+
branch?: string;
|
|
90
|
+
headCommit?: string;
|
|
91
|
+
repository?: string;
|
|
92
|
+
hostType?: string;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
/** `data` of an `assistant.message` event — the per-turn fallback token source. */
|
|
96
|
+
export interface CopilotAssistantMessageData {
|
|
97
|
+
messageId?: string;
|
|
98
|
+
model?: string;
|
|
99
|
+
turnId?: string;
|
|
100
|
+
/** Present per turn; sums exactly to the shutdown rollup's `outputTokens`. */
|
|
101
|
+
outputTokens?: number;
|
|
102
|
+
requestId?: string;
|
|
103
|
+
toolRequests?: Array<{
|
|
104
|
+
toolCallId?: string;
|
|
105
|
+
name?: string;
|
|
106
|
+
arguments?: unknown;
|
|
107
|
+
}>;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* `data` of a `tool.execution_start` event.
|
|
111
|
+
*
|
|
112
|
+
* The tool NAME and arguments live here only — `tool.execution_complete` carries neither,
|
|
113
|
+
* so the two events must be paired by `toolCallId` to attribute a call to a tool.
|
|
114
|
+
*/
|
|
115
|
+
export interface CopilotToolStartData {
|
|
116
|
+
toolCallId?: string;
|
|
117
|
+
toolName?: string;
|
|
118
|
+
turnId?: string;
|
|
119
|
+
arguments?: {
|
|
120
|
+
path?: string;
|
|
121
|
+
/** Present on `create`. */
|
|
122
|
+
file_text?: string;
|
|
123
|
+
/** Present on `edit`. */
|
|
124
|
+
old_str?: string;
|
|
125
|
+
new_str?: string;
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* `data` of a `tool.execution_complete` event.
|
|
130
|
+
*
|
|
131
|
+
* Outcome is the boolean `success` — there is no `status` string and no tool name.
|
|
132
|
+
*/
|
|
133
|
+
export interface CopilotToolCompleteData {
|
|
134
|
+
toolCallId?: string;
|
|
135
|
+
success?: boolean;
|
|
136
|
+
error?: unknown;
|
|
137
|
+
result?: unknown;
|
|
138
|
+
model?: string;
|
|
139
|
+
turnId?: string;
|
|
140
|
+
}
|
|
141
|
+
/** `data` of a `skill.invoked` event — feeds the report's session-source classification. */
|
|
142
|
+
export interface CopilotSkillInvokedData {
|
|
143
|
+
skill?: string;
|
|
144
|
+
name?: string;
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=copilot-cli-event-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copilot-cli-event-types.d.ts","sourceRoot":"","sources":["../../../../src/agents/plugins/copilot-cli/copilot-cli-event-types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shapes for GitHub Copilot CLI local session state.
|
|
3
|
+
*
|
|
4
|
+
* Two sources per session directory (`~/.copilot/session-state/<uuid>/`):
|
|
5
|
+
* - `workspace.yaml` — manifest; present in every session directory
|
|
6
|
+
* - `events.jsonl` — transcript; present only from the schema-bearing CLI versions
|
|
7
|
+
*
|
|
8
|
+
* The `events.jsonl` schema is undocumented by GitHub. Every field is therefore optional
|
|
9
|
+
* and every consumer must degrade rather than throw.
|
|
10
|
+
*/
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=copilot-cli-event-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copilot-cli-event-types.js","sourceRoot":"","sources":["../../../../src/agents/plugins/copilot-cli/copilot-cli-event-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Copilot CLI identifiers.
|
|
3
|
+
*
|
|
4
|
+
* These live apart from `copilot-cli.plugin.ts` so the session adapter can use them
|
|
5
|
+
* without importing the plugin, which imports the adapter — a cycle.
|
|
6
|
+
*/
|
|
7
|
+
/** Internal agent key. Disambiguates the CLI from the VS Code / JetBrains extensions. */
|
|
8
|
+
export declare const COPILOT_CLI_AGENT_NAME = "copilot-cli";
|
|
9
|
+
/** User-facing label shown in the analytics report and terminal output. */
|
|
10
|
+
export declare const COPILOT_CLI_DISPLAY_NAME = "GitHub Copilot CLI";
|
|
11
|
+
//# sourceMappingURL=copilot-cli.constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copilot-cli.constants.d.ts","sourceRoot":"","sources":["../../../../src/agents/plugins/copilot-cli/copilot-cli.constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,yFAAyF;AACzF,eAAO,MAAM,sBAAsB,gBAAgB,CAAC;AAEpD,2EAA2E;AAC3E,eAAO,MAAM,wBAAwB,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Copilot CLI identifiers.
|
|
3
|
+
*
|
|
4
|
+
* These live apart from `copilot-cli.plugin.ts` so the session adapter can use them
|
|
5
|
+
* without importing the plugin, which imports the adapter — a cycle.
|
|
6
|
+
*/
|
|
7
|
+
/** Internal agent key. Disambiguates the CLI from the VS Code / JetBrains extensions. */
|
|
8
|
+
export const COPILOT_CLI_AGENT_NAME = 'copilot-cli';
|
|
9
|
+
/** User-facing label shown in the analytics report and terminal output. */
|
|
10
|
+
export const COPILOT_CLI_DISPLAY_NAME = 'GitHub Copilot CLI';
|
|
11
|
+
//# sourceMappingURL=copilot-cli.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copilot-cli.constants.js","sourceRoot":"","sources":["../../../../src/agents/plugins/copilot-cli/copilot-cli.constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,yFAAyF;AACzF,MAAM,CAAC,MAAM,sBAAsB,GAAG,aAAa,CAAC;AAEpD,2EAA2E;AAC3E,MAAM,CAAC,MAAM,wBAAwB,GAAG,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copilot CLI storage locations.
|
|
3
|
+
*
|
|
4
|
+
* Copilot honors `COPILOT_HOME` as an override of `~/.copilot`. Discovery that ignores it
|
|
5
|
+
* silently returns zero sessions for anyone who sets it.
|
|
6
|
+
*/
|
|
7
|
+
/** `~/.copilot`, or `$COPILOT_HOME` when set. */
|
|
8
|
+
export declare function getCopilotHome(): string;
|
|
9
|
+
/** Directory holding one subdirectory per session. */
|
|
10
|
+
export declare function getCopilotSessionStateRoot(): string;
|
|
11
|
+
//# sourceMappingURL=copilot-cli.paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copilot-cli.paths.d.ts","sourceRoot":"","sources":["../../../../src/agents/plugins/copilot-cli/copilot-cli.paths.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,iDAAiD;AACjD,wBAAgB,cAAc,IAAI,MAAM,CAMvC;AAED,sDAAsD;AACtD,wBAAgB,0BAA0B,IAAI,MAAM,CAEnD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copilot CLI storage locations.
|
|
3
|
+
*
|
|
4
|
+
* Copilot honors `COPILOT_HOME` as an override of `~/.copilot`. Discovery that ignores it
|
|
5
|
+
* silently returns zero sessions for anyone who sets it.
|
|
6
|
+
*/
|
|
7
|
+
import { join } from 'path';
|
|
8
|
+
import { resolveHomeDir } from '../../../utils/paths.js';
|
|
9
|
+
/** `~/.copilot`, or `$COPILOT_HOME` when set. */
|
|
10
|
+
export function getCopilotHome() {
|
|
11
|
+
const override = process.env.COPILOT_HOME?.trim();
|
|
12
|
+
if (override) {
|
|
13
|
+
return override;
|
|
14
|
+
}
|
|
15
|
+
return resolveHomeDir('.copilot');
|
|
16
|
+
}
|
|
17
|
+
/** Directory holding one subdirectory per session. */
|
|
18
|
+
export function getCopilotSessionStateRoot() {
|
|
19
|
+
return join(getCopilotHome(), 'session-state');
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=copilot-cli.paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copilot-cli.paths.js","sourceRoot":"","sources":["../../../../src/agents/plugins/copilot-cli/copilot-cli.paths.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,iDAAiD;AACjD,MAAM,UAAU,cAAc;IAC5B,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,EAAE,CAAC;IAClD,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,OAAO,cAAc,CAAC,UAAU,CAAC,CAAC;AACpC,CAAC;AAED,sDAAsD;AACtD,MAAM,UAAU,0BAA0B;IACxC,OAAO,IAAI,CAAC,cAAc,EAAE,EAAE,eAAe,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitHub Copilot CLI — analytics-only agent plugin.
|
|
3
|
+
*
|
|
4
|
+
* CodeMie does NOT install, launch, configure, or proxy Copilot. This plugin exists solely
|
|
5
|
+
* so `AgentRegistry` can hand the analytics pipeline a `SessionAdapter`: `native-loader.ts`
|
|
6
|
+
* resolves adapters via `AgentRegistry.getAgent(name)?.getSessionAdapter?.()`, and there is
|
|
7
|
+
* no analytics-only bypass around the registry.
|
|
8
|
+
*
|
|
9
|
+
* The mutating lifecycle methods inherited from `BaseAgentAdapter` are therefore overridden
|
|
10
|
+
* to refuse. Left inherited, `install()` would npm-install `@github/copilot` and `run()`
|
|
11
|
+
* would launch it — both outside this integration's remit.
|
|
12
|
+
*/
|
|
13
|
+
import type { AgentMetadata } from '../../core/types.js';
|
|
14
|
+
import { BaseAgentAdapter } from '../../core/BaseAgentAdapter.js';
|
|
15
|
+
import type { SessionAdapter } from '../../core/session/BaseSessionAdapter.js';
|
|
16
|
+
import { COPILOT_CLI_AGENT_NAME, COPILOT_CLI_DISPLAY_NAME } from './copilot-cli.constants.js';
|
|
17
|
+
export { COPILOT_CLI_AGENT_NAME, COPILOT_CLI_DISPLAY_NAME };
|
|
18
|
+
export declare const CopilotCliPluginMetadata: AgentMetadata;
|
|
19
|
+
export declare class CopilotCliPlugin extends BaseAgentAdapter {
|
|
20
|
+
private sessionAdapter;
|
|
21
|
+
constructor();
|
|
22
|
+
getSessionAdapter(): SessionAdapter;
|
|
23
|
+
/** Refused: analytics-only. See {@link NOT_MANAGED}. */
|
|
24
|
+
install(): Promise<void>;
|
|
25
|
+
/** Refused: analytics-only. See {@link NOT_MANAGED}. */
|
|
26
|
+
uninstall(): Promise<void>;
|
|
27
|
+
/** Refused: analytics-only. See {@link NOT_MANAGED}. */
|
|
28
|
+
run(_args: string[], _env?: Record<string, string>): Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=copilot-cli.plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copilot-cli.plugin.d.ts","sourceRoot":"","sources":["../../../../src/agents/plugins/copilot-cli/copilot-cli.plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAG/E,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAE9F,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,CAAC;AAM5D,eAAO,MAAM,wBAAwB,EAAE,aAmBtC,CAAC;AAEF,qBAAa,gBAAiB,SAAQ,gBAAgB;IACpD,OAAO,CAAC,cAAc,CAA+B;;IAMrD,iBAAiB,IAAI,cAAc;IAOnC,wDAAwD;IAClD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAI9B,wDAAwD;IAClD,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAIhC,wDAAwD;IAClD,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAGzE"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitHub Copilot CLI — analytics-only agent plugin.
|
|
3
|
+
*
|
|
4
|
+
* CodeMie does NOT install, launch, configure, or proxy Copilot. This plugin exists solely
|
|
5
|
+
* so `AgentRegistry` can hand the analytics pipeline a `SessionAdapter`: `native-loader.ts`
|
|
6
|
+
* resolves adapters via `AgentRegistry.getAgent(name)?.getSessionAdapter?.()`, and there is
|
|
7
|
+
* no analytics-only bypass around the registry.
|
|
8
|
+
*
|
|
9
|
+
* The mutating lifecycle methods inherited from `BaseAgentAdapter` are therefore overridden
|
|
10
|
+
* to refuse. Left inherited, `install()` would npm-install `@github/copilot` and `run()`
|
|
11
|
+
* would launch it — both outside this integration's remit.
|
|
12
|
+
*/
|
|
13
|
+
import { BaseAgentAdapter } from '../../core/BaseAgentAdapter.js';
|
|
14
|
+
import { CopilotCliSessionAdapter } from './copilot-cli.session.js';
|
|
15
|
+
import { ConfigurationError } from '../../../utils/errors.js';
|
|
16
|
+
import { COPILOT_CLI_AGENT_NAME, COPILOT_CLI_DISPLAY_NAME } from './copilot-cli.constants.js';
|
|
17
|
+
export { COPILOT_CLI_AGENT_NAME, COPILOT_CLI_DISPLAY_NAME };
|
|
18
|
+
const NOT_MANAGED = 'GitHub Copilot CLI is not managed by CodeMie. It is supported for analytics only — ' +
|
|
19
|
+
'install and run it with the `copilot` command directly (npm package `@github/copilot`).';
|
|
20
|
+
export const CopilotCliPluginMetadata = {
|
|
21
|
+
name: COPILOT_CLI_AGENT_NAME,
|
|
22
|
+
displayName: COPILOT_CLI_DISPLAY_NAME,
|
|
23
|
+
description: 'GitHub Copilot CLI — analytics ingestion only (not managed by CodeMie)',
|
|
24
|
+
// Deliberately null, even though Copilot ships as @github/copilot. `codemie update`
|
|
25
|
+
// bypasses the adapter entirely — updateAgent() reads metadata.npmPackage and runs
|
|
26
|
+
// `npm install -g <pkg> --force`, which would overwrite the user's own Copilot install.
|
|
27
|
+
// Null makes that path fail safe ("cannot be updated") instead of destructively, as
|
|
28
|
+
// defense in depth behind the getManageableAgents() exclusion.
|
|
29
|
+
npmPackage: null,
|
|
30
|
+
cliCommand: 'copilot',
|
|
31
|
+
dataPaths: {
|
|
32
|
+
home: '.copilot',
|
|
33
|
+
},
|
|
34
|
+
// Required by AgentMetadata but inapplicable here: CodeMie never launches Copilot, so
|
|
35
|
+
// there is no environment to map and no provider to route it through.
|
|
36
|
+
envMapping: {},
|
|
37
|
+
supportedProviders: [],
|
|
38
|
+
analyticsOnly: true,
|
|
39
|
+
};
|
|
40
|
+
export class CopilotCliPlugin extends BaseAgentAdapter {
|
|
41
|
+
sessionAdapter = null;
|
|
42
|
+
constructor() {
|
|
43
|
+
super(CopilotCliPluginMetadata);
|
|
44
|
+
}
|
|
45
|
+
getSessionAdapter() {
|
|
46
|
+
if (!this.sessionAdapter) {
|
|
47
|
+
this.sessionAdapter = new CopilotCliSessionAdapter(this.metadata);
|
|
48
|
+
}
|
|
49
|
+
return this.sessionAdapter;
|
|
50
|
+
}
|
|
51
|
+
/** Refused: analytics-only. See {@link NOT_MANAGED}. */
|
|
52
|
+
async install() {
|
|
53
|
+
throw new ConfigurationError(NOT_MANAGED);
|
|
54
|
+
}
|
|
55
|
+
/** Refused: analytics-only. See {@link NOT_MANAGED}. */
|
|
56
|
+
async uninstall() {
|
|
57
|
+
throw new ConfigurationError(NOT_MANAGED);
|
|
58
|
+
}
|
|
59
|
+
/** Refused: analytics-only. See {@link NOT_MANAGED}. */
|
|
60
|
+
async run(_args, _env) {
|
|
61
|
+
throw new ConfigurationError(NOT_MANAGED);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=copilot-cli.plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copilot-cli.plugin.js","sourceRoot":"","sources":["../../../../src/agents/plugins/copilot-cli/copilot-cli.plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAElE,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAE9F,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,CAAC;AAE5D,MAAM,WAAW,GACf,qFAAqF;IACrF,yFAAyF,CAAC;AAE5F,MAAM,CAAC,MAAM,wBAAwB,GAAkB;IACrD,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,wBAAwB;IACrC,WAAW,EAAE,wEAAwE;IACrF,oFAAoF;IACpF,mFAAmF;IACnF,wFAAwF;IACxF,oFAAoF;IACpF,+DAA+D;IAC/D,UAAU,EAAE,IAAI;IAChB,UAAU,EAAE,SAAS;IACrB,SAAS,EAAE;QACT,IAAI,EAAE,UAAU;KACjB;IACD,sFAAsF;IACtF,sEAAsE;IACtE,UAAU,EAAE,EAAE;IACd,kBAAkB,EAAE,EAAE;IACtB,aAAa,EAAE,IAAI;CACpB,CAAC;AAEF,MAAM,OAAO,gBAAiB,SAAQ,gBAAgB;IAC5C,cAAc,GAA0B,IAAI,CAAC;IAErD;QACE,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAClC,CAAC;IAED,iBAAiB;QACf,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;YACzB,IAAI,CAAC,cAAc,GAAG,IAAI,wBAAwB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACpE,CAAC;QACD,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAED,wDAAwD;IACxD,KAAK,CAAC,OAAO;QACX,MAAM,IAAI,kBAAkB,CAAC,WAAW,CAAC,CAAC;IAC5C,CAAC;IAED,wDAAwD;IACxD,KAAK,CAAC,SAAS;QACb,MAAM,IAAI,kBAAkB,CAAC,WAAW,CAAC,CAAC;IAC5C,CAAC;IAED,wDAAwD;IACxD,KAAK,CAAC,GAAG,CAAC,KAAe,EAAE,IAA6B;QACtD,MAAM,IAAI,kBAAkB,CAAC,WAAW,CAAC,CAAC;IAC5C,CAAC;CACF"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copilot CLI Session Adapter.
|
|
3
|
+
*
|
|
4
|
+
* Sessions live at `~/.copilot/session-state/<uuid>/` (or `$COPILOT_HOME/...`), one
|
|
5
|
+
* directory per session, each holding a `workspace.yaml` manifest and — from the
|
|
6
|
+
* schema-bearing CLI versions — an `events.jsonl` transcript.
|
|
7
|
+
*
|
|
8
|
+
* Discovery reads only the manifest; transcripts are opened during parse, so a report run
|
|
9
|
+
* never pays to read a transcript it goes on to filter out.
|
|
10
|
+
*
|
|
11
|
+
* Modeled on `CodexSessionAdapter` (`src/agents/plugins/codex/codex.session.ts`), the
|
|
12
|
+
* closest analog — a natively-discovered JSONL agent. Discovery here is simpler: Codex
|
|
13
|
+
* walks `YYYY/MM/DD` directories and stats mtimes, whereas Copilot's flat layout plus the
|
|
14
|
+
* manifest's own timestamps make both unnecessary.
|
|
15
|
+
*/
|
|
16
|
+
import type { SessionAdapter, ParsedSession, AggregatedResult, SessionDiscoveryOptions, SessionDescriptor } from '../../core/session/BaseSessionAdapter.js';
|
|
17
|
+
import type { SessionProcessor, ProcessingContext } from '../../core/session/BaseProcessor.js';
|
|
18
|
+
import type { AgentMetadata } from '../../core/types.js';
|
|
19
|
+
export declare class CopilotCliSessionAdapter implements SessionAdapter {
|
|
20
|
+
private readonly metadata;
|
|
21
|
+
readonly agentName = "copilot-cli";
|
|
22
|
+
private processors;
|
|
23
|
+
constructor(metadata: AgentMetadata);
|
|
24
|
+
registerProcessor(processor: SessionProcessor): void;
|
|
25
|
+
/**
|
|
26
|
+
* Enumerate `session-state/<uuid>/` directories that carry a transcript, newest first.
|
|
27
|
+
*
|
|
28
|
+
* Directories without `events.jsonl` are pre-schema sessions with nothing to parse or
|
|
29
|
+
* price, and are skipped rather than surfaced as empty rows.
|
|
30
|
+
*/
|
|
31
|
+
discoverSessions(options?: SessionDiscoveryOptions): Promise<SessionDescriptor[]>;
|
|
32
|
+
/**
|
|
33
|
+
* Read `events.jsonl` into the unified `ParsedSession`.
|
|
34
|
+
*
|
|
35
|
+
* `messages` carries the RAW per-model Copilot buckets — `readCopilotCli` in
|
|
36
|
+
* `usage-readers.ts` owns the conversion into `TokenUsage`, so the OpenAI/Anthropic
|
|
37
|
+
* convention mismatch lives in exactly one place.
|
|
38
|
+
*/
|
|
39
|
+
parseSessionFile(filePath: string, sessionId: string): Promise<ParsedSession>;
|
|
40
|
+
/** Parse once, then run every registered processor in priority order. */
|
|
41
|
+
processSession(filePath: string, sessionId: string, context: ProcessingContext): Promise<AggregatedResult>;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=copilot-cli.session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copilot-cli.session.d.ts","sourceRoot":"","sources":["../../../../src/agents/plugins/copilot-cli/copilot-cli.session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,uBAAuB,EACvB,iBAAiB,EAClB,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EAElB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAmCzD,qBAAa,wBAAyB,YAAW,cAAc;IAIjD,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAHrC,QAAQ,CAAC,SAAS,iBAA0B;IAC5C,OAAO,CAAC,UAAU,CAA0B;gBAEf,QAAQ,EAAE,aAAa;IAKpD,iBAAiB,CAAC,SAAS,EAAE,gBAAgB,GAAG,IAAI;IAQpD;;;;;OAKG;IACG,gBAAgB,CAAC,OAAO,CAAC,EAAE,uBAAuB,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAuEvF;;;;;;OAMG;IACG,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAuLnF,yEAAyE;IACnE,cAAc,CAClB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,gBAAgB,CAAC;CAwC7B"}
|